1 | # MobilityFirst ORBIT Tutorial - Exercise 2
|
---|
2 | # -----------------------------------------
|
---|
3 | #
|
---|
4 | # This script executes the performance study of the MobilityFirst
|
---|
5 | # network protocol, outlined in Exercise 2 of the ORBIT tutorial.
|
---|
6 | # The 4-node topology used is the following:
|
---|
7 | #
|
---|
8 | # Host1 ------- MFR1 ---- MFR2 ------- Host2
|
---|
9 | #
|
---|
10 | # The script defines software components, including the MobilityFirst
|
---|
11 | # Router (MFR), end hosts, and the modified iperf (called mfperf), to
|
---|
12 | # measure the performance of data transfer using the MF protocol. Host1
|
---|
13 | # will run the mfperf (iperf modified to use MF sockets) as a client
|
---|
14 | # and Host2 will run as the mfperf server.
|
---|
15 | #
|
---|
16 | # Measurement data is logged by the mfperf application using OML, and
|
---|
17 | # can be retrieved and visualized through the OMF result service (see
|
---|
18 | # detailed instructions in Exercise 2 of tutorial).
|
---|
19 |
|
---|
20 | ###################
|
---|
21 | # Apps Definition #
|
---|
22 | ###################
|
---|
23 |
|
---|
24 | #We need an application to enable the monitor that reports oml stats
|
---|
25 | defApplication('MF-Router', 'router') {|app|
|
---|
26 | app.shortDescription = "Click-based MobilityFirst Core Router"
|
---|
27 | app.path = "/root/scripts/router/RWrapper.sh"
|
---|
28 | # click options
|
---|
29 | app.defProperty('num_threads', 'number of threads', "-t",{:type => :integer, :mandatory => true, :default => 4, :order => 1})
|
---|
30 | app.defProperty('ctrl_port', 'port for Click control socket', "-c",{:type => :string, :order => 2})
|
---|
31 | # click config file
|
---|
32 | app.defProperty('config_file', 'Click configuration file', "-C",{:type => :string,:mandatory=> true})
|
---|
33 | # keyword parameters used in click config file
|
---|
34 | app.defProperty('my_GUID', 'router GUID', "-m",{:type => :string, :mandatory => true})
|
---|
35 | app.defProperty('topo_file', 'path to topology file', "-f",{:type => :string, :mandatory => true})
|
---|
36 | app.defProperty('core_dev', 'core network interface', "-d",{:type => :string,:mandatory => true})
|
---|
37 | app.defProperty('GNRS_server_ip', 'IP of local GNRS server', "-s",{:type => :string,:mandatory => true})
|
---|
38 | app.defProperty('GNRS_server_port', 'Port of GNRS server', "-p",{:type => :string,:mandatory => true})
|
---|
39 | app.defProperty('GNRS_listen_ip', 'IP to listen for GNRS response', "-i",{:type => :string,:default => "0.0.0.0"})
|
---|
40 | app.defProperty('GNRS_listen_port', 'port to listen for GNRS response', "-P",{:type => :string,:default => "10001"})
|
---|
41 | app.defProperty('log_level', 'Click log level', "-l",{:type => :string,:default => "5"})
|
---|
42 | }
|
---|
43 |
|
---|
44 | #We need an application to enable the monitor that reports oml stats
|
---|
45 | defApplication('MF-Access-Router', 'access-router') {|app|
|
---|
46 | app.shortDescription = "Click-based MobilityFirst Access Router"
|
---|
47 | app.path = "/root/scripts/router/ARWrapper.sh"
|
---|
48 | # click options
|
---|
49 | app.defProperty('num_threads', 'number of threads', "-t",{:type => :integer, :mandatory => true, :default => 4, :order => 1})
|
---|
50 | app.defProperty('ctrl_port', 'port for Click control socket', "-c",{:type => :string, :order => 2})
|
---|
51 | # click config file
|
---|
52 | app.defProperty('config_file', 'Click configuration file', "-C",{:type => :string,:mandatory=> true})
|
---|
53 | # keyword parameters used in click config file
|
---|
54 | app.defProperty('my_GUID', 'router GUID', "-m",{:type => :string, :mandatory => true})
|
---|
55 | app.defProperty('topo_file', 'path to topology file', "-f",{:type => :string, :mandatory => true})
|
---|
56 | app.defProperty('core_dev', 'core network interface', "-d",{:type => :string,:mandatory => true})
|
---|
57 | app.defProperty('GNRS_server_ip', 'IP of local GNRS server', "-s",{:type => :string,:mandatory => true})
|
---|
58 | app.defProperty('GNRS_server_port', 'Port of GNRS server', "-p",{:type => :string,:mandatory => true})
|
---|
59 | app.defProperty('GNRS_listen_ip', 'IP to listen for GNRS response', "-i",{:type => :string,:default => "0.0.0.0"})
|
---|
60 | app.defProperty('GNRS_listen_port', 'port to listen for GNRS response', "-P",{:type => :string,:default => "10001"})
|
---|
61 | app.defProperty('edge_dev', 'edge network interface', "-D",{:type => :string,:mandatory => true})
|
---|
62 | app.defProperty('edge_dev_ip', 'IP assigned to edge interface', "-I",{:type => :string,:mandatory => true})
|
---|
63 | app.defProperty('virtual_topo_file', 'virtual_topo_file', "-T",{:type => :string,:mandatory => true})
|
---|
64 | app.defProperty('virtual_config_file', 'virtual_config_file', "-F",{:type => :string,:mandatory => true})
|
---|
65 | app.defProperty('virtual_service_file', 'virtual_service_file', "-S",{:type => :string,:mandatory => true})
|
---|
66 | app.defProperty('my_virtual_GUID', 'my_virtual_GUID', "-G",{:type => :string,:mandatory => true})
|
---|
67 | app.defProperty('my_virtual_network_GUID', 'my_virtual_network_GUID', "-V",{:type => :string,:mandatory => true})
|
---|
68 | app.defProperty('log_level', 'Click log level', "-l",{:type => :string,:default => "5"})
|
---|
69 | }
|
---|
70 |
|
---|
71 | #We need an application to enable the monitor that reports oml stats
|
---|
72 | defApplication('MF-Virtual-Router', 'virtual-router') {|app|
|
---|
73 | app.shortDescription = "Click-based MobilityFirst Virtual Router"
|
---|
74 | app.path = "/root/scripts/router/VRWrapper.sh"
|
---|
75 | # click options
|
---|
76 | app.defProperty('num_threads', 'number of threads', "-t",{:type => :integer, :mandatory => true, :default => 4, :order => 1})
|
---|
77 | app.defProperty('ctrl_port', 'port for Click control socket', "-c",{:type => :string, :order => 2})
|
---|
78 | # click config file
|
---|
79 | app.defProperty('config_file', 'Click configuration file', "-C",{:type => :string,:mandatory=> true})
|
---|
80 | # keyword parameters used in click config file
|
---|
81 | app.defProperty('my_GUID', 'router GUID', "-m",{:type => :string, :mandatory => true})
|
---|
82 | app.defProperty('topo_file', 'path to topology file', "-f",{:type => :string, :mandatory => true})
|
---|
83 | app.defProperty('core_dev', 'core network interface', "-d",{:type => :string,:mandatory => true})
|
---|
84 | app.defProperty('GNRS_server_ip', 'IP of local GNRS server', "-s",{:type => :string,:mandatory => true})
|
---|
85 | app.defProperty('GNRS_server_port', 'Port of GNRS server', "-p",{:type => :string,:mandatory => true})
|
---|
86 | app.defProperty('GNRS_listen_ip', 'IP to listen for GNRS response', "-i",{:type => :string,:default => "0.0.0.0"})
|
---|
87 | app.defProperty('GNRS_listen_port', 'port to listen for GNRS response', "-P",{:type => :string,:default => "10001"})
|
---|
88 | app.defProperty('virtual_topo_file', 'virtual_topo_file', "-T",{:type => :string,:mandatory => true})
|
---|
89 | app.defProperty('virtual_config_file', 'virtual_config_file', "-F",{:type => :string,:mandatory => true})
|
---|
90 | app.defProperty('virtual_service_file', 'virtual_service_file', "-S",{:type => :string,:mandatory => true})
|
---|
91 | app.defProperty('my_virtual_GUID', 'my_virtual_GUID', "-G",{:type => :string,:mandatory => true})
|
---|
92 | app.defProperty('my_virtual_network_GUID', 'my_virtual_network_GUID', "-V",{:type => :string,:mandatory => true})
|
---|
93 | app.defProperty('log_level', 'Click log level', "-l",{:type => :string,:default => "5"})
|
---|
94 | }
|
---|
95 |
|
---|
96 | defApplication('MF-GNRS', 'gnrs') {|app|
|
---|
97 | app.shortDescription = "GNRS Server"
|
---|
98 | app.path = "/root/scripts/gnrs/GNRSWrapper.sh"
|
---|
99 | app.defProperty('log4j_config_file', 'log 4j configuration file', "-d",{:type => :string, :order => 1})
|
---|
100 | app.defProperty('jar_file', 'server jar file with all dependencies', "-j" ,{:type => :string, :mandatory=> true, :default => "/usr/local/src/mobilityfirst/gnrs/jserver/target/gnrs-server-1.0.0-SNAPSHOT-jar-with-dependencies.jar", :order => 2})
|
---|
101 | app.defProperty('config_file', 'server configuration file', "-c",{:type => :string, :mandatory=> true, :order => 3})
|
---|
102 | }
|
---|
103 |
|
---|
104 | #Enable OML reporting by default
|
---|
105 | defApplication('MF-HostStack', 'hoststack') {|app|
|
---|
106 | app.shortDescription = "MF host network stack"
|
---|
107 | app.path = "/root/scripts/client/clientWrapper.sh"
|
---|
108 | app.defProperty('log_level', 'log level', nil,{:type => :string, :mandatory => true, :order => 1, :default => "-d"}) # default is 'error'
|
---|
109 | app.defProperty('config_file', 'stack configuration file', nil,{:type => :string, :mandatory => true, :order => 2})
|
---|
110 | }
|
---|
111 |
|
---|
112 | #Router monitor to report statistics
|
---|
113 | defApplication("mf_click_monitor", "mf_click_monitor") do |app|
|
---|
114 | app.shortDescription = "OML enabled statistics monitor for MobilityFirst Routers"
|
---|
115 | app.path = "/usr/local/bin/mf_click_mon"
|
---|
116 | app.defProperty('ctrl_port', 'Port for Click control socket', nil,{:type => :string, :mandatory => true, :order => 1})
|
---|
117 | app.defProperty('self-id', 'OML ID', nil,{:type => :string, :mandatory => true, :order => 2})
|
---|
118 | app.defProperty('oml-config-file', 'OML configuration file', "--oml-config",{:type => :string,:mandatory=> true})
|
---|
119 | app.defProperty('oml-domain', 'OML domain name', "--oml-domain",{:type => :string,:mandatory=> true})
|
---|
120 | end
|
---|
121 |
|
---|
122 | # defApplication('virtual-client', 'virtual-client') do |a|
|
---|
123 | # a.path = "/root/apps/virtual-client"
|
---|
124 | # a.version(1, 0, 0)
|
---|
125 | # a.shortDescription = "Virtual client application for VN experiment"
|
---|
126 | # a.description = "Virtual client application for VN experiment."
|
---|
127 | #
|
---|
128 | # a.defProperty('temp', 'Temp', '-m', {:type => :string})
|
---|
129 | # end
|
---|
130 |
|
---|
131 | # router nodes
|
---|
132 | # defTopology('router_universe') do |t|
|
---|
133 | # t.addNode(baseTopo.getNodeByIndex(1))
|
---|
134 | # t.addNode(baseTopo.getNodeByIndex(2))
|
---|
135 | # end
|
---|
136 | # routersTopo = Topology['router_universe']
|
---|
137 | #
|
---|
138 | # # host nodes
|
---|
139 | # defTopology('host_universe') do |t|
|
---|
140 | # t.addNode(baseTopo.getNodeByIndex(0))
|
---|
141 | # t.addNode(baseTopo.getNodeByIndex(3))
|
---|
142 | # end
|
---|
143 | # hostsTopo = Topology['host_universe']
|
---|
144 |
|
---|
145 | #Update with data interface making sure that routers are in spoofing mode
|
---|
146 |
|
---|
147 | # router configurations
|
---|
148 | click_log_level="1"
|
---|
149 | access_router_guid = ['10001', '50001', '50002']
|
---|
150 | access_router_node = ['node2-20.grid.orbit-lab.org', 'node10-10.grid.orbit-lab.org', 'node10-7.grid.orbit-lab.org']
|
---|
151 | virtual_router_guid = ['30001', '30002', '30003', '30004']
|
---|
152 | virtual_router_node = ['node5-1.grid.orbit-lab.org', 'node5-5.grid.orbit-lab.org', 'node6-1.grid.orbit-lab.org', 'node6-6.grid.orbit-lab.org']
|
---|
153 | core_router_guid = ['20001', '20002', '40001', '40002', '40003']
|
---|
154 | core_router_node = ['node2-19.grid.orbit-lab.org', 'node3-18.grid.orbit-lab.org', 'node7-7.grid.orbit-lab.org', 'node7-10.grid.orbit-lab.org', 'node8-3.grid.orbit-lab.org']
|
---|
155 | all_router_guid = [access_router_guid, virtual_router_guid, core_router_guid].flatten
|
---|
156 | all_router_node = [access_router_node, virtual_router_node, core_router_node].flatten
|
---|
157 | my_virtual_GUID_acc = ['701', '721', '722']
|
---|
158 | my_virtual_GUID_core = ['711', '712', '713', '714']
|
---|
159 | router_threads = 4
|
---|
160 | GNRS_listen_ip = '0.0.0.0'
|
---|
161 | GNRS_listen_port = "10001"
|
---|
162 | router_control_port = "10002"
|
---|
163 |
|
---|
164 | access_router_core_eth = ['192.168.2.1', '192.168.2.11', '192.168.2.12']
|
---|
165 | access_router_edge_eth = ['192.168.1.2', '192.168.3.2', '192.168.4.2']
|
---|
166 | access_router_edge_vlan = ['2001', '2003', '2004']
|
---|
167 | core_router_core_eth = ['192.168.2.2', '192.168.2.3', '192.168.2.8', '192.168.2.9', '192.168.2.10']
|
---|
168 | virtual_router_core_eth = ['192.168.2.4', '192.168.2.5', '192.168.2.6', '192.168.2.7']
|
---|
169 |
|
---|
170 | # GNRS configuration
|
---|
171 | GNRS_server_port = "5000"
|
---|
172 | GNRS_server_ip = '192.168.2.100'
|
---|
173 |
|
---|
174 | # GNRS configuration file
|
---|
175 | GNRS_log_file = 'file:/root/conf/virtual-demo/gnrs/single-server/log4j.xml'
|
---|
176 | GNRS_conf_file = '/root/conf/virtual-demo/gnrs/single-server/server.xml'
|
---|
177 | GNRS_jar_file = "/usr/local/src/mobilityfirst/gnrs/jserver/target/gnrs-server-1.0.0-SNAPSHOT-jar-with-dependencies.jar"
|
---|
178 | GNRS_nodes = ['node13-13.grid.orbit-lab.org']
|
---|
179 |
|
---|
180 | # host configurations
|
---|
181 | client_guid = '1'
|
---|
182 | client_node = 'node1-20.grid.orbit-lab.org'
|
---|
183 | client_eth = ['192.168.1.1']
|
---|
184 | server_guid = ['21', '22']
|
---|
185 | server_node = ['node10-11.grid.orbit-lab.org', 'node10-17.grid.orbit-lab.org']
|
---|
186 | server_eth = ['192.168.3.1', '192.168.4.1']
|
---|
187 | all_guid = [client_guid, server_guid].flatten
|
---|
188 | all_node = [client_node, server_node].flatten
|
---|
189 | all_eth = [client_eth, server_eth].flatten
|
---|
190 | log_level = '-d'
|
---|
191 |
|
---|
192 | data_netmask = '255.255.255.0'
|
---|
193 |
|
---|
194 | #GUID-based connectivity graph; enforced within the Click router
|
---|
195 | rtr_topo_file = '/root/conf/virtual-demo/router/topology'
|
---|
196 | virtual_topo_file = '/root/conf/virtual-demo/router/vtopology'
|
---|
197 | virtual_config_file = '/root/conf/virtual-demo/router/vconffile'
|
---|
198 | virtual_service_file = '/root/conf/virtual-demo/router/vservicefile'
|
---|
199 | my_virtual_network_GUID = "77777"
|
---|
200 | hoststack_conf_file = ['/root/conf/virtual-demo/client/client1.stack', '/root/conf/virtual-demo/client/server1.stack', '/root/conf/virtual-demo/client/server2.stack']
|
---|
201 |
|
---|
202 | #Click configuration file for MobilityFirst Access Router
|
---|
203 | click_core_conf = '/usr/local/src/mobilityfirst/router/click/conf/MF_Router_GNRS.click'
|
---|
204 | click_access_conf = '/usr/local/src/mobilityfirst/router/click/conf/MF_AccessVirtualRouter_GNRS.click'
|
---|
205 | click_virtual_conf = '/usr/local/src/mobilityfirst/router/click/conf/MF_VirtualRouter_GNRS.click'
|
---|
206 |
|
---|
207 | #interface Click router listens on
|
---|
208 | core_dev = 'eth0.2002'
|
---|
209 | edge_dev = ['eth0.2001', 'eth0.2003', 'eth0.2004']
|
---|
210 | client_dev = ['eth0.2001', 'eth0.2003', 'eth0.2004']
|
---|
211 |
|
---|
212 | #Create router groups
|
---|
213 | for i in 1..access_router_guid.length
|
---|
214 | defTopology("topo:access_router_#{i}") { |t|
|
---|
215 | aNode = access_router_node[i-1]
|
---|
216 | t.addNode(aNode)
|
---|
217 | info aNode, " assigned role of access router with GUID: " + access_router_guid[i-1]
|
---|
218 | }
|
---|
219 |
|
---|
220 | defGroup("access_router_#{i}", "topo:access_router_#{i}") {|node|
|
---|
221 | node.addApplication('MF-Access-Router') {|app|
|
---|
222 | app.setProperty('num_threads', router_threads)
|
---|
223 | app.setProperty('ctrl_port', router_control_port)
|
---|
224 | app.setProperty('config_file', click_access_conf)
|
---|
225 | app.setProperty('my_GUID', access_router_guid[i-1])
|
---|
226 | app.setProperty('topo_file', rtr_topo_file)
|
---|
227 | app.setProperty('core_dev', core_dev)
|
---|
228 | app.setProperty('GNRS_server_ip', GNRS_server_ip)
|
---|
229 | app.setProperty('GNRS_server_port', GNRS_server_port)
|
---|
230 | app.setProperty('GNRS_listen_ip', access_router_core_eth[i-1])
|
---|
231 | app.setProperty('GNRS_listen_port', GNRS_listen_port)
|
---|
232 | app.setProperty('edge_dev', edge_dev[i-1])
|
---|
233 | app.setProperty('edge_dev_ip', access_router_edge_eth[i-1])
|
---|
234 | app.setProperty('virtual_topo_file', virtual_topo_file)
|
---|
235 | app.setProperty('virtual_config_file', virtual_config_file)
|
---|
236 | app.setProperty('virtual_service_file', virtual_service_file)
|
---|
237 | app.setProperty('my_virtual_network_GUID', my_virtual_network_GUID)
|
---|
238 | app.setProperty('my_virtual_GUID', my_virtual_GUID_acc[i-1])
|
---|
239 | app.setProperty('log_level', click_log_level)
|
---|
240 | }
|
---|
241 |
|
---|
242 | #Interfaces are set at run time
|
---|
243 | }
|
---|
244 | end
|
---|
245 |
|
---|
246 | #Create router groups
|
---|
247 | for i in 1..core_router_guid.length
|
---|
248 | defTopology("topo:core_router_#{i}") { |t|
|
---|
249 | aNode = core_router_node[i-1]
|
---|
250 | t.addNode(aNode)
|
---|
251 | info aNode, " assigned role of core router with GUID: " + core_router_guid[i-1]
|
---|
252 | }
|
---|
253 |
|
---|
254 | defGroup("core_router_#{i}", "topo:core_router_#{i}") {|node|
|
---|
255 | node.addApplication('MF-Router') {|app|
|
---|
256 | app.setProperty('num_threads', router_threads)
|
---|
257 | app.setProperty('ctrl_port', router_control_port)
|
---|
258 | app.setProperty('config_file', click_core_conf)
|
---|
259 | app.setProperty('my_GUID', core_router_guid[i-1])
|
---|
260 | app.setProperty('topo_file', rtr_topo_file)
|
---|
261 | app.setProperty('core_dev', core_dev)
|
---|
262 | app.setProperty('GNRS_server_ip', GNRS_server_ip)
|
---|
263 | app.setProperty('GNRS_server_port', GNRS_server_port)
|
---|
264 | app.setProperty('GNRS_listen_ip', core_router_core_eth[i-1])
|
---|
265 | app.setProperty('GNRS_listen_port', GNRS_listen_port)
|
---|
266 | app.setProperty('log_level', click_log_level)
|
---|
267 | }
|
---|
268 |
|
---|
269 | #Interfaces are set at run time
|
---|
270 | }
|
---|
271 | end
|
---|
272 |
|
---|
273 | #Create router groups
|
---|
274 | for i in 1..virtual_router_guid.length
|
---|
275 | defTopology("topo:virtual_router_#{i}") { |t|
|
---|
276 | aNode = virtual_router_node[i-1]
|
---|
277 | t.addNode(aNode)
|
---|
278 | info aNode, " assigned role of virtual router with GUID: " + virtual_router_guid[i-1]
|
---|
279 | }
|
---|
280 |
|
---|
281 | defGroup("virtual_router_#{i}", "topo:virtual_router_#{i}") {|node|
|
---|
282 | node.addApplication('MF-Virtual-Router') {|app|
|
---|
283 | app.setProperty('num_threads', router_threads)
|
---|
284 | app.setProperty('ctrl_port', router_control_port)
|
---|
285 | app.setProperty('config_file', click_virtual_conf)
|
---|
286 | app.setProperty('my_GUID', virtual_router_guid[i-1])
|
---|
287 | app.setProperty('topo_file', rtr_topo_file)
|
---|
288 | app.setProperty('core_dev', core_dev)
|
---|
289 | app.setProperty('GNRS_server_ip', GNRS_server_ip)
|
---|
290 | app.setProperty('GNRS_server_port', GNRS_server_port)
|
---|
291 | app.setProperty('GNRS_listen_ip', virtual_router_core_eth[i-1])
|
---|
292 | app.setProperty('GNRS_listen_port', GNRS_listen_port)
|
---|
293 | app.setProperty('virtual_topo_file', virtual_topo_file)
|
---|
294 | app.setProperty('virtual_config_file', virtual_config_file)
|
---|
295 | app.setProperty('virtual_service_file', virtual_service_file)
|
---|
296 | app.setProperty('my_virtual_network_GUID', my_virtual_network_GUID)
|
---|
297 | app.setProperty('my_virtual_GUID', my_virtual_GUID_core[i-1])
|
---|
298 | app.setProperty('log_level', click_log_level)
|
---|
299 | }
|
---|
300 |
|
---|
301 | #Interfaces are set at run time
|
---|
302 | }
|
---|
303 | end
|
---|
304 |
|
---|
305 | for i in 1..GNRS_nodes.length
|
---|
306 | defTopology("topo:gnrs_#{i}") { |t|
|
---|
307 | aNode = GNRS_nodes[i-1]
|
---|
308 | t.addNode(aNode)
|
---|
309 | info aNode, " assigned role of GNRS"
|
---|
310 | }
|
---|
311 |
|
---|
312 | defGroup("gnrs_#{i}", "topo:gnrs_#{i}") {|node|
|
---|
313 | node.addApplication('MF-GNRS') {|app|
|
---|
314 | app.setProperty('log4j_config_file', GNRS_log_file)
|
---|
315 | app.setProperty('jar_file', GNRS_jar_file)
|
---|
316 | app.setProperty('config_file', GNRS_conf_file)
|
---|
317 | }
|
---|
318 | }
|
---|
319 | end
|
---|
320 |
|
---|
321 | #Create host groups
|
---|
322 | for i in 1..all_node.length
|
---|
323 | defTopology("topo:host_#{i}") { |t|
|
---|
324 | aNode = all_node[i-1]
|
---|
325 | t.addNode(aNode)
|
---|
326 | info aNode, " assigned role of client with GUID: " + all_guid[i-1]
|
---|
327 | }
|
---|
328 |
|
---|
329 | defGroup("host_#{i}", "topo:host_#{i}") {|node|
|
---|
330 | node.addApplication('MF-HostStack') {|app|
|
---|
331 | app.setProperty('config_file', hoststack_conf_file[i-1])
|
---|
332 | app.setProperty('log_level', log_level)
|
---|
333 | }
|
---|
334 |
|
---|
335 | #setup interfaces at run time
|
---|
336 | }
|
---|
337 | end
|
---|
338 |
|
---|
339 | oml_config_file = "/root/conf/virtual-demo/router/click-oml-config.xml"
|
---|
340 | oml_domain = "geni22VNdemo"
|
---|
341 |
|
---|
342 | #Create router groups
|
---|
343 | for i in 1..all_router_guid.length
|
---|
344 | defTopology("topo:router_monitor_#{i}") { |t|
|
---|
345 | aNode = all_router_node[i-1]
|
---|
346 | t.addNode(aNode)
|
---|
347 | info aNode, " started monitor for guid: " + all_router_guid[i-1]
|
---|
348 | }
|
---|
349 |
|
---|
350 | defGroup("router_monitor_#{i}", "topo:router_monitor_#{i}") {|node|
|
---|
351 | node.addApplication('mf_click_monitor') {|app|
|
---|
352 | app.setProperty('ctrl_port', router_control_port)
|
---|
353 | app.setProperty('self-id', all_router_guid[i-1])
|
---|
354 | app.setProperty('oml-config-file', oml_config_file)
|
---|
355 | app.setProperty('oml-domain', oml_domain)
|
---|
356 | }
|
---|
357 | }
|
---|
358 | end
|
---|
359 |
|
---|
360 | # # Configure mfperf client
|
---|
361 | # defTopology("topo:mfperf_client") { |t|
|
---|
362 | # aNode = hostsTopo.getNodeByIndex(0)
|
---|
363 | # t.addNode(aNode)
|
---|
364 | # print "Adding node: ", aNode, " as mfperf_client\n"
|
---|
365 | # }
|
---|
366 | # defGroup("mfperf_client", "topo:mfperf_client") {|node|
|
---|
367 | # node.addApplication('mfperf') {|app|
|
---|
368 | # app.setProperty('mode', 'client')
|
---|
369 | # app.setProperty('chunk_size', mfperf_initial_chunk_size)
|
---|
370 | # app.setProperty('data_rate', mfperf_initial_data_rate)
|
---|
371 | # }
|
---|
372 | # }
|
---|
373 | #
|
---|
374 | # # Configure mfperf server
|
---|
375 | # defTopology("topo:mfperf_server") { |t|
|
---|
376 | # aNode = hostsTopo.getNodeByIndex(1)
|
---|
377 | # t.addNode(aNode)
|
---|
378 | # print "Adding node: ", aNode, " as mfperf_server\n"
|
---|
379 | # }
|
---|
380 | # defGroup("", "mf:topo:mfperf_server") {|node|
|
---|
381 | # node.addApplication('mfperf') {|app|
|
---|
382 | # app.setProperty('mode', 'server')
|
---|
383 | # app.setProperty('chunk_size', mfperf_initial_chunk_size)
|
---|
384 | # app.setProperty('data_rate', mfperf_initial_data_rate)
|
---|
385 | # }
|
---|
386 | # }
|
---|
387 |
|
---|
388 | info 'Definition of resources completed'
|
---|
389 |
|
---|
390 | onEvent(:ALL_UP_AND_INSTALLED) do |event|
|
---|
391 |
|
---|
392 | info "Initializing resources"
|
---|
393 | # clean up and initialize networking for routers
|
---|
394 | for i in 1..access_router_node.length
|
---|
395 | info "Preparing resources on node " + access_router_node[i-1]
|
---|
396 | # click router cleanup
|
---|
397 | group("access_router_#{i}").exec("killall -9 click")
|
---|
398 | group("access_router_#{i}").exec("killall -9 mf_click_mon")
|
---|
399 | #setup interfaces
|
---|
400 | group("access_router_#{i}").exec("ifconfig " + core_dev + " " + access_router_core_eth[i-1] + " netmask 255.255.255.0")
|
---|
401 | group("access_router_#{i}").exec("ifconfig " + core_dev + " up")
|
---|
402 | #setup interfaces
|
---|
403 | group("access_router_#{i}").exec("ifconfig " + edge_dev[i-1] + " " + access_router_edge_eth[i-1] + " netmask 255.255.255.0")
|
---|
404 | group("access_router_#{i}").exec("ifconfig " + edge_dev[i-1] + " up")
|
---|
405 | end
|
---|
406 | # clean up and initialize networking for routers
|
---|
407 | for i in 1..core_router_node.length
|
---|
408 | info "Preparing resources on node " + core_router_node[i-1]
|
---|
409 | # click router cleanup
|
---|
410 | group("core_router_#{i}").exec("killall -9 click")
|
---|
411 | group("core_router_#{i}").exec("killall -9 mf_click_mon")
|
---|
412 | #setup interfaces
|
---|
413 | group("core_router_#{i}").exec("ifconfig " + core_dev + " " + core_router_core_eth[i-1] + " netmask 255.255.255.0")
|
---|
414 | group("core_router_#{i}").exec("ifconfig " + core_dev + " up")
|
---|
415 | end
|
---|
416 | # clean up and initialize networking for routers
|
---|
417 | for i in 1..virtual_router_node.length
|
---|
418 | info "Preparing resources on node " + virtual_router_node[i-1]
|
---|
419 | # click router cleanup
|
---|
420 | group("virtual_router_#{i}").exec("killall -9 click")
|
---|
421 | group("virtual_router_#{i}").exec("killall -9 mf_click_mon")
|
---|
422 | #setup interfaces
|
---|
423 | group("virtual_router_#{i}").exec("ifconfig " + core_dev + " " + virtual_router_core_eth[i-1] + " netmask 255.255.255.0")
|
---|
424 | group("virtual_router_#{i}").exec("ifconfig " + core_dev + " up")
|
---|
425 | end
|
---|
426 |
|
---|
427 | #clean up and initialize networking for hosts
|
---|
428 | for i in 1..all_node.length
|
---|
429 | info "Preparing resources on node " + all_node[i-1]
|
---|
430 | group("host_#{i}").exec("killall -9 mfstack")
|
---|
431 | #setup interfaces
|
---|
432 | group("host_#{i}").exec("ifconfig " + client_dev[i-1] + " " + all_eth[i-1] + " netmask 255.255.255.0")
|
---|
433 | group("host_#{i}").exec("ifconfig " + client_dev[i-1] + " up")
|
---|
434 | end
|
---|
435 |
|
---|
436 | #clean up and initialize networking for hosts
|
---|
437 | for i in 1..GNRS_nodes.length
|
---|
438 | info "Preparing resources on node " + GNRS_nodes[i-1]
|
---|
439 | group("gnrs_#{i}").exec("killall -9 java")
|
---|
440 | group("gnrs_#{i}").exec("rm -r /tmp/bdb/")
|
---|
441 | #setup interfaces
|
---|
442 | group("gnrs_#{i}").exec("ifconfig " + core_dev + " " + GNRS_server_ip + " netmask 255.255.255.0")
|
---|
443 | group("gnrs_#{i}").exec("ifconfig " + core_dev + " up")
|
---|
444 | end
|
---|
445 |
|
---|
446 | wait 10
|
---|
447 |
|
---|
448 | for i in 1..GNRS_nodes.length
|
---|
449 | info "Starting GNRS on node " + GNRS_nodes[i-1]
|
---|
450 | group("gnrs_#{i}").startApplications
|
---|
451 | end
|
---|
452 |
|
---|
453 | # bring up routers (along with gnrs servers)
|
---|
454 | info "Bringing up routers..."
|
---|
455 | for i in 1..access_router_node.length
|
---|
456 | info "Starting router " + access_router_guid[i-1] + " on node " + access_router_node[i-1]
|
---|
457 | # click router cleanup
|
---|
458 | group("access_router_#{i}").startApplications
|
---|
459 | end
|
---|
460 | for i in 1..core_router_node.length
|
---|
461 | info "Starting router " + core_router_node[i-1] + " on node " + core_router_node[i-1]
|
---|
462 | # click router cleanup
|
---|
463 | group("core_router_#{i}").startApplications
|
---|
464 | end
|
---|
465 | for i in 1..virtual_router_node.length
|
---|
466 | info "Starting router " + virtual_router_node[i-1] + " on node " + virtual_router_node[i-1]
|
---|
467 | # click router cleanup
|
---|
468 | group("virtual_router_#{i}").startApplications
|
---|
469 | end
|
---|
470 | wait 5
|
---|
471 |
|
---|
472 | info "Bringing up host stacks..."
|
---|
473 | for i in 1..all_node.length
|
---|
474 | info "Starting hoststack " + all_guid[i-1] + " on node " + all_node[i-1]
|
---|
475 | group("host_#{i}").startApplications
|
---|
476 | end
|
---|
477 |
|
---|
478 | #Starting router monitors
|
---|
479 | for i in 1..all_router_guid.length
|
---|
480 | info "Starting monitor for router " + all_router_guid[i-1]
|
---|
481 | group("router_monitor_#{i}").startApplications
|
---|
482 | end
|
---|
483 |
|
---|
484 | info "Press to Ctrl-C to kill the experiment"
|
---|
485 | while true
|
---|
486 | wait 10
|
---|
487 | end
|
---|
488 |
|
---|
489 | Experiment.done
|
---|
490 | end
|
---|