Commit graph

30 commits

Author SHA1 Message Date
JerryXiao 6269f404fc
test median smoothing 2022-12-12 13:46:36 +08:00
Toke Høiland-Jørgensen d9763bd7a0
babel: Add route metric smoothing
The Babel RTT extension employs metric smoothing to dampen route
oscillations in the face of varying RTT values between two peers[0].

This patch implements such dampening in Bird, roughly following the
implementation in babeld (i.e., using the same exponential function
definition). The main difference is that we calculate everything in the
native Bird microsecond time unit (and increase constants accordingly), and
that we split out the smoothed metric calculation in two function variants,
one that has no side effects and one that does.

  [0] https://arxiv.org/pdf/1403.3488.pdf

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2022-12-12 13:46:36 +08:00
Toke Høiland-Jørgensen 94ebf8e00e
babel: Add support for the RTT extension
This adds support to the Babel protocol for the RTT extension specified in
draft-ietf-babel-rtt-extension. While this extension is not yet at the RFC
stage, it is one of the more useful extensions to Babel[0], so it seems
worth having in Bird as well.

The extension adds timestamps to Hello and IHU TLVs and uses these to
compute an RTT to each neighbour. An extra per-neighbour cost is then
computed from the RTT based on a minimum and maximum interval and cost
value specified in the configuration. The primary use case for this is
improving routing in a geographically distributed tunnel-based overlay
network.

The implementation follows the babeld implementation when picking constants
and default configuration values. It also uses the same RTT smoothing
algorithm as babeld, and follows it in adding a new 'tunnel' interface type
which enables RTT by default.

[0] https://alioth-lists.debian.net/pipermail/babel-users/2022-April/003932.html

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2022-12-12 13:46:35 +08:00
Maria Matejka c507fb41bb Babel: Convert the rte-local attributes to extended attributes 2021-10-13 19:09:04 +02:00
Ondrej Zajicek (work) 6d26f85395 Babel: Simplify auth expiration
Just use hello_expiry for that, keep init_expiry for initial
unauthentized neighbors.
2021-06-09 19:31:55 +02:00
Ondrej Zajicek (work) b174cc0abc Babel: Add MAC authentication support - update
Some cleanups and bugfixes to the previous patch, including:

 - Fix rate limiting in index mismatch check

 - Fix missing BABEL_AUTH_INDEX_LEN in auth_tx_overhead computation

 - Fix missing auth_tx_overhead recalculation during reconfiguration

 - Fix pseudoheader construction in babel_auth_sign() (sport vs fport)

 - Fix typecasts for ptrdiffs in log messages

 - Make auth log messages similar to corresponding RIP/OSPF ones

 - Change auth log messages for events that happen during regular
   operation to debug messages

 - Switch meaning of babel_auth_check*() functions for consistency
   with corresponding RIP/OSPF ones

 - Remove requirement for min/max key length, only those required by
   given MAC code are enforced
2021-06-06 16:28:18 +02:00
Toke Høiland-Jørgensen b218a28f61 Babel: Add MAC authentication support
This implements support for MAC authentication in the Babel protocol, as
specified by RFC 8967. The implementation seeks to follow the RFC as close
as possible, with the only deliberate deviation being the addition of
support for all the HMAC algorithms already supported by Bird, as well as
the Blake2b variant of the Blake algorithm.

For description of applicability, assumptions and security properties,
see RFC 8967 sections 1.1 and 1.2.
2021-06-06 16:28:18 +02:00
Maria Matejka ebd5751cde Babel: Seqno requests are properly decoupled from neighbors when the underlying interface disappears
When an interface disappears, all the neighbors are freed as well. Seqno
requests were anyway not decoupled from them, leading to strange
segfaults. This fix adds a proper seqno request list inside neighbors to
make sure that no pointer to neighbor is kept after free.
2021-05-30 13:29:21 +02:00
Maria Matejka fd9f0c0640 Configuration strings are constant.
This is merely a const propagation. There was no problem in there.
2020-04-09 15:37:14 +02:00
Jan Maria Matejka ee7e2ffd26 Protocol: Introducing an enum protocol_class
This supersedes the EAP_* constants.
2018-05-29 12:35:06 +02:00
Ondrej Zajicek (work) 70fab17837 Babel: Add option to randomize router ID
When a Babel node restarts, it loses its sequence number, which can cause
its routes to be rejected by peers until the state is cleared out by other
nodes in the network (which can take on the order of minutes).

There are two ways to fix this: Having stable storage to keep the sequence
number across restarts, or picking a different router ID each time.

This implements the latter, by introducing a new option that will cause
BIRD to randomize a high 32 bits of router ID every time it starts up.
This avoids the problem at the cost of not having stable router IDs in
the network.

Thanks to Toke Hoiland-Jorgensen for the patch.
2018-05-03 16:55:11 +02:00
Ondrej Zajicek (work) 185a0a51f8 Babel: Add source-specific routing support
This patch adds support for source-specific routing to the Babel protocol.
It changes the protocol to support both NET_IP6 and NET_IP6_SADR channels
for IPv6 addresses. If only a NET_IP6 channel is configured,
source-specific updates are ignored. Otherwise, non-source-specific
routes are simply treated as source-specific routes with SADR prefix 0.

