A YANG Data Model for Static Context Header Compression (SCHC)
updated by
- rfc-9441 — Static Context Header Compression (SCHC) Compound Acknowledgement (ACK)
Extracted elements (27)
All identifiers in the SCHC YANG data model use the identityref statement rather than enumerations or strings. This ensures global uniqueness and allows easy augmentation by third parties without modifying the base module.
RFC 8724 provides only an informal representation of SCHC Rules; this document formalizes them as a YANG data model to ensure the same definition on both ends of a constrained network link and to enable one SCHC instance to update specific values (e.g., IPv6 prefix, destination address) in the other.
Timer values use a two-parameter encoding (tick-duration and tick-numbers) where the tick unit is 2^(tick-duration)/10^6 seconds. This design supports a range from microseconds (real-time systems) to multiple days (worse-than-best-effort systems) without requiring a large integer type.
The YANG data model described in RFC 9363 conforms to the Network Management Datastore Architecture (NMDA) defined in RFC 8342. Implementations accessing the ietf-schc module must support NMDA-compliant datastores.
Each header field used in a compression Rule MUST be identified through a global YANG identityref. Protocol-level Field IDs MUST derive from fid-base-type, and all fields for a specific protocol MUST derive from that protocol's base identity (e.g., fid-ipv6-base-type).
For match-mapping Matching Operator Target Values, index values MUST start from 0 and MUST be contiguous. The highest index value is used to compute the size of the index sent in the compression residue.
Fragmentation Rules MUST contain a mandatory Direction Indicator (up or down). Bidirectional MUST NOT be used for fragmentation Rules because fragmentation works for a specific direction only.
If the Retransmission Timer is specified, its ticks-numbers value MUST be strictly positive (range 1..max). The Inactivity Timer uses 0 to explicitly indicate that the timer is disabled.
In a compression-rule-entry, matching-operator values other than mo-ignore MUST have a target-value present; mo-msb additionally requires a matching-operator-value argument specifying the number of most significant bits to match. These constraints are enforced via YANG 'must' statements.
More than max-interleaved-frames DTag values MUST NOT be active simultaneously during fragmentation. The maximum value of max-interleaved-frames is 2^dtag-size.
A compression Rule entry (compression-rule-entry) contains seven elements: Field ID (fid-type), Field Length (union of uint8 or fl-type function), Field Position (uint8), Direction Indicator (di-type), Target Value list (indexed binary), Matching Operator (mo-type), and Compression/Decompression Action (cda-type). The entry is keyed by field-id, field-position, and direction-indicator.
The ack-behavior-type identity (ACK-on-Error mode only) specifies when an ACK can be sent: ack-behavior-after-all-0 (after sending an All-0 fragment), ack-behavior-after-all-1 (after the last fragment), or ack-behavior-by-layer2 (Layer 2 determines timing).
The last fragment of a datagram carries a Reassembly Check Sequence (RCS); the default algorithm is CRC32 (4 bytes, identity rcs-crc32). For ACK-on-Error, the All-1 fragment behavior is configurable as: all-1-data-no (RCS only), all-1-data-yes (one tile plus RCS), or all-1-data-sender-choice (sender decides).
The SCHC ACK header contains RuleID, optional DTag, mandatory window W, and a C bit indicating RCS validation success. On failure (C=0), a Compressed Bitmap follows indicating which tiles were received.
The SCHC data fragment header starts with RuleID followed by optional DTag (T bits), optional Window W (M bits, absent in No-ACK mode), and mandatory FCN (N bits). DTag identifies concurrent datagrams; FCN indicates fragment position within the window.
The YANG module declares two optional features: 'compression' (SCHC compression capabilities) and 'fragmentation' (SCHC fragmentation capabilities). Implementations can advertise which capabilities are supported, and the data model uses if-feature guards to make the corresponding rule types conditional.
Three fragmentation modes are defined: No-ACK (unidirectional, no acknowledgment sent back), ACK-Always (each fragmentation window must be explicitly acknowledged before proceeding), and ACK-on-Error (a window is acknowledged only when the receiver detects missing fragments).
Three Rule natures are defined: nature-compression (a compression Rule associated with a RuleID), nature-no-compression (the default passthrough Rule when no compression Rule matches), and nature-fragmentation (fragmentation parameters associated with a RuleID). A Rule must have exactly one nature.
IANA registered the YANG module 'ietf-schc' in the YANG Module Names registry (RFC 6020) with namespace 'urn:ietf:params:xml:ns:yang:ietf-schc', prefix 'schc', and reference RFC 9363.
IANA registered URI 'urn:ietf:params:xml:ns:yang:ietf-schc' in the IETF XML Registry (RFC 3688). This URI serves as the XML namespace for the ietf-schc YANG module.
Access to the ietf-schc YANG module via NETCONF requires mandatory-to-implement secure transport using SSH (RFC 6242); via RESTCONF it requires HTTPS with TLS (RFC 8446). The NACM model (RFC 8341) provides access control for NETCONF/RESTCONF users.
Read access to SCHC Rules (e.g., via NETCONF get or get-config) must be controlled because an attacker reading the module can infer traffic patterns, application addresses, and REST API structure of constrained devices. Access control on readable data nodes is therefore important.
The /schc data tree contains sensitive writable nodes, notably application IPv6 addresses. An attacker modifying another device's Rules could redirect traffic or enable eavesdropping. Therefore, a device MUST be allowed to modify only its own rules, with requester identity validated through certificates or access lists.
A RuleID is composed of rule-id-value (uint32) and rule-id-length (uint8, range 0..32 bits). The pair serves as a list key in the YANG model. A rule-id-length of 0 represents an implicit Rule.
Field Length (fl-type) is a union of uint8 (fixed size in bits) and identityref (function-based length). Defined functions include fl-variable (variable-length field, length in bytes as defined for CoAP) and fl-token-length (CoAP Token Length field).
Fragmentation header field sizes are expressed in bits: dtag-size (uint8, default 0), w-size (uint8, present only in ACK-Always and ACK-on-Error modes), fcn-size (uint8, mandatory). Layer 2 Word size is l2-word-size (uint8, default 8 bits = byte-aligned; value 1 means bit-oriented with no padding).
Target Value entries use a tv-struct with an index (uint16) and value (binary). For equal and MSB operators, a single element at index 0 is used; for match-mapping, multiple consecutive entries starting at index 0 are used, and the highest index determines residue index bit-width.