Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@matperin
Copy link
Owner

@matperin matperin commented Dec 4, 2025

No description provided.

@matperin matperin force-pushed the unnumbered-bgp-auto-dicovery branch 4 times, most recently from df02ee0 to da1cc3c Compare December 10, 2025 09:48
The definition and helper functions for a new route-like
object to track peers discovery data has been added.
It only contains the (v4 or v6) remote peer address and the
ingress iface index, for now.

The main intent of this is, currently, to enable BGP
unnumbered auto peer discovery via RAdv incoming
advertisments, but in the future the same data structure
could be used to allow discovery coming from different protocols.

Signed-off-by: Matteo Perin <[email protected]>
Implementation of peer discovery based on incoming Router Advertisments
to the RAdv protocol.

Up until this point no much use has been make of incoming RAs, this commit
tries to amend that by importing peer-based routes to a new peers channel.
This will allow to use the information discovered about remote routers
on other protocols which can export peers on this same channel.

RA staleness has also been taken into consideration and the routes are
withdrawn whenever the advertised router lifetime expires.

The feature is meant to be enabled via a new configuration option in
the RAdv protocol called router discovery [yes/no].

Signed-off-by: Matteo Perin <[email protected]>
… achieve locking requirements

The dynamic BGP postponed socket handling was moved from bgp_init() to bgp_start_locked()
to ensure both domains are properly locked during the rmove() operation.

In bgp_init(), the protocol birdloop does not exist yet, but in bgp_start_locked() it is
possible to safely enter both the socket original birdloop and the protocol birdloop to satisfy
dual-lock requirement and avoid DG_IS_LOCKED failed assertions.

Signed-off-by: Matteo Perin <[email protected]>
@matperin matperin force-pushed the unnumbered-bgp-auto-dicovery branch from da1cc3c to 3fc9fe7 Compare December 10, 2025 09:49
…tic peering

This change proposal is made in order to achieve BGP automatic peering based
on discovered link-local addresses leveraging the IPv6 ND protocol.

A big part of the necessary logic is already present in the dynamic BGP implementation.
The problem is that dynamic BGP works in a passive/reactive model only, as it waits for
peers within a specified range to connect.

This integrates with this implementation by triggering the spawn of a BGP process
sending OPEN requests in order to achieve active peer connection when a valid peer
remote address has been discovered.

The discovery is done by exporting routing information from a table containing
peer data through a newly introduced peers channel. This means that the feature
will only work if there is another protocol actively importing peer data (e.g. RAdv).
The feature is also meant to work only in the presence of a valid dynamic BGP
configuration.

A new configuration paramenter has been added to the BGP protocol, persist [yes/no]
which controls the behavior of sessions shutdown on peer route withdrawal.
If enabled, a BGP connection spawned from peer discovery or dyamic BGP will be left running.
If disabled, the session will be torn down and removed.

Logic to avoid duplicate sessions from both the dynamic BGP and automatic peers
discovery paths has also been introduced.

Signed-off-by: Matteo Perin <[email protected]>
@matperin matperin force-pushed the unnumbered-bgp-auto-dicovery branch from 3fc9fe7 to 99d6a65 Compare December 10, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants