Package org.onosproject.segmentrouting
Interface SegmentRoutingService
-
- All Known Implementing Classes:
SegmentRoutingManager
public interface SegmentRoutingServiceSegment Routing Service for REST API.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PRIORITYDefault flow priority.static intFLOOD_PRIORITYSubnet flooding flow priority.static intMIN_IP_PRIORITYMinimum IP priority.static intXCONNECT_ACL_PRIORITYDeprecated.in ONOS 1.12.static intXCONNECT_PRIORITYDeprecated.in ONOS 1.12.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description L2TunnelHandler.ResultaddPseudowire(L2TunnelDescription tunnel)Adds a Pseudowire to the system.L2TunnelHandler.ResultaddPseudowiresBulk(List<DefaultL2TunnelDescription> l2TunnelDescriptions)Deprecated.onos-1.12 use addPseudowire insteaddefault org.onosproject.core.ApplicationIdappId()Gets application id.PolicyHandler.ResultcreatePolicy(Policy policy)Creates a policy.TunnelHandler.ResultcreateTunnel(Tunnel tunnel)Creates a tunnel.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.default 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.default Set<org.onosproject.net.PortNumber>getInfraPorts(org.onosproject.net.DeviceId deviceId)Returns a set of infrastructure ports on the given device.default 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.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.default Optional<org.onosproject.net.DeviceId>getPairDeviceId(org.onosproject.net.DeviceId deviceId)Returns optional pair device ID of given device.default 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.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.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()Deprecated.in trellis-control-3.0.1Map<org.onosproject.net.DeviceId,Boolean>getShouldProgramCache()Deprecated.in trellis-control-3.0.1Map<org.onosproject.net.DeviceId,org.onosproject.cluster.NodeId>getShouldProgramLeaders()Returns shouldProgram leaders.List<Tunnel>getTunnels()Returns all tunnels.com.google.common.collect.ImmutableMap<VlanNextObjectiveStoreKey,Integer>getVlanNextObjStore()Returns the VLAN next objective store.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.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.voidverifyGroups(org.onosproject.net.DeviceId id)Triggers the verification of all ECMP groups in the specified device.
-
-
-
Field Detail
-
XCONNECT_ACL_PRIORITY
@Deprecated static final int XCONNECT_ACL_PRIORITY
Deprecated.in ONOS 1.12. Replaced byXconnectServiceVLAN cross-connect ACL priority.- See Also:
- Constant Field Values
-
XCONNECT_PRIORITY
@Deprecated static final int XCONNECT_PRIORITY
Deprecated.in ONOS 1.12. Replaced byXconnectServiceVLAN cross-connect Bridging priority.- See Also:
- Constant Field Values
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITY
Default flow priority.- See Also:
- Constant Field Values
-
MIN_IP_PRIORITY
static final int MIN_IP_PRIORITY
Minimum IP priority. Should < 0 such that priority of /0 will not conflict with lowest priority default entries.- See Also:
- Constant Field Values
-
FLOOD_PRIORITY
static final int FLOOD_PRIORITY
Subnet flooding flow priority.- See Also:
- Constant Field Values
-
-
Method Detail
-
createTunnel
TunnelHandler.Result createTunnel(Tunnel tunnel)
Creates a tunnel.- 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
-
getL2TunnelDescriptions
Set<L2TunnelDescription> getL2TunnelDescriptions(boolean pending)
Returns the l2 tunnel descriptions.- Parameters:
pending- if true fetch pending pseudowires, else fetch installed- Returns:
- set of l2 tunnel descriptions.
-
getL2Tunnels
List<L2Tunnel> getL2Tunnels()
Returns all l2 tunnels of pseudowires.- Returns:
- list of l2 tunnels
-
getL2Policies
List<L2TunnelPolicy> getL2Policies()
Returns all l2 policie of pseudowires.- Returns:
- list of l2 policies.
-
removePseudowire
L2TunnelHandler.Result removePseudowire(Integer pwId)
Removes pseudowire.- Parameters:
pwId- The id of the pseudowire.- Returns:
- SUCCESS if operation successful or a descriptive error otherwise.
-
addPseudowire
L2TunnelHandler.Result addPseudowire(L2TunnelDescription tunnel)
Adds a Pseudowire to the system.- Parameters:
tunnel- The pseudowire tunnel.- Returns:
- SUCCESS if operation is successful or a descriptive error otherwise.
-
addPseudowiresBulk
@Deprecated L2TunnelHandler.Result addPseudowiresBulk(List<DefaultL2TunnelDescription> l2TunnelDescriptions)
Deprecated.onos-1.12 use addPseudowire insteadAdds a set of pseudowires.- Parameters:
l2TunnelDescriptions- 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.
-
createPolicy
PolicyHandler.Result createPolicy(Policy policy)
Creates a policy.- 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.
-
removeTunnel
TunnelHandler.Result removeTunnel(Tunnel tunnel)
Removes a tunnel.- 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
PolicyHandler.Result removePolicy(Policy policy)
Removes a policy.- Parameters:
policy- policy reference to remove- Returns:
- POLICY_NOT_FOUND if the policy to remove does not exists, SUCCESS if it is removed successfully
-
rerouteNetwork
void rerouteNetwork()
Use current state of the network to repopulate forwarding rules.
-
getDeviceSubnetMap
Map<org.onosproject.net.DeviceId,Set<org.onlab.packet.IpPrefix>> getDeviceSubnetMap()
Returns device-subnet mapping.- Returns:
- device-subnet mapping
-
getCurrentEcmpSpg
com.google.common.collect.ImmutableMap<org.onosproject.net.DeviceId,EcmpShortestPathGraph> getCurrentEcmpSpg()
Returns the current ECMP shortest path graph in this controller instance.- Returns:
- ECMP shortest path graph
-
getDstNextObjStore
com.google.common.collect.ImmutableMap<DestinationSetNextObjectiveStoreKey,NextNeighbors> getDstNextObjStore()
Returns the destinatiomSet-NextObjective store contents.- Returns:
- current contents of the dstNextObjStore
-
getVlanNextObjStore
com.google.common.collect.ImmutableMap<VlanNextObjectiveStoreKey,Integer> getVlanNextObjStore()
Returns the VLAN next objective store.- Returns:
- current contents of the vlanNextObjStore
-
getMacVlanNextObjStore
com.google.common.collect.ImmutableMap<MacVlanNextObjectiveStoreKey,Integer> getMacVlanNextObjStore()
Returns the Mac Vlan next objective store.- Returns:
- current contents of the macVlanNextObjStore
-
getPortNextObjStore
com.google.common.collect.ImmutableMap<PortNextObjectiveStoreKey,Integer> getPortNextObjStore()
Returns the port next objective store.- Returns:
- current contents of the portNextObjStore
-
getMcastNextIds
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.- Parameters:
mcastIp- the group ip- Returns:
- the mapping mcastIp-device to next id
-
getPwInitNext
com.google.common.collect.ImmutableMap<String,org.onosproject.net.flowobjective.NextObjective> getPwInitNext()
Returns the PW init next objective store.- Returns:
- current contents of the l2InitiationNextObjStore
-
getPwTermNext
com.google.common.collect.ImmutableMap<String,org.onosproject.net.flowobjective.NextObjective> getPwTermNext()
Returns the PW termination next objective store.- Returns:
- current contents of the l2TerminationNextObjStore
-
invalidateNextObj
void invalidateNextObj(int nextId)
Removes all entries in dst/vlan/port/mcast NextObjectiveStore that are associated with the given nextId.- Parameters:
nextId- nextId
-
verifyGroups
void verifyGroups(org.onosproject.net.DeviceId id)
Triggers 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.- Parameters:
id- the device identifier
-
getSeenLinks
com.google.common.collect.ImmutableMap<org.onosproject.net.Link,Boolean> getSeenLinks()
Returns the internal link state as seen by this instance of the controller.- Returns:
- the internal link state
-
getDownedPortState
com.google.common.collect.ImmutableMap<org.onosproject.net.DeviceId,Set<org.onosproject.net.PortNumber>> getDownedPortState()
Returns the ports administratively disabled by the controller.- Returns:
- a map of devices and port numbers for administratively disabled ports. Does not include ports manually disabled by the operator.
-
getMcastRoles
Map<McastRoleStoreKey,McastRole> getMcastRoles(org.onlab.packet.IpAddress mcastIp, org.onosproject.net.ConnectPoint sourcecp)
Returns the associated roles to the mcast groups.- Parameters:
mcastIp- the group ipsourcecp- the source connect point- Returns:
- the mapping mcastIp-device to mcast role
-
getMcastTrees
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.- Parameters:
mcastIp- the group ipsourcecp- the source connect point- Returns:
- the mapping egress point to mcast path
-
getMcastLeaders
Map<org.onlab.packet.IpAddress,org.onosproject.cluster.NodeId> getMcastLeaders(org.onlab.packet.IpAddress mcastIp)
Return the leaders of the mcast groups.- Parameters:
mcastIp- the group ip- Returns:
- the mapping group-node
-
getShouldProgram
@Deprecated Map<Set<org.onosproject.net.DeviceId>,org.onosproject.cluster.NodeId> getShouldProgram()
Deprecated.in trellis-control-3.0.1Returns shouldProgram map.- Returns:
- shouldProgram map
-
getShouldProgramCache
@Deprecated Map<org.onosproject.net.DeviceId,Boolean> getShouldProgramCache()
Deprecated.in trellis-control-3.0.1Returns shouldProgram local cache.- Returns:
- shouldProgram local cache
-
getShouldProgramLeaders
Map<org.onosproject.net.DeviceId,org.onosproject.cluster.NodeId> getShouldProgramLeaders()
Returns shouldProgram leaders.- Returns:
- shouldProgram mapping device to node
-
shouldProgram
boolean shouldProgram(org.onosproject.net.DeviceId deviceId)
Determines 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.
- Parameters:
deviceId- device identifier to consider for routing- Returns:
- true if current instance should handle the routing for given device
-
getMcastFilters
Map<org.onosproject.net.DeviceId,List<McastFilteringObjStoreKey>> getMcastFilters()
Returns the mcast filtering obj.- Returns:
- the mapping group-node
-
isRoutingStable
boolean isRoutingStable()
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.- Returns:
- true if stable
-
initHost
void initHost(org.onosproject.net.DeviceId deviceId)
Invoke hostHandler.init() for given device.- Parameters:
deviceId- device ID
-
initRoute
void initRoute(org.onosproject.net.DeviceId deviceId)
Invoke routeHandler.init() for given device.- Parameters:
deviceId- device ID
-
appId
default org.onosproject.core.ApplicationId appId()
Gets application id.- Returns:
- application id
-
getInternalVlanId
default org.onlab.packet.VlanId getInternalVlanId(org.onosproject.net.ConnectPoint connectPoint)
Returns 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.
- Parameters:
connectPoint- connect point- Returns:
- internal VLAN or null if both vlan-untagged and vlan-native are undefined
-
getPairDeviceId
default Optional<org.onosproject.net.DeviceId> getPairDeviceId(org.onosproject.net.DeviceId deviceId)
Returns optional pair device ID of given device.- Parameters:
deviceId- device ID- Returns:
- optional pair device ID. Might be empty if pair device is not configured
-
getPairLocalPort
default Optional<org.onosproject.net.PortNumber> getPairLocalPort(org.onosproject.net.DeviceId deviceId)
Returns optional pair device local port of given device.- Parameters:
deviceId- device ID- Returns:
- optional pair device ID. Might be empty if pair device is not configured
-
getInfraPorts
default Set<org.onosproject.net.PortNumber> getInfraPorts(org.onosproject.net.DeviceId deviceId)
Returns a set of infrastructure ports on the given device.- Parameters:
deviceId- device ID- Returns:
- a set of ports that does not have interface configuration
-
getEdgePorts
default Set<org.onosproject.net.PortNumber> getEdgePorts(org.onosproject.net.DeviceId deviceId)
Returns a set of edge ports on the given device.- Parameters:
deviceId- device ID- Returns:
- a set of ports that has interface configuration
-
getEdgeDeviceIds
List<org.onosproject.net.DeviceId> getEdgeDeviceIds()
Returns a list of edge devices.- Returns:
- list of the edge device ids
-
getInfraDeviceIds
List<org.onosproject.net.DeviceId> getInfraDeviceIds()
Returns a list of infra devices.- Returns:
- list of the infra device ids
-
getDeviceMacAddress
org.onlab.packet.MacAddress getDeviceMacAddress(org.onosproject.net.DeviceId deviceId) throws org.onosproject.segmentrouting.config.DeviceConfigNotFoundExceptionReturns the configured mac address of the device.- Parameters:
deviceId- the device id- Returns:
- the configured mac address
- Throws:
org.onosproject.segmentrouting.config.DeviceConfigNotFoundException- if config is not present
-
getDefaultInternalVlan
org.onlab.packet.VlanId getDefaultInternalVlan()
Returns the VlanId assigned internally by default to unconfigured ports.- Returns:
- the default internal vlan id
-
-