blob: 37f500a8b5648b1d8ea764b3ccb10f9eb6f65f2d [file] [log] [blame]
Simon Huntb3656d42017-04-07 18:15:35 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Creates a replica of the GEANT topology using ONOS null provider
4# -----------------------------------------------------------------------------
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
27### Start by adding Country regions
28# Note that Long/Lat places region icon nicely in the country center
29
30# region-add <region-id> <region-name> <region-type> <long/Y> <lat/X> <region-master>
31
32onos ${host} <<-EOF
33
34region-add rUK "United Kingdom" COUNTRY 52.206035 -1.310384 ${host}
35region-add rIT "Italy" COUNTRY 44.447951 11.093161 ${host}
36region-add rFR "France" COUNTRY 47.066264 2.711458 ${host}
37region-add rDE "Germany" COUNTRY 50.863152 9.761971 ${host}
38region-add rES "Spain" COUNTRY 40.416704 -3.7035824 ${host}
39
40EOF
41
42
43###------------------------------------------------------
44###----- TEMPORARY DATA ---------------------------------
45
46#region-add rLON "London" COUNTRY 51.507321 -0.1276473 ${host}
47#region-add rMIL "Milan" COUNTRY 45.466797 9.1904984 ${host}
48#region-add rPAR "Paris" COUNTRY 48.856610 2.3514992 ${host}
49#region-add rFRA "Frankfurt" COUNTRY 50.110652 8.6820934 ${host}
50#region-add rMAD "Madrid" COUNTRY 40.416704 -3.7035824 ${host}
51
52# null-create-device switch LON ${nports} 51.507321 -0.1276473
53# null-create-device switch PAR ${nports} 48.856610 2.3514992
54# null-create-device switch MIL ${nports} 45.466797 9.1904984
55# null-create-device switch FRA ${nports} 50.110652 8.6820934
56# null-create-device switch MAD ${nports} 40.416704 -3.7035824
57
58###------------------------------------------------------
59
60
61### Add layouts, associating backing regions, and optional parent.
62# layout-add <layout-id> <bg-ref> \
63# [ <region-id> <parent-layout-id> <scale> <offset-x> <offset-y> ]
64#
65
66onos ${host} <<-EOF
67
68# -- root layout
69layout-add root @europe . . 6.664 -2992.552 -2473.084
70
71# -- layouts for top level regions
72layout-add lUK @europe rUK root 13.99 -6233.775 -5111.723
73layout-add lIT @europe rIT root 14.72 -7793.210 -6623.814
74layout-add lFR @europe rFR root 16.91 -8225.716 -7198.134
75layout-add lDE @europe rDE root 17.63 -9119.646 -7044.949
76layout-add lES @europe rES root 21.41 -9994.596 -10135.655
77
78# -- layouts for country sub-regions
79# TODO
80
81# -- summary of installed layouts
82layouts
83
84EOF
85
86
87### Set up debug log messages for classes we care about
88onos ${host} <<-EOF
89log:set DEBUG org.onosproject.ui.impl.topo.Topo2ViewMessageHandler
90log:set DEBUG org.onosproject.ui.impl.topo.Topo2Jsonifier
91log:set DEBUG org.onosproject.ui.impl.UiWebSocket
92log:set DEBUG org.onosproject.ui.impl.UiTopoSession
93log:list
94EOF