Subject: [quicwg/base-drafts] negative base values (#4938)

From: Kazuho Oku <[email-masked]>
Date: Mon, 27 Sep 2021 00:16:56 -0700

[Section 4.5.1.2 of QPACK](https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#name-base) states that Base is calculated as:
```
   if S == 0:
      Base = ReqInsertCount + DeltaBase
   else:
      Base = ReqInsertCount - DeltaBase - 1
```

As Base is defined as an index of a table, I tend to believe that it is assumed to be non-negative. Am I correct?

I am asking this because I cannot find any statement that states as such, even though [section 7.4](https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#name-implementation-limits) states that implementations might refuse very _large_ values.

I understand that it might be too late to consider changes to the draft, but would like to see if we have consensus that QPACK encoders are prohibited from generating a Encoded Field Section Prefix that make Base become a negative number.

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

---

From: Martin Thomson <[email-masked]>
Date: Mon, 27 Sep 2021 03:59:47 -0700

We reject as invalid anything that underflows.  We also (now) reject anything that produces a base >= 2<sup>64</sup>.  I don't see any other way to handle that situation.

-- 
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/4938#issuecomment-927752490

---

From: Mike Bishop <[email-masked]>
Date: Mon, 27 Sep 2021 12:51:13 -0700

That might fall in the "reasonable clarification" bucket, but @afrind and @quicwg/chairs would need to weigh in on that.  All integers in QPACK are intended to be positive, but this is (I think) the only instance in which one integer is subtracted from another, creating a potentially-negative result.

-- 
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/4938#issuecomment-928217981

---

From: Kazuho Oku <[email-masked]>
Date: Mon, 27 Sep 2021 23:17:46 -0700

Thank you for your comments. It's assuring to know that others think the same way; i.e. that Base should be positive.

@martinthomson 
>  We also (now) reject anything that produces a base >= 2<sup>64</sup>. I don't see any other way to handle that situation.

That sounds totally fine when the underlying transport is QUIC v1, because the encoder can send no more than ~2<sup>62</sup> instructions due to the size limit of a QUIC stream. Even if we ignore this v1-specific property, endpoints would have the opportunity to send GOAWAY before base exceeds 2<sup>64</sup>.

-- 
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/4938#issuecomment-928889128