summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
efa868d)
Problem Description:
====================
Table Miss Entry for SNAT/DNAT in FIB Table (table=21->26 flow) is
overriting when multiple router is present instead of creating new entry
for each VPN Instance.
Each router is associated with unique external network and each external
network is associated with unique internet BGP VPN Instance.
Example topology:
router-1/external-network-1/bgp-vpn-1
router-2/external-network-2/bgp-vpn-2
Both router-1 and router-2 are presented on single compute node. In this
scenario router-2 ping traffic only is working as expected. Since table 21
doesn't have the table miss entry for router-1 with bgp-vpn-1 instance.
Solution:
=========
In ExternalNetworkListener while creating table miss entry for SNAT/DNAT
in table 21, added "vpn-id" attribute also in creating flow reference as
same as implemented in the class
SNATDefaultRouteProgrammer.buildDefNATFlowEntity(). After this code change
in table 21 miss entry for SNAT/DNAT is created for each bgp-vpn instance.
Change-Id: Iac909e628f1a4134526e6df0b640149c8d45cd20
Signed-off-by: karthikeyan <karthikeyan.k@altencalsoftlabs.com>
List<InstructionInfo> instructions = new ArrayList<>();
instructions.add(new InstructionGotoTable(NwConstants.PSNAT_TABLE));
List<InstructionInfo> instructions = new ArrayList<>();
instructions.add(new InstructionGotoTable(NwConstants.PSNAT_TABLE));
- String flowRef = NatUtil.getFlowRef(dpId, NwConstants.L3_FIB_TABLE, defaultIP);
+ String flowRef = NatUtil.getFlowRef(dpId, NwConstants.L3_FIB_TABLE, defaultIP, vpnId);
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.L3_FIB_TABLE, flowRef,
NatConstants.DEFAULT_DNAT_FLOW_PRIORITY, flowRef, 0, 0,
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.L3_FIB_TABLE, flowRef,
NatConstants.DEFAULT_DNAT_FLOW_PRIORITY, flowRef, 0, 0,
+ "Cannot proceed with installation of Default NAT flow");
return;
}
+ "Cannot proceed with installation of Default NAT flow");
return;
}
+ LOG.debug("NAT Service : Installing flow {}", flowEntity);
mdsalManager.installFlow(flowEntity);
}
mdsalManager.installFlow(flowEntity);
}
+ "Cannot proceed with installation of Default NAT flow");
return;
}
+ "Cannot proceed with installation of Default NAT flow");
return;
}
+ LOG.debug("NAT Service : Removing flow {}", flowEntity);
mdsalManager.removeFlow(flowEntity);
}
}
mdsalManager.removeFlow(flowEntity);
}
}
.FLOWID_SEPARATOR + routerID + NatConstants.FLOWID_SEPARATOR + ip;
}
.FLOWID_SEPARATOR + routerID + NatConstants.FLOWID_SEPARATOR + ip;
}
- public static String getFlowRef(BigInteger dpnId, short tableId, InetAddress destPrefix) {
- return NatConstants.FLOWID_PREFIX + dpnId + NwConstants.FLOWID_SEPARATOR + tableId + NwConstants
- .FLOWID_SEPARATOR + destPrefix.getHostAddress();
- }
-
public static String getFlowRef(BigInteger dpnId, short tableId, InetAddress destPrefix, long vpnId) {
return NatConstants.NAPT_FLOWID_PREFIX + dpnId + NatConstants.FLOWID_SEPARATOR + tableId + NatConstants
public static String getFlowRef(BigInteger dpnId, short tableId, InetAddress destPrefix, long vpnId) {
return NatConstants.NAPT_FLOWID_PREFIX + dpnId + NatConstants.FLOWID_SEPARATOR + tableId + NatConstants
- .FLOWID_SEPARATOR + vpnId;
+ .FLOWID_SEPARATOR + destPrefix.getHostAddress() + NatConstants.FLOWID_SEPARATOR + vpnId;
}
public static String getNaptFlowRef(BigInteger dpnId, short tableId, String routerID, String ip, int port) {
}
public static String getNaptFlowRef(BigInteger dpnId, short tableId, String routerID, String ip, int port) {