-
Notifications
You must be signed in to change notification settings - Fork 241
_ebgpv4Rib and _bgpv4Rib of BgpRoutingProcess process two equal-cost EBGP routes differently when multipathIbgp enabled but multipathEbgp disabled #8990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi Dan, the tl;dr is we don’t support mixing multipath and non-multipath modes, so this is an unsupported use case. I’m sure that Ari can say more.
From: dan wang ***@***.***>
Reply-To: batfish/batfish ***@***.***>
Date: Sunday, April 14, 2024 at 3:33 AM
To: batfish/batfish ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [batfish/batfish] _ebgpv4Rib and _bgpv4Rib of BgpRoutingProcess process two equal-cost EBGP routes differently when multipathIbgp enabled but multipathEbgp disabled (Issue #8990)
Hi, I notice a possible bug of Batfish. That is, when a BgpProcess is multipathIbgp enabled but multipathEbgp disabled (implying multipath enabled, since multipath = multipathIbgp || multipathEbgp<https://github.com/batfish/batfish/blob/ab258be3c5d31649d9d2ffa9761bd06963339d42/projects/batfish/src/main/java/org/batfish/dataplane/ibdp/BgpRoutingProcess.java#L440>), given two equal-cost EBGP routes LEARNED<https://github.com/batfish/batfish/blob/ab258be3c5d31649d9d2ffa9761bd06963339d42/projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/OriginMechanism.java#L11> from neighbors, the corresponding BgpRoutingProcess's _ebgpv4Rib will insert only one of them into its RibTree since it is multipath disabled, while its _bgpv4Rib will insert both of the routes into its RibTree since it is multipath enabled.
You can use the following code to find the inconsistency:
// set up
NetworkFactory nf = new NetworkFactory();
Configuration c =
nf.configurationBuilder()
.setConfigurationFormat(ConfigurationFormat.CISCO_IOS)
.setHostname("c1")
.build();
Vrf vrf = nf.vrfBuilder().setOwner(c).setName(DEFAULT_VRF_NAME).build();
BgpProcess bgpProcess = BgpProcess.testBgpProcess(Ip.ZERO);
bgpProcess.setMultipathIbgp(true);
bgpProcess.setMultipathEbgp(false);
vrf.setBgpProcess(bgpProcess);
Rib mainRib = new Rib();
mainRib.mergeRouteGetDelta(
new AnnotatedRoute<>(
StaticRoute.testBuilder().setNetwork(Prefix.parse("70.0.0.0/24")).build(),
DEFAULT_VRF_NAME));
mainRib.mergeRouteGetDelta(
new AnnotatedRoute<>(
StaticRoute.testBuilder().setNetwork(Prefix.parse("60.0.0.0/24")).build(),
DEFAULT_VRF_NAME));
BgpRoutingProcess routingProcess =
new BgpRoutingProcess(
bgpProcess, c, DEFAULT_VRF_NAME, mainRib, BgpTopology.EMPTY, new PrefixTracer());
// init two equal-cost EBGP routes learned from neighbors
Prefix pfx = Prefix.parse("10.0.1.0/24");
Bgpv4Route r1 =
Bgpv4Route.testBuilder()
.setNetwork(pfx)
.setNextHopIp(Ip.parse("70.0.0.1"))
.setOriginMechanism(OriginMechanism.LEARNED)
.setReceivedFrom(ReceivedFromIp.of(Ip.parse("70.0.0.1")))
.build();
Bgpv4Route r2 =
Bgpv4Route.testBuilder()
.setNetwork(pfx)
.setNextHopIp(Ip.parse("60.0.0.1"))
.setOriginMechanism(OriginMechanism.LEARNED)
.setReceivedFrom(ReceivedFromIp.of(Ip.parse("60.0.0.1")))
.build();
// insert r1 into _bgpv4Rib and _ebgpv4Rib, the test will success
routingProcess._bgpv4Rib.mergeRouteGetDelta(r1);
routingProcess._ebgpv4Rib.mergeRouteGetDelta(r1);
assertEquals(routingProcess._bgpv4Rib.getRoutes(pfx), routingProcess._ebgpv4Rib.getRoutes(pfx));
// insert r2 into _bgpv4Rib and _ebgpv4Rib, the test will fail
routingProcess._bgpv4Rib.mergeRouteGetDelta(r2);
routingProcess._ebgpv4Rib.mergeRouteGetDelta(r2);
assertEquals(routingProcess._bgpv4Rib.getRoutes(pfx), routingProcess._ebgpv4Rib.getRoutes(pfx));
—
Reply to this email directly, view it on GitHub<#8990>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAEAQT4KJXSWPTUO2JW7FLDY5JLMJAVCNFSM6AAAAABGGDLXUGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2DEMBYHA3TOMQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I notice a possible bug of Batfish. That is, when a
BgpProcess
ismultipathIbgp
enabled butmultipathEbgp
disabled (implyingmultipath
enabled, sincemultipath = multipathIbgp || multipathEbgp
), given two equal-cost EBGP routesLEARNED
from neighbors, the correspondingBgpRoutingProcess
's_ebgpv4Rib
will insert only one of them into itsRibTree
since it is multipath disabled, while its_bgpv4Rib
will insert both of the routes into itsRibTree
since it is multipath enabled.You can use the following code to find the inconsistency:
The text was updated successfully, but these errors were encountered: