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: Derive and set MED from IGP or AIGP #17038

Merged

Conversation

ton31337
Copy link
Member

@ton31337 ton31337 commented Oct 8, 2024

Related: #17031

@frrbot frrbot bot added bgp documentation tests Topotests, make check, etc labels Oct 8, 2024
@ton31337 ton31337 force-pushed the feature/bgp_set_metric_internal branch from 5f34a79 to 07d48af Compare October 8, 2024 19:16
@Mark225
Copy link

Mark225 commented Oct 9, 2024

Thank you so much for noticing my request. @ton31337

I have installed and tested this branch with new feature. And, I found a bug about this new added feature. The list of test steps are shown as followed.

  1. Built the below topology.

image

  1. Configured the relationships between node.
    n2, n3, n4 --> ISIS, IBGP
    n1-n2 --> EBGP
    n1-n3 --> EBGP
    n4-n5 --> EBGP
    n1 --> AS 1
    n2, n3, n4 --> AS 2
    n5 --> AS 5

  2. Set the isis metric between n3 and n4 to 100, while kept the isis metric between n2 and n4 to 10.

  3. Set MED from IGP in node n2 and n3, the configuration in n2 is as below.

image
image

  1. Here, it can be observed that node n1 selects node n2 as next hop to destination 33.0.0.5. It meet the requirements defined in RFC 4451. (33.0.0.5 is the loopback address of n5)
    image

  2. At this moment, I changed the isis metric between n2 and n4 to 200. However, node n1 still selected node n2 as next hop to destination 33.0.0.5. I think that the change of IGP metric should provoke the change of BGP MED and node n1 should reselect the next hop. But, this didn't seem to be effective.

If possible, could you help solve this problem?

@ton31337
Copy link
Member Author

ton31337 commented Oct 9, 2024

Could you give the full configs, then I'd test it out?

@Mark225
Copy link

Mark225 commented Oct 9, 2024

Could you give the full configs, then I'd test it out?

Please refer to the followed content. Thank you~

n1's configuration:

!
frr version 10.2-dev
frr defaults datacenter
hostname n1
service integrated-vtysh-config
!
interface eth0
 ip address 10.0.0.1/24
exit
!
interface eth1
 ip address 10.0.1.1/24
exit
!
interface lo
 ip address 33.0.0.1/32
exit
!
router bgp 1
 bgp router-id 10.0.0.1
 neighbor 10.0.0.2 remote-as 2
 neighbor 10.0.1.2 remote-as 2
 !
 address-family ipv4 unicast
  network 33.0.0.1/32
 exit-address-family
exit
!
end

n2's configuration:

!
frr version 10.2-dev
frr defaults datacenter
hostname n2
service integrated-vtysh-config
!
ip prefix-list test seq 5 permit any
!
interface eth0
 ip address 10.0.0.2/24
 ip router isis n2
 isis circuit-type level-2-only
 isis fast-reroute lfa level-2
 isis network point-to-point
exit
!
interface eth1
 ip address 10.0.2.1/24
 ip router isis n2
 isis circuit-type level-2-only
 isis fast-reroute lfa level-2
 isis network point-to-point
exit
!
router bgp 2
 bgp router-id 10.0.0.2
 neighbor 10.0.0.1 remote-as 1
 neighbor 10.0.2.2 remote-as 2
 !
 address-family ipv4 unicast
  redistribute connected
  neighbor 10.0.0.1 route-map test out
 exit-address-family
exit
!
router isis n2
 is-type level-2-only
 net 49.0001.0000.0000.0002.00
 lsp-mtu 1440
exit
!
route-map test permit 10
 match ip address prefix-list test
 set metric igp
exit
!
end

n3's configuration:

!
frr version 10.2-dev
frr defaults datacenter
hostname n3
service integrated-vtysh-config
!
ip prefix-list test seq 5 permit any
!
interface eth0
 ip address 10.0.1.2/24
 ip router isis n3
 isis circuit-type level-2-only
 isis fast-reroute lfa level-2
 isis network point-to-point
