MPLS Forwarding Engine Design in Linux ======================================== -Pranjal Kumar Dutta Here are a few notes that I have scribbled when I started designing the forwarding engine components for MPLS Ingress LSR, Transit or Core LSR and Egress LSR. Don't assume that this document is "everything that includes all". I would utter the usual GPL developer quote "read the source code". These notes are written in 2002 and after that Linux kernel has gone through lots of changes till 2.6.15.6. Thse notes are mostly platform independent design, that is not dependent on any Linux features. Linux User Space +----------+ +------------+ +----------+ | RSVP-TE |LSP_ADD/LSP_DEL | zMPLS | LSP_ADD/DEL |LDP/CR-LDP| | |--------------->| |<-------------| | +----------+ +------------+ +----------+ -----------------------------------|------------------------------------ Linux Kernel Space | |MPLS Forwarding Services APIs +----------------+ | | | NETLINK_MPLS | | | +----------------+ | | MPLS Forwarding Functional APIs | +---------------------------------------------------+-------------------------+ | | | | | | | | mpls_fec.c mpls_ilm.c mpls_nhlfe.c mpls_input.c mpls_output.c mpls_forward.c | mpls_lsp.c MicroACE Blocks Currently I am working on improving the MPLS forwarding for linux2.6.15.6 kernel. The MPLS Fowarding Engine in Linux Kernel is comprised of following three main modules. 1. MPLS Forwarding Services APIs ============================== This module is extension of Linux NETLINK. This is the common interface for LDP/CR-LDP and RSVP-TE. It provides the message based interface for MPLS Forwarding Components. The scope of this API is restricted to LSPs associated with Ethernet (Generic), ATM, FR and POS (Generic interfaces). 2. MPLS Forwarding Functional APIs ==================================== This component provides the set of APIs for configuring individual MPLS forwarding components. NETLINK module talks to each forwarding engine component through these set of APIs.Each forwarding engine module exports its own API(s) to this set. 3. MPLS Forwarding Engine Components ==================================== The MPLS forwarding Engine is divided into following subcomponents. 3.1 MPLS FEC mpls_fec.c ===================== This module is the LER component and classifies the data being forwarded into FECs. This module provides L2/L3 FEC (policy based as wll as non-policy based.) For L3 there are two FEC Tables. 1) Best Effort LSPs (Programmed by LDP component of the control plane). 2) TE-LSPs ( Programmed by RSVP Component of the control plane). I am yet to sort out how to deal with LSPs installed by CR-LDP. Design Considerations : 3.1.1. FTN Entries are organized in a system specific FEC table. An FTN Entry is uniquely identified based on FEC Parameters. A FTN Entry can be IPV4/IPV4 Prefix, IPV4/IPV6 Host L2FEC (PWID Element) etc. The FEC Table is populated by Control Plane. The FEC Table points to FEC Type specific sub-Tables. So each sub-table will have FTN entry of a specific type. 3.1.2. FTN Entries can be stored in traditional linux IP/L2 forwarders. For example, for L3 LSP, the fib_entry can have pointer to FTN Entry. The same entry can be populated to the ip flow caches in wheh a flow fast path is programmed. 3.2 MPLS ILM mpls_ilm.c ==================== This module maintains abstractions for ILM. Design Considerations : 3.2.1 ILM Entries are maintained in a system wide table (Not interface specific). 3.2.2 An ILM entry is uniquely identified based on incoming label and incoming interface identifier. 3.2.3 3.3 MPLS NHLFE Module mpls_nhlfe.c ============================== This module maintains abstractions for NHLFE. Design Considerations: 3.3.1 NHLFE are kept in a system wide table. 3.3.2.An NHLFE Entry is uniquely identfied based on outgoing interface identifier, a next hop IP address and outgoing label Stack. The outgoing label will be the top label in the label stack information associated with the NHLFE. 3.3.3 An NHLFE/NHLFE Set can be created first in the NHLFE/NHLFE Set Table database. The creation will result in a unique NHLFE/NHLFRE Set Handle. The NHLFE handle value will be passed along with the LSP creation as part of the NHLFE Set information. 3.3.4 An NHLFE/NHLFE Set is created along with the LSP, when the LSP is created in kernel. An NHLFE Set will be created even if i is just one NHLFE. 3.3.5 An NHLFE/NHLFE Set can be shared by multiple LSPs, if the system can support label merging. This will arise when a label space MAY be partitioned into multiple non-overlapping signaling protocol partitions. 3.4 MPLS LSP Table/Database ============================ This module maintains the LSP database. Design considerations: This module contains the LSPs programmed by NETLINK into the Kernel. 3.4.1 For an LSP there can be multiple NHLFEs.For example, P2MP LSP or PWs. A policy may be defined to select between the NHLFEs. The policy information and the associated NHLFEs are contained within a NHLFE set. 3.5 MPLS Input Module mpls_input.c ============================== 3.6 MPLS output module mpls_output.c =================================