Re: [netconf] YANG encoding in CBOR

Michel Veillette <Michel.Veillette@trilliant.com> Thu, 28 March 2019 14:06 UTC

Return-Path: <Michel.Veillette@trilliant.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0CAD7120318; Thu, 28 Mar 2019 07:06:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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 ObMS8pxHtdcC; Thu, 28 Mar 2019 07:06:21 -0700 (PDT)
Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800101.outbound.protection.outlook.com [40.107.80.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8E50B120274; Thu, 28 Mar 2019 07:06:21 -0700 (PDT)
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=2kiZbIVUZWwTFQNkbiDo10EzVN4UyN8cz1gP3vevvDM=; b=ee4KIKlE5VCECLiqskW+Poru78SjFKyn775DoUVchBL29bG1+DYNbVTqJPLLSFfx/JKZbxDTfLyENUPfSnbRQz5y09+WO47mGX6ENmPYj04lZOyNNMEdv8hCGbPkHtYYyAp9tUqkj3HVq1Of/oS9QumHX3PDh/N0LldQqi0SLAs=
Received: from BL0PR06MB5042.namprd06.prod.outlook.com (10.167.240.31) by BL0PR06MB4370.namprd06.prod.outlook.com (10.167.181.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.17; Thu, 28 Mar 2019 14:06:17 +0000
Received: from BL0PR06MB5042.namprd06.prod.outlook.com ([fe80::6d4a:3963:7ffb:1f30]) by BL0PR06MB5042.namprd06.prod.outlook.com ([fe80::6d4a:3963:7ffb:1f30%2]) with mapi id 15.20.1750.017; Thu, 28 Mar 2019 14:06:17 +0000
From: Michel Veillette <Michel.Veillette@trilliant.com>
To: Carsten Bormann <cabo@tzi.org>, Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
CC: Ladislav Lhotka <lhotka@nic.cz>, "netconf@ietf.org" <netconf@ietf.org>, "core@ietf.org" <core@ietf.org>
Thread-Topic: [netconf] YANG encoding in CBOR
Thread-Index: AdTf3q8hCOPNH5o0Q0SJZRQQHN87VgA3tcGQAAL8XAAAAtt/gAAgmRkAAAJStYAAYEUIgABUqX2QAAwU1oAAE3mQoAApxZcAAATFAAAAAF65QA==
Date: Thu, 28 Mar 2019 14:06:17 +0000
Message-ID: <BL0PR06MB5042C392E675385B2AB0148A9A590@BL0PR06MB5042.namprd06.prod.outlook.com>
References: <6235c6683ff14848a661f8b8cec94280@XCH-RCD-007.cisco.com> <BL0PR06MB5042823429DB7CDA0F33408B9A430@BL0PR06MB5042.namprd06.prod.outlook.com> <588401AB-483E-40F5-95BB-20A066E56DAC@tzi.org> <15fbaf84b20343a1b83f40b571149a14@XCH-RCD-007.cisco.com> <1ADF8201-ABB4-44FD-A515-F3F8E0DBF5FC@tzi.org> <20190323101003.gp3zvsvqqwc26jip@anna.jacobs.jacobs-university.de> <871s2vqsxi.fsf@nic.cz> <BL0PR06MB5042C9AA6B4A0CCD913F50D89A580@BL0PR06MB5042.namprd06.prod.outlook.com> <20190327061637.g5a7t7nulk7kyh2v@anna.jacobs.jacobs-university.de> <BL0PR06MB5042C28B79FF95078C8A881F9A580@BL0PR06MB5042.namprd06.prod.outlook.com> <20190328113018.uzujjtc7a2ukhovl@anna.jacobs.jacobs-university.de> <4656560A-2135-4F51-B3E7-8DB31B43B17D@tzi.org>
In-Reply-To: <4656560A-2135-4F51-B3E7-8DB31B43B17D@tzi.org>
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: [207.96.192.122]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: a02707fd-b61b-463f-9b29-08d6b3868c17
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:BL0PR06MB4370;
x-ms-traffictypediagnostic: BL0PR06MB4370:
x-ms-exchange-purlcount: 1
x-microsoft-antispam-prvs: <BL0PR06MB437005DFDF330DCD6548F32E9A590@BL0PR06MB4370.namprd06.prod.outlook.com>
x-forefront-prvs: 0990C54589
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(366004)(376002)(396003)(136003)(39840400004)(189003)(199004)(13464003)(7696005)(53546011)(99286004)(102836004)(2906002)(76176011)(6506007)(186003)(26005)(97736004)(446003)(11346002)(476003)(486006)(106356001)(105586002)(3846002)(478600001)(6116002)(72206003)(14454004)(53936002)(93886005)(86362001)(81166006)(81156014)(8676002)(74316002)(52536014)(7736002)(305945005)(229853002)(8936002)(6436002)(66066001)(110136005)(54906003)(25786009)(55016002)(68736007)(316002)(6306002)(9686003)(4326008)(5660300002)(6246003)(71190400001)(71200400001)(256004)(33656002); DIR:OUT; SFP:1102; SCL:1; SRVR:BL0PR06MB4370; H:BL0PR06MB5042.namprd06.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: 2P6tUx3NXX8VZ/OTL7Ty1GGsiiOR7BnnveggRF9Zr4G02NEnA1KFjAz4qTjyu4YNiwnLQbEoPxO2z+ulgsJGfvONqPX8ew5BweA5WyAnlkyfi77InuoUvxEW/rCMYf+qzCUnOX1TEiliBwEhxaaORRHmJRqdqWXCr4YPYVmwP9gyJtgUe1qefYGVeszmWgKSShFcKi0qIRR5LA4wTzIVcaq94OlQFIHhTrLFHK0hLtJrcRzaabt8fjQTtTX1fXjJCmxr/l9Nv3/AfNLu8t+vGpTqGzxUmnorUMpc6CSurbRQvAB7KhMKcXYfUEWd8UvxIScQ/SB6RgSpLe/ZwQ8R7lqREyMWRBli3Dy4Qy+NFxtkAaQUHxuXh4jp4v/kY45c6B9hnFfwD+BEeG+wdEsi4qS7/RY8aYjt+l+0CgE5Iww=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: Trilliant.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a02707fd-b61b-463f-9b29-08d6b3868c17
X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Mar 2019 14:06:17.5429 (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: BL0PR06MB4370
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/xa7hMcMKOHHhxv6AvXWP94lbSxo>
Subject: Re: [netconf] YANG encoding in CBOR
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Mar 2019 14:06:27 -0000

+1 for value outside, string inside union

My rational:

- SID can have up to 8 bytes and will provide a marginal compression.
- Generating SID for all 'enumeration' and 'bits' in case they are used in 'union' is lot of overhead to revolve a corner case.
- YANG also support the 'choice' statement (https://tools.ietf.org/html/rfc7950#section-4.2.7) which is similar to
   the concept of type tagging within union. This construct can be used by YANG modules specifically created for
  embedded applications to take advantage of 'enumeration' encoded as value and 'bits' encoded as bit.

Michel


-----Original Message-----
From: Carsten Bormann <cabo@tzi.org>; 
Sent: Thursday, March 28, 2019 9:47 AM
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>;
Cc: Michel Veillette <Michel.Veillette@trilliant.com>;; Ladislav Lhotka <lhotka@nic.cz>;; netconf@ietf.org; core@ietf.org
Subject: Re: [netconf] YANG encoding in CBOR

So for enum/bits we are back to value outside, string inside union?
Can we use SIDs instead of the strings for the latter?
This can’t be much more complicated than assigning a SID to each string that occurs in an enum/bits in a union.

Grüße, Carsten