exit
!
interface eth1
 ip address 10.0.3.1/24
 ip router isis n3
 isis circuit-type level-2-only
 isis fast-reroute lfa level-2
 isis metric level-1 10
 isis metric level-2 100
 isis network point-to-point
exit
!
router bgp 2
 neighbor 10.0.1.1 remote-as 1
 neighbor 10.0.3.2 remote-as 2
 !
 address-family ipv4 unicast
  neighbor 10.0.1.1 route-map test out
 exit-address-family
exit
!
router isis n3
 is-type level-2-only
 net 49.0001.0000.0000.0003.00
 lsp-mtu 1440
exit
!
route-map test permit 10
 match ip address prefix-list test
 set metric igp
exit
!
end

n4's configuration:

!
frr version 10.2-dev
frr defaults datacenter
hostname n4
service integrated-vtysh-config
!
interface eth0
 ip address 10.0.2.2/24
 ip router isis n4
 isis circuit-type level-2-only
 isis fast-reroute lfa level-2
 isis network point-to-point
exit
!
interface eth1
 ip address 10.0.3.2/24
 ip router isis n4
 isis circuit-type level-2-only
 isis fast-reroute lfa level-2
 isis metric level-1 10
 isis metric level-2 100
 isis network point-to-point
exit
!
interface eth2
 ip address 10.0.4.1/24
 ip router isis n4
 isis circuit-type level-2-only
 isis fast-reroute lfa level-2
 isis network point-to-point
exit
!
router bgp 2
 neighbor 10.0.2.1 remote-as 2
 neighbor 10.0.3.1 remote-as 2
 neighbor 10.0.4.2 remote-as 5
exit
!
router isis n4
 is-type level-2-only
 net 49.0001.0000.0000.0004.00
 lsp-mtu 1440
exit
!
end

n5's configuration:

!
frr version 10.2-dev
frr defaults datacenter
hostname n5
service integrated-vtysh-config
!
interface eth0
 ip address 10.0.4.2/24
exit
!
interface lo
 ip address 33.0.0.5/32
exit
!
router bgp 5
 bgp router-id 10.0.4.2
 neighbor 10.0.4.1 remote-as 2
 !
 address-family ipv4 unicast
  network 33.0.0.5/32
 exit-address-family
exit
!
end

@github-actions github-actions bot added size/XL and removed size/L labels Oct 9, 2024
@ton31337
Copy link
Member Author

ton31337 commented Oct 9, 2024

Tested with your topology and configs, looks good now.

@ton31337 ton31337 requested a review from riw777 October 10, 2024 13:59
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@ton31337 ton31337 force-pushed the feature/bgp_set_metric_internal branch from 101ca1b to 10f9b9a Compare October 15, 2024 14:32
Set metric automatically from the path info (IGP protocol).

Signed-off-by: Donatas Abraitis <[email protected]>
@ton31337 ton31337 force-pushed the feature/bgp_set_metric_internal branch 2 times, most recently from 5f73d2d to 24e23fc Compare October 15, 2024 14:40
Same as `set metric igp`, but in this case accumulated IGP metric is being
sent as MED attribute.

Signed-off-by: Donatas Abraitis <[email protected]>
Signed-off-by: Donatas Abraitis <[email protected]>
If the underlay IGP metric changes, we SHOULD re-announce the routes with the
correct bpi->extra->igpmetric set.

Without this patch if the IGP link cost (metric) changes, we never notice this
and the peers do not have the updated metrics, which in turn causes incorrect
best path selections on remote peers.

Signed-off-by: Donatas Abraitis <[email protected]>
@ton31337 ton31337 force-pushed the feature/bgp_set_metric_internal branch from 24e23fc to a593f15 Compare October 15, 2024 14:43
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 de02471 into FRRouting:master Oct 15, 2024
11 checks passed
@ton31337 ton31337 deleted the feature/bgp_set_metric_internal branch October 16, 2024 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants