Re: What ASN.1 got right

Theodore Ts'o <tytso@mit.edu> Tue, 02 March 2021 04:45 UTC

Return-Path: <tytso@mit.edu>
X-Original-To: ietf@ietfa.amsl.com
Delivered-To: ietf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 69EE83A0EC6 for <ietf@ietfa.amsl.com>; Mon, 1 Mar 2021 20:45:17 -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, SPF_HELO_NONE=0.001, SPF_PASS=-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 pHMwdZzWAz-j for <ietf@ietfa.amsl.com>; Mon, 1 Mar 2021 20:45:16 -0800 (PST)
Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (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 1F0D23A0EC3 for <ietf@ietf.org>; Mon, 1 Mar 2021 20:45:15 -0800 (PST)
Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 1224jDZc003395 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 1 Mar 2021 23:45:14 -0500
Received: by cwcc.thunk.org (Postfix, from userid 15806) id 663B015C3A88; Mon, 1 Mar 2021 23:45:13 -0500 (EST)
Date: Mon, 1 Mar 2021 23:45:13 -0500
From: "Theodore Ts'o" <tytso@mit.edu>
To: Keith Moore <moore@network-heretics.com>
Cc: ietf@ietf.org
Subject: Re: What ASN.1 got right
Message-ID: <YD3C2UxM9t2cmKI+@mit.edu>
References: <20210302010731.GL30153@localhost> <04f601d70f04$404c5870$c0e50950$@acm.org> <47fcbfb5-36ef-959b-0579-81b36c428e74@network-heretics.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <47fcbfb5-36ef-959b-0579-81b36c428e74@network-heretics.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/ietf/OM4kJPXkq_KS_x6mvnVniUSjB0U>
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: IETF-Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ietf/>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 02 Mar 2021 04:45:17 -0000

On Mon, Mar 01, 2021 at 11:09:31PM -0500, Keith Moore wrote:
> There's something I used to call "ASN.1 disease", but it applies equally to
> XDR, some uses of XML, and a lot of other systems used to define data
> structures used in communications.
> 
> The basic problem is that if you give people the ability to generate and
> require arbitrarily complex type-checked data structures, protocol designers
> will use that ability to create overly complex structures.   This in turn
> makes protocols and implementations much more brittle and less interoperable
> than they should be.   Every non-optional field must be specified and
> checked whether it is needed or not, it's more difficult to extend such
> protocols when needed, and implementation bugs that break things at a level
> which is hard to work around are far too common.

There's another side effect which this often enables (although
arguably this is the fault of the working group / standards committee)
which is that it becomes easier to settle disagreements by adding
large numbers of optional fields / substructures.  If you are using
fixed-length encodings, such as what is found in, say PPP, you can
still have extensibility, but since it's painful to create the
ASCII-art packet formats, I theorize this acts as a check against
unneceessary protocol complexity.

ASN.1-specified protocols tend to be far more complex, because it's
*easier* to create complexity, and this results in implementors having
to agree on profiles which are the subset of the protocol that
implementations _actually_ implement, and if there are different
profiles with different subset, there goes any hope of
interoperability.

						 - Ted