Version 6 (modified by 11 years ago) (diff) | ,
---|
<-- Back to Experiment 1 | Jump to Main Tutorial Page | Next to Experiment 3 -->
Experiment 2
Overview
Part 1 - Design/Setup
The goal of this second part of the tutorial is to showcase a realistic research experiment.
A researcher developed a new algorithm which allows the BitTorrent file sharing protocol to be used to stream videos. She implemented her algorithm into the popular 'transmission' BitTorrent software, and would like to evaluate that prototype.
The scenario of this simple experiment involves 4 ExoGENI virtual machine resources
- one resource will be a seed, i.e. a BitTorrent peer which has the complete video file available and shares it with others
- one resource will be a tracker, i.e. an entity that maintain a list of peers interested in the video file
- two resources act as leechers, i.e. a BitTorrent peer which are downloading the video file. These two leechers will run the modified BitTorrent transmission software, which includes the researcher's algorithm (aka SBT, Streaming BitTorrent). In addition, they will each also run a VLC player software, which will play the video as it is being received by the peer.
In this experiment scenario, we will collect the following measurements:
- from the BitTorrent transmission client running on each peer, we will collect the upload rate, the download rate, and the percentage of completion for the video file
- from the VLC player running on the leechers, we will collect the amount of decoded, lost and played video frame
Part 2 - Execute
For help on all actions regarding LabWiki, please refer to the previous page
- First, if you have not done it yet, login into LabWiki
- Create a new experiment file with the name of your choice
- Cut-and-paste the following OEDL experiment description into that file, then save it
defProperty('slice', 'cdw', "slice name") defProperty('tracker', "1", "ID of tracker node") defProperty('leecher_player', "2,3", "List of leecher/player nodes") defProperty('seeder', "4", "List of seeder nodes") defProperty('upload', 2500, 'Maximum torrent upload speed in kb/s') tracker = property.tracker.to_s.split(',').map { |x| "#{x}-#{property.slice}" } leecher_player = property.leecher_player.to_s.split(',').map { |x| "#{x}-#{property.slice}" } seeder = property.seeder.value.to_s.split(',').map { |x| "#{x}-#{property.slice}" } allresources = tracker + leecher_player + seeder defApplication('clean_all') do |app| app.description = 'Some commands to ensure that we start with a clean slate' app.binary_path = 'killall -s9 bttrack transmission-daemon vlc; rm -f /root/.config/transmission-daemon/settings.json; ' app.quiet = true end defApplication('clean_leechers') do |app| app.description = 'Ensure that leechers do not have the video from a previous experiment run' app.binary_path = 'rm -f /root/Downloads/* /root/.config/transmission-daemon/resume/* /root/.config/transmission-daemon/torrents/*' app.quiet = true end defApplication('bttrack') do |app| app.description = 'Bittornado BT tracker' app.binary_path = '/usr/bin/bttrack' app.defProperty('dfile', 'Database file', '--dfile', {:type => :string}) app.defProperty('port', 'Port number', '--port', {:type => :integer}) app.quiet = true end defApplication('transmission_daemon') do |app| app.description = 'bittorrent client with video streaming support' app.binary_path = '/usr/local/bin/transmission-daemon' app.defProperty('foreground', 'Run in foreground', '-f', {:type => :boolean}) app.quiet = true app.defMeasurement("stats") do |mp| mp.defMetric('tor_id', :int32) mp.defMetric('tor_name', :string) mp.defMetric('dl_rate', :double) mp.defMetric('ul_rate', :double) mp.defMetric('percent_done', :double) end end defApplication('vlc') do |app| app.description = 'VideoLAN client media player' app.binary_path = 'usr/local/bin/vlc.sh' app.defProperty('vstream', 'URL to play stream from', nil, {:type => :string}) app.quiet = true app.defMeasurement("video") do |mp| mp.defMetric('i_decoded_video_blocks', :int32) mp.defMetric('i_played_video_frames', :int32) mp.defMetric('i_lost_video_frames', :int32) end end defGroup('tracker', *tracker) do |g| g.addApplication("bttrack") do |app| app.setProperty('dfile', "/tmp/dfile_#{Time.now.to_i}") app.setProperty('port', 6969) end end defGroup('seeder', *seeder) do |g| g.addApplication("transmission_daemon") do |app| app.setProperty('foreground', true) app.measure('stats', :samples => 1) end end defGroup('leecher', *leecher_player) do |g| g.addApplication("transmission_daemon") do |app| app.setProperty('foreground', true) app.measure('stats', :samples => 1) end end defGroup('player', *leecher_player) do |g| g.addApplication("vlc") do |app| app.setProperty('vstream', "http://localhost:8080/big_buck_bunny_480p_stereo.avi?tor_url=http://192.168.1.1/big_buck_bunny_480p_stereo.avi.torrent") app.measure('video', :samples => 1) end end defGroup('all_resources', *allresources) do |g| g.addApplication("clean_all") end defGroup('all_leechers', *leecher_player) do |g| g.addApplication("clean_leechers") end onEvent(:ALL_UP_AND_INSTALLED) do |event| group("all_leechers").startApplications group("all_resources").startApplications after 10 do info "Starting tracker" group("tracker").startApplications end after 15 do info "Starting seeders" group("seeder").startApplications info "Starting leechers" group("leecher").startApplications end after 20 do # set the upload speed limit allGroups.exec("/usr/local/bin/transmission-remote -u #{property.upload.value}") end after 25 do info "Starting players" group("player").startApplications end after 220 do group("all_resources").startApplications Experiment.done end end defGraph 'Bittorrent' do |g| g.ms('stats').select {[ :oml_sender_id, :oml_seq, :oml_ts_server, :percent_done ]} g.caption "Bittorrent (torrent completion)" g.type 'line_chart3' g.mapping :x_axis => :oml_ts_server, :y_axis => :percent_done, :group_by => :oml_sender_id g.xaxis :legend => 'time [s]' g.yaxis :legend => 'Completion', :ticks => {:format => 's'} end defGraph 'VLC Player' do |h| h.ms('video').select {[ :oml_sender_id, :oml_seq, :oml_ts_server, :i_played_video_frames ]} h.caption "VLC Player (frames played)" h.type 'line_chart3' h.mapping :x_axis => :oml_ts_server, :y_axis => :i_played_video_frames, :group_by => :oml_sender_id h.xaxis :legend => 'time [s]' h.yaxis :legend => 'Frames played', :ticks => {:format => 's'} end
Part 3 - Finish
Help & Additional Resources
<-- Back to Experiment 1 | Jump to Main Tutorial Page | Next to Experiment 3 -->
Attachments (5)
- exp2_overview.png (71.8 KB) - added by 11 years ago.
- labwiki_exp2_4.png (277.9 KB) - added by 11 years ago.
- labwiki_exp2_5.png (292.8 KB) - added by 11 years ago.
- labwiki_exp2_1.png (118.4 KB) - added by 11 years ago.
- labwiki_exp2_3.png (180.6 KB) - added by 11 years ago.
Download all attachments as: .zip