Skip to content

Commit 5904408

Browse files
Prashasthi Melantameta-codesync[bot]
authored andcommitted
Use high second octet for mirror receiver IP to avoid conflicts
Summary: Mirror tests fail on platforms with many ports because the receiver IP (`201.0.0.10`) can conflict with interface IPs generated by `genInterfaceAddress()`. The function uses `ipDecimal % 224` for the first octet and `ipDecimal / 224` for the second octet. With 200+ ports, the second octet increments, creating interface IPs like `201.0.0.x` that conflict with the receiver IP. Changed receiver IP to `201.201.0.10` - using a high second octet (201) ensures no conflict since `ipDecimal / 224` produces small values for typical port counts. Issue : Tahan-sb has more interfaces than Tahan (100T switch with 400G ports vs 50T switch with 800G ports). The test creates a subnet for each interface sequentially starting from 1.0.0.0/24, with drop rules installed in the ASIC for each subnet. Test packets are sent to 201.x.x.x expecting them to be mirrored. On Tahan, the packet doesn't match any subnet and catches the default route with a valid next-hop, so the packet reaches the port and gets mirrored. On Tahan-sb, due to the increased number of interfaces, the packet matches a subnet route and gets dropped before reaching the port - resulting in no mirroring. Reviewed By: ashutoshgrewal Differential Revision: D90695135 fbshipit-source-id: 3785e625dd602620a87463aaacf32596e0e236de
1 parent 1111e8f commit 5904408

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fboss/agent/test/utils/MirrorTestUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ namespace facebook::fboss::utility {
1010
template <>
1111
MirrorTestParams<folly::IPAddressV4> getMirrorTestParams<folly::IPAddressV4>() {
1212
return MirrorTestParams<folly::IPAddressV4>(
13-
folly::IPAddressV4("101.0.0.10"), // sender
14-
folly::IPAddressV4("201.0.0.10"), // receiver
13+
folly::IPAddressV4("101.201.0.10"), // sender
14+
folly::IPAddressV4("201.201.0.10"), // receiver
1515
folly::IPAddressV4("101.0.0.11")); // erspan destination
1616
}
1717

0 commit comments

Comments
 (0)