Subject: [quicwg/base-drafts] STREAM_ID_BLOCKED frame can't encode being blocked on stream 0 (#1850)

From: Marten Seemann <[email-masked]>
Date: Thu, 11 Oct 2018 06:14:15 -0700

The STREAM_ID_BLOCKED frame has the Stream ID field which is

> A variable-length integer indicating the highest stream ID that the sender was permitted to open.

This encoding doesn't allow to convey that the peer (in this case, this is always the client) would like to open stream 0, but the server didn't allow any bidirectional stream in the transport parameters (i.e. sent a 0 for `initial_max_stream_data_bidi_remote`).

The easy fix for this is to send the stream ID of the stream that the peer was **not** permitted to open due to missing stream flow control credit.

This would also have the nice property to make this frame more symmetric with the BLOCKED and STREAM_BLOCKED frames. For example, for STREAM_BLOCKED an offset of 0 means that the peer was **not** allowed to send byte 0 on that stream.

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

---

From: janaiyengar <[email-masked]>
Date: Thu, 11 Oct 2018 17:01:19 -0700

Good catch. Your proposal seems reasonable to me.

On Thu, Oct 11, 2018 at 6:14 AM Marten Seemann <[email-masked]>
wrote:

> This encoding doesn't allow to convey that the peer (in this case, this is
> always the client) would like to open stream 0, but the server didn't allow
> any bidirectional stream in the transport parameters (i.e. sent a 0 for
> initial_max_stream_data_bidi_remote).
>
> The easy fix for this is to send the stream ID of the stream that the peer
> was *not* permitted to open due to missing stream flow control credit.
>
> This would also have the nice property to make this frame more symmetric
> with the BLOCKED and STREAM_BLOCKED frames. For example, for STREAM_BLOCKED
> an offset of 0 means that the peer was *not* allowed to send byte 0 on
> that stream.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/quicwg/base-drafts/issues/1850>, or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AKjg1El0Zpj64fQnW3vRvuhK4PfNT0bfks5uj0QmgaJpZM4XXhCq>
> .
>

-- 
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/1850#issuecomment-429160677

---

From: MikkelFJ <[email-masked]>
Date: Fri, 12 Oct 2018 00:23:58 -0700

Or we could finally decide that 0 is not a stream. 0 was invented for a reason.

-- 
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/1850#issuecomment-429230705

---

From: Dmitri Tikhonov <[email-masked]>
Date: Fri, 12 Oct 2018 12:29:04 +0000 (UTC)

> Or we could finally decide that 0 is not a stream. 0 was invented for a reason.

Uh-oh -- not this can of worms again! :smile:

-- 
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/1850#issuecomment-429308924

---

From: ianswett <[email-masked]>
Date: Fri, 12 Oct 2018 05:30:06 -0700

+1 to 0 not being a stream from my perspective.

That being said, my understanding was that the question of 0 being a valid stream id(or 0 being a valid packet number) had clear lack of consensus, with about half the group wanting 0 to be valid and the other wanting to start at 1.

-- 
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/1850#issuecomment-429309185

---

From: Marten Seemann <[email-masked]>
Date: Fri, 12 Oct 2018 05:32:13 -0700

I agree that 0 should not be a stream, and that 0 should not be a packet number. It's really useful to have a sentinel value.
Making 0 a valid stream created a bunch of overhead in my code - nothing complicated, just a bunch of bools of stream 0 was already created or not.

-- 
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/1850#issuecomment-429309728

---

From: Dmitri Tikhonov <[email-masked]>
Date: Fri, 12 Oct 2018 05:42:27 -0700

I am with you about 0 being an invalid number for stream and packet numbers, @ianswett and @marten-seemann, and I also stated this on the mailing list. The (unofficial?) consensus seems to be 0, however. Should we be re-arguing the same issues over and over again?

-- 
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/1850#issuecomment-429312252

---

From: ianswett <[email-masked]>
Date: Fri, 12 Oct 2018 05:45:05 -0700

Anything worth arguing once is worth arguing at least twice based on past experience in this WG.

-- 
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/1850#issuecomment-429312919

---

From: MikkelFJ <[email-masked]>
Date: Fri, 12 Oct 2018 05:49:03 -0700

The complication is that streams are module 4, so if 0 is invalid, so should stream 1, 2, and 3.

-- 
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/1850#issuecomment-429313988

---

From: Marten Seemann <[email-masked]>
Date: Fri, 12 Oct 2018 05:50:50 -0700

> I am with you about 0 being an invalid number for stream and packet numbers, @ianswett and @marten-seemann, and I also stated this on the mailing list. The (unofficial?) consensus seems to be 0, ho…

I don't think we ever even came close to establishing consensus on this issue, we just had some discussions during a coffee break at one of the interims.

> The complication is that streams are module 4, so if 0 is invalid, so should stream 1, 2, and 3.

The stream directionality is defined mod 4. Starting at 1 is equally arbitrary as starting at 0.

-- 
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/1850#issuecomment-429314401

---

From: Kazuho Oku <[email-masked]>
Date: Fri, 12 Oct 2018 11:39:32 -0700

I disagree to making 0 "special", because I care about having consistency in design. I do not care what is "natural."

Packet numbers, Stream IDs, stream offsets, MAX_DATA offset, all those things currently start from zero. Why do we need to start some of them from one? Doing so would be an unnecessary complexity.

As @marten-seemann points out, the issue here is MAX_STREAM_ID frame not following the design pattern we use for transmitting blocked state that we have for offsets. The fix should be to follow the pattern.

> I agree that 0 should not be a stream, and that 0 should not be a packet number. It's really useful to have a sentinel value.

I understand that sentinel is useful. But it does not need to be zero. Because the "integers" we use in QUIC is uint62_t, you can use `int64_t` to represent the value internally, with -1 being the sentinel below and 2<sup>62</sup> being the one above.

-- 
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/1850#issuecomment-429420829

---

From: Nick Banks <[email-masked]>
Date: Fri, 12 Oct 2018 18:41:58 +0000 (UTC)

I also disagree that 0 should be special. I feel like we've definitely had this discussion more than twice...

-- 
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/1850#issuecomment-429421539

---

From: janaiyengar <[email-masked]>
Date: Fri, 12 Oct 2018 12:39:48 -0700

I suggest that we stick with @marten-seemann's original proposal for now, since it's a simple consistency fix. It also has the very useful property of not opening a can of worms.

-- 
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/1850#issuecomment-429439981

---

From: Martin Thomson <[email-masked]>
Date: Sun, 14 Oct 2018 19:09:46 -0700

It's just not possible to leave you folks alone for any time, is it?  I agree with @janaiyengar.

-- 
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/1850#issuecomment-429687184

---

From: Martin Thomson <[email-masked]>
Date: Wed, 31 Oct 2018 00:19:09 +0000 (UTC)

Closed #1850 via #1906.

-- 
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/1850#event-1936625612