RIB Component

The RIB component receives routes from each routing protocol and stores them in the RIB. For each network prefix the 'best' route is sent to the dataplane for use when forwarding packets. By default, flock uses the Linux kernel as dataplane, but it can be configured to use other dataplanes.

Configuring the RIB component

RIB component configuration is under the top level rib object in /etc/flockd/flockd.json. The default configuration uses the Linux kernel as dataplane, and programs the routes via netlink:

{
    "rib": {
        "dataplane": {
            "netlink": true,
        }
    }
}

If the rib JSON object doesn't exist, or is empty of null, flock falls back the default configuration shown above. These configurations are all equivalent:

{}
{"rib": {}}
{"rib": null}
{"rib": {"dataplane": {}}
{"rib": {"dataplane": null}
{"rib": {"dataplane": {"netlink": true}}}

To use an alternative dataplane via FPM (Forwarding Plan Manager):

{
    "rib": {
        "dataplane": {
            "netlink": false,
            "fpm": {
                "tcp_port": 2620
            }
        }
    }
}

Operational State

Overview

flock@flocknet:~$ flockc rib --af ipv4
{"route_count":2328}
flock@flocknet:~$

flock@flocknet:~$ flockc rib --af ipv6
{"route_count":5340}
flock@flocknet:~$

In all RIB commands IPv6 is the default address family

flock@flocknet:~$ flockc rib
{"route_count":5340}
flock@flocknet:~$

Longest Path Match (LPM) for destination

flock@flocknet:~$ flockc rib --af ipv4 -l 10.0.2.34
{"origin":"Ospfv2","next_hops":[{"intf_id":2,"ip_addr":"10.0.1.49"}]}
flock@flocknet:~$

Single RIB prefix entry

flock@flocknet:~$ flockc --af ipv4 -p 10.0.2.0/24
{"origin":"Ospfv2","next_hops":[{"intf_id":2,"ip_addr":"10.0.1.49"}]}
flock@flocknet:~$

All prefix entries in the RIB

flock@flocknet:~$ flockc --af ipv4 -p
{"ip_net":"0.0.0.0/0","origin":"Kernel","next_hops":[{"intf_id":5,"ip_addr":"192.168.22.1"}]}
{"ip_net":"10.0.1.0/24","origin":"Kernel","next_hops":[{"intf_id":2}]}
{"ip_net":"10.0.2.0/24","origin":"Ospfv2","next_hops":[{"intf_id":2,"ip_addr":"10.0.1.49"}]}
{"ip_net":"10.0.3.0/24","origin":"Kernel","next_hops":[{"intf_id":4}]}
{"ip_net":"10.0.4.0/24","origin":"Kernel","next_hops":[{"intf_id":3}]}
{"ip_net":"42.0.0.0/16","origin":"Kernel","next_hops":[{"intf_id":5,"ip_addr":"192.68.122.1"}]}
{"ip_net":"192.168.122.0/24","origin":"Kernel","next_hops":[{"intf_id":5}]}
flock@flocknet:~$

RIB Operation

Help

flockc rib -h

RIB Overview

flockc rib --af [ipv4 | ipv6 ]

RIB Prefixes

flockc rib --af [ ipv4 | ipv6 ] -p [<ip-network>]

Prefixes by route origin.

Origin can be bgp, kernel, ospfv2 or static.

flockc rib --af [ipv4 | ipv6 ] -p -o ospfv2

Longest Path Match (LPM)

flockc rib --af [ipv4 | ipv6 ] -l <ip-address>