]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: Implement LLGR helper mode
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Mon, 20 Dec 2021 21:03:09 +0000 (23:03 +0200)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 28 Dec 2021 14:07:59 +0000 (16:07 +0200)
commit1479ed2fb35f4a5ae1017201a7ee37ba2727163a
tree694707211977d33fc37cb2a7ac2b3a0d1d2b4325
parent5086cc1c6639180fbc34da7e534a09dff6d8669a
bgpd: Implement LLGR helper mode

Tested between GoBGP and FRR (this commit).

```
┌───────────┐             ┌────────────┐
│           │             │            │
│ GoBGPD    │             │ FRRouting  │
│ (restart) │             │            │
│           │             │            │
└──────┬────┘             └───────┬────┘
       │                          │
       │                          │
       │                          │
       │     ┌───────────┐        │
       │     │           │        │
       │     │           │        │
       └─────┤ FRRouting ├────────┘
             │ (helper)  │
             │           │
             └───────────┘

// GoBGPD
% cat /etc/gobgp/config.toml
[global.config]
    as = 65002
    router-id = "2.2.2.2"
    port = 179

[[neighbors]]
    [neighbors.config]
        peer-as = 65001
        neighbor-address = "2a02:abc::123"
    [neighbors.graceful-restart.config]
        enabled = true
        restart-time = 3
        long-lived-enabled = true
    [[neighbors.afi-safis]]
        [neighbors.afi-safis.config]
            afi-safi-name = "ipv6-unicast"
        [neighbors.afi-safis.mp-graceful-restart.config]
            enabled = true
        [neighbors.afi-safis.long-lived-graceful-restart.config]
            enabled = true
            restart-time = 10
    [[neighbors.afi-safis]]
        [neighbors.afi-safis.config]
            afi-safi-name = "ipv4-unicast"
        [neighbors.afi-safis.mp-graceful-restart.config]
            enabled = true
        [neighbors.afi-safis.long-lived-graceful-restart.config]
            enabled = true
            restart-time = 20

% ./gobgp global rib add -a ipv6 2001:db8:4::/64
% ./gobgp global rib add -a ipv6 2001:db8:5::/64 community 65535:7
% ./gobgp global rib add -a ipv4 100.100.100.100/32
% ./gobgp global rib add -a ipv4 100.100.100.200/32 community 65535:7
```

1. When killing GoBGPD, graceful restart timer starts in FRR helper router;
2. When GR timer expires in helper router:
   a) LLGR_STALE community is attached to routes to be retained;
   b) Clear stale routes that have NO_LLGR community attached;
   c) Start LLGR timer per AFI/SAFI;
   d) Recompute bestpath and reannounce routes to peers;
   d) When LLGR timer expires, clear all routes on particular AFI/SAFI.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
bgpd/bgp_fsm.c
bgpd/bgp_open.c
bgpd/bgp_packet.c
bgpd/bgp_route.c
bgpd/bgp_route.h
bgpd/bgpd.c
bgpd/bgpd.h