Add exceed merge path on limit

Saklak, Marcin msaklak at akamai.com
Thu Mar 13 13:34:21 CET 2025


Hello Maria,

Some hardware platforms require specifying a maximum number of next-hops (NH) in the ECMP group due to resource limitations, while other platforms don’t care about that.

By default, bird limit merge path to 16 NH. We increased this limit to 32, and it has been sufficient for a while. However, we’re now approaching 64 NH or potentially more.

While the current limit is acceptable, a router in the fabric with 64 downlink interfaces (64 NH) plus additional uplink interfaces could encounter a scenario where it receives a north-south route (64+X NH). In such cases, Bird skips excess NHs based on its internal sorting mechanism, unpredictably dropping either uplink or downlink NHs. Although this scenario could result from either misconfiguration or intentional configuration, it remains a realistic situation.

Ideally would be to have on/off for this log if someone is ok with less NH in the kernel than it is in the bird

Thanks,
Marcin

From: Maria Matejka <maria.matejka at nic.cz>
Date: Friday, March 7, 2025 at 3:26 PM
To: Saklak, Marcin <msaklak at akamai.com>, Saklak, Marcin via Bird-users <bird-users at network.cz>, bird-users at network.cz <bird-users at network.cz>
Subject: Re: Add exceed merge path on limit
Hello Marcin, this looks interesting, would you please elaborate on the intended usecase? Is that something like "the hardware goes crazy with too many next hops"? I'm wondering whether this is a direct intended use, or some crazy workaround
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd
Hello Marcin,

this looks interesting, would you please elaborate on the intended usecase? Is that something like "the hardware goes crazy with too many next hops"?

I'm wondering whether this is a direct intended use, or some crazy workaround which could be done completely differently if BIRD had the right tooling for your use case.

Thanks,
Maria

On March 7, 2025 2:53:37 PM GMT+01:00, "Saklak, Marcin via Bird-users" <bird-users at network.cz> wrote:
Hi All,
I’m wondering if it’s possible to add a log entry whenever the merged path limit is exceeded.
For example, a route can have 64 next hops, but BIRD export to the kernel up to merge limit and skip rest of next hops.
I’d like to be able to detect when this happens.

Below is a potential solution for that:

---
nest/rt-attr.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index c8ef8e08..ef118cb0 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -323,6 +323,8 @@ nexthop_merge(struct nexthop *x, struct nexthop *y, int rx, int ry, int max, lin
     n = &((*n)->next);
   }
   *n = NULL;
+  if (max == -1)
+    log(L_ERR "Exceeded merge paths on limit!");

   return root;
}
--
2.34.1

If you have any suggestions or a better approach, please let me know!

Best regards,
Marcin Sakłak
--
Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20250313/3f805b11/attachment.htm>


More information about the Bird-users mailing list