Re: [netmod] yang canonical integer format

Robert Varga <> Mon, 06 March 2017 11:13 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 86A5012963E for <>; Mon, 6 Mar 2017 03:13:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id DiPbOt6rgxJv for <>; Mon, 6 Mar 2017 03:13:48 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 4EFF012963D for <>; Mon, 6 Mar 2017 03:13:48 -0800 (PST)
Received: from [] ( []) by (Postfix) with ESMTPSA id C6E8124008B; Mon, 6 Mar 2017 12:13:44 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;; s=mail; t=1488798824; bh=0xu5uR/YLjmgCwWDAVX2dzlWX4UZvm/ySYtBhrfhtvE=; h=Subject:To:References:From:Date:In-Reply-To; b=qweXoGyJJ/RERfmKj0SAvWciBKmDSqSCNJaCzLxU2an2ZZY6SAKeGyzvCStMy0DNb t9gKeUoWJfLzclgPrTJA5zDNPxZ6P/ZsNoaUsAuTQVFRcts6hXe7xuX049NAkl5sn6 CPIGY1jStNK7XyDuYnTLu+/s3EvPJE5u82bk6/z0=
To: Kent Watsen <>, Juergen Schoenwaelder <>, "" <>
References: <20170303155322.GA3345@elstar.local> <>
From: Robert Varga <>
Message-ID: <>
Date: Mon, 6 Mar 2017 12:13:36 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="o8sw4kkgDpajiuBcDtPb3skRtVJaRuccR"
Archived-At: <>
Subject: Re: [netmod] yang canonical integer format
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 06 Mar 2017 11:13:50 -0000


On 03/03/2017 05:52 PM, Kent Watsen wrote:
>>  typedef ether-type {
>>    type uint16 { format "%x"; }
>>  }
>> in plain YANG to make the hexadecimal format the canonical format. Who
>> maintains ideas for the next YANG revision?

This is also useful for other types, for example inet-types:mac-address,
where implementations could use an 'canonical-pattern' type of declaration.

I think this particular idea ties the transport-specific representation
to a type definition -- I mean requiring binary transports to send
uint16s as text is not efficient and they would end up not using the
statement at all. This is also sticky if the transport places additional
restrictions on what is and is not a valid string and reminds me of some
of the 'anyxml' problems...

>> /js
> Ideas for the next revision of YANG are being captured in this tracker:

given YANG is an extensible language, would it make sense to deliver
these outside of YANG revisions?

The main reason for doing so is that these, unlike YANG revisions:
- do not change the meta model of the language
- are not mandatory-to-implement

It will also allow for faster delivery to end users.