Andrea Campanella | 1909032 | 2017-08-22 10:31:37 +0200 | [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 custom simulation.. |
| 13 | onos ${host} null-simulation start custom |
| 14 | |
| 15 | |
| 16 | ## unfortunately, it takes a time for the sim to start up |
| 17 | # this is not ideal... |
| 18 | |
| 19 | echo |
| 20 | echo "Sleeping while sim starts up... (${sleepfor} seconds)..." |
| 21 | echo |
| 22 | sleep ${sleepfor} |
| 23 | |
| 24 | # Add devices, links, and hosts |
| 25 | onos ${1:-localhost} <<-EOF |
| 26 | |
| 27 | null-create-device switch ATH ${nports} 37.984149 23.7279843 |
| 28 | null-create-device switch LIS ${nports} 38.707792 -9.1365069 |
| 29 | |
| 30 | |
| 31 | null-create-link direct ATH LIS |
| 32 | null-create-link direct LIS ATH |
| 33 | |
| 34 | null-create-host ATH 192.168.1.1 34.984149 24.7279843 |
| 35 | null-create-host LIS 192.168.1.2 37.707792 -7.1365069 |
| 36 | |
| 37 | EOF |