blob: 7f9044629957c9cfc93beb353dce8e2704ae890d [file] [log] [blame]
Thomas Vachuskad9c900e2015-05-19 14:04:08 -07001#!/usr/bin/env python
2
3"""
4"""
5from mininet.topo import Topo
6from mininet.net import Mininet
7from mininet.node import RemoteController
8from mininet.node import Node
9from mininet.node import CPULimitedHost
10from mininet.link import TCLink
11from mininet.cli import CLI
12from mininet.log import setLogLevel
13from mininet.util import dumpNodeConnections
14
15class AttMplsTopo( Topo ):
16 "Internet Topology Zoo Specimen."
17
Brian O'Connor2f0817c2015-09-03 16:36:27 -070018 def build( self ):
Thomas Vachuskad9c900e2015-05-19 14:04:08 -070019 "Create a topology."
20
Thomas Vachuskad9c900e2015-05-19 14:04:08 -070021 # add nodes, switches first...
Thomas Vachuskad9c900e2015-05-19 14:04:08 -070022 CMBR = self.addSwitch( 's1' ) # 42.373730, -71.109734
23 CHCG = self.addSwitch( 's2' ) # 41.877461, -87.642892
24 CLEV = self.addSwitch( 's3' ) # 41.498928, -81.695217
25 RLGH = self.addSwitch( 's4' ) # 35.780150, -78.644026
26 ATLN = self.addSwitch( 's5' ) # 33.749017, -84.394168
27 PHLA = self.addSwitch( 's6' ) # 39.952906, -75.172278
28 WASH = self.addSwitch( 's7' ) # 38.906696, -77.035509
29 NSVL = self.addSwitch( 's8' ) # 36.166410, -86.787305
30 STLS = self.addSwitch( 's9' ) # 38.626418, -90.198143
31 NWOR = self.addSwitch( 's10' ) # 29.951475, -90.078434
32 HSTN = self.addSwitch( 's11' ) # 29.763249, -95.368332
33 SNAN = self.addSwitch( 's12' ) # 29.424331, -98.491745
34 DLLS = self.addSwitch( 's13' ) # 32.777665, -96.802064
35 ORLD = self.addSwitch( 's14' ) # 28.538641, -81.381110
36 DNVR = self.addSwitch( 's15' ) # 39.736623, -104.984887
37 KSCY = self.addSwitch( 's16' ) # 39.100725, -94.581228
38 SNFN = self.addSwitch( 's17' ) # 37.779751, -122.409791
39 SCRM = self.addSwitch( 's18' ) # 38.581001, -121.497844
40 PTLD = self.addSwitch( 's19' ) # 45.523317, -122.677768
41 STTL = self.addSwitch( 's20' ) # 47.607326, -122.331786
42 SLKC = self.addSwitch( 's21' ) # 40.759577, -111.895079
43 LA03 = self.addSwitch( 's22' ) # 34.056346, -118.235951
44 SNDG = self.addSwitch( 's23' ) # 32.714564, -117.153528
45 PHNX = self.addSwitch( 's24' ) # 33.448289, -112.076299
Brian O'Connor2f0817c2015-09-03 16:36:27 -070046 NY54 = self.addSwitch( 's25' ) # 40.728270, -73.994483
Thomas Vachuskad9c900e2015-05-19 14:04:08 -070047
48 # ... and now hosts
Thomas Vachuskad9c900e2015-05-19 14:04:08 -070049 CMBR_host = self.addHost( 'h1' )
50 CHCG_host = self.addHost( 'h2' )
51 CLEV_host = self.addHost( 'h3' )
52 RLGH_host = self.addHost( 'h4' )
53 ATLN_host = self.addHost( 'h5' )
54 PHLA_host = self.addHost( 'h6' )
55 WASH_host = self.addHost( 'h7' )
56 NSVL_host = self.addHost( 'h8' )
57 STLS_host = self.addHost( 'h9' )
58 NWOR_host = self.addHost( 'h10' )
59 HSTN_host = self.addHost( 'h11' )
60 SNAN_host = self.addHost( 'h12' )
61 DLLS_host = self.addHost( 'h13' )
62 ORLD_host = self.addHost( 'h14' )
63 DNVR_host = self.addHost( 'h15' )
64 KSCY_host = self.addHost( 'h16' )
65 SNFN_host = self.addHost( 'h17' )
66 SCRM_host = self.addHost( 'h18' )
67 PTLD_host = self.addHost( 'h19' )
68 STTL_host = self.addHost( 'h20' )
69 SLKC_host = self.addHost( 'h21' )
70 LA03_host = self.addHost( 'h22' )
71 SNDG_host = self.addHost( 'h23' )
72 PHNX_host = self.addHost( 'h24' )
Brian O'Connor2f0817c2015-09-03 16:36:27 -070073 NY54_host = self.addHost( 'h25' )
Thomas Vachuskad9c900e2015-05-19 14:04:08 -070074
75 # add edges between switch and corresponding host
76 self.addLink( NY54 , NY54_host )
77 self.addLink( CMBR , CMBR_host )
78 self.addLink( CHCG , CHCG_host )
79 self.addLink( CLEV , CLEV_host )
80 self.addLink( RLGH , RLGH_host )
81 self.addLink( ATLN , ATLN_host )
82 self.addLink( PHLA , PHLA_host )
83 self.addLink( WASH , WASH_host )
84 self.addLink( NSVL , NSVL_host )
85 self.addLink( STLS , STLS_host )
86 self.addLink( NWOR , NWOR_host )
87 self.addLink( HSTN , HSTN_host )
88 self.addLink( SNAN , SNAN_host )
89 self.addLink( DLLS , DLLS_host )
90 self.addLink( ORLD , ORLD_host )
91 self.addLink( DNVR , DNVR_host )
92 self.addLink( KSCY , KSCY_host )
93 self.addLink( SNFN , SNFN_host )
94 self.addLink( SCRM , SCRM_host )
95 self.addLink( PTLD , PTLD_host )
96 self.addLink( STTL , STTL_host )
97 self.addLink( SLKC , SLKC_host )
98 self.addLink( LA03 , LA03_host )
99 self.addLink( SNDG , SNDG_host )
100 self.addLink( PHNX , PHNX_host )
101
102 # add edges between switches
Thomas Vachuska5160dbb2015-07-14 10:21:45 -0700103 self.addLink( NY54 , CMBR)
104 self.addLink( NY54 , CMBR)
105 self.addLink( NY54 , CMBR)
106 self.addLink( NY54 , CHCG)
107 self.addLink( NY54 , PHLA)
108 self.addLink( NY54 , PHLA)
109 self.addLink( NY54 , WASH)
110 self.addLink( CMBR , PHLA)
111 self.addLink( CHCG , CLEV)
112 self.addLink( CHCG , PHLA)
113 self.addLink( CHCG , STLS)
114 self.addLink( CHCG , DNVR)
115 self.addLink( CHCG , KSCY)
116 self.addLink( CHCG , KSCY)
117 self.addLink( CHCG , SNFN)
118 self.addLink( CHCG , STTL)
119 self.addLink( CHCG , SLKC)
120 self.addLink( CLEV , NSVL)
121 self.addLink( CLEV , STLS)
122 self.addLink( CLEV , PHLA)
123 self.addLink( RLGH , ATLN)
124 self.addLink( RLGH , WASH)
125 self.addLink( ATLN , WASH)
126 self.addLink( ATLN , NSVL)
127 self.addLink( ATLN , STLS)
128 self.addLink( ATLN , DLLS)
129 self.addLink( ATLN , DLLS)
130 self.addLink( ATLN , DLLS)
131 self.addLink( ATLN , ORLD)
132 self.addLink( PHLA , WASH)
133 self.addLink( NSVL , STLS)
134 self.addLink( NSVL , DLLS)
135 self.addLink( STLS , DLLS)
136 self.addLink( STLS , KSCY)
137 self.addLink( STLS , LA03)
138 self.addLink( NWOR , HSTN)
139 self.addLink( NWOR , DLLS)
140 self.addLink( NWOR , ORLD)
141 self.addLink( HSTN , SNAN)
142 self.addLink( HSTN , DLLS)
143 self.addLink( HSTN , ORLD)
144 self.addLink( SNAN , PHNX)
145 self.addLink( SNAN , DLLS)
146 self.addLink( DLLS , DNVR)
147 self.addLink( DLLS , DNVR)
148 self.addLink( DLLS , KSCY)
149 self.addLink( DLLS , KSCY)
150 self.addLink( DLLS , SNFN)
151 self.addLink( DLLS , LA03)
152 self.addLink( DLLS , LA03)
153 self.addLink( DNVR , KSCY)
154 self.addLink( DNVR , SNFN)
155 self.addLink( DNVR , SNFN)
156 self.addLink( DNVR , SLKC)
157 self.addLink( KSCY , SNFN)
158 self.addLink( SNFN , SCRM)
159 self.addLink( SNFN , PTLD)
160 self.addLink( SNFN , STTL)
161 self.addLink( SNFN , SLKC)
162 self.addLink( SNFN , LA03)
163 self.addLink( SNFN , LA03)
164 self.addLink( SNFN , LA03)
165 self.addLink( SCRM , SLKC)
166 self.addLink( PTLD , STTL)
167 self.addLink( SLKC , LA03)
168 self.addLink( LA03 , SNDG)
169 self.addLink( LA03 , SNDG)
170 self.addLink( LA03 , PHNX)
171 self.addLink( LA03 , PHNX)
172 self.addLink( SNDG , PHNX)
Thomas Vachuskad9c900e2015-05-19 14:04:08 -0700173
174topos = { 'att': ( lambda: AttMplsTopo() ) }