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