Subject: [netmod] YANG identities and identityref's

From: "Acee Lindem (acee)" <[email-masked]>
Date: Thu, 3 May 2018 17:30:01 +0000

Let’s say one define a base identity with a hierarchy of identifyref’s using it. This will allow for augmentation in future models. Should one also define an identityref for the class of unknown identities? Or, should one simply return the lowest parent in the hierarchy matching the value? Many times, this would be the base identity.

Thanks,
Acee

---

From: Ladislav Lhotka <[email-masked]>
Date: Thu, 03 May 2018 19:49:46 +0200

Hi Acee,

I am not sure what you mean by unknown identities. In general, the identity used
as the base of an identityref (or in Xpath functions derived-from/derived-from-
or-self) should be the most general identity that can match at the given place.

Do you have any example illustrating your case?

Lada

On Thu, 2018-05-03 at 17:30 +0000, Acee Lindem (acee) wrote:
> Let’s say one define a base identity with a hierarchy of identifyref’s using
> it. This will allow for augmentation in future models. Should one also define
> an identityref for the class of unknown identities? Or, should one simply
> return the lowest parent in the hierarchy matching the value? Many times, this
> would be the base identity.
>  
> Thanks,
> Acee
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67

---

From: "Acee Lindem (acee)" <[email-masked]>
Date: Thu, 3 May 2018 18:00:01 +0000

Hi Lada, 

So you have a base identify of foo-type and subordinates of foo-type-1, foo-type-2, ... foo-type-9. You have a data leaf that type identityref foo-type but the actual instantiation is not one of the known foo-types. Should a foo-type-unknown be defined to return for this case or should one just return foo-type?  

Thanks,
Acee

On 5/3/18, 1:49 PM, "netmod on behalf of Ladislav Lhotka" <[email-masked] on behalf of [email-masked]> wrote:

    Hi Acee,

    
    Lada

---

From: Ladislav Lhotka <[email-masked]>
Date: Thu, 03 May 2018 20:40:55 +0200

On Thu, 2018-05-03 at 18:00 +0000, Acee Lindem (acee) wrote:
> Hi Lada, 
> 
> So you have a base identify of foo-type and subordinates of foo-type-1, foo-
> type-2, ... foo-type-9. You have a data leaf that type identityref foo-type
> but the actual instantiation is not one of the known foo-types. Should a foo-
> type-unknown be defined to return for this case or should one just return foo-
> type? 

Hmm, the actual instantiation looks like invalid data. If the leaf is an
identityref with "foo-type" as its base, then permitted values are exactly those
"foo-type-[1-9]".

If the server supports a particular type, then I would expect it to implement a
module where the identity corresponding to that type is defined.

Lada

---

From: "Acee Lindem (acee)" <[email-masked]>
Date: Thu, 3 May 2018 18:52:38 +0000

On 5/3/18, 2:40 PM, "Ladislav Lhotka" <[email-masked]> wrote:

The whole reason to use identities rather than enums is to allow for incremental extension. With routing protocols, it is possible if not likely to have an instantiation of a data leaf that is unknown. So, we absolutely need to handle this case. 

Acee 

    Lada

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 03 May 2018 22:23:07 +0200 (CEST)

"Acee Lindem (acee)" <[email-masked]> wrote:
> The whole reason to use identities rather than enums is to allow for
> incremental extension.

Yes.

> With routing protocols, it is possible if not
> likely to have an instantiation of a data leaf that is unknown. So, we
> absolutely need to handle this case.

But the instrumentation code that fills in the value (assuming it is
config false) knows what it is, right?  Then it might be better to
have the vendor define a proprietaty identity that is derived from
foo-type, and let the instrumentation code use that identity.

/martin

>     > On 5/3/18, 1:49 PM, "netmod on behalf of Ladislav Lhotka"
>     > <netmod-bounces@iet
>     > f.org on behalf of [email-masked]> wrote:
>     > 
>     >     Hi Acee,
>     >     
>     >     as the base of an identityref (or in Xpath functions
>     >     derived-from/derived-
>     > from-
>     >     or-self) should be the most general identity that can match at the
>     >     given
>     > place.
>     >     
>     >     > Let’s say one define a base identity with a hierarchy of
>     >     > identifyref’s
>     > using
>     >     > it. This will allow for augmentation in future models. Should one
>     >     > also
>     > define

---

From: "Acee Lindem (acee)" <[email-masked]>
Date: Thu, 3 May 2018 20:30:59 +0000

On 5/3/18, 4:23 PM, "Martin Bjorklund" <[email-masked]> wrote:

    Yes.

    But the instrumentation code that fills in the value (assuming it is
    config false) knows what it is, right?

No - there are multiple devices in the network and they could have different level of support. For example, OSPF will accept OSPF Link State Advertisement (LSA) TLV types that it doesn't yet understand. The OSPF Link State Database can be retrieved via a YANG model. This seems like a pretty basic use case to me. 

  Then it might be better to
    have the vendor define a proprietaty identity that is derived from
    foo-type, and let the instrumentation code use that identity.

Or define the foo-type-unknown in the model since this is such a common case.  

Thanks,
Acee 

    /martin

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Thu, 3 May 2018 23:04:38 +0200

> No - there are multiple devices in the network and they could have different level of support. For example, OSPF will accept OSPF Link State Advertisement (LSA) TLV types that it doesn't yet unders…

If multiple different TLVs that are unknown to the server but that
exist in the link state database all map to a single unknown identity,
then you loose potentially important information. Perhaps you have no
other choice than modeling TLVs using tag numbers instead of
identities.

/js

-- 
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/>