Forwarding and Control Element Separation (ForCES) Logical Function Block (LFB) Library
Extracted elements (29)
Base data type definitions are provided as a separate 'BaseTypeLibrary' XML library file rather than embedded in LFB class definitions, enabling extensive reuse by other LFB class definitions through the <load library='BaseTypeLibrary' location='...'/> statement.
Similar packet processing functions in the base LFB library MUST NOT be simultaneously defined as two different LFBs (e.g., two different LFBs for the same next-hop processing), as redundant definitions add implementation burden and impede interoperability between CEs and FEs.
The library adheres to the weak-host model (RFC 1122) for IP packet processing within the Network Element, as it is considered the most practical model for a packet-processing NE. This contrasts with the strong-host model where packets are only accepted on the interface addressed.
When a function could be represented by either one LFB or two or more LFBs at equal cost, the design choice is to use two or more LFBs to provide greater implementer flexibility. Additionally, LFBs should have minimal coupling with other LFBs to maximize independence.
An LFB is a functionally accurate abstraction of FE processing capabilities, not a hardware-accurate representation. The purpose of LFB definitions is to represent functions for interoperability between separate CEs and FEs; vendors may also define proprietary LFB classes per RFC 5812.
The LFB library currently only defines Ethernet copper media processing (EtherPHYCop). Processing for other physical media types such as Packet over SONET (POS) or ATM, as well as fiber Ethernet media, is explicitly deferred to future versions of this document or separate documents.
Any LFB element defined for counting purposes MUST be specified to monotonically increase until it reaches the maximum value of its unsigned integer type, at which point it wraps around and starts increasing again from zero. How counter discontinuities (due to wrapping or resets) are handled is an implementation issue.
A Logical Function Block (LFB) is a well-defined, logically separable functional block residing in a Forwarding Element (FE), controlled by a Control Element (CE) via the ForCES protocol. It is a functionally accurate abstraction of FE processing capabilities, not a hardware-accurate representation. LFB classes are templates for fine-grained FE processing aspects; multiple instances of the same class may exist in one FE.
BasicMetadataDispatch LFB dispatches packets to group output ports based on a metadata value lookup in a metadata dispatch table (MetadataDispatchTableType). GenericScheduler LFB abstracts queue scheduling, currently supporting Round Robin (RR) discipline, and exposes a QueueStatsTable for per-queue depth monitoring in packets and bytes.
EtherClassifier LFB classifies Ethernet frames by performing VLAN input table lookups (mapping incoming port ID + VLAN ID to a LogicalPortID) and Ethernet dispatch table lookups (mapping LogicalPortID + EtherType to a group output port index). Unmatched packets produce a ClassifyNoMatching ExceptionID.
EtherPHYCop LFB abstracts the Ethernet physical copper interface. It receives frames from the media via a singleton output 'EtherPHYOut' (passing PHYPortID metadata downstream) and transmits frames from upstream LFBs received at singleton input 'EtherPHYIn'. It covers all Ethernet variants including Ethernet V2, 802.3 RAW, IEEE 802.3/802.2, and VLAN/MACinMAC.
Five Ethernet-processing LFBs are defined: EtherPHYCop (physical copper layer), EtherMACIn (MAC-layer ingress including locality check), EtherClassifier (Ethernet type/VLAN dispatch), EtherEncap (Ethernet encapsulation for egress), and EtherMACOut (MAC-layer egress). They collectively abstract physical and data-link layer processing for Ethernet media.
Four IP forwarding LFBs are defined: IPv4UcastLPM and IPv6UcastLPM perform longest-prefix-match lookups on destination addresses to produce a HopSelector metadata; IPv4NextHop and IPv6NextHop use the HopSelector to look up next-hop tables containing L3PortID, MTU, next-hop IP address, MediaEncapInfoIndex, and LFBOutputSelectIndex.
LFB Metadata communicates per-packet state from one LFB to another within the FE data path but is never sent across the network. As a default provision of RFC 5812, all metadata produced by upstream LFBs passes through all downstream LFBs; only metadata explicitly consumed by an LFB is marked as expected in that LFB's input definition.
LFB Topology (intra-FE topology) describes how LFB instances are logically interconnected along the data path within one FE. A CE connects LFBs by establishing connections between an output port of one LFB instance and an input port of another. LFB ports include singleton ports (named single ports) and group ports (named collections of port instances indexed by name and index).
RedirectIn and RedirectOut LFBs abstract packet transmission between CEs and FEs (the redirect path). RedirectIn accepts packets from the CE with a RedirectIndex metadata indicating the target group output port; RedirectOut sends packets up to the CE.
Two IP packet validation LFBs are defined: IPv4Validator and IPv6Validator. IPv4Validator checks header length, total length, TTL, and checksum fields, while IPv6Validator checks header, total length, and hop limit. Invalid packets produce a ValidateErrorID metadata; exceptional cases (e.g., TTL zero, router alert options) produce an ExceptionID metadata.
VlanInputTableEntryType maps an incoming physical port ID (uint32) and VLAN ID (uint16, range 0–4095) to a LogicalPortID (uint32), allowing EtherClassifier to assign logical port identities to packets based on their ingress port and VLAN tag. This decouples L2 logical port assignment from physical port identity.
IANA created a registry for 'Exception ID' (Section 8.3) with values 0–15 defined in this document, including ClassifyNoMatching (1), BadTTL (4), RouterAlertOptions (6), LPMLookupFailed (11), FragRequired (14), and MetadataNoMatching (15).
IANA created a registry for 'LFB Class Names and LFB Class Identifiers' (Section 8.1). This document registers 13 LFB classes: EtherPHYCop, EtherMACIn, EtherClassifier, EtherEncap, EtherMACOut, IPv4Validator, IPv6Validator, IPv4UcastLPM, IPv4NextHop, IPv6UcastLPM, IPv6NextHop, RedirectIn, RedirectOut, BasicMetadataDispatch, and GenericScheduler.
IANA created a registry for 'Metadata ID' (Section 8.2). This document registers 15 metadata IDs (PHYPortID=1 through MediaEncapInfoIndex=15) as defined in the BaseTypeLibrary.
IANA created a registry for 'Validate Error ID' (Section 8.4) with values 0–11 defined in this document, encoding IPv4 and IPv6 packet header validation failure codes such as InvalidIPv4Checksum (5) and InvalidIPv6SrcAddr (10).
Security considerations for this LFB library are addressed in Section 9, which references the ForCES protocol security mechanisms defined in RFC 5810 and the FE model security in RFC 5812. The LFB library itself does not introduce additional security mechanisms beyond those defined in the ForCES framework.
EncapTableEntryType encodes Ethernet encapsulation parameters as: DstMac (6 bytes), SrcMac (6 bytes), VlanID (uint16, range 0–4095), Reserved (uint16), L2PortID (uint32). The EtherEncap LFB uses MediaEncapInfoIndex received from upstream as the table lookup key.
Fifteen metadata types are defined with fixed numeric IDs: PHYPortID (1, uint32), SrcMAC (2, 6 bytes), DstMAC (3, 6 bytes), LogicalPortID (4, uint32), EtherType (5, uint16), VlanID (6, uint16), VlanPriority (7, uchar), NextHopIPv4Addr (8, 4 bytes), NextHopIPv6Addr (9, 16 bytes), HopSelector (10, uint32), ExceptionID (11), ValidateErrorID (12), L3PortID (13), RedirectIndex (14), MediaEncapInfoIndex (15, uint32).
IPv4NextHopInfoType encodes a next-hop table entry as: L3PortID (uint32), MTU (uint32), NextHopIPAddr (4 bytes), MediaEncapInfoIndex (uint32), LFBOutputSelectIndex (uint32). IPv6NextHopInfoType mirrors this structure with NextHopIPAddr as 16 bytes for IPv6.
IPv4PrefixInfoType encodes an IPv4 LPM table entry as: IPv4Address (4 bytes), Prefixlen (1 byte, range 0–32), ECMPFlag (boolean), DefaultRouteFlag (boolean), Reserved (1 byte), HopSelector (uint32). The HopSelector produced here is passed as metadata to downstream next-hop LFBs.
The ExceptionID metadata (metadataID=11) is a uint32 with 15 defined special values encoding packet exception cases, including: ClassifyNoMatching (1), BadTTL (4), IPv4HeaderLengthMismatch (5), RouterAlertOptions (6), IPv6HopLimitZero (7), LPMLookupFailed (11), FragRequired (14), and MetadataNoMatching (15).
The ValidateErrorID metadata (metadataID=12) is a uint32 with 11 defined special values encoding IP header validation failures: InvalidIPv4PacketSize (1), NotIPv4Packet (2), InvalidIPv4HeaderLengthSize (3), InvalidIPv4Checksum (5), InvalidIPv4SrcAddr (6), InvalidIPv6PacketSize (8), NotIPv6Packet (9), and related IPv6 address errors.