Connection ID lengths 1, 2 and 3

Marten Seemann <martenseemann@gmail.com> Tue, 03 July 2018 12:45 UTC

Return-Path: <martenseemann@gmail.com>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 99320130EB5 for <quic@ietfa.amsl.com>; Tue, 3 Jul 2018 05:45:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-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 ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F8IprRTrdJ1U for <quic@ietfa.amsl.com>; Tue, 3 Jul 2018 05:45:16 -0700 (PDT)
Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (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 7AAE4130EAB for <quic@ietf.org>; Tue, 3 Jul 2018 05:45:16 -0700 (PDT)
Received: by mail-io0-x235.google.com with SMTP id q4-v6so1585317iob.2 for <quic@ietf.org>; Tue, 03 Jul 2018 05:45:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=zqRR0qqF3BakBHybFfZoVj4DpdCSFclsfrxkaRlOoPk=; b=nsqCDLBI6PgHSCq+XZ9tBmKBRDA0Brpj95JFWTAdSjEasIrapF/I10/46MQKAIrznH 5we8SUPRPUhUGF/ZbjPwkowbgpXNPKn6/kZkODJB1PcKGwK6ByPuiZn70MvKcL13SmKA CetAdF/LldKzTP2Mc4hgMgZzA9bNJyBL4u9r8tPkMLPiUO9BUscUdzYlw1eFsP5YcG2g 9ejC1nXatCn3dAonCFGpvyR1Xewh7AVLEPwndhwAx5zzM8UHF+YlK99WOO5wusb7J0Fx FHHMUU2dXfR5juRKF+mexmxiz/7PJrWS3BDNmUVwMLabL/ORI0hsnA9jH82kp7hV3NqH vnnw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=zqRR0qqF3BakBHybFfZoVj4DpdCSFclsfrxkaRlOoPk=; b=JSCtABjTgSWFPm0uxe8KDt8tbBpDkoIuDskqZF8af3pET/MVVtn7HDBWPVLt0Cundh Eq4xv4echb2YzNb96Jp/4/qG3RzrBrk3HUuUwjTpaGf0kfHmqloFBn8zqVVa17vzzmbv J0yqeqrwrd8iBh7B4gQJHqUP/BuUC12PGTOz1is2G4olGFlBI8z+wOXAlWGiAi+6m+8N B9IYRy3K/FUFSlPL0yJL9Iu45v47TDSVT8KGAeGTjES0+hoIHAP/s2lK+nmlIxchIkrP ToJrHcZHVEHIdYdQgwqmiclw+CHPHDja0RP9uoffbjuOvcTRmQGEaBUPWSSJEfnjOvKb K3Cg==
X-Gm-Message-State: APt69E0Ji3dCbi1bAMCdmwFOUfvq7YaGOmnVI2eFoPIl5VSU5tejGShl W5ArhHylk1SxmCEWw/A/efYdCNHmCzD7Y2uBbqwyaw==
X-Google-Smtp-Source: AAOMgpfD+LfGVd28yTwc81xqNxBlN2rwBcZd8XumWMoWLDBMS+Vn66ZvNrlQAfzNlBKrFdVWtaiakFlry1rIFFvibjI=
X-Received: by 2002:a6b:f812:: with SMTP id o18-v6mr23080810ioh.235.1530621915136; Tue, 03 Jul 2018 05:45:15 -0700 (PDT)
MIME-Version: 1.0
From: Marten Seemann <martenseemann@gmail.com>
Date: Tue, 03 Jul 2018 19:45:03 +0700
Message-ID: <CAOYVs2pZx-u5_Gm0L9oAmztE4p067F34u3+-pyc5ezjm_gquKw@mail.gmail.com>
Subject: Connection ID lengths 1, 2 and 3
To: QUIC WG <quic@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000898682057017af8b"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/zXiG6Gci9u0T_va1w4MBhEvuLMM>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.26
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 03 Jul 2018 12:45:19 -0000

First of all, I realise that I'm bringing this up late in the process, and
maybe too late, since this would require a change to the invariants.

The connection IDs can be either 0 bytes or anything between 4 and 18 bytes
(inclusive). Lengths of 1, 2 and 3 bytes are not possible.
For p2p applications, and for server deployments that are not doing
connection ID based load balancing, it would be interesting to use shorter
connection IDs. One might imagine that a peer encodes the length of the
connection ID into the first few bits, and then starts using 1 byte
connection IDs first, and successively moves to longer lengths only when
handling more connections. A p2p host handling several thousand
simultaneous connections (which will be enough for many p2p protocols)
would never have to use anything longer than 2 byte connection IDs.

In the connection ID length field in the Long Header, we only have to 4 bit
to encode a range of 19 values (we want 0 byte connection IDs, and we want
to support 18 byte connection IDs), so *some* values have to be left out.
However, leaving out 1, 2 and 3 seems a bit unfortunate, as there will be
more use cases for these values than e.g. for 13, 14 and 15 bytes.