Network Working Group A. Minaburo Internet-Draft Acklio Intended status: Informational L. Toutain Expires: January 2, 2017 Institut MINES TELECOM ; TELECOM Bretagne July 1, 2016 YANG module for LPWAN Static Context Header Compression (SCHC) draft-toutain-lpwan-yang-static-context-hc-00 Abstract This document describes a yang model for Static Context Header Compression. A generic module is defined, that can be applied for any headers. A specific model for the IPv6 UDP protocol stack is also proposed. Status of This Memo 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 http://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 January 2, 2017. Copyright Notice Copyright (c) 2016 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 (http://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. Minaburo & Toutain Expires January 2, 2017 [Page 1] Internet-Draft LPWAN SCHC YANG moodule July 2016 1. Introduction [I-D.toutain-6lpwa-ipv6-static-context-hc] defines a compression technique for LPWA network based on static context. The context is known by both ends. A context contains an ordered list of rules (cf. Figure 1). Each rule is a vector of entries. Each entry is composed of a field descriptor, a prescribed matching value, a matching rule for the compression side, a matching rule for the decompression side and a compression/decompression action function. +---------------------------------------------------------------------+ | Rule N | +---------------------------------------------------------------------+ | | Rule i | | +---------------------------------------------------------------------+ | | | Rule 1 | | | | +---------+-------+------------+--------------+-----------------+ | | | | | Field 1 | Value |match. comp.| match decomp | Action function | | | | | +---------+-------+------------+--------------+-----------------+ | | | | | Field 2 | Value |match. comp.| match decomp | Action function | | | | | +---------+-------+------------+--------------+-----------------+ | | | | | ... | ... |... | ... | ... | | | | | +---------+-------+------------+--------------+-----------------+ | |----+ | | Field N | Value |match. comp.| match decomp | Action function | | | | +---------+-------+------------+--------------+-----------------+ |------+ | | +---------------------------------------------------------------------+ Figure 1: Context in LC 2. YANG types 2.1. Value field A value may be associated for each field in a rule. The value's type depends of the field. It can be an integer, a prefix, a string, or any other type carried by the field. The LPWA-types regroups all the possibles values. Figure 2 gives its definition. Minaburo & Toutain Expires January 2, 2017 [Page 2] Internet-Draft LPWAN SCHC YANG moodule July 2016 typedef LPWA-types { type union { type uint8; type uint16; type uint32; type uint64; type inet:ipv6-prefix; // better use int64, more comptact ? type string; } } Figure 2: Value types Note that as defined in [I-D.toutain-6lpwa-ipv6-static-context-hc], ESprefix and LCprefix can be of inet:ipv6-prefix type, but this type derives from ASCII characters, a binary representation such as uint64 will be more compact. 2.2. Matching operator A matching operator is used to check the field value stored in the rule against the value contained in the header field. If there is no matching the rule is not selected. Two instances of matching operator are defined to allow the rule selection from informations contained either the compressed or uncompressed header. [I-D.toutain-6lpwa-ipv6-static-context-hc] defines three operators: o equal: the rule's value must be equal to the packet header value for a specific field. o lsb(L): this operator compare the most significant bits. The operator takes one argument representing the length of least significant bit part, which will be ignored during the matching but sent if the rule matches. o ignore: there is no check for this field. Minaburo & Toutain Expires January 2, 2017 [Page 3] Internet-Draft LPWAN SCHC YANG moodule July 2016 grouping matching-operator { leaf operator { type enumeration { enum operator-equal; enum operator-lsb; enum operator-ignore; } } choice operator-lsb { leaf lsb-length { type LPWA-types; } } Figure 3: Matching operators Figure 3 represents the matching operator type definition. 2.3. action function [I-D.toutain-6lpwa-ipv6-static-context-hc] defines some actions functions. Action functions tell how to compress and inversely how to decompress the field. They are defined in Figure 4 typedef LPWA-action-functions { type enumeration { enum elided; enum send-value; enum compute-IPv6-length; enum compute-UDP-length; enum compute-UDP-checksum; enum ESiid-DID; enum LAiid-DID; } } Figure 4: Action functions 3. Generic rule definition Each rule's row is defined by several leaves, composed of: o a field name that can be used for debugging purpose, Minaburo & Toutain Expires January 2, 2017 [Page 4] Internet-Draft LPWAN SCHC YANG moodule July 2016 o a field position which will be used as a key, o a field value containing the value that will be compared, o two matching operators for rule selection: one for compression and the other for decompression, o an action function to compress/uncompress the field. Figure 5 defines the format. grouping field-context { leaf field-name { type string; } leaf field-pos { type int8; } leaf field-value { type LPWA-types; } container field-compression-match { uses matching-operator; } container field-decompression-match { uses matching-operator; } leaf action-function { type LPWA-action-functions; } } Figure 5: Action functions 4. Yang static context model This lead to the generic rule definition, represented Figure 6. Minaburo & Toutain Expires January 2, 2017 [Page 5] Internet-Draft LPWAN SCHC YANG moodule July 2016 +--rw generic-rules | +--rw context-name? string | +--rw context-rules* [rule-id] | +--rw rule-name? string | +--rw rule-id int8 | +--rw rule-fields* [field-pos] | +--rw field-name? string | +--rw field-pos int8 | +--rw field-value? LPWA-types | +--rw field-compression-match | | +--rw operator? enumeration | | +--rw (operator-lsb)? | | +--:(lsb-length) | | +--rw lsb-length? LPWA-types | +--rw field-decompression-match | | +--rw operator? enumeration | | +--rw (operator-lsb)? | | +--:(lsb-length) | | +--rw lsb-length? LPWA-types | +--rw action-function? LPWA-action-functions Figure 6: Generic module tree A context is defined by a set of rules identified through a rule-id. Each rule contains a set of field definitions identified through a field position. Figure 7 gives the yang definition of this module. Minaburo & Toutain Expires January 2, 2017 [Page 6] Internet-Draft LPWAN SCHC YANG moodule July 2016 container generic-rules { leaf context-name { type string; } list context-rules { key rule-id; leaf rule-name { type string; } leaf rule-id { type int8; } list rule-fields { key field-pos; uses field-context; } } } Figure 7: Yang definition of the generic module Specific modules can be defined based on the same principle. Figure 8 represents the module defined in [I-D.toutain-6lpwa-ipv6-static-context-hc]. container IPv6-UDP-rules { leaf context-name { type string; } list context-rules { key rule-id; leaf rule-name { type string; } leaf rule-id { type int8; } container shim-id { uses field-context { refine field-name { default "shim identifier"; } refine field-pos { Minaburo & Toutain Expires January 2, 2017 [Page 7] Internet-Draft LPWAN SCHC YANG moodule July 2016 default 0; } refine field-value { default 0; } } } container ES-device-id { uses field-context { refine field-name { default "End System device identifier"; } refine field-pos { default 1; } refine field-value { default 0; } } } container ipv6-version { uses field-context { refine field-name { default "IPv6 Version"; } refine field-pos { default 2; } refine field-value { default 6; } } } container ipv6-diffserv { uses field-context { refine field-name { default "IPv6 Diffserv"; } refine field-pos { default 3; } refine field-value { default 0; } } } container ipv6-flow-label { uses field-context { Minaburo & Toutain Expires January 2, 2017 [Page 8] Internet-Draft LPWAN SCHC YANG moodule July 2016 refine field-name { default "IPv6 Flow Label"; } refine field-pos { default 4; } refine field-value { default 0; } } } container ipv6-length { uses field-context { refine field-name { default "IPv6 length"; } refine field-pos { default 5; } } } container ipv6-next-header { uses field-context { refine field-name { default "IPv6 next header"; } refine field-pos { default 6; } refine field-value { default 17; } } } container ipv6-hop-limit { uses field-context { refine field-name { default "IPv6 Hop Limit"; } refine field-pos { default 7; } refine field-value { default 17; } } } container ipv6-ES-prefix { Minaburo & Toutain Expires January 2, 2017 [Page 9] Internet-Draft LPWAN SCHC YANG moodule July 2016 uses field-context { refine field-name { default "IPv6 ES Prefix"; } refine field-pos { default 8; } } } container ipv6-ES-iid { uses field-context { refine field-name { default "IPv6 ES Interface ID"; } refine field-pos { default 9; } } } container ipv6-LC-prefix { uses field-context { refine field-name { default "IPv6 LC Prefix"; } refine field-pos { default 10; } } } container ipv6-LC-iid { uses field-context { refine field-name { default "IPv6 LC Interface ID"; } refine field-pos { default 11; } } } container udp-ES-port { uses field-context { refine field-name { default "UDP ES port"; } refine field-pos { default 12; } Minaburo & Toutain Expires January 2, 2017 [Page 10] Internet-Draft LPWAN SCHC YANG moodule July 2016 } } container udp-LC-port { uses field-context { refine field-name { default "UDP LC port"; } refine field-pos { default 13; } } } } } Figure 8: Yang definition of the IPv6 UDP compression Each field is specifically defined with some default values. 5. Use of COMI/CoOL COMI/CoOL [I-D.veillette-core-cool] defines a management function set adapted to constrained networks. In the generic format, the keys to access a field (referenced as field-SID) are the rule-id and the field-pos. Therefore to modify one value for a specific rule and a specific field, a iPATCH will be used as defined in Figure 9 iPATCH /c Content-Format(application/cool-value-pairs+cbor) [ [field-SID, rule-id, field-pos], value ] Figure 9: Yang definition of the IPv6 UDP compression For a specific context, only the rule-id has to be specified in the iPATH methods since each field has its own sid value. 6. Acknowledgement The authors would like to thank Michel Veillette, Alexander Pelov, Antoni Markovski for their help on COMI/CoOL and Yang. Minaburo & Toutain Expires January 2, 2017 [Page 11] Internet-Draft LPWAN SCHC YANG moodule July 2016 7. Normative References [I-D.toutain-6lpwa-ipv6-static-context-hc] Minaburo, A. and L. Toutain, "6LPWA Static Context Header Compression (SCHC) for IPV6 and UDP", draft-toutain-6lpwa- ipv6-static-context-hc-00 (work in progress), June 2016. [I-D.veillette-core-cool] Veillette, M., Pelov, A., Somaraju, A., Turner, R., and A. Minaburo, "Constrained Objects Language", draft-veillette- core-cool-01 (work in progress), March 2016. Appendix A. Yang Model module LPWA-compression { namespace "http://ackl.io/compression"; prefix "lpwa"; import ietf-inet-types { prefix inet; } description "Data model to compress headers on 6LPWA"; revision 2016-06-01 { description "This module describes the context store in End-System (LC) and LPWA Compressor (LC). "; } typedef LPWA-types { type union { type uint8; type uint16; type uint32; type uint64; type inet:ipv6-prefix; // better use int64, more comptact ? type string; } } typedef LPWA-action-functions { type enumeration { enum elided; Minaburo & Toutain Expires January 2, 2017 [Page 12] Internet-Draft LPWAN SCHC YANG moodule July 2016 enum send-value; enum compute-IPv6-length; enum compute-UDP-length; enum compute-UDP-checksum; enum ESiid-DID; enum LAiid-DID; } } grouping matching-operator { leaf operator { type enumeration { enum operator-equal; enum operator-lsb; enum operator-ignore; } } choice operator-lsb { leaf lsb-length { type LPWA-types; } } } grouping field-context { leaf field-name { type string; } leaf field-pos { type int8; } leaf field-value { type LPWA-types; } container field-compression-match { uses matching-operator; } container field-decompression-match { uses matching-operator; } leaf action-function { type LPWA-action-functions; } } container generic-rules { leaf context-name { Minaburo & Toutain Expires January 2, 2017 [Page 13] Internet-Draft LPWAN SCHC YANG moodule July 2016 type string; } list context-rules { key rule-id; leaf rule-name { type string; } leaf rule-id { type int8; } list rule-fields { key field-pos; uses field-context; } } } container IPv6-UDP-rules { leaf context-name { type string; } list context-rules { key rule-id; leaf rule-name { type string; } leaf rule-id { type int8; } container shim-id { uses field-context { refine field-name { default "shim identifier"; } refine field-pos { default 0; } refine field-value { default 0; } } } container ES-device-id { uses field-context { refine field-name { Minaburo & Toutain Expires January 2, 2017 [Page 14] Internet-Draft LPWAN SCHC YANG moodule July 2016 default "End System device identifier"; } refine field-pos { default 1; } refine field-value { default 0; } } } container ipv6-version { uses field-context { refine field-name { default "IPv6 Version"; } refine field-pos { default 2; } refine field-value { default 6; } } } container ipv6-diffserv { uses field-context { refine field-name { default "IPv6 Diffserv"; } refine field-pos { default 3; } refine field-value { default 0; } } } container ipv6-flow-label { uses field-context { refine field-name { default "IPv6 Flow Label"; } refine field-pos { default 4; } refine field-value { default 0; } } Minaburo & Toutain Expires January 2, 2017 [Page 15] Internet-Draft LPWAN SCHC YANG moodule July 2016 } container ipv6-length { uses field-context { refine field-name { default "IPv6 length"; } refine field-pos { default 5; } } } container ipv6-next-header { uses field-context { refine field-name { default "IPv6 next header"; } refine field-pos { default 6; } refine field-value { default 17; } } } container ipv6-hop-limit { uses field-context { refine field-name { default "IPv6 Hop Limit"; } refine field-pos { default 7; } refine field-value { default 17; } } } container ipv6-ES-prefix { uses field-context { refine field-name { default "IPv6 ES Prefix"; } refine field-pos { default 8; } } } container ipv6-ES-iid { Minaburo & Toutain Expires January 2, 2017 [Page 16] Internet-Draft LPWAN SCHC YANG moodule July 2016 uses field-context { refine field-name { default "IPv6 ES Interface ID"; } refine field-pos { default 9; } } } container ipv6-LC-prefix { uses field-context { refine field-name { default "IPv6 LC Prefix"; } refine field-pos { default 10; } } } container ipv6-LC-iid { uses field-context { refine field-name { default "IPv6 LC Interface ID"; } refine field-pos { default 11; } } } container udp-ES-port { uses field-context { refine field-name { default "UDP ES port"; } refine field-pos { default 12; } } } container udp-LC-port { uses field-context { refine field-name { default "UDP LC port"; } refine field-pos { default 13; } Minaburo & Toutain Expires January 2, 2017 [Page 17] Internet-Draft LPWAN SCHC YANG moodule July 2016 } } } } } Figure 10: Yang definition of the IPv6 UDP compression Authors' Addresses Ana Minaburo Acklio 2bis rue de la Chataigneraie 35510 Cesson-Sevigne Cedex France Email: ana@ackl.io Laurent Toutain Institut MINES TELECOM ; TELECOM Bretagne 2 rue de la Chataigneraie CS 17607 35576 Cesson-Sevigne Cedex France Email: Laurent.Toutain@telecom-bretagne.eu Minaburo & Toutain Expires January 2, 2017 [Page 18]