Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between HTTP pipeling and HTTP multiplexing with SPDY

Thanks to Google and Stack Overflow, I think I understood the difference between regular HTTP pipelining and HTTP multiplexing (e.g., with SPDY), so I made the diagram below to show the differences between pipelining and multiplexing based on three regular HTTP requests.

enter image description here

My two questions are:

  1. Is the image correct?
  2. Is it true that if pipelining would not have the head-of-line blocking problem it would be as fast as HTTP multiplexing? Or did I miss an additional difference?
like image 740
qualle Avatar asked May 07 '12 10:05

qualle


People also ask

What are the main differences between HTTP with pipelining and HTTP without pipelining?

HTTP/1.1 without pipelining: Each HTTP request over the TCP connection must be responded to before the next request can be made. HTTP/1.1 with pipelining: Each HTTP request over the TCP connection may be made immediately without waiting for the previous request's response to return.

What is HTTP multiplexing?

HTTP multiplexing is the re-use of established server connections for multiple clients connections. The best way to understand this feature is to compare non-multiplexing behavior to multiplexing behavior.

What is the difference between HTTP 1.1 and HTTP 2?

Multiplexing: HTTP/1.1 loads resources one after the other, so if one resource cannot be loaded, it blocks all the other resources behind it. In contrast, HTTP/2 is able to use a single TCP connection to send multiple streams of data at once so that no one resource blocks any other resource.

How is pipeline HTTP connected?

HTTP pipelining is a feature of HTTP/1.1 which allows multiple HTTP requests to be sent over a single TCP (transmission control protocol) connection without waiting for the corresponding responses.


1 Answers

It's not incorrect, but there is an important aspect it omits. HTTP requires that you deliver the entire response before any other request can proceed. What you're showing in the diagram is correct in the sense that with SPDY we can finally break the "head of line" requirement and deliver the responses as they become available. However, we also don't have to wait for any request to complete entirely.

Imagine two requests, both several kb's in size: each request will have multiple packets, call them [r1p1, r1p2] and [r2p1, r2p2]. HTTP requires that pN's arrive in exact order. SPDY, on the other hand allows us the following: [r2p1, r1p1, r1p2, r2p2].

It's also worth mentioning that with SPDY we can use request priorities to hint the server which requests should take precedence, even if it arrives later on the wire (amongst half a dozen other great features).

like image 128
igrigorik Avatar answered Sep 20 '22 14:09

igrigorik