0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-18 17:18:42 +00:00
The BIRD project aims to develop a fully functional dynamic IP routing daemon. https://bird.network.cz
Go to file
Maria Matejka 080cbd1219 Route refresh in tables uses a stale counter.
Until now, we were marking routes as REF_STALE and REF_DISCARD to
cleanup old routes after route refresh. This needed a synchronous route
table walk at both beginning and the end of route refresh routine,
marking the routes by the flags.

We avoid these walks by using a stale counter. Every route contains:
  u8 stale_cycle;
Every import hook contains:
  u8 stale_set;
  u8 stale_valid;
  u8 stale_pruned;
  u8 stale_pruning;

In base_state, stale_set == stale_valid == stale_pruned == stale_pruning
and all routes' stale_cycle also have the same value.

The route refresh looks like follows:
+ ----------- + --------- + ----------- + ------------- + ------------ +
|             | stale_set | stale_valid | stale_pruning | stale_pruned |
| Base        |     x     |      x      |        x      |       x      |
| Begin       |    x+1    |      x      |        x      |       x      |
  ... now routes are being inserted with stale_cycle == (x+1)
| End         |    x+1    |     x+1     |        x      |       x      |
  ... now table pruning routine is scheduled
| Prune begin |    x+1    |     x+1     |       x+1     |       x      |
  ... now routes with stale_cycle not between stale_set and stale_valid
      are deleted
| Prune end   |    x+1    |     x+1     |       x+1     |      x+1     |
+ ----------- + --------- + ----------- + ------------- + ------------ +

The pruning routine is asynchronous and may have high latency in
high-load environments. Therefore, multiple route refresh requests may
happen before the pruning routine starts, leading to this situation:

| Prune begin |    x+k    |     x+k     |    x -> x+k   |       x      |
  ... or even
| Prune begin |   x+k+1   |     x+k     |    x -> x+k   |       x      |
  ... if the prune event starts while another route refresh is running.

In such a case, the pruning routine still deletes routes not fitting
between stale_set and and stale_valid, effectively pruning the remnants
of all unpruned route refreshes from before:

| Prune end   |    x+k    |     x+k     |       x+k     |      x+k     |

In extremely rare cases, there may happen too many route refreshes
before any route prune routine finishes. If the difference between
stale_valid and stale_pruned becomes more than 128 when requesting for
another route refresh, the routine walks the table synchronously and
resets all the stale values to a base state, while logging a warning.
2022-07-12 12:22:41 +02:00
client Client: Use exit status to report errors 2022-03-11 03:52:50 +01:00
conf Fixed forgotten preference handling in filters 2022-06-26 14:31:31 +02:00
distro Pkg: Improve RPM package unit file 2022-03-11 15:47:00 +01:00
doc Allowed optimized exporting of a subprefix tree 2022-06-24 15:49:08 +02:00
filter Fixed displaying BGP and RIP attributes after recent reworks 2022-06-27 12:32:47 +02:00
lib Route refresh in tables uses a stale counter. 2022-07-12 12:22:41 +02:00
misc NEWS and version update 2022-02-09 03:47:49 +01:00
nest Route refresh in tables uses a stale counter. 2022-07-12 12:22:41 +02:00
proto Route refresh in tables uses a stale counter. 2022-07-12 12:22:41 +02:00
sysdep Dropped the internal kernel protocol table for learnt routes. 2022-07-11 17:04:52 +02:00
test Explicit definition structures of route attributes 2022-05-04 15:39:19 +02:00
tools Small improvement in directory test 2022-03-02 10:52:09 +01:00
.dir-locals.el BIRD coding conventions 2019-06-12 16:37:12 +02:00
.gitignore add apkg-powered upstream packaging for deb, rpm 2021-05-19 17:22:11 +02:00
.gitlab-ci.yml CI: Remove broken FreeBSD builds 2022-05-27 16:07:50 +02:00
aclocal.m4 Enforcing certain data structure explicit paddings. 2022-05-04 15:37:41 +02:00
bird-gdb.py Removed forgotten remnants of unused enum rtc 2022-05-04 15:39:21 +02:00
bird.conf KRT: Fix IPv6 route learn 2018-02-06 16:08:45 +01:00
configure.ac Enforcing certain data structure explicit paddings. 2022-05-04 15:37:41 +02:00
INSTALL Doc: Detect SP/OpenSP automatically 2019-02-19 18:20:07 +01:00
Makefile.in Protocols have their own explicit init routines 2022-04-06 18:14:08 +02:00
NEWS NEWS: Fix formatting and add some notes 2022-02-13 16:45:49 +01:00
README Doc: README and INSTALL update 2019-01-03 17:26:52 +01:00

                       BIRD Internet Routing Daemon

                     Home page  http://bird.network.cz/
                  Mailing list  bird-users@network.cz

                (c) 1998--2008  Martin Mares <mj@ucw.cz>
                (c) 1998--2000  Pavel Machek <pavel@ucw.cz>
                (c) 1998--2008  Ondrej Filip <feela@network.cz>
                (c) 2009--2019  CZ.NIC z.s.p.o.

