13
13
'SEA' : {'dpid' : '000000000000010%s' },
14
14
'SFO' : {'dpid' : '000000000000020%s' },
15
15
'LAX' : {'dpid' : '000000000000030%s' },
16
- 'ATL' : {'dpid' : '000000000000040%s' },
17
- 'IAD' : {'dpid' : '000000000000050%s' },
18
- 'EWR' : {'dpid' : '000000000000060%s' },
19
- 'SLC' : {'dpid' : '000000000000070%s' },
20
- 'MCI' : {'dpid' : '000000000000080%s' },
21
- 'ORD' : {'dpid' : '000000000000090%s' },
22
- 'CLE' : {'dpid' : '0000000000000a0%s' },
23
- 'IAH' : {'dpid' : '0000000000000b0%s' },
24
16
}
25
17
26
18
FANOUT = 4
@@ -40,32 +32,28 @@ def __init__(self, enable_all = True):
40
32
41
33
# Add hosts and connect them to their core switch
42
34
for switch in CORES :
43
- for count in xrange (1 , FANOUT + 1 ):
44
- # Add hosts
45
- host = 'h_%s_%s' % (switch , count )
46
- ip = '10.0.0.%s' % count
47
- mac = CORES [switch ]['dpid' ][4 :] % count
48
- h = self .addHost (host , ip = ip , mac = mac )
49
- # Connect hosts to core switches
50
- self .addLink (h , self .cores [switch ], bw = 10 , delay = '5ms' , loss = 2 ,
51
- max_queue_size = 1000 , use_htb = True )
52
-
35
+ for count in xrange (1 , FANOUT + 1 ):
36
+ # Add hosts
37
+ host = 'h_%s_%s' % (switch , count )
38
+ ip = '10.0.0.%s' % count
39
+ mac = CORES [switch ]['dpid' ][4 :] % count
40
+ h = self .addHost (host , ip = ip , mac = mac )
41
+
42
+ self .addLink ('h_SEA_1' , 'SEA' , bw = 10 , delay = '5ms' , loss = 2 , max_queue_size = 1000 , use_htb = True )
43
+ self .addLink ('h_SEA_2' , 'SEA' )
44
+ self .addLink ('h_SEA_3' , 'SEA' )
45
+ self .addLink ('h_SEA_4' , 'SEA' )
46
+ self .addLink ('h_LAX_1' , 'LAX' )
47
+ self .addLink ('h_LAX_2' , 'LAX' , bw = 10 , delay = '5ms' , loss = 2 , max_queue_size = 1000 , use_htb = True )
48
+ self .addLink ('h_LAX_3' , 'LAX' )
49
+ self .addLink ('h_LAX_4' , 'LAX' )
50
+ self .addLink ('h_SFO_1' , 'SFO' )
51
+ self .addLink ('h_SFO_2' , 'SFO' )
52
+ self .addLink ('h_SFO_3' , 'SFO' )
53
+ self .addLink ('h_SFO_4' , 'SFO' )
53
54
# Connect core switches
54
- self .addLink (self .cores ['SFO' ], self .cores ['SEA' ],bw = 10 )
55
- self .addLink (self .cores ['SEA' ], self .cores ['SLC' ],bw = 10 )
56
- self .addLink (self .cores ['SFO' ], self .cores ['LAX' ],bw = 10 )
57
- self .addLink (self .cores ['LAX' ], self .cores ['SLC' ],bw = 10 )
58
- self .addLink (self .cores ['LAX' ], self .cores ['IAH' ],bw = 10 )
59
- self .addLink (self .cores ['SLC' ], self .cores ['MCI' ],bw = 10 )
60
- self .addLink (self .cores ['MCI' ], self .cores ['IAH' ],bw = 10 )
61
- self .addLink (self .cores ['MCI' ], self .cores ['ORD' ],bw = 10 )
62
- self .addLink (self .cores ['IAH' ], self .cores ['ATL' ],bw = 10 )
63
- self .addLink (self .cores ['ORD' ], self .cores ['ATL' ],bw = 10 )
64
- self .addLink (self .cores ['ORD' ], self .cores ['CLE' ],bw = 10 )
65
- self .addLink (self .cores ['ATL' ], self .cores ['IAD' ],bw = 10 )
66
- self .addLink (self .cores ['CLE' ], self .cores ['IAD' ],bw = 10 )
67
- self .addLink (self .cores ['CLE' ], self .cores ['EWR' ],bw = 10 )
68
- self .addLink (self .cores ['EWR' ], self .cores ['IAD' ],bw = 10 )
55
+ self .addLink (self .cores ['SFO' ], self .cores ['SEA' ])
56
+ self .addLink (self .cores ['SFO' ], self .cores ['LAX' ])
69
57
70
58
71
59
if __name__ == '__main__' :
0 commit comments