HTTP/2 Stream

46 views
Skip to first unread message

chirag shah

unread,
Apr 12, 2019, 12:46:15 PM4/12/19
to grpc.io
Hello,

I am seeking one clarification about the Stream-ID of the  HTTP/2 frame.  

As we know all frames share a common 9-byte header (as shown below), which contains the length of the frame, its type, a bit field for flags, and a 31-bit stream identifier.
However,  in  HEADERS frame spec, they say that this stream-identifier  is actually the identifier of the parent stream.   A 31-bit stream identifier for the stream that  this stream depends on.
I do understand  this field is only  present if the PRIORITY flag is set.

So my question is, if this 31 bits are taken up by  parent stream-id then where are we fitting the stream-id of this stream in question.



http2_frame.png





Thanks.


Michael Lumish

unread,
Apr 12, 2019, 12:56:44 PM4/12/19
to chirag shah, grpc.io
The parent frame identifier, also called the stream dependency, is part of the HEADERS frame payload. The HEADERS frame still has the same general frame header with the stream identifier.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/cba73533-89b3-46b7-9dbd-80b182cf66e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

chirag shah

unread,
Apr 12, 2019, 4:22:54 PM4/12/19
to grpc.io

Thanks for yoru response Michael.
I am however, still missing something to understand.
You said that
    "The HEADERS frame still has the same general frame header with the stream identifier."

But from HEADER BLOCK's size point of view we have only 9 bytes
3 bytes for length
1 byte   for  frame-type
1 byte   for  frame-flags
4  bytes for  stream-identifier (including reserved bit)

If these 4 bytes are for the parent stream-identifier,  where will the current stream-identifier  be located  ?



Thanks.


On Friday, April 12, 2019 at 11:56:44 AM UTC-5, Michael Lumish wrote:
The parent frame identifier, also called the stream dependency, is part of the HEADERS frame payload. The HEADERS frame still has the same general frame header with the stream identifier.

On Fri, Apr 12, 2019 at 9:46 AM chirag shah <chirag...@gmail.com> wrote:
Hello,

I am seeking one clarification about the Stream-ID of the  HTTP/2 frame.  

As we know all frames share a common 9-byte header (as shown below), which contains the length of the frame, its type, a bit field for flags, and a 31-bit stream identifier.
However,  in  HEADERS frame spec, they say that this stream-identifier  is actually the identifier of the parent stream.   A 31-bit stream identifier for the stream that  this stream depends on.
I do understand  this field is only  present if the PRIORITY flag is set.

So my question is, if this 31 bits are taken up by  parent stream-id then where are we fitting the stream-id of this stream in question.



http2_frame.png





Thanks.


--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grp...@googlegroups.com.

Michael Lumish

unread,
Apr 12, 2019, 4:36:31 PM4/12/19
to chirag shah, grpc.io
Here's how it works: every frame starts with a 9-byte header, consisting of 3 bytes for the payload length, 1 byte for the frame type, 1 byte for the flags, and 4 bytes for the stream identifier plus reserved bit. This is followed by the frame payload. The HEADER frame payload starts with an additional 6-byte header consisting of 1 byte for the padding length, 4 bytes for the stream dependency plus "exclusive" bit, and 1 byte for the priority weight. These HEADERS frame headers are present in addition to the generic frame headers. So, the HEADERS stream dependency is simply a different field from the stream identifier.

To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.

chirag shah

unread,
Apr 13, 2019, 9:56:33 AM4/13/19
to grpc.io
Totally makes sense to me now Michael.
Really appreciate your clarification !!!
I, somehow missed it in the spec 7540

Thanks.


On Friday, April 12, 2019 at 3:36:31 PM UTC-5, Michael Lumish wrote:
Here's how it works: every frame starts with a 9-byte header, consisting of 3 bytes for the payload length, 1 byte for the frame type, 1 byte for the flags, and 4 bytes for the stream identifier plus reserved bit. This is followed by the frame payload. The HEADER frame payload starts with an additional 6-byte header consisting of 1 byte for the padding length, 4 bytes for the stream dependency plus "exclusive" bit, and 1 byte for the priority weight. These HEADERS frame headers are present in addition to the generic frame headers. So, the HEADERS stream dependency is simply a different field from the stream identifier.

Reply all
Reply to author
Forward
0 new messages