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