Simon Hunt | b3656d4 | 2017-04-07 18:15:35 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Creates a replica of the GEANT topology using ONOS null provider |
| 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 |
| 19 | # this is not ideal... |
| 20 | |
| 21 | echo |
| 22 | echo "Sleeping while sim starts up... (${sleepfor} seconds)..." |
| 23 | echo |
| 24 | sleep ${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 | |
| 32 | onos ${host} <<-EOF |
| 33 | |
| 34 | region-add rUK "United Kingdom" COUNTRY 52.206035 -1.310384 ${host} |
| 35 | region-add rIT "Italy" COUNTRY 44.447951 11.093161 ${host} |
| 36 | region-add rFR "France" COUNTRY 47.066264 2.711458 ${host} |
| 37 | region-add rDE "Germany" COUNTRY 50.863152 9.761971 ${host} |
| 38 | region-add rES "Spain" COUNTRY 40.416704 -3.7035824 ${host} |
| 39 | |
| 40 | EOF |
| 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 | |
| 66 | onos ${host} <<-EOF |
| 67 | |
| 68 | # -- root layout |
| 69 | layout-add root @europe . . 6.664 -2992.552 -2473.084 |
| 70 | |
| 71 | # -- layouts for top level regions |
| 72 | layout-add lUK @europe rUK root 13.99 -6233.775 -5111.723 |
| 73 | layout-add lIT @europe rIT root 14.72 -7793.210 -6623.814 |
| 74 | layout-add lFR @europe rFR root 16.91 -8225.716 -7198.134 |
| 75 | layout-add lDE @europe rDE root 17.63 -9119.646 -7044.949 |
| 76 | layout-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 |
| 82 | layouts |
| 83 | |
| 84 | EOF |
| 85 | |
| 86 | |
| 87 | ### Set up debug log messages for classes we care about |
| 88 | onos ${host} <<-EOF |
| 89 | log:set DEBUG org.onosproject.ui.impl.topo.Topo2ViewMessageHandler |
| 90 | log:set DEBUG org.onosproject.ui.impl.topo.Topo2Jsonifier |
| 91 | log:set DEBUG org.onosproject.ui.impl.UiWebSocket |
| 92 | log:set DEBUG org.onosproject.ui.impl.UiTopoSession |
| 93 | log:list |
| 94 | EOF |