wiki:GEC16Agenda/WiMAX-Tutorial/Coop/05

Version 4 (modified by Fraida Fund, 6 years ago) (diff)

--

Previous

Writing the Experiment Script

Once all of the OMF application wrappers are installed on the OMF EC console, we can prepare the experiment script:


Deconstructing the experiment script:
Every OMF-enabled node in the experiment (purple node) is represented by a "defGroup" stanza.
Every OML-enabled application that runs on an OMF node is represented by an "addApplication" stanza within the "defGroup"


defProperty('hrnPrefix', "omf.witest.node", "Prefix to use for the HRN of resources")
defProperty('nodeList', "13,4,6", "List of IDs for the resources to use as senders")
defProperty('duration',50, "Duration of experiment")
defProperty('mcsUrl', "http://wimaxrf:5052/wimaxrf/bs/set?dl_profile1", "URL prefix for setting MCS")
defProperty('queue',50, "Length to buffer for")

property.nodeList.value.split(",").each do |i|
  defGroup("Receiver#{i}", "#{property.hrnPrefix}#{i}") do |node|

groupList = []
res = eval(property.sender.value)
groupNumber = res.size >= property.groupSize ? (res.size.to_f / property.groupSize.value.to_f).ceil : 1
(1..groupNumber).each do |i|
  list = []
  (1..property.groupSize).each do |j| popped = res.pop ; list << popped if !popped.nil?  end
  senderNames = list.collect do |id| "#{property.hrnPrefix}#{id}" end
  senders = senderNames.join(',')

  info "Group Receiver #{i}: '#{senders}'"
  groupList << "Receiver#{i}"
  defGroup("Receiver#{i}", senders) do |node|
    node.net.x0.profile = '51'
    node.net.x0.ip = "128.238.38.%y%"
    node.net.x0.netmask = "255.255.255.0"
    node.net.w0.mode = "adhoc"
    node.net.w0.type = 'g'
    node.net.w0.channel = "6"
    node.net.w0.essid = "witest"
    node.net.w0.ip = "192.168.0.%y%"
    node.net.w0.netmask = "255.255.255.0"
    node.addApplication("wmxstat_universal") do |app|
      app.measure('status_link')
    end
    node.addApplication("test:app:iperf") do |app|
      app.setProperty('udp', true)
      app.setProperty('server', true)
      app.setProperty('port', 12345)
      app.setProperty('interval', 1)
      app.measure('UDP_Rich_Info', :samples =>1)
    end
    node.addApplication("coopshim") do |app|
      app.setProperty('queue-length', "#{property.queue-length}")
      app.measure('req', :samples =>1)
      app.measure('recv', :samples =>1)
      app.measure('sent', :samples =>1)
    end

  end
end

onEvent(:ALL_UP_AND_INSTALLED) do |event|
  # Setting a QPSK modulation so clients will connect, even with a poor signal
  system("/usr/bin/wget -qO- #{property.mcsUrl}=13")
  wait 15
  # Setting a 64QAM modulation so that we can test the application where some clients
  # have a great deal of packet loss
  system("/usr/bin/wget -qO- #{property.mcsUrl}=21")
  system("/home/#{ENV['USER']}/getbsconf -i wimaxrf --oml-server tcp:localhost:3003 --oml-id console --oml-exp-id #{Experiment.ID}")
  allGroups.startApplications
  wait property.duration
  wait 10
  # Restore QPSK modulation
  system("/usr/bin/wget -qO- #{property.mcsUrl}=13")
  allGroups.stopApplications
  Experiment.done
end




Next