CORD-523 Introduce generic routing service in Segment Routing
Segment Routing now reacts to routes being added/removed through RouteService.
SR will disable SingleSwitchFibInstaller if vRouter is activated
SR will install a routing table entry on
- The leaf where next hop attaches to
- The other leaves that points packets to the leaf where next hop attaches to
Host handler no longer add any IP flow for hosts outside the configured subnet
- We need to explicitly add a per host route via RouteService when needed (vSG)
Change suppressSubnet behavior
- Before: do not push any flow
- After: ignore subnet config but still push filtering obj with VLAN 4094
ARP handler drops all packets from suppressed ports
Additional refactoring
- Remove vRouterId. Gateway router now needs to be specify through route API
- Limit the scope of some variables
- Unify handler.init method name
Change-Id: Idd2fd19fa74e3fa6209eef5cf2ed79957715c5e9
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
index 28fd5ec..4e35571 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
@@ -562,18 +562,21 @@
for (Port port : devPorts) {
ConnectPoint connectPoint = new ConnectPoint(deviceId, port.number());
// TODO: Handles dynamic port events when we are ready for dynamic config
- SegmentRoutingAppConfig appConfig = srManager.cfgService
- .getConfig(srManager.appId, SegmentRoutingAppConfig.class);
if (!port.isEnabled()) {
disabledPorts++;
continue;
}
+
+ boolean isSuppressed = false;
+ SegmentRoutingAppConfig appConfig = srManager.cfgService
+ .getConfig(srManager.appId, SegmentRoutingAppConfig.class);
if (appConfig != null && appConfig.suppressSubnet().contains(connectPoint)) {
+ isSuppressed = true;
suppressedPorts++;
- continue;
}
+
Ip4Prefix portSubnet = config.getPortSubnet(deviceId, port.number());
- VlanId assignedVlan = (portSubnet == null)
+ VlanId assignedVlan = (portSubnet == null || isSuppressed)
? VlanId.vlanId(SegmentRoutingManager.ASSIGNED_VLAN_NO_SUBNET)
: srManager.getSubnetAssignedVlanId(deviceId, portSubnet);