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. .. raw:: html
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: .. confval:: filter rib_in_pre(Log, Route, RouteContext) -> Verdict Argument Types -------------- .. confval:: Log The output value that will be sent to a configured output, such as ``mqtt-out``. .. confval:: Route (read-only) The Route that is flowing through this filter. It can be inspected, and will be sent out unmodified. .. confval:: RouteContext (read-only) Contextual data about the session. Return Value ------------ .. confval:: Verdict The resulting value of this filter, a of value ``accept`` or ``reject``. Upon updates to the ROV status of a stored prefix, the function ``rib_in_rov_status_update`` is called. This happens when new RTR updates (responses to Serial Queries, not the initial Cache Reset synchronisation) come in. Note that this is a ``function``, not a ``filter``: there is no return type for Rotonda to act upon afterwards. .. _roto_rov_status_update: .. confval:: function rib_in_rov_status_update(rov_update: RovStatusUpdate) .. confval:: rov_update Describes the previous and current :roto:ref:`RovStatus` (Valid/Invalid/NotFound) for a stored route. See :roto:ref:`RovStatusUpdate` for the available roto methods. Configuration Options --------------------- The ``rib`` component can be defined in the Rotonda configuration file, like this: .. code-block:: text [units.