blob: 8f4790a6dace3bb54e7abc81fa88aee3b11ed725 [file] [log] [blame]
Simon Huntb3656d42017-04-07 18:15:35 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
Simon Huntb3567282017-04-07 22:59:28 -07003# Creates a Europe-based topology (with regions) using ONOS null provider
Simon Huntb3656d42017-04-07 18:15:35 -07004# -----------------------------------------------------------------------------
5
6# config
7host=${1:-localhost}
8nports=24
9sleepfor=5
10
11
12### start up null provider
13onos ${host} null-simulation stop custom
14onos ${host} wipe-out please
15onos ${host} null-simulation start custom
16
17
18## unfortunately, it takes a time for the sim to start up
19# this is not ideal...
20
21echo
22echo "Sleeping while sim starts up... (${sleepfor} seconds)..."
23echo
24sleep ${sleepfor}
25
26
Simon Huntb3567282017-04-07 22:59:28 -070027###------------------------------------------------------
Simon Huntb3656d42017-04-07 18:15:35 -070028### Start by adding Country regions
29# Note that Long/Lat places region icon nicely in the country center
30
Simon Huntb3567282017-04-07 22:59:28 -070031# region-add <region-id> <region-name> <region-type> <lat/Y> <long/X> <region-master>
Simon Huntb3656d42017-04-07 18:15:35 -070032
33onos ${host} <<-EOF
34
35region-add rUK "United Kingdom" COUNTRY 52.206035 -1.310384 ${host}
36region-add rIT "Italy" COUNTRY 44.447951 11.093161 ${host}
37region-add rFR "France" COUNTRY 47.066264 2.711458 ${host}
38region-add rDE "Germany" COUNTRY 50.863152 9.761971 ${host}
39region-add rES "Spain" COUNTRY 40.416704 -3.7035824 ${host}
40
Simon Huntc4ca7102017-04-08 22:28:04 -070041region-add rMilan "Milan" METRO 45.4654 9.1859 ${host}
42
Simon Huntb3656d42017-04-07 18:15:35 -070043EOF
44
45
46###------------------------------------------------------
Simon Huntb3656d42017-04-07 18:15:35 -070047### Add layouts, associating backing regions, and optional parent.
48# layout-add <layout-id> <bg-ref> \
49# [ <region-id> <parent-layout-id> <scale> <offset-x> <offset-y> ]
50#
51
52onos ${host} <<-EOF
53
54# -- root layout
Steven Burrows67713d42017-04-11 11:35:20 -070055layout-add root @europe . . 4.66 -2562.93 -412.56
Simon Huntb3656d42017-04-07 18:15:35 -070056
57# -- layouts for top level regions
Steven Burrows67713d42017-04-11 11:35:20 -070058layout-add lUK @europe rUK root 11.63 -6652.54 -938.04
59layout-add lIT @europe rIT root 7.15 -4818.73 -1330.36
60layout-add lFR @europe rFR root 8.98 -5378.99 -1334.77
61layout-add lDE @europe rDE root 10.06 -6739.05 -1002.4
62layout-add lES @europe rES root 10.34 -5804.84 -2464.81
Simon Huntb3656d42017-04-07 18:15:35 -070063
64# -- layouts for country sub-regions
Simon Huntc4ca7102017-04-08 22:28:04 -070065layout-add lMilan +segmentRoutingTwo rMilan lIT 0.86 68.58 54.71
Simon Huntb3656d42017-04-07 18:15:35 -070066
67# -- summary of installed layouts
68layouts
Simon Huntb3656d42017-04-07 18:15:35 -070069EOF
70
Simon Huntb3567282017-04-07 22:59:28 -070071###------------------------------------------------------
72### Add devices, hosts and links for each of the regions
73
74onos ${host} <<-EOF
75
76# -- UK devices
77
78null-create-device switch London ${nports} 51.5073 -0.1276
79null-create-device switch Reading ${nports} 51.4543 -0.9781
80null-create-device switch Portsmouth ${nports} 50.8198 -1.0880
81null-create-device switch Bristol ${nports} 51.4545 -2.5879
82null-create-device switch Warrington ${nports} 53.3900 -2.5970
83null-create-device switch Leeds ${nports} 53.8008 -1.5491
84
85# -- Assign UK devices to UK region
86
87region-add-devices rUK \
88 null:0000000000000001 \
89 null:0000000000000002 \
90 null:0000000000000003 \
91 null:0000000000000004 \
92 null:0000000000000005 \
93 null:0000000000000006 \
94
95# -- UK hosts
96
97null-create-host London 192.168.1.1 51.8697 -0.0287
98null-create-host London 192.168.1.2 51.7225 0.7624
99null-create-host London 192.168.1.3 51.1437 0.4694
100
101null-create-host Bristol 192.168.1.4 51.7500 -2.6000
102
103# -- UK connectivity
104
105null-create-link direct London Reading
106null-create-link direct London Portsmouth
107null-create-link direct Reading Bristol
108null-create-link direct Portsmouth Bristol
109null-create-link direct Reading Warrington
110null-create-link direct London Leeds
111null-create-link direct Leeds Warrington
112
113# -- UK Peers
Simon Huntc4ca7102017-04-08 22:28:04 -0700114## TODO: figure out why this data isn't getting put into runtime config?!
115region-add-peer-loc rUK rES 50.4060 -3.3860
116region-add-peer-loc rUK rFR 50.4060 -1.8482
117region-add-peer-loc rUK rIT 50.4060 -0.1361
118region-add-peer-loc rUK rDE 50.4060 1.2491
Simon Huntb3567282017-04-07 22:59:28 -0700119
120
121# -- France Devices
122
123null-create-device switch Paris ${nports} 48.8566 2.3522
124null-create-device switch Lyon ${nports} 45.7640 4.8357
125null-create-device switch Bordeaux ${nports} 44.8378 -0.5792
126null-create-device switch Marseille ${nports} 43.2965 5.3698
127null-create-device switch Nice ${nports} 43.7102 7.2620
128
129# -- Assign France devices to France region
130
131region-add-devices rFR \
132 null:0000000000000007 \
133 null:0000000000000008 \
134 null:0000000000000009 \
135 null:000000000000000a \
136 null:000000000000000b \
137
138
139# -- France hosts
140
141null-create-host Paris 192.168.2.1 49.5134 2.8882
142null-create-host Lyon 192.168.2.2 46.4590 5.2380
143
144# -- France connectivity
145
146null-create-link direct Paris Lyon
147null-create-link direct Paris Bordeaux
148null-create-link direct Lyon Bordeaux
149null-create-link direct Marseille Bordeaux
150null-create-link direct Marseille Lyon
151null-create-link direct Marseille Nice
152null-create-link direct Lyon Nice
153
154# -- France Peers
155
Simon Huntc4ca7102017-04-08 22:28:04 -0700156region-add-peer-loc rFR rES 42.6806 -2.1273
157region-add-peer-loc rFR rUK 50.6164 -2.1013
158region-add-peer-loc rFR rIT 45.1105 9.7450
159region-add-peer-loc rFR rDE 49.6307 7.9326
160
161
162# -- Italy Devices
163
164# these four in a mini fabric (data center?)
165
166null-create-device switch Milan-1 ${nports} 10.0 20.0 grid
167null-create-device switch Milan-2 ${nports} 10.0 50.0 grid
168null-create-device switch Milan-3 ${nports} 45.0 20.0 grid
169null-create-device switch Milan-4 ${nports} 45.0 50.0 grid
170
171null-create-host Milan-3 192.168.3.13 60.0 15.0 grid
172null-create-host Milan-4 192.168.3.14 60.0 45.0 grid
173
174region-add-devices rMilan \
175 null:000000000000000c \
176 null:000000000000000d \
177 null:000000000000000e \
178 null:000000000000000f \
179
180null-create-device switch Venice ${nports} 45.4408 12.3155
181null-create-device switch Rome ${nports} 41.9028 12.4964
182null-create-device switch Naples ${nports} 40.8518 14.2681
183
184region-add-devices rIT \
185 null:0000000000000010 \
186 null:0000000000000011 \
187 null:0000000000000012 \
188
189# -- Italy Connectivity
190
191null-create-link direct Milan-1 Milan-3
192null-create-link direct Milan-1 Milan-4
193null-create-link direct Milan-2 Milan-3
194null-create-link direct Milan-2 Milan-4
195
196null-create-link direct Milan-1 Venice
197null-create-link direct Milan-2 Rome
198
199null-create-link direct Venice Rome
200null-create-link direct Venice Naples
201null-create-link direct Rome Naples
202
203# -- Italy Peers
204
205#region-add-peer-loc rIT rES xx.xxxx xx.xxxx
206#region-add-peer-loc rIT rUK xx.xxxx xx.xxxx
207#region-add-peer-loc rIT rFR xx.xxxx xx.xxxx
208#region-add-peer-loc rIT rDE xx.xxxx xx.xxxx
209
210# -- Germany Devices
211
212null-create-device switch Munich ${nports} 48.1351 11.5820
213null-create-device switch Berlin ${nports} 52.5200 13.4050
214null-create-device switch Bremen ${nports} 53.0793 8.8017
215null-create-device switch Frankfurt ${nports} 50.1109 8.6821
216null-create-device switch Stuttgart ${nports} 48.7758 9.1829
217
218null-create-host Munich 192.168.4.1 47.4818 11.7441
219null-create-host Berlin 192.168.4.2 53.0537 13.5310
220
221region-add-devices rDE \
222 null:0000000000000013 \
223 null:0000000000000014 \
224 null:0000000000000015 \
225 null:0000000000000016 \
226 null:0000000000000017 \
227
228# -- Germany Connectivity
229
230null-create-link direct Munich Berlin
231null-create-link direct Munich Stuttgart
232null-create-link direct Munich Stuttgart
233null-create-link direct Frankfurt Stuttgart
234null-create-link direct Frankfurt Bremen
235null-create-link direct Berlin Bremen
236null-create-link direct Berlin Frankfurt
237
238# -- Germany Peers
239
240#region-add-peer-loc rDE rES xx.xxxx xx.xxxx
241#region-add-peer-loc rDE rUK xx.xxxx xx.xxxx
242#region-add-peer-loc rDE rFR xx.xxxx xx.xxxx
243#region-add-peer-loc rDE rIT xx.xxxx xx.xxxx
244
245# -- Spain Devices
246
247null-create-device switch Madrid ${nports} 40.4168 -3.7038
248null-create-device switch Barcelona ${nports} 41.3851 2.1734
249null-create-device switch Valencia ${nports} 39.4699 -0.3763
250null-create-device switch Seville ${nports} 37.3891 -5.9845
251
252null-create-host Madrid 192.168.5.1 41.0797 -3.9559
253null-create-host Barcelona 192.168.5.2 41.8507 2.0399
254null-create-host Valencia 192.168.5.3 38.8488 -0.5097
255null-create-host Seville 192.168.5.4 38.0110 -6.4442
256
257region-add-devices rES \
258 null:0000000000000018 \
259 null:0000000000000019 \
260 null:000000000000001a \
261 null:000000000000001b \
262
263# -- Spain Connectivity
264
265null-create-link direct Barcelona Madrid
266null-create-link direct Barcelona Valencia
267null-create-link direct Seville Madrid
268null-create-link direct Seville Valencia
269null-create-link direct Madrid Valencia
270
271# -- Spain Peers
272
273#region-add-peer-loc rES rDE xx.xxxx xx.xxxx
274#region-add-peer-loc rES rUK xx.xxxx xx.xxxx
275#region-add-peer-loc rES rFR xx.xxxx xx.xxxx
276#region-add-peer-loc rES rIT xx.xxxx xx.xxxx
277
278
279# -- Inter-Region Connectivity
280
281# Spain-France
282null-create-link direct Barcelona Marseille
283null-create-link direct Madrid Bordeaux
284
285# France-Italy
286null-create-link direct Rome Nice
287null-create-link direct Milan-1 Lyon
288
289# Italy-Germany
290null-create-link direct Venice Munich
291
292# France-Germany
293null-create-link direct Lyon Stuttgart
294null-create-link direct Paris Frankfurt
295
296# England-France
297null-create-link direct Portsmouth Paris
298
299# England-Germany
300null-create-link direct London Bremen
301null-create-link direct London Frankfurt
Simon Huntb3567282017-04-07 22:59:28 -0700302
303EOF
Simon Huntb3656d42017-04-07 18:15:35 -0700304
305### Set up debug log messages for classes we care about
306onos ${host} <<-EOF
307log:set DEBUG org.onosproject.ui.impl.topo.Topo2ViewMessageHandler
308log:set DEBUG org.onosproject.ui.impl.topo.Topo2Jsonifier
309log:set DEBUG org.onosproject.ui.impl.UiWebSocket
310log:set DEBUG org.onosproject.ui.impl.UiTopoSession
311log:list
312EOF