]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgp_fsm.h
bgpd: bgpd-mrai.patch
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 20 May 2015 00:40:37 +0000 (17:40 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 20 May 2015 00:40:37 +0000 (17:40 -0700)
commitcb1faec92248549307ffcfd93b24713d339cb8b0
tree19de8a141c81b89a9f1714a856d2d4585470367d
parentcdabb8b69196648046264f4fa76b77b66ae134a6
bgpd: bgpd-mrai.patch

BGP: Event-driven route announcement taking into account min route advertisement interval

ISSUE

BGP starts the routeadv timer (peer->t_routeadv) to expire in 1 sec
when a peer is established. From then on, the timer expires
periodically based on the configured MRAI value (default: 30sec for
EBGP, 5sec for IBGP).  At the expiry, the write thread is triggered
that takes the routes from peer's sync FIFO (adj-rib-out) and sends
UPDATEs. This has a few drawbacks:

(1) Delay in new route announcement: Even when the last UPDATE message
    was sent a while back, the next route change will necessarily have
    to wait for routeadv expiry
(2) CPU usage: The timer is always armed. If the operator chooses to
    configure a lower value of MRAI (zero second is a preferred choice
    in many deployments) for better convergence, it leads to high CPU
    usage for BGP process, even at the times of no network churn.

PATCH

Make the route advertisement event-driven - When routes are added to
peer's sync FIFO, check if the routeadv timer needs to be adjusted (or
started). Conversely, do not arm the routeadv timer unconditionally.

The patch also addresses route announcements during read-only mode
(update-delay).  During read-only mode operation, the routeadv timer
is not started. When BGP comes out of read-only mode and all the
routes are processed, the timer is started for all peers with zero
expiry, so that the UPDATEs can be sent all at once. This leads to
(near-)optimal UPDATE packing.

Finally, the patch makes the "max # packets to write to peer socket at
a time" configurable. Currently it is hard-coded to 10. The command is
at the top router-bgp mode and is called "write-quanta <number>". It
is a useful convergence parameter to tweak.

Signed-off-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
bgpd/bgp_advertise.c
bgpd/bgp_fsm.c
bgpd/bgp_fsm.h
bgpd/bgp_packet.c
bgpd/bgp_route.c
bgpd/bgp_route.h
bgpd/bgp_vty.c
bgpd/bgp_vty.h
bgpd/bgpd.c
bgpd/bgpd.h