Re: FYI... Binary Optimized Header Encoding for SPDY

On Aug 1, 2012 8:30 PM, "Mike Belshe" <mike@
> A couple of thoughts:
> * Thanks for writing up!
> * I don't think we need utf-8 encoded headers.  Not sure how you'd pass
them off to HTTP anyway?

The hand off to http 1.1 could be problematic, yes and I'm not 100% sold on
the utf-8 thing yet either. It's not an impossible problem tho and
shouldn't be too much of a challenge since most of the existing header
value definitions would likely not be modified... that is, just because
utf-8 is allowed in general doesn't mean that the existing value
definitions would all automatically be changed to allow for all possible
utf-8 characters.

> * The codepages seem like complexity, but I'm not sure the benefit.  I
would remove them.

The code pages are specifically *because* of the http 1.1 handoff and the
need to continue supporting extensibility of headers. If an intermediary
happens across a code page zero header that it does not understand, and
therefore cannot translate to an appropriate http 1.1 style header, a
protocol error can be returned.

> * I would remove the flags too - per header flags - do we really need it?
 I'd remove it without a very clear use case.

The immediate use cases are documented within the draft already: binary
header values and multiple values.

> * I know that 32bits seems like a lot.  Defining length fields has two
routes:  fixed length or variable length.  I like the fixed length because
I believe they are simpler.  However, the price of that simplicity is that
you've got limits.  Everyone hates limits :-)  In your proposal you whacked
the number of headers to 8 bits, or 256 headers.   While I agree this is an
edge, I don't see a reason why it should be against the rules to have more.
 Same for the length of a header value - you've used 16 bits (64KB).  While
this seems massive by today's standards, in 10 years maybe 1MB cookies are
the norm.  I don't know, but I'd hate to have the limit.  So.... this
leaves us thinking that maybe we should use variable length encoding.
 Personally, I think the fixed length simplicity is worth it.  But this is
subjective, of course.   Just use 32bits everywhere - it works well and you
won't notice the perf difference at all (I measured :-)

If you need more than 256 headers, use multiple HEADERS frames. There is no
limit to the number of HEADERS frames you can send so that should cover
your edge case.

And I would argue that anyone who is using header values longer than
max(int16) Is Doing It Wrong.

Variable length encoding would be a mistake because it's simply not

- James

> On Wed, Aug 1, 2012 at 5:37 PM, James M Snell <jasnell <>
@ <> <>> wrote:
>> I have submitted an I-D describing the alternative header encoding for
SPDY that I discussed previously. Should be pretty self-explanatory and
there are plenty of examples given throughout. I know it still has yet to
be decided whether SPDY will be the starting point for the HTTP/2.0 effort,
but I wanted to make this available for discussion.
>> http <>://<> <>/<>
id <>/draft-<>
snell <>-<>
httpbis <>-<>
bohe <>-00.<>
txt <>
>> http <>://<> <>/<>
html <>/draft-<>
snell <>-<>
httpbis <>-<>
bohe <>-00<>
>> - James

Received on Thursday, 2 August 2012 05:52:16 UTC