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: Do not keep stale paths in Adj-RIB-Out if not addpath aware #18275

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ton31337
Copy link
Member

@ton31337 ton31337 commented Feb 27, 2025

munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 5, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.100                10      0 65100 65444 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i

Announce one more 10.0.0.0/24 via 65200 and we have TWO paths 10.0.0.0/24 in adj-rib-out:

munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 6, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.100                10      0 65100 65444 65444 i
 *> 10.0.0.0/24      192.168.137.201                10      0 65200 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i

Stop announcing 10.0.0.0/24 via 65200 and we still have TWO paths for 10.0.0.0/24...

munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 7, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.100                10      0 65100 65444 65444 i
 *> 10.0.0.0/24      192.168.137.201                10      0 65200 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i

Why do we need to keep old paths in adj-rib-out if we don't have e.g. AddPaths enabled?

Shouldn't it be like here? (only one 10.0.0.0/24 in adj-rib-out for this update-group instead of multiple (stale from previous announcements))

munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 6, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.201                10      0 65200 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i

Closes #18222

@frrbot frrbot bot added the bgp label Feb 27, 2025
@ton31337 ton31337 force-pushed the fix/issue_18222_no_topotest branch from 7a83efa to 9bf2ba2 Compare February 27, 2025 18:53
```
munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 5, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.100                10      0 65100 65444 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i
```

Announce one more 10.0.0.0/24 via 65200 and we have TWO paths 10.0.0.0/24 in adj-rib-out:

```
munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 6, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.100                10      0 65100 65444 65444 i
 *> 10.0.0.0/24      192.168.137.201                10      0 65200 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i
```

Stop announcing 10.0.0.0/24 via 65200 and we still have TWO paths for 10.0.0.0/24...

```
munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 7, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.100                10      0 65100 65444 65444 i
 *> 10.0.0.0/24      192.168.137.201                10      0 65200 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i
```

Why do we need to keep old paths in adj-rib-out if we don't have e.g. AddPaths enabled?

Shouldn't it be like here? (only one 10.0.0.0/24 in adj-rib-out for this update-group instead of multiple (stale from previous announcements))

```
munet> r1 shi vtysh -c 'show ip bgp update advertised-routes'
update group 1, subgroup 1
BGP table version is 6, local router ID is 192.168.137.1
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Origin codes:  i - IGP, e - EGP, ? - incomplete
     Network          Next Hop            Metric LocPrf Weight Path
 *> 1.0.0.0/24       192.168.137.201                10      0 65200 65444 i
 *> 10.0.0.0/24      192.168.137.201                10      0 65200 65444 i
 *> 10.65.10.0/24    192.168.137.100          0     10      0 65100 i
 *> 10.200.2.0/24    192.168.137.202          0     10      0 65200 i
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
There was a case where removing the selected (single best) route leads to
adj-rib-out to be vanished at all.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
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 ... waiting on Donatas to clear do not merge label

@pguibert6WIND
Copy link
Member

do you have a topotest for that ?

… RS setup

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
@frrbot frrbot bot added the tests Topotests, make check, etc label Mar 7, 2025
@github-actions github-actions bot added size/L rebase PR needs rebase and removed size/S labels Mar 7, 2025
@ton31337
Copy link
Member Author

ton31337 commented Mar 7, 2025

Added a topotest.

@IvayloJ
Copy link

IvayloJ commented Mar 8, 2025

@ton31337 Very sorry for the delay ! Please check my last post in #18222.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bgp do not merge master rebase PR needs rebase size/L tests Topotests, make check, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BGP probably a bug with multipath + addpath capability + bestpath calculation + route server scenario
4 participants