Reputation: 28540
I've got a capture of HTTP/2 fetching https://example.com
. The three entries on the initial row of the capture are:
HyperText Transfer Protocol 2
Stream: Magic
Stream: SETTINGS, Stream ID: 0, Length 18
Stream: WINDOW_UPDATE, Stream ID: 0, Length 4
How should I refer to these? Can I say that they're the three initial frames from stream 0
and are the Magic
, SETTINGS
and WINDOW_UPDATE
frames?
Upvotes: 3
Views: 1842
Reputation: 46040
The Magic is a not a frame but a special set of bytes, resembling an HTTP/1.1 message. It is sent at the beginning of all HTTP/2 connections to allow HTTP/1.1 servers to reject the connection elegantly with an HTTP/1.1 response so the client knows to revert back to HTTP/1.1. It’s officially known as the Connection Preface but is often referred to as the “Magic” message. As an aside it has an interesting history.
You can see the Magic message is not a frame as it does not have a stream id nor any of the other necessary frame headers which define a frame.
The SETTINGS and WINDOW_UPDATE messages are indeed frames and there are several frame types defined in the HTTP/2 spec and a few more have been added since in extensions.
Upvotes: 5