Class Ofdpa2Pipeline
- java.lang.Object
-
- org.onosproject.net.driver.AbstractBehaviour
-
- org.onosproject.net.driver.AbstractHandlerBehaviour
-
- org.onosproject.driver.pipeline.ofdpa.Ofdpa2Pipeline
-
- All Implemented Interfaces:
org.onosproject.net.behaviour.Pipeliner,org.onosproject.net.driver.Behaviour,org.onosproject.net.driver.HandlerBehaviour
- Direct Known Subclasses:
Ofdpa3Pipeline,OvsOfdpaPipeline
public class Ofdpa2Pipeline extends org.onosproject.net.driver.AbstractHandlerBehaviour implements org.onosproject.net.behaviour.PipelinerDriver for Broadcom's OF-DPA v2.0 TTP.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classOfdpa2Pipeline.RetryFlowsUtility class that retries sending flows a fixed number of times, even if some of the attempts are successful.
-
Field Summary
Fields Modifier and Type Field Description protected static org.onlab.util.KryoNamespaceappKryoprotected org.onosproject.core.CoreServicecoreServiceprotected org.onosproject.net.DeviceIddeviceIdprotected org.onosproject.net.device.DeviceServicedeviceServiceprotected org.onosproject.core.ApplicationIddriverIdprotected org.onosproject.net.flowobjective.FlowObjectiveStoreflowObjectiveStoreprotected org.onosproject.net.flow.FlowRuleServiceflowRuleServiceprotected Ofdpa2GroupHandlergroupHandlerprotected org.onosproject.net.group.GroupServicegroupServiceprotected java.util.concurrent.atomic.AtomicBooleanreadyprotected org.onlab.osgi.ServiceDirectoryserviceDirectory
-
Constructor Summary
Constructors Constructor Description Ofdpa2Pipeline()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()voidfilter(org.onosproject.net.flowobjective.FilteringObjective filteringObjective)voidforward(org.onosproject.net.flowobjective.ForwardingObjective fwd)java.util.List<java.lang.String>getNextMappings(org.onosproject.net.behaviour.NextGroup nextGroup)voidinit(org.onosproject.net.DeviceId deviceId, org.onosproject.net.behaviour.PipelinerContext context)protected voidinitDriverId()protected voidinitGroupHander(org.onosproject.net.behaviour.PipelinerContext context)protected voidinitializePipeline()booleanisReady()protected booleanmatchInPortTmacTable()Determines whether in-port should be matched on in TMAC table rules.voidnext(org.onosproject.net.flowobjective.NextObjective nextObjective)protected java.util.Collection<org.onosproject.net.flow.FlowRule>processEgress(org.onosproject.net.flowobjective.ForwardingObjective fwd)In the OF-DPA 2.0 pipeline, egress forwarding objectives go to the egress tables.protected java.util.List<java.util.List<org.onosproject.net.flow.FlowRule>>processEthDstFilter(org.onosproject.net.flow.criteria.PortCriterion portCriterion, org.onosproject.net.flow.criteria.EthCriterion ethCriterion, org.onosproject.net.flow.criteria.VlanIdCriterion vidCriterion, org.onlab.packet.VlanId assignedVlan, org.onlab.packet.MacAddress unicastMac, org.onosproject.core.ApplicationId applicationId)Allows routed packets with correct destination MAC to be directed to unicast routing table, multicast routing table or MPLS forwarding table.protected java.util.List<java.util.List<org.onosproject.net.flow.FlowRule>>processEthDstOnlyFilter(org.onosproject.net.flow.criteria.EthCriterion ethCriterion, org.onosproject.core.ApplicationId applicationId)protected java.util.Collection<org.onosproject.net.flow.FlowRule>processEthDstSpecific(org.onosproject.net.flowobjective.ForwardingObjective fwd)Handles forwarding rules to the L2 bridging table.protected java.util.Collection<org.onosproject.net.flow.FlowRule>processEthTypeSpecific(org.onosproject.net.flowobjective.ForwardingObjective fwd)Handles forwarding rules to the IP and MPLS tables.protected java.util.Collection<org.onosproject.net.flow.FlowRule>processEthTypeSpecificInternal(org.onosproject.net.flowobjective.ForwardingObjective fwd, boolean allowDefaultRoute, int mplsNextTable)Internal implementation of processEthTypeSpecific.protected voidprocessFilter(org.onosproject.net.flowobjective.FilteringObjective filt, boolean install, org.onosproject.core.ApplicationId applicationId)As per OFDPA 2.0 TTP, filtering of VLAN ids and MAC addresses (for routing) configured on switch ports happen in different tables.protected java.util.Collection<org.onosproject.net.flow.FlowRule>processVersatile(org.onosproject.net.flowobjective.ForwardingObjective fwd)In the OF-DPA 2.0 pipeline, versatile forwarding objectives go to the ACL table.protected java.util.List<java.util.List<org.onosproject.net.flow.FlowRule>>processVlanIdFilter(org.onosproject.net.flow.criteria.PortCriterion portCriterion, org.onosproject.net.flow.criteria.VlanIdCriterion vidCriterion, org.onlab.packet.VlanId assignedVlan, org.onosproject.core.ApplicationId applicationId, boolean install)Internal implementation of processVlanIdFilter.protected booleanrequireEthType()Determines whether this pipeline requires one additional flow matching on ethType 0x86dd in ACL table.booleanrequireMplsBosMatch()Determines whether this pipeline requires MPLS BOS match.booleanrequireMplsPop()Determines whether this pipeline requires MPLS POP instruction.booleanrequireMplsTtlModification()Determines whether this pipeline requires MPLS TTL decrement and copy.protected booleanrequirePuntTable()protected booleanrequireUnicastBeforeMulticast()Determines whether this driver requires unicast flow to be installed before multicast flow in TMAC table.protected booleanrequireVlanExtensions()Determines whether this pipeline requires OFDPA match and set VLAN extensions.protected booleanshouldRetry()Determines whether this driver should continue to retry flows that point to empty groups.protected booleansupportIpv6L4Dst()Determines whether matching L4 destination port on IPv6 packets is supported in ACL table.protected booleansupportsUnicastBlackHole()Determines whether this driver supports installing a clearDeferred action on table 30.protected org.onosproject.net.flow.TrafficTreatment.BuilderversatileTreatmentBuilder(org.onosproject.net.flowobjective.ForwardingObjective fwd)Helper function to create traffic treatment builder for versatile forwarding objectives.-
Methods inherited from class org.onosproject.net.driver.AbstractHandlerBehaviour
handler, setHandler
-
-
-
-
Field Detail
-
serviceDirectory
protected org.onlab.osgi.ServiceDirectory serviceDirectory
-
flowRuleService
protected org.onosproject.net.flow.FlowRuleService flowRuleService
-
coreService
protected org.onosproject.core.CoreService coreService
-
groupService
protected org.onosproject.net.group.GroupService groupService
-
flowObjectiveStore
protected org.onosproject.net.flowobjective.FlowObjectiveStore flowObjectiveStore
-
deviceId
protected org.onosproject.net.DeviceId deviceId
-
driverId
protected org.onosproject.core.ApplicationId driverId
-
deviceService
protected org.onosproject.net.device.DeviceService deviceService
-
appKryo
protected static org.onlab.util.KryoNamespace appKryo
-
groupHandler
protected Ofdpa2GroupHandler groupHandler
-
ready
protected java.util.concurrent.atomic.AtomicBoolean ready
-
-
Method Detail
-
init
public void init(org.onosproject.net.DeviceId deviceId, org.onosproject.net.behaviour.PipelinerContext context)- Specified by:
initin interfaceorg.onosproject.net.behaviour.Pipeliner
-
isReady
public boolean isReady()
- Specified by:
isReadyin interfaceorg.onosproject.net.behaviour.Pipeliner
-
cleanUp
public void cleanUp()
- Specified by:
cleanUpin interfaceorg.onosproject.net.behaviour.Pipeliner
-
initDriverId
protected void initDriverId()
-
initGroupHander
protected void initGroupHander(org.onosproject.net.behaviour.PipelinerContext context)
-
initializePipeline
protected void initializePipeline()
-
requireMplsPop
public boolean requireMplsPop()
Determines whether this pipeline requires MPLS POP instruction.- Returns:
- true to use MPLS POP instruction
-
requireEthType
protected boolean requireEthType()
Determines whether this pipeline requires one additional flow matching on ethType 0x86dd in ACL table.- Returns:
- true to create one additional flow matching on ethType 0x86dd in ACL table
-
requireMplsBosMatch
public boolean requireMplsBosMatch()
Determines whether this pipeline requires MPLS BOS match.- Returns:
- true to use MPLS BOS match
-
requireMplsTtlModification
public boolean requireMplsTtlModification()
Determines whether this pipeline requires MPLS TTL decrement and copy.- Returns:
- true to use MPLS TTL decrement and copy
-
requireVlanExtensions
protected boolean requireVlanExtensions()
Determines whether this pipeline requires OFDPA match and set VLAN extensions.- Returns:
- true to use the extensions
-
matchInPortTmacTable
protected boolean matchInPortTmacTable()
Determines whether in-port should be matched on in TMAC table rules.- Returns:
- true if match on in-port should be programmed
-
supportIpv6L4Dst
protected boolean supportIpv6L4Dst()
Determines whether matching L4 destination port on IPv6 packets is supported in ACL table.- Returns:
- true if matching L4 destination port on IPv6 packets is supported in ACL table.
-
shouldRetry
protected boolean shouldRetry()
Determines whether this driver should continue to retry flows that point to empty groups. See CORD-554.- Returns:
- true if the driver should retry flows
-
requireUnicastBeforeMulticast
protected boolean requireUnicastBeforeMulticast()
Determines whether this driver requires unicast flow to be installed before multicast flow in TMAC table.- Returns:
- true if required
-
supportsUnicastBlackHole
protected boolean supportsUnicastBlackHole()
Determines whether this driver supports installing a clearDeferred action on table 30.- Returns:
- true if required
-
requirePuntTable
protected boolean requirePuntTable()
-
filter
public void filter(org.onosproject.net.flowobjective.FilteringObjective filteringObjective)
- Specified by:
filterin interfaceorg.onosproject.net.behaviour.Pipeliner
-
forward
public void forward(org.onosproject.net.flowobjective.ForwardingObjective fwd)
- Specified by:
forwardin interfaceorg.onosproject.net.behaviour.Pipeliner
-
next
public void next(org.onosproject.net.flowobjective.NextObjective nextObjective)
- Specified by:
nextin interfaceorg.onosproject.net.behaviour.Pipeliner
-
processFilter
protected void processFilter(org.onosproject.net.flowobjective.FilteringObjective filt, boolean install, org.onosproject.core.ApplicationId applicationId)As per OFDPA 2.0 TTP, filtering of VLAN ids and MAC addresses (for routing) configured on switch ports happen in different tables.- Parameters:
filt- the filtering objectiveinstall- indicates whether to add or remove the objectiveapplicationId- the application that sent this objective
-
processVlanIdFilter
protected java.util.List<java.util.List<org.onosproject.net.flow.FlowRule>> processVlanIdFilter(org.onosproject.net.flow.criteria.PortCriterion portCriterion, org.onosproject.net.flow.criteria.VlanIdCriterion vidCriterion, org.onlab.packet.VlanId assignedVlan, org.onosproject.core.ApplicationId applicationId, boolean install)Internal implementation of processVlanIdFilter.The is_present bit in set_vlan_vid action is required to be 0 in OFDPA i12. Since it is non-OF spec, we need an extension treatment for that. The useVlanExtension must be set to false for OFDPA i12.
NOTE: Separate VLAN filtering rules and assignment rules into different stages in order to guarantee that filtering rules always go first, as required by OFDPA.
- Parameters:
portCriterion- port on device for which this filter is programmedvidCriterion- vlan assigned to port, or NONE for untaggedassignedVlan- assigned vlan-id for untagged packetsapplicationId- for application programming this filterinstall- indicates whether to add or remove the objective- Returns:
- stages of flow rules for port-vlan filters
-
processEthDstFilter
protected java.util.List<java.util.List<org.onosproject.net.flow.FlowRule>> processEthDstFilter(org.onosproject.net.flow.criteria.PortCriterion portCriterion, org.onosproject.net.flow.criteria.EthCriterion ethCriterion, org.onosproject.net.flow.criteria.VlanIdCriterion vidCriterion, org.onlab.packet.VlanId assignedVlan, org.onlab.packet.MacAddress unicastMac, org.onosproject.core.ApplicationId applicationId)Allows routed packets with correct destination MAC to be directed to unicast routing table, multicast routing table or MPLS forwarding table.- Parameters:
portCriterion- port on device for which this filter is programmedethCriterion- dstMac of device for which is filter is programmedvidCriterion- vlan assigned to port, or NONE for untaggedassignedVlan- assigned vlan-id for untagged packetsunicastMac- some switches require a unicast TMAC flow to be programmed before multicast TMAC flow. This MAC address will be used for the unicast TMAC flow. This is unused if the filtering objective is a unicast.applicationId- for application programming this filter- Returns:
- stages of flow rules for port-vlan filters
-
processEthDstOnlyFilter
protected java.util.List<java.util.List<org.onosproject.net.flow.FlowRule>> processEthDstOnlyFilter(org.onosproject.net.flow.criteria.EthCriterion ethCriterion, org.onosproject.core.ApplicationId applicationId)
-
processEgress
protected java.util.Collection<org.onosproject.net.flow.FlowRule> processEgress(org.onosproject.net.flowobjective.ForwardingObjective fwd)
In the OF-DPA 2.0 pipeline, egress forwarding objectives go to the egress tables.- Parameters:
fwd- the forwarding objective of type 'egress'- Returns:
- a collection of flow rules to be sent to the switch. An empty collection may be returned if there is a problem in processing the flow rule
-
processVersatile
protected java.util.Collection<org.onosproject.net.flow.FlowRule> processVersatile(org.onosproject.net.flowobjective.ForwardingObjective fwd)
In the OF-DPA 2.0 pipeline, versatile forwarding objectives go to the ACL table.- Parameters:
fwd- the forwarding objective of type 'versatile'- Returns:
- a collection of flow rules to be sent to the switch. An empty collection may be returned if there is a problem in processing the flow rule
-
versatileTreatmentBuilder
protected org.onosproject.net.flow.TrafficTreatment.Builder versatileTreatmentBuilder(org.onosproject.net.flowobjective.ForwardingObjective fwd)
Helper function to create traffic treatment builder for versatile forwarding objectives.- Parameters:
fwd- original forwarding objective- Returns:
- treatment builder for the flow rule, or null if there is an error.
-
processEthTypeSpecific
protected java.util.Collection<org.onosproject.net.flow.FlowRule> processEthTypeSpecific(org.onosproject.net.flowobjective.ForwardingObjective fwd)
Handles forwarding rules to the IP and MPLS tables.- Parameters:
fwd- the forwarding objective- Returns:
- A collection of flow rules, or an empty set
-
processEthTypeSpecificInternal
protected java.util.Collection<org.onosproject.net.flow.FlowRule> processEthTypeSpecificInternal(org.onosproject.net.flowobjective.ForwardingObjective fwd, boolean allowDefaultRoute, int mplsNextTable)Internal implementation of processEthTypeSpecific.Wildcarded IPv4_DST is not supported in OFDPA i12. Therefore, we break the rule into 0.0.0.0/1 and 128.0.0.0/1. The allowDefaultRoute must be set to false for OFDPA i12.
- Parameters:
fwd- the forwarding objectiveallowDefaultRoute- allow wildcarded IPv4_DST or notmplsNextTable- next MPLS table- Returns:
- A collection of flow rules, or an empty set
-
processEthDstSpecific
protected java.util.Collection<org.onosproject.net.flow.FlowRule> processEthDstSpecific(org.onosproject.net.flowobjective.ForwardingObjective fwd)
Handles forwarding rules to the L2 bridging table. Flow actions are not allowed in the bridging table - instead we use L2 Interface group or L2 flood group- Parameters:
fwd- the forwarding objective- Returns:
- A collection of flow rules, or an empty set
-
getNextMappings
public java.util.List<java.lang.String> getNextMappings(org.onosproject.net.behaviour.NextGroup nextGroup)
- Specified by:
getNextMappingsin interfaceorg.onosproject.net.behaviour.Pipeliner
-
-