Guide

MPLS

Ze can act as a Linux MPLS label-switching router (LSR). BGP labeled-unicast routes (RFC 8277) received from peers are programmed into the kernel MPLS FIB as label-push entries, so Ze forwards labeled traffic without VPP.

Enabling MPLS

MPLS label processing is per-interface. Enable it on each interface that should accept labeled packets:

interface {
    ethernet eth0 {
        unit 0 {
            mpls {
                enable true
            }
        }
    }
}

This sets net.mpls.conf.eth0.input=1. The global label-table size is the net.mpls.platform_labels sysctl. It defaults to 0, which disables MPLS entirely, so ze writes the full 20-bit space (1048575) once, immediately before it programs its first label. An operator value set in the sysctl {} block is never overwritten: only a table reading exactly 0 is repaired.

The Linux kernel must supply MPLS forwarding, either through the mpls_router and mpls_iptunnel modules or built in with CONFIG_MPLS_ROUTING and CONFIG_MPLS_IPTUNNEL. ze's own appliance kernel builds both in, so it loads no module. MPLS is an enrolled kernel capability: ze probes for the AF_MPLS table rather than for the module list, because a built-in kernel lists no module.

When the configuration asks the kernel FIB to forward MPLS and /proc/sys/net/mpls/platform_labels does not exist, ze doctor reports doctor-mpls-unavailable at error severity, ze refuses to start, and ze config validate fails. There is no operator override. A daemon that advertises label forwarding it cannot perform blackholes the traffic it attracted.

A probe ze could not read is a different answer. It reports doctor-mpls-unknown at warning severity and ze starts, because refusing on a question ze could not ask would stop a router whose kernel is fine.

RSVP-TE transit routes can carry the LSP's path MTU only on a kernel with CONFIG_MPLS_IP_MTU, which ze's appliance kernel adds. On a stock kernel ze still installs every transit swap and pop, without the MTU, so the LSP comes up and forwards, but an oversized labeled packet is dropped rather than fragmented or answered with ICMP (Linux limitation LL-MPLS-FORWARD-NO-PMTU, docs/architecture/linux-limitations.md). The daemon logs this once, and ze doctor reports doctor-mpls-transit-mtu-unenforced at warning severity; neither refuses a start. Details: docs/architecture/mpls/mpls-kernel.md, "On a kernel without the patch".

A VPP or P4 FIB backend is never judged on the kernel's AF_MPLS table. The requirement belongs to fib-kernel, the plugin that programs kernel labels. LDP and RSVP-TE load it under interface { backend netlink; } with no fib { } block, and a fib { kernel { } } block loads it too.

On interface { backend vpp; }, fib-vpp programs the same LDP and RSVP-TE swap and pop entries into VPP's MPLS table 0, and mpls { enable true; } enables MPLS input on the VPP interface instead of only writing the sysctl. show mpls fib in vppctl lists each label twice, as eos and neos. VPP has no per-route MTU, so labeled frames are bounded by the interface MTU, and an RSVP-TE facility-backup push into a private table is refused. The details are in VPP, row vpp-3.

Inspecting the forwarding table

ze show mpls forwarding              # all installed MPLS entries
ze show mpls forwarding limit 500    # cap the response size

Each row reports the incoming label (in-label), the operation (swap or pop), any outgoing out-labels, the next-hop, and the egress device. The data is read directly from the kernel AF_MPLS routing table.

Metrics

  • ze_fibkernel_mpls_routes_installed -- current MPLS labeled-route count.
  • ze_fibkernel_mpls_installs_total -- MPLS routes successfully programmed.

Label distribution

Two label-distribution protocols are available (both experimental):

  • LDP (RFC 5036) for IGP-shortest-path label distribution.
  • RSVP-TE (RFC 3209) for traffic-engineered explicit-path LSPs with bandwidth reservation -- see RSVP-TE.

LDP configuration

ldp {
    lsr-id 10.0.0.1
    transport-address 10.0.0.1
    interfaces eth0
    interfaces eth1
}
  • lsr-id -- this router's LSR identifier (IPv4 address format).
  • transport-address -- address advertised for the LDP TCP session.
  • interfaces -- a list entry per interface on which LDP Hello discovery runs (repeat the leaf for each interface).
  • hello-interval / hello-hold-time / keepalive-time -- optional soft-state timers (defaults 5s / 15s / 60s).
  • hop-count-max -- the largest Hop Count TLV value a Label Mapping can carry (default 254). A mapping above it is answered with a Loop Detected Notification and not used (RFC 5036 section 3.4.4.1).

keepalive-time is the KeepAlive Time ze proposes in the Initialization message of each new session (RFC 5036 section 3.5.3). The two LSRs keep the lower of the two proposals. Ze then sends a KeepAlive every third of the negotiated value, and when no PDU arrives inside the negotiated value itself (RFC 5036 section 3.5.3) it sends the peer a Notification carrying KeepAlive Timer Expired, then closes the session. The proposal is exchanged one time, when the session starts, so a change to this leaf applies to the sessions that open after it and leaves an established session on the value it negotiated.

RFC 5036 section 3.5.3 makes the KeepAlive Time a non-zero integer, so ze refuses a peer that proposes 0. It answers the Session Rejected/Bad KeepAlive Time Notification of section 3.9, logs ldp: initialization rejected, peer proposed a KeepAlive Time of 0, and closes the connection. A peer proposing a protocol version other than 1 is refused the same way, with the Bad Protocol Version Notification.

During initialization, OPENSENT accepts only an Initialization message and OPENREC accepts only a KeepAlive. Any other message, including a Notification, triggers a Shutdown Notification and ends the transport session before its body is applied. The Initialization PDU's LSR ID and label-space ID must also match the Hello adjacency that opened the session; a mismatch receives Session Rejected/No Hello.

With the LDP log at info (environment { log { ldp info } }), ze logs ldp: session operational with the peer address when a session reaches OPERATIONAL, and ldp: session ended with the peer and the cause when a session ends on an error, so the log shows when each session came up and went down.

Inspect LDP state with show ldp neighbor (session state, transport address) and show ldp binding (FEC-to-label bindings). A label binding learned from a neighbor programs an ingress push entry toward that neighbor, in the kernel MPLS FIB under interface { backend netlink; } and in VPP under backend vpp. show mpls forwarding reads the data plane the backend selects: under backend vpp it lists the labels in VPP MPLS table 0 and VPP's labeled IP routes, in the same row format as the kernel table. When VPP does not answer, the command fails and names ze doctor. It does not answer an empty table.