Thanks to Toke Hoiland-Jorgensen for the original patch.
Minor changes by Ondrej Santiago Zajicek.
2018-02-13 16:40:14 +01:00
Ondrej Zajicek (work) a6f79ca57f Timers: Revert temporary names and remove old timer.h 2017-12-07 13:54:59 +01:00
Ondrej Zajicek (work) 3b3b0910ff Babel: More changes and bugfixes
Several changes and bugfixes in Babel, namely:

- Exported route parameters stored directly in route table entry
- Exported non-babel routes no longer stored in per-entry route list
- Route update, selection and retraction simplified and fixed
- Route feasibility is evalualated per update and stored with route
- Unreachable route handling fixed, based on hold interval
- Added 'show babel routes' command

Overall, it fixes some issues with proper propagation of triggered
updates, making Babel convergence after topology change almost
instant.
2017-12-07 13:53:42 +01:00
Ondrej Zajicek (work) dbf1ed263c Babel: Fix handling of seqno requests
Old behavior has several deficiencies compared to standard behavior
(no triggered updates for replies, no retransmissions, ...).
2017-12-07 13:53:42 +01:00
Ondrej Zajicek (work) 268dc7c8b3 Babel: Remove babel_proto ptr from babel_entry 2017-12-07 13:53:42 +01:00
Ondrej Zajicek (work) b47eaefe12 Babel: Revamp cost computation and run route selection when cost change
Also fix several minor bugs and add 'limit' option for k-out-of-j
link sensing strategy. Change default from 8-of-16 to 12-of-16.
Change IHU expiry factor from 1.5 to 3.5 (as in RFC 6126).
2017-12-07 13:53:42 +01:00
Ondrej Zajicek (work) 38f4721092 Babel: Avoid batch seqno updates 2017-12-07 13:53:42 +01:00
Ondrej Zajicek (work) 5ee69d11f2 Babel: Fix Hello and IHU expiration 2017-12-07 13:53:42 +01:00
Ondrej Zajicek (work) 8b58f565e4 Babel: Update to new timers 2017-12-07 13:53:42 +01:00
Ondrej Zajicek (work) 145ebfa1df Babel: Parse sub-TLVs and skip TLVs with mandatory sub-TLV
RFC6126bis formally introduces sub-TLVs to the Babel protocol, including
mandatory sub-TLVs. This adds support for parsing sub-TLVs to the Babel
protocol and skips TLVs that contain mandatory sub-TLVs, as per the spec.

For details, see section 4.4 of
https://tools.ietf.org/html/draft-ietf-babel-rfc6126bis-02

Thanks to Toke Høiland-Jørgensen <toke@toke.dk> for the patch.
2017-06-09 14:33:06 +02:00
Ondrej Zajicek (work) 4324025f98 Babel: Add support for dual-stack IPv4/IPv6 operation
This adds support for dual-stack v4/v6 operation to the Babel protocol.
Routing messages will be exchanged over IPv6, but IPv4 routes can be
carried in the messages being exchanged. This matches how the reference
Babel implementation (babeld) works.

The nexthop address for v4 can be configured per interface, and will
default to the first available IPv4 address on the given interface. For
symmetry, a configuration option to configure the IPv6 nexthop address
is also added.

Thanks to Toke Høiland-Jørgensen <toke@toke.dk> for the patch.
2017-06-08 12:18:16 +02:00
Ondrej Zajicek (work) 5e8df049fb Babel: Update to integrated branch 2016-12-10 00:44:13 +01:00
Jan Moskyto Matejka ad88b94bca Merge branch 'int-new-rpki-squashed' (early part) into int-new 2016-12-07 15:30:46 +01:00
Jan Moskyto Matejka af62c0f9f1 LibSSH may be switched off together with RPKI 2016-12-07 14:15:35 +01:00
Jan Moskyto Matejka f7f70bed8f Make: upgrade Babel makefiles 2016-12-07 09:35:24 +01:00
Jan Moskyto Matejka 3e236955c9 Build: switch on -Wextra, get rid of most of the warnings
There are several unresolved -Wmissing-field-initializers on older
versions of GCC than 5.1, all of them false positive.
2016-11-01 14:52:54 +01:00
Ondrej Zajicek (work) 5d6ca22085 Babel: Send wildcard retractions on shutdown and startup
This makes BIRD send a wildcard retraction on all interfaces before
shutting down and right after starting up. This helps ensure that
neighbours will discard the announced routes as soon as possible,
rather than only after the normal timeout procedures.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2016-07-19 14:23:41 +02:00
Ondrej Zajicek (work) 321ff8c404 Babel: Make sure intervals do not overflow
Intervals are carried as 16-bit centisecond values, but kept internally
in 16-bit second values, which causes a potential for overflow. This adds
some checks to make sure this does not happen.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2016-07-19 11:57:20 +02:00
Ondrej Zajicek (work) 937e75d8f1 Add the Babel routing protocol (RFC 6126)
This patch implements the IPv6 subset of the Babel routing protocol.
Based on the patch from Toke Hoiland-Jorgensen, with some heavy
modifications and bugfixes.

Thanks to Toke Hoiland-Jorgensen for the original patch.
2016-04-28 18:01:40 +02:00