Re: [netmod] hex-string as built-in type in future versions of YANG

Scott Mansfield <scott.mansfield@ericsson.com> Wed, 06 November 2019 16:29 UTC

Return-Path: <scott.mansfield@ericsson.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EDED712087B for <netmod@ietfa.amsl.com>; Wed, 6 Nov 2019 08:29:26 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.002
X-Spam-Level:
X-Spam-Status: No, score=-2.002 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.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 Gt1r0bb9sjo9 for <netmod@ietfa.amsl.com>; Wed, 6 Nov 2019 08:29:24 -0800 (PST)
Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730067.outbound.protection.outlook.com [40.107.73.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2D8D212086A for <netmod@ietf.org>; Wed, 6 Nov 2019 08:29:24 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RH/S8X2rY8bLujWIpssk8fta1v5IvsZa2t1DIQ+G5+HH36Bm3frUnByil0z8SwyHlYgSGdkbyjcJTBGEGChDtn4eaS97FrJNPrw3g5jJo4Yp+r0RsIegqrYJhkSFFt703xtjHfMHFLZKTP6LJ+BYSYiykkVdtKLw5oIEzI+cDoM9g+onLp4Kg6dIiBEdFFDHW9e66xRMKzoR7Qe2amXku5bBv5BCyMLpdE62zqgb1LB54XA1RWZgZW2x/5h54tF4Y2yKui5MuqxW6wXbnNV60jD6wOcC782v77lTSbQConjhrKYKa2YR+QqtAnbXh1KH6PAs05TkVHbKUnj3vyvE+w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5Q3kU2tgiy1l2+MCMq+Ri0yTUwyDsS683e/xFpT6kQY=; b=TCZ3HCFjZCkTqVc9zIWdQiPqRxR6Vw+3rY9c0mxWLY3Zgl2fl96pAAQL8EuQ1HOcMKE5xMAQdoD+HPpdD3zsr0LuBHc1O4dH4mCn4YpSUVgHcnEBDE9ZxSZuolyBE6mh5p1mTbiSCBkiN1TA2dwSc25j5WSbBzcVQlNfJFNvzBYjetROxB/HDjOBSxxq8f1fpint1n82SEEUq5K9icUAncUIGMqAD4644orksb3G/EcbFx48KxJuX2kFDJXOMga0vA6g+SjOQOutPdywjq08Ir55DJVIegK2+7q50hk9i3wlvVOcoTZd3tDsCBcPK82qoVgiXvtF8Exl/hCFzoeyNA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5Q3kU2tgiy1l2+MCMq+Ri0yTUwyDsS683e/xFpT6kQY=; b=faNXDE4P2RuFQSfvFqIBIvSWUSemeYp0H58n534nYEUaWvBM4OxjA7C+4q+/lyE68OXv188KKtmM6BtcyxOQIKp9D2XAUTxLSow+PgQLIkzDRzLo2u6dzDB5dhPP8ZhhxCMctJSmhPNTJCshkNcVSH/TECTji60VqFM5SpZ774o=
Received: from SN6PR15MB2382.namprd15.prod.outlook.com (52.135.65.142) by SN6PR15MB2317.namprd15.prod.outlook.com (52.135.65.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.22; Wed, 6 Nov 2019 16:29:22 +0000
Received: from SN6PR15MB2382.namprd15.prod.outlook.com ([fe80::cc77:ad6:c868:482b]) by SN6PR15MB2382.namprd15.prod.outlook.com ([fe80::cc77:ad6:c868:482b%7]) with mapi id 15.20.2430.020; Wed, 6 Nov 2019 16:29:22 +0000
From: Scott Mansfield <scott.mansfield@ericsson.com>
To: Vladimir Vassilev <vladimir@lightside-instruments.com>, tom petch <ietfa@btconnect.com>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: hex-string as built-in type in future versions of YANG
Thread-Index: AQHVlKY+KWDtjPWkUEerecz0ieqA5ad+UybQ
Date: Wed, 6 Nov 2019 16:29:22 +0000
Message-ID: <SN6PR15MB23824A84A0DEDE35988E59A88B790@SN6PR15MB2382.namprd15.prod.outlook.com>
References: <157053706777.17066.5329202935752721411.idtracker@ietfa.amsl.com> <e6e439e6-5e39-9155-7924-59e8ecde72bd@lightside-instruments.com> <00e501d58b52$2bc35b60$4001a8c0@gateway.2wire.net> <a44c75d7-123f-3d7b-e95f-f21715eba22a@lightside-instruments.com> <06eb01d58e54$84b43fa0$4001a8c0@gateway.2wire.net> <41a2a04d-a9bd-5c2d-678e-0e416a1dd556@lightside-instruments.com>
In-Reply-To: <41a2a04d-a9bd-5c2d-678e-0e416a1dd556@lightside-instruments.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=scott.mansfield@ericsson.com;
x-originating-ip: [24.154.234.238]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: ab24c4e0-ba5f-4c56-5c67-08d762d67b2d
x-ms-traffictypediagnostic: SN6PR15MB2317:
x-microsoft-antispam-prvs: <SN6PR15MB2317E9FBEE709BC439414FB98B790@SN6PR15MB2317.namprd15.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:8273;
x-forefront-prvs: 02135EB356
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(396003)(39860400002)(376002)(366004)(136003)(129404003)(51444003)(13464003)(174864002)(199004)(189003)(11346002)(486006)(446003)(5660300002)(476003)(52536014)(25786009)(8936002)(81166006)(8676002)(81156014)(256004)(2906002)(5024004)(14444005)(71190400001)(71200400001)(44832011)(6116002)(3846002)(33656002)(561944003)(110136005)(229853002)(966005)(2501003)(316002)(14454004)(6436002)(66066001)(7696005)(76176011)(102836004)(55016002)(6246003)(53546011)(6506007)(6306002)(99936001)(478600001)(99286004)(66946007)(76116006)(7736002)(66446008)(305945005)(64756008)(74316002)(186003)(26005)(86362001)(66476007)(66616009)(66556008)(9686003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR15MB2317; H:SN6PR15MB2382.namprd15.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: c4c6CZ9+q4IJjvT5hCPh3uoy7uEobyPVeaq8i+u4Udgw6u77M4PQTxgM92f2QfjlwN0aJhIduV3hU0UU6Ca9qCHdWic4VJzi6KaMcUa+HvtTAAEFuFGyHdMfXVk1pxo4MFm2cdn3WX6KWrrFJ/xnMaIOr/ikQhQBwA0pqBhpKiaJAXDd8aUhhN315S6upncrIF56tpGT7LvfOS/iEVjNK4slsZFIsi8fWs5FdhKPi4scC/diQeqoSb5/6Pmuki1oPx7eNmNrmCfzv+VujifpASRNwhuZpeYCI/GKAohryI7nvWmgE7yfzwxsCmOGlyW5uKDJIGX/5rpAq14TuzBKwu8rlbVepnVuRp2A3kCZ7lPXH6SU4caamo7ycBopvhmTserSvWDTGJLZjkmKIUtUEdKEyUXRMq1fYBxhWKrTJ0wH+whKXWUXQILdqfgmW9wMKszet2VFcEHPrtHC2Yto4g==
x-ms-exchange-transport-forked: True
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=SHA1; boundary="----=_NextPart_000_01E5_01D59495.6F1C9600"
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ab24c4e0-ba5f-4c56-5c67-08d762d67b2d
X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2019 16:29:22.4178 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 2suxQvyNu8bDlLoXydblcJnhMGe8aN6fkRKRqn979t82k6EgsA8XH7IjfRx+pIV5x3Nupz3Gi0c7rFet7kuM3MUELXsE97jmSynV2zN1+5M=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR15MB2317
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/MAGc7SUauI-01_P4-iNIS6o6FPI>
Subject: Re: [netmod] hex-string as built-in type in future versions of YANG
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Nov 2019 16:29:27 -0000

The licensing information for IEEE YANG models can be found here...
https://github.com/YangModels/yang  (YANG Catalog's github repository)

If you scroll down there is the text of the README.md file, there you will 
find...

In the Models Directory Structure section:
yang/standard/ieee: standard modules (published or drafts) intended for IEEE 
submission [3]

is this information:
[3] IEEE License:

- All files contained within this sub-directory are considered to be intended 
as IEEE Contributions.

- All issues entered into the trouble ticket system for this directory are 
considered to be intended as IEEE Contributions.

- All pull requests submitted for this directory are considered to be intended 
as IEEE Contributions.

- All contributions to IEEE standards development (whether for an individual 
or entity standard) shall meet the requirements outlined in the IEEE-SA 
Copyright
Policy (https://standards.ieee.org/develop/policies/bylaws/sect6-7.html#7)

- Copyright release for YANG modules: Users may freely reproduce the YANG 
modules contained under /standard/ieee/ so that they can be used for their 
intended purpose.

If you really want the official YANG, you can extract the YANG out of the IEEE 
Standard document (yang is included as a txt attachment to pdf).  But the
copyright release is the same.  See 
https://ieeexplore.ieee.org/browse/standards/get-program/page/series?id=68 for 
a place to freely download 802 Standards.

Hope this helps.

Regards,
-scott.



-----Original Message-----
From: netmod <netmod-bounces@ietf.org>; On Behalf Of Vladimir Vassilev
Sent: Wednesday, November 6, 2019 8:30 AM
To: tom petch <ietfa@btconnect.com>;; netmod@ietf.org
Subject: [netmod] hex-string as built-in type in future versions of YANG

Moving a netmod relevant topic from a thread on the bmwg mailing list
https://mailarchive.ietf.org/arch/msg/bmwg/GwkVykKmOX7DFokCFynJVy_ZwZ8

On 29/10/2019 13.32, tom petch wrote:
> Picking up the point below about vlan, this is where the IETF is not
> doing the job it might.  'vlan' appears in many YANG modules with
> several flavours thereof; yes, we might get a better resolution on the
> netmod list but really, apart from our IEEE liaison, I do not know
> where to go for the best advice on this.  I saw this issue surface
> recently on I2RS which, thinking about it, makes sense and there, the 
> outcome was
>       import ieee802-dot1q-types {...      reference
>          "IEEE Std 802.1Qcp-2018: Bridges and Bridged
>           Networks - Amendment: YANG Data Model."; i.e. anything vlan
> we import from the IEEE module.  I did query making an IETF module
> normatively dependent on an IEEE module and the ADs said that that was
> fine so that is the direction in which I think that the IETF should
> go.

I can think of at least 2 issues with importing ieee802-dot1q-types.yang in 
IETF modules. 1. the unclear license under which third party organizations can 
distribute it. 2. Its design

[1] The IETF has liaison with IEEE but the IETF modules are distributed under 
Simplified BSD License while the IEEE ones are not.  It is not clear to me 
what is the effective IEEE license for third party organizations that need to 
distribute the IEEE modules together with the importing IETF ones. If the cost 
of the 5 simple ethernet frame field types - ethertype, vlanid, tpid, pcp, cfi 
is embedding dependency on the conservative IEEE licensing policies I think 
the cost is too high.

[2] Some of the types are based on strings with complex lexical representation 
with canonical form specified in description statement which is neither 
scalable nor automation friendly. For example the "ethertype-type" type (just 
getting started):

... from ieee802-dot1q-types@2018-03-07.yang

   typedef ethertype-type {
     type string {
       pattern "[0-9a-fA-F]{2}-[0-9a-fA-F]{2}";
     }
     description
       "The EtherType value represented in the canonical order defined
       by IEEE 802. The canonical representation uses uppercase
       characters.";
     reference
       "9.2 of IEEE Std 802-2014";
   }
...

IMO typedefs (not types) with constrains specified in a description statement 
especially if they are not part of ietf-yang-types (RFC6991) should be 
avoided. Those types are bad enough even when they are defined in 
ietf-yang-types e.g. "mac-address" AA:BB:CC:DD:EE:FF which is valid for rpc 
"input" data has to be treated as aa:bb:cc:dd:ee:ff (which is the canonical 
representation). The difference comes from the fact that "mac-address" is 
seamlessly converted to lowercase in many tools (not all). Those tools do not 
support the types defined in ieee802-dot1q-types in the same way. So there is 
no "to uppercase"
seamless conversion for ethertype-type and "aB-cD" and "AA-CD" are treated as 
different values and you will have to figure out how your implementation can 
fix this on your own.

IMO ietf-yang-types:mac-address (and many others 
ieee802-dot1q-types:ethertype-type included) can be derived from 
ietf-yang-types:hex-string instead of string. It would be even better if 
"hex-string" is defined as a new built-in type in YANG next with an optional 
"width" sub-statement constraining the number of bits represented.

There are relevant discussions in
https://protect2.fireeye.com/v1/url?k=f32414e9-afadbb20-f3245472-0cc47ad93e1c-3cac03145d53bba2&q=1&e=6bf134b3-1f82-4293-8625-2d5bf67d1c2d&u=https%3A%2F%2Fgithub.com%2Fnetmod-wg%2Fyang-next%2Fissues%2F19 
and
https://protect2.fireeye.com/v1/url?k=df09b925-838016ec-df09f9be-0cc47ad93e1c-3baced0791ac566c&q=1&e=6bf134b3-1f82-4293-8625-2d5bf67d1c2d&u=https%3A%2F%2Fgithub.com%2Fnetmod-wg%2Fyang-next%2Fissues%2F46 
(posted the last paragraph of this proposal there).

/Vladimir

>
> Tom Petch
_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod