RIBs
This unit is a general purpose prefix store but is primarily intended to map prefixes to the details of the routes to those prefixes and the source from which they were received.
It offers a HTTP API for querying the set of known routes to a longest match to a given IP prefix address and length.
The key of the RIB is the tuple (Prefix, ingress_id)
. This means that new
values for this key will override existing values in the RIB.
Upstream announcements cause routes to be added to the store. Upstream
withdrawals cause routes to be flagged as withdrawn in the store. Routes and
their withdrawals are stored per unique value of the field ingress_id
in
the RouteContext
object.
Pipeline Interaction
The rib
component ingests messages from type Route
, that maybe
accompanied by an object of type RouteContext
. It is first filtered,
and then may be stored in the RIB. Finally, it gets sent out if it was not
filtered out.
HTTP/API │ ▲ │ │ ┌──────────▼─┴─┐ (Prefix,Route,RouteContext) ───▶ filter──▶RIB ├──▶ (Prefix,Route,RouteContext) └──────────────┘
Filtering
The RIB
component has a programmable Roto filter built-in with a
hard-coded name rib-in-pre
, and it should be included in the Roto filter
file specified in the Rotonda configuration. The type of this Roto filter is:
- filter rib-in-pre(Log, Route, RouteContext) -> Verdict
Argument Types
- Log
The output value that will be sent to a configured output, such as
mqtt-out
.- Route (read-only)
The Route that is flowing through this filter. It can be inspected, and will be sent out unmodified.
- RouteContext (read-only)
Contextual data about the session.
Return Value
- Verdict
The resulting value of this filter, a of value
accept
orreject
.
Configuration Options
The rib
component can be defined in the Rotonda configuration file,
like this:
[units.<NAME>]
type = "rib"
..
where <NAME>
is the name of the component, to be referenced in the value
of the sources
field in a receiving component.
- rib_type (mandatory)
The type of this RIB. Can be either
physical
, orvirtual
.
- sources (mandatory)
An [“array”, “of”, “upstream”, “unit”, “names”] from which data will be received.
- http_api_path
The relative URL prefix for HTTP REST API calls responded to by this instance of this unit.
Default:
/prefixes/
- query_limits.more_specifics.shortest_prefix_ipv4
Default:
8
- query_limits.more_specifics.shortest_prefix_ipv6 (def: 19)
These two settings protect against overly broad queries that require more time to lookup longest matching prefixes in the store. Queries for IPv4 prefixes shorter than /8 (e.g. /7), or for IPv6 prefixes shorter than /19 (e.g. /18), will result in a HTTP 400 Bad Request status code.
Default:
8