Re: [babel] [netmod] NULL value for uint16

Carsten Bormann <cabo@tzi.org> Tue, 14 September 2021 23:01 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: babel@ietfa.amsl.com
Delivered-To: babel@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B9CAE3A353C; Tue, 14 Sep 2021 16:01:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 UBtaekNt2D1V; Tue, 14 Sep 2021 16:01:16 -0700 (PDT)
Received: from gabriel-smtp.zfn.uni-bremen.de (gabriel-smtp.zfn.uni-bremen.de [IPv6:2001:638:708:32::15]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EB51F3A353B; Tue, 14 Sep 2021 16:01:15 -0700 (PDT)
Received: from smtpclient.apple (p548dcf6e.dip0.t-ipconnect.de [84.141.207.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4H8Jk00N3Vz2xMf; Wed, 15 Sep 2021 01:01:12 +0200 (CEST)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <20210914191618.khcicr6o4x5sdki3@anna.jacobs.jacobs-university.de>
Date: Wed, 15 Sep 2021 01:01:11 +0200
Cc: "netmod@ietf.org" <netmod@ietf.org>, "STARK, BARBARA H" <bs7652@att.com>, Babel at IETF <babel@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <21E40C00-5C1B-4C54-9CDB-B99AC14B1F3E@tzi.org>
References: <AM7PR07MB62482A4271AF1CA5013EB136A0D69@AM7PR07MB6248.eurprd07.prod.outlook.com> <b1b1cd18-537f-561f-dcb1-9aca41b7d3c9@labn.net> <20210910200902.bic4rhyhp75bgsjz@anna.jacobs.jacobs-university.de> <BBC6AA9F-86C1-4A9C-86FD-AD77668CA9D9@gmail.com> <20210913200455.xot7lihpmqiemm5c@anna.jacobs.jacobs-university.de> <DM6PR02MB69248D2780D5C880CC647783C3D99@DM6PR02MB6924.namprd02.prod.outlook.com> <AM7PR07MB6248BBB558136D1E6F8C1549A0DA9@AM7PR07MB6248.eurprd07.prod.outlook.com> <DM6PR02MB692446F49506791E90B0D23EC3DA9@DM6PR02MB6924.namprd02.prod.outlook.com> <20210914171729.ph5q77zm46z3zvxi@anna.jacobs.jacobs-university.de> <FAE5986C-BE56-44A9-A6A5-1A37D9539F61@tzi.org> <20210914191618.khcicr6o4x5sdki3@anna.jacobs.jacobs-university.de>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
Archived-At: <https://mailarchive.ietf.org/arch/msg/babel/T0dLwJdiJgg2eJTUwDKWlBRsS1E>
Subject: Re: [babel] [netmod] NULL value for uint16
X-BeenThere: babel@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "A list for discussion of the Babel Routing Protocol." <babel.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/babel>, <mailto:babel-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/babel/>
List-Post: <mailto:babel@ietf.org>
List-Help: <mailto:babel-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/babel>, <mailto:babel-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Sep 2021 23:01:21 -0000

On 14. Sep 2021, at 21:16, Jürgen Schönwälder <j.schoenwaelder@jacobs-university.de> wrote:
> 
> Carsten,
> 
> whatever you do, you will at the end need an extra bit.

Sure.  There are 65537 values, so you need at least 16.000022 bits :-)

> If BBF already
> defined to use -1, so be it.

That works for me and is consistent with the information model in 9046.

What I find not so great is the side effect of going from uint16 to int32.

I don’t see a big difference between
Optional-uint16 = uint16 / -1
and
Optional-uint16 = uint16 / empty

I do not like

Optional-uint16 = int32

> The alternative is to not instantiate the leaf if there is no value
> and to accept that a client can't tell the difference between 'there
> is no value' and 'the value has been suppressed by authorization'.

Interesting.  I wasn’t aware that this cannot be distinguished in YANG.

But an “empty” would be present if it is chosen, no?

Grüße, Carsten

> 
> /js
> 
> PS: You can define a maybe-uint16 type as a union in YANG but yes
>    there is no syntactic sugar to generalize this.
> 
> On Tue, Sep 14, 2021 at 08:36:12PM +0200, Carsten Bormann wrote:
>> On 14. Sep 2021, at 19:17, Jürgen Schönwälder <j.schoenwaelder@jacobs-university.de> wrote:
>>> 
>>> If other data models use an extended integer range and -1 to indicate
>>> a special case, then this may be a strong reason to do the same in the
>>> IETF YANG data model.
>> 
>> Any data model based on FORTRAN certainly will do.
>> Most other data modeling languages by now should have nullable/optional/Maybe types.
>> 
>> Going from the actual data type, uint16, to int32, just to accommodate the “not present” case, strikes me as a mistake.
>> (Which doesn’t mean that you may not want to do this in an implementation, after having validated the input data.)
>> 
>> Grüße, Carsten
>> 
> 
> -- 
> 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/>
> 
> _______________________________________________
> babel mailing list
> babel@ietf.org
> https://www.ietf.org/mailman/listinfo/babel