Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

Operational State

Overview

flock@r70:~$ flockc rib --af ipv4
{"total":15,"total_v4":12,"total_v6":3}

flock@r70:~$ flockc rib --af ipv6
{"total":15,"total_v4":12,"total_v6":3}

In all RIB commands IPv6 is the default address family

flock@r70:~$ flockc rib
{"total":15,"total_v4":12,"total_v6":3}

Longest Prefix Match (LPM) for destination

  • fib_ip_nhs are the resolved next hops taken from the 'best' protocol

      flock@r70:~$ flockc rib -v default --af ipv4 -l 70.0.70.1
      {"prefix":"70.0.70.0/24","route":{"fib_ip_nhs":[{"ConnectedNh":{"intf_id":125675, ...,"table_id":{"afi":"ipv4-unicast","vrf_id":254}}}], ...,"protos":[{"admin_dist":0, ...,"origin":"Connected", ...,"ip_nhs":[{"ConnectedNh":{...}}], ...}]}}
    

Single RIB prefix entry

flock@r70:~$ flockc rib -v default --af ipv4 -p 70.0.0.0/8 -j
{
  "protos": [
    {
      "admin_dist": 1,
      "origin": {
        "Static": "Conf"
      },
      ...
      "ip_nhs": [
        {
          "SpecialNh": {
            "table_id": {
              "vrf_id": 254,
              "afi": "ipv4-unicast"
            },
            "special_nh_type": "Discard",
            ...
          }
        }
      ],
      ...
    }
  ],
  "fib_ip_nhs": [
    {
      "SpecialNh": {
        ...
        "special_nh_type": "Discard",
        ...
      }
    }
  ],
  ...
}

All prefix entries in the RIB

  • Only the 'best' origin protocol is shown.

      flock@r70:~$ flockc rib -v default --af ipv4 -p
      [["50.0.0.0/8",{"protos":[{"admin_dist":20,"origin":"Bgp", ...,"ip_nhs":[{"RecursiveNh":{ ...,"ip_addr":"90.0.93.61", ...}}], ...}],"fib_ip_nhs":[{"AttachedNh":{ ...,"ip_addr":"90.0.93.61", ...}}], ...}],["70.0.0.0/8",{"protos":[{"admin_dist":1,"origin":{"Static":"Conf"}, ...}], ...}],["70.0.70.0/24",{"protos":[{"admin_dist":0,"origin":"Connected", ...}], ...}], ...]
    

RIB Operation

Help

flockc rib -h

RIB Overview

flockc rib --af [ipv4 | ipv6 ]

RIB Prefixes

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

Connected routes

flockc rib -v <vrf-name> --af [ ipv4 | ipv6 ] -c

Prefixes by route origin.

Origin can be bgp, connected, dhcpv4, dhcpv6, ipv6ra, ipsecctrl, ipsecike, kernel, ospfv2, ospfv3, or static.

flockc rib -v <vrf-name> --af [ipv4 | ipv6 ] -p -o ospfv2

Longest Prefix Match (LPM)

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

Label RIB (LRIB)

The Label RIB manages MPLS label bindings programmed by protocols such as BGP and OSPF Segment Routing.

LRIB Overview

flockc lrib

LRIB label lookup

flockc lrib -l [<label>]