16 | | Paste ED file here! |
| 16 | defProperty('hrnPrefix', "omf.witest.node", "Prefix to use for the HRN of resources") |
| 17 | defProperty('sender', "[13,5,8]", "List of IDs for the resources to use as senders") |
| 18 | defProperty('groupSize', 1, "Number of resources to put in each group of senders") |
| 19 | defProperty('duration',50, "Duration of experiment") |
| 20 | defProperty('attUrl', "http://wimaxrf:5052/wimaxrf/bs/set?dl_profile1", "URL prefix for setting MCS") |
| 21 | defProperty('queue-length',50, "Length to buffer for") |
| 22 | |
| 23 | groupList = [] |
| 24 | res = eval(property.sender.value) |
| 25 | groupNumber = res.size >= property.groupSize ? (res.size.to_f / property.groupSize.value.to_f).ceil : 1 |
| 26 | (1..groupNumber).each do |i| |
| 27 | list = [] |
| 28 | (1..property.groupSize).each do |j| popped = res.pop ; list << popped if !popped.nil? end |
| 29 | senderNames = list.collect do |id| "#{property.hrnPrefix}#{id}" end |
| 30 | senders = senderNames.join(',') |
| 31 | |
| 32 | info "Group Receiver #{i}: '#{senders}'" |
| 33 | groupList << "Receiver#{i}" |
| 34 | defGroup("Receiver#{i}", senders) do |node| |
| 35 | node.net.x0.profile = '51' |
| 36 | node.net.x0.ip = "128.238.38.%y%" |
| 37 | node.net.x0.netmask = "255.255.255.0" |
| 38 | node.net.w0.mode = "adhoc" |
| 39 | node.net.w0.type = 'g' |
| 40 | node.net.w0.channel = "6" |
| 41 | node.net.w0.essid = "witest" |
| 42 | node.net.w0.ip = "192.168.0.%y%" |
| 43 | node.net.w0.netmask = "255.255.255.0" |
| 44 | node.addApplication("wmxstat_universal") do |app| |
| 45 | app.measure('status') |
| 46 | end |
| 47 | node.addApplication("test:app:iperf") do |app| |
| 48 | app.setProperty('udp', true) |
| 49 | app.setProperty('server', true) |
| 50 | app.setProperty('port', 12345) |
| 51 | app.setProperty('interval', 1) |
| 52 | app.measure('UDP_Rich_Info', :samples =>1) |
| 53 | end |
| 54 | node.addApplication("coopshim") do |app| |
| 55 | app.setProperty('queue-length', "#{property.queue-length}") |
| 56 | app.measure('req', :samples =>1) |
| 57 | app.measure('recv', :samples =>1) |
| 58 | app.measure('sent', :samples =>1) |
| 59 | end |
| 60 | |
| 61 | end |
| 62 | end |
| 63 | |
| 64 | onEvent(:ALL_UP_AND_INSTALLED) do |event| |
| 65 | system("/usr/bin/wget -qO- #{property.attUrl}=13") |
| 66 | wait 15 |
| 67 | system("/usr/bin/wget -qO- #{property.attUrl}=21") |
| 68 | allGroups.startApplications |
| 69 | wait property.duration |
| 70 | wait 10 |
| 71 | system("/usr/bin/wget -qO- #{property.attUrl}=13") |
| 72 | allGroups.stopApplications |
| 73 | Experiment.done |
| 74 | end |
| 75 | |