Simon Hunt

GUI -- added topo script and configuration for projection onto UK map.

Change-Id: Id87991aca319f6c2bf5bd2c9f0735592ad4c4b1f
1 +{
2 + "devices": {
3 + "of:0000000000000001": { "basic": { "name": "LONDON", "latitude": 51.5072, "longitude": -0.1275 }},
4 + "of:0000000000000002": { "basic": { "name": "BRISTL", "latitude": 51.4500, "longitude": -2.5833 }},
5 + "of:0000000000000003": { "basic": { "name": "BIRMHM", "latitude": 52.4831, "longitude": -1.8936 }},
6 + "of:0000000000000004": { "basic": { "name": "PLYMTH", "latitude": 50.3714, "longitude": -4.1422 }},
7 + "of:0000000000000005": { "basic": { "name": "DOVER", "latitude": 51.1295, "longitude": 1.3089 }},
8 + "of:0000000000000006": { "basic": { "name": "BRGHTN", "latitude": 50.8429, "longitude": -0.1313 }},
9 + "of:0000000000000007": { "basic": { "name": "LIVRPL", "latitude": 53.4000, "longitude": -3.0000 }},
10 + "of:0000000000000008": { "basic": { "name": "YORK", "latitude": 53.9583, "longitude": -1.0803 }},
11 + "of:0000000000000009": { "basic": { "name": "NWCSTL", "latitude": 54.9667, "longitude": -1.6000 }},
12 + "of:000000000000000a": { "basic": { "name": "NRWICH", "latitude": 52.6283, "longitude": 1.2967 }},
13 + "of:000000000000000b": { "basic": { "name": "EDBUGH", "latitude": 55.9531, "longitude": -3.1889 }},
14 + "of:000000000000000c": { "basic": { "name": "ABYSTW", "latitude": 52.4140, "longitude": -4.0810 }}
15 + },
16 +
17 + "hosts": {
18 + "00:00:00:00:00:01/-1": { "basic": { "location": "of:0000000000000001/1", "ips": [ "10.0.0.1" ], "name": "LONDON", "latitude": 51.9798, "longitude": 0.0671 }},
19 + "00:00:00:00:00:02/-1": { "basic": { "location": "of:0000000000000002/1", "ips": [ "10.0.0.2" ], "name": "BRISTL", "latitude": 51.1693, "longitude": -2.5234 }},
20 + "00:00:00:00:00:03/-1": { "basic": { "location": "of:0000000000000003/1", "ips": [ "10.0.0.3" ], "name": "BIRMHM", "latitude": 52.2088, "longitude": -1.7738 }},
21 + "00:00:00:00:00:04/-1": { "basic": { "location": "of:0000000000000004/1", "ips": [ "10.0.0.4" ], "name": "PLYMTH", "latitude": 50.7991, "longitude": -4.1871 }},
22 + "00:00:00:00:00:05/-1": { "basic": { "location": "of:0000000000000005/1", "ips": [ "10.0.0.5" ], "name": "DOVER", "latitude": 51.4570, "longitude": 1.6981 }},
23 + "00:00:00:00:00:06/-1": { "basic": { "location": "of:0000000000000006/1", "ips": [ "10.0.0.6" ], "name": "BRGHTN", "latitude": 50.5870, "longitude": 0.2429 }},
24 + "00:00:00:00:00:07/-1": { "basic": { "location": "of:0000000000000007/1", "ips": [ "10.0.0.7" ], "name": "LIVRPL", "latitude": 53.1044, "longitude": -3.0899 }},
25 + "00:00:00:00:00:08/-1": { "basic": { "location": "of:0000000000000008/1", "ips": [ "10.0.0.8" ], "name": "YORK", "latitude": 54.2567, "longitude": -0.7510 }},
26 + "00:00:00:00:00:09/-1": { "basic": { "location": "of:0000000000000009/1", "ips": [ "10.0.0.9" ], "name": "NWCSTL", "latitude": 55.3089, "longitude": -1.4952 }},
27 + "00:00:00:00:00:0a/-1": { "basic": { "location": "of:000000000000000a/1", "ips": [ "10.0.0.10" ], "name": "NRWICH", "latitude": 52.9722, "longitude": 1.4613 }},
28 + "00:00:00:00:00:0b/-1": { "basic": { "location": "of:000000000000000b/1", "ips": [ "10.0.0.11" ], "name": "EDBUGH", "latitude": 55.7009, "longitude": -3.6230 }},
29 + "00:00:00:00:00:0c/-1": { "basic": { "location": "of:000000000000000c/1", "ips": [ "10.0.0.12" ], "name": "ABYSTW", "latitude": 52.0745, "longitude": -4.1444 }}
30 + }
31 +}
1 +#!/usr/bin/env python
2 +
3 +"""
4 +"""
5 +from mininet.topo import Topo
6 +
7 +class UkTopo( Topo ):
8 + """Internet Topology Zoo Specimen."""
9 +
10 + def __init__( self ):
11 + """Create a topology."""
12 +
13 + # Initialize Topology
14 + Topo.__init__( self )
15 +
16 + # add nodes, switches first...
17 + LONDON = self.addSwitch( 's1' )
18 + BRISTL = self.addSwitch( 's2' )
19 + BIRMHM = self.addSwitch( 's3' )
20 + PLYMTH = self.addSwitch( 's4' )
21 + DOVER = self.addSwitch( 's5' )
22 + BRGHTN = self.addSwitch( 's6' )
23 + LIVRPL = self.addSwitch( 's7' )
24 + YORK = self.addSwitch( 's8' )
25 + NWCSTL = self.addSwitch( 's9' )
26 + NRWICH = self.addSwitch( 's10' )
27 + EDBUGH = self.addSwitch( 's11' )
28 + ABYSTW = self.addSwitch( 's12' )
29 +
30 +
31 + # ... and now hosts
32 + LONDON_host = self.addHost( 'h1' )
33 + BRISTL_host = self.addHost( 'h2' )
34 + BIRMHM_host = self.addHost( 'h3' )
35 + PLYMTH_host = self.addHost( 'h4' )
36 + DOVER_host = self.addHost( 'h5' )
37 + BRGHTN_host = self.addHost( 'h6' )
38 + LIVRPL_host = self.addHost( 'h7' )
39 + YORK_host = self.addHost( 'h8' )
40 + NWCSTL_host = self.addHost( 'h9' )
41 + NRWICH_host = self.addHost( 'h10' )
42 + EDBUGH_host = self.addHost( 'h11' )
43 + ABYSTW_host = self.addHost( 'h12' )
44 +
45 + # add edges between switch and corresponding host
46 + self.addLink( LONDON, LONDON_host )
47 + self.addLink( BRISTL, BRISTL_host )
48 + self.addLink( BIRMHM, BIRMHM_host )
49 + self.addLink( PLYMTH, PLYMTH_host )
50 + self.addLink( DOVER, DOVER_host )
51 + self.addLink( BRGHTN, BRGHTN_host )
52 + self.addLink( LIVRPL, LIVRPL_host )
53 + self.addLink( YORK, YORK_host )
54 + self.addLink( NWCSTL, NWCSTL_host )
55 + self.addLink( NRWICH, NRWICH_host )
56 + self.addLink( EDBUGH, EDBUGH_host )
57 + self.addLink( ABYSTW, ABYSTW_host )
58 +
59 + # add edges between switches
60 + self.addLink( LONDON, BRISTL, bw=10, delay='1.0ms')
61 + self.addLink( LONDON, BRISTL, bw=10, delay='1.0ms')
62 + self.addLink( LONDON, BIRMHM, bw=10, delay='1.0ms')
63 + self.addLink( BRISTL, BIRMHM, bw=10, delay='1.0ms')
64 + self.addLink( BRISTL, PLYMTH, bw=10, delay='1.0ms')
65 + self.addLink( LONDON, PLYMTH, bw=10, delay='1.0ms')
66 + self.addLink( LONDON, DOVER, bw=10, delay='1.0ms')
67 + self.addLink( LONDON, BRGHTN, bw=10, delay='1.0ms')
68 + self.addLink( DOVER, BRGHTN, bw=10, delay='1.0ms')
69 + self.addLink( BIRMHM, LIVRPL, bw=10, delay='1.0ms')
70 + self.addLink( BIRMHM, YORK, bw=10, delay='1.0ms')
71 + self.addLink( NWCSTL, YORK, bw=10, delay='1.0ms')
72 + self.addLink( NWCSTL, LIVRPL, bw=10, delay='1.0ms')
73 + self.addLink( LONDON, YORK, bw=10, delay='1.0ms')
74 + self.addLink( LONDON, YORK, bw=10, delay='1.0ms')
75 + self.addLink( LONDON, NRWICH, bw=10, delay='1.0ms')
76 + self.addLink( DOVER, NRWICH, bw=10, delay='1.0ms')
77 + self.addLink( YORK, NRWICH, bw=10, delay='1.0ms')
78 + self.addLink( YORK, LIVRPL, bw=10, delay='1.0ms')
79 + self.addLink( NWCSTL, EDBUGH, bw=10, delay='1.0ms')
80 + self.addLink( LIVRPL, EDBUGH, bw=10, delay='1.0ms')
81 + self.addLink( LIVRPL, ABYSTW, bw=10, delay='1.0ms')
82 + self.addLink( BRISTL, ABYSTW, bw=10, delay='1.0ms')
83 +
84 +topos = { 'uk': ( lambda: UkTopo() ) }