Internet-Draft | LPWAN SCHC YANG module | May 2022 |
Minaburo & Toutain | Expires 7 November 2022 | [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 7 November 2022.¶
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:¶
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 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:¶
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, UDP, CoAP and OSCORE.¶
SCHC fragmentation requires a set of common parameters that are included in a rule. These parameters are defined in [RFC8724].¶
The YANG 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 3) shows how an identityref is created for RCS 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 model, each field MUST be identified through a global YANG identityref. A YANG field ID for the protocol always derives 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 7. The example Figure 4 gives the first field ID definitions. 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.¶
The type associated to this identity is fid-type (cf. Figure 5)¶
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 shown in Figure 6.¶
Therefore, the type for field length is a union between an integer giving in bits the size of the length and the identityref (cf. Figure 7).¶
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).¶
Figure 8 gives the identityref for Direction Indicators. The naming convention is "di" followed by the Direction Indicator name.¶
The type is "di-type" (cf. Figure 9).¶
The Target Value is a list of binary sequences of any length, aligned to the left. Figure 10 shows the definition of a single element of a Target Value. In the rule, the structure will be used as a list, with position as a key. The highest position value is used to compute the size of the index sent in residue for the match-mapping CDA. The position allows to specify several values:¶
Matching Operator (MO) is a function applied between a field value provided by the parsed header and the target value. [RFC8724] defines 4 MO as listed in Figure 11.¶
The naming convention is "mo" followed by the MO name.¶
The type is "mo-type" (cf. Figure 12)¶
They are viewed as a list, built with a tv-struct (see chapter Section 2.7).¶
Compression Decompression Action (CDA) identifies the function to use for compression or decompression. [RFC8724] defines 6 CDA.¶
Figure 14 shows some CDA definition, the full definition is in Section 7.¶
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:¶
Figure 15 shows the definition for identifiers from these three modes.¶
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. The SCHC header may be composed of (cf. Figure 16):¶
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 identity of the RCS algorithm is shown in Figure 17.¶
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 defined in Figure 18 allows to define the behavior:¶
The naming convention is "all1-data" followed by the behavior identifier.¶
The acknowledgment fragment header goes in the opposite direction of data. The header is composed of (see Figure 19):¶
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 following identifiers (cf. Figure 20) define the acknowledgment behavior.¶
The naming convention is "ack-behavior" followed by the algorithm name.¶
The state machine requires some common values to handle fragmentation:¶
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 (cf. Figure 22). An entry contains all the information defined in Figure 2 with the types defined above.¶
The compression rule described Figure 2 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 2. Their type reflects the identifier types defined in Section 2.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 2.10.¶
The definition of a Fragmentation rule is divided into three sub-parts:¶
grouping fragmentation-content { description "This grouping defines the fragmentation parameters for all the modes (No-Ack, Ack-Always and Ack-on-Error) specified in RFC 8724."; leaf fragmentation-mode { type schc:fragmentation-mode-type; mandatory true; description "which fragmentation mode is used (noAck, AckAlways, AckonError)"; } leaf l2-word-size { type uint8; default "8"; description "Size, in bits, of the layer 2 word"; } leaf direction { type schc:di-type; must "derived-from-or-self(., 'di-up') or derived-from-or-self(., 'di-down')" { error-message "direction for fragmentation rules are up or down."; } mandatory true; description "Should be up or down, bidirectionnal is forbiden."; } // SCHC Frag header format leaf dtag-size { type uint8; default "0"; description "Size, in bits, of the DTag field (T variable from RFC8724)."; } leaf w-size { when "derived-from(../fragmentation-mode, 'fragmentation-mode-ack-on-error') or derived-from(../fragmentation-mode, 'fragmentation-mode-ack-always') "; type uint8; description "Size, in bits, of the window field (M variable from RFC8724)."; } leaf fcn-size { type uint8; mandatory true; description "Size, in bits, of the FCN field (N variable from RFC8724)."; } leaf rcs-algorithm { type rcs-algorithm-type; default "schc:rcs-RFC8724"; description "Algorithm used for RCS. The algorithm specifies the RCS size"; } // SCHC fragmentation protocol parameters leaf maximum-packet-size { type uint16; default "1280"; description "When decompression is done, packet size must not strictly exceed this limit, expressed in bytes."; } leaf window-size { type uint16; description "By default, if not specified 2^w-size - 1. Should not exceed this value. Possible FCN values are between 0 and window-size - 1."; } leaf max-interleaved-frames { type uint8; default "1"; description "Maximum of simultaneously fragmented frames. Maximum value is 2^dtag-size. All DTAG values can be used, but at most max-interleaved-frames must be active at any time."; } leaf inactivity-timer { type uint64; description "Duration is seconds of the inactivity timer, 0 indicates that the timer is disabled."; } leaf retransmission-timer { when "derived-from(../fragmentation-mode, 'fragmentation-mode-ack-on-error') or derived-from(../fragmentation-mode, 'fragmentation-mode-ack-always') "; type uint64 { range "1..max"; } description "Duration in seconds of the retransmission timer."; } leaf max-ack-requests { when "derived-from(../fragmentation-mode, 'fragmentation-mode-ack-on-error') or derived-from(../fragmentation-mode, 'fragmentation-mode-ack-always') "; type uint8 { range "1..max"; } description "The maximum number of retries for a specific SCHC ACK."; } choice mode { case no-ack; case ack-always; case ack-on-error { leaf tile-size { when "derived-from(../fragmentation-mode, 'fragmentation-mode-ack-on-error')"; type uint8; description "Size, in bits, of tiles. If not specified or set to 0, tiles fill the fragment."; } leaf tile-in-All1 { when "derived-from(../fragmentation-mode, 'fragmentation-mode-ack-on-error')"; type schc:all1-data-type; description "Defines whether the sender and receiver expect a tile in All-1 fragments or not, or if it is left to the sender's choice."; } leaf ack-behavior { when "derived-from(../fragmentation-mode, 'fragmentation-mode-ack-on-error')"; type schc:ack-behavior-type; description "Sender behavior to acknowledge, after All-0, All-1 or when the LPWAN allows it."; } } description "RFC 8724 defines 3 fragmentation modes."; } }¶
This document has no request to IANA.¶
This document does not have any more Security consideration than the ones already raised in [RFC8724] and [RFC8824].¶
The authors would like to thank Dominique Barthel, Carsten Bormann, Alexander Pelov.¶