draft-ietf-lpwan-schc-yang-data-model-01.txt | draft-ietf-lpwan-schc-yang-data-model-02.txt | |||
---|---|---|---|---|
lpwan Working Group A. Minaburo | lpwan Working Group A. Minaburo | |||
Internet-Draft Acklio | Internet-Draft Acklio | |||
Intended status: Standards Track L. Toutain | Intended status: Standards Track L. Toutain | |||
Expires: July 26, 2020 Institut MINES TELECOM; IMT Atlantique | Expires: August 31, 2020 Institut MINES TELECOM; IMT Atlantique | |||
January 23, 2020 | February 28, 2020 | |||
Data Model for Static Context Header Compression (SCHC) | Data Model for Static Context Header Compression (SCHC) | |||
draft-ietf-lpwan-schc-yang-data-model-01 | draft-ietf-lpwan-schc-yang-data-model-02 | |||
Abstract | Abstract | |||
This document describes a YANG data model for the SCHC (Static | This document describes a YANG data model for the SCHC (Static | |||
Context Header Compression) compression and fragmentation rules. | Context Header Compression) compression and fragmentation rules. | |||
Status of This Memo | Status of This Memo | |||
This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
skipping to change at page 1, line 32 ¶ | skipping to change at page 1, line 32 ¶ | |||
Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
This Internet-Draft will expire on July 26, 2020. | This Internet-Draft will expire on August 31, 2020. | |||
Copyright Notice | Copyright Notice | |||
Copyright (c) 2020 IETF Trust and the persons identified as the | Copyright (c) 2020 IETF Trust and the persons identified as the | |||
document authors. All rights reserved. | document authors. All rights reserved. | |||
This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
(https://trustee.ietf.org/license-info) in effect on the date of | (https://trustee.ietf.org/license-info) in effect on the date of | |||
publication of this document. Please review these documents | publication of this document. Please review these documents | |||
skipping to change at page 2, line 22 ¶ | skipping to change at page 2, line 22 ¶ | |||
2.4. Field position . . . . . . . . . . . . . . . . . . . . . 7 | 2.4. Field position . . . . . . . . . . . . . . . . . . . . . 7 | |||
2.5. Direction Indicator . . . . . . . . . . . . . . . . . . . 7 | 2.5. Direction Indicator . . . . . . . . . . . . . . . . . . . 7 | |||
2.6. Target Value . . . . . . . . . . . . . . . . . . . . . . 8 | 2.6. Target Value . . . . . . . . . . . . . . . . . . . . . . 8 | |||
2.7. Matching Operator . . . . . . . . . . . . . . . . . . . . 9 | 2.7. Matching Operator . . . . . . . . . . . . . . . . . . . . 9 | |||
2.7.1. Matching Operator arguments . . . . . . . . . . . . . 10 | 2.7.1. Matching Operator arguments . . . . . . . . . . . . . 10 | |||
2.8. Compression Decompresison Actions . . . . . . . . . . . . 10 | 2.8. Compression Decompresison Actions . . . . . . . . . . . . 10 | |||
2.8.1. Compression Decompression Action arguments . . . . . 12 | 2.8.1. Compression Decompression Action arguments . . . . . 12 | |||
3. Rule definition . . . . . . . . . . . . . . . . . . . . . . . 12 | 3. Rule definition . . . . . . . . . . . . . . . . . . . . . . . 12 | |||
3.1. Compression rule . . . . . . . . . . . . . . . . . . . . 14 | 3.1. Compression rule . . . . . . . . . . . . . . . . . . . . 14 | |||
3.1.1. Compression context representation. . . . . . . . . . 14 | 3.1.1. Compression context representation. . . . . . . . . . 14 | |||
3.1.2. Rule definition . . . . . . . . . . . . . . . . . . . 16 | 3.1.2. Rule definition . . . . . . . . . . . . . . . . . . . 15 | |||
3.2. Fragmentation rule . . . . . . . . . . . . . . . . . . . 16 | 3.2. Fragmentation rule . . . . . . . . . . . . . . . . . . . 16 | |||
3.3. YANG Tree . . . . . . . . . . . . . . . . . . . . . . . . 17 | 3.3. YANG Tree . . . . . . . . . . . . . . . . . . . . . . . . 17 | |||
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 | 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 | |||
5. Security considerations . . . . . . . . . . . . . . . . . . . 17 | 5. Security considerations . . . . . . . . . . . . . . . . . . . 19 | |||
6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 18 | 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 19 | |||
7. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 18 | 7. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 19 | |||
8. Normative References . . . . . . . . . . . . . . . . . . . . 18 | 8. Normative References . . . . . . . . . . . . . . . . . . . . 33 | |||
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 | Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 33 | |||
1. Introduction | 1. Introduction | |||
2. SCHC rules | 2. SCHC rules | |||
SCHC is a compression and fragmentation mechanism for constrained | SCHC is a compression and fragmentation mechanism for constrained | |||
networks defined in [I-D.ietf-lpwan-ipv6-static-context-hc] it is | networks defined in [I-D.ietf-lpwan-ipv6-static-context-hc] it is | |||
based on a static context shared by two entities at the boundary this | based on a static context shared by two entities at the boundary this | |||
contrained network. Draft [I-D.ietf-lpwan-ipv6-static-context-hc] | contrained network. Draft [I-D.ietf-lpwan-ipv6-static-context-hc] | |||
provides an abstract representation of the rules used either for | provides an abstract representation of the rules used either for | |||
skipping to change at page 6, line 9 ¶ | skipping to change at page 6, line 9 ¶ | |||
Figure 2 gives an example of field ID identityref definitions. The | Figure 2 gives an example of field ID identityref definitions. The | |||
base identity is field-id-base-type, and field id are derived for it. | base identity is field-id-base-type, and field id are derived for it. | |||
The naming convention is "fid" followed by the protocol name and the | The naming convention is "fid" followed by the protocol name and the | |||
field name. | field name. | |||
The yang model in annex gives the full definition of the field ID for | The yang model in annex gives the full definition of the field ID for | |||
[I-D.ietf-lpwan-ipv6-static-context-hc] and | [I-D.ietf-lpwan-ipv6-static-context-hc] and | |||
[I-D.ietf-lpwan-coap-static-context-hc]. | [I-D.ietf-lpwan-coap-static-context-hc]. | |||
The type associated to this identity is field-id-type (cf. {{Fig-field-id-type}}) | The type associated to this identity is field-id-type (cf. Figure 3) | |||
typedef field-id-type { | typedef field-id-type { | |||
description "Field ID generic type."; | description "Field ID generic type."; | |||
type identityref { | type identityref { | |||
base field-id-base-type; | base field-id-base-type; | |||
} | } | |||
} | } | |||
Figure 3: Definition of indentityref for field IDs | Figure 3: Definition of indentityref for field IDs | |||
2.3. Field length | 2.3. Field length | |||
Field length is either an integer giving the size of a field in bits | Field length is either an integer giving the size of a field in bits | |||
or a function. [I-D.ietf-lpwan-ipv6-static-context-hc] defines the | or a function. [I-D.ietf-lpwan-ipv6-static-context-hc] defines the | |||
"var" function which allows variable length fields in byte and | "var" function which allows variable length fields in byte and | |||
[I-D.ietf-lpwan-coap-static-context-hc] defines the "tkl" function | [I-D.ietf-lpwan-coap-static-context-hc] defines the "tkl" function | |||
for managing the CoAP Token length field. | for managing the CoAP Token length field. | |||
skipping to change at page 15, line 5 ¶ | skipping to change at page 15, line 5 ¶ | |||
3.1.1. Compression context representation. | 3.1.1. Compression context representation. | |||
The compression rule described Figure 1 is associated to a rule ID. | The compression rule described Figure 1 is associated to a rule ID. | |||
The compression rule entry is defined in Figure 14. Each column in | The compression rule entry is defined in Figure 14. Each column in | |||
the table is either represented by a leaf or a list. Note that | the table is either represented by a leaf or a list. Note that | |||
Matching Operators and Compression Decompression actions can have | Matching Operators and Compression Decompression actions can have | |||
arguments. They are viewed a ordered list of strings and numbers as | arguments. They are viewed a ordered list of strings and numbers as | |||
in target values. | in target values. | |||
grouping compression-rule-entry { | grouping compression-rule-entry { | |||
leaf field-id { | leaf field-id { | |||
mandatory true; | mandatory true; | |||
type schc-id:field-id-type; | type schc-id:field-id-type; | |||
} | } | |||
leaf field-length { | leaf field-length { | |||
mandatory true; | mandatory true; | |||
type schc-id:field-length-type; | type schc-id:field-length-type; | |||
} | } | |||
leaf field-position { | leaf field-position { | |||
mandatory true; | mandatory true; | |||
type uint8; | type uint8; | |||
} | } | |||
leaf direction-indicator { | leaf direction-indicator { | |||
mandatory true; | mandatory true; | |||
type schc-id:direction-indicator-type; | type schc-id:direction-indicator-type; | |||
} | } | |||
list target-values { | list target-values { | |||
key position; | key position; | |||
uses target-values-struct; | ||||
uses target-values-struct; | } | |||
} | leaf mo { | |||
leaf mo { | mandatory true; | |||
mandatory true; | type schc-id:matching-operator-type; | |||
type schc-id:matching-operator-type; | } | |||
} | list mo-value { | |||
// /!\ Not always good, it allows to give several arguments to a MO, but | key position; | |||
// theses arguments are only int or strings, cannot be arrays. Is it necessary? | uses target-values-struct; | |||
list mo-value { | } | |||
key position; | leaf cda { | |||
uses target-values-struct; | mandatory true; | |||
} | type schc-id:comp-decomp-action-type; | |||
leaf cda { | } | |||
mandatory true; | list cda-value { | |||
type schc-id:cda-type; | key position; | |||
} | uses target-values-struct; | |||
list cda-value { | } | |||
key position; | } | |||
uses target-values-struct; | ||||
} | ||||
} | ||||
Figure 14: Definition of a compression entry | Figure 14: Definition of a compression entry | |||
3.1.2. Rule definition | 3.1.2. Rule definition | |||
A compression rule is a list of entries. | A compression rule is a list of entries. | |||
grouping compression-content { | grouping compression-content { | |||
list entry { | list entry { | |||
key "field-id field-position direction-indicator"; // field-position direction-indicator"; | key "field-id field-position direction-indicator"; | |||
uses compression-rule-entry; | uses compression-rule-entry; | |||
} | } | |||
} | } | |||
Figure 15: Definition of a compression rule | Figure 15: Definition of a compression rule | |||
To identify a specific entry Field ID, position and direction is | To identify a specific entry Field ID, position and direction are | |||
needed. | needed. | |||
3.2. Fragmentation rule | 3.2. Fragmentation rule | |||
TBD | Parameters for fragmentation are defined in Annex D of | |||
[I-D.ietf-lpwan-ipv6-static-context-hc]. Two new types are defined | ||||
for Ack on Error acknowlement behavior (ack-behavior-type) and the | ||||
RCS algorithm (RCS-algorithm-type). | ||||
grouping fragmentation-content { | grouping fragmentation-content { | |||
leaf dtagsize { | leaf direction { | |||
type uint8; | type schc-id:direction-indicator-type; | |||
} | description "should be up or down"; | |||
leaf wsize { | } | |||
type uint8; | ||||
} | leaf dtagsize { | |||
leaf fcnsize { | type uint8; | |||
type uint8; | description "size in bit of the DTag field"; | |||
} | } | |||
choice mode { | leaf wsize { | |||
case no-ack; | type uint8; | |||
case ack-always; | description "size in bit of the window field"; | |||
case ack-on-error { | } | |||
leaf ack-method { | leaf fcnsize { | |||
type enumeration { | type uint8; | |||
enum afterAll0; | description "size in bit of the FCN field"; | |||
enum afterAll1; | } | |||
enum always; | leaf RCS-algorithm { | |||
} | type RCS-algorithm-type; | |||
} | default schc-id:RFC8724-RCS; | |||
} | description "Algoritm used for RCS"; | |||
} | } | |||
} | leaf maximum-window-size { | |||
type uint16; | ||||
description "by default 2^wsize - 1"; | ||||
} | ||||
leaf retransmission-timer { | ||||
type uint64; | ||||
description "duration in seconds of the retransmission timer"; // Check the units | ||||
} | ||||
leaf inactivity-timer { | ||||
type uint64; | ||||
description "duration is seconds of the inactivity timer"; // check units | ||||
} | ||||
leaf max-ack-requests { | ||||
type uint8; | ||||
} | ||||
leaf maximum-packet-size { | ||||
type uint16; | ||||
mandatory true; | ||||
default 1280; | ||||
description "When decompression is done, packet size must not strictly exceed this limit in Bytes"; | ||||
} | ||||
choice mode { | ||||
case no-ack; | ||||
case ack-always; | ||||
case ack-on-error { | ||||
leaf tile-size { | ||||
type uint8; | ||||
description "size in bit of tiles"; | ||||
} | ||||
leaf tile-in-All1 { | ||||
type boolean; | ||||
description "When true, sender and receiver except a tile in All-1 frag"; | ||||
} | ||||
leaf ack-behavior { | ||||
type schc-id:ack-behavior-type; | ||||
mandatory true; | ||||
} | ||||
} | ||||
} | ||||
} | ||||
Figure 16: Definition of a fragmentation rule | Figure 16: Definition of a fragmentation rule | |||
3.3. YANG Tree | 3.3. YANG Tree | |||
module: schc | module: schc | |||
+--rw schc | +--rw schc | |||
+--rw version? uint64 | +--rw version? uint64 | |||
+--rw rule* [rule-id rule-length] | +--rw rule* [rule-id rule-length] | |||
+--rw rule-id uint32 | +--rw rule-id uint32 | |||
+--rw rule-length uint8 | +--rw rule-length uint8 | |||
+--rw (nature)? | +--rw (nature)? | |||
+--:(fragmentation) | +--:(fragmentation) | |||
| +--rw dtagsize? uint8 | | +--rw direction? schc-id:direction-indicator-type | |||
| +--rw wsize? uint8 | | +--rw dtagsize? uint8 | |||
| +--rw fcnsize? uint8 | | +--rw wsize? uint8 | |||
| +--rw (mode)? | | +--rw fcnsize? uint8 | |||
| +--rw RCS-algorithm? RCS-algorithm-type | ||||
| +--rw maximum-window-size? uint16 | ||||
| +--rw retransmission-timer? uint64 | ||||
| +--rw inactivity-timer? uint64 | ||||
| +--rw max-ack-requests? uint8 | ||||
| +--rw maximum-packet-size uint16 | ||||
| +--rw (mode) | ||||
| +--:(no-ack) | | +--:(no-ack) | |||
| +--:(ack-always) | | +--:(ack-always) | |||
| +--:(ack-on-error) | | +--:(ack-on-error) | |||
| +--rw ack-method? enumeration | | +--rw tile-size? uint8 | |||
| +--rw tile-in-All1? boolean | ||||
| +--rw ack-behavior schc-id:ack-behavior-type | ||||
+--:(compression) | +--:(compression) | |||
+--rw entry* [field-id field-position direction-indicator] | +--rw entry* [field-id field-position direction-indicator] | |||
+--rw field-id schc-id:field-id-type | +--rw field-id schc-id:field-id-type | |||
+--rw field-length schc-id:field-length-type | +--rw field-length schc-id:field-length-type | |||
+--rw field-position uint8 | +--rw field-position uint8 | |||
+--rw direction-indicator schc-id:direction-indicator-type | +--rw direction-indicator schc-id:direction-indicator-type | |||
+--rw target-values* [position] | +--rw target-values* [position] | |||
| +--rw value? union | | +--rw value? union | |||
| +--rw position uint16 | | +--rw position uint16 | |||
+--rw mo schc-id:matching-operator-type | +--rw mo schc-id:matching-operator-type | |||
skipping to change at page 18, line 12 ¶ | skipping to change at page 19, line 21 ¶ | |||
This document does not have any more Security consideration than the | This document does not have any more Security consideration than the | |||
ones already raised on [I-D.ietf-lpwan-ipv6-static-context-hc] | ones already raised on [I-D.ietf-lpwan-ipv6-static-context-hc] | |||
6. Acknowledgements | 6. Acknowledgements | |||
The authors would like to thank Dominique Barthel, Carsten Bormann, | The authors would like to thank Dominique Barthel, Carsten Bormann, | |||
Alexander Pelov. | Alexander Pelov. | |||
7. YANG Module | 7. YANG Module | |||
Currently the data model is split into two parts. The first one is | ||||
dedicated to SCHC identifiers and the second one contains the rules | ||||
definition. The goal is to allow some stabilities in the rule | ||||
identifiers if new SCHC identfiers are added. When the model will be | ||||
stable, these two files will be merged. | ||||
<code begins> file schc-id@2020-02-28.yang | ||||
module schc-id{ | ||||
yang-version "1"; | ||||
namespace "urn:ietf:lpwan:schc:schc-id"; | ||||
prefix "schc-id"; | ||||
description | ||||
"Identifiers used in SCHC data model."; | ||||
revision 2020-02-28 { | ||||
description "Add fragmentation identifiers"; | ||||
} | ||||
revision 2020-02-11 { | ||||
description "Clean up"; | ||||
} | ||||
revision 2020-01-07 { | ||||
description "First version of the SCHC identifiers"; | ||||
} | ||||
// ------------------------- | ||||
// Field ID type definition | ||||
//-------------------------- | ||||
// generic value TV definition | ||||
identity field-id-base-type { | ||||
description "Field ID with SID"; | ||||
} | ||||
identity fid-ipv6-version { | ||||
base field-id-base-type; | ||||
description "IPv6 version field from RFC8200"; | ||||
} | ||||
identity fid-ipv6-trafficclass { | ||||
base field-id-base-type; | ||||
description "IPv6 Traffic Class field from RFC8200"; | ||||
} | ||||
identity fid-ipv6-trafficclass-ds { | ||||
base field-id-base-type; | ||||
description "IPv6 Traffic Class field from RFC8200, | ||||
DiffServ field from RFC3168"; | ||||
} | ||||
identity fid-ipv6-trafficclass-ecn { | ||||
base field-id-base-type; | ||||
description "IPv6 Traffic Class field from RFC8200, | ||||
ECN field from RFC3168"; | ||||
} | ||||
identity fid-ipv6-flowlabel { | ||||
base field-id-base-type; | ||||
description "IPv6 Flow Label field from RFC8200"; | ||||
} | ||||
identity fid-ipv6-payloadlength { | ||||
base field-id-base-type; | ||||
description "IPv6 Payload Length field from RFC8200"; | ||||
} | ||||
identity fid-ipv6-nextheader { | ||||
base field-id-base-type; | ||||
description "IPv6 Next Header field from RFC8200"; | ||||
} | ||||
identity fid-ipv6-hoplimit { | ||||
base field-id-base-type; | ||||
description "IPv6 Next Header field from RFC8200"; | ||||
} | ||||
identity fid-ipv6-devprefix { | ||||
base field-id-base-type; | ||||
description "correspond either to the source address or the desdination | ||||
address prefix of RFC 8200. Depending if it is respectively | ||||
a uplink or an downklink message."; | ||||
} | ||||
identity fid-ipv6-deviid { | ||||
base field-id-base-type; | ||||
description "correspond either to the source address or the desdination | ||||
address prefix of RFC 8200. Depending if it is respectively | ||||
a uplink or an downklink message."; | ||||
} | ||||
identity fid-ipv6-appprefix { | ||||
base field-id-base-type; | ||||
description "correspond either to the source address or the desdination | ||||
address prefix of RFC 768. Depending if it is respectively | ||||
a downlink or an uplink message."; | ||||
} | ||||
identity fid-ipv6-appiid { | ||||
base field-id-base-type; | ||||
description "correspond either to the source address or the desdination | ||||
address prefix of RFC 768. Depending if it is respectively | ||||
a downlink or an uplink message."; | ||||
} | ||||
identity fid-udp-dev-port { | ||||
base field-id-base-type; | ||||
description "UDP length from RFC 768"; | ||||
} | ||||
identity fid-udp-app-port { | ||||
base field-id-base-type; | ||||
description "UDP length from RFC 768"; | ||||
} | ||||
identity fid-udp-length { | ||||
base field-id-base-type; | ||||
description "UDP length from RFC 768"; | ||||
} | ||||
identity fid-udp-checksum { | ||||
base field-id-base-type; | ||||
description "UDP length from RFC 768"; | ||||
} | ||||
identity fid-coap-version { | ||||
base field-id-base-type; | ||||
description "CoAP version from RFC 7252"; | ||||
} | ||||
identity fid-coap-type { | ||||
base field-id-base-type; | ||||
description "CoAP type from RFC 7252"; | ||||
} | ||||
identity fid-coap-tkl { | ||||
base field-id-base-type; | ||||
description "CoAP token length from RFC 7252"; | ||||
} | ||||
identity fid-coap-code { | ||||
base field-id-base-type; | ||||
description "CoAP code from RFC 7252"; | ||||
} | ||||
identity fid-coap-code-class { | ||||
base field-id-base-type; | ||||
description "CoAP code from RFC 7252"; | ||||
} | ||||
identity fid-coap-code-detail { | ||||
base field-id-base-type; | ||||
description "CoAP code from RFC 7252"; | ||||
} | ||||
identity fid-coap-mid { | ||||
base field-id-base-type; | ||||
description "CoAP message ID from RFC 7252"; | ||||
} | ||||
identity fid-coap-token { | ||||
base field-id-base-type; | ||||
description "CoAP token from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-if-match { | ||||
base field-id-base-type; | ||||
description "CoAP option If-Match from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-uri-host { | ||||
base field-id-base-type; | ||||
description "CoAP option URI-Host from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-etag { | ||||
base field-id-base-type; | ||||
description "CoAP option Etag from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-if-none-match { | ||||
base field-id-base-type; | ||||
description "CoAP option if-none-match from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-observe { | ||||
base field-id-base-type; | ||||
description "CoAP option Observe from RFC 7641"; | ||||
} | ||||
identity fid-coap-option-uri-port { | ||||
base field-id-base-type; | ||||
description "CoAP option Uri-Port from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-location-path { | ||||
base field-id-base-type; | ||||
description "CoAP option Location-Path from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-uri-path { | ||||
base field-id-base-type; | ||||
description "CoAP option Uri-Path from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-content-format { | ||||
base field-id-base-type; | ||||
description "CoAP option Content Format from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-max-age { | ||||
base field-id-base-type; | ||||
description "CoAP option Max-Age from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-uri-query { | ||||
base field-id-base-type; | ||||
description "CoAP option Uri-Query from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-accept { | ||||
base field-id-base-type; | ||||
description "CoAP option Max-Age from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-location-query { | ||||
base field-id-base-type; | ||||
description "CoAP option Location-Query from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-block2 { | ||||
base field-id-base-type; | ||||
description "CoAP option Block2 from RFC 7959"; | ||||
} | ||||
identity fid-coap-option-block1 { | ||||
base field-id-base-type; | ||||
description "CoAP option Block1 from RFC 7959"; | ||||
} | ||||
identity fid-coap-option-size2 { | ||||
base field-id-base-type; | ||||
description "CoAP option size2 from RFC 7959"; | ||||
} | ||||
identity fid-coap-option-proxy-uri { | ||||
base field-id-base-type; | ||||
description "CoAP option Proxy-Uri from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-proxy-scheme { | ||||
base field-id-base-type; | ||||
description "CoAP option Proxy-scheme from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-size1 { | ||||
base field-id-base-type; | ||||
description "CoAP option Size1 from RFC 7252"; | ||||
} | ||||
identity fid-coap-option-no-response { | ||||
base field-id-base-type; | ||||
description "CoAP option No response from RFC 7967"; | ||||
} | ||||
identity fid-coap-option-end-option { | ||||
base field-id-base-type; | ||||
description "CoAP End Option from RFC 7967"; | ||||
} | ||||
//---------------------------------- | ||||
// Field Length type definition | ||||
//---------------------------------- | ||||
identity field-length-base-type { | ||||
description "used to extend field length functions"; | ||||
} | ||||
identity fl-variable { | ||||
base field-length-base-type; | ||||
description "residue length in Byte is sent"; | ||||
} | ||||
identity fl-token-length { | ||||
base field-length-base-type; | ||||
description "residue length in Byte is sent"; | ||||
} | ||||
//--------------------------------- | ||||
// Direction Indicator type | ||||
//--------------------------------- | ||||
identity direction-indicator-base-type { | ||||
description "used to extend field length functions"; | ||||
} | ||||
identity di-bidirectional { | ||||
base direction-indicator-base-type; | ||||
description "Direction Indication of bi directionality"; | ||||
} | ||||
identity di-up { | ||||
base direction-indicator-base-type; | ||||
description "Direction Indication of upstream"; | ||||
} | ||||
identity di-down { | ||||
base direction-indicator-base-type; | ||||
description "Direction Indication of downstream"; | ||||
} | ||||
//---------------------------------- | ||||
// Matching Operator type definition | ||||
//---------------------------------- | ||||
identity matching-operator-base-type { | ||||
description "used to extend Matching Operators with SID values"; | ||||
} | ||||
identity mo-equal { | ||||
base matching-operator-base-type; | ||||
description "SCHC draft"; | ||||
} | ||||
identity mo-ignore { | ||||
base matching-operator-base-type; | ||||
description "SCHC draft"; | ||||
} | ||||
identity mo-msb { | ||||
base matching-operator-base-type; | ||||
description "SCHC draft"; | ||||
} | ||||
identity mo-matching { | ||||
base matching-operator-base-type; | ||||
description "SCHC draft"; | ||||
} | ||||
//------------------------------ | ||||
// CDA type definition | ||||
//------------------------------ | ||||
identity compression-decompression-action-base-type; | ||||
identity cda-not-sent { | ||||
base compression-decompression-action-base-type; | ||||
description "from SCHC draft"; | ||||
} | ||||
identity cda-value-sent { | ||||
base compression-decompression-action-base-type; | ||||
description "from SCHC draft"; | ||||
} | ||||
identity cda-lsb { | ||||
base compression-decompression-action-base-type; | ||||
description "from SCHC draft"; | ||||
} | ||||
identity cda-mapping-sent { | ||||
base compression-decompression-action-base-type; | ||||
description "from SCHC draft"; | ||||
} | ||||
identity cda-compute-length { | ||||
base compression-decompression-action-base-type; | ||||
description "from SCHC draft"; | ||||
} | ||||
identity cda-compute-checksum { | ||||
base compression-decompression-action-base-type; | ||||
description "from SCHC draft"; | ||||
} | ||||
identity cda-deviid { | ||||
base compression-decompression-action-base-type; | ||||
description "from SCHC draft"; | ||||
} | ||||
identity cda-appiid { | ||||
base compression-decompression-action-base-type; | ||||
description "from SCHC draft"; | ||||
} | ||||
// -- type definition | ||||
typedef field-id-type { | ||||
description "Field ID generic type."; | ||||
type identityref { | ||||
base field-id-base-type; | ||||
} | ||||
} | ||||
typedef field-length-type { | ||||
type union { | ||||
type int64; /* positive length */ | ||||
type identityref { /* function */ | ||||
base field-length-base-type; | ||||
} | ||||
} | ||||
} | ||||
typedef direction-indicator-type { | ||||
type identityref { | ||||
base direction-indicator-base-type; | ||||
} | ||||
} | ||||
typedef matching-operator-type { | ||||
type identityref { | ||||
base matching-operator-base-type; | ||||
} | ||||
} | ||||
typedef comp-decomp-action-type { | ||||
type identityref { | ||||
base compression-decompression-action-base-type; | ||||
} | ||||
} | ||||
// -- fragmentation types | ||||
identity ack-behavior-base-type { | ||||
description "type to define when to send an Acknowledgment message"; | ||||
} | ||||
identity ack-behavior-after-All0 { | ||||
description "fragmentor expect Ack after sending All0 fragment."; | ||||
base ack-behavior-base-type; | ||||
} | ||||
identity ack-behavior-after-All1 { | ||||
description "fragmentor expect Ack after sending All1 fragment."; | ||||
base ack-behavior-base-type; | ||||
} | ||||
identity ack-behavior-after-Always { | ||||
description "fragmentor expect Ack after sending every fragment."; | ||||
base ack-behavior-base-type; | ||||
} | ||||
typedef ack-behavior-type { | ||||
type identityref { | ||||
base ack-behavior-base-type; | ||||
} | ||||
} | ||||
// -- fragmentation types | ||||
identity RCS-algorithm-base-type { | ||||
description "identify which algorithm is used to compute RSC. | ||||
The algorithm defines also the size if the RSC field."; | ||||
} | ||||
identity RFC8724-RCS { | ||||
description "CRC 32 defined as default RCS in RFC8724."; | ||||
base RCS-algorithm-base-type; | ||||
} | ||||
typedef RCS-algorithm-type { | ||||
type identityref { | ||||
base RCS-algorithm-base-type; | ||||
} | ||||
} | ||||
} | ||||
<code ends> | ||||
Figure 18 | ||||
<code begins> file schc@2020-02-28.yang | ||||
module schc{ | ||||
yang-version "1"; | ||||
namespace "urn:ietf:lpwan:schc:rules-description"; | ||||
prefix "schc"; | ||||
import schc-id { | ||||
prefix "schc-id"; | ||||
} | ||||
description | ||||
"Generic Data model for Static Context Header Compression Rule for SCHC, | ||||
based on draft-ietf-lpwan-ipv6-static-context-hc-18. Include compression | ||||
rules and fragmentation rules."; | ||||
revision 2020-02-28 { | ||||
description "Add Fragmentation parameters"; | ||||
} | ||||
revision 2020-01-23 { | ||||
description "Modified TV with binary and union"; | ||||
} | ||||
revision 2020-01-07 { | ||||
description "First version of the YANG model"; | ||||
} | ||||
// -------- RULE DEFINITION ------------ | ||||
grouping target-values-struct { | ||||
leaf value { | ||||
type union { | ||||
type binary; | ||||
type string; | ||||
} | ||||
} | ||||
leaf position { | ||||
type uint16; | ||||
} | ||||
} | ||||
grouping compression-rule-entry { | ||||
leaf field-id { | ||||
mandatory true; | ||||
type schc-id:field-id-type; | ||||
} | ||||
leaf field-length { | ||||
mandatory true; | ||||
type schc-id:field-length-type; | ||||
} | ||||
leaf field-position { | ||||
mandatory true; | ||||
type uint8; | ||||
} | ||||
leaf direction-indicator { | ||||
mandatory true; | ||||
type schc-id:direction-indicator-type; | ||||
} | ||||
list target-values { | ||||
key position; | ||||
uses target-values-struct; | ||||
} | ||||
leaf mo { | ||||
mandatory true; | ||||
type schc-id:matching-operator-type; | ||||
} | ||||
list mo-value { | ||||
key position; | ||||
uses target-values-struct; | ||||
} | ||||
leaf cda { | ||||
mandatory true; | ||||
type schc-id:comp-decomp-action-type; | ||||
} | ||||
list cda-value { | ||||
key position; | ||||
uses target-values-struct; | ||||
} | ||||
} | ||||
grouping fragmentation-content { | ||||
leaf direction { | ||||
type schc-id:direction-indicator-type; | ||||
description "should be up or down"; | ||||
} | ||||
leaf dtagsize { | ||||
type uint8; | ||||
description "size in bit of the DTag field"; | ||||
} | ||||
leaf wsize { | ||||
type uint8; | ||||
description "size in bit of the window field"; | ||||
} | ||||
leaf fcnsize { | ||||
type uint8; | ||||
description "size in bit of the FCN field"; | ||||
} | ||||
leaf RCS-algorithm { | ||||
type RCS-algorithm-type; | ||||
default schc-id:RFC8724-RCS; | ||||
description "Algoritm used for RCS"; | ||||
} | ||||
leaf maximum-window-size { | ||||
type uint16; | ||||
description "by default 2^wsize - 1"; | ||||
} | ||||
leaf retransmission-timer { | ||||
type uint64; | ||||
description "duration in seconds of the retransmission timer"; // Check the units | ||||
} | ||||
leaf inactivity-timer { | ||||
type uint64; | ||||
description "duration is seconds of the inactivity timer"; // check units | ||||
} | ||||
leaf max-ack-requests { | ||||
type uint8; | ||||
} | ||||
leaf maximum-packet-size { | ||||
type uint16; | ||||
mandatory true; | ||||
default 1280; | ||||
description "When decompression is done, packet size must not strictly exceed this limit in Bytes"; | ||||
} | ||||
choice mode { | ||||
mandatory true; | ||||
case no-ack; | ||||
case ack-always; | ||||
case ack-on-error { | ||||
leaf tile-size { | ||||
type uint8; | ||||
description "size in bit of tiles"; | ||||
} | ||||
leaf tile-in-All1 { | ||||
type boolean; | ||||
description "When true, sender and receiver except a tile in All-1 frag"; | ||||
} | ||||
leaf ack-behavior { | ||||
type schc-id:ack-behavior-type; | ||||
mandatory true; | ||||
} | ||||
} | ||||
} | ||||
} | ||||
grouping compression-content { | ||||
list entry { | ||||
key "field-id field-position direction-indicator"; | ||||
uses compression-rule-entry; | ||||
} | ||||
} | ||||
// Define rule ID. Rule ID is composed of a RuleID value and a Rule ID Length | ||||
grouping rule-id-type { | ||||
leaf rule-id { | ||||
type uint32; | ||||
description "rule ID value, this value must be unique combined with the length"; | ||||
} | ||||
leaf rule-length { | ||||
type uint8 { | ||||
range 0..32; | ||||
} | ||||
description "rule ID length in bits, value 0 is for implicit rules"; | ||||
} | ||||
} | ||||
// SCHC table for a specific device. | ||||
container schc { | ||||
leaf version{ | ||||
type uint64; | ||||
mandatory false; | ||||
description "used as an indication for versioning"; | ||||
} | ||||
list rule { | ||||
key "rule-id rule-length"; | ||||
uses rule-id-type; | ||||
choice nature { | ||||
case fragmentation { | ||||
uses fragmentation-content; | ||||
} | ||||
case compression { | ||||
uses compression-content; | ||||
} | ||||
} | ||||
} | ||||
} | ||||
} | ||||
<code ends> | ||||
Figure 19 | ||||
8. Normative References | 8. Normative References | |||
[I-D.ietf-lpwan-coap-static-context-hc] | [I-D.ietf-lpwan-coap-static-context-hc] | |||
Minaburo, A., Toutain, L., and R. Andreasen, "LPWAN Static | Minaburo, A., Toutain, L., and R. Andreasen, "LPWAN Static | |||
Context Header Compression (SCHC) for CoAP", draft-ietf- | Context Header Compression (SCHC) for CoAP", draft-ietf- | |||
lpwan-coap-static-context-hc-12 (work in progress), | lpwan-coap-static-context-hc-12 (work in progress), | |||
December 2019. | December 2019. | |||
[I-D.ietf-lpwan-ipv6-static-context-hc] | [I-D.ietf-lpwan-ipv6-static-context-hc] | |||
Minaburo, A., Toutain, L., Gomez, C., Barthel, D., and J. | Minaburo, A., Toutain, L., Gomez, C., Barthel, D., and J. | |||
End of changes. 17 change blocks. | ||||
99 lines changed or deleted | 827 lines changed or added | |||
This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |