wiki:GENIEducation/SampleAssignments/VLCDashTutorial/Execute

Version 9 (modified by divyashri.bhat@gmail.com, 6 years ago) (diff)

--

OpenFlow Load Balancer Tutorial

Image Map

2. Implement VLC DASH Client on ExoGENI VLAN

2.1 Setup OpenFlow Switches

  • 2.1.1 Login to VM and get the public IP by executing ifconfig
  • 2.1.2 Login to nodes VM, VM-0, VM-1, VM-2 and execute the following script
    #!/bin/bash
    ovs-vsctl add-br test
    ovs-vsctl add-port test eth1
    ovs-vsctl add-port test eth2
    ovs-vsctl add-port test eth3
    ovs-vsctl set-controller test tcp:<IP.OF.CONTROLLER>:6633
    ovs-vsctl set-fail-mode test secure
    

Replace IP.OF.CONTROLLER above with the public IP address of VM.

2.2 Setup the Apache Server and host DASH Video

In this section, you will be able to install the Apache server on ExoGENI node (VM-3) by logging in and executing the following script.

The first 4 lines of this script install and setup the Apache server. The rest of the script downloads a sample DASH video from emmy9.casa.umass.edu and hosts it on the server that you just set up.

#!/bin/bash

apt-get update
apt-get -y install apache2
apt-get -y install apache2-threaded-dev

apache2ctl restart

mkdir /root/DASH_BuckBunny

curl http://emmy9.casa.umass.edu/wget_download.sh -o /root/wget_download.sh

chmod +x /root/wget_download.sh

sh /root/wget_download.sh

2.3 Install VLC Client

The actual VLC Client which requests the video can be set up using this script. For streaming this video from the Apache server and in order to instrumentize and measure the DASH bit-rate using LabWiki we need to execute the following commands.

This script needs to be executed manually to monitor the progress of VLC Client installation

#!/bin/bash

apt-get install -y --force-yes subversion
echo 'deb http://download.opensuse.org/repositories/home:cdwertmann:oml/xUbuntu_12.04/ /' >> /etc/apt/sources.list.d/oml2.list 
curl http://download.opensuse.org/repositories/home:cdwertmann:oml/xUbuntu_12.04/Release.key -o /root/Release.key
apt-key add - < /root/Release.key  

apt-get -y --force-yes update
apt-get -y --force-yes -f install
apt-get -y --force-yes install oml2

apt-get build-dep -y --force-yes vlc
cd /root/
svn co http://witestlab.poly.edu/repos/omlapps/vlc/vlc-2.1.0-git/
cd /root/vlc-2.1.0-git
apt-get install -y --force-yes liboml2-dev checkinstall build-essential cmake libtool automake autoconf git-core ffmpeg libxcb-shm0-dev libxcb-xv0-dev libx11-xcb-dev libcdparanoia-dev libcdio-paranoia-dev libcdio-cdda-dev libqt4-dev qt4-dev-tools qt4-qmake nasm yasm libasm-dev lua5.1

apt-get autoremove

./configure LIBS="-loml2" --enable-run-as-root
make
make install

2.4 Instrumentize and Measure DASH Bit-Rate using LabWiki

2.4.1 OML Script

defApplication('test:app:vlc', 'vlc') do |app|

   app.path = "/usr/local/bin/vlc" 
#   app.path = "/home/cong/work/vlc-2.1.0-git/bin/vlc-static"
   app.version(2, 1, 0)
   app.shortDescription = "VLC" 
   app.description = "VLC multimedia player and streamer" 

   app.defProperty("input", "Stream input (e.g. file or network address)", nil, 
                   {:type => :string, :dynamic => false})
#   app.defProperty("sout", "Stream output", "--sout", 
#                   {:type => :string, :dynamic => false}) 
   app.defProperty("intf", "Main interface module", "--intf",
                   {:type => :string, :dynamic => false})
#   app.defProperty("extraintf", "Extra interface module(s). Use --extraintf omlstats to enable OML", "--extraintf",
#                   {:type => :string, :dynamic => false})
 #  app.defProperty("mtu", "Specifies the MTU of the network interface", "--mtu",
