32 | | |
33 | | nodes([8,8], 'receiver') {|node| |
34 | | node.image = nil |
35 | | node.prototype("test:proto:receiver" , { |
36 | | 'hostname' => '12.0.0.7', |
37 | | 'protocol' => 'udp' |
| 32 | defNodes('receiver', [7,6]) {|node| |
| 33 | node.image = nil # assume the right image to be on disk |
| 34 | node.prototype("test:proto:raw_receiver" , { |
| 35 | 'dstfilter' => '12.0.0.7', |
| 36 | 'rxdev' => 'ath0', |
| 37 | 'protocol' => 'raw' |
46 | | defNodes('receiver', [1,1]) {|node| |
47 | | node.image = nil |
48 | | node.prototype("test:proto:receiver" , { |
49 | | 'protocol' => 'udp' |
50 | | }) |
51 | | node.net.w0.mode = "managed" |
52 | | node.net.w0.ip = "12.0.0.7" |
53 | | } |
54 | | nodes([4,4], 'forwarder1') {|node| |
| 42 | defNodes('forwarder, [5,8]) {|node| |
70 | | nodes([5,5], 'forwarder2') {|node| |
71 | | node.image = nil # assume the right image to be on disk |
72 | | node.prototype("test:proto:forwarder", { |
73 | | 'protocol' => 'raw', |
74 | | 'rxdev' =>'eth2', |
75 | | 'txdev' =>'eth2', |
76 | | 'ipFilter' => '12.0.0.7', |
77 | | 'nextHopMAC' =>'00:0E:35:9E:4D:82' |
78 | | }) |
79 | | node.net.w0.mode = "ad-hoc" |
80 | | node.net.w0.type = 'a' |
81 | | # node.net.w0.essid = "mhop" |
82 | | node.net.w0.ip = "14.0.0.1" |
83 | | } |
84 | | nodes([6,6], 'forwarder3') {|node| |
85 | | node.image = nil # assume the right image to be on disk |
86 | | node.prototype("test:proto:forwarder", { |
87 | | 'protocol' => 'raw', |
88 | | 'rxdev' =>'eth2', |
89 | | 'txdev' =>'eth2', |
90 | | 'ipFilter' => '12.0.0.7', |
91 | | 'nextHopMAC' =>'00:0E:35:9E:55:7F' |
92 | | }) |
93 | | node.net.w0.mode = "ad-hoc" |
94 | | node.net.w0.type = 'a' |
95 | | # node.net.w0.essid = "mhop" |
96 | | node.net.w0.ip = "15.0.0.1" |
97 | | } |
98 | | |
99 | | nodes([7,7], 'forwarder4') {|node| |
100 | | node.image = nil # assume the right image to be on disk |
101 | | node.prototype("test:proto:forwarder", { |
102 | | 'protocol' => 'raw', |
103 | | 'rxdev' =>'eth2', |
104 | | 'txdev' =>'eth2', |
105 | | 'ipFilter' => '12.0.0.7', |
106 | | 'nextHopMAC' => '00:0E:35:9E:4D:B8' |
107 | | }) |
108 | | node.net.w0.mode = "ad-hoc" |
109 | | node.net.w0.type = 'a' |
110 | | # node.net.w0.essid = "mhop" |
111 | | node.net.w0.ip = "12.0.0.1" |
112 | | } |
113 | | whenAll("/*/*", "procs/proc/status[text()='INSTALLED.OK']") {|node| |
114 | | # |
115 | | # Start the OML Collection Server |
116 | | # |
117 | | filename = "http://console.grid.orbit-lab.org:4000/omls" |
118 | | url = "http://idb1.grid.orbit-lab.org:5001/startCollectionServer?config_file=#{filename}" |
119 | | response = Net::HTTP.get_response(URI.parse(url)) |
120 | | if (! response.kind_of? Net::HTTPSuccess) |
121 | | raise "Can't start OML Collection Server : #{response.to_s}" |
122 | | end |
| 55 | allNodes.net.w0 { |w| |
| 56 | w.essid = "helloworld" |
| 57 | } |
133 | | |
134 | | NodeSet['receiver'].startApplication('otr') |
135 | | NodeSet['forwarder1'].startApplication('otf') |
136 | | NodeSet['forwarder2'].startApplication('otf') |
137 | | NodeSet['forwarder3'].startApplication('otf') |
138 | | NodeSet['forwarder4'].startApplication('otf') |
139 | | NodeSet['sender'].startApplication('otg') |
140 | | |
141 | | # Kernel.sleep 5 |
142 | | NodeSet['sender'].send(:STDIN, 'proc/otg', 'size 1024') |
143 | | NodeSet['sender'].send(:STDIN, 'proc/otg', 'rate 5000') |
144 | | |
145 | | Kernel.sleep 60 |
146 | | NodeSet['sender'].send(:STDIN, 'proc/otg', 'exit') |
147 | | NodeSet['receiver'].send(:STDIN, 'proc/otr', 'exit') |
148 | | NodeSet['forwarder1'].send(:STDIN, 'proc/otf', 'exit') |
149 | | NodeSet['forwarder2'].send(:STDIN, 'proc/otf', 'exit') |
150 | | NodeSet['forwarder3'].send(:STDIN, 'proc/otf', 'exit') |
151 | | NodeSet['forwarder4'].send(:STDIN, 'proc/otf', 'exit') |
152 | | Kernel.sleep 10 |
153 | | |
154 | | # |
155 | | # Stop the OML Collection Server |
156 | | # |
157 | | filename = "http://console.grid.orbit-lab.org:4000/omls" |
158 | | url = "http://idb1.grid.orbit-lab.org:5001/stopCollectionServer?config_file=#{filename}" |
159 | | response = Net::HTTP.get_response(URI.parse(url)) |
160 | | if (! response.kind_of? Net::HTTPSuccess) |
161 | | raise "Can't stop OML Collection Server : #{response.to_s}" |
162 | | end |
163 | | |
164 | | |
165 | | NodeHandler.exit |
166 | | |
| 68 | Experiment.done |