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

Andy Bierman <andy@yumaworks.com> Fri, 09 July 2021 16:50 UTC

Return-Path: <andy@yumaworks.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 7C5863A2760 for <netmod@ietfa.amsl.com>; Fri, 9 Jul 2021 09:50:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.887
X-Spam-Level:
X-Spam-Status: No, score=-1.887 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.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 lwzrY5fbtCvA for <netmod@ietfa.amsl.com>; Fri, 9 Jul 2021 09:50:17 -0700 (PDT)
Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6E1743A2761 for <netmod@ietf.org>; Fri, 9 Jul 2021 09:50:17 -0700 (PDT)
Received: by mail-lj1-x22f.google.com with SMTP id k8so9011127lja.4 for <netmod@ietf.org>; Fri, 09 Jul 2021 09:50:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dP8IOcvVHWRqay9hPJRfi8ULEH18ZKboUouaA8L0ci4=; b=zNGninQnd94v21FtSLUQa266wCaoY/StW8DMJUFY2Six7Ez5IoJe2kKqkt5rk6/dJL iw8YncaWmcsddKa18CKSSwPaFMpnIYtlkrxLjiddFJ0lyrzs/VJfeRH39C/irEx40poq 6ZIU6LWokfj+OTxwBTDdcd1AuLE/33cwm9+In1Am5ObpuH412cicUV2TVZyKog4GkW6M 7oWdEGTRLgLVkrRt1WjU6qcl2LectYqLbPPx1xmGYNRPohCGZGdp/H9Y8b2nEfM9/W6D ReSxcLXLtWj6ICe74kn3oCHtUe/gGPkxK2LwCNvJJZdXrFciQ6QAvYfQUxcXv6Rnu5Qq 9GNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dP8IOcvVHWRqay9hPJRfi8ULEH18ZKboUouaA8L0ci4=; b=Knr06UA9g5SbkDg+nyt/CSRV5n2n4tG9vY4aVBtSVWzF1ZCFcb2e36+fTDuj/PAuiQ ZkX1LjlY8oZdrq9d9qghNe0RT9Pf/3hjRoWsv0pH7e4uft+MzIRsUe2ATzkGXKGLeb2S KnUqNSmm8t3eSlSxsrDaLKVqX2AuwbV0pg4y7hhiX8JWqDmTRAfHcMjJGBAiiMch9xqs ps7mlraRarinxw+9HGTHCrbnI3dRxkUrZQbKZAMpZhOmQgIbFSGKD3R3Rgj2XoHu5j0o kly8uZeemMAPm0MuJJN6rNmtuTrmc7Vny8JupleEuMrRKed0aYStM2ALIkDrgx9Kv2C/ DZxA==
X-Gm-Message-State: AOAM532CB4EJyq3Bb58U8RdPSrlUnARhB7SHcsJ+HNpvgctQSvI0bF14 53wgb2MxhQabgUfP/CKhKtO4J2Qs8dvaEQfAmvSoMQ==
X-Google-Smtp-Source: ABdhPJwG9tiFkVd+DR/ADtSqA+a1NQCGD22iOuZLoZh8Eu2+xr4YgEQ26ADIc6RYimNBMgkJLKqKbRE+ei3i8Mq5PFA=
X-Received: by 2002:a2e:b60c:: with SMTP id r12mr12679688ljn.55.1625849413892; Fri, 09 Jul 2021 09:50:13 -0700 (PDT)
MIME-Version: 1.0
References: <CABCOCHQB8=kAXRejif=04ThzbSn87oqvDLB5=oJ2FVcAKrSg4Q@mail.gmail.com> <DM4PR11MB5438F5874CDEB4D78C9A5695B5189@DM4PR11MB5438.namprd11.prod.outlook.com>
In-Reply-To: <DM4PR11MB5438F5874CDEB4D78C9A5695B5189@DM4PR11MB5438.namprd11.prod.outlook.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Fri, 09 Jul 2021 09:50:03 -0700
Message-ID: <CABCOCHR8HwLa-PVBTwL67VvFZxegnWC-ZQNNhy_8+M1+QTgeAQ@mail.gmail.com>
To: "Rob Wilton (rwilton)" <rwilton@cisco.com>
Cc: NetMod WG <netmod@ietf.org>, Balázs Lengyel <balazs.lengyel@ericsson.com>
Content-Type: multipart/alternative; boundary="000000000000c60c2905c6b39086"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/TB_iaIH_HGChQ-4nPAMwL4qS1nQ>
Subject: Re: [netmod] yang-instance-file include-defaults leaf
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: Fri, 09 Jul 2021 16:50:23 -0000

On Fri, Jul 9, 2021 at 5:23 AM Rob Wilton (rwilton) <rwilton@cisco.com>
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.
>
>
>
> 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?
>


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




>
>
> Regards,
> Rob
>
>
>

Andy


>
>
> *From:* netmod <netmod-bounces@ietf.org> *On Behalf Of *Andy Bierman
> *Sent:* 08 July 2021 18:16
> *To:* NetMod WG <netmod@ietf.org>
> *Subject:* [netmod] yang-instance-file include-defaults leaf
>
>
>
> 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
>
>
>
>
>