Re: [netmod] type equivalence

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Fri, 26 February 2021 14:27 UTC

Return-Path: <J.Schoenwaelder@jacobs-university.de>
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 905863A0C49 for <netmod@ietfa.amsl.com>; Fri, 26 Feb 2021 06:27:55 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham 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 ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kCQMYFxlxid7 for <netmod@ietfa.amsl.com>; Fri, 26 Feb 2021 06:27:53 -0800 (PST)
Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20044.outbound.protection.outlook.com [40.107.2.44]) (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 C685E3A0C44 for <netmod@ietf.org>; Fri, 26 Feb 2021 06:27:52 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IUINov/bksGgW4dg17pb56tEsSsuU4tEQlMNc7XvgjJYwMTiBkgZSpmCnMQ/Okg/zErXYOKD8e2uLT0uR9QC2zUTQn6RqD9QJFHlHzT3AHggdTr9JIkm3yJpW12UxF38P8ulWzcQlQGpduO9AADNta1LhJvQOlYTurxdu05mAfqI75lJqO3wWrfTPsDijHQm1PhiRnYWj/WInciwhUANtvtkra4jbhUxHqpfcqSX/3L8XtPKDVEupXE0ngfaihRr0xwYjEVCz0NX/pdNOCGi/MEuHtlOcnrP2+XarWkrTshWwFG8W63tEVExHiJ9Pg0z9FKkC0jT5gVgc2n1ym5FeQ==
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-SenderADCheck; bh=eIII4I5YKQ4wLrujJvUB1eoWGdy+9JVdjQt68nFTpNc=; b=Ps7QDPaRzOmicWJiq1FoAjM6OEmJlLLzZz51fIOXHmfsT8Itg+V5sXrPDb3saO55QlnuVm8qHhSM80yNWs6uy36P08oTIg+VKv9lCPFXBvbC9RPGAFxIDWXOJve80HfEcDO9JEnjtbpiWhIDmYPYPvZDYi7zanCRSPd6M3kqBW7aIeqGSLdug7wvPJfh2hQAaYPlDpLxGcdg+qHsELf3eUOU5YVF91n6aX5kDWo6+VDLneToGEvbY2tLorvTT2xKHUX4tFNR7oss1vy9DIH/KhRkn6C+Mru4Rgu7jp3o9Lg1uGoXevhGqvovBSwOg+vB54pcsFANfF+Xzc/8ukdNaw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jacobs-university.de; 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=eIII4I5YKQ4wLrujJvUB1eoWGdy+9JVdjQt68nFTpNc=; b=pDNVsM8rtluXBjDIkbXIOJJcFVr1lmQ9XaGdWXC2xSufpvVob7gMpP0rooop8Ozglk3kx61O7xaQeAYCmo0ars6X8BKNZQznyMZl9Vbi//WUrsLKLOQs/5eAVhROzrtPU+PnYq0M+o0iOjT8mhSMZ6ZICOrZKR2M0cHcmSVyEXI=
Authentication-Results: cisco.com; dkim=none (message not signed) header.d=none;cisco.com; dmarc=none action=none header.from=jacobs-university.de;
Received: from AM0P190MB0641.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:194::23) by AM9P190MB1171.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:260::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Fri, 26 Feb 2021 14:27:50 +0000
Received: from AM0P190MB0641.EURP190.PROD.OUTLOOK.COM ([fe80::1ce1:49e3:3e54:804d]) by AM0P190MB0641.EURP190.PROD.OUTLOOK.COM ([fe80::1ce1:49e3:3e54:804d%5]) with mapi id 15.20.3868.033; Fri, 26 Feb 2021 14:27:50 +0000
Date: Fri, 26 Feb 2021 15:27:49 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: "Rob Wilton (rwilton)" <rwilton@cisco.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Message-ID: <20210226142749.ry2pbyym6ernhgi4@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: "Rob Wilton (rwilton)" <rwilton@cisco.com>, "netmod@ietf.org" <netmod@ietf.org>
References: <20210222.104938.680142326480637892.id@4668.se> <20210222100857.ovetw7udo4ccbezx@anna.jacobs.jacobs-university.de> <20210222.111343.254950973345362316.id@4668.se> <04B94A94-236A-44CE-B47C-BE5F36FFF278@tzi.org> <20210222135333.t4hfa3ekguwm33pm@anna.jacobs.jacobs-university.de> <C83451C6-56D2-4A95-A0FE-66197E7DFB59@tzi.org> <20210222141715.vhzqka77yzhbkpst@anna.jacobs.jacobs-university.de> <450E683C-4F47-4314-BA63-DAC17AF60970@tzi.org> <20210224203915.2ysjgjv6izjoh6to@anna.jacobs.jacobs-university.de> <MN2PR11MB4366BD4F7DE5297B38488749B59D9@MN2PR11MB4366.namprd11.prod.outlook.com>
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <MN2PR11MB4366BD4F7DE5297B38488749B59D9@MN2PR11MB4366.namprd11.prod.outlook.com>
X-Originating-IP: [212.201.44.244]
X-ClientProxiedBy: AM0PR02CA0195.eurprd02.prod.outlook.com (2603:10a6:20b:28e::32) To AM0P190MB0641.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:194::23)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
Received: from localhost (212.201.44.244) by AM0PR02CA0195.eurprd02.prod.outlook.com (2603:10a6:20b:28e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Fri, 26 Feb 2021 14:27:49 +0000
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 25243bbd-3722-4140-9dd9-08d8da62b1e1
X-MS-TrafficTypeDiagnostic: AM9P190MB1171:
X-MS-Exchange-Transport-Forked: True
X-Microsoft-Antispam-PRVS: <AM9P190MB11718350C5C8FD67DCE6915EDE9D9@AM9P190MB1171.EURP190.PROD.OUTLOOK.COM>
X-MS-Oob-TLC-OOBClassifiers: OLM:10000;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: rbp673ffSzXgDlxgwPZCWappowI31ruGNJhpiusJDpyNSs6UWMZbESXw3eDX/bqV9iv32Wj9POINXUB3bdBkndKjWkY+m54PdwGtBdKSzEWxU8lALL8Cq5XZadOR79Jviz4oixLr03PVRR3fa8Q1bkSaZ+nZwHGqvzMTvSrIYMqeDAWbFYtA+5xqTb7dMmYomKZ0wgXFnsxFNTnISNBM6dDODlOmioqc9xNcCzQqFvDF16LWOirFu0Pqi8BaWmHCJbA9wIJ5RJOG7x52bTWRKfstIn0ji9fAmBycUTNa4cZ8/gBAsJRRR+mPPk8VRlzUrC3lziYDEf5ytuVSb3ZGHvqX8TaqN/jmmr5iFmRWnfw05N0zLimn4KHdRJXS5DNShcPDmki/NbCgP2C+XoL8PaJ2KpIei49J3oNxzQluNMYvJZy1F8/oztSRcHAX7g/2ZJK6bJfGxSoeNLe3yNEvSKhMbMaI3mHi5hz2cp2JVV7luGWvMg0YOmVba37EZ6wi+YyE89N95dN5K0c6MIuKftKsqeB0Pzn89AW0+OjXPDpcwSFySPAiUI05QuFklYFk/xdeP6xwF2zDfA4iSg2+beYF1MiOhPIO5SW1Fdun0uUsxlh+96vFxHb22ydX1zl1nUWaxowwabntyVXgMWx7oApu0TnjgIK6jhU3El7DCAs=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0P190MB0641.EURP190.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(366004)(346002)(136003)(39850400004)(376002)(186003)(786003)(8936002)(1076003)(316002)(6486002)(2906002)(26005)(16526019)(478600001)(5660300002)(83080400002)(6916009)(3450700001)(956004)(52116002)(6496006)(86362001)(53546011)(4326008)(66476007)(66946007)(8676002)(66556008)(83380400001); DIR:OUT; SFP:1101;
X-MS-Exchange-AntiSpam-MessageData: U7jEDe/wshNR+snPEr87sg52JMXowXBbI9jaoUjyMzMruFiBLCXipUfxEbtOq3Pus14OcDsXeSdwFQL3e58pkOj/LbrT1593Viq875RQdLCdoSCK9s9W0yz9X4T7+BrgJBseisQGWRW2a8kfvRnj34BPltiGlx2BJVj7QvECa5doYUiZxX12ZUSh1NFY/Ayd/2QRDqSka0+kGYJX2OsFaByCqvfyDu+TcCgIguqBeLFkszDvk4FkzhFsTllB2AmpYLYgIN3tpx+IdBqSARN68N/iqhIBmCTUXvfEPHTyMI1Kpzid4WpLehFTL+QpwyIYslpwRGy/h7nQvUQdCgJNHXozbptAC/dMQ1yTG9wFvu2NmSdMdgdxFUTIdm9pcwAa5w+Dv/93rQOsVmSK2kOnHJZcsu/u6sHIG5Efvs1Ci4qnmCqPAEXAfx6QDX1s4viNu6Ycx97hujZmupLh/b7y1yTdPetwqpgyfHgZ67hHvDfHhdh3XHyrE8hf4ahzoPgTEeRA6Qud8pdwhAyfAK8/jd5AlV7ROMexPmDL20k/3uetuGpPz7cr/Py3SKn+DbqqQM9+4KkS1BYiesFK0s9/ig4dTM2yrJMchWElyMIANDHg92AtOmBmSCORa3Cirjrd6DRV4jut6LDFaZU9gLggTL87NOIA7AylXxy3g330OkvYVvhQI1s/XNIGasNbJiXDCpuqK2l+om0UgvaMIJ8FAz9AsbRUGF2qMoUQvP8paj/By/KDwRZ8ltjr2f0BXZuVkmHxNzdPNhb/4Txj9eNR0wJLkZIzhoeXGdMTgVXVd7wBtaZxSWyntynSfHK33Y0/GEI9nOHVdu+4jRob4UenCf4b1j2tyjXkzOemPHjrsfo2HVhjLTg99gES5ZIdzSGFHCel6i8jP3g8//Ji3Cx85xC1YOpzYW/6sxCoEwxflTOiu1YZ1MtFyqreQUwiYl82YMq9AhYXtAky1yGzpDw1ZzslzqvawBGBbRgqpsWuIPq2TAoM0kLGueEILaHt9VvhegK/GfqrYuHxOvx90GYvVJnb0SV5biCyctqwQ7hJ2H8EcoauB1pef1CfpLHA5xaC7Cn4I4uz+cyWBzsLEwprjYrDbso68nEYXwStP9p+6po4bDXMTp2lO2Zsalkypy+sWlGBga18IiOa7fCZqOGpgkt25BOlDWZ96Q56tOG2e+CD6TJ8i/H5vDzMnapUKnlXaQFKrzSD87trxojFbtDSEZXy1A1kUEms/YjE5oAKnvfOFd6N1ubrE+bAxWH7bsbeEzBMehLzx9F9MO6E3VcHThpkZajRKgNb9dsca53NQEJ73sGfYmLSF/OHy8UP6hgW
X-OriginatorOrg: jacobs-university.de
X-MS-Exchange-CrossTenant-Network-Message-Id: 25243bbd-3722-4140-9dd9-08d8da62b1e1
X-MS-Exchange-CrossTenant-AuthSource: AM0P190MB0641.EURP190.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2021 14:27:50.1766 (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: ZarNPh9+LGSniCDatqACbbVRHw+hSAyqa/GWrBQ4N+ZyKQfwvHMyxXHjjkcGgZ07mxQIjjS2Ajk49trZSfCUFSNStatPD/GzWTjWz29n1hU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P190MB1171
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/dMXW3QWvt2lxu8MS1601giXDYOk>
Subject: Re: [netmod] type equivalence
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, 26 Feb 2021 14:27:56 -0000

On Fri, Feb 26, 2021 at 12:21:26PM +0000, Rob Wilton (rwilton) wrote:
> 
> 
> > -----Original Message-----
> > From: netmod <netmod-bounces@ietf.org> On Behalf Of Juergen Schoenwaelder
> > Sent: 24 February 2021 20:39
> > To: netmod@ietf.org
> > Subject: Re: [netmod] type equivalence
> > 
> > Here is an attempt to come up with better wording. If people agree on
> > a new wording, I volunteer to submit an errata.
> > 
> > OLD
> > 
> >    o  A "type" statement may be replaced with another "type" statement
> >       that does not change the syntax or semantics of the type.  For
> >       example, an inline type definition may be replaced with a typedef,
> >       but an int8 type cannot be replaced by an int16, since the syntax
> >       would change.
> > 
> > NEW
> > 
> >    o  A "type" statement may be replaced with another "type" statement
> >       that does not change the semantics of the type or the underlying
> >       built-in type.  For example, an inline type definition may be
> >       replaced with a semantically equivalent typedef derived from the
> >       same built-in type, but an int8 type cannot be replaced by an
> >       int16, since the underlying built-in type would change.
> [RW] 
> 
> Would the text be more clear it is just specified what is allowed, e.g.,
> 
>      o  A "type" statement may be replaced with another "type" statement
>         that resolves to the same underlying built-in type.  For example,
>         ...

Perhaps - but it is not just the built-in type that matters...
 
> What does "semantics of the type" cover?
> 
> If I have this type:
> 
>   typedef "timestamp" {
>     type "string";
>     description
>       "The time of day that an event occurred, in any format";
>   }
> 
> then can I replace it with this definition:
> 
>   typedef "timestamp" {
>     type "string";
>     description
>       "The time of day, and optionally date, that an event
>        occurred, in any format";
>   }

This example seems to be constructed since "in any format" is already
broken to begin with. A more perhaps better example: If you have

    type inet:ipv4-address;

then you can't replace that with

    type inet:ipv6-address;

since that changes the semantics of the type. If you have a counter
that only counts upwards (until it wraps or latches), then you can't
replace it with a gauge that goes up and down. The point is that you
break expectations about the semantics of a value of existing
applications.

In your example, if you have time in any format, then well
interoperability does not seem to be expected in the first place and
then you can start a philosophical discussion whether making something
non-interoperable even more non-interoperable is not just leading to
non-interoperable.

Anyway, the "semantics" part was not the question that triggered this
thread, the question was whether changing built-in types is allowed or
not.
 
> Tangentially, it is worth noting the RFC 8342 also writes about syntactic
> constraints covering types:
> 
> 5.3.  The Operational State Datastore (<operational>)
> 
>    Syntactic constraints MUST NOT be violated, including hierarchical
>    organization, identifiers, and type-based constraints.  If a node in
>    <operational> does not meet the syntactic constraints, then it
>    MUST NOT be returned, and some other mechanism should be used to flag
>    the error.
> 
> I'm not sure how clear RFC 8342 section 5.3 is about returning values
> that can be represented by the underlying built-in-type, but are outside
> the value space defined by a range, length, or pattern statement.
> 
> My memory during the discussions was that it is allowed to return a value
> outside arange, length, pattern statement, as long as it is contained
> in the value space of the built-in-type.  E.g., cannot return 257 in a
> uint8, but can return 11 even if the type range is 1..10.
> 
> But, I'm not sure that is what the text actually states.

Perhaps this requires a separate thread. Perhaps 'syntactic
constraints' was not a good choice and yes different people might
understand 'type-based constraints' differently. RFC 7950 says:

   The following properties are true in all data trees:

   o  All leaf data values MUST match the type constraints for the leaf,
      including those defined in the type's "range", "length", and
      "pattern" properties.

So I am not sure about returning 11 for a range 1..10.

/js

-- 
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/>