#                   {:type => :string, :dynamic => false})
#   app.defProperty("quiet", " Deactivates all console messages", "--quiet",
#                   {:type => :boolean, :dynamic => false})
 #  app.defProperty("play-and-exit", "Exit VLC after playing all the items in the input stream list", "--play-and-exit",
 #                  {:type => :boolean, :dynamic => false})

   app.defMeasurement('dashRateAdaptation') do |mp|
     mp.defMetric('chosenRate_bps',:int)
     mp.defMetric('empiricalRate_bps',:int)
     mp.defMetric('decisionRate_bps',:int)
     mp.defMetric('buffer_percent',:int)
   end

   app.defMeasurement('dashDlSession') do |mp|
     mp.defMetric('chunkCount',:int)
     mp.defMetric('readSession_B',:int)
     mp.defMetric('readChunk_B',:int)
     mp.defMetric('timeSession_s',:float)
     mp.defMetric('timeChunk_s',:float)
   end
end

defProperty('theOne','Node0','ID of sender node')

#defProperty('packetsize', 128, "Packet size (byte) from the sender node")
#defProperty('bitrate', 2048, "Bitrate (bit/s) from the sender node")
#defProperty('runtime', 40, "Time in second for the experiment is to run")
defProperty('graph', true, "Display graph or not")
defProperty('duration', 100, "Duration of experiment")

defGroup('Sender',property.theOne) do |node|
  node.addApplication("test:app:vlc") do |app|
#    app.setProperty('quiet', true)
#    app.setProperty('play-and-exit', false)
    app.setProperty('intf', 'dummy')
#    app.setProperty('extraintf', 'omlstats')
    app.setProperty('input', 'http://192.168.2.53/DASH_BuckBunny/www-itec.uni-klu.ac.at/ftp/datasets/mmsys12/BigBuckBunny/bunny_2s_480p_only/bunny_Desktop.mpd')
#    app.setProperty('mtu', '1200')
    app.measure('dashDlSession', :samples =>1)
    app.measure('dashRateAdaptation', :samples =>1)
  end
end


onEvent(:ALL_UP_AND_INSTALLED) do |event|
    info "starting"
    wait 5
    allGroups.startApplications
    info "All applications started..."  
    wait property.duration
    wait 5
    allGroups.stopApplications
    info "All applications stopped." 
    Experiment.done
end

defGraph 'DashRate1' do |g|
  g.ms('dashRateAdaptation').select (:oml_seq, :decisionRate_bps)
  g.caption "Dash Rate Adaptation."
  g.type 'line_chart3'
  g.mapping :x_axis => :oml_seq, :y_axis => :decisionRate_bps
  g.xaxis :legend => 'time [s]'
  g.yaxis :legend => 'Decision Rate', :ticks => {:format => 's'}
end

defGraph 'DashRate2' do |g|
  g.ms('dashRateAdaptation').select (:oml_seq, :buffer_percent)
  g.caption "VLC Buffer Percentage."
  g.type 'line_chart3'
  g.mapping :x_axis => :oml_seq, :y_axis => :buffer_percent
  g.xaxis :legend => 'time [s]'
  g.yaxis :legend => 'Buffer Percentage ', :ticks => {:format => 's'}
end

#defGraph 'DashRate3' do |g|
#  g.ms('dashDlSession').select (:oml_seq, :timeChunk_s)
#  g.caption "read Chunk."
#  g.type 'line_chart3'
#  g.mapping :x_axis => :oml_seq, :y_axis => :timeChunk_s
#  g.xaxis :legend => 'time [s]'
#  g.yaxis :legend => 'read session [bps] ', :ticks => {:format => 's'}
#end

2.4.2 Execute Script

Load the script vlc.oedl from the Prepare window.

Image(vlcscr1.png)?

Click and Drag the script Icon over to the Execute panel

Change the property to reflect your slicename, inside-<slicename>

Image(vlcscr2.png)?

2.4.3 View Results in iRODs

Attachments (6)