Working Group: ForCES J. Halpern Internet-Draft Self Expires: April 9, 2008 E. Deleganes Intel Corp. October 7, 2007 ForCES Forwarding Element Model draft-ietf-forces-model-08.txt Status of this Memo By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on April 9, 2008. Copyright Notice Copyright (C) The IETF Trust (2007). Comments are solicited and should be addressed to the working group's mailing list at forces@peach.ease.lsoft.com and/or the author(s). Abstract This document defines the forwarding element (FE) model used in the Forwarding and Control Element Separation (ForCES) protocol. The model represents the capabilities, state and configuration of forwarding elements within the context of the ForCES protocol, so Halpern & Deleganes Expires April 9, 2008 [Page 1] Internet-Draft ForCES FE Model October 2007 that control elements (CEs) can control the FEs accordingly. More specifically, the model describes the logical functions that are present in an FE, what capabilities these functions support, and how these functions are or can be interconnected. This FE model is intended to satisfy the model requirements specified in the ForCES requirements draft,RFC3654 [2]. Table of Contents 1. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . 5 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1. Requirements on the FE model . . . . . . . . . . . . . . 7 2.2. The FE Model in Relation to FE Implementations . . . . . 8 2.3. The FE Model in Relation to the ForCES Protocol . . . . . 8 2.4. Modeling Language for the FE Model . . . . . . . . . . . 9 2.5. Document Structure . . . . . . . . . . . . . . . . . . . 9 3. FE Model Concepts . . . . . . . . . . . . . . . . . . . . . . 10 3.1. FE Capability Model and State Model . . . . . . . . . . . 10 3.2. LFB (Logical Functional Block) Modeling . . . . . . . . . 13 3.2.1. LFB Outputs . . . . . . . . . . . . . . . . . . . . . 16 3.2.2. LFB Inputs . . . . . . . . . . . . . . . . . . . . . 19 3.2.3. Packet Type . . . . . . . . . . . . . . . . . . . . . 21 3.2.4. Metadata . . . . . . . . . . . . . . . . . . . . . . 22 3.2.5. LFB Events . . . . . . . . . . . . . . . . . . . . . 29 3.2.6. LFB Component Properties . . . . . . . . . . . . . . 29 3.2.7. LFB Versioning . . . . . . . . . . . . . . . . . . . 30 3.2.8. LFB Inheritance . . . . . . . . . . . . . . . . . . . 30 3.3. FE Datapath Modeling . . . . . . . . . . . . . . . . . . 31 3.3.1. Alternative Approaches for Modeling FE Datapaths . . 32 3.3.2. Configuring the LFB Topology . . . . . . . . . . . . 36 4. Model and Schema for LFB Classes . . . . . . . . . . . . . . 40 4.1. Namespace . . . . . . . . . . . . . . . . . . . . . . . . 40 4.2. Element . . . . . . . . . . . . . . . . . . 40 4.3. Element . . . . . . . . . . . . . . . . . . . . . 42 4.4. Element for Frame Type Declarations . . . . . 43 4.5. Element for Data Type Definitions . . . . 43 4.5.1. Element for Aliasing Existing Data Types . 46 4.5.2. Element for Deriving New Atomic Types . . . 47 4.5.3. Element to Define Arrays . . . . . . . . . . 47 4.5.4. Element to Define Structures . . . . . . . . 51 4.5.5. Element to Define Union Types . . . . . . . . 52 4.5.6. Element . . . . . . . . . . . . . . . . . . . 52 4.5.7. Augmentationst . . . . . . . . . . . . . . . . . . . 53 4.6. Element for Metadata Definitions . . . . . 54 4.7. Element for LFB Class Definitions . . . . 55 4.7.1. Element to Express LFB Inheritance . . 57 4.7.2. Element to Define LFB Inputs . . . . . . 58 Halpern & Deleganes Expires April 9, 2008 [Page 2] Internet-Draft ForCES FE Model October 2007 4.7.3. Element to Define LFB Outputs . . . . . 60 4.7.4. Element to Define LFB Operational Components . . . . . . . . . . . . . . . . . . . . . 63 4.7.5. Element to Define LFB Capability Components . . . . . . . . . . . . . . . . . . . . . 65 4.7.6. Element for LFB Notification Generation . . 67 4.7.7. Element for LFB Operational Specification . . . . . . . . . . . . . . . . . . . . 70 4.8. Properties . . . . . . . . . . . . . . . . . . . . . . . 70 4.8.1. Basic Properties . . . . . . . . . . . . . . . . . . 71 4.8.2. Array Properties . . . . . . . . . . . . . . . . . . 73 4.8.3. String Properties . . . . . . . . . . . . . . . . . . 73 4.8.4. Octetstring Properties . . . . . . . . . . . . . . . 74 4.8.5. Event Properties . . . . . . . . . . . . . . . . . . 75 4.8.6. Alias Properties . . . . . . . . . . . . . . . . . . 78 4.9. XML Schema for LFB Class Library Documents . . . . . . . 79 5. FE Components and Capabilities . . . . . . . . . . . . . . . 90 5.1. XML for FEObject Class definition . . . . . . . . . . . . 91 5.2. FE Capabilities . . . . . . . . . . . . . . . . . . . . . 97 5.2.1. ModifiableLFBTopology . . . . . . . . . . . . . . . . 97 5.2.2. SupportedLFBs and SupportedLFBType . . . . . . . . . 98 5.3. FE Components . . . . . . . . . . . . . . . . . . . . . . 100 5.3.1. FEStatus . . . . . . . . . . . . . . . . . . . . . . 100 5.3.2. LFBSelectors and LFBSelectorType . . . . . . . . . . 100 5.3.3. LFBTopology and LFBLinkType . . . . . . . . . . . . . 101 5.3.4. FENeighbors and FEConfiguredNeighborType . . . . . . 101 6. Satisfying the Requirements on FE Model . . . . . . . . . . . 102 7. Using the FE model in the ForCES Protocol . . . . . . . . . . 103 7.1. FE Topology Query . . . . . . . . . . . . . . . . . . . . 105 7.2. FE Capability Declarations . . . . . . . . . . . . . . . 106 7.3. LFB Topology and Topology Configurability Query . . . . . 107 7.4. LFB Capability Declarations . . . . . . . . . . . . . . . 107 7.5. State Query of LFB Attributes . . . . . . . . . . . . . . 108 7.6. LFB Component Manipulation . . . . . . . . . . . . . . . 109 7.7. LFB Topology Re-configuration . . . . . . . . . . . . . . 109 8. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 8.1. Data Handling . . . . . . . . . . . . . . . . . . . . . . 116 8.1.1. Setting up a DLCI . . . . . . . . . . . . . . . . . . 117 8.1.2. Error Handling . . . . . . . . . . . . . . . . . . . 118 8.2. LFB Components . . . . . . . . . . . . . . . . . . . . . 118 8.3. Capabilities . . . . . . . . . . . . . . . . . . . . . . 119 8.4. Events . . . . . . . . . . . . . . . . . . . . . . . . . 119 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 120 10. Authors Emeritus . . . . . . . . . . . . . . . . . . . . . . 121 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 121 12. Security Considerations . . . . . . . . . . . . . . . . . . . 121 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 121 13.1. Normative References . . . . . . . . . . . . . . . . . . 121 Halpern & Deleganes Expires April 9, 2008 [Page 3] Internet-Draft ForCES FE Model October 2007 13.2. Informative References . . . . . . . . . . . . . . . . . 122 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 122 Intellectual Property and Copyright Statements . . . . . . . . . 124 Halpern & Deleganes Expires April 9, 2008 [Page 4] Internet-Draft ForCES FE Model October 2007 1. Definitions The use of compliance terminology (MUST, SHOULD, MAY) is used in accordance with RFC2119 [1]. Such terminology is used in describing the required behavior of ForCES forwarding elements or control elements in supporting or manipulating information described in this model. Terminology associated with the ForCES requirements is defined in RFC3654 [2] and is not copied here. The following list of terminology relevant to the FE model is defined in this section. FE Model -- The FE model is designed to model the logical processing functions of an FE. The FE model proposed in this document includes three components: the modeling of individual logical functional blocks (LFB model), the logical interconnection between LFBs (LFB topology) and the FE level attributes, including FE capabilities. The FE model provides the basis to define the information elements exchanged between the CE and the FE in the ForCES protocol. Datapath -- A conceptual path taken by packets within the forwarding plane inside an FE. Note that more than one datapath can exist within an FE. LFB (Logical Functional Block) Class (or type) -- A template that representing a fine-grained, logically separable aspect of FE processing. Most LFBs relate to packet processing in the data path. LFB classes are the basic building blocks of the FE model. LFB Instance -- As a packet flows through an FE along a datapath, it flows through one or multiple LFB instances, where each LFB is an instance of a specific LFB class. Multiple instances of the same LFB class can be present in an FE's datapath. Note that we often refer to LFBs without distinguishing between an LFB class and LFB instance when we believe the implied reference is obvious for the given context. LFB Model -- The LFB model describes the content and structures in an LFB, plus the associated data definition. Four types of information are defined in the LFB model. The core part of the LFB model is the LFB class definitions; the other three types define the associated data including common data types, supported frame formats and metadata. LFB Metadata -- Metadata is used to communicate per-packet state from one LFB to another, but is not sent across the network. The FE model defines how such metadata is identified, produced and consumed by the LFBs, but not how the per-packet state is implemented within actual Halpern & Deleganes Expires April 9, 2008 [Page 5] Internet-Draft ForCES FE Model October 2007 hardware. Metadata is sent between the FE and the CE on redirect packets. LFB Component -- Operational parameters of the LFBs that must be visible to the CEs are conceptualized in the FE model as the LFB components. The LFB components include: flags, single parameter arguments, complex arguments, and tables that the CE can read or/and write via the ForCES protocol. Structure Component -- Forces allows for complex data structures to be used in its data definitions. Generally, these include tables and Structures. The individual parts which make up a structured set of data are referred to as Structure Components. These can themselves be of any valid data type, including tables and structures. Component -- Often in describing the forces model and its operational, it is useful to refer to the parts of an LFB or structure, without regard to what they are part of. The term component by itself will be used to refer to these parts. If the context is unclear, but it is necessary to refer explicitly to either LFB Components or Structure Components, then the modifying word will be present. When the correct prefix is clear from context, or when no differentiation is needed, no modifier will be used. Element -- Element is generally used in this document in accordance with the XML usage of the term. It refers to an XML tagged part of an XML document. For a precise definition, please see the full set of XML specifications from the W3C. This term is included in this list for completeness, and because earlier versions of this document used the term element inconsistently. The other use of the term element is in terms of the FE and CE (Forwarding Element and Control Element.) As those are not textual or data structure items, context provides sufficient clarity for this usage. Attribute -- Attribute is used in the XML sense of attribute information include in an XML tag. LFB Topology -- A representation of the logical interconnection and the placement of LFB instances along the datapath within one FE. Sometimes this representation is called intra-FE topology, to be distinguished from inter-FE topology. LFB topology is outside of the LFB model, but is part of the FE model. FE Topology -- A representation of how multiple FEs within a single NE are interconnected. Sometimes this is called inter-FE topology, to be distinguished from intra-FE topology (i.e., LFB topology). An individual FE might not have the global knowledge of the full FE topology, but the local view of its connectivity with other FEs is Halpern & Deleganes Expires April 9, 2008 [Page 6] Internet-Draft ForCES FE Model October 2007 considered to be part of the FE model. The FE topology is discovered by the ForCES base protocol or by some other means. Inter-FE Topology -- See FE Topology. Intra-FE Topology -- See LFB Topology. LFB class library -- A set of LFB classes that has been identified as the most common functions found in most FEs and hence should be defined first by the ForCES Working Group. 2. Introduction RFC3746 [3] specifies a framework by which control elements (CEs) can configure and manage one or more separate forwarding elements (FEs) within a networking element (NE) using the ForCES protocol. The ForCES architecture allows Forwarding Elements of varying functionality to participate in a ForCES network element. The implication of this varying functionality is that CEs can make only minimal assumptions about the functionality provided by FEs in an NE. Before CEs can configure and control the forwarding behavior of FEs, CEs need to query and discover the capabilities and states of their FEs.RFC3654 [2] mandates that the capabilities, states and configuration information be expressed in the form of an FE model. RFC3444 [8] observed that information models (IMs) and data models (DMs) are different because they serve different purposes. "The main purpose of an IM is to model managed objects at a conceptual level, independent of any specific implementations or protocols used". "DMs, conversely, are defined at a lower level of abstraction and include many details. They are intended for implementors and include protocol-specific constructs." Sometimes it is difficult to draw a clear line between the two. The FE model described in this document is primarily an information model, but also includes some aspects of a data model, such as explicit definitions of the LFB class schema and FE schema. It is expected that this FE model will be used as the basis to define the payload for information exchange between the CE and FE in the ForCES protocol. 2.1. Requirements on the FE model RFC3654 [2]defines requirements that must be satisfied by a ForCES FE model. To summarize, an FE model must define: o Logically separable and distinct packet forwarding operations in an FE datapath (logical functional blocks or LFBs); Halpern & Deleganes Expires April 9, 2008 [Page 7] Internet-Draft ForCES FE Model October 2007 o The possible topological relationships (and hence the sequence of packet forwarding operations) between the various LFBs; o The possible operational capabilities (e.g., capacity limits, constraints, optional features, granularity of configuration) of each type of LFB; o The possible configurable parameters (i.e., attributes) of each type of LFB; o Metadata that may be exchanged between LFBs. 2.2. The FE Model in Relation to FE Implementations The FE model proposed here is based on an abstraction of distinct logical functional blocks (LFBs), which are interconnected in a directed graph, and receive, process, modify, and transmit packets along with metadata. The FE model should be designed such that different implementations of the forwarding datapath can be logically mapped onto the model with the functionality and sequence of operations correctly captured. However, the model is not intended to directly address how a particular implementation maps to an LFB topology. It is left to the forwarding plane vendors to define how the FE functionality is represented using the FE model. Our goal is to design the FE model such that it is flexible enough to accommodate most common implementations. The LFB topology model for a particular datapath implementation must correctly capture the sequence of operations on the packet. Metadata generation by certain LFBs MUST always precede any use of that metadata by subsequent LFBs in the topology graph; this is required for logically consistent operation. Further, modification of packet fields that are subsequently used as inputs for further processing MUST occur in the order specified in the model for that particular implementation to ensure correctness. 2.3. The FE Model in Relation to the ForCES Protocol The ForCES base protocol is used by the CEs and FEs to maintain the communication channel between the CEs and FEs. The ForCES protocol may be used to query and discover the inter-FE topology. The details of a particular datapath implementation inside an FE, including the LFB topology, along with the operational capabilities and attributes of each individual LFB, are conveyed to the CE within information elements in the ForCES protocol. The model of an LFB class should define all of the information that needs to be exchanged between an FE and a CE for the proper configuration and management of that LFB. Halpern & Deleganes Expires April 9, 2008 [Page 8] Internet-Draft ForCES FE Model October 2007 Specifying the various payloads of the ForCES messages in a systematic fashion is difficult without a formal definition of the objects being configured and managed (the FE and the LFBs within). The FE Model document defines a set of classes and components for describing and manipulating the state of the LFBs within an FE. These class definitions themselves will generally not appear in the ForCES protocol. Rather, ForCES protocol operations will reference classes defined in this model, including relevant components and the defined operations. Section 7 provides more detailed discussion on how the FE model should be used by the ForCES protocol. 2.4. Modeling Language for the FE Model Even though not absolutely required, it is beneficial to use a formal data modeling language to represent the conceptual FE model described in this document. Use of a formal language can help to enforce consistency and logical compatibility among LFBs. A full specification will be written using such a data modeling language. The formal definition of the LFB classes may facilitate the eventual automation of some of the code generation process and the functional validation of arbitrary LFB topologies. These class definitions form the LFB Library. Documents which describe LFB Classes are therefore referred to as LFB Library documents. Human readability was the most important factor considered when selecting the specification language, whereas encoding, decoding and transmission performance was not a selection factor. The encoding method for over the wire transport is not dependent on the specification language chosen and is outside the scope of this document and up to the ForCES protocol to define. XML was chosen as the specification language in this document, because XML has the advantage of being both human and machine readable with widely available tools support. This document uses XML Schema to define the structure of the LFB Library documents, as defined in [9] and [10]. While these LFB Class definitions are not sent in the Forces protocol, these definitions comply with the recommendations in RFC3470 [9] on the use of XML in IETF protocols. 2.5. Document Structure Section 3 provides a conceptual overview of the FE model, laying the foundation for the more detailed discussion and specifications in the sections that follow. Section 4 and Section 5 constitute the core of the FE model, detailing the two major aspects of the FE model: a general LFB model and a definition of the FE Object LFB, with its Halpern & Deleganes Expires April 9, 2008 [Page 9] Internet-Draft ForCES FE Model October 2007 components, including FE capabilities and LFB topology information. Section 6 directly addresses the model requirements imposed by the ForCES requirement draft[1] while Section 7 explains how the FE model should be used in the ForCES protocol. 3. FE Model Concepts Some of the important concepts used throughout this document are introduced in this section. Section 3.1 explains the difference between a state model and a capability model, and describes how the two can be combined in the FE model.Section 3.2 introduces the concept of LFBs (Logical Functional Blocks) as the basic functional building blocks in the FE model.Section 3.3 discusses the logical inter-connection and ordering between LFB instances within an FE, that is, the LFB topology. The FE model proposed in this document has two major aspects: the LFB model and FE Object defintion whose components include FE capability information and LFB topology information. The LFB model provides the content and data structures to define each individual LFB class. The FE Object class defines the components to provide information at the FE level, particularly the capabilities of the FE at a coarse level. Part of the FE level information is the LFB topology, which expresses the logical inter- connection between the LFB instances along the datapath(s) within the FE. Details of these aspects are described in Section 4 and Section 5. The intent of this section is to discuss these concepts at the high level and lay the foundation for the detailed description in the following sections. 3.1. FE Capability Model and State Model The ForCES FE model includes both a capability and a state model. The FE capability model describes the capabilities and capacities of an FE by specifying the variation in functions supported and any limitations. The FE state model describes the current state of the FE, that is, the instantaneous values or operational behavior of the FE. Equally, this concept applies to LFB classes, where the capability information indicates what this FE is capable of providing using the specific LFB Class, or even the specific component (such as the table size limits.) Capability information is always read-only, as it describes what the FE / LFB can provide, not what the CE has requested. Conceptually, the FE capability model tells the CE which states are allowed on an FE, with capacity information indicating certain quantitative limits or constraints. Thus, the CE has general knowledge about configurations that are applicable to a particular Halpern & Deleganes Expires April 9, 2008 [Page 10] Internet-Draft ForCES FE Model October 2007 FE. For example, an FE capability model may describe the FE at a coarse level such as: o this FE can handle IPv4 and IPv6 forwarding; o this FE can perform classification on the following fields: source IP address, destination IP address, source port number, destination port number, etc; o this FE can perform metering; o this FE can handle up to N queues (capacity); o this FE can add and remove encapsulating headers of types including IPSec, GRE, L2TP. While one could try and build an object model to fully represent the FE capabilities, other efforts found this to be a significant undertaking. The main difficulty arises in describing detailed limits, such as the maximum number of classifiers, queues, buffer pools, and meters the FE can provide. We believe that a good balance between simplicity and flexibility can be achieved for the FE model by combining coarse level capability reporting with an error reporting mechanism. That is, if the CE attempts to instruct the FE to set up some specific behavior it cannot support, the FE will return an error indicating the problem. Examples of similar approaches include DiffServ PIB RFC3317 [4] and Framework PIB RFC3318 [5]. There is one common and shared aspect of capability that will be handled in a separate fashion. For all components (i.e. LFB components and Structure components), certain property information is needed. All components need to provide information as to whether they are supported and if so whether the components is readable or writeable. Based on their type, many components have additional common properties (for example, arrays have their current size.) There is a specific model and protocol mechanism for referencing this form of property information about components of the model. The FE state model presents the snapshot view of the FE to the CE. For example, using an FE state model, an FE may be described to its corresponding CE as the following: o on a given port, the packets are classified using a given classification filter; o the given classifier results in packets being metered in a certain way, and then marked in a certain way; Halpern & Deleganes Expires April 9, 2008 [Page 11] Internet-Draft ForCES FE Model October 2007 o the packets coming from specific markers are delivered into a shared queue for handling, while other packets are delivered to a different queue; o a specific scheduler with specific behavior and parameters will service these collected queues. Figure 1 shows the concepts of FE state, capabilities and configuration in the context of CE-FE communication via the ForCES protocol. +-------+ +-------+ | | FE capabilities: what it can/cannot do. | | | |<-----------------------------------------| | | | | | | CE | FE state: what it is now. | FE | | |<-----------------------------------------| | | | | | | | FE configuration: what it should be. | | | |----------------------------------------->| | +-------+ +-------+ Figure 1: Illustration of FE state, capabilities and configuration exchange in the context of CE-FE communication via ForCES. The concepts relating to LFBs, particularly capability at the LFB level and LFB topology will be discussed in the rest of this section. Capability information at the LFB level is an integral part of the LFB model, and is modeled the same way as the other operational parameters inside an LFB. For example, when certain features of an LFB class are optional, the CE MUST be able to determine whether those optional features are supported by a given LFB instance. Such capability information is modeled as either property information, or for LFB information not provided by the defined properties, as capability components which are inherently read-only. The schema for the definition of LFB classes provides for identifying such components. Capability information at the FE level may describe the LFB classes that the FE can instantiate; the number of instances of each that can be created; the topological (linkage) limitations between these LFB instances, etc. Section 5 defines the FE level components including capability information. Since all information is represented as LFBs, this is provided by a single instance of the FE Object LFB Class. By using a single instance with a known LFB Class and a known instance identification, the Forces Protocol can allow a CE to access Halpern & Deleganes Expires April 9, 2008 [Page 12] Internet-Draft ForCES FE Model October 2007 this information whenever it needs to, including as part of establishing the control of the FE by the CE. Once the FE capability is described to the CE, the FE state information can be represented by two levels. The first level is the logically separable and distinct packet processing functions, called Logical Functional Blocks (LFBs). The second level of information describes how these individual LFBs are ordered and placed along the datapath to deliver a complete forwarding plane service. The interconnection and ordering of the LFBs is called LFB Topology. Section 3.2 discusses high level concepts around LFBs, whereas Section 3.3 discusses LFB topology issues. This topology information is represented as components of the FE Object LFB instance, to allow the CE to fetch and manipulate this. 3.2. LFB (Logical Functional Block) Modeling Each LFB performs a well-defined action or computation on the packets passing through it. Upon completion of its prescribed function, either the packets are modified in certain ways (e.g., decapsulator, marker), or some results are generated and stored, often in the form of metadata (e.g., classifier). Each LFB typically performs a single action. Classifiers, shapers and meters are all examples of such LFBs. Modeling LFBs at such a fine granularity allows us to use a small number of LFBs to express the higher-order FE functions (such as an IPv4 forwarder) precisely, which in turn can describe more complex networking functions and vendor implementations of software and hardware. These LFBs will be defined in detail in one or more documents. An LFB has one or more inputs, each of which takes a packet P, and optionally metadata M; and produces one or more outputs, each of which carries a packet P', and optionally metadata M'. Metadata is data associated with the packet in the network processing device (router, switch, etc.) and is passed from one LFB to the next, but is not sent across the network. In general, multiple LFBs are contained in one FE, as shown in Figure 2, and all the LFBs share the same ForCES protocol termination point that implements the ForCES protocol logic and maintains the communication channel to and from the CE. Halpern & Deleganes Expires April 9, 2008 [Page 13] Internet-Draft ForCES FE Model October 2007 +-----------+ | CE | +-----------+ ^ | Fp reference point | +--------------------------|-----------------------------------+ | FE | | | v | | +----------------------------------------------------------+ | | | ForCES protocol | | | | termination point | | | +----------------------------------------------------------+ | | ^ ^ | | : : Internal control | | : : | | +---:----------+ +---:----------| | | | :LFB1 | | : LFB2 | | | =====>| v |============>| v |======>...| | Inputs| +----------+ |Outputs | +----------+ | | | (P,M) | |Components| |(P',M') | |Components| |(P",M") | | | +----------+ | | +----------+ | | | +--------------+ +--------------+ | | | +--------------------------------------------------------------+ Figure 2: Generic LFB Diagram An LFB, as shown in Figure 2, has inputs, outputs and components that can be queried and manipulated by the CE via an Fp reference point (defined in RFC 3746 [2]) and the ForCES protocol termination point. The horizontal axis is in the forwarding plane for connecting the inputs and outputs of LFBs within the same FE. The vertical axis between the CE and the FE denotes the Fp reference point where bidirectional communication between the CE and FE occurs: the CE to FE communication is for configuration, control and packet injection while FE to CE communication is used for packet re- direction to the control plane, monitoring and accounting information, errors, etc. Note that the interaction between the CE and the LFB is only abstract and indirect. The result of such an interaction is for the CE to manipulate the components of the LFB instances. A namespace is used to associate a unique name or ID with each LFB class. The namespace MUST be extensible so that a new LFB class can be added later to accommodate future innovation in the forwarding plane. LFB operation is specified in the model to allow the CE to understand Halpern & Deleganes Expires April 9, 2008 [Page 14] Internet-Draft ForCES FE Model October 2007 the behavior of the forwarding datapath. For instance, the CE must understand at what point in the datapath the IPv4 header TTL is decremented. That is, the CE needs to know if a control packet could be delivered to it either before or after this point in the datapath. In addition, the CE MUST understand where and what type of header modifications (e.g., tunnel header append or strip) are performed by the FEs. Further, the CE MUST verify that the various LFBs along a datapath within an FE are compatible to link together. There is value to vendors if the operation of LFB classes can be expressed in sufficient detail so that physical devices implementing different LFB functions can be integrated easily into an FE design. Therefore, a semi-formal specification is needed; that is, a text description of the LFB operation (human readable), but sufficiently specific and unambiguous to allow conformance testing and efficient design, so that interoperability between different CEs and FEs can be achieved. The LFB class model specifies information such as: o number of inputs and outputs (and whether they are configurable) o metadata read/consumed from inputs; o metadata produced at the outputs; o packet type(s) accepted at the inputs and emitted at the outputs; o packet content modifications (including encapsulation or decapsulation); o packet routing criteria (when multiple outputs on an LFB are present); o packet timing modifications; o packet flow ordering modifications; o LFB capability information components; o Events that can be detected by the LFB, with notification to the CE; o LFB operational components, etc. Section 4 of this document provides a detailed discussion of the LFB model with a formal specification of LFB class schema. The rest of Section 3.2 only intends to provide a conceptual overview of some Halpern & Deleganes Expires April 9, 2008 [Page 15] Internet-Draft ForCES FE Model October 2007 important issues in LFB modeling, without covering all the specific details. 3.2.1. LFB Outputs An LFB output is a conceptual port on an LFB that can send information to another LFB. The information is typically a packet and its associated metadata, although in some cases it might consist of only metadata, i.e., with no packet data. A single LFB output can be connected to only one LFB input. This is required to make the packet flow through the LFB topology unambiguously. Some LFBs will have a single output, as depicted in Figure 3.a. +---------------+ +-----------------+ | | | | | | | OUT +--> ... OUT +--> ... | | | | EXCEPTIONOUT +--> | | | | +---------------+ +-----------------+ a. One output b. Two distinct outputs +---------------+ +-----------------+ | | | EXCEPTIONOUT +--> | OUT:1 +--> | | ... OUT:2 +--> ... OUT:1 +--> | ... +... | OUT:2 +--> | OUT:n +--> | ... +... +---------------+ | OUT:n +--> +-----------------+ c. One output group d. One output and one output group Figure 3: Examples of LFBs with various output combinations. To accommodate a non-trivial LFB topology, multiple LFB outputs are needed so that an LFB class can fork the datapath. Two mechanisms are provided for forking: multiple singleton outputs and output groups, which can be combined in the same LFB class. Multiple separate singleton outputs are defined in an LFB class to model a pre-determined number of semantically different outputs. Halpern & Deleganes Expires April 9, 2008 [Page 16] Internet-Draft ForCES FE Model October 2007 That is, the LFB class definition MUST include the number of outputs, implying the number of outputs is known when the LFB class is defined. Additional singleton outputs cannot be created at LFB instantiation time, nor can they be created on the fly after the LFB is instantiated. For example, an IPv4 LPM (Longest-Prefix-Matching) LFB may have one output(OUT) to send those packets for which the LPM look-up was successful, passing a META_ROUTEID as metadata; and have another output (EXCEPTIONOUT) for sending exception packets when the LPM look-up failed. This example is depicted in Figure 3.b. Packets emitted by these two outputs not only require different downstream treatment, but they are a result of two different conditions in the LFB and each output carries different metadata. This concept assumes the number of distinct outputs is known when the LFB class is defined. For each singleton output, the LFB class definition defines the types of frames and metadata the output emits. An output group, on the other hand, is used to model the case where a flow of similar packets with an identical set of metadata needs to be split into multiple paths. In this case, the number of such paths is not known when the LFB class is defined because it is not an inherent property of the LFB class. An output group consists of a number of outputs, called the output instances of the group, where all output instances share the same frame and metadata emission definitions (see Figure 3.c). Each output instance can connect to a different downstream LFB, just as if they were separate singleton outputs, but the number of output instances can differ between LFB instances of the same LFB class. The class definition may include a lower and/or an upper limit on the number of outputs. In addition, for configurable FEs, the FE capability information may define further limits on the number of instances in specific output groups for certain LFBs. The actual number of output instances in a group is an attribute of the LFB instance, which is read-only for static topologies, and read-write for dynamic topologies. The output instances in a group are numbered sequentially, from 0 to N-1, and are addressable from within the LFB. The LFB has a built-in mechanism to select one specific output instance for each packet. This mechanism is described in the textual definition of the class and is typically configurable via some attributes of the LFB. For example, consider a re-director LFB, whose sole purpose is to direct packets to one of N downstream paths based on one of the metadata associated with each arriving packet. Such an LFB is fairly versatile and can be used in many different places in a topology. For example, a redirector can be used to divide the data path into an IPv4 and an IPv6 path based on a FRAMETYPE metadata (N=2), or to fork into color specific paths after metering using the COLOR metadata Halpern & Deleganes Expires April 9, 2008 [Page 17] Internet-Draft ForCES FE Model October 2007 (red, yellow, green; N=3), etc. Using an output group in the above LFB class provides the desired flexibility to adapt each instance of this class to the required operation. The metadata to be used as a selector for the output instance is a property of the LFB. For each packet, the value of the specified metadata may be used as a direct index to the output instance. Alternatively, the LFB may have a configurable selector table that maps a metadata value to output instance. Note that other LFBs may also use the output group concept to build in similar adaptive forking capability. For example, a classifier LFB with one input and N outputs can be defined easily by using the output group concept. Alternatively, a classifier LFB with one singleton output in combination with an explicit N-output re- director LFB models the same processing behavior. The decision of whether to use the output group model for a certain LFB class is left to the LFB class designers. The model allows the output group to be combined with other singleton output(s) in the same class, as demonstrated in Figure 3.d. The LFB here has two types of outputs, OUT, for normal packet output, and EXCEPTIONOUT for packets that triggered some exception. The normal OUT has multiple instances, thus, it is an output group. In summary, the LFB class may define one output, multiple singleton outputs, one or more output groups, or a combination thereof. Multiple singleton outputs should be used when the LFB must provide for forking the datapath, and at least one of the following conditions hold: o the number of downstream directions are inherent from the definition of the class and hence fixed; o the frame type and set of metadata emitted on any of the outputs are substantially different from what is emitted on the other outputs (i.e., they cannot share frame-type and metadata definitions); An output group is appropriate when the LFB must provide for forking the datapath, and at least one of the following conditions hold: o the number of downstream directions is not known when the LFB class is defined; o the frame type and set of metadata emitted on these outputs are sufficiently similar or ideally identical, such they can share the same output definition. Halpern & Deleganes Expires April 9, 2008 [Page 18] Internet-Draft ForCES FE Model October 2007 3.2.2. LFB Inputs An LFB input is a conceptual port on an LFB where the LFB can receive information from other LFBs. The information is typically a packet and associated metadata, although in some cases it might consist of only metadata, without any packet data. For LFB instances that receive packets from more than one other LFB instance (fan-in). There are three ways to model fan-in, all supported by the LFB model and can be combined in the same LFB: o Implicit multiplexing via a single input o Explicit multiplexing via multiple singleton inputs o Explicit multiplexing via a group of inputs (input group) The simplest form of multiplexing uses a singleton input (Figure 4 .a). Most LFBs will have only one singleton input. Multiplexing into a single input is possible because the model allows more than one LFB output to connect to the same LFB input. This property applies to any LFB input without any special provisions in the LFB class. Multiplexing into a single input is applicable when the packets from the upstream LFBs are similar in frame-type and accompanying metadata, and require similar processing. Note that this model does not address how potential contention is handled when multiple packets arrive simultaneously. If contention handling needs to be explicitly modeled, one of the other two modeling solutions must be used. The second method to model fan-in uses individually defined singleton inputs (Figure 4.b). This model is meant for situations where the LFB needs to handle distinct types of packet streams, requiring input-specific handling inside the LFB, and where the number of such distinct cases is known when the LFB class is defined. For example, a Layer 2 Decapsulation/Encapsulation LFB may have two inputs, one for receiving Layer 2 frames for decapsulation, and one for receiving Layer 3 frames for encapsulation. This LFB type expects different frames (L2 vs. L3) at its inputs, each with different sets of metadata, and would thus apply different processing on frames arriving at these inputs. This model is capable of explicitly addressing packet contention by defining how the LFB class handles the contending packets. Halpern & Deleganes Expires April 9, 2008 [Page 19] Internet-Draft ForCES FE Model October 2007 +--------------+ +------------------------+ | LFB X +---+ | | +--------------+ | | | | | | | +--------------+ v | | | LFB Y +---+-->|input Meter LFB | +--------------+ ^ | | | | | | +--------------+ | | | | LFB Z |---+ | | +--------------+ +------------------------+ (a) An LFB connects with multiple upstream LFBs via a single input. +--------------+ +------------------------+ | LFB X +---+ | | +--------------+ +-->|layer2 | +--------------+ | | | LFB Y +------>|layer3 LFB | +--------------+ +------------------------+ (b) An LFB connects with multiple upstream LFBs via two separate singleton inputs. +--------------+ +------------------------+ | Queue LFB #1 +---+ | | +--------------+ | | | | | | +--------------+ +-->|in:0 \ | | Queue LFB #2 +------>|in:1 | input group | +--------------+ |... | | +-->|in:N-1 / | ... | | | +--------------+ | | | | Queue LFB #N |---+ | Scheduler LFB | +--------------+ +------------------------+ (c) A Scheduler LFB uses an input group to differentiate which queue LFB packets are coming from. Halpern & Deleganes Expires April 9, 2008 [Page 20] Internet-Draft ForCES FE Model October 2007 Figure 4: Input modeling concepts (examples). The third method to model fan-in uses the concept of an input group. The concept is similar to the output group introduced in the previous section, and is depicted in Figure 4.c. An input group consists of a number of input instances, all sharing the properties (same frame and metadata expectations). The input instances are numbered from 0 to N-1. From the outside, these inputs appear as normal inputs, i.e., any compatible upstream LFB can connect its output to one of these inputs. When a packet is presented to the LFB at a particular input instance, the index of the input where the packet arrived is known to the LFB and this information may be used in the internal processing. For example, the input index can be used as a table selector, or as an explicit precedence selector to resolve contention. As with output groups, the number of input instances in an input group is not defined in the LFB class. However, the class definition may include restrictions on the range of possible values. In addition, if an FE supports configurable topologies, it may impose further limitations on the number of instances for a particular port group(s) of a particular LFB class. Within these limitations, different instances of the same class may have a different number of input instances. The number of actual input instances in the group is an component defined in the LFB class, which is read-only for static topologies, and is read-write for configurable topologies. As an example for the input group, consider the Scheduler LFB depicted in Figure 3.c. Such an LFB receives packets from a number of Queue LFBs via a number of input instances, and uses the input index information to control contention resolution and scheduling. In summary, the LFB class may define one input, multiple singleton inputs, one or more input groups, or a combination thereof. Any input allows for implicit multiplexing of similar packet streams via connecting multiple outputs to the same input. Explicit multiple singleton inputs are useful when either the contention handling must be handled explicitly, or when the LFB class must receive and process a known number of distinct types of packet streams. An input group is suitable when contention handling must be modeled explicitly, but the number of inputs are not inherent from the class (and hence is not known when the class is defined), or when it is critical for LFB operation to know exactly on which input the packet was received. 3.2.3. Packet Type When LFB classes are defined, the input and output packet formats (e.g., IPv4, IPv6, Ethernet, etc.) MUST be specified. These are the Halpern & Deleganes Expires April 9, 2008 [Page 21] Internet-Draft ForCES FE Model October 2007 types of packets a given LFB input is capable of receiving and processing, or a given LFB output is capable of producing. This requires distinct packet types be uniquely labeled with a symbolic name and/or ID. Note that each LFB has a set of packet types that it operates on, but does not care whether the underlying implementation is passing a greater portion of the packets. For example, an IPv4 LFB might only operate on IPv4 packets, but the underlying implementation may or may not be stripping the L2 header before handing it over -- whether that is happening or not is opaque to the CE. 3.2.4. Metadata Metadata is the per-packet state that is passed from one LFB to another. The metadata is passed with the packet to assist subsequent LFBs to process that packet. The ForCES model captures how the per- packet state information is propagated from one LFB to other LFBs. Practically, such metadata propagation can happen within one FE, or cross the FE boundary between two interconnected FEs. We believe that the same metadata model can be used for either situation; however, our focus here is for intra-FE metadata. 3.2.4.1. Metadata Vocabulary Metadata has historically been understood to mean "data about data". While this definition is a start, it is inadequate to describe the multiple forms of metadata, which may appear within a complex network element. The discussion here categorizes forms of metadata by two orthogonal axes. The first axis is "internal" versus "external", which describes where the metadata exists in the network model or implementation. For example, a particular vendor implementation of an IPv4 forwarder may make decisions inside of a chip that are not visible externally. Those decisions are metadata for the packet that is "internal" to the chip. When a packet is forwarded out of the chip, it may be marked with a traffic management header. That header, which is metadata for the packet, is visible outside of the chip, and is therefore called "external" metadata. The second axis is "implicit" versus "expressed", which specifies whether or not the metadata has a visible physical representation. For example, the traffic management header described in the previous paragraph may be represented as a series of bits in some format, and that header is associated with the packet. Those bits have physical representation, and are therefore "expressed" metadata. If the metadata does not have a physical representation, it is called Halpern & Deleganes Expires April 9, 2008 [Page 22] Internet-Draft ForCES FE Model October 2007 "implicit" metadata. This situation occurs, for example, when a particular path through a network device is intended to be traversed only by particular kinds of packets, such as an IPv4 router. An implementation may not mark every packet along this path as being of type "IPv4", but the intention of the designers is that every packet is of that type. This understanding can be thought of as metadata about the packet, which is implicitly attached to the packet through the intent of the designers. In the ForCES model, we do not discuss or represent metadata "internal" to vendor implementations of LFBs. Our focus is solely on metadata "external" to the LFBs, and therefore visible in the ForCES model. The metadata discussed within this model may, or may not be visible outside of the particular FE implementing the LFB model. In this regard, the scope of the metadata within ForCES is very narrowly defined. Note also that while we define metadata within this model, it is only a model. There is no requirement that vendor implementations of ForCES use the exact metadata representations described in this document. The only implementation requirement is that vendors implement the ForCES protocol, not the model. 3.2.4.2. Metadata lifecycle within the ForCES model Each metadata can be conveniently modeled as a pair, where the label identifies the type of information, (e.g., "color"), and its value holds the actual information (e.g., "red"). The tag here is shown as a textual label, but it can be replaced or associated with a unique numeric value (identifier). The metadata life-cycle is defined in this model using three types of events: "write", "read" and "consume". The first "write" implicitly creates and initializes the value of the metadata, and hence starts the life-cycle. The explicit "consume" event terminates the life- cycle. Within the life-cycle, that is, after a "write" event, but before the next "consume" event, there can be an arbitrary number of "write" and "read" events. These "read" and "write" events can be mixed in an arbitrary order within the life- cycle. Outside of the life-cycle of the metadata, that is, before the first "write" event, or between a "consume" event and the next "write" event, the metadata should be regarded non-existent or non- initialized. Thus, reading a metadata outside of its life-cycle is considered an error. To ensure inter-operability between LFBs, the LFB class specification must define what metadata the LFB class "reads" or "consumes" on its input(s) and what metadata it "produces" on its output(s). For maximum extensibility, this definition should neither specify which Halpern & Deleganes Expires April 9, 2008 [Page 23] Internet-Draft ForCES FE Model October 2007 LFBs the metadata is expected to come from for a consumer LFB, nor which LFBs are expected to consume metadata for a given producer LFB. While it is important to define the metadata types passing between LFBs, it is not appropriate to define the exact encoding mechanism used by LFBs for that metadata. Different implementations are allowed to use different encoding mechanisms for metadata. For example, one implementation may store metadata in registers or shared memory, while another implementation may encode metadata in- band as a preamble in the packets. In order to allow the CE to understand and control the meta-data related operations, the model represents each metadata tag as a 32-bit integer. Each LFB definition indicates in its metadata declarations the 32-bit value associated with a given metadata tag. Ensuring consistency of usage of tags is important, and outside the scope of the model. At any link between two LFBs, the packet is marked with a finite set of active metadata, where active means the metadata is within its life-cycle. There are two corollaries of this model: 1. No un-initialized metadata exists in the model. 2. No more than one occurrence of each metadata tag can be associated with a packet at any given time. 3.2.4.3. LFB Operations on Metadata When the packet is processed by an LFB (i.e., between the time it is received and forwarded by the LFB), the LFB may perform read, write and/or consume operations on any active metadata associated with the packet. If the LFB is considered to be a black box, one of the following operations is performed on each active metadata. * IGNORE: ignores and forwards the metadata * READ: reads and forwards the metadata * READ/RE-WRITE: reads, over-writes and forwards the metadata * WRITE: writes and forwards the metadata (can also be used to create new metadata) * READ-AND-CONSUME: reads and consumes the metadata * CONSUME consumes metadata without reading The last two operations terminate the life-cycle of the metadata, meaning that the metadata is not forwarded with the packet when the Halpern & Deleganes Expires April 9, 2008 [Page 24] Internet-Draft ForCES FE Model October 2007 packet is sent to the next LFB. In our model, a new metadata is generated by an LFB when the LFB applies a WRITE operation to a metadata type that was not present when the packet was received by the LFB. Such implicit creation may be unintentional by the LFB, that is, the LFB may apply the WRITE operation without knowing or caring if the given metadata existed or not. If it existed, the metadata gets over-written; if it did not exist, the metadata is created. For LFBs that insert packets into the model, WRITE is the only meaningful metadata operation. For LFBs that remove the packet from the model, they may either READ- AND-CONSUME (read) or CONSUME (ignore) each active metadata associated with the packet. 3.2.4.4. Metadata Production and Consumption For a given metadata on a given packet path, there MUST be at least one producer LFB that creates that metadata and SHOULD be at least one consumer LFB that needs that metadata. In this model, the producer and consumer LFBs of a metadata are not required to be adjacent. In addition, there may be multiple producers and consumers for the same metadata. When a packet path involves multiple producers of the same metadata, then subsequent producers overwrite that metadata value. The metadata that is produced by an LFB is specified by the LFB class definition on a per output port group basis. A producer may always generate the metadata on the port group, or may generate it only under certain conditions. We call the former an "unconditional" metadata, whereas the latter is a "conditional" metadata. In the case of conditional metadata, it should be possible to determine from the definition of the LFB when a "conditional" metadata is produced. The consumer behavior of an LFB, that is, the metadata that the LFB needs for its operation, is defined in the LFB class definition on a per input port group basis. An input port group may "require" a given metadata, or may treat it as "optional" information. In the latter case, the LFB class definition MUST explicitly define what happens if an optional metadata is not provided. One approach is to specify a default value for each optional metadata, and assume that the default value is used if the metadata is not provided with the packet. When a consumer LFB requires a given metadata, it has dependencies on its up-stream LFBs. That is, the consumer LFB can only function if there is at least one producer of that metadata and no intermediate Halpern & Deleganes Expires April 9, 2008 [Page 25] Internet-Draft ForCES FE Model October 2007 LFB consumes the metadata. The model should expose these inter-dependencies. Furthermore, it should be possible to take inter-dependencies into consideration when constructing LFB topologies, and also that the dependencies can be verified when validating topologies. For extensibility reasons, the LFB specification SHOULD define what metadata the LFB requires without specifying which LFB(s) it expects a certain metadata to come from. Similarly, LFBs SHOULD specify what metadata they produce without specifying which LFBs the metadata is meant for. When specifying the metadata tags, some harmonization effort must be made so that the producer LFB class uses the same tag as its intended consumer(s), or vice versa. 3.2.4.5. Fixed, Variable and Configurable Tag When the produced metadata is defined for a given LFB class, most metadata will be specified with a fixed tag. For example, a Rate Meter LFB will always produce the "Color" metadata. A small subset of LFBs need the capability to produce one or more of their metadata with tags that are not fixed in the LFB class definition, but instead can be selected per LFB instance. An example of such an LFB class is a Generic Classifier LFB. We call this capability "variable tag metadata production". If an LFB produces metadata with a variable tag, the corresponding LFB attribute, called the tag selector, specifies the tag for each such metadata. This mechanism improves the versatility of certain multi- purpose LFB classes, since it allows the same LFB class to be used in different topologies, producing the right metadata tags according to the needs of the topology. This selection of tags is variable in that the produced output may have any number of different tags. The meaning of the various tags is still defined by the metadata declaration associated with the LFB class definition. This also allows the CE to correctly set the tag values in the table to match the declared meanings of the metadata tag values. Depending on the capability of the FE, the tag selector can be either a read-only or a read-write attribute. If the selector is read-only, the tag cannot be modified by the CE. If the selector is read-write, the tag can be configured by the CE, hence we call this "configurable tag metadata production." Note that using this definition, configurable tag metadata production is a subset of variable tag metadata production. Halpern & Deleganes Expires April 9, 2008 [Page 26] Internet-Draft ForCES FE Model October 2007 Similar concepts can be introduced for the consumer LFBs to satisfy different metadata needs. Most LFB classes will specify their metadata needs using fixed metadata tags. For example, a Next Hop LFB may always require a "NextHopId" metadata; but the Redirector LFB may need a "ClassID" metadata in one instance, and a "ProtocolType" metadata in another instance as a basis for selecting the right output port. In this case, an LFB attribute is used to provide the required metadata tag at run-time. This metadata tag selector attribute may be read-only or read-write, depending on the capabilities of the LFB instance and the FE. 3.2.4.6. Metadata Usage Categories Depending on the role and usage of a metadata, various amounts of encoding information MUST be provided when the metadata is defined, where some cases offer less flexibility in the value selection than others. There are three types of metadata related to metadata usage: o Relational (or binding) metadata o Enumerated metadata o Explicit/external value metadata The purpose of the relational metadata is to refer in one LFB instance (producer LFB) to a "thing" in another downstream LFB instance (consumer LFB), where the "thing" is typically an entry in a table attribute of the consumer LFB. For example, the Prefix Lookup LFB executes an LPM search using its prefix table and resolves to a next-hop reference. This reference needs to be passed as metadata by the Prefix Lookup LFB (producer) to the Next Hop LFB (consumer), and must refer to a specific entry in the next-hop table within the consumer. Expressing and propagating such a binding relationship is probably the most common usage of metadata. One or more objects in the producer LFB are bound to a specific object in the consumer LFB. Such a relationship is established by the CE explicitly by properly configuring the attributes in both LFBs. Available methods include the following: The binding may be expressed by tagging the involved objects in both LFBs with the same unique, but otherwise arbitrary, identifier. The value of the tag is explicitly configured by the CE by writing the value into both LFBs, and this value is also carried by the metadata Halpern & Deleganes Expires April 9, 2008 [Page 27] Internet-Draft ForCES FE Model October 2007 between the LFBs. Another way of setting up binding relations is to use a naturally occurring unique identifier of the consumer's object as a reference and as a value of the metadata (e.g., the array index of a table entry). In this case, the index is either read or inferred by the CE by communicating with the consumer LFB. Once the CE obtains the index, it needs to write it into the producer LFB to establish the binding. Important characteristics of the binding usage of metadata are: o The value of the metadata shows up in the CE-FE communication for both the consumer and the producer. That is, the metadata value MUST be carried over the ForCES protocol. Using the tagging technique, the value is written to both LFBs. Using the other technique, the value is written to only the producer LFB and may be READ from the consumer LFB. o The metadata value is irrelevant to the CE, the binding is simply expressed by using the same value at the consumer and producer LFBs. o Hence the metadata definition is not required to include value assignments. The only exception is when some special value(s) of the metadata must be reserved to convey special events. Even though these special cases must be defined with the metadata specification, their encoded values can be selected arbitrarily. For example, for the Prefix Lookup LFB example, a special value may be reserved to signal the NO-MATCH case, and the value of zero may be assigned for this purpose. The second class of metadata is the enumerated type. An example is the "Color" metadata that is produced by a Meter LFB. As the name suggests, enumerated metadata has a relatively small number of possible values, each with a specific meaning. All possible cases must be enumerated when defining this class of metadata. Although a value encoding must be included in the specification, the actual values can be selected arbitrarily (e.g., and would be both valid encodings, what is important is that an encoding is specified). The value of the enumerated metadata may or may not be conveyed via the ForCES protocol between the CE and FE. The third class of metadata is the explicit type. This refers to cases where the metadata value is explicitly used by the consumer LFB to change some packet header fields. In other words, the value has a Halpern & Deleganes Expires April 9, 2008 [Page 28] Internet-Draft ForCES FE Model October 2007 direct and explicit impact on some field and will be visible externally when the packet leaves the NE. Examples are: TTL increment given to a Header Modifier LFB, and DSCP value for a Remarker LFB. For explicit metadata, the value encoding MUST be explicitly provided in the metadata definition. The values cannot be selected arbitrarily and should conform to what is commonly expected. For example, a TTL increment metadata should be encoded as zero for the no increment case, one for the single increment case, etc. A DSCP metadata should use 0 to encode DSCP=0, 1 to encode DSCP=1, etc. 3.2.5. LFB Events During operation, various conditions may occur that can be detected by LFBs. Examples range from link failure or restart to timer expiration in special purpose LFBs. The CE may wish to be notified of the occurrence of such events. The PL protocol provides for such notifications. The LFB definition includes the necessary declarations of events. The declarations include identifiers necessary for subscribing to events (so that the CE can indicate to the FE which events it wishes to receive) and to indicate in event notification messages which event is being reported. The declaration of an event defines a condition that an FE can detect, and may report. From a conceptual point of view, event processing is split into triggering (the detection of the condition) and reporting (the generation of the notification of the event.) In between these two conceptual points there is event filtering. Properties associated with the event in the LFB instance can define filtering conditions to suppress the reporting of that event. The model thus describes event processing as if events always occur, and filtering may suppress reporting. Implementations may function in this manner, or may have more complex logic that eliminates some event processing if the reporting would be suppressed. Any implementation producing an effect equivalent to the model description is valid The reports with events are designed to allow for the common, closely related information that the CE can be strongly expected to need to react to the event. It is not intended to carry information the CE already has, nor large volumes of information, nor information related in complex fashions. 3.2.6. LFB Component Properties LFBs are made up of components, containing the information that the CE needs to see and / or change about the functioning of the LFB. These components, as described in detail elsewhere, may be basic values, complex structures (containing multiple components Halpern & Deleganes Expires April 9, 2008 [Page 29] Internet-Draft ForCES FE Model October 2007 themselves, each of which can be values, structures, or tables), or tables (which contain values, structures or tables.) Some of these components are optional. Some components may be readable or writeable at the discretion of the FE implementation. The CE needs to know these properties. Additionally, certain kinds of components (arrays / tables, aliases, and events as of this writing) have additional property information that the CE may need to read or write. This model defines the structure of the property information for all defined data types. 3.2.7. LFB Versioning LFB class versioning is a method to enable incremental evolution of LFB classes. In general, an FE is not allowed to contain an LFB instance for more than one version of a particular class. Inheritance (discussed next in Section 3.2.6) has special rules. If an FE datapath model containing an LFB instance of a particular class C also simultaneously contains an LFB instance of a class C' inherited from class C; C could have a different version than C'. LFB class versioning is supported by requiring a version string in the class definition. CEs may support multiple versions of a particular LFB class to provide backward compatibility, but FEs MUST NOT support more than one version of a particular class. Versioning is not restricted to making backwards compatible changes. It is specifically expected to be used to make changes that cannot be represented by inheritance. Often this will be to correct errors, and hence may not be backwards compatible. It may also be used to remove components which are not considered useful (particularly if they were previously mandatory, and hence were an implementation impediment.) 3.2.8. LFB Inheritance LFB class inheritance is supported in the FE model as a method to define new LFB classes. This also allows FE vendors to add vendor- specific extensions to standardized LFBs. An LFB class specification MUST specify the base class and version number it inherits from (the default is the base LFB class). Multiple- inheritance is not allowed, however, to avoid unnecessary complexity. Inheritance should be used only when there is significant reuse of the base LFB class definition. A separate LFB class should be defined if little or no reuse is possible between the derived and the base LFB class. An interesting issue related to class inheritance is backward Halpern & Deleganes Expires April 9, 2008 [Page 30] Internet-Draft ForCES FE Model October 2007 compatibility between a descendant and an ancestor class. Consider the following hypothetical scenario where a standardized LFB class "L1" exists. Vendor A builds an FE that implements LFB "L1" and vendor B builds a CE that can recognize and operate on LFB "L1". Suppose that a new LFB class, "L2", is defined based on the existing "L1" class by extending its capabilities incrementally. Let us examine the FE backward compatibility issue by considering what would happen if vendor B upgrades its FE from "L1" to "L2" and vendor C's CE is not changed. The old L1-based CE can interoperate with the new L2-based FE if the derived LFB class "L2" is indeed backward compatible with the base class "L1". The reverse scenario is a much less problematic case, i.e., when CE vendor B upgrades to the new LFB class "L2", but the FE is not upgraded. Note that as long as the CE is capable of working with older LFB classes, this problem does not affect the model; hence we will use the term "backward compatibility" to refer to the first scenario concerning FE backward compatibility. Backward compatibility can be designed into the inheritance model by constraining LFB inheritance to require the derived class be a functional superset of the base class (i.e. the derived class can only add functions to the base class, but not remove functions). Additionally, the following mechanisms are required to support FE backward compatibility: 1. When detecting an LFB instance of an LFB type that is unknown to the CE, the CE MUST be able to query the base class of such an LFB from the FE. 2. The LFB instance on the FE SHOULD support a backward compatibility mode (meaning the LFB instance reverts itself back to the base class instance), and the CE SHOULD be able to configure the LFB to run in such a mode. 3.3. FE Datapath Modeling Packets coming into the FE from ingress ports generally flow through multiple LFBs before leaving out of the egress ports. How an FE treats a packet depends on many factors, such as type of the packet (e.g., IPv4, IPv6 or MPLS), actual header values, time of arrival, etc. The result of LFB processing may have an impact on how the packet is to be treated in downstream LFBs. This differentiation of packet treatment downstream can be conceptualized as having alternative datapaths in the FE. For example, the result of a 6- tuple classification performed by a classifier LFB could control which rate meter is applied to the packet by a rate meter LFB in a later stage in the datapath. Halpern & Deleganes Expires April 9, 2008 [Page 31] Internet-Draft ForCES FE Model October 2007 LFB topology is a directed graph representation of the logical datapaths within an FE, with the nodes representing the LFB instances and the directed link depicting the packet flow direction from one LFB to the next. Section 3.3.1 discusses how the FE datapaths can be modeled as LFB topology; while Section 3.3.2 focuses on issues related to LFB topology reconfiguration. 3.3.1. Alternative Approaches for Modeling FE Datapaths There are two basic ways to express the differentiation in packet treatment within an FE, one represents the datapath directly and graphically (topological approach) and the other utilizes metadata (the encoded state approach). o Topological Approach Using this approach, differential packet treatment is expressed by splitting the LFB topology into alternative paths. In other words, if the result of an LFB operation controls how the packet is further processed, then such an LFB will have separate output ports, one for each alternative treatment, connected to separate sub-graphs, each expressing the respective treatment downstream. o Encoded State Approach An alternate way of expressing differential treatment is by using metadata. The result of the operation of an LFB can be encoded in a metadata, which is passed along with the packet to downstream LFBs. A downstream LFB, in turn, can use the metadata and its value (e.g., as an index into some table) to determine how to treat the packet. Theoretically, either approach could substitute for the other, so one could consider using a single pure approach to describe all datapaths in an FE. However, neither model by itself results in the best representation for all practically relevant cases. For a given FE with certain logical datapaths, applying the two different modeling approaches will result in very different looking LFB topology graphs. A model using only the topological approach may require a very large graph with many links or paths, and nodes (i.e., LFB instances) to express all alternative datapaths. On the other hand, a model using only the encoded state model would be restricted to a string of LFBs, which is not an intuitive way to describe different datapaths (such as MPLS and IPv4). Therefore, a mix of these two approaches will likely be used for a practical model. In fact, as we illustrate below, the two approaches can be mixed even within the same LFB. Using a simple example of a classifier with N classification outputs followed by other LFBs, Figure 5(a) shows what the LFB topology looks Halpern & Deleganes Expires April 9, 2008 [Page 32] Internet-Draft ForCES FE Model October 2007 like when using the pure topological approach. Each output from the classifier goes to one of the N LFBs where no metadata is needed. The topological approach is simple, straightforward and graphically intuitive. However, if N is large and the N nodes following the classifier (LFB#1, LFB#2, ..., LFB#N) all belong to the same LFB type (e.g., meter), but each has its own independent components, the encoded state approach gives a much simpler topology representation, as shown in Figure 5(b). The encoded state approach requires that a table of N rows of meter components is provided in the Meter node itself, with each row representing the attributes for one meter instance. A metadata M is also needed to pass along with the packet P from the classifier to the meter, so that the meter can use M as a look-up key (index) to find the corresponding row of the attributes that should be used for any particular packet P. What if those N nodes (LFB#1, LFB#2, ..., LFB#N) are not of the same type? For example, if LFB#1 is a queue while the rest are all meters, what is the best way to represent such datapaths? While it is still possible to use either the pure topological approach or the pure encoded state approach, the natural combination of the two appears to be the best option. Figure 5(c) depicts two different functional datapaths using the topological approach while leaving the N-1 meter instances distinguished by metadata only, as shown in Figure 5(c). Halpern & Deleganes Expires April 9, 2008 [Page 33] Internet-Draft ForCES FE Model October 2007 +----------+ P | LFB#1 | +--------->|(Compon-1)| +-------------+ | +----------+ | 1|------+ P +----------+ | 2|---------------->| LFB#2 | | classifier 3| |(Compon-2)| | ...|... +----------+ | N|------+ ... +-------------+ | P +----------+ +--------->| LFB#N | |(Compon-N)| +----------+ 5(a) Using pure topological approach +-------------+ +-------------+ | 1| | Meter | | 2| (P, M) | (Compon-1) | | 3|---------------->| (Compon-2) | | ...| | ... | | N| | (Compon-N) | +-------------+ +-------------+ 5(b) Using pure encoded state approach to represent the LFB topology in 5(a), if LFB#1, LFB#2, ..., and LFB#N are of the same type (e.g., meter). +-------------+ +-------------+ (P, M) | queue | | 1|------------->| (Compon-1) | | 2| +-------------+ | 3| (P, M) +-------------+ | ...|------------->| Meter | | N| | (Compon-2) | +-------------+ | ... | | (Compon-N) | +-------------+ 5(c) Using a combination of the two, if LFB#1, LFB#2, ..., and LFB#N are of different types (e.g., queue and meter). Figure 5: An example of how to model FE datapaths From this example, we demonstrate that each approach has a distinct advantage depending on the situation. Using the encoded state approach, fewer connections are typically needed between a fan-out node and its next LFB instances of the same type because each packet Halpern & Deleganes Expires April 9, 2008 [Page 34] Internet-Draft ForCES FE Model October 2007 carries metadata the following nodes can interpret and hence invoke a different packet treatment. For those cases, a pure topological approach forces one to build elaborate graphs with many more connections and often results in an unwieldy graph. On the other hand, a topological approach is the most intuitive for representing functionally different datapaths. For complex topologies, a combination of the two is the most flexible. A general design guideline is provided to indicate which approach is best used for a particular situation. The topological approach should primarily be used when the packet datapath forks to distinct LFB classes (not just distinct parameterizations of the same LFB class), and when the fan-outs do not require changes, such as adding/removing LFB outputs, or require only very infrequent changes. Configuration information that needs to change frequently should be expressed by using the internal attributes of one or more LFBs (and hence using the encoded state approach). +---------------------------------------------+ | | +----------+ V +----------+ +------+ | | | | | |if IP-in-IP| | | ---->| ingress |->+----->|classifier|---------->|Decap.|---->---+ | ports | | |---+ | | +----------+ +----------+ |others +------+ | V (a) The LFB topology with a logical loop +-------+ +-----------+ +------+ +-----------+ | | | |if IP-in-IP | | | | --->|ingress|-->|classifier1|----------->|Decap.|-->+classifier2|-> | ports | | |----+ | | | | +-------+ +-----------+ |others +------+ +-----------+ | V The LFB topology without the loop utilizing two independent classifier instances. Figure 6: An LFB topology example. It is important to point out that the LFB topology described here is Halpern & Deleganes Expires April 9, 2008 [Page 35] Internet-Draft ForCES FE Model October 2007 the logical topology, not the physical topology of how the FE hardware is actually laid out. Nevertheless, the actual implementation may still influence how the functionality is mapped to the LFB topology. Figure 6 shows one simple FE example. In this example, an IP-in-IP packet from an IPSec application like VPN may go to the classifier first and have the classification done based on the outer IP header; upon being classified as an IP-in-IP packet, the packet is then sent to a decapsulator to strip off the outer IP header, followed by a classifier again to perform classification on the inner IP header. If the same classifier hardware or software is used for both outer and inner IP header classification with the same set of filtering rules, a logical loop is naturally present in the LFB topology, as shown in Figure 6(a). However, if the classification is implemented by two different pieces of hardware or software with different filters (i.e., one set of filters for the outer IP header and another set for the inner IP header), then it is more natural to model them as two different instances of classifier LFB, as shown in Figure 6(b). To distinguish between multiple instances of the same LFB class, each LFB instance has its own LFB instance ID. One way to encode the LFB instance ID is to encode it as x.y where x is the LFB class ID and y is the instance ID within each LFB class. 3.3.2. Configuring the LFB Topology While there is little doubt that an individual LFB must be configurable, the configurability question is more complicated for LFB topology. Since the LFB topology is really the graphic representation of the datapaths within an FE, configuring the LFB topology means dynamically changing the datapaths, including changing the LFBs along the datapaths on an FE (e.g., creating, instantiating or deleting LFBs) and setting up or deleting interconnections between outputs of upstream LFBs to inputs of downstream LFBs. Why would the datapaths on an FE ever change dynamically? The datapaths on an FE are set up by the CE to provide certain data plane services (e.g., DiffServ, VPN, etc.) to the Network Element's (NE) customers. The purpose of reconfiguring the datapaths is to enable the CE to customize the services the NE is delivering at run time. The CE needs to change the datapaths when the service requirements change, such as adding a new customer or when an existing customer changes their service. However, note that not all datapath changes result in changes in the LFB topology graph. Changes in the graph are dependent on the approach used to map the datapaths into LFB topology. As discussed in 3.3.1, the topological approach and encoded state approach can result in very different looking LFB Halpern & Deleganes Expires April 9, 2008 [Page 36] Internet-Draft ForCES FE Model October 2007 topologies for the same datapaths. In general, an LFB topology based on a pure topological approach is likely to experience more frequent topology reconfiguration than one based on an encoded state approach. However, even an LFB topology based entirely on an encoded state approach may have to change the topology at times, for example, to bypass some LFBs or insert new LFBs. Since a mix of these two approaches is used to model the datapaths, LFB topology reconfiguration is considered an important aspect of the FE model. We want to point out that allowing a configurable LFB topology in the FE model does not mandate that all FEs are required to have this capability. Even if an FE supports configurable LFB topology, the FE may impose limitations on what can actually be configured. Performance-optimized hardware implementations may have zero or very limited configurability, while FE implementations running on network processors may provide more flexibility and configurability. It is entirely up to the FE designers to decide whether or not the FE actually implements reconfiguration and if so, how much. Whether a simple runtime switch is used to enable or disable (i.e., bypass) certain LFBs, or more flexible software reconfiguration is used, is implementation detail internal to the FE and outside of the scope of FE model. In either case, the CE(s) MUST be able to learn the FE's configuration capabilities. Therefore, the FE model MUST provide a mechanism for describing the LFB topology configuration capabilities of an FE. These capabilities may include (see Section 5 for full details): o Which LFB classes the FE can instantiate o Maximum number of instances of the same LFB class that can be created o Any topological limitations, For example: * The maximum number of instances of the same class or any class that can be created on any given branch of the graph * Ordering restrictions on LFBs (e.g., any instance of LFB class A must be always downstream of any instance of LFB class B). Note that even when the CE is allowed to configure LFB topology for the FE, the CE is not expected to be able to interpret an arbitrary LFB topology and determine which specific service or application (e.g. VPN, DiffServ, etc.) is supported by the FE. However, once the CE understands the coarse capability of an FE, the CE MUST configure the LFB topology to implement the network service the NE is supposed to provide. Thus, the mapping the CE has to understand is from the high level NE service to a specific LFB topology, not the Halpern & Deleganes Expires April 9, 2008 [Page 37] Internet-Draft ForCES FE Model October 2007 other way around. The CE is not expected to have the ultimate intelligence to translate any high level service policy into the configuration data for the FEs. However, it is conceivable that within a given network service domain, a certain amount of intelligence can be programmed into the CE to give the CE a general understanding of the LFBs involved to allow the translation from a high level service policy to the low level FE configuration to be done automatically. Note that this is considered an implementation issue internal to the control plane and outside the scope of the FE model. Therefore, it is not discussed any further in this draft. +----------+ +-----------+ ---->| Ingress |---->|classifier |--------------+ | | |chip | | +----------+ +-----------+ | v +-------------------------------------------+ +--------+ | Network Processor | <----| Egress | | +------+ +------+ +-------+ | +--------+ | |Meter | |Marker| |Dropper| | ^ | +------+ +------+ +-------+ | | | | +----------+-------+ | | | | | +---------+ +---------+ +------+ +---------+ | | |Forwarder|<------|Scheduler|<--|Queue | |Counter | | | +---------+ +---------+ +------+ +---------+ | |--------------------------------------------------------------+ (a) The Capability of the FE, reported to the CE +-----+ +-------+ +---+ | A|--->|Queue1 |--------------------->| | ------>| | +-------+ | | +---+ | | | | | | | | +-------+ +-------+ | | | | | B|--->|Meter1 |----->|Queue2 |------>| |->| | | | | | +-------+ | | | | | | | |--+ | | | | +-----+ +-------+ | +-------+ | | +---+ classifier +-->|Dropper| | | IPv4 +-------+ +---+ Fwd. Scheduler (b) One LFB topology as configured by the CE and accepted by the FE Halpern & Deleganes Expires April 9, 2008 [Page 38] Internet-Draft ForCES FE Model October 2007 Queue1 +---+ +--+ | A|------------------->| |--+ +->| | | | | | | B|--+ +--+ +--+ +--+ | | +---+ | | | | | | | Meter1 +->| |-->| | | | | | | | | | +--+ +--+ | Ipv4 | Counter1 Dropper1 Queue2| +--+ Fwd. +---+ | +--+ +--->|A | +-+ | A|---+ | |------>|B | | | ------>| B|------------------------------>| | +--->|C |->| |-> | C|---+ +--+ | +->|D | | | | D|-+ | | | +--+ +-+ +---+ | | +---+ Queue3| | Scheduler Classifier1 | | | A|------------> +--+ | | | +->| | | |--+ | | | B|--+ +--+ +-------->| | | | +---+ | | | | +--+ | | Meter2 +->| |-+ | | | | | | +--+ Queue4 | | Marker1 +--+ | +---------------------------->| |----+ | | +--+ (c) Another LFB topology as configured by the CE and accepted by the FE Figure 7: An example of configuring LFB topology Figure 7 shows an example where a QoS-enabled router has several line cards that have a few ingress ports and egress ports, a specialized classification chip, a network processor containing codes for FE blocks like meter, marker, dropper, counter, queue, scheduler and Ipv4 forwarder. Some of the LFB topology is already fixed and has to remain static due to the physical layout of the line cards. For example, all of the ingress ports might be hard- wired into the classification chip so all packets flow from the ingress port into the classification engine. On the other hand, the LFBs on the network processor and their execution order are programmable. However, certain capacity limits and linkage constraints could exist between these LFBs. Examples of the capacity limits might be: 8 meters; 16 queues in one FE; the scheduler can handle at most up to 16 queues; etc. The linkage constraints might dictate that the classification engine may be followed by a meter, marker, dropper, Halpern & Deleganes Expires April 9, 2008 [Page 39] Internet-Draft ForCES FE Model October 2007 counter, queue or IPv4 forwarder, but not a scheduler; queues can only be followed by a scheduler; a scheduler must be followed by the IPv4 forwarder; the last LFB in the datapath before going into the egress ports must be the IPv4 forwarder, etc. Once the FE reports these capabilities and capacity limits to the CE, it is now up to the CE to translate the QoS policy into a desirable configuration for the FE. Figure 7(a) depicts the FE capability while 7(b) and 7(c) depict two different topologies that the CE may request the FE to configure. Note that both the ingress and egress are omitted in (b) and (c) to simplify the representation. The topology in 7(c) is considerably more complex than 7(b) but both are feasible within the FE capabilities, and so the FE should accept either configuration request from the CE. 4. Model and Schema for LFB Classes The main goal of the FE model is to provide an abstract, generic, modular, implementation-independent representation of the FEs. This is facilitated using the concept of LFBs, which are instantiated from LFB classes. LFB classes and associated definitions will be provided in a collection of XML documents. The collection of these XML documents is called a LFB class library, and each document is called an LFB class library document (or library document, for short). Each of the library documents will conform to the schema presented in this section. The root element of the library document is the element. It is not expected that library documents will be exchanged between FEs and CEs "over-the-wire". But the model will serve as an important reference for the design and development of the CEs (software) and FEs (mostly the software part). It will also serve as a design input when specifying the ForCES protocol elements for CE-FE communication. 4.1. Namespace A namespace is needed to uniquely identify the LFB type in the LFB class library. The reference to the namespace definition is contained in Section 9, IANA Considerations. 4.2. Element The for the frame declarations; o for defining common data types; o for defining metadata, and o for defining LFB classes. Each element is optional, that is, one library document may contain only metadata definitions, another may contain only LFB class definitions, yet another may contain all of the above. In addition to the above main elements, a library document can import other library documents if it needs to refer to definitions contained in the included document. This concept is similar to the "#include" directive in C. Importing is expressed by the use of elements, which must precede all the above elements in the document. For unique referencing, each LFBLibrary instance document has a unique label defined in the "provide" attribute of the LFBLibrary element. The element also includes an optional element, which can be used to provide textual description about the library document. The following is a skeleton of a library document: Halpern & Deleganes Expires April 9, 2008 [Page 41] Internet-Draft ForCES FE Model October 2007 ... ... ... ... 4.3. Element This element is used to refer to another LFB library document. Similar to the "#include" directive in C, this makes the objects (metadata types, data types, etc.) defined in the referred library document available for referencing in the current document. The load element MUST contain the label of the library document to be included and may contain a URL to specify where the library can be retrieved. The load element can be repeated unlimited times. Three examples for the elements: Halpern & Deleganes Expires April 9, 2008 [Page 42] Internet-Draft ForCES FE Model October 2007 4.4. Element for Frame Type Declarations Frame names are used in the LFB definition to define the types of frames the LFB expects at its input port(s) and emits at its output port(s). The optional element in the library document contains one or more elements, each declaring one frame type. Each frame definition MUST contain a unique name (NMTOKEN) and a brief synopsis. In addition, an optional detailed description may be provided. Uniqueness of frame types MUST be ensured among frame types defined in the same library document and in all directly or indirectly included library documents. The following example defines two frame types: ipv4 IPv4 packet This frame type refers to an IPv4 packet. ipv6 IPv6 packet This frame type refers to an IPv6 packet. ... 4.5. Element for Data Type Definitions The (optional) element can be used to define commonly used data types. It contains one or more elements, each defining a data type with a unique name. Such data types can be used in several places in the library documents, including: Halpern & Deleganes Expires April 9, 2008 [Page 43] Internet-Draft ForCES FE Model October 2007 o Defining other data types o Defining attributes of LFB classes This is similar to the concept of having a common header file for shared data types. Each element MUST contain a unique name (NMTOKEN), a brief synopsis, an optional longer description, and a type definition element. The name MUST be unique among all data types defined in the same library document and in any directly or indirectly included library documents. For example: ieeemacaddr 48-bit IEEE MAC address ... type definition ... ipv4addr IPv4 address ... type definition ... ... There are two kinds of data types: atomic and compound. Atomic data types are appropriate for single-value variables (e.g. integer, string, byte array). The following built-in atomic data types are provided, but additional atomic data types can be defined with the and elements: Halpern & Deleganes Expires April 9, 2008 [Page 44] Internet-Draft ForCES FE Model October 2007 Meaning ---- ------- char 8-bit signed integer uchar 8-bit unsigned integer int16 16-bit signed integer uint16 16-bit unsigned integer int32 32-bit signed integer uint32 32-bit unsigned integer int64 64-bit signed integer uint64 64-bit unsigned integer boolean A true / false value where 0 = false, 1 = true string[N] A UTF-8 string represented in at most N Octets. string A UTF-8 string without a configured storage length limit. byte[N] A byte array of N bytes octetstring[N] A buffer of N octets, which may contain fewer than N octets. Hence the encoded value will always have a length. float16 16-bit floating point number float32 32-bit IEEE floating point number float64 64-bit IEEE floating point number These built-in data types can be readily used to define metadata or LFB attributes, but can also be used as building blocks when defining new data types. The boolean data type is defined here because it is so common, even though it can be built by sub-ranging the uchar data type. Compound data types can build on atomic data types and other compound data types. Compound data types can be defined in one of four ways. They may be defined as an array of components of some compound or atomic data type. They may be a structure of named components of compound or atomic data types (ala C structures). They may be a union of named components of compound or atomic data types (ala C unions). They may also be defined as augmentations (explained below in 4.5.6) of existing compound data types. Given that the FORCES protocol will be getting and setting component values, all atomic data types used here must be able to be conveyed in the FORCES protocol. Further, the FORCES protocol will need a mechanism to convey compound data types. However, the details of such representations are for the protocol document to define, not the model document. Strings and octetstrings must be conveyed with their length, as they are not delimited, and are variable length. Halpern & Deleganes Expires April 9, 2008 [Page 45] Internet-Draft ForCES FE Model October 2007 With regard to strings, this model defines a small set of restrictions and definitions on how they are structured. String and octetstring length limits can be specified in the LFB Class definitions. The component properties for string and octetstring components also contain actual lengths and length limits. This duplication of limits is to allow for implementations with smaller limits than the maximum limits specified in the LFB Class definition. In all cases, these lengths are specified in octets, not in characters. In terms of protocol operation, as long as the specified length is within the FE's supported capabilities, the FE stores the contents of a string exactly as provided by the CE, and returns those contents when requested. No canonicalization, transformations, or equivalences are performed by the FE. components of type string (or string[n]) may be used to hold identifiers for correlation with components in other LFBs. In such cases, an exact octet for octet match is used. No equivalences are used by the FE or CE in performing that matching. The ForCES protocol does not perform or require validation of the content of UTF-8 strings. However, UTF-8 strings SHOULD be encoded in the shortest form to avoid potential security issues described in [12]. Any entity displaying such strings is expected to perform its own validation (for example for correct multi-byte characters, and for ensuring that the string does not end in the middle of a multi-byte sequence.) Specific LFB class definitions may restrict the valid contents of a string as suited to the particular usage (for example, a component that holds a DNS name would be restricted to hold only octets valid in such a name.) FEs should validate the contents of SET requests for such restricted components at the time the set is performed, just as range checks for range limited components are performed. The ForCES protocol behavior defines the normative processing for requests using that protocol. For the definition of the actual type in the element, the following elements are available: , , , , and . The predefined type alias is somewhere between the atomic and compound data types. It behaves like a structure, one component of which has special behavior. Given that the special behavior is tied to the other parts of the structure, the compound result is treated as a predefined construct. 4.5.1. Element for Aliasing Existing Data Types The element refers to an existing data type by its name. The referred data type MUST be defined either in the same library document, or in one of the included library documents. If the referred data type is an atomic data type, the newly defined type will also be regarded as atomic. If the referred data type is a Halpern & Deleganes Expires April 9, 2008 [Page 46] Internet-Draft ForCES FE Model October 2007 compound type, the new type will also be compound. Some usage examples follow: short Alias to int16 int16 ieeemacaddr 48-bit IEEE MAC address byte[6] 4.5.2. Element for Deriving New Atomic Types The element allows the definition of a new atomic type from an existing atomic type, applying range restrictions and/or providing special enumerated values. Note that the element can only use atomic types as base types, and its result MUST be another atomic type. For example, the following snippet defines a new "dscp" data type: dscp Diffserv code point. uchar DSCP-BE Best Effort ... 4.5.3. Element to Define Arrays The element can be used to create a new compound data type as an array of a compound or an atomic data type. Depending upon context, this document, and others, refer to such arrays as tables or arrays interchangeably, without semantic or syntactic implication. Halpern & Deleganes Expires April 9, 2008 [Page 47] Internet-Draft ForCES FE Model October 2007 The type of the array entry can be specified either by referring to an existing type (using the element) or defining an unnamed type inside the element using any of the , , , or elements. The array can be "fixed-size" or "variable-size", which is specified by the "type" attribute of the element. The default is "variable-size". For variable size arrays, an optional "max-length" attribute specifies the maximum allowed length. This attribute should be used to encode semantic limitations, not implementation limitations. The latter should be handled by capability attributes of LFB classes, and should never be included in data type array is regarded as of unlimited-size. For fixed-size arrays, a "length" attribute MUST be provided that specifies the constant size of the array. The result of this construct MUST always be a compound type, even if the array has a fixed size of 1. Arrays MUST only be subscripted by integers, and will be presumed to start with index 0. In addition to their subscripts, arrays may be declared to have content keys. Such a declaration has several effects: o Any declared key can be used in the ForCES protocol to select a component for operations (for details, see the protocol). o In any instance of the array, each declared key must be unique within that instance. No two components of an array may have the same values on all the fields which make up a key. Each key is declared with a keyID for use in the protocol, where the unique key is formed by combining one or more specified key fields. To support the case where an array of an atomic type with unique values can be referenced by those values, the key field identifier may be "*" (i.e., the array entry is the key). If the value type of the array is a structure or an array, then the key is one or more components of the value type, each identified by name. Since the field may be a component of the contained structure, a component of a component of a structure, or further nested, the field name is actually a concatenated sequence of component identifiers, separated by decimal points ("."). The syntax for key field identification is given following the array examples. The following example shows the definition of a fixed size array with a pre-defined data type as the array content type: Halpern & Deleganes Expires April 9, 2008 [Page 48] Internet-Draft ForCES FE Model October 2007 dscp-mapping-table A table of 64 DSCP values, used to re-map code space. dscp The following example defines a variable size array with an upper limit on its size: mac-alias-table A table with up to 8 IEEE MAC addresses ieeemacaddr The following example shows the definition of an array with a local (unnamed) content type definition: classification-table A table of classification rules and result opcodes. rule The rule to match classrule opcode The result code opcode In the above example, each entry of the array is a of two components ("rule" and "opcode"). Halpern & Deleganes Expires April 9, 2008 [Page 49] Internet-Draft ForCES FE Model October 2007 The following example shows a table of IP Prefix information that can be accessed by a multi-field content key on the IP Address and prefix length. This means that in any instance of this table, no two entries can have the same IP address and prefix length. ipPrefixInfo_table A table of information about known prefixes address-prefix the prefix being described ipv4Prefix source the protocol or process providing this information uint16 prefInfo the information we care about hypothetical-info-type address-prefix.ipv4addr address-prefix.prefixlen source Note that the keyField elements could also have been simply address- prefix and source, since all of the fields of address-prefix are being used. 4.5.3.1. Key Field References In order to use key declarations, one must refer to components that are potentially nested inside other components in the array. If there are nested arrays, one might even use an array element as a key (but great care would be needed to ensure uniqueness.) Halpern & Deleganes Expires April 9, 2008 [Page 50] Internet-Draft ForCES FE Model October 2007 The key is the combination of the values of each field declared in a keyField element. Therefore, the value of a keyField element MUST be a concatenated Sequence of field identifiers, separated by a "." (period) character. Whitespace is permitted and ignored. A valid string for a single field identifier within a keyField depends upon the current context. Initially, in an array key declaration, the context is the type of the array. Progressively, the context is whatever type is selected by the field identifiers processed so far in the current key field declaration. When the current context is an array, (e.g., when declaring a key for an array whose content is an array) then the only valid value for the field identifier is an explicit number. When the current context is a structure, the valid values for the field identifiers are the names of the components of the structure. In the special case of declaring a key for an array containing an atomic type, where that content is unique and is to be used as a key, the value "*" can be used as the single key field identifier. 4.5.4. Element to Define Structures A structure is comprised of a collection of data components. Each data components has a data type (either an atomic type or an existing compound type) and is assigned a name unique within the scope of the compound data type being defined. These serve the same function as "struct" in C, etc. The actual type of the component can be defined by referring to an existing type (using the element), or can be a locally defined (unnamed) type created by any of the , , , or elements. A structure definition is a series of component declarations. Each component carries a componentID for use by the ForCES protocol. In addition, the component declaration contains the name of the component, a synopsis, an optional description, an optional declaration that the component itself is optional, and the typeRef declaration that specifies the component type. For a dataTypeDef of a struct, the structure definition may be inherited from, and augment, a previously defined structured type. This is indicated by including the derivedFrom attribute on the struct declaration. Halpern & Deleganes Expires April 9, 2008 [Page 51] Internet-Draft ForCES FE Model October 2007 The result of this construct MUST be a compound type, even when the contains only one field. An example: ipv4prefix IPv4 prefix defined by an address and a prefix length address Address part ipv4addr prefixlen Prefix length part uchar 4.5.5. Element to Define Union Types Similar to the union declaration in C, this construct allows the definition of overlay types. Its format is identical to the element. The result of this construct MUST be a compound type, even when the union contains only one element. 4.5.6. Element It is sometimes necessary to have a component in an LFB or structure refer to information (a component) in other LFBs. The declaration creates the constructs for this. The content of an element MUST be a named type. Whatever component the alias references (whcih is determined by the alias component properties, as described below) that component must be of the same type as that declared for the alias. Thus, when the CE or FE dereferences the alias component, the type of the information returned is known. The Halpern & Deleganes Expires April 9, 2008 [Page 52] Internet-Draft ForCES FE Model October 2007 type can be a base type or a derived type. The actual value referenced by an alias is known as its target. When a GET or SET operation references the alias element, the value of the target is returned or replaced. Write access to an alias element is permitted if write access to both the alias and the target are permitted. The target of a component declared by an >alias> element is determined by it the components properties. Like all components, the properties MUST include the support / read / write permission for the alias. In addition, there are several fields (components) in the alias properties which define the target of the alias. These components are the ID of the LFB class of the target, the ID of the LFB instance of the target, and a sequence of integers representing the path within the target LFB instance to the target component. The type of the target element must match the declared type of the alias. Details of the alias property structure are described in the section of this document on properties. Note that the read / write property of the alias refers to the value. The CE can only determine if it can write the target selection properties of the alias by attempting such a write operation. (Property components do not themselves have properties.) 4.5.7. Augmentationst Compound types can also be defined as augmentations of existing compound types. If the existing compound type is a structure, augmentation may add new elements to the type. The type of an existing component can be replaced in the definition of an augmenting structure, but only with an augmentation derived