Subject: [yang-doctors] IANA full-registry definition

From: Benoit Claise <[email-masked]>
Date: Sat, 30 Mar 2019 14:44:06 +0100

Hi Doctors,

I was approached by Ruediger with this problem statement. I'll let 
Ruediger extend the problem description if necessary.

When we model an IANA registry with YANG, we model the entries one by 
one as new values are assigned by IANA.
There are some IANA registries with clear ranges. For example, fields 
with a couple of bits.
Would it be possible to have a generic way (YANG 
typedef/identities:whatever) that would report all entries, even the 
ones not yet assigned. The latter would report the observed values.

Regards, Benoit

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Sat, 30 Mar 2019 15:29:41 +0100

Benoit,

I think Ruediger's problem is a BGP module where they modeled BGP
capabilities as identities and they wanted to report the negotiated
capabilities as config false data. This is problematic since not all
capability numbers have an identity defined and the set of known
identities may differ from implementation to implementation.  It would
be much easier and more robust to simply report the capability
numbers. Yes, this is less readable for a human, but much more robust
for automation since clients know they always get a number.

An alternative would be to create a union of an identity and a uint8
but this does not address the problem that the set of identities known
by different implementations can differ. One could fix this problem by
moving from identities to enums since an enum fixes the set of known
enums. Whether it is worth to have a union of enums and numbers needs
to be decided by BGP people. I would suggest to simply define (in
ietf-bgp-types) a

typedef capability {
  type uint8;
  description
    "BGP capability as maintained by IANA in the BGP capability
     code registry";
  reference
    "RFC 5492: Capabilities Advertisement with BGP-4";
}

and then use bt:capability that instead of the much more complicated
identityref { base bt:BGP_CAPABILITY; } to report the BGP capabilities.

/js

On Sat, Mar 30, 2019 at 02:44:06PM +0100, Benoit Claise wrote:
> Hi Doctors,
> 
> I was approached by Ruediger with this problem statement. I'll let Ruediger
> extend the problem description if necessary.
> 
> When we model an IANA registry with YANG, we model the entries one by one as
> new values are assigned by IANA.
> There are some IANA registries with clear ranges. For example, fields with a
> couple of bits.
> typedef/identities:whatever) that would report all entries, even the ones
> not yet assigned. The latter would report the observed values.
> 
> Regards, Benoit
> 
> 
> 
> _______________________________________________
> yang-doctors mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/yang-doctors

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>

---

From: Benoit Claise <[email-masked]>
Date: Sat, 30 Mar 2019 17:31:00 +0100

Jürgen,
> capabilities as config false data.
Bingo.

> This is problematic since not all
Thanks, B.