Internal/TrafficGenerator: wimax-tutorial2.rb

File wimax-tutorial2.rb, 1.6 KB (added by nilanjan, 13 years ago)
Line 
1defApplication('ifconfig', 'ifconfig') {|a|
2 a.name = "ifconfig"
3 a.version(0, 0, 1)
4 a.path = "/sbin/ifconfig"
5 a.defProperty('args', "Arguments for ifconfig command", nil, {:order => 1, :dynamic => false, :type => :string, :use_name => false})
6}
7defApplication('wimaxcu', 'wimaxcu') {|a|
8 a.name = "wimaxcu"
9 a.version(0, 0, 1)
10 a.path = "/usr/bin/wimaxcu"
11 a.defProperty('args', "Arguments for wimaxcu command", nil, {:order => 1, :dynamic => false, :type => :string, :use_name => false})
12}
13
14defGroup('Sender', [1,2]) { |node|
15 node.addApplication('wimaxcu') { |app|
16 app.setProperty('args','connect network 51')
17 }
18 node.addApplication("ifconfig") { |app|
19 app.setProperty('args','wmx0 10.41.17.2 netmask 255.255.0.0')
20 }
21 node.addApplication("test:app:otg2") { |app|
22 app.setProperty('udp:local_host', '10.41.17.2')
23 app.setProperty('udp:dst_host', '10.41.17.1')
24 app.setProperty('udp:dst_port', 3000)
25 app.measure('udp_out', :interval => 3)
26 }
27}
28
29
30defGroup('Receiver', [1,1]) { |node|
31 node.addApplication('wimaxcu') { |app|
32 app.setProperty('args','connect network 51')
33 }
34 node.addApplication("ifconfig") { |app|
35 app.setProperty('args','wmx0 10.41.17.1 netmask 255.255.0.0')
36 }
37 node.addApplication("test:app:otr2") { |app|
38 app.setProperty('udp:local_host', '10.41.17.1')
39 app.setProperty('udp:local_port', 3000)
40 app.measure('udp_in', :interval => 3)
41 }
42}
43
44whenAllInstalled() {|node|
45 info "Give machines some time to warm up"
46 wait 10
47 allGroups.startApplications
48 info "Collect measurements for 100 seconds"
49 wait 100
50 info "Finish it."
51 Experiment.done
52}