Subject: [quicwg/base-drafts] make payload length 0 special (#1301)

From: Marten Seemann <[email-masked]>
Date: Wed, 18 Apr 2018 05:05:34 +0000 (UTC)

0 is currently a valid value for the payload length, but sending a packet with no payload is not allowed. By making this value special, we can give it a clearly defined meaning, and save a byte in the common case (and potentially make implementations easier).
You can view, comment on, or merge this pull request online at:

  https://github.com/quicwg/base-drafts/pull/1301

-- Commit Summary --

  * make payload length 0 special

-- File Changes --

    M draft-ietf-quic-transport.md (3)

-- Patch Links --

https://github.com/quicwg/base-drafts/pull/1301.patch
https://github.com/quicwg/base-drafts/pull/1301.diff

-- 
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/pull/1301

---

From: MikkelFJ <[email-masked]>
Date: Tue, 17 Apr 2018 22:17:25 -0700

Would't it be even more efficient with a header flag, if there are any bits left? There are many more invalid values than just zero, e.g. all longer than UDP size.

-- 
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/pull/1301#issuecomment-382264756

---

From: Kazuho Oku <[email-masked]>
Date: Wed, 18 Apr 2018 08:08:41 -0700

I prefer not making 0 special for two reasons.

Firstly, I am not sure if it simplifies things. While I can see that it makes the encoding side slightly simpler for some implementations, I would argue that it makes the decoding side more complex since you need to special-case 0. Note that any value below AEAD tag length + 1 are invalid, so special-casing 0 just adds another `if` on the decoding side.

Secondly, I prefer just having one canonicalized form rather than having two ways to represent the same thing.

@mikkelfj 
> Would't it be even more efficient with a header flag, if there are any bits left?

FWIW, we discussed that in #1262 and it seemed that we preferred not having different packet types for those that have payload lengths fields. You might want to look at the comments.

-- 
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/pull/1301#issuecomment-382420774

---

From: Mike Bishop <[email-masked]>
Date: Wed, 18 Apr 2018 14:07:49 -0700

Can I just say again how much I dislike sentinel values?

-- 
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/pull/1301#issuecomment-382529809