wiki:GEC16Agenda/WiMAX-Tutorial/Coop/05

Version 3 (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('sender', "[13,5,8]", "List of IDs for the resources to use as senders")
defProperty('groupSize', 1, "Number of resources to put in each group of senders")
defProperty('duration',50, "Duration of experiment")
defProperty('attUrl', "http://wimaxrf:5052/wimaxrf/bs/set?dl_profile1", "URL prefix for setting MCS")
defProperty('queue-length',50, "Length to buffer for")

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|
  system("/usr/bin/wget -qO- #{property.attUrl}=13")
  wait 15
  system("/usr/bin/wget -qO- #{property.attUrl}=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
  system("/usr/bin/wget -qO- #{property.attUrl}=13")
  allGroups.stopApplications
  Experiment.done
end




Next