Subject: [netmod] yang-instance-file include-defaults leaf

From: Andy Bierman <[email-masked]>
Date: Thu, 8 Jul 2021 10:16:29 -0700

Hi,

The module has this object:

    leaf includes-defaults {
       type enumeration {
         enum report-all {
           value 1;
           description
             "All data nodes SHOULD be included independent of
               any default values.";
         }
         enum trim {
           value 2;
           description
             "Data nodes that have a default defined and where
               the actual value is the default value SHOULD
               NOT be included.";
         }
         enum explicit {
           value 3;
           description
             "Data nodes that have a default defined and where
               the actual value is the default value SHOULD NOT be
               included. However, if the actual value was set by
               a NETCONF client or other management application
               by the way of an explicit management operation the
               data node SHOULD be included.";
         }
       }
       default trim;

The draft is extremely server-centric, like most IETF standards, but this
leaf is too server-centric to ignore.

Consider the possibility that the source of the file is NOT a NETCONF
server.
This data may not be known so the default of "trim" may not be correct.

IMO this leaf is noise because any tool that knows the schema will also
know the YANG defaults.  The solution is incomplete anyway because
the presence of a leaf that has a YANG default is not enough.
The  "report-all-tagged" mode must be used to identify defaults.
IMO this leaf should be removed, but at least add an enum called "unknown".

Andy

---

From: "Rob Wilton (rwilton)" <[email-masked]>
Date: Fri, 9 Jul 2021 12:23:11 +0000

Andy,

Yes, when I suggested this, I was thinking that a boolean flag might be sufficient.  My point being that automatically filtering out default values isn’t always the right thing to do.

E.g., something along these lines:

leaf exclude-defaults {
  type boolean;
  default true;
  description
    “Can be used to reduce the size of the content data file.

      When unset or set to true, data nodes that have a default defined and
      where the actual value is the default value are excluded from the content
      data.

      When set to false, data nodes with default value are not filtered, and
      may appear in the content data.”
}

Would this satisfy your concern?

Regards,
Rob

From: netmod <[email-masked]> On Behalf Of Andy Bierman
Sent: 08 July 2021 18:16
To: NetMod WG <[email-masked]>
Subject: [netmod] yang-instance-file include-defaults leaf

Hi,

    leaf includes-defaults {

       type enumeration {

         enum report-all {

           value 1;

           description

               any default values.";

         }

         enum trim {

           value 2;

           description

               NOT be included.";

         }

         enum explicit {

           value 3;

           description

         }

       }

       default trim;

Consider the possibility that the source of the file is NOT a NETCONF server.
This data may not be known so the default of "trim" may not be correct.

Andy

---

From: Andy Bierman <[email-masked]>
Date: Fri, 9 Jul 2021 09:50:03 -0700

On Fri, Jul 9, 2021 at 5:23 AM Rob Wilton (rwilton) <[email-masked]>
wrote:

> Andy,
>
>
>
> Yes, when I suggested this, I was thinking that a boolean flag might be
> sufficient.  My point being that automatically filtering out default values
> isn’t always the right thing to do.
>
>
>

no.

I am confused as to what problem you are trying to solve here.
There does not seem to be one.

Maybe it is "The reader needs to know if the writer reported defaults or
not".
What problem is solved because the reader knows this info?

There has always been confusion between implementing YANG default behavior
and a protocol that allows a client to request how defaults are handled in
the response.
RFC 6243 is a hack needed because the WG never actually agreed on how
defaults should be treated within a server.

A YANG default is the value that MUST be used in the event the leaf or
leaf-list instance
does not exist.  So the term "defaults present" only really applies to
reporting YANG defaults.
The YANG default behavior is always in effect. Unlike SMIv2 DEFVAL, it is
mandatory to support.

The with-defaults parameter is optional to implement, so it is not even
true to say that
all servers report defaults, let alone say that all YANG instance files are
from NC/RC servers.

For basic-style=report-all, there is never any default suppression.  Every
value, including
missing nodes with YANG defaults, are reported as if they are nodes which
exist.
For this mode, the leafs in this draft are useless.

For basic-style=trim there is default suppression.  A node is considered
not present if it has the YANG default value, even if a client sets it to
the default value.
For this mode, the leafs in this draft are useless. Any leaf that contains
the default value is a YANG default that is being reported.

For basic-style=explicit there is default suppression.  A node is considered
not present if it has not been set by a client, ignoring the YANG default
value.
For this mode, the data reported in the content for this draft are useless.
Any leaf that contains the default value could be a default but it is not if
it was set by a client.  The 'default' attribute must be added to the node
to
identify it as a reported default.

https://datatracker.ietf.org/doc/html/rfc6243#section-6

Andy

>
>
> *From:* netmod <[email-masked]> *On Behalf Of *Andy Bierman
> *Sent:* 08 July 2021 18:16
> *To:* NetMod WG <[email-masked]>
> *Subject:* [netmod] yang-instance-file include-defaults leaf
>
>
>
> Hi,
>
>
>

---

From: Andy Bierman <[email-masked]>
Date: Sat, 10 Jul 2021 09:41:00 -0700

> isn’t always the right thing to do.

The solution is simple.
Get rid of the inappropriate "default trim" statement.

If the leaf is present then it identifies the basic-mode that was used to
include defaults.
If not then the information is either not known, not applicable, or
defaults were not added.

The "default" statement is a bug because there is no default basic-mode.
All of the basic-modes are in use in deployments and no camp has ever
been able to convince the others that theirs is right.

Andy

---

From: Balázs Lengyel <[email-masked]>
Date: Tue, 13 Jul 2021 15:07:35 +0000

Hello Andy,

Looking through the use-cases I think the producer will always know whether it includes default values or not. This is the case if the instance data set is produced by the server e.g. in UC4, UC5,  or if it created by some design activity UC1, UC2, UC3, UC8. (UC6 and UC7 are so broad and loosely defined it is hard to say much about them.)

Once the producer knows whether defaults are included or not it can set the include-defaults accordingly, so the default value for include-defaults is not so important. However, I chose trim as the default because:

*	during the WGLC the draft explicitly stated that defaults SHOULD NOT be included and the WG was happy/ok with that
*	IMHO It is better to have short files, 

Note, I used the term producer, as IMHO the above is true in all cases whether the server produces the file or some design activity creates the server.

Regards Balazs

From: netmod <[email-masked]> On Behalf Of Andy Bierman
Sent: 2021. július 8., csütörtök 19:16
To: NetMod WG <[email-masked]>
Subject: [netmod] yang-instance-file include-defaults leaf

Hi,

    leaf includes-defaults {
       type enumeration {
         enum report-all {
           value 1;
           description

 

Andy

---

From: Andy Bierman <[email-masked]>
Date: Tue, 13 Jul 2021 08:31:35 -0700

On Tue, Jul 13, 2021 at 8:07 AM Balázs Lengyel <[email-masked]>
wrote:

> Hello Andy,
>
> Looking through the use-cases I think the producer will always know
> whether it includes default values or not. This is the case if the instance
> data set is produced by the server e.g. in UC4, UC5,  or if it created by
> some design activity UC1, UC2, UC3, UC8. (UC6 and UC7 are so broad and
> loosely defined it is hard to say much about them.)
>
>
>
> Once the producer knows whether defaults are included or not it can set
> the include-defaults accordingly, so the default value for include-defaults
> is not so important. However, I chose trim as the default because:
>
>    - during the WGLC the draft explicitly stated that defaults SHOULD NOT
>    be included and the WG was happy/ok with that
>    - IMHO It is better to have short files,
>
>
>

I strongly object to having a default-stmt since it does matter and
the usage is incorrect.
If the include-defaults is not set then conveying a default value of 'trim'
is incorrect.
Leaving it out of a representation does not change the semantics of the
model.
The consumer will add that leaf = "trim" if it is missing.

Andy

Note, I used the term *producer*, as IMHO the above is true in all cases
> whether the server produces the file or some design activity creates the
> server.
>
> Regards Balazs
>
>
>
> *Sent:* 2021. július 8., csütörtök 19:16

---

From: "Rob Wilton (rwilton)" <[email-masked]>
Date: Tue, 27 Jul 2021 15:37:56 +0000

Hi Andy, Balazs,

So, the reason that I want a flag to indicate whether default values are in use is because of this definition of operational in RFC 8342:

   Requests to retrieve nodes from <operational> always return the value
   in use if the node exists, regardless of any default value specified
   in the YANG module.  If no value is returned for a given node, then
   this implies that the node is not used by the device.

It was written this way because otherwise a consumer of operational data cannot differentiate between:

(i)                  This value is not present because it matches the default value specified in the YANG module, and

(ii)                This value is not present because the server has failed to return it for some reason (e.g., perhaps the daemon that would have provided this value is down or not available, or perhaps it is a bug, or perhaps it is not implemented and is a missing deviation).

So, I think that in some cases, the absence of a data node does not necessarily mean that the default value is in effect, and I wanted the instance-data document to be able to contain and correctly report this data.

I think that this behaviour could be captured by a single leaf.  Another way of articulating this would be:

leaf in-use-values {
  type boolean;
  default false;
  description
    “Only if set to true, the absence of a value in the
     instance data for a given data node implies that the
    node is not used rather than implicitly taking the
     default value specified by any corresponding
    ‘default’ statement specified in the YANG schema.”;
}

With this, I’m not sure whether we need the “includes-default” leaf currently specified in the draft, but if we do, then I would think that leaf should be entirely optional, i.e., without the default “trim”.

Regards,
Rob

From: Andy Bierman <[email-masked]>
Sent: 10 July 2021 17:41
To: Rob Wilton (rwilton) <[email-masked]>
Cc: NetMod WG <[email-masked]>; Balázs Lengyel <[email-masked]>
Subject: Re: [netmod] yang-instance-file include-defaults leaf

On Fri, Jul 9, 2021 at 5:23 AM Rob Wilton (rwilton) <[email-masked]<mailto:[email-masked]>> wrote:
Andy,

The solution is simple.

If the leaf is present then it identifies the basic-mode that was used to include defaults.
If not then the information is either not known, not applicable, or defaults were not added.

Andy

leaf exclude-defaults {
  type boolean;
  default true;
  description

Regards,
Rob

From: netmod <[email-masked]<mailto:[email-masked]>> On Behalf Of Andy Bierman
Sent: 08 July 2021 18:16
To: NetMod WG <[email-masked]<mailto:[email-masked]>>
Subject: [netmod] yang-instance-file include-defaults leaf

Hi,

    leaf includes-defaults {

       type enumeration {

         enum report-all {

           value 1;

           description

               any default values.";

         }

         enum trim {

           value 2;

           description

               NOT be included.";

         }

         enum explicit {

           value 3;

           description

         }

       }

       default trim;

Andy

---

From: Andy Bierman <[email-masked]>
Date: Tue, 27 Jul 2021 09:59:55 -0700

Hi,

None of this addresses my point that a default value of "trim" is not
appropriate.
Simply remove the default-stmt so that a missing leaf instance means that
no information is provided, rather than meaning defaults were added for
basic-mode=trim.

Andy

On Tue, Jul 27, 2021 at 8:38 AM Rob Wilton (rwilton) <[email-masked]>
wrote:

> Hi Andy, Balazs,
>
>
>
> So, the reason that I want a flag to indicate whether default values are
> in use is because of this definition of operational in RFC 8342:
>
>
>
> (i)                  This value is not present because it matches the
> default value specified in the YANG module, and
>
> (ii)                This value is not present because the server has
> failed to return it for some reason (e.g., perhaps the daemon that would
> have provided this value is down or not available, or perhaps it is a bug,
> or perhaps it is not implemented and is a missing deviation).
>
>
>
> So, I think that in some cases, the absence of a data node does not
> necessarily mean that the default value is in effect, and I wanted the
> instance-data document to be able to contain and correctly report this data.
>
>
>
> With this, I’m not sure whether we need the “includes-default” leaf
> currently specified in the draft, but if we do, then I would think that
> leaf should be entirely optional, i.e., without the default “trim”.
>
>
>
> Regards,
> Rob
>
>
>
>
>
> *From:* Andy Bierman <[email-masked]>
> *Sent:* 10 July 2021 17:41
> *To:* Rob Wilton (rwilton) <[email-masked]>
> *Cc:* NetMod WG <[email-masked]>; Balázs Lengyel <
> [email-masked]>
> *Subject:* Re: [netmod] yang-instance-file include-defaults leaf
>
>
>
>
>
>
>

---

From: "Rob Wilton (rwilton)" <[email-masked]>
Date: Tue, 27 Jul 2021 17:47:07 +0000

Hi Andy,

The comment at the end of my email was:
“With this, I’m not sure whether we need the “includes-default” leaf currently specified in the draft, but if we do, then I would think that leaf should be entirely optional, i.e., without the default “trim”.”
Regards,
Rob

From: Andy Bierman <[email-masked]>
Sent: 27 July 2021 18:00
To: Rob Wilton (rwilton) <[email-masked]>
Cc: Balázs Lengyel <[email-masked]>; NetMod WG <[email-masked]>
Subject: Re: [netmod] yang-instance-file include-defaults leaf

Hi,

None of this addresses my point that a default value of "trim" is not appropriate.
Simply remove the default-stmt so that a missing leaf instance means that
no information is provided, rather than meaning defaults were added for basic-mode=trim.

Andy

On Tue, Jul 27, 2021 at 8:38 AM Rob Wilton (rwilton) <[email-masked]<mailto:[email-masked]>> wrote:
Hi Andy, Balazs,

leaf in-use-values {
  type boolean;
  default false;
  description

Regards,
Rob

From: Andy Bierman <[email-masked]<mailto:[email-masked]>>
Sent: 10 July 2021 17:41
To: Rob Wilton (rwilton) <[email-masked]<mailto:[email-masked]>>
Cc: NetMod WG <[email-masked]<mailto:[email-masked]>>; Balázs Lengyel <[email-masked]<mailto:[email-masked]>>
Subject: Re: [netmod] yang-instance-file include-defaults leaf

The solution is simple.

Andy

leaf exclude-defaults {
  type boolean;
  default true;
  description

Regards,
Rob

Hi,

    leaf includes-defaults {

       type enumeration {

         enum report-all {

           value 1;

           description

               any default values.";

         }

         enum trim {

           value 2;

           description

               NOT be included.";

         }

         enum explicit {

           value 3;

           description

         }

       }

       default trim;

Andy

---

From: Andy Bierman <[email-masked]>
Date: Tue, 27 Jul 2021 11:11:28 -0700

On Tue, Jul 27, 2021 at 10:47 AM Rob Wilton (rwilton) <[email-masked]>
wrote:

> “With this, I’m not sure whether we need the “includes-default” leaf
> leaf should be entirely optional, i.e., without the default “trim”.”
>

OK then we are in agreement about the default-stmt.

WRT:

     the absence of a data node does not necessarily mean that the default
value is in effect,

Agreed. However this is not a server-wide corner-case, so a global flag
does not really help.
Even if the server is adding defaults, it may not know the current "in-use"
value for 1 leaf.
Following NMDA rules, the server does not report anything.  Note that this
is a corner-case within
NMDA <operational> and has nothing whatsoever to do with the YANG instance
file RFC.

The solution to this NMDA problem is to report the unknown leaf with an
attribute that indicates "no-data".
Otherwise a missing leaf with a YANG default will be incorrectly
interpreted as an "in-use" value.

Andy

> *Sent:* 27 July 2021 18:00
> *Cc:* Balázs Lengyel <[email-masked]>; NetMod WG <
> [email-masked]>

---

From: Balázs Lengyel <[email-masked]>
Date: Wed, 28 Jul 2021 21:56:41 +0000

Hello Andy,

I will remove the “default trim; “

Balazs

Sent: 2021. július 27., kedd 19:00

Hi,

 

Andy

On Tue, Jul 27, 2021 at 8:38 AM Rob Wilton (rwilton) <[email-masked] <mailto:[email-masked]> > wrote:

Hi Andy, Balazs,

leaf in-use-values {

  type boolean;

  default false;

  description

}

Regards,
Rob

From: Andy Bierman <[email-masked] <mailto:[email-masked]> > 
Sent: 10 July 2021 17:41
To: Rob Wilton (rwilton) <[email-masked] <mailto:[email-masked]> >
Cc: NetMod WG <[email-masked] <mailto:[email-masked]> >; Balázs Lengyel <[email-masked] <mailto:[email-masked]> >
Subject: Re: [netmod] yang-instance-file include-defaults leaf

On Fri, Jul 9, 2021 at 5:23 AM Rob Wilton (rwilton) <[email-masked] <mailto:[email-masked]> > wrote:

Andy,

 

The solution is simple.

 

Andy

leaf exclude-defaults {

  type boolean;

  default true;

  description

      data.

}

Regards,
Rob

From: netmod <[email-masked] <mailto:[email-masked]> > On Behalf Of Andy Bierman
Sent: 08 July 2021 18:16
To: NetMod WG <[email-masked] <mailto:[email-masked]> >
Subject: [netmod] yang-instance-file include-defaults leaf

Hi,

    leaf includes-defaults {
       type enumeration {
         enum report-all {
           value 1;
           description

 

Andy

---

From: Balázs Lengyel <[email-masked]>
Date: Wed, 28 Jul 2021 22:07:48 +0000

Hello Rob,

Removing the “default trim;” will address Andy’s comment.

Your in-use-values is very specific to one of the use-cases: reading/documenting operational values. It is not useful for the other use-cases. I think the “documenting operational datastore” use-case could be handled by indicating the includes-defaults=report-all. Case (i) would contain the value case (ii) will not.

Regards Balazs

From: Rob Wilton (rwilton) <[email-masked]> 
Sent: 2021. július 27., kedd 17:38
To: Andy Bierman <[email-masked]>; Balázs Lengyel <[email-masked]>
Cc: NetMod WG <[email-masked]>
Subject: RE: [netmod] yang-instance-file include-defaults leaf

Hi Andy, Balazs,

leaf in-use-values {

  type boolean;

  default false;

  description

}

Regards,
Rob

 

Andy,

 

The solution is simple.

 

Andy

leaf exclude-defaults {

  type boolean;

  default true;

  description

      data.

}

Regards,
Rob

Hi,

    leaf includes-defaults {
       type enumeration {
         enum report-all {
           value 1;
           description

 

Andy