Re: [netmod] [core] CBOR YANG encoding of union & bits [draft-ietf-core-yang-cbor-12]

Andy Bierman <andy@yumaworks.com> Fri, 08 May 2020 03:27 UTC

Return-Path: <andy@yumaworks.com>
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 DE0583A0EBC for <netmod@ietfa.amsl.com>; Thu, 7 May 2020 20:27:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.887
X-Spam-Level:
X-Spam-Status: No, score=-1.887 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.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 VfL_13FcQm8C for <netmod@ietfa.amsl.com>; Thu, 7 May 2020 20:27:47 -0700 (PDT)
Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6D9953A0ED9 for <netmod@ietf.org>; Thu, 7 May 2020 20:27:47 -0700 (PDT)
Received: by mail-yb1-xb31.google.com with SMTP id v9so174698ybq.13 for <netmod@ietf.org>; Thu, 07 May 2020 20:27:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kYAIPQbrRCti9atcryh65k++mW+h3/kojqvNwni+yeo=; b=uEsFDqe15GzD9YPvUwgHHJ790VgP94yTy56SiL0sShCuj0MQC2/IaM8Z+sLuF3FrWZ Nmc/CW5tOy2LUmAwB5zLQdmO2dZlTE0d8kHql+l0VZPMLCSvOby7T5hvaTm1EEvM2FUz BltIstSc8PeNRYiYC26bcgkvoishOaFaAY4WDCPmo92blDeqKrnrapKXToNJz+M5Y/Lp CzNmsC+7Gyxxi8U8WT3HzL5TVpFW1Z2jyOLHoDiQB2byDbxFTMqqBSVfhmFrSsqfyDaD dzg8vSTAA+sW0QzkU79yYAHq8b84XHc7veo6iH900bXW4fHoWgRUYMDsnNMqumxfVDVG nd1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kYAIPQbrRCti9atcryh65k++mW+h3/kojqvNwni+yeo=; b=a8rFtK8euJK4+aQijmbb1PSWCXqbbZ7GBnX7zZ7FhPs3HpLjkLWVJQPuVev8ycwkGk qJ71v3iTgWdgbXa/BPFR84Gtb7jO2KVUu8NuKLgFlyZ+RWnSGK2mxJ8Cv7VOhUmYIqYD QSb6E2fXiz0dUFth6j3cT6mwplXbIDZEYFk0mLc4C/KzvO+EVLID5V2MW2GqbCQVlZ2Y NrVgOyANjme0J+zJjONPItEeoNqMuQ9FnhVyQAArxXKJyIKk3t8EZPmJ9tK8lVnHML2O 360badXOafuA4PiGud0Nrxvo4oF+usJnAThjmPQnIf37L5j1xllgzaZ+oq/I55oxuq5s xxDA==
X-Gm-Message-State: AGi0PuZOILzqxjz/LXvoIgHuzhLloNVJ0fYh6IeMB45gj4AGEgcuuH70 tj35sGi6uUPMsoc7uSLJhhG1yj8b00ulKBtVR2UmH9ko7cA=
X-Google-Smtp-Source: APiQypJyNNpM4IAsMqwtpvGXQv0R/WgwVJhuP7WcbsuoEmLHrB8YDy455MqKyK76BH3cCvGUdul65w4GrZTrK740vKA=
X-Received: by 2002:a25:1f05:: with SMTP id f5mr1305468ybf.44.1588908466108; Thu, 07 May 2020 20:27:46 -0700 (PDT)
MIME-Version: 1.0
References: <BY5PR11MB4355C26250C9CF46713C9956B5A40@BY5PR11MB4355.namprd11.prod.outlook.com> <D66596CE-7F5C-4562-89A4-48FCE96D0E18@tzi.org> <28486.1588785684@localhost>
In-Reply-To: <28486.1588785684@localhost>
From: Andy Bierman <andy@yumaworks.com>
Date: Thu, 07 May 2020 20:27:35 -0700
Message-ID: <CABCOCHRRDYDomEPctAHaHf+MxS2qXab1J4o=_LUEWcJ2=by5Ww@mail.gmail.com>
To: Michael Richardson <mcr+ietf@sandelman.ca>
Cc: Carsten Bormann <cabo@tzi.org>, "netmod@ietf.org" <netmod@ietf.org>, "core@ietf.org" <core@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000b41f1e05a51a94e1"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/zk90v6oRT5cT8eDkA_DC6DeMzvk>
Subject: Re: [netmod] [core] CBOR YANG encoding of union & bits [draft-ietf-core-yang-cbor-12]
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, 08 May 2020 03:27:54 -0000

On Wed, May 6, 2020 at 10:22 AM Michael Richardson <mcr+ietf@sandelman.ca>
wrote:

>
> Carsten Bormann <cabo@tzi.org> wrote:
>     >> Or, if it is supported by the language then is it reasonable that
>     >> implementation SHOULD support it?  In which case I think that we
> might
>     >> need a second encoding of bits that supports this pathological case.
>     >> Perhaps an array of 'set' bit positions, or alternatively the union
>     >> string encoding of bits could be used.
>
>     > This could reduce the attack vector by malicious YANG specification,
>     > but I think an arbitrary limit (such as the 256 mentioned above)
> should
>     > work, too.  (Except that arbitrary limits always come back to bite
> you,
>     > but that’s what we have software maintenance contracts for.)
>
> I think that the YANG knows what the maximum value is.
> So I think that anyone generating code from specific YANG definitions could
> size their array based upon that value.
> If it's a generic decoder for YANG encoded content, then it might need
> a hint from the application, or it could have a compile-time arbitrary
> limit.
>
>
There are 2 competing goals: fidelity and efficiency

For network management and telemetry, fidelity is critical.
Missing data and altered data are dealbreakers.

I think 1 point Rob is making is that the bitset encoding can end up being
much less efficient
than an XSD-style list of tokens.  Encoding bit position 4 million requires
an octet string 500,000 bytes long.
Obviously not a workable solution, even for an unconstrained device/network.
Also not OK to drop bit values that seem too big for the implementation.
That is not reliable enough.

Why is the bit position allowed to be a uint32 in YANG? Who knows, but it
has to be supported.

--
> Michael Richardson <mcr+IETF@sandelman.ca>, Sandelman Software Works
>  -= IPv6 IoT consulting =-
> _______________________



Andy



> ________________________
> core mailing list
> core@ietf.org
> https://www.ietf.org/mailman/listinfo/core
>