Re: [dispatch] draft-devault-bare-07 to be discussed during IETF 114

Jiri Vlasak <jiri.hubacek@gmail.com> Sun, 12 June 2022 12:27 UTC

Return-Path: <jiri.hubacek@gmail.com>
X-Original-To: dispatch@ietfa.amsl.com
Delivered-To: dispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5457AC14CF0E for <dispatch@ietfa.amsl.com>; Sun, 12 Jun 2022 05:27:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 PpqoIPMoaDRj for <dispatch@ietfa.amsl.com>; Sun, 12 Jun 2022 05:27:30 -0700 (PDT)
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 731BEC14CF05 for <dispatch@ietf.org>; Sun, 12 Jun 2022 05:27:30 -0700 (PDT)
Received: by mail-ej1-x62f.google.com with SMTP id y19so6225444ejq.6 for <dispatch@ietf.org>; Sun, 12 Jun 2022 05:27:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7AeXFsy+ViijmVDyqfXGMDp3r0jOCdwT5SN1AZj/CyU=; b=EtTaU7oiigKMfFUaJmlxgjfnjUR2v4zZJHPO4FEGNG8x+VY5Am33NNm/4j3ycdYMlk ABOnXKBWh8MWSyz7hFfkxMioO88haltqA0SJ5zoFGofHR34ZVsCCeE6AK5wb7gloqvFA Qs8yQTe3o3GP3uRSJsNxpESnwyo7Tr48L0oOwvI1ydxCqCVPjb0zHKy4Tv1tpfhu0kNB Gac+90ArM0o0DdHI9HoxDmlrptJJN2Es1+5LrFHyFPPod5l5IUMTUxp5yLgtjBsE3NwI 9wTKN+tpAUj0VG/8IUoplAQYJwA4ZfaiK0+gziuyJm5ymvatw9mIQctQpg8oDpqtZO0L /4Cw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7AeXFsy+ViijmVDyqfXGMDp3r0jOCdwT5SN1AZj/CyU=; b=FpAktBAHLpj9ynZdinaZISwaztn5leRXAfKSCYKteQYrMUP9GNkFsW94KXx/axm9jH VLxvvpQP5amUwehizrsiZvXFflzbnI9uNpGBcCGTFgJy8ZEOkEwACO55lmtQRwN+hUIu Vqw6ggfeLQ8KIweS0zqQNxukhuteXzXfxbf2FQWlsTQDd5K5XCc8Flxk6XMXqc5Riqtp KVxlog4TDgaSot7dNo7voxmxO5SoyvsYg5ke3u18GhjbxRSaapxaKTJHwzxzzqkGEU84 8mbtPHfmkhIWt3Q2zsFu80nytWmYkpnBSE/pb6MOjOmBU6aFeg1JZjOqjd8E4WWg5kmE IN1A==
X-Gm-Message-State: AOAM533r8fSUbl1Q/bkNFr2aJ8v+B9gati0EQl/wAUckRQg/SYEQPEWz G4wvckhVJI163xRk+xBPHw+vlZuhvjwnxQ==
X-Google-Smtp-Source: ABdhPJza4HGhYV6aTvu5JUIUINJF/qOj0OkvixgiUfDBDQgk30Ci2GMp5yj4b4cWSgVk4fTylX2KTg==
X-Received: by 2002:a17:906:f84e:b0:70e:6ec8:cc4a with SMTP id ks14-20020a170906f84e00b0070e6ec8cc4amr41820690ejb.694.1655036848703; Sun, 12 Jun 2022 05:27:28 -0700 (PDT)
Received: from gmail.com (185-170-195-217.cust.centrio.cz. [217.195.170.185]) by smtp.gmail.com with ESMTPSA id q4-20020a50aa84000000b0042617ba638esm3104784edc.24.2022.06.12.05.27.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jun 2022 05:27:27 -0700 (PDT)
Date: Sun, 12 Jun 2022 14:27:25 +0200
From: Jiri Vlasak <jiri.hubacek@gmail.com>
To: Eric Rescorla <ekr@rtfm.com>
Cc: John Levine <johnl@taugh.com>, DISPATCH <dispatch@ietf.org>
Message-ID: <YqXbraM9m8PSag5V@gmail.com>
References: <YqC0MHD7MPpcFEuc@cvut.cz> <20220608210551.72EB94341C93@ary.qy> <YqH16YukCzEbLBF3@cvut.cz> <CABcZeBNBSt0z7ur7_JwhBs30s05wT9n4jsDZA1wre991fkvS8w@mail.gmail.com> <YqJUjF8W3Dw/XgKB@gmail.com> <CABcZeBPRkW1iHVDVG4fLTdGzigfFtNLQDu_UkRHE1-V7jXgKrA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CABcZeBPRkW1iHVDVG4fLTdGzigfFtNLQDu_UkRHE1-V7jXgKrA@mail.gmail.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/fSqIGSgqFcjTYmaGICjrl79dJI8>
Subject: Re: [dispatch] draft-devault-bare-07 to be discussed during IETF 114
X-BeenThere: dispatch@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: DISPATCH Working Group Mail List <dispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dispatch>, <mailto:dispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dispatch/>
List-Post: <mailto:dispatch@ietf.org>
List-Help: <mailto:dispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dispatch>, <mailto:dispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 12 Jun 2022 12:27:34 -0000

