Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
0.5.0
Released 2024-11-20.
This release features a lot of changes, big and small. The list below is not
exhaustive but tries to highlight and describe the bigger (and perhaps, more
important) ones.
Breaking changes
Several common basic types (e.g.
Asn
andPrefix
) are moved out ofroutecore to the new inetnum crate.
Refactor of PathAttributes
The introduction of
PaMap
andRouteWorkshop
(see below) required refactoringof the
PathAttributes
enum and related types. Most significantly, an entirelayer in the enum was removed, changing how one matches on variants.
Furthermore some of the types in those variants slightly changed.
Overhaul of address family related code
The types describing address families, and related traits to parse and compose
NLRI of such families, have severely changed. This eliminates any possible
ambiguity regarding the address family of announcements/withdrawals in UPDATE
messages at compile time.
in the
AfiSafiType
enum. As a SAFI by itself does not carry much meaning,the separate
SAFI
enum is removed. Almost all of the code now worksbased on the more descriptive
AfiSafiType
.AfiSafiType
includes~AddPath
variants for every single AFI+SAFIcombination.
over the
AfiSafiType
.But, as a possible downside, this moves the task of determining what
address family a set of NLRI holds to the caller in order to then use the
correctly typed iterator. The less efficient, 'easier to use' iterators
returning an enum instead of a distinct NLRI type are therefore still
available.
New
RouteWorkshop / PaMap
This release introduces the
RouteWorkshop
to create UPDATE messages based onan NLRI and a set of attributes. For creation, inspection and manipulation of
those attributes, the
PaMap
is introduced. These new types work inconjunction with the existing
UpdateBuilder
.Another new, related type is the
OwnedPathAttributes
, which is sort of a mixbetween the
PathAttributes
andPaMap
, keeping the actual wireformatattributes blob in tact (using a
Vec<u8>
). This makes it more memoryefficient than the
PaMap
, at a small cost in forms of compute.BGP FSM (absorbed from rotonda-fsm)
routecore now contains the code to enable for actual BGP sessions, i.e. the
BGP FSM and related machinery. By pulling this in into routecore allows for
less dependency juggling, easier development iterations and more sensible code
in all parts. All of this has some rough edges and is prone to changes on the
near future.
The rotonda-fsm crate for now is left as-is.
Route Selection fundamentals
This release introduces a first attempt at providing handles to perform the
BGP Decision Process as described in RFC4271, colloquially known as 'route
selection' or 'best path selection'.
Most of the heavy-lifting for this comes from implementing
Ord
on a wrapperstruct holding a 'route' (i.e.,
PaMap
) and additional information to allowtie-breaking as described in the RFC.
As the tie-breaking in RFC4271 is actually broken and not totally ordered, we
aim to provide a certain degree of flexibility in the tie-breaking process by
means of different
OrdStrat
ordering strategies.Limited MRT read support
Support for reading and parsing MRT files, such as those published by RIPE
RIS, is added behind the
mrt
feature flag. Both the 'dump' and the 'updates'files are supported, though not all exotic message types might be recognized,
and the API will likely change.
Other changes
Feature flags
After splitting of parts of routecore into the inetnum crate, the default
features set resulted in an almost empty library. Therefore the
bgp
flag isnow on by default, and we introduced an
fsm
flag to enable the BGP FSM codeabsorbed from rotonda-fsm.
Known limitations
Constructed UPDATE messages are MultiProtocol-only
With regards to announcing and withdrawing NLRI, the
UpdateBuilder
is currentlylimited to putting everything in the MultiProtocol path attributes
(MP_REACH_NLRI, MP_UNREACH_NLRI), so even for IPv4 Unicast.
Note that this behaviour is considered preferable as it leads to somewhat more
flexibility/resilience on the protocol level. But in case one of the peers
does not signal the capability of doing IPv4 Unicast in MultiProtocol
attributes, we should allow creation of PDUs in the traditional form anyway,
so we plan to reintroduce this functionality.