Skip to content

Commit

Permalink
bgp_nhg_zapi_scalability: add route update avoidance with nhg
Browse files Browse the repository at this point in the history
When using bgp nexthop groups, it is possible to avoid route
updates, and this test ensures that the number of zapi route
messages from BGP to ZEBRA can be reduced, for instance when
a failover happens.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Mar 5, 2024
1 parent 2404364 commit 9c19460
Show file tree
Hide file tree
Showing 26 changed files with 1,423 additions and 18 deletions.
19 changes: 1 addition & 18 deletions tests/topotests/bgp_nhg_topo1/test_bgp_nhg_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@
# Import topogen and topotest helpers
from lib import topotest
from lib.common_config import step
from lib.nexthopgroup import (
route_get_nhg_id,
verify_nexthop_group,
verify_route_nexthop_group,
)
from lib.nexthopgroup import route_check_nhg_id_is_protocol
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger

Expand Down Expand Up @@ -297,19 +293,6 @@ def iproute2_check_path_selection(
return topotest.json_cmp(output, expected)


def route_check_nhg_id_is_protocol(ipaddr_str, rname, vrf_name=None, protocol="bgp"):
tgen = get_topogen()
nhg_id = route_get_nhg_id(ipaddr_str, rname, vrf_name=vrf_name)
output = tgen.gears["r1"].vtysh_cmd(
"show nexthop-group rib %d" % nhg_id,
)
assert f"ID: {nhg_id} ({protocol})" in output, (
"NHG %d not found in 'show nexthop-group rib ID json" % nhg_id
)

return nhg_id


def test_bgp_ipv4_route_presence():
"""
Assert that the 192.0.2.9/32 prefix is present in unicast and vpn RIB
Expand Down
Empty file.
19 changes: 19 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r1/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
debug bgp nexthop-group
debug bgp zebra
debug bgp nexthop
debug bgp nht
bgp suppress-fib-pending
router bgp 64500
bgp router-id 192.0.2.1
no bgp ebgp-requires-policy
neighbor rrserver peer-group
neighbor rrserver remote-as 64500
neighbor rrserver update-source lo
neighbor rrserver timers connect 2
neighbor 192.0.2.3 peer-group rrserver
neighbor 192.0.2.3 bfd
address-family ipv4 unicast
neighbor rrserver next-hop-self
neighbor rrserver activate
exit-address-family
!
26 changes: 26 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r1/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
hostname r1
interface lo
ip router isis 1
isis passive
!
interface r1-eth1
ip router isis 1
isis network point-to-point
!
interface r1-eth2
ip router isis 1
isis network point-to-point
!
interface r1-eth4
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0001.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.1/32 index 1
!
26 changes: 26 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r1/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
log stdout
!debug zebra packet recv
!debug zebra nexthop detail
interface lo
ip address 192.0.2.1/32
!
interface r1-eth0
ip address 172.31.10.1/24
!
interface r1-eth1
ip address 172.31.0.1/24
mpls enable
!
interface r1-eth2
ip address 172.31.2.1/24
mpls enable
!
interface r1-eth3
ip address 172.31.11.1/24
mpls enable
!
interface r1-eth4
ip address 172.31.8.1/24
mpls enable
!

14 changes: 14 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r3/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
router bgp 64500
bgp router-id 192.0.2.3
neighbor rr peer-group
neighbor rr remote-as 64500
neighbor rr update-source lo
neighbor rr bfd check-control-plane-failure
bgp listen range 192.0.2.0/24 peer-group rr
!
address-family ipv4 unicast
neighbor rr activate
neighbor rr route-reflector-client
neighbor rr addpath-tx-all-paths
exit-address-family
!
38 changes: 38 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r3/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
hostname r3
interface lo
ip router isis 1
isis passive
!
interface r3-eth0
ip router isis 1
isis network point-to-point
!
interface r3-eth1
ip router isis 1
isis network point-to-point
!
interface r3-eth2
ip router isis 1
isis network point-to-point
!
interface r3-eth3
ip router isis 1
isis network point-to-point
!
interface r3-eth4
ip router isis 1
isis network point-to-point
!
interface r3-eth5
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0003.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.3/32 index 3
!
16 changes: 16 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r3/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
log stdout
interface lo
ip address 192.0.2.3/32
!
interface r3-eth0
ip address 172.31.0.3/24
mpls enable
!
interface r3-eth1
ip address 172.31.4.3/24
mpls enable
!
interface r3-eth2
ip address 172.31.5.3/24
mpls enable
!
30 changes: 30 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r4/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
hostname r4
interface lo
ip router isis 1
isis passive
!
interface r4-eth0
ip router isis 1
isis network point-to-point
!
interface r4-eth1
ip router isis 1
isis network point-to-point
!
interface r4-eth2
ip router isis 1
isis network point-to-point
!
interface r4-eth3
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0004.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.4/32 index 4
!
20 changes: 20 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r4/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
log stdout
interface lo
ip address 192.0.2.4/32
!
interface r4-eth0
ip address 172.31.2.4/24
mpls enable
!
interface r4-eth1
ip address 172.31.6.4/24
mpls enable
!
interface r4-eth2
ip address 172.31.7.4/24
mpls enable
!
interface r4-eth3
mpls enable
!

17 changes: 17 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r5/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
router bgp 64500
bgp router-id 192.0.2.5
no bgp ebgp-requires-policy
no bgp network import-check
neighbor rrserver peer-group
neighbor rrserver remote-as 64500
neighbor rrserver update-source lo
neighbor rrserver bfd
neighbor rrserver timers connect 2
neighbor 192.0.2.3 peer-group rrserver
address-family ipv4 unicast
network 192.0.2.9/32
neighbor rrserver activate
neighbor rrserver next-hop-self
redistribute sharp
exit-address-family
!
26 changes: 26 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r5/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
hostname r5
interface lo
ip router isis 1
isis passive
!
interface r5-eth1
ip router isis 1
isis network point-to-point
!
interface r5-eth2
ip router isis 1
isis network point-to-point
!
interface r5-eth3
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0005.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.5/32 index 55
!
21 changes: 21 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r5/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
log stdout
debug zebra packet recv
!debug zebra rib detail
mpls label dynamic-block 5000 5999
interface lo
ip address 192.0.2.5/32
!
interface r5-eth0
ip address 172.31.12.5/24
!
interface r5-eth1
ip address 172.31.4.5/24
mpls enable
!
interface r5-eth2
ip address 172.31.7.5/24
mpls enable
!
interface r5-eth3
ip address 172.31.21.5/24
!
16 changes: 16 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r6/bgpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
router bgp 64500
bgp router-id 192.0.2.6
no bgp ebgp-requires-policy
no bgp network import-check
neighbor rrserver peer-group
neighbor rrserver remote-as 64500
neighbor rrserver update-source lo
neighbor rrserver bfd
neighbor 192.0.2.3 peer-group rrserver
address-family ipv4 unicast
network 192.0.2.9/32
neighbor rrserver activate
neighbor rrserver next-hop-self
redistribute sharp
exit-address-family
!
22 changes: 22 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r6/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
hostname r6
interface lo
ip router isis 1
isis passive
!
interface r6-eth1
ip router isis 1
isis network point-to-point
!
interface r6-eth2
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0006.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.6/32 index 6
!
1 change: 1 addition & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r6/sharpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sharp install routes 193.0.0.1 nexthop 192.0.2.6 2000
20 changes: 20 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r6/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
log stdout
mpls label dynamic-block 6000 6999
interface lo
ip address 192.0.2.6/32
!
interface r6-eth0
ip address 172.31.13.6/24
!
interface r6-eth1
ip address 172.31.5.6/24
mpls enable
!
interface r6-eth2
ip address 172.31.6.6/24
mpls enable
!
interface r6-eth3
ip address 172.31.22.6/24
!

22 changes: 22 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r7/isisd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
hostname r7
interface lo
ip router isis 1
isis passive
!
interface r7-eth0
ip router isis 1
isis network point-to-point
!
interface r7-eth1
ip router isis 1
isis network point-to-point
!
router isis 1
net 49.0123.6452.0007.00
is-type level-2-only
mpls-te on
segment-routing on
segment-routing global-block 16000 17000
segment-routing node-msd 10
segment-routing prefix 192.0.2.7/32 index 7
!
14 changes: 14 additions & 0 deletions tests/topotests/bgp_nhg_zapi_scalability/r7/zebra.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
log stdout
interface lo
ip address 192.0.2.7/32
!
interface r7-eth0
ip address 172.31.8.7/24
mpls enable
! shutdown
!
interface r7-eth1
ip address 172.31.9.7/24
mpls enable
!

Loading

0 comments on commit 9c19460

Please sign in to comment.