Re: [Cbor] MIME tag 257 vs 36

Carsten Bormann <cabo@tzi.org> Sat, 26 September 2020 06:57 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7E0973A1059 for <cbor@ietfa.amsl.com>; Fri, 25 Sep 2020 23:57:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.919
X-Spam-Level:
X-Spam-Status: No, score=-1.919 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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 H0B33ULN_x_B for <cbor@ietfa.amsl.com>; Fri, 25 Sep 2020 23:57:05 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A15FC3A1055 for <cbor@ietf.org>; Fri, 25 Sep 2020 23:57:04 -0700 (PDT)
Received: from [192.168.217.118] (p548dcc60.dip0.t-ipconnect.de [84.141.204.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4Bz02N6c0lzySW; Sat, 26 Sep 2020 08:57:00 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <03268088-A7A8-4F7A-B923-ED3334BD992A@island-resort.com>
Date: Sat, 26 Sep 2020 08:57:00 +0200
Cc: cbor@ietf.org, Jim Schaad <ietf@augustcellars.com>
X-Mao-Original-Outgoing-Id: 622796220.4544491-302ddcdfb877371e79c8c459c1f7bc3e
Content-Transfer-Encoding: quoted-printable
Message-Id: <3B3C1C2D-6831-496B-AB3F-50D23A128344@tzi.org>
References: <77902B73-54E2-455C-88D3-D9CC62EDD84E@island-resort.com> <4271C433-0B38-4B05-AD44-01830EDBD834@tzi.org> <D4F397FE-79BF-41A5-9B14-3C2D9E7A83FA@island-resort.com> <C4D07067-D855-401F-9EA5-5F11F3896835@island-resort.com> <03e801d68f77$297a2800$7c6e7800$@augustcellars.com> <31F3B345-A983-45BA-BF8E-BEBB3881A13D@tzi.org> <7D9A02D7-6D3B-4466-9682-D957BEDCCA4C@island-resort.com> <2F089689-3E53-4DB1-81D7-60841721818E@tzi.org> <03268088-A7A8-4F7A-B923-ED3334BD992A@island-resort.com>
To: Laurence Lundblade <lgl@island-resort.com>
X-Mailer: Apple Mail (2.3608.120.23.2.4)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/zkA3uLGHT8albcUExOew566mzH8>
Subject: Re: [Cbor] MIME tag 257 vs 36
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 26 Sep 2020 06:57:08 -0000

Hi Laurence,

> On 2020-09-25, at 19:11, Laurence Lundblade <lgl@island-resort.com> wrote:
> 
> Hi Carsten,
> 
> Thanks for the detailed explanation.
> 
> Is this a good summary of the upshot?
> 
> Text lines in Internet protocols (on the wire) are delimited by either a CRLF or just an LF. Officially many protocols specify CRLF, but implementations often work with either.

Indeed.

> CBOR type 3 text can be either line ending, even a mixture of both.

CBOR text strings can contain any UTF-8, so they are agnostic to line endings.
(“CBOR type 3 text” is a pleonasm, but also leaving out the word “major”.)

> Operating systems usually have a line end convention. Windows uses CRLF. Linux and MacOS use LF. Some applications on a given OS may work with either and some may prefer the OS’s line ending convention.

Right.

> The majority of use cases and CBOR protocols using type 3 text will work with either line ending. However, some use cases or protocols may not work with either in which case translation to and/or from the local line end convention, typically that of the OS, is necessary.

I think the important observation is that most of the limitations to one type of line ending stem from using line endings as part of the encoding/framing of a TCP-based protocol.  E.g., SMTP is less tolerant of modern line endings because it needs to react to CRLF dot CRLF (unless some SMTP framing is used).  That is not a problem with CBOR-based protocols, as the framing is coming from the self-delimiting CBOR encoding, not from parsing text streams.

> Are you proposing that CDDL be able to specify a line end convention for type 3 items?

I think that might be useful.  Most text strings in CBOR protocols are “1-D”, i.e., they don’t employ line endings.  Where “2-D” text is intended, indicating a preference for a form of line ending, or a restriction to a form of line ending, might be useful.  Of course, restricting text content can today be done with regexes (and soon with ABNF); there is no .feature in regex/ABNF though…

Grüße, Carsten