Re: [netmod] Comments on draft-ma-netmod-immutable-flag-06

Kent Watsen <kent+ietf@watsen.net> Wed, 26 April 2023 13:23 UTC

Return-Path: <01000187bdbc1dad-12c31976-fb03-4a74-889c-716e69d952fd-000000@amazonses.watsen.net>
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 AA1ECC151547 for <netmod@ietfa.amsl.com>; Wed, 26 Apr 2023 06:23:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.899
X-Spam-Level:
X-Spam-Status: No, score=-6.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=amazonses.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pbTcctlwnxEl for <netmod@ietfa.amsl.com>; Wed, 26 Apr 2023 06:23:56 -0700 (PDT)
Received: from a8-33.smtp-out.amazonses.com (a8-33.smtp-out.amazonses.com [54.240.8.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 39913C151524 for <netmod@ietf.org>; Wed, 26 Apr 2023 06:23:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1682515435; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References:Feedback-ID; bh=HGV2m7hQV+jrRlUdBBuZNUtiAczez0yNI/0YowH3sys=; b=Wds0YpPnQQIT1EMTzDNO3CxAZB6K/O+tPj1LERoe3KZVL4+zTrgQuJF14jsuWT05 BREX0zgX7MQ32JIFTr/oCPDzeNyOZ9yF74OvnS+kFV3ZpZA6ezjE7R24s9o+ZOW2du4 L45VEP5zabYNh/bqubhSDH/5KDP2/T+ZwYd8Z8Hc=
From: Kent Watsen <kent+ietf@watsen.net>
Message-ID: <01000187bdbc1dad-12c31976-fb03-4a74-889c-716e69d952fd-000000@email.amazonses.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_9EE6E6EA-A316-42F2-A83C-0042A42BB803"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\))
Date: Wed, 26 Apr 2023 13:23:54 +0000
In-Reply-To: <20230426121905.cyszfgqwxrlhkhyo@anna>
Cc: "Fengchong (frank)" <frank.fengchong@huawei.com>, "maqiufang (A)" <maqiufang1=40huawei.com@dmarc.ietf.org>, "netmod@ietf.org" <netmod@ietf.org>, "Jan Lindblad (jlindbla)" <jlindbla@cisco.com>
To: Jürgen Schönwälder <jschoenwaelder@constructor.university>
References: <b8e370d2ad5042c99c6f0d98345d3c5b@huawei.com> <C2D8A539-4AF9-44FA-92E8-9A9DC6CE7971@cisco.com> <d37925b807604b76b92cbf2f32341dab@huawei.com> <01000187ae695684-69ae4a4b-eeb9-4827-8b65-ff590ed52db7-000000@email.amazonses.com> <793be10da43c4958aa7565dd8c29f16c@huawei.com> <20230425095020.areq7etekgquaqyi@anna> <01000187b8421975-108a6801-0ab0-4c40-8df9-46702a08d602-000000@email.amazonses.com> <ba0c6cd1ac7646feaf0704a6cdff2a7b@huawei.com> <20230426064438.6rv7bshdvwc44to6@anna> <01000187bd739490-d39c4dd3-ede8-45f0-8f1c-f7992c265749-000000@email.amazonses.com> <20230426121905.cyszfgqwxrlhkhyo@anna>
X-Mailer: Apple Mail (2.3731.400.51.1.1)
Feedback-ID: 1.us-east-1.DKmIRZFhhsBhtmFMNikgwZUWVrODEw9qVcPhqJEI2DA=:AmazonSES
X-SES-Outgoing: 2023.04.26-54.240.8.33
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/FFmwQuX7GrPnh-tFtEnfLQi6f14>
Subject: Re: [netmod] Comments on draft-ma-netmod-immutable-flag-06
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
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: Wed, 26 Apr 2023 13:23:58 -0000


> Where in the NC or YANG RFCs do we talk about immutable data? Where in
> the interfaces data model do we define that the type leaf becomes
> immutable once a line card has been plugged into a slot?

Following is from RFC 7223.  Note that the description statement almost says that the value is immutable:

         leaf type {
           type identityref {
             base interface-type;
           }
           mandatory true;
           description
             "The type of the interface.

              When an interface entry is created, a server MAY
              initialize the type leaf with a valid value, e.g., if it
              is possible to derive the type from the name of the
              interface.

              If a client tries to set the type of an interface to a
              value that can never be used by the system, e.g., if the
              type is not supported or if the type does not match the
              name of the interface, the server MUST reject the request.
              A NETCONF server MUST reply with an rpc-error with the
              error-tag 'invalid-value' in this case.";
           reference
             "RFC 2863: The Interfaces Group MIB - ifType";
         }

Also from RFC 7223, note that the value is used in a "when" expression:

     augment "/if:interfaces/if:interface" {
         when "if:type = 'ianaift:ethernetCsmacd'";

         container ethernet {
             leaf duplex {
                 ...
             }
         }
     }


My assumption (not knowing the true history) is that the "type" node is historically "config false" and, in <operational>, might have origin "learned", or maybe "system".  For some reason that I'm unaware of, it was desirable for the "type" node to appear in <running>, so that it can be, e.g., referenced in "must" and/or "when" statements.  That is, the "type" node in the YANG module was made to be "config true", but the "description" statement says that it is always expected to have the value that is (or will be, for a pluggable card) seen in <operational>.  Presumably, existing server behavior would reject (or ignore) a client's attempt to set the interface's "type" to anything other than it actually is.  If this is all true then all this draft does, for this specific example, is codify the "description" statement text to an "immutable" extension statement, so the behavior can be understood programmatically.

K.