[[PageOutline]] [wiki:GEC18Agenda/LabWikiAndOEDL/Experiment1 <-- Back to Experiment 1] | [wiki:GEC18Agenda/LabWikiAndOEDL Jump to Main Tutorial Page] | [wiki:GEC18Agenda/LabWikiAndOEDL/Experiment3 Next to Experiment 3 -->] = Experiment 2 = == Overview == == Part 1 - Design/Setup == [[Image(wiki:GENIExperimenter/Tutorials/Graphics:design_on.png, 76)]] 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 [http://en.wikipedia.org/wiki/BitTorrent 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 [http://en.wikipedia.org/wiki/BitTorrent#Operation seed], i.e. a !BitTorrent peer which has the complete video file available and shares it with others * one resource will be a [http://en.wikipedia.org/wiki/BitTorrent#Operation tracker], i.e. an entity that maintain a list of peers interested in the video file * two resources act as [http://en.wikipedia.org/wiki/BitTorrent#Operation 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. [[Image(exp2_overview.png)]] 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 == [[Image(wiki:GENIExperimenter/Tutorials/Graphics:execute_on.png, 76)]] For help on all actions regarding !LabWiki, please refer to the [wiki:GEC18Agenda/LabWikiAndOEDL/Introduction previous page] 1. First, if you have not done it yet, login into !LabWiki 2. Create a new experiment file with the name of your choice 3. Cut-and-paste the following OEDL experiment description into that file, then save it {{{ defProperty('slice', 'oedl-', "slice name") defProperty('tracker', "0", "ID of tracker node") defProperty('leecher_player', "1,2", "List of leecher/player nodes") defProperty('seeder', "5", "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 file to download' 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 |g| g.ms('video').select {[ :oml_sender_id, :oml_seq, :oml_ts_server, :i_played_video_frames ]} g.caption "VLC Player (frames played)" g.type 'line_chart3' g.mapping :x_axis => :oml_ts_server, :y_axis => :i_played_video_frames, :group_by => :oml_sender_id g.xaxis :legend => 'time [s]' g.yaxis :legend => 'Frames played', :ticks => {:format => 's'} end }}} Walk-through the above OEDL experiment description: * Here we define some experiment properties, which will allow us to parameterize the values for the slice, the resources, and the application settings used in the experiment. As mentioned earlier, these values may be customized for each experiment run. We further declare variables (internal to the experiment descriptions), which facilitate our specific use of properties within this given experiment example. {{{ defProperty('slice', 'oedl-', "slice name") ... tracker = property.tracker.to_s.split(',').map { |x| "#{x}-#{property.slice}" } ... }}} * Below we declare the applications that we will use in this experiment. The first two applications are bundles of command lines which ensure that no processes or created files from previous experiment runs remain. The third application is the !BitTorrent we use. The following application is the modified and instrumented !BitTorrent prototype which we would like to evaluate. Finally the last application is the instrumented VLC player, which we will use to assess the efficiency of the prototype. {{{ defApplication('clean_all') do |app| ... end defApplication('clean_leechers') do |app| ... end defApplication('bttrack') do |app| .. end defApplication('transmission_daemon') do |app| ... end defApplication('vlc') do |app| ... end }}} == Part 3 - Finish == [[Image(wiki:GENIExperimenter/Tutorials/Graphics:finish_on.png, 76)]] == Help & Additional Resources == ---- [wiki:GEC18Agenda/LabWikiAndOEDL/Experiment1 <-- Back to Experiment 1] | [wiki:GEC18Agenda/LabWikiAndOEDL Jump to Main Tutorial Page] | [wiki:GEC18Agenda/LabWikiAndOEDL/Experiment3 Next to Experiment 3 -->]