Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | """ |
| 4 | """ |
| 5 | from mininet.topo import Topo |
| 6 | from mininet.net import Mininet |
| 7 | from mininet.node import RemoteController |
| 8 | from mininet.node import Node |
| 9 | from mininet.node import CPULimitedHost |
| 10 | from mininet.link import TCLink |
| 11 | from mininet.cli import CLI |
| 12 | from mininet.log import setLogLevel |
| 13 | from mininet.util import dumpNodeConnections |
| 14 | |
| 15 | class AttMplsTopo( Topo ): |
| 16 | "Internet Topology Zoo Specimen." |
| 17 | |
| 18 | def __init__( self ): |
| 19 | "Create a topology." |
| 20 | |
| 21 | # Initialize Topology |
| 22 | Topo.__init__( self ) |
| 23 | |
| 24 | # add nodes, switches first... |
Thomas Vachuska | fc0859f | 2014-11-18 18:24:22 -0800 | [diff] [blame] | 25 | NY54 = self.addSwitch( 's25' ) # 40.728270, -73.994483 |
| 26 | CMBR = self.addSwitch( 's1' ) # 42.373730, -71.109734 |
Thomas Vachuska | 82041f5 | 2014-11-30 22:14:02 -0800 | [diff] [blame] | 27 | CHCG = self.addSwitch( 's2', protocols='OpenFlow13' ) # 41.877461, -87.642892 |
Thomas Vachuska | fc0859f | 2014-11-18 18:24:22 -0800 | [diff] [blame] | 28 | CLEV = self.addSwitch( 's3' ) # 41.498928, -81.695217 |
| 29 | RLGH = self.addSwitch( 's4' ) # 35.780150, -78.644026 |
| 30 | ATLN = self.addSwitch( 's5' ) # 33.749017, -84.394168 |
| 31 | PHLA = self.addSwitch( 's6' ) # 39.952906, -75.172278 |
| 32 | WASH = self.addSwitch( 's7' ) # 38.906696, -77.035509 |
| 33 | NSVL = self.addSwitch( 's8' ) # 36.166410, -86.787305 |
Thomas Vachuska | 82041f5 | 2014-11-30 22:14:02 -0800 | [diff] [blame] | 34 | STLS = self.addSwitch( 's9', protocols='OpenFlow13' ) # 38.626418, -90.198143 |
Thomas Vachuska | fc0859f | 2014-11-18 18:24:22 -0800 | [diff] [blame] | 35 | NWOR = self.addSwitch( 's10' ) # 29.951475, -90.078434 |
| 36 | HSTN = self.addSwitch( 's11' ) # 29.763249, -95.368332 |
| 37 | SNAN = self.addSwitch( 's12' ) # 29.424331, -98.491745 |
| 38 | DLLS = self.addSwitch( 's13' ) # 32.777665, -96.802064 |
| 39 | ORLD = self.addSwitch( 's14' ) # 28.538641, -81.381110 |
| 40 | DNVR = self.addSwitch( 's15' ) # 39.736623, -104.984887 |
| 41 | KSCY = self.addSwitch( 's16' ) # 39.100725, -94.581228 |
| 42 | SNFN = self.addSwitch( 's17' ) # 37.779751, -122.409791 |
| 43 | SCRM = self.addSwitch( 's18' ) # 38.581001, -121.497844 |
| 44 | PTLD = self.addSwitch( 's19' ) # 45.523317, -122.677768 |
| 45 | STTL = self.addSwitch( 's20' ) # 47.607326, -122.331786 |
| 46 | SLKC = self.addSwitch( 's21' ) # 40.759577, -111.895079 |
Thomas Vachuska | 82041f5 | 2014-11-30 22:14:02 -0800 | [diff] [blame] | 47 | LA03 = self.addSwitch( 's22', protocols='OpenFlow13' ) # 34.056346, -118.235951 |
Thomas Vachuska | fc0859f | 2014-11-18 18:24:22 -0800 | [diff] [blame] | 48 | SNDG = self.addSwitch( 's23' ) # 32.714564, -117.153528 |
| 49 | PHNX = self.addSwitch( 's24' ) # 33.448289, -112.076299 |
Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 50 | |
| 51 | # ... and now hosts |
| 52 | NY54_host = self.addHost( 'h25' ) |
| 53 | CMBR_host = self.addHost( 'h1' ) |
| 54 | CHCG_host = self.addHost( 'h2' ) |
| 55 | CLEV_host = self.addHost( 'h3' ) |
| 56 | RLGH_host = self.addHost( 'h4' ) |
| 57 | ATLN_host = self.addHost( 'h5' ) |
| 58 | PHLA_host = self.addHost( 'h6' ) |
| 59 | WASH_host = self.addHost( 'h7' ) |
| 60 | NSVL_host = self.addHost( 'h8' ) |
| 61 | STLS_host = self.addHost( 'h9' ) |
| 62 | NWOR_host = self.addHost( 'h10' ) |
| 63 | HSTN_host = self.addHost( 'h11' ) |
| 64 | SNAN_host = self.addHost( 'h12' ) |
| 65 | DLLS_host = self.addHost( 'h13' ) |
| 66 | ORLD_host = self.addHost( 'h14' ) |
| 67 | DNVR_host = self.addHost( 'h15' ) |
| 68 | KSCY_host = self.addHost( 'h16' ) |
| 69 | SNFN_host = self.addHost( 'h17' ) |
| 70 | SCRM_host = self.addHost( 'h18' ) |
| 71 | PTLD_host = self.addHost( 'h19' ) |
| 72 | STTL_host = self.addHost( 'h20' ) |
| 73 | SLKC_host = self.addHost( 'h21' ) |
| 74 | LA03_host = self.addHost( 'h22' ) |
| 75 | SNDG_host = self.addHost( 'h23' ) |
| 76 | PHNX_host = self.addHost( 'h24' ) |
| 77 | |
| 78 | # add edges between switch and corresponding host |
| 79 | self.addLink( NY54 , NY54_host ) |
| 80 | self.addLink( CMBR , CMBR_host ) |
| 81 | self.addLink( CHCG , CHCG_host ) |
| 82 | self.addLink( CLEV , CLEV_host ) |
| 83 | self.addLink( RLGH , RLGH_host ) |
| 84 | self.addLink( ATLN , ATLN_host ) |
| 85 | self.addLink( PHLA , PHLA_host ) |
| 86 | self.addLink( WASH , WASH_host ) |
| 87 | self.addLink( NSVL , NSVL_host ) |
| 88 | self.addLink( STLS , STLS_host ) |
| 89 | self.addLink( NWOR , NWOR_host ) |
| 90 | self.addLink( HSTN , HSTN_host ) |
| 91 | self.addLink( SNAN , SNAN_host ) |
| 92 | self.addLink( DLLS , DLLS_host ) |
| 93 | self.addLink( ORLD , ORLD_host ) |
| 94 | self.addLink( DNVR , DNVR_host ) |
| 95 | self.addLink( KSCY , KSCY_host ) |
| 96 | self.addLink( SNFN , SNFN_host ) |
| 97 | self.addLink( SCRM , SCRM_host ) |
| 98 | self.addLink( PTLD , PTLD_host ) |
| 99 | self.addLink( STTL , STTL_host ) |
| 100 | self.addLink( SLKC , SLKC_host ) |
| 101 | self.addLink( LA03 , LA03_host ) |
| 102 | self.addLink( SNDG , SNDG_host ) |
| 103 | self.addLink( PHNX , PHNX_host ) |
| 104 | |
| 105 | # add edges between switches |
| 106 | self.addLink( NY54 , CMBR, bw=10, delay='0.979030824185ms') |
Thomas Vachuska | 5160dbb | 2015-07-14 10:21:45 -0700 | [diff] [blame] | 107 | self.addLink( NY54 , CMBR, bw=10, delay='0.979030824185ms') |
| 108 | self.addLink( NY54 , CMBR, bw=10, delay='0.979030824185ms') |
Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 109 | self.addLink( NY54 , CHCG, bw=10, delay='0.806374975652ms') |
| 110 | self.addLink( NY54 , PHLA, bw=10, delay='0.686192970166ms') |
Thomas Vachuska | 5160dbb | 2015-07-14 10:21:45 -0700 | [diff] [blame] | 111 | self.addLink( NY54 , PHLA, bw=10, delay='0.686192970166ms') |
Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 112 | self.addLink( NY54 , WASH, bw=10, delay='0.605826192092ms') |
| 113 | self.addLink( CMBR , PHLA, bw=10, delay='1.4018238197ms') |
| 114 | self.addLink( CHCG , CLEV, bw=10, delay='0.232315346482ms') |
| 115 | self.addLink( CHCG , PHLA, bw=10, delay='1.07297714274ms') |
| 116 | self.addLink( CHCG , STLS, bw=10, delay='1.12827896944ms') |
| 117 | self.addLink( CHCG , DNVR, bw=10, delay='1.35964770335ms') |
| 118 | self.addLink( CHCG , KSCY, bw=10, delay='1.5199778541ms') |
Thomas Vachuska | 5160dbb | 2015-07-14 10:21:45 -0700 | [diff] [blame] | 119 | self.addLink( CHCG , KSCY, bw=10, delay='1.5199778541ms') |
Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 120 | self.addLink( CHCG , SNFN, bw=10, delay='0.620743405435ms') |
| 121 | self.addLink( CHCG , STTL, bw=10, delay='0.93027212534ms') |
| 122 | self.addLink( CHCG , SLKC, bw=10, delay='0.735621751348ms') |
| 123 | self.addLink( CLEV , NSVL, bw=10, delay='0.523419372248ms') |
| 124 | self.addLink( CLEV , STLS, bw=10, delay='1.00360290845ms') |
| 125 | self.addLink( CLEV , PHLA, bw=10, delay='0.882912133249ms') |
| 126 | self.addLink( RLGH , ATLN, bw=10, delay='1.1644489729ms') |
| 127 | self.addLink( RLGH , WASH, bw=10, delay='1.48176810502ms') |
| 128 | self.addLink( ATLN , WASH, bw=10, delay='0.557636936322ms') |
| 129 | self.addLink( ATLN , NSVL, bw=10, delay='1.32869749865ms') |
| 130 | self.addLink( ATLN , STLS, bw=10, delay='0.767705554748ms') |
| 131 | self.addLink( ATLN , DLLS, bw=10, delay='0.544782086448ms') |
Thomas Vachuska | 5160dbb | 2015-07-14 10:21:45 -0700 | [diff] [blame] | 132 | self.addLink( ATLN , DLLS, bw=10, delay='0.544782086448ms') |
| 133 | self.addLink( ATLN , DLLS, bw=10, delay='0.544782086448ms') |
Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 134 | self.addLink( ATLN , ORLD, bw=10, delay='1.46119152532ms') |
| 135 | self.addLink( PHLA , WASH, bw=10, delay='0.372209320106ms') |
| 136 | self.addLink( NSVL , STLS, bw=10, delay='1.43250491305ms') |
| 137 | self.addLink( NSVL , DLLS, bw=10, delay='1.67698215288ms') |
| 138 | self.addLink( STLS , DLLS, bw=10, delay='0.256389964194ms') |
| 139 | self.addLink( STLS , KSCY, bw=10, delay='0.395511571791ms') |
| 140 | self.addLink( STLS , LA03, bw=10, delay='0.257085227363ms') |
| 141 | self.addLink( NWOR , HSTN, bw=10, delay='0.0952906633914ms') |
| 142 | self.addLink( NWOR , DLLS, bw=10, delay='1.60231329739ms') |
| 143 | self.addLink( NWOR , ORLD, bw=10, delay='0.692731063896ms') |
| 144 | self.addLink( HSTN , SNAN, bw=10, delay='0.284150653798ms') |
| 145 | self.addLink( HSTN , DLLS, bw=10, delay='1.65690128332ms') |
| 146 | self.addLink( HSTN , ORLD, bw=10, delay='0.731886304782ms') |
| 147 | self.addLink( SNAN , PHNX, bw=10, delay='1.34258627257ms') |
| 148 | self.addLink( SNAN , DLLS, bw=10, delay='1.50063532341ms') |
| 149 | self.addLink( DLLS , DNVR, bw=10, delay='0.251471593235ms') |
Thomas Vachuska | 5160dbb | 2015-07-14 10:21:45 -0700 | [diff] [blame] | 150 | self.addLink( DLLS , DNVR, bw=10, delay='0.251471593235ms') |
| 151 | self.addLink( DLLS , KSCY, bw=10, delay='0.18026026737ms') |
Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 152 | self.addLink( DLLS , KSCY, bw=10, delay='0.18026026737ms') |
| 153 | self.addLink( DLLS , SNFN, bw=10, delay='0.74304274592ms') |
| 154 | self.addLink( DLLS , LA03, bw=10, delay='0.506439293357ms') |
Thomas Vachuska | 5160dbb | 2015-07-14 10:21:45 -0700 | [diff] [blame] | 155 | self.addLink( DLLS , LA03, bw=10, delay='0.506439293357ms') |
Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 156 | self.addLink( DNVR , KSCY, bw=10, delay='0.223328790403ms') |
| 157 | self.addLink( DNVR , SNFN, bw=10, delay='0.889017541903ms') |
Thomas Vachuska | 5160dbb | 2015-07-14 10:21:45 -0700 | [diff] [blame] | 158 | self.addLink( DNVR , SNFN, bw=10, delay='0.889017541903ms') |
Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 159 | self.addLink( DNVR , SLKC, bw=10, delay='0.631898982721ms') |
| 160 | self.addLink( KSCY , SNFN, bw=10, delay='0.922778522233ms') |
| 161 | self.addLink( SNFN , SCRM, bw=10, delay='0.630352278097ms') |
| 162 | self.addLink( SNFN , PTLD, bw=10, delay='0.828572513655ms') |
| 163 | self.addLink( SNFN , STTL, bw=10, delay='1.54076081649ms') |
| 164 | self.addLink( SNFN , SLKC, bw=10, delay='0.621507502625ms') |
| 165 | self.addLink( SNFN , LA03, bw=10, delay='0.602936230151ms') |
Thomas Vachuska | 5160dbb | 2015-07-14 10:21:45 -0700 | [diff] [blame] | 166 | self.addLink( SNFN , LA03, bw=10, delay='0.602936230151ms') |
| 167 | self.addLink( SNFN , LA03, bw=10, delay='0.602936230151ms') |
Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 168 | self.addLink( SCRM , SLKC, bw=10, delay='0.461350343644ms') |
| 169 | self.addLink( PTLD , STTL, bw=10, delay='1.17591515181ms') |
| 170 | self.addLink( SLKC , LA03, bw=10, delay='0.243225267023ms') |
| 171 | self.addLink( LA03 , SNDG, bw=10, delay='0.681264950821ms') |
Thomas Vachuska | 5160dbb | 2015-07-14 10:21:45 -0700 | [diff] [blame] | 172 | self.addLink( LA03 , SNDG, bw=10, delay='0.681264950821ms') |
Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 173 | self.addLink( LA03 , PHNX, bw=10, delay='0.343709457969ms') |
Thomas Vachuska | 5160dbb | 2015-07-14 10:21:45 -0700 | [diff] [blame] | 174 | self.addLink( LA03 , PHNX, bw=10, delay='0.343709457969ms') |
Thomas Vachuska | e4cebaf | 2014-11-15 18:49:34 -0800 | [diff] [blame] | 175 | self.addLink( SNDG , PHNX, bw=10, delay='0.345064487693ms') |
| 176 | |
| 177 | topos = { 'att': ( lambda: AttMplsTopo() ) } |