Thomas Vachuska

Adding support for link state to GUI.

Change-Id: I6476cf04810f7bc7e88af629a36ce671b42748d0
...@@ -82,6 +82,7 @@ public class DevicesListCommand extends AbstractShellCommand { ...@@ -82,6 +82,7 @@ public class DevicesListCommand extends AbstractShellCommand {
82 if (device != null) { 82 if (device != null) {
83 result.put("id", device.id().toString()) 83 result.put("id", device.id().toString())
84 .put("available", service.isAvailable(device.id())) 84 .put("available", service.isAvailable(device.id()))
85 + .put("type", device.type().toString())
85 .put("role", service.getRole(device.id()).toString()) 86 .put("role", service.getRole(device.id()).toString())
86 .put("mfr", device.manufacturer()) 87 .put("mfr", device.manufacturer())
87 .put("hw", device.hwVersion()) 88 .put("hw", device.hwVersion())
......
...@@ -35,7 +35,7 @@ import static org.onlab.onos.net.DeviceId.deviceId; ...@@ -35,7 +35,7 @@ import static org.onlab.onos.net.DeviceId.deviceId;
35 description = "Lists all infrastructure links") 35 description = "Lists all infrastructure links")
36 public class LinksListCommand extends AbstractShellCommand { 36 public class LinksListCommand extends AbstractShellCommand {
37 37
38 - private static final String FMT = "src=%s/%s, dst=%s/%s, type=%s%s"; 38 + private static final String FMT = "src=%s/%s, dst=%s/%s, type=%s, state=%s%s";
39 private static final String COMPACT = "%s/%s-%s/%s"; 39 private static final String COMPACT = "%s/%s-%s/%s";
40 40
41 @Argument(index = 0, name = "uri", description = "Device ID", 41 @Argument(index = 0, name = "uri", description = "Device ID",
...@@ -82,6 +82,8 @@ public class LinksListCommand extends AbstractShellCommand { ...@@ -82,6 +82,8 @@ public class LinksListCommand extends AbstractShellCommand {
82 ObjectNode result = mapper.createObjectNode(); 82 ObjectNode result = mapper.createObjectNode();
83 result.set("src", json(mapper, link.src())); 83 result.set("src", json(mapper, link.src()));
84 result.set("dst", json(mapper, link.dst())); 84 result.set("dst", json(mapper, link.dst()));
85 + result.put("type", link.type().toString());
86 + result.put("state", link.state().toString());
85 result.set("annotations", annotations(mapper, link.annotations())); 87 result.set("annotations", annotations(mapper, link.annotations()));
86 return result; 88 return result;
87 } 89 }
...@@ -107,7 +109,8 @@ public class LinksListCommand extends AbstractShellCommand { ...@@ -107,7 +109,8 @@ public class LinksListCommand extends AbstractShellCommand {
107 */ 109 */
108 public static String linkString(Link link) { 110 public static String linkString(Link link) {
109 return String.format(FMT, link.src().deviceId(), link.src().port(), 111 return String.format(FMT, link.src().deviceId(), link.src().port(),
110 - link.dst().deviceId(), link.dst().port(), link.type(), 112 + link.dst().deviceId(), link.dst().port(),
113 + link.type(), link.state(),
111 annotations(link.annotations())); 114 annotations(link.annotations()));
112 } 115 }
113 116
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
15 */ 15 */
16 package org.onlab.onos.store.trivial.impl; 16 package org.onlab.onos.store.trivial.impl;
17 17
18 +import static org.onlab.onos.net.DefaultAnnotations.merge;
18 import static org.onlab.onos.net.host.HostEvent.Type.HOST_ADDED; 19 import static org.onlab.onos.net.host.HostEvent.Type.HOST_ADDED;
19 import static org.onlab.onos.net.host.HostEvent.Type.HOST_MOVED; 20 import static org.onlab.onos.net.host.HostEvent.Type.HOST_MOVED;
20 import static org.onlab.onos.net.host.HostEvent.Type.HOST_REMOVED; 21 import static org.onlab.onos.net.host.HostEvent.Type.HOST_REMOVED;
...@@ -33,6 +34,7 @@ import org.apache.felix.scr.annotations.Deactivate; ...@@ -33,6 +34,7 @@ import org.apache.felix.scr.annotations.Deactivate;
33 import org.apache.felix.scr.annotations.Service; 34 import org.apache.felix.scr.annotations.Service;
34 import org.onlab.onos.net.Annotations; 35 import org.onlab.onos.net.Annotations;
35 import org.onlab.onos.net.ConnectPoint; 36 import org.onlab.onos.net.ConnectPoint;
37 +import org.onlab.onos.net.DefaultAnnotations;
36 import org.onlab.onos.net.DefaultHost; 38 import org.onlab.onos.net.DefaultHost;
37 import org.onlab.onos.net.DeviceId; 39 import org.onlab.onos.net.DeviceId;
38 import org.onlab.onos.net.Host; 40 import org.onlab.onos.net.Host;
...@@ -106,7 +108,8 @@ public class SimpleHostStore ...@@ -106,7 +108,8 @@ public class SimpleHostStore
106 descr.hwAddress(), 108 descr.hwAddress(),
107 descr.vlan(), 109 descr.vlan(),
108 descr.location(), 110 descr.location(),
109 - ImmutableSet.copyOf(descr.ipAddress())); 111 + ImmutableSet.copyOf(descr.ipAddress()),
112 + descr.annotations());
110 synchronized (this) { 113 synchronized (this) {
111 hosts.put(hostId, newhost); 114 hosts.put(hostId, newhost);
112 locations.put(descr.location(), newhost); 115 locations.put(descr.location(), newhost);
...@@ -123,15 +126,19 @@ public class SimpleHostStore ...@@ -123,15 +126,19 @@ public class SimpleHostStore
123 return new HostEvent(HOST_MOVED, host); 126 return new HostEvent(HOST_MOVED, host);
124 } 127 }
125 128
126 - if (host.ipAddresses().containsAll(descr.ipAddress())) { 129 + if (host.ipAddresses().containsAll(descr.ipAddress()) &&
130 + descr.annotations().keys().isEmpty()) {
127 return null; 131 return null;
128 } 132 }
129 133
130 Set<IpAddress> addresses = new HashSet<>(host.ipAddresses()); 134 Set<IpAddress> addresses = new HashSet<>(host.ipAddresses());
131 addresses.addAll(descr.ipAddress()); 135 addresses.addAll(descr.ipAddress());
136 + Annotations annotations = merge((DefaultAnnotations) host.annotations(),
137 + descr.annotations());
132 StoredHost updated = new StoredHost(providerId, host.id(), 138 StoredHost updated = new StoredHost(providerId, host.id(),
133 host.mac(), host.vlan(), 139 host.mac(), host.vlan(),
134 - descr.location(), addresses); 140 + descr.location(), addresses,
141 + annotations);
135 event = new HostEvent(HOST_UPDATED, updated); 142 event = new HostEvent(HOST_UPDATED, updated);
136 synchronized (this) { 143 synchronized (this) {
137 hosts.put(host.id(), updated); 144 hosts.put(host.id(), updated);
......
1 +{
2 + "devices": [
3 + { "name": "CMBR", "alias": "s1", "uri": "of:0000000000000001", "mac": "000000000001", "annotations": { "latitude": 42.373730, "longitude": -71.109734 }, "type": "SWITCH" },
4 + { "name": "CHCG", "alias": "s2", "uri": "of:0000000000000002", "mac": "000000000002", "annotations": { "latitude": 41.877461, "longitude": -87.642892 }, "type": "SWITCH" },
5 + { "name": "CLEV", "alias": "s3", "uri": "of:0000000000000003", "mac": "000000000003", "annotations": { "latitude": 41.498928, "longitude": -81.695217 }, "type": "SWITCH" },
6 + { "name": "RLGH", "alias": "s4", "uri": "of:0000000000000004", "mac": "000000000004", "annotations": { "latitude": 35.780150, "longitude": -78.644026 }, "type": "SWITCH" },
7 + { "name": "ATLN", "alias": "s5", "uri": "of:0000000000000005", "mac": "000000000005", "annotations": { "latitude": 33.749017, "longitude": -84.394168 }, "type": "SWITCH" },
8 + { "name": "PHLA", "alias": "s6", "uri": "of:0000000000000006", "mac": "000000000006", "annotations": { "latitude": 39.952906, "longitude": -75.172278 }, "type": "SWITCH" },
9 + { "name": "WASH", "alias": "s7", "uri": "of:0000000000000007", "mac": "000000000007", "annotations": { "latitude": 38.906696, "longitude": -77.035509 }, "type": "SWITCH" },
10 + { "name": "NSVL", "alias": "s8", "uri": "of:0000000000000008", "mac": "000000000008", "annotations": { "latitude": 36.166410, "longitude": -86.787305 }, "type": "SWITCH" },
11 + { "name": "STLS", "alias": "s9", "uri": "of:0000000000000009", "mac": "000000000009", "annotations": { "latitude": 38.626418, "longitude": -90.198143 }, "type": "SWITCH" },
12 + { "name": "NWOR", "alias": "s10", "uri": "of:000000000000000a", "mac": "00000000000a", "annotations": { "Xlatitude": 0.0, "Xlongitude": 0.00 }, "type": "SWITCH" },
13 + { "name": "HSTN", "alias": "s11", "uri": "of:000000000000000b", "mac": "00000000000b", "annotations": { "latitude": 29.763249, "longitude": -95.368332 }, "type": "SWITCH" },
14 + { "name": "SNAN", "alias": "s12", "uri": "of:000000000000000c", "mac": "00000000000c", "annotations": { "latitude": 29.424331, "longitude": -98.491745 }, "type": "SWITCH" },
15 + { "name": "DLLS", "alias": "s13", "uri": "of:000000000000000d", "mac": "00000000000d", "annotations": { "latitude": 32.777665, "longitude": -96.802064 }, "type": "SWITCH" },
16 + { "name": "ORLD", "alias": "s14", "uri": "of:000000000000000e", "mac": "00000000000e", "annotations": { "latitude": 28.538641, "longitude": -81.381110 }, "type": "SWITCH" },
17 + { "name": "DNVR", "alias": "s15", "uri": "of:000000000000000f", "mac": "00000000000f", "annotations": { "latitude": 39.736623, "longitude": -104.984887 }, "type": "SWITCH" },
18 + { "name": "KSCY", "alias": "s16", "uri": "of:0000000000000010", "mac": "000000000010", "annotations": { "latitude": 39.100725, "longitude": -94.581228 }, "type": "SWITCH" },
19 + { "name": "SNFN", "alias": "s17", "uri": "of:0000000000000011", "mac": "000000000011", "annotations": { "latitude": 37.779751, "longitude": -122.409791 }, "type": "SWITCH" },
20 + { "name": "SCRM", "alias": "s18", "uri": "of:0000000000000012", "mac": "000000000012", "annotations": { "latitude": 38.581001, "longitude": -121.497844 }, "type": "SWITCH" },
21 + { "name": "PTLD", "alias": "s19", "uri": "of:0000000000000013", "mac": "000000000013", "annotations": { "latitude": 45.523317, "longitude": -122.677768 }, "type": "SWITCH" },
22 + { "name": "STTL", "alias": "s20", "uri": "of:0000000000000014", "mac": "000000000014", "annotations": { "latitude": 47.607326, "longitude": -122.331786 }, "type": "SWITCH" },
23 + { "name": "SLKC", "alias": "s21", "uri": "of:0000000000000015", "mac": "000000000015", "annotations": { "latitude": 40.759577, "longitude": -111.895079 }, "type": "SWITCH" },
24 + { "name": "LA03", "alias": "s22", "uri": "of:0000000000000016", "mac": "000000000016", "annotations": { "latitude": 34.056346, "longitude": -118.235951 }, "type": "SWITCH" },
25 + { "name": "SNDG", "alias": "s23", "uri": "of:0000000000000017", "mac": "000000000017", "annotations": { "latitude": 32.714564, "longitude": -117.153528 }, "type": "SWITCH" },
26 + { "name": "PHNX", "alias": "s24", "uri": "of:0000000000000018", "mac": "000000000018", "annotations": { "latitude": 33.448289, "longitude": -112.076299 }, "type": "SWITCH" },
27 + { "name": "NY54", "alias": "s25", "uri": "of:0000000000000019", "mac": "000000000019", "annotations": { "latitude": 40.728270, "longitude": -73.994483 }, "type": "SWITCH" }
28 + ],
29 +
30 + "hosts": [
31 + { "name": "CMBR", "alias": "h1", "mac": "00:00:00:00:00:01", "vlan": -1, "location": "of:0000000000000001/1", "ip": "10.0.0.1", "annotations": { "latitude": 44.373730, "longitude": -71.109734 } },
32 + { "name": "CHCG", "alias": "h2", "mac": "00:00:00:00:00:02", "vlan": -1, "location": "of:0000000000000002/1", "ip": "10.0.0.2", "annotations": { "latitude": 43.877461, "longitude": -87.642892 } },
33 + { "name": "CLEV", "alias": "h3", "mac": "00:00:00:00:00:03", "vlan": -1, "location": "of:0000000000000003/1", "ip": "10.0.0.3", "annotations": { "latitude": 43.498928, "longitude": -81.695217 } },
34 + { "name": "RLGH", "alias": "h4", "mac": "00:00:00:00:00:04", "vlan": -1, "location": "of:0000000000000004/1", "ip": "10.0.0.4", "annotations": { "latitude": 37.780150, "longitude": -78.644026 } },
35 + { "name": "ATLN", "alias": "h5", "mac": "00:00:00:00:00:05", "vlan": -1, "location": "of:0000000000000005/1", "ip": "10.0.0.5", "annotations": { "latitude": 35.749017, "longitude": -84.394168 } },
36 + { "name": "PHLA", "alias": "h6", "mac": "00:00:00:00:00:06", "vlan": -1, "location": "of:0000000000000006/1", "ip": "10.0.0.6", "annotations": { "latitude": 41.952906, "longitude": -75.172278 } },
37 + { "name": "WASH", "alias": "h7", "mac": "00:00:00:00:00:07", "vlan": -1, "location": "of:0000000000000007/1", "ip": "10.0.0.7", "annotations": { "latitude": 40.906696, "longitude": -77.035509 } },
38 + { "name": "NSVL", "alias": "h8", "mac": "00:00:00:00:00:08", "vlan": -1, "location": "of:0000000000000008/1", "ip": "10.0.0.8", "annotations": { "latitude": 38.166410, "longitude": -86.787305 } },
39 + { "name": "STLS", "alias": "h9", "mac": "00:00:00:00:00:09", "vlan": -1, "location": "of:0000000000000009/1", "ip": "10.0.0.9", "annotations": { "latitude": 40.626418, "longitude": -90.198143 } },
40 + { "name": "NWOR", "alias": "h10", "mac": "00:00:00:00:00:0a", "vlan": -1, "location": "of:000000000000000a/1", "ip": "10.0.0.10", "annotations": { "Xlatitude": 0.0, "Xlongitude": 0.00 } },
41 + { "name": "HSTN", "alias": "h11", "mac": "00:00:00:00:00:0b", "vlan": -1, "location": "of:000000000000000b/1", "ip": "10.0.0.11", "annotations": { "latitude": 31.763249, "longitude": -95.368332 } },
42 + { "name": "SNAN", "alias": "h12", "mac": "00:00:00:00:00:0c", "vlan": -1, "location": "of:000000000000000c/1", "ip": "10.0.0.12", "annotations": { "latitude": 31.424331, "longitude": -98.491745 } },
43 + { "name": "DLLS", "alias": "h13", "mac": "00:00:00:00:00:0d", "vlan": -1, "location": "of:000000000000000d/1", "ip": "10.0.0.13", "annotations": { "latitude": 34.777665, "longitude": -96.802064 } },
44 + { "name": "ORLD", "alias": "h14", "mac": "00:00:00:00:00:0e", "vlan": -1, "location": "of:000000000000000e/1", "ip": "10.0.0.14", "annotations": { "latitude": 31.538641, "longitude": -81.381110 } },
45 + { "name": "DNVR", "alias": "h15", "mac": "00:00:00:00:00:0f", "vlan": -1, "location": "of:000000000000000f/1", "ip": "10.0.0.15", "annotations": { "latitude": 41.736623, "longitude": -104.984887 } },
46 + { "name": "KSCY", "alias": "h16", "mac": "00:00:00:00:00:10", "vlan": -1, "location": "of:0000000000000010/1", "ip": "10.0.0.16", "annotations": { "latitude": 41.100725, "longitude": -94.581228 } },
47 + { "name": "SNFN", "alias": "h17", "mac": "00:00:00:00:00:11", "vlan": -1, "location": "of:0000000000000011/1", "ip": "10.0.0.17", "annotations": { "latitude": 39.779751, "longitude": -122.409791 } },
48 + { "name": "SCRM", "alias": "h18", "mac": "00:00:00:00:00:12", "vlan": -1, "location": "of:0000000000000012/1", "ip": "10.0.0.18", "annotations": { "latitude": 40.581001, "longitude": -121.497844 } },
49 + { "name": "PTLD", "alias": "h19", "mac": "00:00:00:00:00:13", "vlan": -1, "location": "of:0000000000000013/1", "ip": "10.0.0.19", "annotations": { "latitude": 47.523317, "longitude": -122.677768 } },
50 + { "name": "STTL", "alias": "h20", "mac": "00:00:00:00:00:14", "vlan": -1, "location": "of:0000000000000014/1", "ip": "10.0.0.20", "annotations": { "latitude": 49.607326, "longitude": -122.331786 } },
51 + { "name": "SLKC", "alias": "h21", "mac": "00:00:00:00:00:15", "vlan": -1, "location": "of:0000000000000015/1", "ip": "10.0.0.21", "annotations": { "latitude": 42.759577, "longitude": -111.895079 } },
52 + { "name": "LA03", "alias": "h22", "mac": "00:00:00:00:00:16", "vlan": -1, "location": "of:0000000000000016/1", "ip": "10.0.0.22", "annotations": { "latitude": 36.056346, "longitude": -118.235951 } },
53 + { "name": "SNDG", "alias": "h23", "mac": "00:00:00:00:00:17", "vlan": -1, "location": "of:0000000000000017/1", "ip": "10.0.0.23", "annotations": { "latitude": 34.714564, "longitude": -117.153528 } },
54 + { "name": "PHNX", "alias": "h24", "mac": "00:00:00:00:00:18", "vlan": -1, "location": "of:0000000000000018/1", "ip": "10.0.0.24", "annotations": { "latitude": 35.448289, "longitude": -112.076299 } },
55 + { "name": "NY54", "alias": "h25", "mac": "00:00:00:00:00:19", "vlan": -1, "location": "of:0000000000000019/1", "ip": "10.0.0.25", "annotations": { "latitude": 42.728270, "longitude": -73.994483 } }
56 + ]
57 +
58 +}
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...
25 + NY54 = self.addSwitch( 's25' ) // 40.728270, -73.994483
26 + CMBR = self.addSwitch( 's1' ) // 42.373730, -71.109734
27 + CHCG = self.addSwitch( 's2' ) // 41.877461, -87.642892
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
34 + STLS = self.addSwitch( 's9' ) // 38.626418, -90.198143
35 + NWOR = self.addSwitch( 's10' ) //
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
47 + LA03 = self.addSwitch( 's22' ) // 34.056346, -118.235951
48 + SNDG = self.addSwitch( 's23' ) // 32.714564, -117.153528
49 + PHNX = self.addSwitch( 's24' ) // 33.448289, -112.076299
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')
107 + self.addLink( NY54 , CHCG, bw=10, delay='0.806374975652ms')
108 + self.addLink( NY54 , PHLA, bw=10, delay='0.686192970166ms')
109 + self.addLink( NY54 , WASH, bw=10, delay='0.605826192092ms')
110 + self.addLink( CMBR , PHLA, bw=10, delay='1.4018238197ms')
111 + self.addLink( CHCG , CLEV, bw=10, delay='0.232315346482ms')
112 + self.addLink( CHCG , PHLA, bw=10, delay='1.07297714274ms')
113 + self.addLink( CHCG , STLS, bw=10, delay='1.12827896944ms')
114 + self.addLink( CHCG , DNVR, bw=10, delay='1.35964770335ms')
115 + self.addLink( CHCG , KSCY, bw=10, delay='1.5199778541ms')
116 + self.addLink( CHCG , SNFN, bw=10, delay='0.620743405435ms')
117 + self.addLink( CHCG , STTL, bw=10, delay='0.93027212534ms')
118 + self.addLink( CHCG , SLKC, bw=10, delay='0.735621751348ms')
119 + self.addLink( CLEV , NSVL, bw=10, delay='0.523419372248ms')
120 + self.addLink( CLEV , STLS, bw=10, delay='1.00360290845ms')
121 + self.addLink( CLEV , PHLA, bw=10, delay='0.882912133249ms')
122 + self.addLink( RLGH , ATLN, bw=10, delay='1.1644489729ms')
123 + self.addLink( RLGH , WASH, bw=10, delay='1.48176810502ms')
124 + self.addLink( ATLN , WASH, bw=10, delay='0.557636936322ms')
125 + self.addLink( ATLN , NSVL, bw=10, delay='1.32869749865ms')
126 + self.addLink( ATLN , STLS, bw=10, delay='0.767705554748ms')
127 + self.addLink( ATLN , DLLS, bw=10, delay='0.544782086448ms')
128 + self.addLink( ATLN , ORLD, bw=10, delay='1.46119152532ms')
129 + self.addLink( PHLA , WASH, bw=10, delay='0.372209320106ms')
130 + self.addLink( NSVL , STLS, bw=10, delay='1.43250491305ms')
131 + self.addLink( NSVL , DLLS, bw=10, delay='1.67698215288ms')
132 + self.addLink( STLS , DLLS, bw=10, delay='0.256389964194ms')
133 + self.addLink( STLS , KSCY, bw=10, delay='0.395511571791ms')
134 + self.addLink( STLS , LA03, bw=10, delay='0.257085227363ms')
135 + self.addLink( NWOR , HSTN, bw=10, delay='0.0952906633914ms')
136 + self.addLink( NWOR , DLLS, bw=10, delay='1.60231329739ms')
137 + self.addLink( NWOR , ORLD, bw=10, delay='0.692731063896ms')
138 + self.addLink( HSTN , SNAN, bw=10, delay='0.284150653798ms')
139 + self.addLink( HSTN , DLLS, bw=10, delay='1.65690128332ms')
140 + self.addLink( HSTN , ORLD, bw=10, delay='0.731886304782ms')
141 + self.addLink( SNAN , PHNX, bw=10, delay='1.34258627257ms')
142 + self.addLink( SNAN , DLLS, bw=10, delay='1.50063532341ms')
143 + self.addLink( DLLS , DNVR, bw=10, delay='0.251471593235ms')
144 + self.addLink( DLLS , KSCY, bw=10, delay='0.18026026737ms')
145 + self.addLink( DLLS , SNFN, bw=10, delay='0.74304274592ms')
146 + self.addLink( DLLS , LA03, bw=10, delay='0.506439293357ms')
147 + self.addLink( DNVR , KSCY, bw=10, delay='0.223328790403ms')
148 + self.addLink( DNVR , SNFN, bw=10, delay='0.889017541903ms')
149 + self.addLink( DNVR , SLKC, bw=10, delay='0.631898982721ms')
150 + self.addLink( KSCY , SNFN, bw=10, delay='0.922778522233ms')
151 + self.addLink( SNFN , SCRM, bw=10, delay='0.630352278097ms')
152 + self.addLink( SNFN , PTLD, bw=10, delay='0.828572513655ms')
153 + self.addLink( SNFN , STTL, bw=10, delay='1.54076081649ms')
154 + self.addLink( SNFN , SLKC, bw=10, delay='0.621507502625ms')
155 + self.addLink( SNFN , LA03, bw=10, delay='0.602936230151ms')
156 + self.addLink( SCRM , SLKC, bw=10, delay='0.461350343644ms')
157 + self.addLink( PTLD , STTL, bw=10, delay='1.17591515181ms')
158 + self.addLink( SLKC , LA03, bw=10, delay='0.243225267023ms')
159 + self.addLink( LA03 , SNDG, bw=10, delay='0.681264950821ms')
160 + self.addLink( LA03 , PHNX, bw=10, delay='0.343709457969ms')
161 + # self.addLink( LA03 , PHNX, bw=10, delay='0.343709457969ms')
162 + self.addLink( SNDG , PHNX, bw=10, delay='0.345064487693ms')
163 +
164 +topos = { 'att': ( lambda: AttMplsTopo() ) }
1 +#!/bin/bash
2 +cd ~/topos && sudo mn --custom att-mpls.py --topo att --link tc --controller remote,${1:-192.168.56.101} --mac \
3 + --switch ovsk,protocols=OpenFlow10
...@@ -34,11 +34,11 @@ ...@@ -34,11 +34,11 @@
34 ], 34 ],
35 35
36 "links" : [ 36 "links" : [
37 - { "src": "of:0000ffffffffff01/20", "dst": "of:0000ffffffffff03/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true" } }, 37 + { "src": "of:0000ffffffffff01/20", "dst": "of:0000ffffffffff03/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
38 - { "src": "of:0000ffffffffff02/21", "dst": "of:0000ffffffffff03/31", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true" } }, 38 + { "src": "of:0000ffffffffff02/21", "dst": "of:0000ffffffffff03/31", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
39 39
40 - { "src": "of:0000ffffffff0001/2", "dst": "of:0000ffffffffff01/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, 40 + { "src": "of:0000ffffffff0001/2", "dst": "of:0000ffffffffff01/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } },
41 - { "src": "of:0000ffffffff0002/2", "dst": "of:0000ffffffffff02/11", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } } 41 + { "src": "of:0000ffffffff0002/2", "dst": "of:0000ffffffffff02/11", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } }
42 ], 42 ],
43 43
44 "hosts" : [ 44 "hosts" : [
......
...@@ -124,26 +124,26 @@ ...@@ -124,26 +124,26 @@
124 ], 124 ],
125 125
126 "links" : [ 126 "links" : [
127 - { "src": "of:0000ffffffffff01/50", "dst": "of:0000ffffffffff02/30","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 48, "durable": "true" } }, 127 + { "src": "of:0000ffffffffff01/50", "dst": "of:0000ffffffffff02/30","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 48, "durable": "true", "inactive": "true" } },
128 - { "src": "of:0000ffffffffff02/50", "dst": "of:0000ffffffffff03/30","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 493, "durable": "true" } }, 128 + { "src": "of:0000ffffffffff02/50", "dst": "of:0000ffffffffff03/30","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 493, "durable": "true", "inactive": "true" } },
129 - { "src": "of:0000ffffffffff03/50", "dst": "of:0000ffffffffff04/50","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 171, "durable": "true" } }, 129 + { "src": "of:0000ffffffffff03/50", "dst": "of:0000ffffffffff04/50","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 171, "durable": "true", "inactive": "true" } },
130 - { "src": "of:0000ffffffffff01/20", "dst": "of:0000ffffffffff05/50","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2555, "durable": "true" } }, 130 + { "src": "of:0000ffffffffff01/20", "dst": "of:0000ffffffffff05/50","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2555, "durable": "true", "inactive": "true" } },
131 - { "src": "of:0000ffffffffff02/20", "dst": "of:0000ffffffffff05/20","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2539, "durable": "true" } }, 131 + { "src": "of:0000ffffffffff02/20", "dst": "of:0000ffffffffff05/20","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2539, "durable": "true", "inactive": "true" } },
132 - { "src": "of:0000ffffffffff03/20", "dst": "of:0000ffffffffff06/50","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1979, "durable": "true" } }, 132 + { "src": "of:0000ffffffffff03/20", "dst": "of:0000ffffffffff06/50","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1979, "durable": "true", "inactive": "true" } },
133 - { "src": "of:0000ffffffffff04/20", "dst": "of:0000ffffffffff06/20","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1867, "durable": "true" } }, 133 + { "src": "of:0000ffffffffff04/20", "dst": "of:0000ffffffffff06/20","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1867, "durable": "true", "inactive": "true" } },
134 - { "src": "of:0000ffffffffff05/30", "dst": "of:0000ffffffffff06/40","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1378, "durable": "true" } }, 134 + { "src": "of:0000ffffffffff05/30", "dst": "of:0000ffffffffff06/40","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1378, "durable": "true", "inactive": "true" } },
135 - { "src": "of:0000ffffffffff05/40", "dst": "of:0000ffffffffff07/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2200, "durable": "true" } }, 135 + { "src": "of:0000ffffffffff05/40", "dst": "of:0000ffffffffff07/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2200, "durable": "true", "inactive": "true" } },
136 - { "src": "of:0000ffffffffff06/30", "dst": "of:0000ffffffffff08/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1918, "durable": "true" } }, 136 + { "src": "of:0000ffffffffff06/30", "dst": "of:0000ffffffffff08/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1918, "durable": "true", "inactive": "true" } },
137 - { "src": "of:0000ffffffffff07/20", "dst": "of:0000ffffffffff08/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 3625, "durable": "true" } }, 137 + { "src": "of:0000ffffffffff07/20", "dst": "of:0000ffffffffff08/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 3625, "durable": "true", "inactive": "true" } },
138 - { "src": "of:0000ffffffffff07/30", "dst": "of:0000ffffffffff09/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 3880, "durable": "true" } }, 138 + { "src": "of:0000ffffffffff07/30", "dst": "of:0000ffffffffff09/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 3880, "durable": "true", "inactive": "true" } },
139 - { "src": "of:0000ffffffffff08/20", "dst": "of:0000ffffffffff0A/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 838, "durable": "true" } }, 139 + { "src": "of:0000ffffffffff08/20", "dst": "of:0000ffffffffff0A/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 838, "durable": "true", "inactive": "true" } },
140 - { "src": "of:0000ffffffffff09/20", "dst": "of:0000ffffffffff0A/20","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1245, "durable": "true" } }, 140 + { "src": "of:0000ffffffffff09/20", "dst": "of:0000ffffffffff0A/20","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1245, "durable": "true", "inactive": "true" } },
141 141
142 - { "src": "of:0000ffffffff0001/2", "dst": "of:0000ffffffffff01/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, 142 + { "src": "of:0000ffffffff0001/2", "dst": "of:0000ffffffffff01/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } },
143 - { "src": "of:0000ffffffff0002/2", "dst": "of:0000ffffffffff04/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, 143 + { "src": "of:0000ffffffff0002/2", "dst": "of:0000ffffffffff04/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } },
144 - { "src": "of:0000ffffffff0003/2", "dst": "of:0000ffffffffff06/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, 144 + { "src": "of:0000ffffffff0003/2", "dst": "of:0000ffffffffff06/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } },
145 - { "src": "of:0000ffffffff0004/2", "dst": "of:0000ffffffffff07/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, 145 + { "src": "of:0000ffffffff0004/2", "dst": "of:0000ffffffffff07/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } },
146 - { "src": "of:0000ffffffff0005/2", "dst": "of:0000ffffffffff09/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, 146 + { "src": "of:0000ffffffff0005/2", "dst": "of:0000ffffffffff09/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } },
147 - { "src": "of:0000ffffffff0006/2", "dst": "of:0000ffffffffff0A/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } } 147 + { "src": "of:0000ffffffff0006/2", "dst": "of:0000ffffffffff0A/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } }
148 ] 148 ]
149 } 149 }
......
...@@ -39,13 +39,13 @@ ...@@ -39,13 +39,13 @@
39 ], 39 ],
40 40
41 "links" : [ 41 "links" : [
42 - { "src": "of:0000ffffffffff01/20", "dst": "of:0000ffffffffff03/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true" } }, 42 + { "src": "of:0000ffffffffff01/20", "dst": "of:0000ffffffffff03/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
43 - { "src": "of:0000ffffffffff02/21", "dst": "of:0000ffffffffff03/31", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true" } }, 43 + { "src": "of:0000ffffffffff02/21", "dst": "of:0000ffffffffff03/31", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
44 - { "src": "of:0000ffffffffff01/22", "dst": "of:0000ffffffffff04/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true" } }, 44 + { "src": "of:0000ffffffffff01/22", "dst": "of:0000ffffffffff04/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
45 - { "src": "of:0000ffffffffff04/31", "dst": "of:0000ffffffffff02/22", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true" } }, 45 + { "src": "of:0000ffffffffff04/31", "dst": "of:0000ffffffffff02/22", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
46 46
47 - { "src": "of:0000ffffffff0001/2", "dst": "of:0000ffffffffff01/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, 47 + { "src": "of:0000ffffffff0001/2", "dst": "of:0000ffffffffff01/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } },
48 - { "src": "of:0000ffffffff0002/2", "dst": "of:0000ffffffffff02/11", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } } 48 + { "src": "of:0000ffffffff0002/2", "dst": "of:0000ffffffffff02/11", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } }
49 ] 49 ]
50 50
51 } 51 }
......
1 +#!/bin/bash
2 +cd ~/topos && sudo mn --custom tower.py --topo tower --controller remote,${1:-192.168.56.101} --mac
...@@ -188,7 +188,8 @@ public abstract class TopologyViewMessages { ...@@ -188,7 +188,8 @@ public abstract class TopologyViewMessages {
188 ControllerNode node = event.subject(); 188 ControllerNode node = event.subject();
189 ObjectNode payload = mapper.createObjectNode() 189 ObjectNode payload = mapper.createObjectNode()
190 .put("id", node.id().toString()) 190 .put("id", node.id().toString())
191 - .put("online", clusterService.getState(node.id()) == ACTIVE); 191 + .put("online", clusterService.getState(node.id()) == ACTIVE)
192 + .put("uiAttached", event.subject().equals(clusterService.getLocalNode()));
192 193
193 ArrayNode labels = mapper.createArrayNode(); 194 ArrayNode labels = mapper.createArrayNode();
194 labels.add(node.id().toString()); 195 labels.add(node.id().toString());
...@@ -236,7 +237,7 @@ public abstract class TopologyViewMessages { ...@@ -236,7 +237,7 @@ public abstract class TopologyViewMessages {
236 ObjectNode payload = mapper.createObjectNode() 237 ObjectNode payload = mapper.createObjectNode()
237 .put("id", compactLinkString(link)) 238 .put("id", compactLinkString(link))
238 .put("type", link.type().toString().toLowerCase()) 239 .put("type", link.type().toString().toLowerCase())
239 - .put("online", true) // link.state()) TODO: add link state field 240 + .put("online", link.state() == Link.State.ACTIVE)
240 .put("linkWidth", 2) 241 .put("linkWidth", 2)
241 .put("src", link.src().deviceId().toString()) 242 .put("src", link.src().deviceId().toString())
242 .put("srcPort", link.src().port().toString()) 243 .put("srcPort", link.src().port().toString())
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
30 var api = onos.api; 30 var api = onos.api;
31 31
32 // Config variables 32 // Config variables
33 - var guiTitle = 'Open Networking Operating System'; 33 + var guiTitle = 'Open Network Operating System';
34 34
35 // DOM elements and the like 35 // DOM elements and the like
36 var mast = d3.select('#mast'); 36 var mast = d3.select('#mast');
......
...@@ -108,6 +108,11 @@ ...@@ -108,6 +108,11 @@
108 opacity: .7; 108 opacity: .7;
109 } 109 }
110 110
111 +#topo svg .link.inactive {
112 + opacity: .2;
113 + stroke-dasharray: 8 4;
114 +}
115 +
111 #topo svg .link.primary { 116 #topo svg .link.primary {
112 stroke: #f11; 117 stroke: #f11;
113 stroke-width: 6px; 118 stroke-width: 6px;
......
...@@ -826,7 +826,7 @@ ...@@ -826,7 +826,7 @@
826 // merge in remaining data 826 // merge in remaining data
827 $.extend(lnk, link, { 827 $.extend(lnk, link, {
828 class: 'link', 828 class: 'link',
829 - svgClass: type ? 'link ' + type : 'link' 829 + svgClass: (type ? 'link ' + type : 'link') + ' ' + (link.online ? 'active' : 'inactive')
830 }); 830 });
831 return lnk; 831 return lnk;
832 } 832 }
......