Subject: [quicwg/base-drafts] Does minimal encoding apply to extensions? (#3402)

From: Dmitri Tikhonov <[email-masked]>
Date: Thu, 30 Jan 2020 07:17:49 -0800

[Section 12.4 of the Transport Draft](draft-ietf-quic-transport-25#section-12.4) restricts frame type varint encoding:

```
   The Frame Type field uses a variable length integer encoding (see
   Section 16) with one exception.  To ensure simple and efficient
   implementations of frame parsing, a frame type MUST use the shortest
   possible encoding.  Though a two-, four- or eight-byte encoding of
   the frame types defined in this document is possible, the Frame Type
   field for these frames is encoded on a single byte.  For instance,
   though 0x4001 is a legitimate two-byte encoding for a variable-length
   integer with a value of 1, PING frames are always encoded as a single
   byte with the value 0x01.  An endpoint MAY treat the receipt of a
   frame type that uses a longer encoding than necessary as a connection
   error of type PROTOCOL_VIOLATION.
```

The relevant sentence is:

> Though a two-, four- or eight-byte encoding of the frame types defined in this document is possible, the Frame Type field for these frames is encoded on a single byte.

This means that the restriction may not apply to frames defined by QUIC extensions (such as the `ACK_FREQUENCY` frame in the _Delayed Acks_ extension).  Must each extension spell out its own frame type encoding rules?

It would be easier to change the transport draft to extend the minimal encoding restriction to not-as-yet-specified frames as well.

-- 
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/3402

---

From: Lucas Pardue <[email-masked]>
Date: Thu, 30 Jan 2020 07:37:59 -0800

I read the first sentence as applying to all QUIC frame types, core or extensions. The examples confuse the matter by explicitly mentioning the core frames.

-- 
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/3402#issuecomment-580311216

---

From: Dmitri Tikhonov <[email-masked]>
Date: Thu, 30 Jan 2020 07:42:53 -0800

The sentence I highlighted talks about frames _in this document_ and then _these_ frames, effectively overriding what the first sentence may imply.

-- 
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/3402#issuecomment-580313550

---

From: Lucas Pardue <[email-masked]>
Date: Thu, 30 Jan 2020 07:44:36 -0800

yes I think we agree :)

-- 
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/3402#issuecomment-580314294

---

From: Mike Bishop <[email-masked]>
Date: Thu, 30 Jan 2020 09:56:19 -0800

I think we all agree that it can be made more explicit.  The first sentence says that the rule for all frame types is that they be minimally encoded.  Applying that principle to all frame types defined in this document means that they get one-byte encodings.  We should clarify that it's an application of the rule, not a limitation of it.

-- 
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/3402#issuecomment-580376620

---

From: Marten Seemann <[email-masked]>
Date: Thu, 30 Jan 2020 20:17:19 -0800

Why did we have this rule in the first place? It just seems to complicate things in unexpected ways.

-- 
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/3402#issuecomment-580573745

---

From: Kazuho Oku <[email-masked]>
Date: Thu, 30 Jan 2020 20:58:00 -0800

@marten-seemann See #1473.

IIRC the rationale for using *minimal* varint encoding is that stacks that support only the standardized frames can live with a simpler dispatch scheme that takes *one byte* as an input (i.e. the dispatch method being a table or a switch clause).

While I do not have a strong opinion regarding that requirement, I'd prefer not revisiting the discussion.

-- 
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/3402#issuecomment-580582119