public class Ofdpa2GroupHandler extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.onosproject.net.DeviceId |
deviceId |
protected org.onosproject.net.flowobjective.FlowObjectiveStore |
flowObjectiveStore |
protected org.onosproject.net.group.GroupService |
groupService |
protected org.slf4j.Logger |
log |
protected ConcurrentHashMap<Integer,Set<org.onosproject.net.flowobjective.NextObjective>> |
pendingBuckets |
protected org.onosproject.store.service.StorageService |
storageService |
| 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)
Adds a list of group chain by given NextObjective.
|
protected void |
addPendingRemoveNextObjective(org.onosproject.net.flowobjective.NextObjective nextObjective,
List<org.onosproject.net.group.GroupKey> groupKeys) |
protected void |
addPendingUpdateNextObjective(org.onosproject.net.group.GroupKey groupKey,
org.onosproject.net.flowobjective.NextObjective nextObjective) |
protected void |
createEcmpHashBucketChains(org.onosproject.net.flowobjective.NextObjective nextObj,
List<Deque<org.onosproject.net.group.GroupKey>> allGroupKeys,
List<OfdpaGroupHandlerUtility.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 OfdpaGroupHandlerUtility.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 OfdpaGroupHandlerUtility.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 org.onosproject.net.group.GroupDescription |
createMplsSwap(int nextGroupId,
OfdpaGroupHandlerUtility.OfdpaMplsGroupSubType subtype,
int index,
org.onlab.packet.MplsLabel mplsLabel,
org.onosproject.core.ApplicationId applicationId)
Creates an Mpls group of type swap.
|
protected int |
getNextAvailableIndex() |
void |
init(org.onosproject.net.DeviceId deviceId,
org.onosproject.net.behaviour.PipelinerContext context) |
protected void |
modifyBucketFromGroup(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup nextGroup)
modifies group with next objective.
|
protected void |
modifyBucketInL2Group(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
Modify buckets in the L2 interface group.
|
protected void |
modifyBucketInL3Group(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next) |
protected void |
processEcmpHashedNextObjective(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 |
processPendingAddGroupsOrNextObjs(org.onosproject.net.group.GroupKey key,
boolean added) |
protected void |
processPendingRemoveNextObjs(org.onosproject.net.group.GroupKey key) |
protected void |
processPendingUpdateNextObjs(org.onosproject.net.group.GroupKey groupKey) |
protected void |
processPwNextObjective(org.onosproject.net.flowobjective.NextObjective nextObjective)
Processes the pseudo wire related next objective.
|
protected void |
removeBucket(List<Deque<org.onosproject.net.group.GroupKey>> chainsToRemove,
org.onosproject.net.flowobjective.NextObjective nextObjective)
Removes top-level buckets from a group that represents the given next objective.
|
protected void |
removeBucketFromGroup(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
Removes buckets 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-obj.
|
protected boolean |
requireAllowVlanTransition()
Determines whether this pipeline requires AllowVlanTransition in L2 unfiltered group.
|
protected boolean |
requireVlanPopBeforeMplsPush()
Determines whether this pipeline requires popping VLAN before pushing MPLS.
|
protected boolean |
supportCopyTtl()
Determines whether this pipeline support copy ttl instructions or not.
|
protected boolean |
supportSetMplsBos()
Determines whether this pipeline support set mpls bos instruction or not.
|
protected void |
updatePendingGroups(org.onosproject.net.group.GroupKey groupKey,
OfdpaGroupHandlerUtility.GroupChainElem gce) |
protected void |
updatePendingNextObjective(org.onosproject.net.group.GroupKey groupKey,
OfdpaGroupHandlerUtility.OfdpaNextGroup nextGrp) |
protected void |
verifyGroup(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
Checks existing buckets in
NextGroup to verify if they match
the buckets in the given NextObjective. |
protected final org.slf4j.Logger log
protected org.onosproject.net.group.GroupService groupService
protected org.onosproject.store.service.StorageService storageService
protected org.onosproject.net.flowobjective.FlowObjectiveStore flowObjectiveStore
protected org.onosproject.net.DeviceId deviceId
protected ConcurrentHashMap<Integer,Set<org.onosproject.net.flowobjective.NextObjective>> pendingBuckets
protected boolean supportCopyTtl()
protected boolean supportSetMplsBos()
protected boolean requireVlanPopBeforeMplsPush()
If required, pop vlan before push mpls and add an arbitrary vlan back afterward. MPLS interface group will substitute the arbitrary VLAN with expected VLAN later on.
protected boolean requireAllowVlanTransition()
public void init(org.onosproject.net.DeviceId deviceId,
org.onosproject.net.behaviour.PipelinerContext context)
protected void addGroup(org.onosproject.net.flowobjective.NextObjective nextObjective)
nextObjective - the NextObjectiveprotected org.onosproject.net.group.GroupDescription createMplsSwap(int nextGroupId,
OfdpaGroupHandlerUtility.OfdpaMplsGroupSubType subtype,
int index,
org.onlab.packet.MplsLabel mplsLabel,
org.onosproject.core.ApplicationId applicationId)
nextGroupId - the next group in the chainsubtype - the mpls swap label group subtypeindex - the index of the groupmplsLabel - the mpls label to swapapplicationId - the application idprotected OfdpaGroupHandlerUtility.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 OfdpaGroupHandlerUtility.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 processEcmpHashedNextObjective(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 createEcmpHashBucketChains(org.onosproject.net.flowobjective.NextObjective nextObj,
List<Deque<org.onosproject.net.group.GroupKey>> allGroupKeys,
List<OfdpaGroupHandlerUtility.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 - a next objective that contains information for the
buckets to be removed from the groupnext - the representation of the existing group-chains for this next
objective, from which the top-level buckets to remove are determinedprotected void removeBucket(List<Deque<org.onosproject.net.group.GroupKey>> chainsToRemove, org.onosproject.net.flowobjective.NextObjective nextObjective)
chainsToRemove - a list of group bucket chains to removenextObjective - the next objective that contains information for the
buckets to be removed from the groupprotected 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 modifyBucketFromGroup(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup nextGroup)
nextObjective - the NextObjectivenextGroup - the NextGroupprotected void modifyBucketInL2Group(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
nextObjective - a next objective that contains information for the
buckets to be modified in the groupnext - the representation of the existing group-chains for this next
objective, from which the innermost group buckets to remove are determinedprotected void modifyBucketInL3Group(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
protected void verifyGroup(org.onosproject.net.flowobjective.NextObjective nextObjective,
org.onosproject.net.behaviour.NextGroup next)
NextGroup to verify if they match
the buckets in the given NextObjective. Adds or removes buckets
to ensure that the buckets match up.nextObjective - the next objective to verifynext - the representation of the existing group which has to be
modified to match the given next objectiveprotected void updatePendingNextObjective(org.onosproject.net.group.GroupKey groupKey,
OfdpaGroupHandlerUtility.OfdpaNextGroup nextGrp)
protected void updatePendingGroups(org.onosproject.net.group.GroupKey groupKey,
OfdpaGroupHandlerUtility.GroupChainElem gce)
protected void addPendingUpdateNextObjective(org.onosproject.net.group.GroupKey groupKey,
org.onosproject.net.flowobjective.NextObjective nextObjective)
protected void addPendingRemoveNextObjective(org.onosproject.net.flowobjective.NextObjective nextObjective,
List<org.onosproject.net.group.GroupKey> groupKeys)
protected int getNextAvailableIndex()
protected void processPendingUpdateNextObjs(org.onosproject.net.group.GroupKey groupKey)
protected void processPendingRemoveNextObjs(org.onosproject.net.group.GroupKey key)
protected void processPendingAddGroupsOrNextObjs(org.onosproject.net.group.GroupKey key,
boolean added)