Re: [netmod] Modeling unknown bits in YANG (draft-haas-netmod-unknown-bits-00)

Jürgen Schönwälder <j.schoenwaelder@jacobs-university.de> Fri, 27 January 2023 20:18 UTC

Return-Path: <jschoenwaelder@constructor.university>
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 D0C79C1516F3 for <netmod@ietfa.amsl.com>; Fri, 27 Jan 2023 12:18:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.648
X-Spam-Level:
X-Spam-Status: No, score=-1.648 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=jacobsuniversity.onmicrosoft.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 82iltzU1qqVz for <netmod@ietfa.amsl.com>; Fri, 27 Jan 2023 12:18:40 -0800 (PST)
Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2071.outbound.protection.outlook.com [40.107.13.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A08ECC15170B for <netmod@ietf.org>; Fri, 27 Jan 2023 12:18:38 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DZU27eeF0toenSXTPCFGMNOGk7nLGIrT+dJmTWK8VX5mFkmF+Ot/bxlb+t+6XTyt7P+hAFkk1blhVN8aduU4rCKCtEkqcNdDloZKB7hj/mHy4dNF25795DbrEcyDSx5ncZiX82z8mCpYkB1rPQsJGvi7H2OmSSWVA/eFQJmnl4fGKl2LUo3IxSK/d6cfQ7X+oJJNesb+om2xkXB6ZAMJPfjvaC4KhTDLgBaLkZW5bq48c5NSVAjze+3d0XmuEqIPXFhlnaXI0NZMJ6dY4FbzB5hp4epF8eO+5ZeJapN2j0KaCvAJ0RAAKsNGpoSR/S+k5CWTZO0UdfgwSXUZbk890Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lNmNndjh886vprBbOnqL6kj9erECNdONId8KRdy93lM=; b=itCOhPpQjpG93XOJKMEn3h5WMluvt0egBWv+D0nokh2hy0FhUxN+mQEjVvSR10EPeAuKcevgDLQmVSzR4LSHlaMyj0zbrxiYO5PBQGsm3yjkJq1nsUKNz3CqSnJjejIic7kUrh5/ME+mI70Jy3jsY4Hma6UyKp5urVLx+olK4Pjl87868O+khPiwlvNkeH/jvG9DJc5b51KHTgr6tPjyQa3mPlvBZ+7K71vkHJe9OsnpTYFfkbllFy5VJBqEt4RqyFbxy4vylKZ25JpzIjoaIkHoh1q5VCf3CEd6SY7KAOahQAPG0XbD5raNnu8YhbmGoAJxFmd1lhZ97FZtGP6p3A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=constructor.university; dmarc=pass action=none header.from=jacobs-university.de; dkim=pass header.d=jacobs-university.de; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jacobsuniversity.onmicrosoft.com; s=selector2-jacobsuniversity-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lNmNndjh886vprBbOnqL6kj9erECNdONId8KRdy93lM=; b=Drc6k7kShBobUAQRGX+R+1prT20W64mkV3xP8+f0Tngf3mSkuJdJ+lwLMj6UMD7s394W0pRQ2VIH+WtyQ3uVESY3rr8Ye9QIIAhrQY+XIvg4SlyUXrrN2ecKlZIK60rjaN1/Bg7Ymv3ipt14d9YpnegceWNpfiQ+LafeX5glSa4=
Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jacobs-university.de;
Received: from GVXP190MB1991.EURP190.PROD.OUTLOOK.COM (2603:10a6:150:3::6) by DB8P190MB0620.EURP190.PROD.OUTLOOK.COM (2603:10a6:10:123::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.25; Fri, 27 Jan 2023 20:18:33 +0000
Received: from GVXP190MB1991.EURP190.PROD.OUTLOOK.COM ([fe80::9c2e:527:d0b2:f570]) by GVXP190MB1991.EURP190.PROD.OUTLOOK.COM ([fe80::9c2e:527:d0b2:f570%9]) with mapi id 15.20.6002.033; Fri, 27 Jan 2023 20:18:33 +0000
Date: Fri, 27 Jan 2023 21:18:32 +0100
From: Jürgen Schönwälder <j.schoenwaelder@jacobs-university.de>
To: Jeffrey Haas <jhaas@pfrc.org>
Cc: netmod@ietf.org
Message-ID: <20230127201832.fpxs5xj3yczqjl36@anna>
Reply-To: Jürgen Schönwälder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Jeffrey Haas <jhaas@pfrc.org>, netmod@ietf.org
References: <20230126205157.GC27893@pfrc.org> <20230126224033.wmogu3borbctlcaz@anna> <20230127143343.GA12211@pfrc.org>
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230127143343.GA12211@pfrc.org>
X-ClientProxiedBy: AM0PR01CA0173.eurprd01.prod.exchangelabs.com (2603:10a6:208:aa::42) To GVXP190MB1991.EURP190.PROD.OUTLOOK.COM (2603:10a6:150:3::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: GVXP190MB1991:EE_|DB8P190MB0620:EE_
X-MS-Office365-Filtering-Correlation-Id: 1f32dd4f-deb9-4f5f-79fc-08db00a3a9ca
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: dYUFtDhuCyNBGUOmRh5BUyUE8lXwgQCDCf3eY4rjQaWb362YgQVX/Bz0gwPNCMDMa7nQ0sd2NYwKLdAcU4c0/VIh1drTawZm9nW+ZZhNR/wSjX6VxAQk5w2aBp3n5QY/raIlZd2d2FrwJA6D/Om4O18vwk4NPDp0YRL1S94nFMIb9Ru1DG2SilLrFF32yu+rMVI1ubtF7UtDy0HMKdMTKFrGxUF29eIYL2oQjHzjvNFkS62eAB0TBye20kmt4ejzqQXnGidQwX877cdvNrV2DkglbMRD0v0rZYJaJmkWo1HgqIbPvzkoNzv4kKFpimq091h1xpGln4LKllXWSZX8P7Jv+4a0Ak0D0KNFXDh1UParjoHrLdbUY5wAX3O2vOiYYfv+eoQ3YDrGo86ZaMcVL4IjbYNS30cL+0QweikeYGVIwQ5wRLr1+UDEix1n6rnqtba3yChBdUYfm/LHeOp8Pwcz57XZmG+6KahlxVousn9bySlkdlxFysWJj9SOGT4ic7IekdCJtvPtpp+WVJoKEZl31KWmGk7mMieah70/P7RElPj65sZnGpoF+rzwPnHwbmQwta8RTfSU1e/KfNhVScfM9W+sWIrW+mQtnUHSm+uCXD1XizjhHDfGEu7UNk1YuXA/LmL9gBm84qlQitzwaMnTwhEDRVBdJcDrkJTa2Nnlko75ZhbDEc3D4YuI/ltCR68TfhwQVlTlztA8g2sw1mOcdJmoafnn/S0T4RZpGus=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:GVXP190MB1991.EURP190.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230025)(7916004)(376002)(136003)(39850400004)(346002)(366004)(396003)(451199018)(66946007)(66556008)(66476007)(6916009)(8676002)(4326008)(38100700002)(38350700002)(41300700001)(786003)(316002)(6486002)(478600001)(85202003)(186003)(1076003)(9686003)(26005)(6512007)(6506007)(52116002)(66574015)(42882007)(83380400001)(40140700001)(33716001)(85182001)(3450700001)(83170400001)(2906002)(8936002)(5660300002)(41320700001); DIR:OUT; SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: 2uPGbpycgpickxhD00L4nZjM3XNd8wRuB3QZP0iGZFhPs8Or4sQxtt9n8WL9EW2FEOhlS4atTRXdC8CY5lrNe6u5tvb/8WXoh50cBxYesyoRUoXpkMtzqe+1BEMnhaMCfeM/hcRX6WEIfzuKf1hGnCLLy8C6PrwKwhu3HqDpfP4J5cVX4nNDjeOCDDZmgRYwU0uGAQMl8GP4bXgpWw7hjxG9V2v+BO0GPsPPBDLvefjuACof8hDeRNJHRMJoryD5phrLYe7ckhZmoo16l7uPkT8w9/iq6eUpsXfG/2Per2i/9yjCG13gUJ2gcMF8k6hsSufc6pi17K/RqUH9X0XVqs0uT0TSCWOP22vNX+CMmeiQ15i18shiwARZCmBvCZ8kavdrzeS2WCj9RJtStVPJYSkIV+omddTy9R/p5rr3daaaO9da8ErFiJfbX59RuVgAq92HyFBHyAOgDBDjaavTHruICOJsO5XEkm0d+M1AkqvUxX6I//XuCqorGXU15U/TpZUS3A0itTth61bJHIMvjqq5jKtMbVLEJQ6LMFQWcYdhGOxuc5BSZH6G+aBFaqSbxx9VBLb3YAa7qXAR5DHl3tDh/ZU/wzowb4BZw37/k+aNNERe6MicqBrdE7E38lnQUvgeqtAyj5+lolur5mDaVreHc+TCDQ9tcCyjrPID0y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AuthSource: GVXP190MB1991.EURP190.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2023 20:18:33.3688 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f78e973e-5c0b-4ab8-bbd7-9887c95a8ebd
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3ah/t5XcF1UvKqJTcd+LBXkYkt6ndYfxzn1Jh/LNyC7Em2zT4owFnVf4uTuqq0KBHJCOjfxQE5VMQjvrB8yyQNZFpIrIUU3U2S5hHOUt8FM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8P190MB0620
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/ugkLPEOPQObXzzUr1T8Bi-LeMso>
Subject: Re: [netmod] Modeling unknown bits in YANG (draft-haas-netmod-unknown-bits-00)
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: Fri, 27 Jan 2023 20:18:44 -0000

On Fri, Jan 27, 2023 at 09:33:43AM -0500, Jeffrey Haas wrote:
> Jürgen,
> 
> Thank you for your comments.
> 
> On Thu, Jan 26, 2023 at 11:40:33PM +0100, Jürgen Schönwälder wrote:
> > On Thu, Jan 26, 2023 at 03:51:57PM -0500, Jeffrey Haas wrote:
> > - I suggest to avoid talking about displaying data, the verb 'display'
> >   is never used in RFC 7950.
> 
> What is the suggested verbiage for such things?

Depending on context, I think it is 'modeling' when it is about
choosing the type or 'rendering' / 'representing' when it is about how
a type's value is rendered (in XML). Some proposals:

   When bits that are currently RESERVED or otherwise unassigned by the
   protocol are received, being able to display them is necessary in
   YANG operational models.

   When bits that are currently RESERVED or otherwise unassigned by the
   protocol are received, being able to model them is necessary in
   YANG operational models.


   In that typedef, the "flags" leaf could only display
   position 0, the "restart" named bit.  The implementation couldn't
   display that the 'N' bit was sent in the protocol.

   In that typedef, the "flags" leaf could only represent
   position 0, the "restart" named bit.  The implementation couldn't
   represent that the 'N' bit was sent in the protocol.


   One solution to modeling unknown bits is to have a subsequent leaf
   whose purposes is only to display unknown bit mappings.

   One solution to modeling unknown bits is to have a subsequent leaf
   whose purposes is only to model unknown bit mappings.


   The only purpose of such
   unknown named bits is to display fields that may later be assigned
   during maintenance of the protocol.

   The only purpose of such
   unknown named bits is to represent fields that may later be assigned
   during maintenance of the protocol.


   Only the bits received in the protocol that aren't
   recognized would be represented in the protocol-specific "unknown-
   flags" leaf, or similar.

   Only the bits received in the protocol that aren't
   recognized would be represented in the protocol-specific "unknown-
   flags" leaf, or similar.

[...]

> The "more compact representation" also doesn't have any guidance that I'm
> aware of for general YANG modeling.  For example, if the field in question
> can fit into one of the unsigned integer types, good advice may be to pick
> the smallest unsigned integer type that can hold it.  The place where I
> expect there to be some content is whether you start such a bit vector's
> position 0 in the most significant bit, or position the bit vector's last
> bit in the least significant bit position?  (Shove to the left or right.)
> I've seen both forms in implementations.  It's also been the source of bugs
> in both forms and sometimes seen in SNMP MIB implementation issues.

I fear there is no common guidance and I agree that this a source of
trouble, in particular if these details are also left undefined in the
description statement.
 
> What I would have preferred to exist in the YANG language is a bits type
> that provides for automatic default naming for unassigned positions.  Thus,
> using your example:
> <flags>restart b1</flags>
> 
> I understand the motivations to not do this since there's a desire to have
> stable naming for the position 1 element.  Thus, we're driven to this
> discussion.

I assume there are use cases where this would be useful and perhaps
others where it is less so. But more likely nobody thought about this
13 years ago. I do not know whether we have a YANG next issue for this
but this may be an issue worth to look at if there is ever another
version of YANG.

> The motivation for the unknown-flags representation is the expectation that
> they are unusual, and it should be trivial to note the things that are
> unexpected.  One should not have to dig through the raw bits to find that
> there's one that doesn't have a mapping.  In your example above, seeing b0
> means I have to know that "restart" is given position 0 and is expected, but
> that "b1" hasn't been assigned anything.
> 
> Fundamentally, the contents of unknown flags would be, in C syntax:
> unknown_flags = ~known_flags & received_value

Yes, understood.

/js

-- 
Jürgen Schönwälder              Constructor University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>