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/07: gec13-tut02.rb

File gec13-tut02.rb, 3.6 KB (added by Nilanjan Paul, 12 years ago)
Line 
1defProperty('res1', "node1-1.outdoor.orbit-lab.org", "ID of a node")
2defProperty('res2', "node1-2.outdoor.orbit-lab.org", "ID of a node")
3
4defGroup('first_node', property.res1) do |node|
5 node.net.x0.profile = '51'
6 node.net.x0.ip = "10.41.14.%y%"
7 node.net.x0.netmask = "255.255.0.0"
8
9 node.addApplication("test:app:wimaxcu_app") do |app|
10 app.measure('status_link')
11 end
12 node.addApplication("test:app:iperf") do |app|
13 app.setProperty('udp', true)
14 app.setProperty('server', true)
15 app.setProperty('port', 23456)
16 app.setProperty('interval', "1")
17 app.setProperty('bind', "10.41.14.1")
18 app.measure('UDP_Rich_Info', :samples =>1)
19 end
20end
21
22defGroup('second_node', property.res2) do |node|
23 node.net.x0.profile = '51'
24 node.net.x0.ip = "10.41.14.%y%"
25 node.net.x0.netmask = "255.255.0.0"
26
27 node.addApplication("test:app:wimaxcu_app") do |app|
28 app.measure('status_link')
29 end
30 node.addApplication("test:app:iperf") do |app|
31 app.setProperty('udp', true)
32 app.setProperty('server', true)
33 app.setProperty('port', 23456)
34 app.setProperty('interval', "1")
35 app.setProperty('bind', "10.41.14.2")
36 app.measure('UDP_Rich_Info', :samples =>1)
37 end
38end
39
40onEvent(:ALL_UP_AND_INSTALLED) do |event|
41 wait 10
42 allGroups.startApplications
43 wait 50
44 allGroups.stopApplications
45 Experiment.done
46end
47
48addTab(:defaults)
49addTab(:graph2) do |tab|
50 opts = { :postfix => %{This graph shows the Received Signal Strength (RSSI) on the WiMAX link.}, :updateEvery => 1 }
51 tab.addGraph("WiMAX Downlink RSSI (dBm)", opts) do |g|
52 data = Hash.new
53 index = 1
54 mpIn = ms('status_link')
55 mpIn.project(:oml_ts_server, :oml_sender_id, :rssi).each do |sample|
56 time, src, rssi = sample.tuple
57 if data[src].nil?
58 data[src] = [index,[]]
59 index += 1
60 end
61 data[src][1] << [time, rssi]
62 end
63 data.each do |src,value|
64 g.addLine(value[1], :label => "#{value[0]}")
65 end
66 end
67 opts = { :postfix => %{This graph shows the Carrier-to-Interference+Noise Ratio (CINR) on the WiMAX link.}, :updateEvery => 1 }
68 tab.addGraph("WiMAX Downlink CINR (dB)", opts) do |g|
69 data = Hash.new
70 index = 1
71 mpIn = ms('status_link')
72 mpIn.project(:oml_ts_server, :oml_sender_id, :cinr).each do |sample|
73 time, src, rssi = sample.tuple
74 if data[src].nil?
75 data[src] = [index,[]]
76 index += 1
77 end
78 data[src][1] << [time, rssi]
79 end
80 data.each do |src,value|
81 g.addLine(value[1], :label => "#{value[0]}")
82 end
83 end
84 opts = { :postfix => %{This graph shows the UDP Packet Loss Ratio measured by iperf.}, :updateEvery => 1 }
85 tab.addGraph("UDP packet loss (%)", opts) do |g|
86 data = Hash.new
87 index = 1
88 mpIn = ms('UDP_Rich_Info')
89 mpIn.project(:oml_ts_server, :oml_sender_id, :PLR).each do |sample|
90 time, src, plr = sample.tuple
91 if plr > 100
92 plr = 0
93 end
94 if data[src].nil?
95 data[src] = [index,[]]
96 index += 1
97 end
98 data[src][1] << [time, plr]
99 end
100 data.each do |src,value|
101 g.addLine(value[1], :label => "#{value[0]}")
102 end
103 end
104 opts = { :postfix => %{This graph shows throughput measured by iperf.}, :updateEvery => 1 }
105 tab.addGraph("UDP throughput (bytes)", opts) do |g|
106 data = Hash.new
107 index = 1
108 mpIn = ms('UDP_Rich_Info')
109 mpIn.project(:oml_ts_server, :oml_sender_id, :Bandwidth).each do |sample|
110 time, src, bw = sample.tuple
111 if data[src].nil?
112 data[src] = [index,[]]
113 index += 1
114 end
115 data[src][1] << [time, bw]
116 end
117 data.each do |src,value|
118 g.addLine(value[1], :label => "#{value[0]}")
119 end
120 end
121end
122