[core] Use of CBOR tags in "draft-ietf-core-yang-cbor"

Michel Veillette <Michel.Veillette@trilliant.com> Thu, 28 February 2019 01:01 UTC

Return-Path: <Michel.Veillette@trilliant.com>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EEEE912D829; Wed, 27 Feb 2019 17:01:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=trilliant.onmicrosoft.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LyW9g6bLoEEY; Wed, 27 Feb 2019 17:01:29 -0800 (PST)
Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-eopbgr740108.outbound.protection.outlook.com [40.107.74.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 710BD126C15; Wed, 27 Feb 2019 17:01:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Trilliant.onmicrosoft.com; s=selector1-Trilliant-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VqmNODVkx41NXLIPNGsKod2NpISs48Ah5oqkIAVVNyM=; b=RNwls7LoqJqIP1ZcZ/X9NeVh8snZOzGU1gdHCj0IJ8A7RCJX75qfiBFsMR7Gj5hXqjrDBFuzbiVtoNzPVPi/Tv6Le6K+NQlBxbIPtZzJEgMOXyMovGT4o0i2bUmJZh8GbE5EPyiKqpHm/83icC5UNsIMNkOI+zEMMRMjnoVvth0=
Received: from BL0PR06MB5042.namprd06.prod.outlook.com (10.167.240.31) by BL0PR06MB4803.namprd06.prod.outlook.com (10.167.182.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.14; Thu, 28 Feb 2019 01:01:23 +0000
Received: from BL0PR06MB5042.namprd06.prod.outlook.com ([fe80::d5:e11c:db10:639d]) by BL0PR06MB5042.namprd06.prod.outlook.com ([fe80::d5:e11c:db10:639d%2]) with mapi id 15.20.1643.022; Thu, 28 Feb 2019 01:01:22 +0000
From: Michel Veillette <Michel.Veillette@trilliant.com>
To: "yot@ietf.org" <yot@ietf.org>
CC: Core <core@ietf.org>
Thread-Topic: Use of CBOR tags in "draft-ietf-core-yang-cbor"
Thread-Index: AdTO/059/Mdl55lvTJKfGrnQ4j8fEQ==
Date: Thu, 28 Feb 2019 01:01:22 +0000
Message-ID: <BL0PR06MB504266C49731E364DB096A019A750@BL0PR06MB5042.namprd06.prod.outlook.com>
Accept-Language: fr-CA, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=Michel.Veillette@trilliant.com;
x-originating-ip: [184.151.114.6]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 25407382-66aa-4faa-c485-08d69d1841e4
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:BL0PR06MB4803;
x-ms-traffictypediagnostic: BL0PR06MB4803:
x-ms-exchange-purlcount: 2
x-microsoft-exchange-diagnostics: =?us-ascii?Q?1; BL0PR06MB4803; 23:w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ZZ/?= =?us-ascii?Q?2SrP3dk8qvO3Idhxm/Dxg0okKkJoVcMVAvdunu9DyseGmE2l5JEh8XZsTNcj?= =?us-ascii?Q?oeRdiKTpSe3HyC7qdXNf4BDEktG0eO1/RCv4jpN5Y3iQzxaERVJYDfT2Fk2U?= =?us-ascii?Q?c2Q0ugXlWDTQO/eP0v5b/IhfEG0PebPNgeiS9IvvMohV4cR8Rq6k1IlHRqxl?= =?us-ascii?Q?dYobFf7fnShoMibOjnTTIF9jjRvJa77n+DcboELWm1wU1BGqMcBLPZ5ATqWI?= =?us-ascii?Q?LTkhwnxZflOdmCylWTifb8jCiZA9DWqXlkgugvDDYXUgGfFvV5REuQBQMW/V?= =?us-ascii?Q?MHHyrC3FsKF/ckc4v/PP574/6NIZYleGKSHKpyej94MBBXfq9v4syJLDuG5t?= =?us-ascii?Q?AaQ7PwWtKNPSqcatw90oHd57etpruuHz8CdN8Dc32AdZxZ9K8sXmHqdbXbYj?= =?us-ascii?Q?yeI7Yqbn1mK08ySSgsX50Yijg6v3dortPmc7ttAj8Tx?=
x-microsoft-antispam-prvs: <BL0PR06MB48038DFF171BC537BE6FFCD09A750@BL0PR06MB4803.namprd06.prod.outlook.com>
x-forefront-prvs: 0962D394D2
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(396003)(39850400004)(376002)(346002)(136003)(199004)(189003)(53936002)(14454004)(966005)(72206003)(478600001)(606006)(6916009)(4326008)(68736007)(14444005)(256004)(52536013)(316002)(5660300002)(450100002)(71190400001)(7696005)(71200400001)(99286004)(476003)(66066001)(102836004)(2501003)(6436002)(3846002)(26005)(33656002)(486006)(186003)(86362001)(97736004)(74316002)(1730700003)(7736002)(81166006)(81156014)(8676002)(8936002)(55016002)(105586002)(106356001)(236005)(6306002)(2906002)(5640700003)(6116002)(790700001)(9686003)(54896002)(25786009)(2351001)(6506007); DIR:OUT; SFP:1102; SCL:1; SRVR:BL0PR06MB4803; H:BL0PR06MB5042.namprd06.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: trilliant.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: JiVHucgRyghYW7WMR/q5p5g9xf4FR4KYP8feFo2HWFks0b9ufYq0Kw2KpdtVj5SU3VCFHu/wxsjl1Ib7m1hzWe/Z7g6cqWeaqk0XE4H/5703/YI8pk1e38eGiGU9EYul7OMU14JABYZgFFtqzHuvNxLTyD8OZpkR5iFrKPwbwxUUH5BqlT9BGvf283tPeu5dHYUTW6+jk0U1onGEPPePwXE96x5plbe6UAtvUf6XD2BTQftjieS58u9sQoW7eEn2PYrrz7iD7ULG1zWPoQUXoLVF/kyhwIpdgUT0ulaV+hDU877+JSCzw7fNgg6yT1iXdtwEi/1/Kyf89F7q/tlp0yL+bkeDVe0SqN3Ay0Tepz4Gu4Ry/hAP27USvioSbBTvqSONdqBYoXKC+u4fUV2dDhOaRP2bmBkLWYayhZLq/AU=
Content-Type: multipart/alternative; boundary="_000_BL0PR06MB504266C49731E364DB096A019A750BL0PR06MB5042namp_"
MIME-Version: 1.0
X-OriginatorOrg: Trilliant.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 25407382-66aa-4faa-c485-08d69d1841e4
X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Feb 2019 01:01:22.8050 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4f6fbd13-0dfb-4150-85c3-d43260c04309
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR06MB4803
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/qPSHhjUcPS6xXjkceWZrPTR3jRg>
Subject: [core] Use of CBOR tags in "draft-ietf-core-yang-cbor"
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Feb 2019 01:01:34 -0000

Hi YANG to CBOR users

In some cases, using a SID instead of a delta can simplify implementations.
My current specific use case is the encoding of an 'anydata' in a logger.
This can be accomplished by tagging the SID with a specific CBOR tag.
See example below.

Another use case for CBOR tags is the encoding of a 'date-and-time' typedef defined in https://tools.ietf.org/html/rfc6021#section-3 .
This typedef is currently encoded using  a 20 byte string  (e.g. "2014-10-26T12:16:31Z").
If we allow the use of the already existing 'Epoch-based date/time' tag, this information can be encoded using a 4 byte integer.
See example below.

YANG tree:

+--ro logger*                SID 1000524
   +--ro notification        anydata
  +--ro timestamp?          SID 1000525
   +--ro sequence-number     SID 1000526

---n yang-library-change     SID 1000465
   +--ro hash                SID 1000466

CBOR diagnostic notation:

{
  1000524 : [
    {
      SID tag(1000465) : {
        1 : h'8A934D83672F309E'
      },
      +1 : 1(1551296644),
      +2 : 123
    }
  ]
}

CBOR encoding:

A1                              # map(1)
   1A 000F444C                  # unsigned(1000524)
   81                           # array(1)
      A3                        # map(3)
         D8 63                  # tag(99)
            1A 000F4411         # unsigned(1000465)
         A1                     # map(1)
            01                  # unsigned(1)
            48                  # bytes(8)
               8A934D83672F309E # "\x8A\x93M\x83g/0\x9E"
         01                     # unsigned(1)
         C1                     # tag(1)
            1A 5C76E884         # unsigned(1551296644)
         02                     # unsigned(2)
         18 7B                  # unsigned(123)

Question:

  *   Should we support the 'Epoch-based date/time' tag in 'draft-ietf-core-yang-cbor' ?
  *   Should we support the 'Absolute SID' tag in 'draft-ietf-core-yang-cbor' ?
  *   Is so, can we get this tag allocated by IANA only based on an IETF draft? (Do we need to wait for the RFC)
  *   Any other use cases for CBOR tags:
     *   phys-address in ietf-yang-types (https://tools.ietf.org/html/rfc6021) ?
     *   mac-address in ietf-yang-types (https://tools.ietf.org/html/rfc6021) ?


Regards
Michel Veillette