'''[wiki:WiMAX/WiMAX-Tutorial/Dash/03 Previous]''' == Writing the Experiment Script == The other part of the experiment that must be installed in the OMF console is the OMF experiment script. This script describes the configuration of all the OMF-enabled resources in the experiment, and the sequence of events in the experiment. The experiment script is given here: {{{ #!ruby defProperty('hrnSuffix', ".outdoor.orbit-lab.org", "Suffix to use for the HRN of resources") defProperty('hrnPrefix', "node1-", "Prefix to use for the HRN of resources") defProperty('serverNum', "5", "Server's node number:x-y") defProperty('rxNum', "3", "Receiver's node number:x-y") defProperty('duration', 100, "Duration of experiment") defProperty('serverURL', "http://10.41.41.#{property.serverNum}/", "server's url") 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") defGroup("Server", "#{property.hrnPrefix}#{property.serverNum}#{property.hrnSuffix}") do |node| node.net.e0.ip = '10.41.41.%y%' node.net.e0.netmask = "255.255.0.0" end defGroup("Receiver", "#{property.hrnPrefix}#{property.rxNum}#{property.hrnSuffix}") do |node| node.net.x0.profile = '51' node.net.x0.ip = '10.41.41.%y%' node.net.x0.netmask = "255.255.0.0" node.addApplication('vlc-dash', :id => 'vlc') do |app| app.setProperty('quiet', true) app.setProperty('play-and-exit', true) app.setProperty('intf', 'dummy') app.setProperty('redirect', true) app.setProperty('input', "http://10.41.41.#{property.serverNum}/#{property.inputPath}") app.setProperty('sout', "''#duplicate{dst=display,dst=std{access=file,mux=ts,dst=/root/#{Experiment.ID}.mp4}}''") app.measure('dashRateAdaptation', :samples =>1) app.measure('dashDlSession', :samples =>1) end node.addApplication('wmxstat_universal', :id => 'wmxstat') do |app| app.measure('status') end end onEvent(:ALL_UP_AND_INSTALLED) do |event| system("/usr/local/bin/getbsconf -i wimaxrf --oml-collect tcp:oml:3004 --oml-id console --oml-domain #{Experiment.ID}") wait 5 group("Server").exec("/etc/init.d/apache2 start") wait 10 group("Receiver").startApplication('wmxstat') group("Receiver").startApplication('vlc') wait property.duration group("Receiver").stopApplications system("/usr/bin/ssh root@#{property.hrnPrefix}#{property.rxNum} '/usr/local/bin/iput /root/#{Experiment.ID}.mp4 dash'") wait 10 group("Server").exec("/etc/init.d/apache2 stop") wait 10 Experiment.done end }}} [[br]] > '''Deconstructing the experiment script''': [[br]] > Every OMF-enabled node in the experiment (purple node) is represented by a "defGroup" stanza. [[br]] > Every OML-enabled application that runs on an OMF node is represented by an "addApplication" stanza within the "defGroup" == Creating and Loading a Disk Image == To prepare his experiment, he loaded a baseline image onto a node on ORBIT's Outdoor. > Try it yourself another time: To load a baseline image onto a node, e.g. node1-3 on ORBIT's Outdoor, run [[br]] > {{{omf load -i baseline.ndz -t node1-3.outdoor.orbit-lab.org }}} [[br]] Then he installed all the applications he needs on the node, did any modifications necessary to the coded and saved the disk image. > Try it yourself another time: To save a disk image from a node, e.g. node1-3 on ORBIT's Outdoor, run [[br]] > {{{omf save -n node1-3.outdoor.orbit-lab.org}}} [[br]] When the image saving process concluded, it reported that his disk image had been saved and gave the name of the image. Now, when he wants to run his experiment, he will load his disk image onto the nodes he has reserved: On the client node: {{{ omf load -i gec17_dash_policy_X.ndz -t node1-3.outdoor.orbit-lab.org }}} >Note: > X is either 1, 2, or 3. Here we will implement 3 different policies. These 3 policies are hardwired to the VLC code. >So, we have created 3 different images which need to be loaded when the experimenter needs to test either of them. On the server node: {{{ omf load -i gec17_dash_apache.ndz -t node1-5.outdoor.orbit-lab.org }}} [[br]] > Tip: If any node doesn't seem to be checking in, e.g. you see output like this: [[br]] > [[br]] > {{{INFO stdlib: Waiting for nodes (Up/Down/Total): 2/1/3 - (still down: node1-5.outdoor.orbit-lab.org) [140 sec.]}}} [[br]] > [[br]] > try opening another SSH session to the outdoor console and resetting the misbehaving node: [[br]] > {{{omf tell -a reset -t node1-5.outdoor.orbit-lab.org}}} [[br]] [[br]] == Clearing Experiment Settings == In addition to loading a fresh disk image, additional steps must be taken to restore the wireless environment to its default state. These commands are run from the console on Outdoor to reset all of the base station and attenuation settings: {{{ wget -qO- "http://wimaxrf:5004/wimaxrf/bs/default" wget -qO- "http://wimaxrf:5004/wimaxrf/bs/restart" wget -qO- "http://wimaxrf:5004/wimaxrf/datapath/config/load?name=default" }}} '''[wiki:WiMAX/WiMAX-Tutorial/Dash/05 Next]'''