Re: [netmod] type equivalence

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Fri, 19 February 2021 18:19 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 4D8693A12D2 for <netmod@ietfa.amsl.com>; Fri, 19 Feb 2021 10:19:04 -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 AkMZYRHXNbvr for <netmod@ietfa.amsl.com>; Fri, 19 Feb 2021 10:19:02 -0800 (PST)
Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2040.outbound.protection.outlook.com [40.107.22.40]) (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 CB6503A12D5 for <netmod@ietf.org>; Fri, 19 Feb 2021 10:19:01 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TnBgf8W+T/x+7qEHWlhUCuG1k3t0XdAvIycYVEePmz1/4AFqLTuuFb8UJ36Zpbt9RTYQENCR/6bJmkT/Cd7L1/2Tzce6XTklIb4fWJMoJNflM4MGDkhyf+Bj5sNGj2MVAhPL5sKEayQ6sGs0P9kd2CGRyNl4GrPH5+jxw7TBMg9TXillg/teqP8oMjwunULrgGdQosR6oT2vFv8XbW7MkWdEKYl9vbyKerqxcEVXqaimLUKOykEKaFyUbE+TVZJiofqi6NrPVIYHh0QLXuicgahIFZzXKodqNiS65xuWR4qt8ZfmlAkeJrdO7WIoFtimbWBmgIj9Bk80mtzYlwxGog==
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=rA2/Y43TH87LsAROzaKzWT0Bu29Eo9mgodgT17a++k0=; b=U1b58RV5sNVKodZ7LWjJRuoQJ9mmVwop2+4WB87HEHI0eoOBPbMYpFN8h0CfeMu0w51AwRkvlTBAcHh99JwCrsvoIdn6yJGNyhFbJgpkE58qY1BHz9SsLI9HlIWCige/BE/ocCVPGPRlyQXxM2RFCihMksR781oY8ndTwxvM3iYObN1F4bXIlfkRuxQlssNSize3TgsCwNk/uvPDuvm5PsnkMqLfXLp/B0iI51Iv6ADEV+FtJ5YpefGRBd3inJ+AMql4V75HxloyEtM/USkZZw6reE6putyrZj6aGZvheHIRSaSpNb8mnenihdh4Lf25Mh6XbT1qmKPQMELXw19VQg==
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=rA2/Y43TH87LsAROzaKzWT0Bu29Eo9mgodgT17a++k0=; b=SHKIWoHOR26gwJedbk1ejF8/b3oKGpGueA2nJfe6L5iwm8J/GrjZzsQjZOA5CeJ7qha64WSyAfEypWoJnKUQcTGLZOsBSwzuGQoUjhxi6vGmM/FGtRidlJ6fyGnDeoKSOzZdTrLXtllErzGBdMMG6P3mzYW3WUaMFqpexBDQPJg=
Authentication-Results: tzi.org; dkim=none (message not signed) header.d=none;tzi.org; dmarc=none action=none header.from=jacobs-university.de;
Received: from AM0P190MB0641.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:194::23) by AM4P190MB0068.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:5e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27; Fri, 19 Feb 2021 18:18:59 +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.029; Fri, 19 Feb 2021 18:18:58 +0000
Date: Fri, 19 Feb 2021 19:18:58 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Carsten Bormann <cabo@tzi.org>
Cc: netmod@ietf.org
Message-ID: <20210219181858.arafmdtraq4ydir2@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Carsten Bormann <cabo@tzi.org>, netmod@ietf.org
References: <20210219165549.be7l2rbhdqfevhfl@anna.jacobs.jacobs-university.de> <4A8F7739-71AA-4CE0-B9D1-9F24C60B037D@tzi.org>
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <4A8F7739-71AA-4CE0-B9D1-9F24C60B037D@tzi.org>
X-Originating-IP: [212.201.44.244]
X-ClientProxiedBy: AM0PR03CA0070.eurprd03.prod.outlook.com (2603:10a6:208::47) 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 AM0PR03CA0070.eurprd03.prod.outlook.com (2603:10a6:208::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27 via Frontend Transport; Fri, 19 Feb 2021 18:18:58 +0000
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 7c00838a-e0de-40d2-30c8-08d8d502d379
X-MS-TrafficTypeDiagnostic: AM4P190MB0068:
X-MS-Exchange-Transport-Forked: True
X-Microsoft-Antispam-PRVS: <AM4P190MB0068C62D0AB43ACAECCF0E46DE849@AM4P190MB0068.EURP190.PROD.OUTLOOK.COM>
X-MS-Oob-TLC-OOBClassifiers: OLM:9508;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: hufxkAohInOwoehDB1MUAr+5lrxTRwiyUijkYz4XGisOD6wbXhQK6mp9QWCxNDDVSJdqlwy1S6txdmsfNtd9ucYYpPn/xt5X4kzO92DX70cnXS+7S0ClUR44qfY5zJd/Q/rQbUDc+a6ooXO/fxzpR/ey8UgGduzQOKdclxx2fPwNdCgSUMWOnKWJ4c0dcoLQ6csbmQDqlOoNMRid/4Hd/7fUTBsSFaR2HdaXaUTstrpwIg8oUlwP2KSSlOnKQ/Yt8kKJ7hohoM8F7vGh3yBzyZJGaSfvbIs+oy0M5yi6wO3zxFiB5XqeDyRPl59EbC9bkbM/+R+gobf4eTmPk7+9p6FbLLz3G/i6wnepPfGl4xbQ8dD/+AmfFbYkiRvSJch1BZ6jIziNobyjPu2LZDzshCr4Ln7OgVcgXoUmneI4e+zkLDjB2F3h9hunkLxnKH02SB0Cofsr7k+2U6Sm0O/gMCsJGz8b2EpUPn6XYm0b4hUzFoddFkNJ2M5tg8FyUD4CRj9okw7zSrH/CoH/u+SA7nhwShSbEIR3LjBKQmz8dar+lB0yBWLz738rPxyqql1anqjXkpLCHTyqFllre5284fWaJNtZkK0tKXp02+SK8rWpFACJuWqAho3LASMU7lCvcn4ytNf8caR3qaycrlmuDg==
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:(136003)(396003)(39850400004)(346002)(366004)(376002)(4326008)(26005)(83080400002)(6486002)(186003)(66946007)(5660300002)(66556008)(66476007)(16526019)(86362001)(966005)(1076003)(8936002)(53546011)(478600001)(2906002)(786003)(8676002)(956004)(3450700001)(6496006)(316002)(6916009)(52116002); DIR:OUT; SFP:1101;
X-MS-Exchange-AntiSpam-MessageData: pzj1S4YxHI8cnfi+JpnMCoJxdMFcraT8eblzKfGxa4HhHBidnNB/d39gAoh6ya5zoYwVnK7wO3EfsvSqZyO/gwai3JjtMdvYJKOT3WhrRiRJuhPgT2uY838HNt4Xn9RBSNKGOpESOuxu+Mq0eCjaCpNcbU4DtiN6t8NqDmExxbXO4RdGtky1wD8A7t0BFNoocarJRoClf8n9ZxO/BUaWvRyMbRkXPdCgLkk1lkU53nUM/T5onFzKUezPijdyBZPEtYQlyMtaU6kWo2bU+/LojKd/wWDAol6yuoYCpNhQzfTh4K7MTFtX9J2HsN7nB2kq8U4UTt/8SmER+wGnwt3OBvVZJgerQfvDx2qsKtlPiKUGMJP1DCifWDVTcj0tN7IDi57jGLOoxcYcwPadGJpTSsAi/vd5UiUldc8mYai+UTdvvu7wou/gMTinmKyO9QnrmVJ7dal864anq9CdyZpT0g6GmsnksCJR6n4/Yt1Gg4p2kxCgaIXsJ97APL1M9i8QBM5tNVOnOpRJE3LEG8qaqxdnipp5Akn55NEfg1rGP45lnXklis5FZeSC5mykzMQ/X0DMddmz07GSXcJ8IgBH1VzfvzjXGdG+OcVEA+X1MZz3nTl9ivZEI5YBQSGzSkR5uVH67Imbnbr65bnGp68ib/VGdAv9JKsULh7xj4mYhxO5b70AICj6wiB7IpituF7qo02g/t4SsFhrU8/16unmmEgD8NK5tWTvELs4vrX5zdoe2gkJxc8HuVfh4inkx3Lg0FHoH6yDtukuZYQMD0S27x620xKWFEEaOTpNhchg1aYH/OR+qAwHnAmAuRLYA0iibaJWTABW758o9ewYTXdkWj2pKnPBQG5TWeQu7YUoM1LYuosrMmslukDBcAMGFWjxNOEgU8IFVifiS1zOBEsjz0bp7v5yCSzG3P8W1uCer92kH1pPWi+SksQr7zkD2E02QvHtpocoI0+VXH/3MOKVy+wLagE6CEDDJVqK4RSEyjk1P9XXr9+SqtZm117ZiVBwfyKkuKJxU4oc/qvgkXm37eRZvdfVJ414Szd48FxDEeUVNMXe4n6zN+bgVB01jKzqiaTeNXp0hcD9AQpRBY36/9SbLlNSw1JFUATuEwJ2/+9nAeauvGgEX6bbmBM1zdPndJAucU1JbmcK43rbSo+TyZJT3uG3gGu6QR+jVTNPjzOUCaMUU8Z503RFfmm/ugF66V4DEr7EcArGHjDm4AxXZ/SONxBGG0qFjBVAfYqZoZRvREoDZOpX+QB6kp1cgGkVnDUiC6YA+M8BUClUJo4XWs8pvN9fzznSu9S4UfZNQTV2tngS0delBGgAeWM2PqXR
X-OriginatorOrg: jacobs-university.de
X-MS-Exchange-CrossTenant-Network-Message-Id: 7c00838a-e0de-40d2-30c8-08d8d502d379
X-MS-Exchange-CrossTenant-AuthSource: AM0P190MB0641.EURP190.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2021 18:18:58.8795 (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: REYjcGPOzZyQ1TplHdDJ9Hj1Xr/LoTb+7x3D7/RPahL/vaOUTOqklwvwPvWEm0RKJaMqGZQNapzHn3GW/uUOeRnrTrUHT7JNvqnAHRzEMRg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4P190MB0068
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/O2kDW1cJT0Ir8LpRE0otRKqYl-Y>
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, 19 Feb 2021 18:19:04 -0000

I think the CBOR encoding picks different tags depending on the
signedness of the base type and this is why things are not that simple
anymore. For the XML and JSON encodings, all definitions lead to the
same on-the-wire representation, hence the difference is more an
implementation detail. I have no clue what the gnmi people do. The
more diverse encodings we add, the more complex things get.

/js

On Fri, Feb 19, 2021 at 06:24:02PM +0100, Carsten Bormann wrote:
> On 2021-02-19, at 17:55, Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> > 
> > Hi,
> > 
> > can I safely replace
> > 
> >    leaf foo {
> >      type int8 { range "0..100"; };
> >    }
> > 
> > with
> > 
> >    leaf foo {
> >      type uint8 { range "0..100"; };
> >    }
> > 
> > or with
> > 
> >    leaf foo {
> >      type int32 { range "0..100"; };
> >    }
> > 
> > or are these a non-backwards compatible changes?
> 
> I don’t have an answer to that, but would like to point you to the table at the top of page 14 in draft-ietf-core-comi-11.txt [1], which would make the first replacement a non-backwards compatible change in the way we build URIs from that.
> 
> [1]: https://tools.ietf.org/html/draft-ietf-core-comi-11#page-14
> 
> > Note that the value
> > set is always the same, however the underlying base type changes. Did
> > we ever define type equivalence?
> 
> The way unions are handled in YANG gives me the impression that as long as the sets of XML representations generated by the two types are the same, they are equivalent.
> 
> 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/>