Package org.onosproject.segmentrouting
Class SegmentRoutingManager
- java.lang.Object
-
- org.onosproject.segmentrouting.SegmentRoutingManager
-
- All Implemented Interfaces:
SegmentRoutingService
public class SegmentRoutingManager extends Object implements SegmentRoutingService
Segment routing manager.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPP_NAMESegment Routing App ID.org.onosproject.net.config.NetworkConfigRegistrycfgServiceorg.onosproject.cluster.ClusterServiceclusterServiceorg.onosproject.core.CoreServicecoreServiceorg.onosproject.net.device.DeviceServicedeviceServiceorg.onosproject.net.flowobjective.FlowObjectiveServiceflowObjectiveServiceorg.onosproject.net.intf.InterfaceServiceinterfaceServiceorg.onosproject.net.link.LinkServicelinkServiceorg.onosproject.mastership.MastershipServicemastershipServicestatic intMAX_DUMMY_VLAN_IDstatic intMIN_DUMMY_VLAN_IDMinumum and maximum value of dummy VLAN ID to be allocated.org.onosproject.mcast.api.MulticastRouteServicemulticastRouteServiceorg.onosproject.net.neighbour.NeighbourResolutionServiceneighbourResolutionServiceorg.onosproject.routeservice.RouteServicerouteServiceorg.onosproject.store.service.StorageServicestorageServiceorg.onosproject.net.topology.TopologyServicetopologyServiceorg.onosproject.net.intent.WorkPartitionServiceworkPartitionServiceXconnectServicexconnectService-
Fields inherited from interface org.onosproject.segmentrouting.SegmentRoutingService
DEFAULT_PRIORITY, FLOOD_PRIORITY, MIN_IP_PRIORITY, XCONNECT_ACL_PRIORITY, XCONNECT_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description SegmentRoutingManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidactivate(org.osgi.service.component.ComponentContext context)L2TunnelHandler.ResultaddPseudowire(L2TunnelDescription l2TunnelDescription)Adds a Pseudowire to the system.L2TunnelHandler.ResultaddPseudowiresBulk(List<DefaultL2TunnelDescription> bulkPseudowires)Deprecated.org.onosproject.core.ApplicationIdappId()Gets application id.booleancanUseVlanId(int vlanId)Returns true if given vlan id is not being used in the system currently, either as one of the default system wide vlans or as one of the configured interface vlans.PolicyHandler.ResultcreatePolicy(Policy policy)Creates a policy.TunnelHandler.ResultcreateTunnel(Tunnel tunnel)Creates a tunnel.protected voiddeactivate()DeviceConfigurationdeviceConfiguration()Returns the device configuration.org.onosproject.store.service.EventuallyConsistentMap<DestinationSetNextObjectiveStoreKey,NextNeighbors>dsNextObjStore()Per device next objective ID store with (device id + destination set) as key.com.google.common.collect.ImmutableMap<org.onosproject.net.DeviceId,EcmpShortestPathGraph>getCurrentEcmpSpg()Returns the current ECMP shortest path graph in this controller instance.org.onlab.packet.VlanIdgetDefaultInternalVlan()Returns the VlanId assigned internally by default to unconfigured ports.org.onlab.packet.MacAddressgetDeviceMacAddress(org.onosproject.net.DeviceId deviceId)Returns the configured mac address of the device.Map<org.onosproject.net.DeviceId,Set<org.onlab.packet.IpPrefix>>getDeviceSubnetMap()Returns device-subnet mapping.com.google.common.collect.ImmutableMap<org.onosproject.net.DeviceId,Set<org.onosproject.net.PortNumber>>getDownedPortState()Returns the ports administratively disabled by the controller.com.google.common.collect.ImmutableMap<DestinationSetNextObjectiveStoreKey,NextNeighbors>getDstNextObjStore()Returns the destinatiomSet-NextObjective store contents.List<org.onosproject.net.DeviceId>getEdgeDeviceIds()Returns a list of edge devices.Set<org.onosproject.net.PortNumber>getEdgePorts(org.onosproject.net.DeviceId deviceId)Returns a set of edge ports on the given device.List<org.onosproject.net.DeviceId>getInfraDeviceIds()Returns a list of infra devices.Set<org.onosproject.net.PortNumber>getInfraPorts(org.onosproject.net.DeviceId deviceId)Returns a set of infrastructure ports on the given device.org.onlab.packet.VlanIdgetInternalVlanId(org.onosproject.net.ConnectPoint connectPoint)Returns internal VLAN for untagged hosts on given connect point.List<L2TunnelPolicy>getL2Policies()Returns all l2 policie of pseudowires.Set<L2TunnelDescription>getL2TunnelDescriptions(boolean pending)Returns the l2 tunnel descriptions.List<L2Tunnel>getL2Tunnels()Returns all l2 tunnels of pseudowires.intgetMacVlanNextObjectiveId(org.onosproject.net.DeviceId deviceId, org.onlab.packet.MacAddress macAddr, org.onlab.packet.VlanId vlanId, org.onosproject.net.PortNumber port, boolean createIfMissing)Returns the next Objective ID for the given mac and vlan, given the treatment.com.google.common.collect.ImmutableMap<MacVlanNextObjectiveStoreKey,Integer>getMacVlanNextObjStore()Returns the Mac Vlan next objective store.Map<org.onosproject.net.DeviceId,List<McastFilteringObjStoreKey>>getMcastFilters()Returns the mcast filtering obj.Map<org.onlab.packet.IpAddress,org.onosproject.cluster.NodeId>getMcastLeaders(org.onlab.packet.IpAddress mcastIp)Return the leaders of the mcast groups.Map<McastStoreKey,Integer>getMcastNextIds(org.onlab.packet.IpAddress mcastIp)Returns the associated next ids to the mcast groups or to the single group if mcastIp is present.Map<McastRoleStoreKey,McastRole>getMcastRoles(org.onlab.packet.IpAddress mcastIp, org.onosproject.net.ConnectPoint sourcecp)Returns the associated roles to the mcast groups.com.google.common.collect.Multimap<org.onosproject.net.ConnectPoint,List<org.onosproject.net.ConnectPoint>>getMcastTrees(org.onlab.packet.IpAddress mcastIp, org.onosproject.net.ConnectPoint sourcecp)Returns the associated trees to the mcast group.booleangetMplsEcmp()Returns the MPLS-ECMP configuration which indicates whether ECMP on labeled packets should be programmed or not.Optional<org.onosproject.net.DeviceId>getPairDeviceId(org.onosproject.net.DeviceId deviceId)Returns optional pair device ID of given device.Optional<org.onosproject.net.PortNumber>getPairLocalPort(org.onosproject.net.DeviceId deviceId)Returns optional pair device local port of given device.List<Policy>getPolicies()Returns all policies.intgetPortNextObjectiveId(org.onosproject.net.DeviceId deviceId, org.onosproject.net.PortNumber portNum, org.onosproject.net.flow.TrafficTreatment treatment, org.onosproject.net.flow.TrafficSelector meta, boolean createIfMissing)Returns the next objective ID for the given portNumber, given the treatment.com.google.common.collect.ImmutableMap<PortNextObjectiveStoreKey,Integer>getPortNextObjStore()Returns the port next objective store.com.google.common.collect.ImmutableMap<String,org.onosproject.net.flowobjective.NextObjective>getPwInitNext()Returns the PW init next objective store.com.google.common.collect.ImmutableMap<String,org.onosproject.net.flowobjective.NextObjective>getPwTermNext()Returns the PW termination next objective store.org.onlab.packet.VlanIdgetPwTransportVlan()Returns the Vlan id used to transport pseudowire traffic across the network.DefaultRoutingHandlergetRoutingHandler()Returns the default routing handler object.com.google.common.collect.ImmutableMap<org.onosproject.net.Link,Boolean>getSeenLinks()Returns the internal link state as seen by this instance of the controller.Map<Set<org.onosproject.net.DeviceId>,org.onosproject.cluster.NodeId>getShouldProgram()Returns shouldProgram map.Map<org.onosproject.net.DeviceId,Boolean>getShouldProgramCache()Returns shouldProgram local cache.Map<org.onosproject.net.DeviceId,org.onosproject.cluster.NodeId>getShouldProgramLeaders()Returns shouldProgram leaders.TunnelgetTunnel(String tunnelId)Returns the tunnel object with the tunnel ID.List<Tunnel>getTunnels()Returns all tunnels.com.google.common.collect.ImmutableMap<VlanNextObjectiveStoreKey,Integer>getVlanNextObjStore()Returns the VLAN next objective store.com.google.common.collect.Multimap<org.onlab.packet.VlanId,org.onosproject.net.PortNumber>getVlanPortMap(org.onosproject.net.DeviceId deviceId)Returns vlan port map of given device.voidinitHost(org.onosproject.net.DeviceId deviceId)Invoke hostHandler.init() for given device.voidinitRoute(org.onosproject.net.DeviceId deviceId)Invoke routeHandler.init() for given device.voidinvalidateNextObj(int nextId)Removes all entries in dst/vlan/port/mcast NextObjectiveStore that are associated with the given nextId.booleanisRoutingStable()Determines if routing in the network has been stable in the last STABILITY_THRESHOLD seconds, by comparing the current time to the last routing change timestamp.org.onosproject.store.service.EventuallyConsistentMap<MacVlanNextObjectiveStoreKey,Integer>macVlanNextObjStore()Per device next objective ID store with (device id + MAC address + vlan) as key.Set<org.onosproject.net.ConnectPoint>nextHopLocations(org.onosproject.routeservice.ResolvedRoute resolvedRoute)Returns locations of given resolved route.org.onosproject.store.service.EventuallyConsistentMap<PortNextObjectiveStoreKey,Integer>portNextObjStore()Per device next objective ID store with (device id + port + treatment + meta) as key.voidregisterConnectPoint(org.onosproject.net.ConnectPoint portToRegister)Registers the given connect point with the NRS, this is necessary to receive the NDP and ARP packets from the NRS.PolicyHandler.ResultremovePolicy(Policy policy)Removes a policy.L2TunnelHandler.ResultremovePseudowire(Integer pwId)Removes pseudowire.TunnelHandler.ResultremoveTunnel(Tunnel tunnel)Removes a tunnel.voidrerouteNetwork()Use current state of the network to repopulate forwarding rules.booleanshouldProgram(org.onosproject.net.DeviceId deviceId)Determines whether this controller instance should program the givendeviceId, based on work partition service and pairDeviceId if one exists.voidupdateMacVlanTreatment(org.onosproject.net.DeviceId deviceId, org.onlab.packet.MacAddress hostMac, org.onlab.packet.VlanId hostVlanId, org.onosproject.net.PortNumber port, int nextId)Updates the next objective for the given nextId .voidverifyGroups(org.onosproject.net.DeviceId id)Triggers the verification of all ECMP groups in the specified device.org.onosproject.store.service.EventuallyConsistentMap<VlanNextObjectiveStoreKey,Integer>vlanNextObjStore()Per device next objective ID store with (device id + vlanid) as key.
-
-
-
Field Detail
-
neighbourResolutionService
public org.onosproject.net.neighbour.NeighbourResolutionService neighbourResolutionService
-
coreService
public org.onosproject.core.CoreService coreService
-
deviceService
public org.onosproject.net.device.DeviceService deviceService
-
flowObjectiveService
public org.onosproject.net.flowobjective.FlowObjectiveService flowObjectiveService
-
linkService
public org.onosproject.net.link.LinkService linkService
-
mastershipService
public org.onosproject.mastership.MastershipService mastershipService
-
storageService
public org.onosproject.store.service.StorageService storageService
-
multicastRouteService
public org.onosproject.mcast.api.MulticastRouteService multicastRouteService
-
topologyService
public org.onosproject.net.topology.TopologyService topologyService
-
routeService
public org.onosproject.routeservice.RouteService routeService
-
cfgService
public org.onosproject.net.config.NetworkConfigRegistry cfgService
-
interfaceService
public org.onosproject.net.intf.InterfaceService interfaceService
-
clusterService
public org.onosproject.cluster.ClusterService clusterService
-
workPartitionService
public org.onosproject.net.intent.WorkPartitionService workPartitionService
-
xconnectService
public volatile XconnectService xconnectService
-
APP_NAME
public static final String APP_NAME
Segment Routing App ID.- See Also:
- Constant Field Values
-
MIN_DUMMY_VLAN_ID
public static final int MIN_DUMMY_VLAN_ID
Minumum and maximum value of dummy VLAN ID to be allocated.- See Also:
- Constant Field Values
-
MAX_DUMMY_VLAN_ID
public static final int MAX_DUMMY_VLAN_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
activate
protected void activate(org.osgi.service.component.ComponentContext context)
-
deactivate
protected void deactivate()
-
canUseVlanId
public boolean canUseVlanId(int vlanId)
Returns true if given vlan id is not being used in the system currently, either as one of the default system wide vlans or as one of the configured interface vlans.- Parameters:
vlanId- given vlan id- Returns:
- true if vlan is not currently in use
-
getDefaultInternalVlan
public org.onlab.packet.VlanId getDefaultInternalVlan()
Description copied from interface:SegmentRoutingServiceReturns the VlanId assigned internally by default to unconfigured ports.- Specified by:
getDefaultInternalVlanin interfaceSegmentRoutingService- Returns:
- the default internal vlan id
-
getPwTransportVlan
public org.onlab.packet.VlanId getPwTransportVlan()
Returns the Vlan id used to transport pseudowire traffic across the network.- Returns:
- the pseudowire transport vlan id
-
getTunnels
public List<Tunnel> getTunnels()
Description copied from interface:SegmentRoutingServiceReturns all tunnels.- Specified by:
getTunnelsin interfaceSegmentRoutingService- Returns:
- list of tunnels
-
createTunnel
public TunnelHandler.Result createTunnel(Tunnel tunnel)
Description copied from interface:SegmentRoutingServiceCreates a tunnel.- Specified by:
createTunnelin interfaceSegmentRoutingService- Parameters:
tunnel- tunnel reference to create- Returns:
- WRONG_PATH if the tunnel path is wrong, ID_EXISTS if the tunnel ID exists already, TUNNEL_EXISTS if the same tunnel exists, INTERNAL_ERROR if the tunnel creation failed internally, SUCCESS if the tunnel is created successfully
-
removeTunnel
public TunnelHandler.Result removeTunnel(Tunnel tunnel)
Description copied from interface:SegmentRoutingServiceRemoves a tunnel.- Specified by:
removeTunnelin interfaceSegmentRoutingService- Parameters:
tunnel- tunnel reference to remove- Returns:
- TUNNEL_NOT_FOUND if the tunnel to remove does not exists, INTERNAL_ERROR if the tunnel creation failed internally, SUCCESS if the tunnel is created successfully.
-
removePolicy
public PolicyHandler.Result removePolicy(Policy policy)
Description copied from interface:SegmentRoutingServiceRemoves a policy.- Specified by:
removePolicyin interfaceSegmentRoutingService- Parameters:
policy- policy reference to remove- Returns:
- POLICY_NOT_FOUND if the policy to remove does not exists, SUCCESS if it is removed successfully
-
createPolicy
public PolicyHandler.Result createPolicy(Policy policy)
Description copied from interface:SegmentRoutingServiceCreates a policy.- Specified by:
createPolicyin interfaceSegmentRoutingService- Parameters:
policy- policy reference to create- Returns:
- ID_EXISTS if the same policy ID exists, POLICY_EXISTS if the same policy exists, TUNNEL_NOT_FOUND if the tunnel does not exists, UNSUPPORTED_TYPE if the policy type is not supported, SUCCESS if the policy is created successfully.
-
getPolicies
public List<Policy> getPolicies()
Description copied from interface:SegmentRoutingServiceReturns all policies.- Specified by:
getPoliciesin interfaceSegmentRoutingService- Returns:
- list of policy
-
getL2TunnelDescriptions
public Set<L2TunnelDescription> getL2TunnelDescriptions(boolean pending)
Description copied from interface:SegmentRoutingServiceReturns the l2 tunnel descriptions.- Specified by:
getL2TunnelDescriptionsin interfaceSegmentRoutingService- Parameters:
pending- if true fetch pending pseudowires, else fetch installed- Returns:
- set of l2 tunnel descriptions.
-
getL2Tunnels
public List<L2Tunnel> getL2Tunnels()
Description copied from interface:SegmentRoutingServiceReturns all l2 tunnels of pseudowires.- Specified by:
getL2Tunnelsin interfaceSegmentRoutingService- Returns:
- list of l2 tunnels
-
getL2Policies
public List<L2TunnelPolicy> getL2Policies()
Description copied from interface:SegmentRoutingServiceReturns all l2 policie of pseudowires.- Specified by:
getL2Policiesin interfaceSegmentRoutingService- Returns:
- list of l2 policies.
-
addPseudowiresBulk
@Deprecated public L2TunnelHandler.Result addPseudowiresBulk(List<DefaultL2TunnelDescription> bulkPseudowires)
Deprecated.Description copied from interface:SegmentRoutingServiceAdds a set of pseudowires.- Specified by:
addPseudowiresBulkin interfaceSegmentRoutingService- Parameters:
bulkPseudowires- The pseudowires to add.- Returns:
- SUCCESS if ALL pseudowires can be instantiated and are deployed, or a a descriptive error otherwise, without deploying any pseudowire.
-
addPseudowire
public L2TunnelHandler.Result addPseudowire(L2TunnelDescription l2TunnelDescription)
Description copied from interface:SegmentRoutingServiceAdds a Pseudowire to the system.- Specified by:
addPseudowirein interfaceSegmentRoutingService- Parameters:
l2TunnelDescription- The pseudowire tunnel.- Returns:
- SUCCESS if operation is successful or a descriptive error otherwise.
-
removePseudowire
public L2TunnelHandler.Result removePseudowire(Integer pwId)
Description copied from interface:SegmentRoutingServiceRemoves pseudowire.- Specified by:
removePseudowirein interfaceSegmentRoutingService- Parameters:
pwId- The id of the pseudowire.- Returns:
- SUCCESS if operation successful or a descriptive error otherwise.
-
rerouteNetwork
public void rerouteNetwork()
Description copied from interface:SegmentRoutingServiceUse current state of the network to repopulate forwarding rules.- Specified by:
rerouteNetworkin interfaceSegmentRoutingService
-
getDeviceSubnetMap
public Map<org.onosproject.net.DeviceId,Set<org.onlab.packet.IpPrefix>> getDeviceSubnetMap()
Description copied from interface:SegmentRoutingServiceReturns device-subnet mapping.- Specified by:
getDeviceSubnetMapin interfaceSegmentRoutingService- Returns:
- device-subnet mapping
-
getCurrentEcmpSpg
public com.google.common.collect.ImmutableMap<org.onosproject.net.DeviceId,EcmpShortestPathGraph> getCurrentEcmpSpg()
Description copied from interface:SegmentRoutingServiceReturns the current ECMP shortest path graph in this controller instance.- Specified by:
getCurrentEcmpSpgin interfaceSegmentRoutingService- Returns:
- ECMP shortest path graph
-
getDstNextObjStore
public com.google.common.collect.ImmutableMap<DestinationSetNextObjectiveStoreKey,NextNeighbors> getDstNextObjStore()
Description copied from interface:SegmentRoutingServiceReturns the destinatiomSet-NextObjective store contents.- Specified by:
getDstNextObjStorein interfaceSegmentRoutingService- Returns:
- current contents of the dstNextObjStore
-
getVlanNextObjStore
public com.google.common.collect.ImmutableMap<VlanNextObjectiveStoreKey,Integer> getVlanNextObjStore()
Description copied from interface:SegmentRoutingServiceReturns the VLAN next objective store.- Specified by:
getVlanNextObjStorein interfaceSegmentRoutingService- Returns:
- current contents of the vlanNextObjStore
-
getMacVlanNextObjStore
public com.google.common.collect.ImmutableMap<MacVlanNextObjectiveStoreKey,Integer> getMacVlanNextObjStore()
Description copied from interface:SegmentRoutingServiceReturns the Mac Vlan next objective store.- Specified by:
getMacVlanNextObjStorein interfaceSegmentRoutingService- Returns:
- current contents of the macVlanNextObjStore
-
getPortNextObjStore
public com.google.common.collect.ImmutableMap<PortNextObjectiveStoreKey,Integer> getPortNextObjStore()
Description copied from interface:SegmentRoutingServiceReturns the port next objective store.- Specified by:
getPortNextObjStorein interfaceSegmentRoutingService- Returns:
- current contents of the portNextObjStore
-
getPwInitNext
public com.google.common.collect.ImmutableMap<String,org.onosproject.net.flowobjective.NextObjective> getPwInitNext()
Description copied from interface:SegmentRoutingServiceReturns the PW init next objective store.- Specified by:
getPwInitNextin interfaceSegmentRoutingService- Returns:
- current contents of the l2InitiationNextObjStore
-
getPwTermNext
public com.google.common.collect.ImmutableMap<String,org.onosproject.net.flowobjective.NextObjective> getPwTermNext()
Description copied from interface:SegmentRoutingServiceReturns the PW termination next objective store.- Specified by:
getPwTermNextin interfaceSegmentRoutingService- Returns:
- current contents of the l2TerminationNextObjStore
-
invalidateNextObj
public void invalidateNextObj(int nextId)
Description copied from interface:SegmentRoutingServiceRemoves all entries in dst/vlan/port/mcast NextObjectiveStore that are associated with the given nextId.- Specified by:
invalidateNextObjin interfaceSegmentRoutingService- Parameters:
nextId- nextId
-
verifyGroups
public void verifyGroups(org.onosproject.net.DeviceId id)
Description copied from interface:SegmentRoutingServiceTriggers the verification of all ECMP groups in the specified device. Adjusts the group buckets if verification finds that there are more or less buckets than what should be there.- Specified by:
verifyGroupsin interfaceSegmentRoutingService- Parameters:
id- the device identifier
-
getSeenLinks
public com.google.common.collect.ImmutableMap<org.onosproject.net.Link,Boolean> getSeenLinks()
Description copied from interface:SegmentRoutingServiceReturns the internal link state as seen by this instance of the controller.- Specified by:
getSeenLinksin interfaceSegmentRoutingService- Returns:
- the internal link state
-
getDownedPortState
public com.google.common.collect.ImmutableMap<org.onosproject.net.DeviceId,Set<org.onosproject.net.PortNumber>> getDownedPortState()
Description copied from interface:SegmentRoutingServiceReturns the ports administratively disabled by the controller.- Specified by:
getDownedPortStatein interfaceSegmentRoutingService- Returns:
- a map of devices and port numbers for administratively disabled ports. Does not include ports manually disabled by the operator.
-
getMcastNextIds
public Map<McastStoreKey,Integer> getMcastNextIds(org.onlab.packet.IpAddress mcastIp)
Description copied from interface:SegmentRoutingServiceReturns the associated next ids to the mcast groups or to the single group if mcastIp is present.- Specified by:
getMcastNextIdsin interfaceSegmentRoutingService- Parameters:
mcastIp- the group ip- Returns:
- the mapping mcastIp-device to next id
-
getMcastRoles
public Map<McastRoleStoreKey,McastRole> getMcastRoles(org.onlab.packet.IpAddress mcastIp, org.onosproject.net.ConnectPoint sourcecp)
Description copied from interface:SegmentRoutingServiceReturns the associated roles to the mcast groups.- Specified by:
getMcastRolesin interfaceSegmentRoutingService- Parameters:
mcastIp- the group ipsourcecp- the source connect point- Returns:
- the mapping mcastIp-device to mcast role
-
getMcastTrees
public com.google.common.collect.Multimap<org.onosproject.net.ConnectPoint,List<org.onosproject.net.ConnectPoint>> getMcastTrees(org.onlab.packet.IpAddress mcastIp, org.onosproject.net.ConnectPoint sourcecp)
Description copied from interface:SegmentRoutingServiceReturns the associated trees to the mcast group.- Specified by:
getMcastTreesin interfaceSegmentRoutingService- Parameters:
mcastIp- the group ipsourcecp- the source connect point- Returns:
- the mapping egress point to mcast path
-
getMcastLeaders
public Map<org.onlab.packet.IpAddress,org.onosproject.cluster.NodeId> getMcastLeaders(org.onlab.packet.IpAddress mcastIp)
Description copied from interface:SegmentRoutingServiceReturn the leaders of the mcast groups.- Specified by:
getMcastLeadersin interfaceSegmentRoutingService- Parameters:
mcastIp- the group ip- Returns:
- the mapping group-node
-
getMcastFilters
public Map<org.onosproject.net.DeviceId,List<McastFilteringObjStoreKey>> getMcastFilters()
Description copied from interface:SegmentRoutingServiceReturns the mcast filtering obj.- Specified by:
getMcastFiltersin interfaceSegmentRoutingService- Returns:
- the mapping group-node
-
getShouldProgram
public Map<Set<org.onosproject.net.DeviceId>,org.onosproject.cluster.NodeId> getShouldProgram()
Description copied from interface:SegmentRoutingServiceReturns shouldProgram map.- Specified by:
getShouldProgramin interfaceSegmentRoutingService- Returns:
- shouldProgram map
-
getShouldProgramCache
public Map<org.onosproject.net.DeviceId,Boolean> getShouldProgramCache()
Description copied from interface:SegmentRoutingServiceReturns shouldProgram local cache.- Specified by:
getShouldProgramCachein interfaceSegmentRoutingService- Returns:
- shouldProgram local cache
-
getShouldProgramLeaders
public Map<org.onosproject.net.DeviceId,org.onosproject.cluster.NodeId> getShouldProgramLeaders()
Description copied from interface:SegmentRoutingServiceReturns shouldProgram leaders.- Specified by:
getShouldProgramLeadersin interfaceSegmentRoutingService- Returns:
- shouldProgram mapping device to node
-
shouldProgram
public boolean shouldProgram(org.onosproject.net.DeviceId deviceId)
Description copied from interface:SegmentRoutingServiceDetermines whether this controller instance should program the givendeviceId, based on work partition service and pairDeviceId if one exists.Once an instance is elected, it will be the only instance responsible for programming both devices in the pair until it goes down.
- Specified by:
shouldProgramin interfaceSegmentRoutingService- Parameters:
deviceId- device identifier to consider for routing- Returns:
- true if current instance should handle the routing for given device
-
isRoutingStable
public boolean isRoutingStable()
Description copied from interface:SegmentRoutingServiceDetermines if routing in the network has been stable in the last STABILITY_THRESHOLD seconds, by comparing the current time to the last routing change timestamp.- Specified by:
isRoutingStablein interfaceSegmentRoutingService- Returns:
- true if stable
-
initHost
public void initHost(org.onosproject.net.DeviceId deviceId)
Description copied from interface:SegmentRoutingServiceInvoke hostHandler.init() for given device.- Specified by:
initHostin interfaceSegmentRoutingService- Parameters:
deviceId- device ID
-
initRoute
public void initRoute(org.onosproject.net.DeviceId deviceId)
Description copied from interface:SegmentRoutingServiceInvoke routeHandler.init() for given device.- Specified by:
initRoutein interfaceSegmentRoutingService- Parameters:
deviceId- device ID
-
appId
public org.onosproject.core.ApplicationId appId()
Description copied from interface:SegmentRoutingServiceGets application id.- Specified by:
appIdin interfaceSegmentRoutingService- Returns:
- application id
-
deviceConfiguration
public DeviceConfiguration deviceConfiguration()
Returns the device configuration.- Returns:
- device configuration
-
dsNextObjStore
public org.onosproject.store.service.EventuallyConsistentMap<DestinationSetNextObjectiveStoreKey,NextNeighbors> dsNextObjStore()
Per device next objective ID store with (device id + destination set) as key. Used to keep track on MPLS group information.- Returns:
- next objective ID store
-
vlanNextObjStore
public org.onosproject.store.service.EventuallyConsistentMap<VlanNextObjectiveStoreKey,Integer> vlanNextObjStore()
Per device next objective ID store with (device id + vlanid) as key. Used to keep track on L2 flood group information.- Returns:
- vlan next object store
-
macVlanNextObjStore
public org.onosproject.store.service.EventuallyConsistentMap<MacVlanNextObjectiveStoreKey,Integer> macVlanNextObjStore()
Per device next objective ID store with (device id + MAC address + vlan) as key. Used to keep track on L3 Unicast group information for indirect hosts.- Returns:
- mac vlan next object store
-
portNextObjStore
public org.onosproject.store.service.EventuallyConsistentMap<PortNextObjectiveStoreKey,Integer> portNextObjStore()
Per device next objective ID store with (device id + port + treatment + meta) as key. Used to keep track on L2 interface group and L3 unicast group information for direct hosts.- Returns:
- port next object store.
-
getMplsEcmp
public boolean getMplsEcmp()
Returns the MPLS-ECMP configuration which indicates whether ECMP on labeled packets should be programmed or not.- Returns:
- MPLS-ECMP value
-
getTunnel
public Tunnel getTunnel(String tunnelId)
Returns the tunnel object with the tunnel ID.- Parameters:
tunnelId- Tunnel ID- Returns:
- Tunnel reference
-
getInternalVlanId
public org.onlab.packet.VlanId getInternalVlanId(org.onosproject.net.ConnectPoint connectPoint)
Description copied from interface:SegmentRoutingServiceReturns internal VLAN for untagged hosts on given connect point.The internal VLAN is either vlan-untagged for an access port, or vlan-native for a trunk port.
- Specified by:
getInternalVlanIdin interfaceSegmentRoutingService- Parameters:
connectPoint- connect point- Returns:
- internal VLAN or null if both vlan-untagged and vlan-native are undefined
-
getPairDeviceId
public Optional<org.onosproject.net.DeviceId> getPairDeviceId(org.onosproject.net.DeviceId deviceId)
Description copied from interface:SegmentRoutingServiceReturns optional pair device ID of given device.- Specified by:
getPairDeviceIdin interfaceSegmentRoutingService- Parameters:
deviceId- device ID- Returns:
- optional pair device ID. Might be empty if pair device is not configured
-
getPairLocalPort
public Optional<org.onosproject.net.PortNumber> getPairLocalPort(org.onosproject.net.DeviceId deviceId)
Description copied from interface:SegmentRoutingServiceReturns optional pair device local port of given device.- Specified by:
getPairLocalPortin interfaceSegmentRoutingService- Parameters:
deviceId- device ID- Returns:
- optional pair device ID. Might be empty if pair device is not configured
-
getInfraPorts
public Set<org.onosproject.net.PortNumber> getInfraPorts(org.onosproject.net.DeviceId deviceId)
Description copied from interface:SegmentRoutingServiceReturns a set of infrastructure ports on the given device.- Specified by:
getInfraPortsin interfaceSegmentRoutingService- Parameters:
deviceId- device ID- Returns:
- a set of ports that does not have interface configuration
-
getEdgePorts
public Set<org.onosproject.net.PortNumber> getEdgePorts(org.onosproject.net.DeviceId deviceId)
Description copied from interface:SegmentRoutingServiceReturns a set of edge ports on the given device.- Specified by:
getEdgePortsin interfaceSegmentRoutingService- Parameters:
deviceId- device ID- Returns:
- a set of ports that has interface configuration
-
getEdgeDeviceIds
public List<org.onosproject.net.DeviceId> getEdgeDeviceIds()
Description copied from interface:SegmentRoutingServiceReturns a list of edge devices.- Specified by:
getEdgeDeviceIdsin interfaceSegmentRoutingService- Returns:
- list of the edge device ids
-
getInfraDeviceIds
public List<org.onosproject.net.DeviceId> getInfraDeviceIds()
Description copied from interface:SegmentRoutingServiceReturns a list of infra devices.- Specified by:
getInfraDeviceIdsin interfaceSegmentRoutingService- Returns:
- list of the infra device ids
-
getDeviceMacAddress
public org.onlab.packet.MacAddress getDeviceMacAddress(org.onosproject.net.DeviceId deviceId) throws org.onosproject.segmentrouting.config.DeviceConfigNotFoundExceptionDescription copied from interface:SegmentRoutingServiceReturns the configured mac address of the device.- Specified by:
getDeviceMacAddressin interfaceSegmentRoutingService- Parameters:
deviceId- the device id- Returns:
- the configured mac address
- Throws:
org.onosproject.segmentrouting.config.DeviceConfigNotFoundException- if config is not present
-
nextHopLocations
public Set<org.onosproject.net.ConnectPoint> nextHopLocations(org.onosproject.routeservice.ResolvedRoute resolvedRoute)
Returns locations of given resolved route.- Parameters:
resolvedRoute- resolved route- Returns:
- locations of nexthop. Might be empty if next hop is not found
-
getVlanPortMap
public com.google.common.collect.Multimap<org.onlab.packet.VlanId,org.onosproject.net.PortNumber> getVlanPortMap(org.onosproject.net.DeviceId deviceId)
Returns vlan port map of given device.- Parameters:
deviceId- device id- Returns:
- vlan-port multimap
-
getPortNextObjectiveId
public int getPortNextObjectiveId(org.onosproject.net.DeviceId deviceId, org.onosproject.net.PortNumber portNum, org.onosproject.net.flow.TrafficTreatment treatment, org.onosproject.net.flow.TrafficSelector meta, boolean createIfMissing)Returns the next objective ID for the given portNumber, given the treatment. There could be multiple different treatments to the same outport, which would result in different objectives. If the next object does not exist, and should be created, a new one is created and its id is returned.- Parameters:
deviceId- Device IDportNum- port number on device for which NextObjective is queriedtreatment- the actions to apply on the packets (should include outport)meta- metadata passed into the creation of a Next Objective if necessarycreateIfMissing- true if a next object should be created if not found- Returns:
- next objective ID or -1 if an error occurred during retrieval or creation
-
getMacVlanNextObjectiveId
public int getMacVlanNextObjectiveId(org.onosproject.net.DeviceId deviceId, org.onlab.packet.MacAddress macAddr, org.onlab.packet.VlanId vlanId, org.onosproject.net.PortNumber port, boolean createIfMissing)Returns the next Objective ID for the given mac and vlan, given the treatment. There could be multiple different treatments to the same outport, which would result in different objectives. If the next object does not exist, and should be created, a new one is created and its id is returned.- Parameters:
deviceId- Device IDmacAddr- mac of host for which Next ID is required.vlanId- vlan of host for which Next ID is required.port- port with which to create the Next Obj.createIfMissing- true if a next object should be created if not found- Returns:
- next objective ID or -1 if an error occurred during retrieval or creation
-
updateMacVlanTreatment
public void updateMacVlanTreatment(org.onosproject.net.DeviceId deviceId, org.onlab.packet.MacAddress hostMac, org.onlab.packet.VlanId hostVlanId, org.onosproject.net.PortNumber port, int nextId)Updates the next objective for the given nextId .- Parameters:
deviceId- Device IDhostMac- mac of host for which Next obj is to be updated.hostVlanId- vlan of host for which Next obj is to be updated.port- port with which to update the Next Obj.nextId- of Next Obj which needs to be updated.
-
getRoutingHandler
public DefaultRoutingHandler getRoutingHandler()
Returns the default routing handler object.- Returns:
- the default routing handler object
-
registerConnectPoint
public void registerConnectPoint(org.onosproject.net.ConnectPoint portToRegister)
Registers the given connect point with the NRS, this is necessary to receive the NDP and ARP packets from the NRS.- Parameters:
portToRegister- connect point to register
-
-