2 | | |
3 | | == Writing the Experiment Script == |
4 | | |
5 | | While the disk image is loading onto his nodes, he prepares an experiment script. This script describes the configuration of all the OMF-enabled resources in the experiment, and the sequence of events in the experiment. |
6 | | |
7 | | The experiment script is given here: |
8 | | |
9 | | {{{ |
10 | | #!ruby |
11 | | defProperty('hrnSuffix', ".outdoor.orbit-lab.org", "Suffix to use for the HRN of resources") |
12 | | defProperty('hrnPrefix', "node1-", "Prefix to use for the HRN of resources") |
13 | | defProperty('serverNum', "5", "Server's node number:x-y") |
14 | | defProperty('rxNum', "3", "Receiver's node number:x-y") |
15 | | defProperty('duration', 100, "Duration of experiment") |
16 | | defProperty('serverURL', "http://10.41.41.#{property.serverNum}/", "server's url") |
17 | | defProperty('inputPath', "dash_lo/www-itec.uni-klu.ac.at/ftp/datasets/mmsys12/BigBuckBunny/bunny_2s_480p_only/bunny_Desktop.mpd", "Path of the Media Presentation Description File") |
18 | | |
19 | | defGroup("Server", "#{property.hrnPrefix}#{property.serverNum}#{property.hrnSuffix}") do |node| |
20 | | node.net.e0.ip = '10.41.41.%y%' |
21 | | node.net.e0.netmask = "255.255.0.0" |
22 | | end |
23 | | |
24 | | defGroup("Receiver", "#{property.hrnPrefix}#{property.rxNum}#{property.hrnSuffix}") do |node| |
25 | | node.net.x0.profile = '51' |
26 | | node.net.x0.ip = '10.41.41.%y%' |
27 | | node.net.x0.netmask = "255.255.0.0" |
28 | | node.addApplication('vlc-dash', :id => 'vlc') do |app| |
29 | | app.setProperty('quiet', true) |
30 | | app.setProperty('play-and-exit', true) |
31 | | app.setProperty('intf', 'dummy') |
32 | | app.setProperty('redirect', true) |
33 | | app.setProperty('input', "http://10.41.41.#{property.serverNum}/#{property.inputPath}") |
34 | | app.setProperty('sout', "''#duplicate{dst=display,dst=std{access=file,mux=ts,dst=/root/#{Experiment.ID}.mp4}}''") |
35 | | app.measure('dashRateAdaptation', :samples =>1) |
36 | | app.measure('dashDlSession', :samples =>1) |
37 | | end |
38 | | node.addApplication('wmxstat_universal', :id => 'wmxstat') do |app| |
39 | | app.measure('status') |
40 | | end |
41 | | end |
42 | | |
43 | | |
44 | | |
45 | | onEvent(:ALL_UP_AND_INSTALLED) do |event| |
46 | | system("/usr/local/bin/getbsconf -i wimaxrf --oml-collect tcp:oml:3004 --oml-id console --oml-domain #{Experiment.ID}") |
47 | | wait 5 |
48 | | group("Server").exec("/etc/init.d/apache2 start") |
49 | | wait 10 |
50 | | group("Receiver").startApplication('wmxstat') |
51 | | group("Receiver").startApplication('vlc') |
52 | | wait property.duration |
53 | | group("Receiver").stopApplications |
54 | | system("/usr/bin/ssh root@#{property.hrnPrefix}#{property.rxNum} '/usr/local/bin/iput /root/#{Experiment.ID}.mp4 dash'") |
55 | | wait 10 |
56 | | group("Server").exec("/etc/init.d/apache2 stop") |
57 | | wait 10 |
58 | | Experiment.done |
59 | | end |
60 | | |
61 | | |
62 | | |
63 | | }}} |
64 | | |
65 | | [[br]] |
66 | | > '''Deconstructing the experiment script''': [[br]] |
67 | | > Every OMF-enabled node in the experiment (purple node) is represented by a "defGroup" stanza. [[br]] |
68 | | > Every OML-enabled application that runs on an OMF node is represented by an "addApplication" stanza within the "defGroup" |