String SEPARATOR = ".";
String DEFAULT_NEXTHOP_IP = "0.0.0.0";
long INVALID_GROUP_ID = -1;
+ int DEFAULT_VPN_INTERNAL_TUNNEL_TABLE_PRIORITY = 8;
Map<Integer, Class<? extends NxmNxReg>> NXM_REG_MAPPING = ImmutableMap.of(0, NxmNxReg0.class, 1, NxmNxReg1.class);
}
*/
package org.opendaylight.netvirt.fibmanager;
-import static org.opendaylight.netvirt.fibmanager.FibConstants.DEFAULT_FIB_FLOW_PRIORITY;
-import static org.opendaylight.netvirt.fibmanager.FibConstants.FLOWID_PREFIX;
-
import com.google.common.util.concurrent.ListenableFuture;
import java.math.BigInteger;
import java.net.InetAddress;
String flowRef = getFlowRef(dpnId, NwConstants.L3_FIB_TABLE, vpnId, ipAddress);
- int priority = DEFAULT_FIB_FLOW_PRIORITY + prefixLength;
+ int priority = FibConstants.DEFAULT_FIB_FLOW_PRIORITY + prefixLength;
Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_FIB_TABLE, flowRef,
priority, flowRef, 0, 0,
NwConstants.COOKIE_VM_FIB_TABLE, matches, null);
String flowRef = getFlowRef(dpnId, NwConstants.L3_FIB_TABLE, vpnId, ipAddress);
- int priority = DEFAULT_FIB_FLOW_PRIORITY + prefixLength;
+ int priority = FibConstants.DEFAULT_FIB_FLOW_PRIORITY + prefixLength;
Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_FIB_TABLE, flowRef,
priority, flowRef, 0, 0,
NwConstants.COOKIE_VM_FIB_TABLE, matches, customInstructions);
}
private String getFlowRef(BigInteger dpnId, short tableId, long id, String ipAddress) {
- return FLOWID_PREFIX + dpnId + NwConstants.FLOWID_SEPARATOR + tableId + NwConstants.FLOWID_SEPARATOR + id
- + NwConstants.FLOWID_SEPARATOR + ipAddress;
+ return FibConstants.FLOWID_PREFIX + dpnId + NwConstants.FLOWID_SEPARATOR + tableId
+ + NwConstants.FLOWID_SEPARATOR + id + NwConstants.FLOWID_SEPARATOR + ipAddress;
}
//TODO: Below Util methods to be removed once VpnUtil methods are exposed in api bundle
FlowEntity terminatingServiceTableFlowEntity =
MDSALUtil.buildFlowEntity(destDpId, NwConstants.INTERNAL_TUNNEL_TABLE,
- getTableMissFlowRef(destDpId, NwConstants.INTERNAL_TUNNEL_TABLE, label), 5,
- String.format("%s:%d", "TST Flow Entry ", label),
- 0, 0, COOKIE_TUNNEL.add(BigInteger.valueOf(label)), mkMatches, mkInstructions);
+ getTableMissFlowRef(destDpId, NwConstants.INTERNAL_TUNNEL_TABLE, label),
+ FibConstants.DEFAULT_VPN_INTERNAL_TUNNEL_TABLE_PRIORITY,
+ String.format("%s:%d", "TST Flow Entry ", label), 0, 0,
+ COOKIE_TUNNEL.add(BigInteger.valueOf(label)), mkMatches, mkInstructions);
FlowKey flowKey = new FlowKey(new FlowId(terminatingServiceTableFlowEntity.getFlowId()));
flowEntity = MDSALUtil.buildFlowEntity(dpId,
NwConstants.INTERNAL_TUNNEL_TABLE,
getTableMissFlowRef(dpId, NwConstants.INTERNAL_TUNNEL_TABLE, (int) label),
- 5, String.format("%s:%d", "TST Flow Entry ", label), 0, 0,
- COOKIE_TUNNEL.add(BigInteger.valueOf(label)), mkMatches, null);
+ FibConstants.DEFAULT_VPN_INTERNAL_TUNNEL_TABLE_PRIORITY,
+ String.format("%s:%d", "TST Flow Entry ", label), 0, 0,
+ COOKIE_TUNNEL.add(BigInteger.valueOf(label)), mkMatches, null);
Node nodeDpn = FibUtil.buildDpnNode(flowEntity.getDpnId());
FlowKey flowKey = new FlowKey(new FlowId(flowEntity.getFlowId()));
InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
List<MatchInfo> mkMatches = new ArrayList<>();
mkMatches.add(new MatchTunnelId(BigInteger.valueOf(l3Vni)));
Flow terminatingServiceTableFlowEntity = MDSALUtil.buildFlowNew(NwConstants.INTERNAL_TUNNEL_TABLE,
- NatEvpnUtil.getFlowRef(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, l3Vni, NatConstants.DNAT_FLOW_NAME), 6,
+ NatEvpnUtil.getFlowRef(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, l3Vni, NatConstants.DNAT_FLOW_NAME),
+ NatConstants.DEFAULT_VPN_INTERNAL_TUNNEL_TABLE_PRIORITY + 1,
String.format("%s:%d", "TST Flow Entry ", l3Vni),
0, 0, COOKIE_TUNNEL.add(BigInteger.valueOf(l3Vni)), mkMatches, customInstructions);
mdsalManager.addFlow(confTx, dpnId, terminatingServiceTableFlowEntity);
mkMatches.add(new MatchTunnelId(BigInteger.valueOf(l3Vni)));
Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.INTERNAL_TUNNEL_TABLE,
NatEvpnUtil.getFlowRef(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, l3Vni, NatConstants.DNAT_FLOW_NAME),
- 6, String.format("%s:%d", "TST Flow Entry ", l3Vni), 0, 0,
+ NatConstants.DEFAULT_VPN_INTERNAL_TUNNEL_TABLE_PRIORITY + 1,
+ String.format("%s:%d", "TST Flow Entry ", l3Vni), 0, 0,
COOKIE_TUNNEL.add(BigInteger.valueOf(l3Vni)), mkMatches, null);
mdsalManager.removeFlow(confTx, dpnId, flowEntity);
LOG.debug("removeTunnelTableEntry : Successfully removed terminating service table flow {} on DpnId {}",
mkMatches.add(new MatchTunnelId(BigInteger.valueOf(l3Vni)));
Flow terminatingServiceTableFlowEntity = MDSALUtil.buildFlowNew(NwConstants.INTERNAL_TUNNEL_TABLE,
- NatEvpnUtil.getFlowRef(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, l3Vni, NatConstants.SNAT_FLOW_NAME), 5,
+ NatEvpnUtil.getFlowRef(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, l3Vni, NatConstants.SNAT_FLOW_NAME),
+ NatConstants.DEFAULT_VPN_INTERNAL_TUNNEL_TABLE_PRIORITY,
String.format("%s:%d", "TST Flow Entry ", l3Vni),
0, 0, COOKIE_TUNNEL.add(BigInteger.valueOf(l3Vni)), mkMatches, customInstructions);
mdsalManager.addFlow(confTx, dpnId, terminatingServiceTableFlowEntity);
mkMatches.add(new MatchTunnelId(BigInteger.valueOf(l3Vni)));
Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.INTERNAL_TUNNEL_TABLE,
NatEvpnUtil.getFlowRef(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, l3Vni, NatConstants.SNAT_FLOW_NAME),
- 5, String.format("%s:%d", "TST Flow Entry ", l3Vni), 0, 0,
+ NatConstants.DEFAULT_VPN_INTERNAL_TUNNEL_TABLE_PRIORITY,
+ String.format("%s:%d", "TST Flow Entry ", l3Vni), 0, 0,
COOKIE_TUNNEL.add(BigInteger.valueOf(l3Vni)), mkMatches, null);
mdsalManager.removeFlow(confTx, dpnId, flowEntity);
LOG.debug("removeTunnelTableEntry : Successfully removed terminating service table flow {} on DpnId {}",
}
Flow terminatingServiceTableFlowEntity = MDSALUtil.buildFlowNew(NwConstants.INTERNAL_TUNNEL_TABLE,
- getFlowRef(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, serviceId, ""), 5,
- String.format("%s:%d", "TST Flow Entry ", serviceId),
- 0, 0, COOKIE_TUNNEL.add(BigInteger.valueOf(serviceId)), mkMatches, customInstructions);
+ getFlowRef(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, serviceId, ""),
+ NatConstants.DEFAULT_VPN_INTERNAL_TUNNEL_TABLE_PRIORITY,
+ String.format("%s:%d", "TST Flow Entry ", serviceId), 0, 0,
+ COOKIE_TUNNEL.add(BigInteger.valueOf(serviceId)), mkMatches, customInstructions);
mdsalManager.addFlow(confTx, dpnId, terminatingServiceTableFlowEntity);
}
int SNAT_PACKET_RETRY_THEADPOOL_SIZE = 15;
String NAT_DJC_PREFIX = "NAT-";
int NAT_DJC_MAX_RETRIES = 3;
+ int DEFAULT_VPN_INTERNAL_TUNNEL_TABLE_PRIORITY = 8;
// Flow Actions
int ADD_FLOW = 0;
int DEL_FLOW = 1;
List<MatchInfo> mkMatches = new ArrayList<>();
LOG.info("makeTunnelTableEntry on DpnId = {} and serviceId = {}", dpnId, serviceId);
- int flowPriority = 5;
+ int flowPriority = NatConstants.DEFAULT_VPN_INTERNAL_TUNNEL_TABLE_PRIORITY;
// Increased the 36->25 flow priority. If SNAT is also configured on the same
// DPN, then the traffic will be hijacked to DNAT and if there are no DNAT match,
// then handled back to using using flow 25->44(which will be installed as part of SNAT)
if (NatUtil.isOpenStackVniSemanticsEnforcedForGreAndVxlan(elanService, provType)) {
mkMatches.add(new MatchTunnelId(natOverVxlanUtil.getInternetVpnVni(vpnName, serviceId)));
- flowPriority = 6;
+ flowPriority = NatConstants.DEFAULT_VPN_INTERNAL_TUNNEL_TABLE_PRIORITY + 1;
} else {
mkMatches.add(new MatchTunnelId(BigInteger.valueOf(serviceId)));
}