Skip to content
Thomas Mangin edited this page Aug 16, 2026 · 6 revisions

Pre-Alpha. This page describes behavior that may change.

Cross-protocol RIB selector. Takes per-protocol best-path selections and picks the winner by admin distance, then hands the result to the FIB programmer.

Category

Infrastructure.

Configuration

plugin {
    internal sysrib { use sysrib }
}

Not bound to peers. sysrib sits between bgp-rib and fib-kernel in the FIB pipeline and subscribes to per-protocol selection events from the bus.

Behaviour

For each prefix, sysrib collects the best path from every source protocol and picks the one with the lowest admin distance. Ze only has BGP as a source today, so admin distance is not particularly interesting in practice.

Admin distances match the values every other routing daemon uses.

Protocol Admin distance
Static 10
eBGP 20
iBGP 200

After admin-distance selection, sysrib runs two additional phases before publishing.

Recursive next-hop resolution. Next-hops that are not directly connected are resolved by walking the unified Loc-RIB by longest-prefix-match, up to a maximum depth of 8 levels, accumulating the IGP metric along the chain. The resolver tracks the dependents of each next-hop so that when a covering route changes (reachability or metric) every dependent prefix is re-evaluated by cascade. The accumulated metric feeds best-path step 7.

ECMP grouping. Protocol routes for a prefix that share the winner's effective priority and metric are collected into one nexthop group rather than emitting separate single-path events. A group holds up to 128 members. FIB backends receive one event per prefix carrying the full set of paths.

The plugin then publishes selection change events for fib-kernel, fib-vpp, or fib-p4 to install into the actual forwarding table.

Forwarding action

A route carries a forwarding action beside its next-hop: unicast, blackhole, unreachable, or prohibit. The protocol RIB sets it, sysrib copies it onto the winning route, and it rides out on every emitted change, a replay included, so the FIB backend programs a discard rather than a next-hop.

The action takes no part in selection. Admin distance, priority and metric decide the winner exactly as before, so a route never wins for being a discard. It IS part of the change test: a prefix that becomes a discard with its next-hop, metric and labels unchanged is still emitted, because the FIB must hear about it.

An unset action means the producer stated nothing, and the backend installs an ordinary unicast route. Today the only producer is the BGP RIB honoring the RFC 7999 BLACKHOLE community for a peer that is configured and authorized for it.

Commands

Command Output
show rib Cross-protocol selected routes: prefix, family, next-hop, protocol, priority, route-type, and ecmp-paths.
show nexthop-table Resolver tracking table: per next-hop next-hop, resolved, direct-nh, igp-metric, and dependents.
show ecmp-groups Active groups: prefix, family, and a paths array of next-hop / weight / labels.

All return JSON.

route-type names the forwarding action by name (blackhole, unreachable, prohibit), not as the Linux RTN_ number the wire contract carries. The key is OMITTED for an ordinary route, so finding the discards in a table is a search for the key rather than a read of every value.

Metrics

Registered via ConfigureMetrics.

Metric Type Meaning
ze_systemrib_routes_best gauge Current system-wide best-route count.
ze_systemrib_route_changes_total{action} counter Best-path changes emitted, labelled by action.
ze_systemrib_events_received_total counter Protocol RIB events received.

See plugin metrics.

Interactions

  • Consumes best-path change events from bgp-rib.
  • Publishes selection events for fib-kernel or fib-p4.

Source

main/internal/component/sysrib/, with the forwarding-action vocabulary in main/internal/core/rib/routetype/.

Home

About

First Steps

Configuration

Operation

Interfaces

Plugins

Plugin Development

Chaos Testing

Blueprints

Development

Reference

Clone this wiki locally