Changes between Version 5 and Version 6 of GEC18Agenda/LabWikiAndOEDL/Experiment2


Ignore:
Timestamp:
10/18/13 01:04:57 (10 years ago)
Author:
thierry.rakotoarivelo@nicta.com.au
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GEC18Agenda/LabWikiAndOEDL/Experiment2

    v5 v6  
    2222[[Image(exp2_overview.png)]]
    2323
     24In this experiment scenario, we will collect the following measurements:
     25 * 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
     26 * from the VLC player running on the leechers, we will collect the amount of decoded, lost and played video frame
    2427
    2528== Part 2 - Execute ==
     
    2730[[Image(wiki:GENIExperimenter/Tutorials/Graphics:execute_on.png, 76)]]
    2831
     32 For help on all actions regarding !LabWiki, please refer to the [wiki:GEC18Agenda/LabWikiAndOEDL/Introduction previous page]
     33
     34 1. First, if you have not done it yet, login into !LabWiki
     35
     36 2. Create a new experiment file with the name of your choice
     37
     38 3.  Cut-and-paste the following OEDL experiment description into that file, then save it
     39    {{{
     40defProperty('slice', 'cdw', "slice name")
     41defProperty('tracker', "1", "ID of tracker node")
     42defProperty('leecher_player', "2,3", "List of leecher/player nodes")
     43defProperty('seeder', "4", "List of seeder nodes")
     44defProperty('upload', 2500, 'Maximum torrent upload speed in kb/s')
     45
     46tracker = property.tracker.to_s.split(',').map { |x| "#{x}-#{property.slice}" }
     47leecher_player = property.leecher_player.to_s.split(',').map { |x| "#{x}-#{property.slice}" }
     48seeder = property.seeder.value.to_s.split(',').map { |x| "#{x}-#{property.slice}" }
     49allresources = tracker + leecher_player + seeder
     50
     51defApplication('clean_all') do |app|
     52  app.description = 'Some commands to ensure that we start with a clean slate'
     53  app.binary_path = 'killall -s9 bttrack transmission-daemon vlc; rm -f /root/.config/transmission-daemon/settings.json; '
     54  app.quiet = true
     55end
     56
     57defApplication('clean_leechers') do |app|
     58  app.description = 'Ensure that leechers do not have the video from a previous experiment run'
     59  app.binary_path = 'rm -f /root/Downloads/* /root/.config/transmission-daemon/resume/* /root/.config/transmission-daemon/torrents/*'
     60  app.quiet = true
     61end
     62
     63defApplication('bttrack') do |app|
     64  app.description = 'Bittornado BT tracker'
     65  app.binary_path = '/usr/bin/bttrack'
     66  app.defProperty('dfile', 'Database file', '--dfile', {:type => :string})
     67  app.defProperty('port', 'Port number', '--port', {:type => :integer}) 
     68  app.quiet = true
     69end
     70
     71defApplication('transmission_daemon') do |app|
     72  app.description = 'bittorrent client with video streaming support'
     73  app.binary_path = '/usr/local/bin/transmission-daemon'
     74  app.defProperty('foreground', 'Run in foreground', '-f', {:type => :boolean})
     75  app.quiet = true
     76  app.defMeasurement("stats") do |mp|
     77    mp.defMetric('tor_id', :int32)
     78    mp.defMetric('tor_name', :string)
     79    mp.defMetric('dl_rate', :double)
     80    mp.defMetric('ul_rate', :double)
     81    mp.defMetric('percent_done', :double)
     82  end
     83end
     84
     85defApplication('vlc') do |app|
     86  app.description = 'VideoLAN client media player'
     87  app.binary_path = 'usr/local/bin/vlc.sh'
     88  app.defProperty('vstream', 'URL to play stream from', nil, {:type => :string})
     89  app.quiet = true
     90  app.defMeasurement("video") do |mp|
     91    mp.defMetric('i_decoded_video_blocks', :int32)
     92    mp.defMetric('i_played_video_frames', :int32)
     93    mp.defMetric('i_lost_video_frames', :int32)
     94  end
     95end
     96
     97defGroup('tracker', *tracker) do |g|
     98  g.addApplication("bttrack") do |app|
     99    app.setProperty('dfile', "/tmp/dfile_#{Time.now.to_i}")
     100    app.setProperty('port', 6969)
     101  end
     102end
     103
     104defGroup('seeder', *seeder) do |g|
     105  g.addApplication("transmission_daemon") do |app|
     106    app.setProperty('foreground', true)
     107    app.measure('stats', :samples => 1)
     108  end
     109end
     110
     111defGroup('leecher', *leecher_player) do |g|
     112  g.addApplication("transmission_daemon") do |app|
     113    app.setProperty('foreground', true)
     114    app.measure('stats', :samples => 1)
     115  end
     116end
     117
     118defGroup('player', *leecher_player) do |g|
     119  g.addApplication("vlc") do |app|
     120    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")
     121    app.measure('video', :samples => 1)
     122  end
     123end
     124
     125defGroup('all_resources', *allresources) do |g|
     126  g.addApplication("clean_all")
     127end
     128
     129defGroup('all_leechers', *leecher_player) do |g|
     130  g.addApplication("clean_leechers")
     131end
     132
     133onEvent(:ALL_UP_AND_INSTALLED) do |event|
     134  group("all_leechers").startApplications
     135  group("all_resources").startApplications
     136  after 10 do
     137    info "Starting tracker"
     138    group("tracker").startApplications
     139  end
     140  after 15 do
     141   info "Starting seeders"
     142   group("seeder").startApplications
     143   info "Starting leechers"
     144   group("leecher").startApplications
     145  end
     146  after 20 do
     147    # set the upload speed limit
     148    allGroups.exec("/usr/local/bin/transmission-remote -u #{property.upload.value}")
     149  end
     150  after 25 do
     151    info "Starting players"
     152    group("player").startApplications
     153  end
     154  after 220 do
     155    group("all_resources").startApplications
     156    Experiment.done
     157  end
     158end
     159
     160defGraph 'Bittorrent' do |g|
     161  g.ms('stats').select {[ :oml_sender_id, :oml_seq, :oml_ts_server, :percent_done ]}
     162  g.caption "Bittorrent (torrent completion)"
     163  g.type 'line_chart3'
     164  g.mapping :x_axis => :oml_ts_server, :y_axis => :percent_done, :group_by => :oml_sender_id
     165  g.xaxis :legend => 'time [s]'
     166  g.yaxis :legend => 'Completion', :ticks => {:format => 's'}
     167end
     168
     169defGraph 'VLC Player' do |h|
     170  h.ms('video').select {[ :oml_sender_id, :oml_seq, :oml_ts_server, :i_played_video_frames ]}
     171  h.caption "VLC Player (frames played)"
     172  h.type 'line_chart3'
     173  h.mapping :x_axis => :oml_ts_server, :y_axis => :i_played_video_frames, :group_by => :oml_sender_id
     174  h.xaxis :legend => 'time [s]'
     175  h.yaxis :legend => 'Frames played', :ticks => {:format => 's'}
     176end
     177    }}}
    29178
    30179== Part 3 - Finish ==