close Warning: Can't synchronize with repository "(default)" (/common/SVN/wimax does not appear to be a Subversion repository.). Look in the Trac log for more information.

WiMAX/30/06: mclient.rb

File mclient.rb, 2.5 KB (added by Nilanjan Paul, 9 years ago)
Line 
1defProperty('nClients', 3, "Number of client nodes to use, nClients = [1..7]")
2defProperty('packetsize', 1024, "Packet size (byte) from the sender node, packetsize max = 1024")
3defProperty('bitrate', 16384, "Bitrate (bit/s) from the sender node")
4
5defApplication('ifconfig', 'ifconfig') {|a|
6 a.name = "ifconfig"
7 a.version(0, 0, 1)
8 a.path = "/sbin/ifconfig"
9 a.defProperty('args', "Arguments for ifconfig command", nil, {:order => 1, :dynamic => false, :type => :string, :use_name => false})
10}
11defApplication('wimaxcu', 'wimaxcu') {|a|
12 a.name = "wimaxcu"
13 a.version(0, 0, 1)
14 a.path = "/usr/bin/wimaxcu"
15 a.defProperty('args', "Arguments for wimaxcu command", nil, {:order => 1, :dynamic => false, :type => :string, :use_name => false})
16}
17
18defGroup('Receiver', [1,8]){ |node|
19 node.addApplication('wimaxcu') { |app|
20 app.setProperty('args','connect network 51')
21 }
22 node.addApplication("ifconfig") { |app|
23 app.setProperty('args','wmx0 10.41.14.8 netmask 255.255.0.0')
24 }
25 node.addApplication("test:app:otr2") { |app|
26 app.setProperty('udp:local_host', '10.41.14.8')
27 app.setProperty('udp:local_port', 3000)
28 app.measure('udp_in', :interval => 0.01)
29 #{ |mp|
30 # mp.filter('packet_length', 'avg', :input => 'pkt_length')
31 #}
32 }
33}
34
35(1..property.nClients).each do |a|
36 info "Group Sender: #{a.to_i}"
37 defGroup('Sender'+a.to_s, [1,a.to_i]) { |node|
38 node.addApplication('wimaxcu') { |app|
39 app.setProperty('args','connect network 51')
40 }
41 node.addApplication("ifconfig") { |app|
42 app.setProperty('args','wmx0 10.41.14.'+a.to_s+' netmask 255.255.0.0')
43 }
44 node.addApplication("test:app:otg2") { |app|
45 app.setProperty('udp:local_host', '10.41.14.'+a.to_s)
46 app.setProperty('udp:dst_host', '10.41.14.8')
47 app.setProperty('udp:dst_port', 3000)
48 app.setProperty('cbr:size',property.packetsize) # Bytes
49 app.setProperty('cbr:rate',property.bitrate) # bps
50 app.measure('udp_out', :interval => 1.0)
51 }
52 }
53end
54
55whenAllInstalled() {|node|
56 info "Give machines some time to warm up"
57 wait 5
58 allGroups.startApplications
59 info "Collect measurements for 60 seconds"
60 wait 60
61 allGroups.stopApplications
62 info "Finish it."
63 wait 7
64
65 system("cp /var/lib/oml2/#{Experiment.ID}.sq3 udp_n#{property.nClients}_p#{property.packetsize}_br#{property.bitrate}.sq3")
66# system("sqlite3 /var/lib/oml2/#{Experiment.ID}.sq3 \".dump\"")
67
68 Experiment.done
69}