Internet-Draft | LPWAN SCHC YANG module | July 2022 |
Minaburo & Toutain | Expires 12 January 2023 | [Page] |
This document describes a YANG data model for the SCHC (Static Context Header Compression) compression and fragmentation rules.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
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."¶
This Internet-Draft will expire on 12 January 2023.¶
Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
SCHC is a compression and fragmentation mechanism for constrained networks defined in [RFC8724]. It is based on a static context shared by two entities at the boundary of the constrained network. [RFC8724] provides a non formal representation of the rules used either for compression/decompression (or C/D) or fragmentation/reassembly (or F/R). The goal of this document is to formalize the description of the rules to offer:¶
[I-D.ietf-lpwan-architecture] illustrates the exchange of rules using the YANG data model.¶
This document defines a YANG module [RFC7950] to represent both compression and fragmentation rules, which leads to common representation for values for all the rules elements.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This document defines a YANG module to represent both compression and fragmentation rules, which leads to common representation for values for all the rules elements.¶
SCHC compression is generic, the main mechanism does not refer to a specific protocol. Any header field is abstracted through an ID, a position, a direction, and a value that can be a numerical value or a string. [RFC8724] and [RFC8824] specify fields for IPv6 [RFC8200], UDP[RFC0768], CoAP [RFC7252] including options definied for no serveur response [RFC7967] and OSCORE [RFC8613]. For the latter [RFC8824] splits this field into sub-fields.¶
SCHC fragmentation requires a set of common parameters that are included in a rule. These parameters are defined in [RFC8724].¶
The YANG data model allows to select the compression or the fragmentation using the feature command.¶
[RFC8724] proposes a non formal representation of the compression rule. A compression context for a device is composed of a set of rules. Each rule contains information to describe a specific field in the header to be compressed.¶
Identifier used in the SCHC YANG data model are from the identityref statement to ensure to be globally unique and be easily augmented if needed. The principle to define a new type based on a group of identityref is the following:¶
The example (Figure 2) shows how an identityref is created for RCS (Reassembly Check Sequence) algorithms used during SCHC fragmentation.¶
In the process of compression, the headers of the original packet are first parsed to create a list of fields. This list of fields is matched against the rules to find the appropriate rule and apply compression. [RFC8724] does not state how the field ID value is constructed. In examples, identification is done through a string indexed by the protocol name (e.g. IPv6.version, CoAP.version,...).¶
The current YANG data model includes fields definitions found in [RFC8724], [RFC8824].¶
Using the YANG data model, each field MUST be identified through a global YANG identityref. A YANG field ID for the protocol is always derived from the fid-base-type. Then an identity for each protocol is specified using the naming convention fid-<<protocol name>>-base-type. All possible fields for this protocol MUST derive from the protocol identity. The naming convention is "fid" followed by the protocol name and the field name. If a field has to be divided into sub-fields, the field identity serves as a base.¶
The full field-id definition is found in Section 5. A type is defined for IPv6 protocol, and each field is based on it. Note that the DiffServ bits derives from the Traffic Class identity.¶
Field length is either an integer giving the size of a field in bits or a specific function. [RFC8724] defines the "var" function which allows variable length fields (whose length is expressed in bytes) and [RFC8824] defines the "tkl" function for managing the CoAP Token length field.¶
The naming convention is "fl" followed by the function name.¶
The field length function can be defined as an identityref as described in Section 5. Therefore, the type for field length is a union between an integer giving in bits the size of the length and the identityref.¶
Field position is a positive integer which gives the position of a field, the default value is 1, and incremented at each repetition. value 0 indicates that the position is not important and is not considered during the rule selection process.¶
Field position is a positive integer. The type is an uint8.¶
The Direction Indicator (di) is used to tell if a field appears in both direction (Bi) or only uplink (Up) or Downlink (Dw). The naming convention is "di" followed by the Direction Indicator name.¶
The type is "di-type".¶
The Target Value is a list of binary sequences of any length, aligned to the left. In the rule, the structure will be used as a list, with index as a key. The highest index value is used to compute the size of the index sent in residue for the match-mapping CDA (Compression Decompression Action). The index allows to specify several values:¶
If the header field contains a text, the binary sequence uses the same enconding.¶
Matching Operator (MO) is a function applied between a field value provided by the parsed header and the target value. [RFC8724] defines 4 MO.¶
The naming convention is "mo" followed by the MO name.¶
The type is "mo-type"¶
They are viewed as a list, built with a tv-struct (see chapter Section 3.7).¶
Compression Decompression Action (CDA) identifies the function to use for compression or decompression. [RFC8724] defines 6 CDA.¶
The naming convention is "cda" followed by the CDA name.¶
Currently no CDA requires arguments, but in the future some CDA may require one or several arguments. They are viewed as a list, of target-value type.¶
Fragmentation is optional in the data model and depends on the presence of the "fragmentation" feature.¶
Most of the fragmentation parameters are listed in Annex D of [RFC8724].¶
Since fragmentation rules work for a specific direction, they MUST contain a mandatory direction indicator. The type is the same as the one used in compression entries, but bidirectional MUST NOT be used.¶
[RFC8724] defines 3 fragmentation modes:¶
The type is "fragmentation-mode-type". The naming convention is "fragmentation-mode" followed by the fragmentation mode name.¶
A data fragment header, starting with the rule ID can be sent on the fragmentation direction. [RFC8724] indicates that the SCHC header may be composed of (cf. Figure 3):¶
The last fragment of a datagram is sent with an RCS (Reassembly Check Sequence) field to detect residual transmission error and possible losses in the last window. [RFC8724] defines a single algorithm based on Ethernet CRC computation.¶
The naming convention is "rcs" followed by the algorithm name.¶
For Ack-on-Error mode, the All-1 fragment may just contain the RCS or can include a tile. The parameters defines the behavior:¶
The naming convention is "all-1-data" followed by the behavior identifier.¶
The acknowledgment fragment header goes in the opposite direction of data. [RFC8724] defines the header, composed of (see Figure 4):¶
For Ack-on-Error, SCHC defines when an acknowledgment can be sent. This can be at any time defined by the layer 2, at the end of a window (FCN all-0) or as a response to receiving the last fragment (FCN all-1). The naming convention is "ack-behavior" followed by the algorithm name.¶
The state machine requires some common values to handle correctly fragmentation.¶
[RFC8724] do not specified any range for these timers. [RFC9011] recommends a duration of 12 hours. In fact, the value range sould be between milliseconds for real time systems to several days. To allow a large range of applications, two parameters must be specified:¶
The SCHC fragmentation protocol specifies the the number of attempts before aborting through the parameter:¶
The data model includes two parameters needed for fragmentation:¶
A rule is idenfied by a unique rule identifier (rule ID) comprising both a Rule ID value and a Rule ID length. The YANG grouping rule-id-type defines the structure used to represent a rule ID. A length of 0 is allowed to represent an implicit rule.¶
Three types of rules are defined in [RFC8724]:¶
To access a specific rule, the rule ID length and value are used as a key. The rule is either a compression or a fragmentation rule.¶
A compression rule is composed of entries describing its processing. An entry contains all the information defined in Figure 1 with the types defined above.¶
The compression rule described Figure 1 is defined by compression-content. It defines a list of compression-rule-entry, indexed by their field id, position and direction. The compression-rule-entry element represent a line of the table Figure 1. Their type reflects the identifier types defined in Section 3.1¶
Some checks are performed on the values:¶
A Fragmentation rule is composed of entries describing the protocol behavior. Some on them are numerical entries, others are identifiers defined in Section 3.10.¶
This section records the status of known implementations of the protocol defined by this specification at the time of posting of this Internet-Draft, and is based on a proposal described in [RFC7942]. The description of implementations in this section is intended to assist the IETF in its decision processes in progressing drafts to RFCs. Please note that the listing of any individual implementation here does not imply endorsement by the IETF. Furthermore, no effort has been spent to verify the information presented here that was supplied by IETF contributors. This is not intended as, and must not be construed to be, a catalog of available implementations or their features. Readers are advised to note that other implementations may exist.¶
According to [RFC7942], "this will allow reviewers and working groups to assign due consideration to documents that have the benefit of running code, which may serve as evidence of valuable experimentation and feedback that have made the implemented protocols more mature. It is up to the individual working groups to use this information as they see fit".¶
This document registers one URIs and one YANG modules.¶
The YANG module specified in this document defines a schema for data that is designed to be accessed via network management protocols such as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer is the secure transport layer, and the mandatory-to-implement secure transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure transport is TLS [RFC8446].¶
The Network Configuration Access Control Model (NACM) [RFC8341] provides the means to restrict access for particular NETCONF or RESTCONF users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content.¶
This data model formalizes the rules elements described in [RFC8724] for compression and fragmentation. As explained in the architecture document [I-D.ietf-lpwan-architecture], a rule can be read, created, updated or deleted in response to a management request. These actions can be done between two instances of SCHC or between a SCHC instance and a rule repository.¶
create (-------) read +=======+ * ( rules )<------->|Rule |<--|--------> (-------) update |Manager| NETCONF, RESTCONF or CORECONF . read delete +=======+ request . +-------+ <===| R & D |<=== ===>| C & F |===> +-------+¶
The rule contains some sensible informations such as the application IPv6 address. An attacker by changing a rule content may block the communication or intercept the traffic. Therefore, the identity of the requester must be validated. This can be done through certificates or access lists.¶
The full tree is sensitive, since it represents all the elements that can be managed. This module aims to be encapsulated into a YANG module including access right and identities.¶
The authors would like to thank Dominique Barthel, Carsten Bormann, Ivan Martinez, Alexander Pelov for their careful reading and valuable inputs. A special thanks for Carl Moberg, Tom Petch and Eric Vyncke for their explanations and wise advices when building the model.¶