Re: Fibonaccing CID lengths

Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com> Wed, 22 May 2019 16:11 UTC

Return-Path: <mikkelfj@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 6F1F7120099 for <quic@ietfa.amsl.com>; Wed, 22 May 2019 09:11:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.997
X-Spam-Level:
X-Spam-Status: No, score=-1.997 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, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=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 AEfEtgDn_g1z for <quic@ietfa.amsl.com>; Wed, 22 May 2019 09:11:00 -0700 (PDT)
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 0476112015E for <quic@ietf.org>; Wed, 22 May 2019 09:10:47 -0700 (PDT)
Received: by mail-ed1-x534.google.com with SMTP id w37so4601753edw.4 for <quic@ietf.org>; Wed, 22 May 2019 09:10:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to; bh=DSSBXXs78bBY/xnRFQbiZN0L2KXEzKX2Zd0rQvhdoO8=; b=FwByW4am8HIm0+Qqxlbll2BER+dkFh1vDq6lIPX3Jdb/oHUOBxUbJdl1UEcj3yPZwF I0bZz5genVfkZ/up+Ee051pxxf50rQBLcmZ4sYEtHMio4zFKo/x8bmWmzFJCCEunqKwG hGZ1TOjTE3ehAxv7W/BYx+7lMME2tAQJdkqWZfk71VK9MfE/p2Ga6F2EL4VRdJnI73pI aUXotKtTMkIpHuTfVOMfjpPRW3JmJzr4QSwCIv/yqI4WXxMDFW2U20Ilg7cM4/pP8ccU HbbXgfTRAEEX+btn2TL/8NzMAknT4dtf3Gd7zDM92OhBONTPv61NQjRoFNexv5xMCcXk FWdg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to; bh=DSSBXXs78bBY/xnRFQbiZN0L2KXEzKX2Zd0rQvhdoO8=; b=P8yHw81Xjeu++Jb1sV+XSbu3ch6xlNqUeqZUUgA1MffWZ6z/ZpXcRPbzd0SY2zpeUC L9JolwcBoORa5sGeOZ6OLwNlfqQrG7AbqawYcIhvtW3zmo/qIjo3YMuPLct3i6///tVi UcGfb/slNq6PCPTGyi8+b2ZiIMb4L3KhaIezFKfi47TefJhjevIpNfrvEW72nmjmCXbN o3Ehli0KbloynJI5jNEBk/9nTEdPXlz7bcnnO0yPaPb2cnHaCrZ+YWhBRDONWjMS3fpf 9Vnds/pFGpZ7Knm9U91aY3jRAKEn/FbTfjfkre+3Kb5rlpstsshRJ59foMGooHe6FpG9 fQig==
X-Gm-Message-State: APjAAAUNsInGtd7jOIl23uxJcmvOpMqwiqoiO7TZvR7+2ktr6BtUEUS1 /Z8uZWvXLLpo5FwyyBfVM+CDjKwLpRW1VBV5klE=
X-Google-Smtp-Source: APXvYqy9jcF1WKwuTG3b9oSXX/haib3wv5zpUjiiR4Ab2G/R7daP06rSr6CsVMDppjh1j5qIH75iThh8tmCCAuNbfKg=
X-Received: by 2002:a50:a5ed:: with SMTP id b42mr89057115edc.178.1558541446535; Wed, 22 May 2019 09:10:46 -0700 (PDT)
Received: from 1058052472880 named unknown by gmailapi.google.com with HTTPREST; Wed, 22 May 2019 12:10:44 -0400
From: Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>
In-Reply-To: <20190522141238.GA23472@ubuntu-dmitri>
References: <20190522141238.GA23472@ubuntu-dmitri>
X-Mailer: Airmail (420)
MIME-Version: 1.0
Date: Wed, 22 May 2019 12:10:44 -0400
Message-ID: <CAN1APdfBMeKGzsdLR__OLUHQ7pg=YM76C2Qxn6VDCXu680JQyA@mail.gmail.com>
Subject: Re: Fibonaccing CID lengths
To: Dmitri Tikhonov <dtikhonov@litespeedtech.com>, IETF QUIC WG <quic@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000049e31a05897c35a5"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/aYMfgAikaloetGWttp-ePok-U_Q>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.29
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: Wed, 22 May 2019 16:11:02 -0000

Another benefit: I get to use Fibonachi numbers again :)

But, it would arbitrarily consume more bandwidth than necessary, much more
than what is saved in a single byte SCIL/DCIL field.

If we keep the recenlty proposes 1 byte DCIL  and 1 byte SCIL fields we
have 0..255 bytes.
If we need more without the complexity of varints that are bad for hardware
and fast routing in general, we could make all lengths <= 127 single byte
multiples, and all above 127 8 byte multiples. That gives you 2K of routing
bits and is stil easy to decode in hardware.


On 22 May 2019 at 16.13.07, Dmitri Tikhonov (dtikhonov@litespeedtech.com)
wrote:

Idea: we can keep the one-byte SCIDL/DCIDL field but map the 4-bit
parts to a larger range of values. For example, we could map the
16 values to a range of Fibonacci numbers:

0 -> 0
1 -> 1
2 -> 2
3 -> 3
4 -> 5
5 -> 8
6 -> 13
7 -> 21
8 -> 34
9 -> 55
10 -> 89
11 -> 144
12 -> 233
13 -> 377
14 -> 610
15 -> 987

This particular mapping has several profitable properties:

- It covers the whole range of values from zero to the
practical maximum imposed by the protocol (about 1K).

- There is a good selection of small values.

- 8 is one of the values, convenient for storage in
uint64_t.

- Each step up is not too large (double or more) or too
small (less than 50% increase).

- The mapping can be easily generated: its name says how.

- Dmitri.