================================================================================

The BIRD project aims to develop a dynamic IP routing daemon with full support
of all modern routing protocols, easy to use configuration interface and
powerful route filtering language, primarily targeted on (but not limited to)
Linux and other UNIX-like systems and distributed under the GNU General
Public License.

What do we support
==================

	o  Both IPv4 and IPv6
	o  Multiple routing tables
	o  Border Gateway Protocol (BGPv4)
	o  Routing Information Protocol (RIPv2, RIPng)
	o  Open Shortest Path First protocol (OSPFv2, OSPFv3)
	o  Babel Routing Protocol (Babel)
	o  Bidirectional Forwarding Detection (BFD)
	o  IPv6 router advertisements
	o  Static routes
	o  Inter-table protocol
	o  Command-line interface allowing on-line control and inspection of
	   status of the daemon
	o  Soft reconfiguration, no need to use complex online commands to
	   change the configuration, just edit the configuration file and notify
	   BIRD to re-read it and it will smoothly switch itself to the new
	   configuration, not disturbing routing protocols unless they are
	   affected by the configuration changes
	o  Powerful language for route filtering, see doc/bird.conf.example
	o  Linux, FreeBSD, NetBSD and OpenBSD ports

How to install BIRD
===================

	o  From standard distribution package of your OS (recommended)
	o  From official binary packages for Debian and Red Hat Linux
	   ftp://bird.network.cz/pub/bird/debian/
	   ftp://bird.network.cz/pub/bird/redhat/
	o  From source code of the latest stable release version
	   ftp://bird.network.cz/pub/bird/
	o  From current development code in Git repository
	   https://gitlab.labs.nic.cz/labs/bird/

See the file INSTALL for information about installation from source code.

Documentation
=============

Online documentation is available at http://bird.network.cz/?get_doc or as HTML
files in the doc directory, you can install it by `make install-docs' and
rebuild it by `make docs', but you'll need SGMLtools and LaTeX to be installed
on your machine. You can also download a neatly formatted PDF version as
a separate archive (bird-doc-*.tar.gz) from ftp://bird.network.cz/pub/bird/

User support
============

If you want to help us debugging, enhancing and porting BIRD or just lurk
around to see what's going to develop, feel free to subscribe to the BIRD
users mailing list bird-users@network.cz, just send `subscribe' to
bird-request@network.cz. Bug reports, suggestions, feature requests and
code are welcome! We don't use gitlab issues for reporting, sorry.

Subscribe:	http://bird.network.cz/mailman/listinfo/bird-users/
Archive:	http://bird.network.cz/pipermail/bird-users/

Licence
=======

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

History
=======

BIRD development started as a student project at the Faculty of Math
and Physics, Charles University, Prague, Czech Republic under supervision
of RNDr. Libor Forst <forst@cuni.cz>. BIRD has been developed and supported
by CZ.NIC z.s.p.o. http://www.nic.cz/ since 2009.


Good Luck and enjoy the BIRD :)
						The BIRD Team