public class Ofdpa2GroupHandler extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
Ofdpa2GroupHandler.GroupChainElem
Represents a group element that is part of a chain of groups.
|
protected class |
Ofdpa2GroupHandler.GroupInfo
Utility class for moving group information around.
|
protected static class |
Ofdpa2GroupHandler.OfdpaMplsGroupSubType
Helper enum to handle the different MPLS group
types.
|
protected class |
Ofdpa2GroupHandler.OfdpaNextGroup
Represents an entire group-chain that implements a Next-Objective from
the application.
|
| Modifier and Type | Field and Description |
|---|---|
protected org.onosproject.net.DeviceId |
deviceId |
protected org.onosproject.net.group.GroupService |
groupService |
protected static int |
L2_FLOOD_TYPE |
protected static int |
L2_INTERFACE_TYPE |
protected static int |
L3_ECMP_TYPE |
protected static int |
L3_INTERFACE_TYPE |
protected static int |
L3_MULTICAST_TYPE |
protected static int |
L3_UNICAST_TYPE |
protected static int |
MPLS_INTERFACE_TYPE |
protected static int |
MPLS_L3VPN_SUBTYPE |
protected ConcurrentHashMap<Integer,org.onosproject.net.flowobjective.NextObjective> |
pendingBuckets |
protected static long |
PORT_HIGHER_BITS_MASK |
protected static int |
PORT_LOWER_BITS_MASK |
protected org.onosproject.store.service.StorageService |
storageService |
protected static int |
SUBTYPE_MASK |
protected static int |
TYPE_MASK |
protected static int |
TYPE_VLAN_MASK |
| Constructor and Description |
|---|
Ofdpa2GroupHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBucketToGroup(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
Adds a bucket to the top level group of a group-chain, and creates the chain.
|
protected void |
addGroup(org.onosproject.net.flowobjective.NextObjective nextObjective) |
protected void |
createHashBucketChains(org.onosproject.net.flowobjective.NextObjective nextObj,
List<Deque<org.onosproject.net.group.GroupKey>> allGroupKeys,
List<Ofdpa2GroupHandler.GroupInfo> unsentGroups)
Creates group chains for all buckets in a hashed group, and stores the
GroupInfos and GroupKeys for all the groups in the lists passed in, which
should be empty.
|
protected Ofdpa2GroupHandler.GroupInfo |
createL2L3Chain(org.onosproject.net.flow.TrafficTreatment treatment,
int nextId,
org.onosproject.core.ApplicationId appId,
boolean mpls,
org.onosproject.net.flow.TrafficSelector meta)
Creates one of two possible group-chains from the treatment
passed in.
|
protected Ofdpa2GroupHandler.GroupInfo |
createL2L3ChainInternal(org.onosproject.net.flow.TrafficTreatment treatment,
int nextId,
org.onosproject.core.ApplicationId appId,
boolean mpls,
org.onosproject.net.flow.TrafficSelector meta,
boolean useSetVlanExtension)
Internal implementation of createL2L3Chain.
|
protected int |
getNextAvailableIndex() |
protected void |
init(org.onosproject.net.DeviceId deviceId,
org.onosproject.net.behaviour.PipelinerContext context) |
protected int |
l2InterfaceGroupKey(org.onosproject.net.DeviceId deviceId,
org.onlab.packet.VlanId vlanId,
long portNumber)
Returns a hash as the L2 Interface Group Key.
|
Integer |
makeMplsForwardingGroupId(Ofdpa2GroupHandler.OfdpaMplsGroupSubType subType,
int index)
Creates MPLS Forwarding group id given a sub type and
the index.
|
Integer |
makeMplsLabelGroupId(Ofdpa2GroupHandler.OfdpaMplsGroupSubType subType,
int index)
Creates MPLS Label group id given a sub type and
the index.
|
protected void |
processHashedNextObjective(org.onosproject.net.flowobjective.NextObjective nextObj)
As per the OFDPA 2.0 TTP, packets are sent out of ports by using
a chain of groups.
|
protected void |
processPwNextObjective(org.onosproject.net.flowobjective.NextObjective nextObjective)
Processes the pseudo wire related next objective.
|
protected static org.onosproject.net.PortNumber |
readOutPortFromTreatment(org.onosproject.net.flow.TrafficTreatment tt)
Returns the outport in a traffic treatment.
|
protected void |
removeBucketFromGroup(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
Removes the bucket in the top level group of a possible group-chain.
|
protected void |
removeGroup(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
Removes all groups in multiple possible group-chains that represent the next
objective.
|
protected void |
updatePendingGroups(org.onosproject.net.group.GroupKey gkey,
Ofdpa2GroupHandler.GroupChainElem gce) |
protected void |
updatePendingNextObjective(org.onosproject.net.group.GroupKey key,
Ofdpa2GroupHandler.OfdpaNextGroup value) |
boolean |
verifyHashedNextObjective(org.onosproject.net.flowobjective.NextObjective nextObjective)
The purpose of this function is to verify if the hashed next
objective is supported by the current pipeline.
|
protected static final int L2_INTERFACE_TYPE
protected static final int L3_INTERFACE_TYPE
protected static final int L3_UNICAST_TYPE
protected static final int L3_MULTICAST_TYPE
protected static final int MPLS_INTERFACE_TYPE
protected static final int MPLS_L3VPN_SUBTYPE
protected static final int L3_ECMP_TYPE
protected static final int L2_FLOOD_TYPE
protected static final int TYPE_MASK
protected static final int SUBTYPE_MASK
protected static final int TYPE_VLAN_MASK
protected static final int PORT_LOWER_BITS_MASK
protected static final long PORT_HIGHER_BITS_MASK
protected org.onosproject.net.group.GroupService groupService
protected org.onosproject.store.service.StorageService storageService
protected org.onosproject.net.DeviceId deviceId
protected ConcurrentHashMap<Integer,org.onosproject.net.flowobjective.NextObjective> pendingBuckets
protected void init(org.onosproject.net.DeviceId deviceId,
org.onosproject.net.behaviour.PipelinerContext context)
public boolean verifyHashedNextObjective(org.onosproject.net.flowobjective.NextObjective nextObjective)
nextObjective - the hashed objective to verifyprotected void addGroup(org.onosproject.net.flowobjective.NextObjective nextObjective)
protected Ofdpa2GroupHandler.GroupInfo createL2L3Chain(org.onosproject.net.flow.TrafficTreatment treatment, int nextId, org.onosproject.core.ApplicationId appId, boolean mpls, org.onosproject.net.flow.TrafficSelector meta)
treatment - that needs to be broken up to create the group chainnextId - of the next objective that needs this group chainappId - of the application that sent this next objectivempls - determines if L3Unicast or MPLSInterface group is createdmeta - metadata passed in by the application as part of the nextObjectiveprotected Ofdpa2GroupHandler.GroupInfo createL2L3ChainInternal(org.onosproject.net.flow.TrafficTreatment treatment, int nextId, org.onosproject.core.ApplicationId appId, boolean mpls, org.onosproject.net.flow.TrafficSelector meta, boolean useSetVlanExtension)
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 useSetVlanExtension must be set to false for OFDPA i12.
treatment - that needs to be broken up to create the group chainnextId - of the next objective that needs this group chainappId - of the application that sent this next objectivempls - determines if L3Unicast or MPLSInterface group is createdmeta - metadata passed in by the application as part of the nextObjectiveuseSetVlanExtension - use the setVlanVid extension that has is_present bit set to 0.protected void processHashedNextObjective(org.onosproject.net.flowobjective.NextObjective nextObj)
NOTE: We do not create MPLS ECMP groups as they are unimplemented in OF-DPA 2.0 (even though it is in the spec). Therefore we do not check the nextObjective meta to see what is matching before being sent to this nextObjective.
nextObj - the nextObjective of type HASHEDprotected void createHashBucketChains(org.onosproject.net.flowobjective.NextObjective nextObj,
List<Deque<org.onosproject.net.group.GroupKey>> allGroupKeys,
List<Ofdpa2GroupHandler.GroupInfo> unsentGroups)
Does not create the top level ECMP group. Does not actually send the groups to the groupService.
nextObj - the Next Objective with buckets that need to be converted
to group chainsallGroupKeys - a list to store groupKey for each bucket-group-chainunsentGroups - a list to store GroupInfo for each bucket-group-chainprotected void processPwNextObjective(org.onosproject.net.flowobjective.NextObjective nextObjective)
nextObjective - the objective to process.protected void addBucketToGroup(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
nextObjective - the bucket information for a next groupnext - the representation of the existing group-chain for this next objectiveprotected void removeBucketFromGroup(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
nextObjective - the bucket information for a next groupnext - the representation of the existing group-chain for this next objectiveprotected void removeGroup(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
nextObjective - the next objective to removenext - the NextGroup that represents the existing group-chain for
this next objectiveprotected void updatePendingNextObjective(org.onosproject.net.group.GroupKey key,
Ofdpa2GroupHandler.OfdpaNextGroup value)
protected void updatePendingGroups(org.onosproject.net.group.GroupKey gkey,
Ofdpa2GroupHandler.GroupChainElem gce)
protected int getNextAvailableIndex()
protected static org.onosproject.net.PortNumber readOutPortFromTreatment(org.onosproject.net.flow.TrafficTreatment tt)
tt - the treatmentprotected int l2InterfaceGroupKey(org.onosproject.net.DeviceId deviceId,
org.onlab.packet.VlanId vlanId,
long portNumber)
deviceId - Device IDvlanId - VLAN IDportNumber - Port numberpublic Integer makeMplsLabelGroupId(Ofdpa2GroupHandler.OfdpaMplsGroupSubType subType, int index)
subType - the MPLS Label group sub typeindex - the index of the grouppublic Integer makeMplsForwardingGroupId(Ofdpa2GroupHandler.OfdpaMplsGroupSubType subType, int index)
subType - the MPLS forwarding group sub typeindex - the index of the group