> > > > > An obvious question is why one would use BARE rather than CBOR
> > > > > which appears at first glance to do the largely the same
> > > > > thing.  See RFCs 8949, 8152, 8392, 8610, 8742, 8746, and 8812.
> > > >
> > > > An obvious answer is that because BARE spec [1] is short. It has
> > > > about 17 pages (depends on the format), that include schema
> > > > language and many examples.
> > > >
> > >
> > > Without taking a position on BARE, this is not necessarily a
> > > virtue.  There are (at least) two reasons why a draft might be
> > > shorter than alternative technologies (1) that it is simpler (2)
> > > that is underspecified.
> >
> > (1) is one of the BARE's goals. We worked hard to avoid (2) and I am
> > happy to discuss it.
> >
> 
> Since sending this email I have taken a quick look at the
> specification, and IMO the description of the schema language needs to
> be fleshed out some. Providing the ABNF is insufficient, you need to
> explain what each piece of the syntax means. You might be able to save
> some space by interlacing that with the description of each type.

I am afraid I do not understand exactly what you mean by "what each
piece of the syntax means". Could you, please, provide some example?

ABNF is provided merely to describe the syntax of the BARE Schema
Language, which is not needed for encoding or decoding.

<user-types> corresponds to Section 2.3 User-Defined Types, and
<any-type> corresponds to Sections 2.1 Primitive Types and 2.2 Aggregate
Types of the specification. So maybe this has to be stated explicitly?

> > > > Moreover, BARE needs the schema available prior to the
> > > > communication, which is not needed in CBOR [2] as stated in the
> > > > objectives. In this manner, BARE better compares to XDR [3].
> > > >
> > >
> > > As I understand it, CBOR does however support schema, no? If so,
> > > I'm not sure why requiring it is an advantage. Is the idea that it
> > > makes the format more compact? Something else?
> >
> > To my understanding, yes, CBOR supports schema. However, to cite
> > from the CBOR specification [1], "3. Data must be able to be decoded
> > without a schema description." That is not the case for BARE. So, to
> > cite from the BARE specification [2], "A BARE message has a
> > comparable size and entropy to the underlying state it represents."
> >
> > I am not saying that requiring the schema is an advantage, which
> > lead us to the original question -- you probably use BARE when you
> > need simple schema and concise messages; you probably use CBOR when
> > you need self-descriptive messages.
> >
> 
> It would probably help to provide some measurements that compared the
> overhead of CBOR to the overhead of BARE. As a bonus, it would help to
> compare the overhead of compressed CBOR to the overhead of compressed
> BARE.

Here is the script:

https://git.sr.ht/~qeef/draft-devault-bare/tree/master/item/compare-bare-to-cbor.py

I would appreciate if someone can check the script and provide a
feedback. I am going to fix the issues found.

The results for the list of 1,000 messages, where each message (inspired
by the Appendix B. Example Company of the BARE I-D) contains "someone"
with "name", "email", "address" (list of four strings), and "orders"
(list of 10 to 100 orders, where an order has i64 "orderId" and i32
"quantity"), are:

	For 1,000 messages:
	- Raw length, i.e. 100 % [Bytes]: 747933
	- BARE length [%]: 100.94
	- CBOR length [%]: 200.43
	- JSON length [%]: 325.60
	- BARE gzipped [%]: 26.57
	- CBOR gzipped [%]: 29.28
	- JSON gzipped [%]: 32.29