pierky / arouteserver

A tool to automatically build (and test) feature-rich configurations for BGP route servers.
https://arouteserver.readthedocs.org/
GNU General Public License v3.0
288 stars 46 forks source link

Add support for graceful shutdown #5

Closed job closed 7 years ago

job commented 7 years ago

Intro

https://tools.ietf.org/html/draft-ietf-grow-bgp-gshut-06 (gshut for short) introduces a well-known BGP community 65535:0 to signal to an adjacent network that the path will disappear due to upcoming maintenance, and as such they should hunt for other paths.

Implementing the receiving side is straight forward:

function allow_graceful_shutdown() {
    if (65535, 0) ~ bgp_community then {
        bgp_local_pref = 0;
    }
}

And then just add the appropriate allow_graceful_shutdown(); calls to the filters. I think this can be enabled by default.

This way route server participants can use the graceful shutdown mechanism to signal to the route server that soon the path through them will be unavailable and the route server should select another path (if there is any).

Implementing the sending side

A graceful shutdown of the route server itself would look as following:

  1. attach the 65535:0 BGP community to all route announcements towards all clients
  2. wait a number of minutes to allow time for a) bird to load the config, and b) re-announce all routes to all participants with the added community, and c) allow the clients to reconverge. (say, 10 minutes)
  3. actually shut down the bird daemons

Perhaps a wrapper script would easiest to do the three steps described above.

pierky commented 7 years ago

Both receiving and sending sides have been implemented. @job could you take a look?