Skip to content
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

BGP: parse and prefer nexthop carried in MP_REACH_NLRI #397

Open
taspelund opened this issue Oct 22, 2024 · 0 comments
Open

BGP: parse and prefer nexthop carried in MP_REACH_NLRI #397

taspelund opened this issue Oct 22, 2024 · 0 comments
Labels
bgp Border Gateway Protocol

Comments

@taspelund
Copy link
Contributor

taspelund commented Oct 22, 2024

When MP-BGP is negotiated (even just for IPv4 Unicast), NLRI are carried in the MP_REACH_NLRI path attribute.
MP_REACH_NLRI has its own nexthop field (whose semantics are defined per afi/safi) which is separate from the NEXT_HOP path attribute.

When all NLRI carried in an update are contained within an MP_REACH_NLRI attribute, the NEXT_HOP field is optional/discouraged per RFC 4760:

The next hop information carried in the MP_REACH_NLRI path attribute
defines the Network Layer address of the router that SHOULD be used
as the next hop to the destinations listed in the MP_NLRI attribute
in the UPDATE message.
[..]

An UPDATE message that carries no NLRI, other than the one encoded in
the MP_REACH_NLRI attribute, SHOULD NOT carry the NEXT_HOP attribute.
If such a message contains the NEXT_HOP attribute, the BGP speaker
that receives the message SHOULD ignore this attribute.

I've experienced/fixed a similar issue in FRR where NEXT_HOP was implicitly used anytime it was present, even for MP-BGP NLRI that had their own nexthop encoded in the MP_REACH_NLRI attr. In that scenario, a third party BGP speaker was using its Router-ID as the NEXT_HOP for EVPN routes, while the MP_REACH_NLRI nexthop aligned to a different loopback IP. This caused the EVPN routes to be installed via the wrong nexthop.

It's probably unlikely that we'll hit this exact scenario with maghemite, but it would be good to address this proactively.

@taspelund taspelund added the bgp Border Gateway Protocol label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bgp Border Gateway Protocol
Projects
None yet
Development

No branches or pull requests

1 participant