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

bgpd, tests: don't send local nexthop from rr client #17073

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

louis-6wind
Copy link
Contributor

Depends on #17071 merge

AS 65000  | AS 65001
          |
      RR  |
       |  |
R1 --- | --- R2
          |

When r1 peer is an iBGP route reflector client of rr and r2 peer is a
eBGP neighbor of rr, and all three routers shares the same network, r2
receives announcements coming from r1 with a IPv6 link-local nexthop
from rr. This is incorrect as r2 should send traffic to r1 without
involving rr.

Do not send an IPv6 link-local nexthop if the originating peer is a
route-reflector client.

Link: #16219 (comment)
Link: #17037 (comment)

@frrbot frrbot bot added bgp bugfix tests Topotests, make check, etc labels Oct 11, 2024
@louis-6wind louis-6wind marked this pull request as draft October 11, 2024 13:04
@leonshaw
Copy link
Contributor

Should LL nexthop be included if peer R2 has next-hop-self configured on RR?

In subgroup_announce_check(), the variable reflect is misleading, as it
suggests a relation to route reflection. However, it actually refers to
the scenario where an iBGP peer announces a route to another iBGP peer.

Rename reflect to ibgp_to_ibgp.

Signed-off-by: Louis Scalbert <[email protected]>
AS 65000  | AS 65001
          |
      RR  |
       |  |
R1 --- | --- R2
          |

When r1 peer is an iBGP route reflector client of rr and r2 peer is a
eBGP neighbor of rr, and all three routers shares the same network, r2
receives announcements coming from r1 with a IPv6 link-local nexthop
from rr. This is incorrect as r2 should send traffic to r1 without
involving rr.

Do not send an IPv6 link-local nexthop if the originating peer is a
route-reflector client.

Link: FRRouting#16219 (comment)
Link: FRRouting#17037 (comment)
Signed-off-by: Louis Scalbert <[email protected]>
@louis-6wind louis-6wind force-pushed the fix-ipv6-ll-nexthop-reflector branch from d494470 to c4a8263 Compare October 14, 2024 08:20
@github-actions github-actions bot added size/L and removed size/XXL labels Oct 14, 2024
@louis-6wind louis-6wind marked this pull request as ready for review October 14, 2024 08:20
@louis-6wind
Copy link
Contributor Author

Should LL nexthop be included if peer R2 has next-hop-self configured on RR?

Link-Local nexthop is not mandatory. As soon as the next-hop-self option sets the global nexthop correctly, the route-reflector will be the nexthop as expected.

The next-hop-self case is not taken into account even in the other situations (route-server...). If it matters for you, feel free to create a pull request with the appropriate topotests

@leonshaw
Copy link
Contributor

leonshaw commented Oct 14, 2024

Thanks for the clarification.
In above case the routers happens to share the same network, so the next-hop is unchanged. But if RR-R1 and RR-R2 are different networks, since R2 is an eBGP peer of RR, RR will implicitly change the next-hop to itself when advertising to R2. Is it better to append a link-local next-hop for this case?
IMO the key point is not whether the route is received from RR client, but whether the next-hop is self. (except for nexthop-local unchanged)

@louis-6wind
Copy link
Contributor Author

Thanks for the clarification. In above case the routers happens to share the same network, so the next-hop is unchanged.

That is correct.

But if RR-R1 and RR-R2 are different networks, since R2 is an eBGP peer of RR, RR will implicitly change the next-hop to itself when advertising to R2. Is it better to append a link-local next-hop for this case?

It would better to append a link-local nexthop for sure. But technically, I cannot know in subgroup_announce_check() whether the originating (from peer) and the destination peer are in same network. So I have no other options than not sending any IPv6 link-local nexthop in the route-reflector case.

Indeed, in subgroup_announce_check(), peer references one of the peer of the BGP subgroup. And a BGP subgroup can include peers of different subnets. For the option nexthop-local unchanged, peers from different subnets are no more included in the same BGP subgroup since #17071. But we don't want to split subgroup by network subnets in the other cases to not impact the performance.

Conclusion: since the IPv6 Link-local nexthop is optional, we never include for prefix originating from a route-reflector client unless
nexthop-local unchanged is set on the destination peer.

IMO the key point is not whether the route is received from RR client, but whether the next-hop is self. (except for nexthop-local unchanged)

Again, this issue is out of scope of this pull-request.

@leonshaw
Copy link
Contributor

And a BGP subgroup can include peers of different subnets.

I think this reveals a more fundamental problem: in current implementation, a subgroup can't guarantee the number of next-hops is the same for all peers. (As an example, we've recently hit this when enabling IPv6-unicast AF between IPv4 peers. Due to some timing issue, some link-local address has not been processed when peer is establishing. Resulting in some peers have valid nexthop.v6_local while some don't - in the same subgroup.)

Again, this issue is out of scope of this pull-request.

I agree this PR is not intended to solve them all, but I don't think it's a good approach to fix for specific cases here and there. I also don't see a strong connection between RR client and link-local next-hop (it's almost the same if R1 is an eBGP peer of RR, provided the three share the same network).

Maybe could postpone the decision of LL next-hop till concrete peer processing? Or just disable LL next-hop whenever we are not confident enough.

@louis-6wind
Copy link
Contributor Author

And a BGP subgroup can include peers of different subnets.

I think this reveals a more fundamental problem: in current implementation, a subgroup can't guarantee the number of next-hops is the same for all peers. (As an example, we've recently hit this when enabling IPv6-unicast AF between IPv4 peers. Due to some timing issue, some link-local address has not been processed when peer is establishing. Resulting in some peers have valid nexthop.v6_local while some don't - in the same subgroup.)

Please open an issue with more details.

I have seen an issue with global but not with link-local so far. I have a fix for that ed7710f

May be a similar issue with link-local ?

Again, this issue is out of scope of this pull-request.

I agree this PR is not intended to solve them all, but I don't think it's a good approach to fix for specific cases here and there. I also don't see a strong connection between RR client and link-local next-hop (it's almost the same if R1 is an eBGP peer of RR, provided the three share the same network).

Maybe could postpone the decision of LL next-hop till concrete peer processing? Or just disable LL next-hop whenever we are not confident enough.

We will see with the issue

@leonshaw
Copy link
Contributor

May be a similar issue with link-local ?

Yes, it's similar. Link-local next-hop is not updated in bgp_interface_address_add().

We will see with the issue

I will open an issue later.

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@riw777 riw777 merged commit 5b57569 into FRRouting:master Oct 15, 2024
11 checks passed
@leonshaw
Copy link
Contributor

Hi, I opened a discussion #17128 (for general link-local next-hop handling). Please have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants