3
votes

I have a web HTTP/1.1 server implementation that I've written in C++ using Berkeley sockets. I'm looking at implementing support for HTTP/2.0 (or SPDY) which allows for request and response multiplexing:

The binary framing layer in HTTP/2.0 enables full request and response multiplexing, by allowing the client and server to break down an HTTP message into independent frames, interleave them, and then reassemble them on the other end.

My question is as follows; how can I enable HTTP/2.0 (or SPDY) type request and response multiplexing with my already existing HTTP/1.1 program that is writting using the Berkeley Socket API? Perhaps the aformentioned frame multiplexing that is supported by HTTP/2.0 (or SPDY) is already handled by the existing mechanisms in the TCP/IP Stack, or?

Clarification:

I'm specifically interested in the part of multiplexing that use a single connection to deliver multiple requests and responses in parallel , I don't understand from the specs just how this is implemented in the application level protocol? Any ideas?

1
SPDY is a different protocol -- What are you looking for in an answer other than "implement the protocol"? - janm
@janm There are many types of multiplexing within TCP/IP Stack, I'm looking for a solution of howto implement the kind of request/response multiplexing that HTTP/2.0 (and SPDY) supports. The rest of the HTTP/2.0 (or SPDY) protocol is not in the scope of the question at hand. Thank you. - user152949
SPDY isnt within the TCP/IP stack, it is above TCP, traditionally it would be considered an application protocol. Its control and data frames are documented in the draft spec. You implement multiplexing by implementing the protocol. Have you read the protocol draft? - codenheim
@mrjoltcola Yes, I'm aware that HTTP/2.0 (or SPDY) is not part of the TCP/IP stack, and I never implied that it was. Could you add a link to the multiplexing protocol implementation protocol that you mentioned? -TIA - user152949
Pardon my confusion but the last sentence in your post seemed to imply that to me. Anyway, see my answer. - codenheim

1 Answers

4
votes

No, the TCP stack doesnt handle any of this because SPDY isn't part of the TCP/IP stack, it is above TCP, traditionally what is considered an application protocol. Its control and data frames are documented in the draft spec. You implement multiplexing by implementing the protocol. TCP stack knows nothing about HTTP or SPDY.

In short, SPDY is made up of frames within a single TCP connection that include fairly simple headers with session id and frame length, among other things. You have to implement that to multiplex. You should be able to implement it all with standard SSL/TLS enabled socket code.

As far as I know, this is the spec -

http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft2