Subject: [quicwg/base-drafts] Revise frame integer encoding (#876)

From: Martin Thomson <[email-masked]>
Date: Sun, 15 Oct 2017 17:25:22 -0700

Since my work-in-progress on this attracted a massive flurry of feedback - mostly positive even - I'll first open an issue and then the PR, so that there is a more visible place to hold the discussion.

There are lots of bespoke integer encodings in the transport-level frames.  This makes implementation more difficult than is ideal, and it might even be less efficient.  After surveying the options available to us, I think that a variable-length encoding format can be used consistently across all of the frames.  This would eliminate all the bespoke encodings, including - as a bonus - the floating point timestamp format.

The idea is to take the first two bits of the first octet to encode the length.  0 = 1 octet, 1 = 2 octets, 2 = 4 octets, and 3 = 8 octets.  The remainder of the value is big endian.  I can show that encoding this is almost absurdly efficient, see [my little benchmark utility](https://github.com/martinthomson/quic-int).

The cost in terms of bytes is modest, though it would no longer use the bits from the frame type to determine size, which could increase sizes in some corner cases.  Though the added flexibility might represent an occasional saving.

I have a separate proposal for the ACK frame that would simplify more aggressively and even maybe save more space, but I'm attempting to keep some of the spirit of the original encoding here.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/876

---

From: MikkelFJ <[email-masked]>
Date: Mon, 16 Oct 2017 00:39:21 +0000 (UTC)

Relates to earlier proposal  #595

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/876#issuecomment-336754104

---

From: Martin Thomson <[email-masked]>
Date: Mon, 16 Oct 2017 00:48:34 +0000 (UTC)

Oops, duplicate.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/876#issuecomment-336754675

---

From: Martin Thomson <[email-masked]>
Date: Sun, 15 Oct 2017 17:48:35 -0700

Closed #876.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/876#event-1293959137