Class ArpResponderUtil
- java.lang.Object
-
- org.opendaylight.netvirt.elan.arp.responder.ArpResponderUtil
-
public final class ArpResponderUtil extends java.lang.Object
Arp Responder Utility Class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ArpResponderUtil.TriFunction<T,U,S,R>
A Interface that represent lambda TriFunction.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.opendaylight.genius.mdsalutil.FlowEntity
createArpDefaultFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, short tableId, int arpOpType, java.util.function.Supplier<java.util.List<org.opendaylight.genius.mdsalutil.MatchInfo>> matches, java.util.function.Supplier<java.util.List<org.opendaylight.genius.mdsalutil.ActionInfo>> actions)
static org.opendaylight.yangtools.yang.common.Uint64
generateCookie(int lportTag, java.lang.String ipAddress)
Generate Cookie per flow.static org.opendaylight.genius.mdsalutil.FlowEntity
getArpResponderTableMissFlow(org.opendaylight.yangtools.yang.common.Uint64 dpnId)
Get Default ARP Responder Drop flow on the DPN.static java.util.List<org.opendaylight.genius.mdsalutil.BucketInfo>
getDefaultBucketInfos(short resubmitTableId)
Get Bucket Actions for ARP Responder Group Flow.static java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action>
getEgressActionsForInterface(org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager ifaceMgrRpcService, org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.ItmRpcService itmRpcService, java.lang.String ifName, int actionCounter, boolean isTunnelInterface)
Get List of Egress Action for the VPN interface.static java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction>
getExtInterfaceInstructions(org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager ifaceMgrRpcService, org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.ItmRpcService itmRpcService, java.lang.String extInterfaceName, java.lang.String ipAddress, java.lang.String macAddress)
Get instruction list for ARP responder flows originated from ext-net e.g.static java.lang.String
getFlowId(int lportTag, java.lang.String ipAdress)
Creates Uniquely Identifiable flow Id.static java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction>
getInterfaceInstructions(org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager ifaceMgrRpcService, java.lang.String interfaceName, java.lang.String ipAddress, java.lang.String macAddress, org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.ItmRpcService itmRpcService)
Get instruction list for ARP responder flows.static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfo>
getMatchCriteria(int lportTag, ElanInstance elanInstance, java.lang.String ipAddress)
Get Match Criteria for the ARP Responder Flow.static java.lang.Long
retrieveStandardArpResponderGroupId(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService idManager)
Uses the IdManager to retrieve ARP Responder GroupId from ELAN pool.
-
-
-
Method Detail
-
getArpResponderTableMissFlow
public static org.opendaylight.genius.mdsalutil.FlowEntity getArpResponderTableMissFlow(org.opendaylight.yangtools.yang.common.Uint64 dpnId)
Get Default ARP Responder Drop flow on the DPN.- Parameters:
dpnId
- DPN on which group flow to be installed
-
getDefaultBucketInfos
public static java.util.List<org.opendaylight.genius.mdsalutil.BucketInfo> getDefaultBucketInfos(short resubmitTableId)
Get Bucket Actions for ARP Responder Group Flow.Install Default Groups, Group has 1 Bucket
- Resubmit to Table
NwConstants.ARP_RESPONDER_TABLE
, for ARP Auto response from DPN itself
- Parameters:
resubmitTableId
- Resubmit Flow Table Id- Returns:
- List of bucket actions
- Resubmit to Table
-
getMatchCriteria
public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfo> getMatchCriteria(int lportTag, ElanInstance elanInstance, java.lang.String ipAddress)
Get Match Criteria for the ARP Responder Flow.List of Match Criteria for ARP Responder
- Packet is ARP
- Packet is ARP Request
- The ARP packet is requesting for Gateway IP
- Metadata which is generated by using Service
Index(
NwConstants.L3VPN_SERVICE_INDEX
) Lport Tag (MetaDataUtil.METADATA_MASK_LPORT_TAG
) and VRF ID(MetaDataUtil.METADATA_MASK_VRFID
)
- Parameters:
lportTag
- LPort TagelanInstance
- Elan InstanceipAddress
- Ip Address to be matched to this flow- Returns:
- List of Match criteria
-
getInterfaceInstructions
public static java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> getInterfaceInstructions(org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager ifaceMgrRpcService, java.lang.String interfaceName, java.lang.String ipAddress, java.lang.String macAddress, org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.ItmRpcService itmRpcService)
Get instruction list for ARP responder flows.
-
getExtInterfaceInstructions
public static java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> getExtInterfaceInstructions(org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager ifaceMgrRpcService, org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.ItmRpcService itmRpcService, java.lang.String extInterfaceName, java.lang.String ipAddress, java.lang.String macAddress)
Get instruction list for ARP responder flows originated from ext-net e.g. router-gw/fip.
The split-horizon bit should be reset in order to allow traffic from provider network to be routed back to flat/VLAN network and override the egress table drop flow.
In order to allow write-metadata in the ARP responder table the resubmit action needs to be replaced with goto instruction.
-
getFlowId
public static java.lang.String getFlowId(int lportTag, java.lang.String ipAdress)
Creates Uniquely Identifiable flow Id.- Parameters:
lportTag
- LportTag of the flowipAdress
- Gateway IP for which ARP Response flow to be installed- Returns:
- Unique Flow Id
- See Also:
ArpResponderConstant.FLOW_ID_FORMAT_WITH_LPORT
,ArpResponderConstant.FLOW_ID_FORMAT_WITHOUT_LPORT
-
generateCookie
public static org.opendaylight.yangtools.yang.common.Uint64 generateCookie(int lportTag, java.lang.String ipAddress)
Generate Cookie per flow.Cookie is generated by Summation of
NwConstants.COOKIE_ARP_RESPONDER
+ 1 + lportTag + Gateway IP- Parameters:
lportTag
- Lport Tag of the flowipAddress
- Gateway IP for which ARP Response flow to be installed- Returns:
- Cookie
-
createArpDefaultFlow
public static org.opendaylight.genius.mdsalutil.FlowEntity createArpDefaultFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, short tableId, int arpOpType, java.util.function.Supplier<java.util.List<org.opendaylight.genius.mdsalutil.MatchInfo>> matches, java.util.function.Supplier<java.util.List<org.opendaylight.genius.mdsalutil.ActionInfo>> actions)
-
getEgressActionsForInterface
public static java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> getEgressActionsForInterface(org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager ifaceMgrRpcService, org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.ItmRpcService itmRpcService, java.lang.String ifName, int actionCounter, boolean isTunnelInterface)
Get List of Egress Action for the VPN interface.- Parameters:
ifaceMgrRpcService
- Interface Manager RPC reference that invokes API to retrieve Egress ActionifName
- VPN Interface for which Egress Action to be retrievedactionCounter
- Action Key- Returns:
- List of Egress Actions
-
retrieveStandardArpResponderGroupId
public static java.lang.Long retrieveStandardArpResponderGroupId(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService idManager)
Uses the IdManager to retrieve ARP Responder GroupId from ELAN pool.- Parameters:
idManager
- the id manager- Returns:
- the integer
-
-