Internet-Draft | LPWAN SCHC YANG module | September 2021 |
Minaburo & Toutain | Expires 13 March 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 13 March 2022.¶
Copyright (c) 2021 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 Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified 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 this constrained network. Draft [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] specifies fields for IPv6, UDP, CoAP and OSCORE. [I-D.barthel-lpwan-oam-schc] describes ICMPv6 header compression and [I-D.ietf-lpwan-schc-compound-ack] includes a new fragmentation behavior.¶
SCHC fragmentation requires a set of common parameters that are included in a rule. These parameters are defined in [RFC8724].¶
[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 un 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 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 one and apply compression. The link between the list given by the parsed fields and the rules is done through a field ID. [RFC8724] do not state how the field ID value can be 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], and [I-D.barthel-lpwan-oam-schc].¶
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 3 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 4)¶
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 in byte and [RFC8824] defines the "tkl" function for managing the CoAP Token length field.¶
The naming convention is "fl" followed by the function name.¶
As for field ID, field length function can be defined as an identityref as shown in Figure 5.¶
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 6).¶
Field position is a positive integer which gives the position of a field, the default value is 1, but if the field is repeated several times, the value is higher. 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 7 gives the identityref for Direction Indicators. The naming convention is "di" followed by the Direction Indicator name.¶
The type is "direction-indicator-type" (cf. Figure 8).¶
The Target Value is a list of binary sequences of any length, aligned on the left. Figure 9 gives the definition of a single element of a Target Value. In the rule, this 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 LSB 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 10.¶
The naming convention is "mo" followed by the MO name.¶
The type is "matching-operator-type" (cf. Figure 11)¶
Some Matching Operator such as MSB can take some values. Even if currently LSB is the only MO takes only one argument, in the future some MO may require several arguments. They are viewed as a list of target-values-type.¶
Compression Decompression Action (CDA) identified the function to use either for compression or decompression. [RFC8724] defines 6 CDA.¶
Figure 13 gives 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 the future some CDA may require several arguments. They are viewed as a list of target-values-type.¶
Fragmentation is optional in the data model and depends on the presence of the "fragmentation" feature.¶
Most of parameters for fragmentation are defined in Annex D of [RFC8724].¶
Since fragmentation rules work for a specific direction, they contain a mandatory direction. The type is the same as the one used in compression entries, but the use of bidirectional is forbidden.¶
[RFC8724] defines 3 fragmentation modes:¶
Figure 14 give the definition for identifiers from these three modes.¶
The naming convention is "fragmentation-mode" followed by the fragmentation mode name.¶
A data fragment header, directly following the rule ID can be sent on the fragmentation direction. The direction is mandatory and must be up or down. bidirectional is forbidden. The SCHC header may be composed of (cf. Figure 15):¶
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 16.¶
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 17 allows to define the behavior:¶
The naming convention is "all1-data" followed by the behavior identifier.¶
A cknowledgment fragment header goes in the opposite direction of data. The header is composed of (see Figure 18):¶
NOTE: IN THE DATA MODEL THERE IS A max-window-size FIELD TO LIMIT THE BITMAP SIZE, BUT IS NO MORE IN RFC8724! DO WE KEEP IT?¶
For Ack-on-Error, SCHC defined when 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 at the end of the fragment (FCN All-1). The following identifiers (cf. Figure 19) define the acknowledgment behavior.¶
The naming convention is "ack-behavior" followed by the algorithm name.¶
For Ack-onError, [RFC8724] allows a single bitmap in an acknowledment fragment, and [I-D.ietf-lpwan-schc-compound-ack] proposes to acknowledge several windows on a single ack fragment. The following identifiers (cf. Figure 20) define the behavior.¶
The naming convention is "bitmap" 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 either a C/D or an F/R rule. A rule is identified by the rule ID value and its associated length. The YANG grouping rule-id-type defines the structure used to represent a rule ID. Length of 0 is allowed to represent an implicit rule.¶
Three types of rules are defined in [RFC8724]:¶
To access to a specific rule, rule-id and its specific length is used as a key. The rule is either a compression or a fragmentation rule.¶
Each context can be identified though a version id.¶
A compression rule is composed of entries describing its processing (cf. Figure 22). 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 2.1¶
Some controls are made 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 data model defines some relations between the entries:¶
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 l2-word-size { type uint8; default "8"; description "Size in bit of the layer 2 word"; } leaf direction { must "derived-from-or-self(., 'di-up') or derived-from-or-self(., 'di-down')" { error-message "direction for fragmentation rules is up or down"; } type schc:direction-indicator-type; mandatory true; description "Should be up or down, bi directionnal is forbiden."; } leaf dtag-size { type uint8; default "0"; description "Size in bit of the DTag field"; } leaf w-size { when "not(derived-from(../fragmentation-mode, 'fragmentation-mode-no-ack'))"; type uint8; description "Size in bit of the window field"; } leaf fcn-size { type uint8; mandatory true; description "Size in bit of the FCN field"; } leaf rcs-algorithm { type rcs-algorithm-type; default "schc:rcs-RFC8724"; description "Algorithm used for RCS"; } leaf maximum-window-size { type uint16; description "By default 2^wsize - 1"; } leaf retransmission-timer { type uint64 { range "1..max"; } description "Duration in seconds of the retransmission timer"; // Check the units } leaf inactivity-timer { type uint64; description "Duration is seconds of the inactivity timer, 0 indicates the timer is disabled"; // check units } leaf max-ack-requests { type uint8 { range "1..max"; } description "The maximum number of retries for a specific SCHC ACK."; } leaf maximum-packet-size { type uint16; default "1280"; description "When decompression is done, packet size must not strictly exceed this limit in Bytes"; } leaf fragmentation-mode { type schc:fragmentation-mode-type; mandatory true; description "Which fragmentation mode is used (noAck, AckAlways, AckonError)"; } choice mode { case no-ack; case ack-always; case ack-on-error { leaf tile-size { type uint8; when "derived-from(../fragmentation-mode, 'fragmentation-mode-ack-on-error')"; description "Size in bit of tiles, if not specified or set to 0: tile fills the fragment."; } leaf tile-in-All1 { type schc:all1-data-type; when "derived-from(../fragmentation-mode, 'fragmentation-mode-ack-on-error')"; description "When true, sender and receiver except a tile in All-1 frag"; } leaf ack-behavior { type schc:ack-behavior-type; when "derived-from(../fragmentation-mode, 'fragmentation-mode-ack-on-error')"; description "Sender behavior to acknowledge, after All-0, All-1 or when the LPWAN allows it (Always)"; } leaf bitmap-format { type schc:bitmap-format-type; when "derived-from(../fragmentation-mode, 'fragmentation-mode-ack-on-error')"; default "schc:bitmap-RFC8724"; description "How the bitmaps are included in the Ack message."; } } 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 on [RFC8724]¶
The authors would like to thank Dominique Barthel, Carsten Bormann, Alexander Pelov.¶