Committed by
Gerrit Code Review
Added a number of demo-related artifacts. Enhanced GUI a bit.
Change-Id: I4501cb338f9eab07420fb60e347167deda5074be
Showing
11 changed files
with
273 additions
and
23 deletions
| ... | @@ -15,11 +15,7 @@ | ... | @@ -15,11 +15,7 @@ |
| 15 | */ | 15 | */ |
| 16 | package org.onlab.onos.store.statistic.impl; | 16 | package org.onlab.onos.store.statistic.impl; |
| 17 | 17 | ||
| 18 | -import static org.onlab.onos.store.statistic.impl.StatisticStoreMessageSubjects.*; | ||
| 19 | -import static org.slf4j.LoggerFactory.getLogger; | ||
| 20 | - | ||
| 21 | import com.google.common.collect.Sets; | 18 | import com.google.common.collect.Sets; |
| 22 | - | ||
| 23 | import org.apache.felix.scr.annotations.Activate; | 19 | import org.apache.felix.scr.annotations.Activate; |
| 24 | import org.apache.felix.scr.annotations.Component; | 20 | import org.apache.felix.scr.annotations.Component; |
| 25 | import org.apache.felix.scr.annotations.Deactivate; | 21 | import org.apache.felix.scr.annotations.Deactivate; |
| ... | @@ -57,6 +53,10 @@ import java.util.concurrent.TimeUnit; | ... | @@ -57,6 +53,10 @@ import java.util.concurrent.TimeUnit; |
| 57 | import java.util.concurrent.TimeoutException; | 53 | import java.util.concurrent.TimeoutException; |
| 58 | import java.util.concurrent.atomic.AtomicInteger; | 54 | import java.util.concurrent.atomic.AtomicInteger; |
| 59 | 55 | ||
| 56 | +import static org.onlab.onos.store.statistic.impl.StatisticStoreMessageSubjects.GET_CURRENT; | ||
| 57 | +import static org.onlab.onos.store.statistic.impl.StatisticStoreMessageSubjects.GET_PREVIOUS; | ||
| 58 | +import static org.slf4j.LoggerFactory.getLogger; | ||
| 59 | + | ||
| 60 | 60 | ||
| 61 | /** | 61 | /** |
| 62 | * Maintains statistics using RPC calls to collect stats from remote instances | 62 | * Maintains statistics using RPC calls to collect stats from remote instances |
| ... | @@ -69,13 +69,13 @@ public class DistributedStatisticStore implements StatisticStore { | ... | @@ -69,13 +69,13 @@ public class DistributedStatisticStore implements StatisticStore { |
| 69 | private final Logger log = getLogger(getClass()); | 69 | private final Logger log = getLogger(getClass()); |
| 70 | 70 | ||
| 71 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 71 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 72 | - private ReplicaInfoService replicaInfoManager; | 72 | + protected ReplicaInfoService replicaInfoManager; |
| 73 | 73 | ||
| 74 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 74 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 75 | - private ClusterCommunicationService clusterCommunicator; | 75 | + protected ClusterCommunicationService clusterCommunicator; |
| 76 | 76 | ||
| 77 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 77 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 78 | - private ClusterService clusterService; | 78 | + protected ClusterService clusterService; |
| 79 | 79 | ||
| 80 | private Map<ConnectPoint, InternalStatisticRepresentation> representations = | 80 | private Map<ConnectPoint, InternalStatisticRepresentation> representations = |
| 81 | new ConcurrentHashMap<>(); | 81 | new ConcurrentHashMap<>(); |
| ... | @@ -197,9 +197,7 @@ public class DistributedStatisticStore implements StatisticStore { | ... | @@ -197,9 +197,7 @@ public class DistributedStatisticStore implements StatisticStore { |
| 197 | ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(deviceId); | 197 | ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(deviceId); |
| 198 | if (!replicaInfo.master().isPresent()) { | 198 | if (!replicaInfo.master().isPresent()) { |
| 199 | log.warn("No master for {}", deviceId); | 199 | log.warn("No master for {}", deviceId); |
| 200 | - // TODO: revisit if this should be returning empty collection. | 200 | + return Collections.emptySet(); |
| 201 | - // FIXME: throw a StatsStoreException | ||
| 202 | - throw new RuntimeException("No master for " + deviceId); | ||
| 203 | } | 201 | } |
| 204 | if (replicaInfo.master().get().equals(clusterService.getLocalNode().id())) { | 202 | if (replicaInfo.master().get().equals(clusterService.getLocalNode().id())) { |
| 205 | return getCurrentStatisticInternal(connectPoint); | 203 | return getCurrentStatisticInternal(connectPoint); |
| ... | @@ -215,8 +213,8 @@ public class DistributedStatisticStore implements StatisticStore { | ... | @@ -215,8 +213,8 @@ public class DistributedStatisticStore implements StatisticStore { |
| 215 | return SERIALIZER.decode(response.get(STATISTIC_STORE_TIMEOUT_MILLIS, | 213 | return SERIALIZER.decode(response.get(STATISTIC_STORE_TIMEOUT_MILLIS, |
| 216 | TimeUnit.MILLISECONDS)); | 214 | TimeUnit.MILLISECONDS)); |
| 217 | } catch (IOException | TimeoutException | ExecutionException | InterruptedException e) { | 215 | } catch (IOException | TimeoutException | ExecutionException | InterruptedException e) { |
| 218 | - // FIXME: throw a StatsStoreException | 216 | + log.warn("Unable to communicate with peer {}", replicaInfo.master().get()); |
| 219 | - throw new RuntimeException(e); | 217 | + return Collections.emptySet(); |
| 220 | } | 218 | } |
| 221 | } | 219 | } |
| 222 | 220 | ||
| ... | @@ -232,9 +230,7 @@ public class DistributedStatisticStore implements StatisticStore { | ... | @@ -232,9 +230,7 @@ public class DistributedStatisticStore implements StatisticStore { |
| 232 | ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(deviceId); | 230 | ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(deviceId); |
| 233 | if (!replicaInfo.master().isPresent()) { | 231 | if (!replicaInfo.master().isPresent()) { |
| 234 | log.warn("No master for {}", deviceId); | 232 | log.warn("No master for {}", deviceId); |
| 235 | - // TODO: revisit if this should be returning empty collection. | 233 | + return Collections.emptySet(); |
| 236 | - // FIXME: throw a StatsStoreException | ||
| 237 | - throw new RuntimeException("No master for " + deviceId); | ||
| 238 | } | 234 | } |
| 239 | if (replicaInfo.master().get().equals(clusterService.getLocalNode().id())) { | 235 | if (replicaInfo.master().get().equals(clusterService.getLocalNode().id())) { |
| 240 | return getPreviousStatisticInternal(connectPoint); | 236 | return getPreviousStatisticInternal(connectPoint); |
| ... | @@ -250,8 +246,8 @@ public class DistributedStatisticStore implements StatisticStore { | ... | @@ -250,8 +246,8 @@ public class DistributedStatisticStore implements StatisticStore { |
| 250 | return SERIALIZER.decode(response.get(STATISTIC_STORE_TIMEOUT_MILLIS, | 246 | return SERIALIZER.decode(response.get(STATISTIC_STORE_TIMEOUT_MILLIS, |
| 251 | TimeUnit.MILLISECONDS)); | 247 | TimeUnit.MILLISECONDS)); |
| 252 | } catch (IOException | TimeoutException | ExecutionException | InterruptedException e) { | 248 | } catch (IOException | TimeoutException | ExecutionException | InterruptedException e) { |
| 253 | - // FIXME: throw a StatsStoreException | 249 | + log.warn("Unable to communicate with peer {}", replicaInfo.master().get()); |
| 254 | - throw new RuntimeException(e); | 250 | + return Collections.emptySet(); |
| 255 | } | 251 | } |
| 256 | } | 252 | } |
| 257 | 253 | ... | ... |
| ... | @@ -20,11 +20,13 @@ import org.apache.felix.scr.annotations.Component; | ... | @@ -20,11 +20,13 @@ import org.apache.felix.scr.annotations.Component; |
| 20 | import org.apache.felix.scr.annotations.Deactivate; | 20 | import org.apache.felix.scr.annotations.Deactivate; |
| 21 | import org.apache.felix.scr.annotations.Reference; | 21 | import org.apache.felix.scr.annotations.Reference; |
| 22 | import org.apache.felix.scr.annotations.ReferenceCardinality; | 22 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
| 23 | +import org.onlab.onos.net.DefaultAnnotations; | ||
| 23 | import org.onlab.onos.net.Device; | 24 | import org.onlab.onos.net.Device; |
| 24 | import org.onlab.onos.net.DeviceId; | 25 | import org.onlab.onos.net.DeviceId; |
| 25 | import org.onlab.onos.net.MastershipRole; | 26 | import org.onlab.onos.net.MastershipRole; |
| 26 | import org.onlab.onos.net.Port; | 27 | import org.onlab.onos.net.Port; |
| 27 | import org.onlab.onos.net.PortNumber; | 28 | import org.onlab.onos.net.PortNumber; |
| 29 | +import org.onlab.onos.net.SparseAnnotations; | ||
| 28 | import org.onlab.onos.net.device.DefaultDeviceDescription; | 30 | import org.onlab.onos.net.device.DefaultDeviceDescription; |
| 29 | import org.onlab.onos.net.device.DefaultPortDescription; | 31 | import org.onlab.onos.net.device.DefaultPortDescription; |
| 30 | import org.onlab.onos.net.device.DeviceDescription; | 32 | import org.onlab.onos.net.device.DeviceDescription; |
| ... | @@ -206,13 +208,15 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr | ... | @@ -206,13 +208,15 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr |
| 206 | Device.Type deviceType = sw.isOptical() ? Device.Type.ROADM : | 208 | Device.Type deviceType = sw.isOptical() ? Device.Type.ROADM : |
| 207 | Device.Type.SWITCH; | 209 | Device.Type.SWITCH; |
| 208 | ChassisId cId = new ChassisId(dpid.value()); | 210 | ChassisId cId = new ChassisId(dpid.value()); |
| 211 | + SparseAnnotations annotations = DefaultAnnotations.builder() | ||
| 212 | + .set("protocol", sw.factory().getVersion().toString()).build(); | ||
| 209 | DeviceDescription description = | 213 | DeviceDescription description = |
| 210 | new DefaultDeviceDescription(did.uri(), deviceType, | 214 | new DefaultDeviceDescription(did.uri(), deviceType, |
| 211 | sw.manfacturerDescription(), | 215 | sw.manfacturerDescription(), |
| 212 | sw.hardwareDescription(), | 216 | sw.hardwareDescription(), |
| 213 | sw.softwareDescription(), | 217 | sw.softwareDescription(), |
| 214 | sw.serialNumber(), | 218 | sw.serialNumber(), |
| 215 | - cId); | 219 | + cId, annotations); |
| 216 | providerService.deviceConnected(did, description); | 220 | providerService.deviceConnected(did, description); |
| 217 | providerService.updatePorts(did, buildPortDescriptions(sw.getPorts())); | 221 | providerService.updatePorts(did, buildPortDescriptions(sw.getPorts())); |
| 218 | } | 222 | } | ... | ... |
tools/test/topos/att-onos-ext.py
0 → 100644
| 1 | +#!/usr/bin/python | ||
| 2 | + | ||
| 3 | +import sys | ||
| 4 | + | ||
| 5 | +from mininet.net import Mininet | ||
| 6 | +from mininet.cli import CLI | ||
| 7 | +from mininet.log import setLogLevel | ||
| 8 | +from mininet.node import RemoteController | ||
| 9 | +from mininet.link import TCLink | ||
| 10 | + | ||
| 11 | +from attmplsext import AttMplsTopoExt | ||
| 12 | + | ||
| 13 | +setLogLevel( 'info' ) | ||
| 14 | + | ||
| 15 | +def run(controllers=[ '127.0.0.1' ]): | ||
| 16 | + net = Mininet( topo=AttMplsTopoExt(), link=TCLink, build=False, autoSetMacs=True ) | ||
| 17 | + ctrl_count = 0 | ||
| 18 | + for controllerIP in controllers: | ||
| 19 | + net.addController( 'c%d' % ctrl_count, RemoteController, ip=controllerIP ) | ||
| 20 | + net.build() | ||
| 21 | + net.start() | ||
| 22 | + CLI( net ) | ||
| 23 | + net.stop() | ||
| 24 | + | ||
| 25 | +if __name__ == '__main__': | ||
| 26 | + if len( sys.argv ) > 1: | ||
| 27 | + controllers = sys.argv[ 1: ] | ||
| 28 | + else: | ||
| 29 | + print 'Usage: att-onos-ext.py <c0 IP> <c1 IP> ...' | ||
| 30 | + exit( 1 ) | ||
| 31 | + run( controllers ) |
| ... | @@ -12,7 +12,16 @@ from attmpls import AttMplsTopo | ... | @@ -12,7 +12,16 @@ from attmpls import AttMplsTopo |
| 12 | 12 | ||
| 13 | setLogLevel( 'info' ) | 13 | setLogLevel( 'info' ) |
| 14 | 14 | ||
| 15 | +def pingloop( net ): | ||
| 16 | + setLogLevel( 'error' ) | ||
| 17 | + try: | ||
| 18 | + while True: | ||
| 19 | + net.ping() | ||
| 20 | + finally: | ||
| 21 | + setLogLevel( 'info' ) | ||
| 22 | + | ||
| 15 | def run(controllers=[ '127.0.0.1' ]): | 23 | def run(controllers=[ '127.0.0.1' ]): |
| 24 | + Mininet.pingloop = pingloop | ||
| 16 | net = Mininet( topo=AttMplsTopo(), link=TCLink, build=False, autoSetMacs=True ) | 25 | net = Mininet( topo=AttMplsTopo(), link=TCLink, build=False, autoSetMacs=True ) |
| 17 | ctrl_count = 0 | 26 | ctrl_count = 0 |
| 18 | for controllerIP in controllers: | 27 | for controllerIP in controllers: | ... | ... |
tools/test/topos/attmpls-intents
0 → 100755
| 1 | +#!/bin/bash | ||
| 2 | +# Creates some sample intents | ||
| 3 | +onos $OCI add-host-intent 00:00:00:00:00:15/-1 00:00:00:00:00:0b/-1 | ||
| 4 | +onos $OCI add-host-intent 00:00:00:00:00:15/-1 00:00:00:00:00:0e/-1 | ||
| 5 | +onos $OCI add-host-intent 00:00:00:00:00:10/-1 00:00:00:00:00:0a/-1 | ||
| 6 | +onos $OCI add-host-intent 00:00:00:00:00:09/-1 00:00:00:00:00:0c/-1 | ||
| 7 | +onos $OCI add-host-intent 00:00:00:00:00:02/-1 00:00:00:00:00:0e/-1 | ||
| 8 | +onos $OCI add-host-intent 00:00:00:00:00:11/-1 00:00:00:00:00:05/-1 |
| ... | @@ -24,14 +24,14 @@ class AttMplsTopo( Topo ): | ... | @@ -24,14 +24,14 @@ class AttMplsTopo( Topo ): |
| 24 | # add nodes, switches first... | 24 | # add nodes, switches first... |
| 25 | NY54 = self.addSwitch( 's25' ) # 40.728270, -73.994483 | 25 | NY54 = self.addSwitch( 's25' ) # 40.728270, -73.994483 |
| 26 | CMBR = self.addSwitch( 's1' ) # 42.373730, -71.109734 | 26 | CMBR = self.addSwitch( 's1' ) # 42.373730, -71.109734 |
| 27 | - CHCG = self.addSwitch( 's2' ) # 41.877461, -87.642892 | 27 | + CHCG = self.addSwitch( 's2', protocols='OpenFlow13' ) # 41.877461, -87.642892 |
| 28 | CLEV = self.addSwitch( 's3' ) # 41.498928, -81.695217 | 28 | CLEV = self.addSwitch( 's3' ) # 41.498928, -81.695217 |
| 29 | RLGH = self.addSwitch( 's4' ) # 35.780150, -78.644026 | 29 | RLGH = self.addSwitch( 's4' ) # 35.780150, -78.644026 |
| 30 | ATLN = self.addSwitch( 's5' ) # 33.749017, -84.394168 | 30 | ATLN = self.addSwitch( 's5' ) # 33.749017, -84.394168 |
| 31 | PHLA = self.addSwitch( 's6' ) # 39.952906, -75.172278 | 31 | PHLA = self.addSwitch( 's6' ) # 39.952906, -75.172278 |
| 32 | WASH = self.addSwitch( 's7' ) # 38.906696, -77.035509 | 32 | WASH = self.addSwitch( 's7' ) # 38.906696, -77.035509 |
| 33 | NSVL = self.addSwitch( 's8' ) # 36.166410, -86.787305 | 33 | NSVL = self.addSwitch( 's8' ) # 36.166410, -86.787305 |
| 34 | - STLS = self.addSwitch( 's9' ) # 38.626418, -90.198143 | 34 | + STLS = self.addSwitch( 's9', protocols='OpenFlow13' ) # 38.626418, -90.198143 |
| 35 | NWOR = self.addSwitch( 's10' ) # 29.951475, -90.078434 | 35 | NWOR = self.addSwitch( 's10' ) # 29.951475, -90.078434 |
| 36 | HSTN = self.addSwitch( 's11' ) # 29.763249, -95.368332 | 36 | HSTN = self.addSwitch( 's11' ) # 29.763249, -95.368332 |
| 37 | SNAN = self.addSwitch( 's12' ) # 29.424331, -98.491745 | 37 | SNAN = self.addSwitch( 's12' ) # 29.424331, -98.491745 |
| ... | @@ -44,7 +44,7 @@ class AttMplsTopo( Topo ): | ... | @@ -44,7 +44,7 @@ class AttMplsTopo( Topo ): |
| 44 | PTLD = self.addSwitch( 's19' ) # 45.523317, -122.677768 | 44 | PTLD = self.addSwitch( 's19' ) # 45.523317, -122.677768 |
| 45 | STTL = self.addSwitch( 's20' ) # 47.607326, -122.331786 | 45 | STTL = self.addSwitch( 's20' ) # 47.607326, -122.331786 |
| 46 | SLKC = self.addSwitch( 's21' ) # 40.759577, -111.895079 | 46 | SLKC = self.addSwitch( 's21' ) # 40.759577, -111.895079 |
| 47 | - LA03 = self.addSwitch( 's22' ) # 34.056346, -118.235951 | 47 | + LA03 = self.addSwitch( 's22', protocols='OpenFlow13' ) # 34.056346, -118.235951 |
| 48 | SNDG = self.addSwitch( 's23' ) # 32.714564, -117.153528 | 48 | SNDG = self.addSwitch( 's23' ) # 32.714564, -117.153528 |
| 49 | PHNX = self.addSwitch( 's24' ) # 33.448289, -112.076299 | 49 | PHNX = self.addSwitch( 's24' ) # 33.448289, -112.076299 |
| 50 | 50 | ... | ... |
tools/test/topos/attmplsext.json
0 → 100644
| 1 | +{ | ||
| 2 | + "devices": [ | ||
| 3 | + { "alias": "s11", "uri": "of:0000001000000001", "mac": "001000000001", "annotations": { "name": "MINE", "latitude": 44.977862, "longitude": -93.265427 }, "type": "SWITCH" }, | ||
| 4 | + { "alias": "s12", "uri": "of:0000001000000002", "mac": "001000000002", "annotations": { "name": "BISM", "latitude": 46.817887, "longitude": -100.786109 }, "type": "SWITCH" }, | ||
| 5 | + { "alias": "s13", "uri": "of:0000001000000003", "mac": "001000000003", "annotations": { "name": "BOIS", "latitude": 43.617834, "longitude": -116.216903 }, "type": "SWITCH" }, | ||
| 6 | + { "alias": "s14", "uri": "of:0000001000000004", "mac": "001000000004", "annotations": { "name": "RENO", "latitude": 39.533310, "longitude": -119.796940 }, "type": "SWITCH" }, | ||
| 7 | + { "alias": "s15", "uri": "of:0000001000000005", "mac": "001000000005", "annotations": { "name": "ALBU", "latitude": 35.109657, "longitude": -106.626698 }, "type": "SWITCH" } | ||
| 8 | + ], | ||
| 9 | + | ||
| 10 | + "hosts": [ | ||
| 11 | + { "alias": "h31", "mac": "00:10:00:00:00:01", "vlan": -1, "location": "of:0000001000000001/1", "ip": "10.0.0.31", "annotations": { "name": "MINE", "latitude": 46.509021, "longitude": -93.820777 } }, | ||
| 12 | + { "alias": "h32", "mac": "00:10:00:00:00:02", "vlan": -1, "location": "of:0000001000000002/1", "ip": "10.0.0.32", "annotations": { "name": "BISM", "latitude": 48.169551, "longitude": -101.866954 } }, | ||
| 13 | + { "alias": "h33", "mac": "00:10:00:00:00:03", "vlan": -1, "location": "of:0000001000000003/1", "ip": "10.0.0.33", "annotations": { "name": "BOIS", "latitude": 44.617834, "longitude": -117.216903 } }, | ||
| 14 | + { "alias": "h34", "mac": "00:10:00:00:00:04", "vlan": -1, "location": "of:0000001000000004/1", "ip": "10.0.0.34", "annotations": { "name": "RENO", "latitude": 40.686744, "longitude": -117.886514 } }, | ||
| 15 | + { "alias": "h35", "mac": "00:10:00:00:00:05", "vlan": -1, "location": "of:0000001000000005/1", "ip": "10.0.0.35", "annotations": { "name": "ALBU", "latitude": 35.486729, "longitude": -104.231201 } } | ||
| 16 | + ] | ||
| 17 | + | ||
| 18 | +} |
tools/test/topos/attmplsext.py
0 → 100644
| 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 AttMplsTopoExt( 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 | + MINE = self.addSwitch( 's31', dpid='0000001000000001') # 44.977862, -93.265427 | ||
| 26 | + BISM = self.addSwitch( 's32', dpid='0000001000000002') # 46.817887, -100.786109 | ||
| 27 | + BOIS = self.addSwitch( 's33', dpid='0000001000000003') # 43.617834, -116.216903 | ||
| 28 | + RENO = self.addSwitch( 's34', dpid='0000001000000004') # 39.533310, -119.796940 | ||
| 29 | + ALBU = self.addSwitch( 's35', dpid='0000001000000005') # 35.109657, -106.626698 | ||
| 30 | + | ||
| 31 | + # ... and now hosts | ||
| 32 | + MINE_host = self.addHost( 'h31', mac='00:10:00:00:00:01' ) | ||
| 33 | + BISM_host = self.addHost( 'h32', mac='00:10:00:00:00:02' ) | ||
| 34 | + BOIS_host = self.addHost( 'h33', mac='00:10:00:00:00:03' ) | ||
| 35 | + RENO_host = self.addHost( 'h34', mac='00:10:00:00:00:04' ) | ||
| 36 | + ALBU_host = self.addHost( 'h35', mac='00:10:00:00:00:05' ) | ||
| 37 | + | ||
| 38 | + # add edges between switch and corresponding host | ||
| 39 | + self.addLink( MINE , MINE_host ) | ||
| 40 | + self.addLink( BISM , BISM_host ) | ||
| 41 | + self.addLink( BOIS , BOIS_host ) | ||
| 42 | + self.addLink( RENO , RENO_host ) | ||
| 43 | + self.addLink( ALBU , ALBU_host ) | ||
| 44 | + | ||
| 45 | + # add edges between switches | ||
| 46 | + self.addLink( MINE , BISM, bw=10, delay='0.979030824185ms') | ||
| 47 | + self.addLink( BISM , BOIS, bw=10, delay='0.806374975652ms') | ||
| 48 | + self.addLink( BOIS , RENO, bw=10, delay='0.686192970166ms') | ||
| 49 | + self.addLink( BOIS , ALBU, bw=10, delay='0.605826192092ms') | ||
| 50 | + self.addLink( RENO , ALBU, bw=10, delay='1.4018238197ms') | ||
| 51 | + self.addLink( RENO , MINE, bw=10, delay='0.232315346482ms') | ||
| 52 | + self.addLink( BISM , ALBU, bw=10, delay='1.07297714274ms') | ||
| 53 | + | ||
| 54 | +topos = { 'att': ( lambda: AttMplsTopoExt() ) } |
tools/test/topos/attmplsopt.json
0 → 100644
| 1 | +{ | ||
| 2 | + "devices" : [ | ||
| 3 | + { | ||
| 4 | + "uri": "of:0000ffffffffff01", "mac": "ffffffffffff01", "type": "ROADM", | ||
| 5 | + "mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?", | ||
| 6 | + "annotations": { "name": "SFO", "latitude": 37.779751, "longitude": -122.409791, "optical.regens": 0 }, | ||
| 7 | + "ports": [ { "port": 10, "speed": 100000, "type": "FIBER" }, | ||
| 8 | + { "port": 20, "speed": 0, "type": "FIBER" }, | ||
| 9 | + { "port": 50, "speed":100000, "type": "FIBER" } ] | ||
| 10 | + }, | ||
| 11 | + { | ||
| 12 | + "uri": "of:0000ffffffffff02", "mac": "ffffffffffff02", "type": "ROADM", | ||
| 13 | + "mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?", | ||
| 14 | + "annotations": { "name": "SAC", "latitude": 38.581001, "longitude": -121.497844, "optical.regens": 0 }, | ||
| 15 | + "ports": [ { "port": 20, "speed": 100000, "type": "FIBER" }, | ||
| 16 | + { "port": 30, "speed": 0, "type": "FIBER" }, | ||
| 17 | + { "port": 50, "speed": 0, "type": "FIBER" } ] | ||
| 18 | + }, | ||
| 19 | + { | ||
| 20 | + "uri": "of:0000ffffffffff03", "mac": "ffffffffffff03", "type": "ROADM", | ||
| 21 | + "mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?", | ||
| 22 | + "annotations": { "name": "LAX", "latitude": 34.056346, "longitude": -118.235951, "optical.regens": 0 }, | ||
| 23 | + "ports": [ { "port": 30, "speed": 0, "type": "FIBER" }, | ||
| 24 | + { "port": 50, "speed": 0, "type": "FIBER" }, | ||
| 25 | + { "port": 20, "speed": 0, "type": "FIBER" } ] | ||
| 26 | + }, | ||
| 27 | + { | ||
| 28 | + "uri": "of:0000ffffffffff04", "mac": "ffffffffffff04", "type": "ROADM", | ||
| 29 | + "mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?", | ||
| 30 | + "annotations": { "name": "SDG", "latitude": 32.714564, "longitude": -117.153528, "optical.regens": 3 }, | ||
| 31 | + "ports": [ { "port": 30, "speed": 0, "type": "FIBER" }, | ||
| 32 | + { "port":50, "speed": 0, "type": "FIBER" }, | ||
| 33 | + { "port":20, "speed": 0, "type": "FIBER" }] | ||
| 34 | + }, | ||
| 35 | + { | ||
| 36 | + "uri": "of:0000ffffffffff05", "mac": "ffffffffffff05", "type": "ROADM", | ||
| 37 | + "mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?", | ||
| 38 | + "annotations": { "name": "MSP", "latitude": 44.8, "longitude": -93.1, "optical.regens": 3 }, | ||
| 39 | + "ports": [ { "port": 20, "speed": 0, "type": "FIBER" }, | ||
| 40 | + { "port": 30, "speed": 0, "type": "FIBER" }, | ||
| 41 | + { "port": 40, "speed": 0, "type": "FIBER" }, | ||
| 42 | + { "port": 50, "speed": 0, "type": "FIBER" }] | ||
| 43 | + }, | ||
| 44 | + { | ||
| 45 | + "uri": "of:0000ffffffffff06", "mac": "ffffffffffff06", "type": "ROADM", | ||
| 46 | + "mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?", | ||
| 47 | + "annotations": { "name": "DFW", "latitude": 32.777665, "longitude": -96.802064, "optical.regens": 3 }, | ||
| 48 | + "ports": [ { "port": 10, "speed": 0, "type": "FIBER" }, | ||
| 49 | + { "port": 20, "speed": 0, "type": "FIBER" }, | ||
| 50 | + { "port": 30, "speed": 0, "type": "FIBER" }, | ||
| 51 | + { "port": 40, "speed": 0, "type": "FIBER" }, | ||
| 52 | + { "port": 50, "speed": 0, "type": "FIBER" }] | ||
| 53 | + }, | ||
| 54 | + { | ||
| 55 | + "uri": "of:0000ffffffffff07", "mac": "ffffffffffff07", "type": "ROADM", | ||
| 56 | + "mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?", | ||
| 57 | + "annotations": { "name": "CHG", "latitude": 41.877461, "longitude": -87.642892, "optical.regens": 3 }, | ||
| 58 | + "ports": [ { "port": 10, "speed": 0, "type": "FIBER" }, | ||
| 59 | + { "port": 20, "speed": 0, "type": "FIBER" }, | ||
| 60 | + { "port": 30, "speed": 0, "type": "FIBER" }, | ||
| 61 | + { "port": 50, "speed": 0, "type": "FIBER" }] | ||
| 62 | + }, | ||
| 63 | + { | ||
| 64 | + "uri": "of:0000ffffffffff08", "mac": "ffffffffffff08", "type": "ROADM", | ||
| 65 | + "mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?", | ||
| 66 | + "annotations": { "name": "IAD", "latitude": 38.8, "longitude": -77.1, "optical.regens": 3 }, | ||
| 67 | + "ports": [ { "port": 20, "speed": 0, "type": "FIBER" }, | ||
| 68 | + { "port": 30, "speed": 0, "type": "FIBER" }, | ||
| 69 | + { "port": 50, "speed": 0, "type": "FIBER" }] | ||
| 70 | + }, | ||
| 71 | + { | ||
| 72 | + "uri": "of:0000ffffffffff09", "mac": "ffffffffffff09", "type": "ROADM", | ||
| 73 | + "mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?", | ||
| 74 | + "annotations": { "name": "JFK", "latitude": 40.728270, "longitude": -73.994483, "optical.regens": 0 }, | ||
| 75 | + "ports": [ { "port": 10, "speed": 0, "type": "FIBER" }, | ||
| 76 | + { "port": 20, "speed": 0, "type": "FIBER" }, | ||
| 77 | + { "port": 50, "speed": 0, "type": "FIBER" }] | ||
| 78 | + }, | ||
| 79 | + { | ||
| 80 | + "uri": "of:0000ffffffffff0A", "mac": "ffffffffffff0A", "type": "ROADM", | ||
| 81 | + "mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?", | ||
| 82 | + "annotations": { "name": "ATL", "latitude": 33.749017, "longitude": -84.394168, "optical.regens": 0 }, | ||
| 83 | + "ports": [ { "port": 10, "speed": 0, "type": "FIBER" }, | ||
| 84 | + { "port": 20, "speed": 0, "type": "FIBER" }, | ||
| 85 | + { "port": 50, "speed": 0, "type": "FIBER" }] | ||
| 86 | + } | ||
| 87 | + ], | ||
| 88 | + | ||
| 89 | + "links" : [ | ||
| 90 | + { "src": "of:0000ffffffffff01/50", "dst": "of:0000ffffffffff02/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 48, "durable": "true" } }, | ||
| 91 | + { "src": "of:0000ffffffffff02/50", "dst": "of:0000ffffffffff03/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 493, "durable": "true" } }, | ||
| 92 | + { "src": "of:0000ffffffffff03/50", "dst": "of:0000ffffffffff04/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 171, "durable": "true" } }, | ||
| 93 | + { "src": "of:0000ffffffffff01/20", "dst": "of:0000ffffffffff05/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2555, "durable": "true" } }, | ||
| 94 | + { "src": "of:0000ffffffffff02/20", "dst": "of:0000ffffffffff05/20", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2539, "durable": "true" } }, | ||
| 95 | + { "src": "of:0000ffffffffff03/20", "dst": "of:0000ffffffffff06/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1979, "durable": "true" } }, | ||
| 96 | + { "src": "of:0000ffffffffff04/20", "dst": "of:0000ffffffffff06/20", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1867, "durable": "true" } }, | ||
| 97 | + { "src": "of:0000ffffffffff05/30", "dst": "of:0000ffffffffff06/40", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1378, "durable": "true" } }, | ||
| 98 | + { "src": "of:0000ffffffffff05/40", "dst": "of:0000ffffffffff07/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2200, "durable": "true" } }, | ||
| 99 | + { "src": "of:0000ffffffffff06/30", "dst": "of:0000ffffffffff08/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1918, "durable": "true" } }, | ||
| 100 | + { "src": "of:0000ffffffffff07/20", "dst": "of:0000ffffffffff08/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 3625, "durable": "true" } }, | ||
| 101 | + { "src": "of:0000ffffffffff07/30", "dst": "of:0000ffffffffff09/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 3880, "durable": "true" } }, | ||
| 102 | + { "src": "of:0000ffffffffff08/20", "dst": "of:0000ffffffffff0A/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 838, "durable": "true" } }, | ||
| 103 | + { "src": "of:0000ffffffffff09/20", "dst": "of:0000ffffffffff0A/20", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1245, "durable": "true" } }, | ||
| 104 | + | ||
| 105 | + { "src": "of:0000000000000011/52", "dst": "of:0000ffffffffff01/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, | ||
| 106 | + { "src": "of:0000000000000016/52", "dst": "of:0000ffffffffff04/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, | ||
| 107 | + { "src": "of:000000000000000d/52", "dst": "of:0000ffffffffff06/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, | ||
| 108 | + { "src": "of:0000000000000002/52", "dst": "of:0000ffffffffff07/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, | ||
| 109 | + { "src": "of:0000000000000019/52", "dst": "of:0000ffffffffff09/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }, | ||
| 110 | + { "src": "of:0000000000000005/52", "dst": "of:0000ffffffffff0A/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } } | ||
| 111 | + ] | ||
| 112 | +} |
| ... | @@ -475,6 +475,7 @@ public abstract class TopologyViewMessages { | ... | @@ -475,6 +475,7 @@ public abstract class TopologyViewMessages { |
| 475 | new Prop("H/W Version", device.hwVersion()), | 475 | new Prop("H/W Version", device.hwVersion()), |
| 476 | new Prop("S/W Version", device.swVersion()), | 476 | new Prop("S/W Version", device.swVersion()), |
| 477 | new Prop("Serial Number", device.serialNumber()), | 477 | new Prop("Serial Number", device.serialNumber()), |
| 478 | + new Prop("Protocol", annot.value("protocol")), | ||
| 478 | new Separator(), | 479 | new Separator(), |
| 479 | new Prop("Master", master(deviceId)), | 480 | new Prop("Master", master(deviceId)), |
| 480 | new Prop("Latitude", annot.value("latitude")), | 481 | new Prop("Latitude", annot.value("latitude")), | ... | ... |
| ... | @@ -263,15 +263,31 @@ public class TopologyViewWebSocket | ... | @@ -263,15 +263,31 @@ public class TopologyViewWebSocket |
| 263 | 263 | ||
| 264 | // Sends all devices to the client as device-added messages. | 264 | // Sends all devices to the client as device-added messages. |
| 265 | private void sendAllDevices() { | 265 | private void sendAllDevices() { |
| 266 | + // Send optical first, others later for layered rendering | ||
| 266 | for (Device device : deviceService.getDevices()) { | 267 | for (Device device : deviceService.getDevices()) { |
| 267 | - sendMessage(deviceMessage(new DeviceEvent(DEVICE_ADDED, device))); | 268 | + if (device.type() == Device.Type.ROADM) { |
| 269 | + sendMessage(deviceMessage(new DeviceEvent(DEVICE_ADDED, device))); | ||
| 270 | + } | ||
| 271 | + } | ||
| 272 | + for (Device device : deviceService.getDevices()) { | ||
| 273 | + if (device.type() != Device.Type.ROADM) { | ||
| 274 | + sendMessage(deviceMessage(new DeviceEvent(DEVICE_ADDED, device))); | ||
| 275 | + } | ||
| 268 | } | 276 | } |
| 269 | } | 277 | } |
| 270 | 278 | ||
| 271 | // Sends all links to the client as link-added messages. | 279 | // Sends all links to the client as link-added messages. |
| 272 | private void sendAllLinks() { | 280 | private void sendAllLinks() { |
| 281 | + // Send optical first, others later for layered rendering | ||
| 273 | for (Link link : linkService.getLinks()) { | 282 | for (Link link : linkService.getLinks()) { |
| 274 | - sendMessage(linkMessage(new LinkEvent(LINK_ADDED, link))); | 283 | + if (link.type() == Link.Type.OPTICAL) { |
| 284 | + sendMessage(linkMessage(new LinkEvent(LINK_ADDED, link))); | ||
| 285 | + } | ||
| 286 | + } | ||
| 287 | + for (Link link : linkService.getLinks()) { | ||
| 288 | + if (link.type() != Link.Type.OPTICAL) { | ||
| 289 | + sendMessage(linkMessage(new LinkEvent(LINK_ADDED, link))); | ||
| 290 | + } | ||
| 275 | } | 291 | } |
| 276 | } | 292 | } |
| 277 | 293 | ||
| ... | @@ -564,6 +580,7 @@ public class TopologyViewWebSocket | ... | @@ -564,6 +580,7 @@ public class TopologyViewWebSocket |
| 564 | } | 580 | } |
| 565 | } catch (Exception e) { | 581 | } catch (Exception e) { |
| 566 | log.warn("Unable to handle traffic request due to {}", e.getMessage()); | 582 | log.warn("Unable to handle traffic request due to {}", e.getMessage()); |
| 583 | + log.warn("Boom!", e); | ||
| 567 | } | 584 | } |
| 568 | } | 585 | } |
| 569 | } | 586 | } | ... | ... |
-
Please register or login to post a comment