1

I'm reading Kurose's "Computer networking - A top-down approach", and came to the part where they explain the differences between HTTP with Non-persistent connections vs. with persistent connections.

Before diving into details, they say that

Although HTTP uses persistent connections in its default mode, HTTP clients and servers can be configured to use non-persistent connections instead.

from what I understand that Persistent connections are used. But then, in the Non-persistent part, they say that

In their default modes, most browsers open 5 to 10 parallel TCP connections, and each of these connections handles one request- response transaction.

On the other hand, in the persistent part they say:

Typically, the HTTP server closes a connection when it isn’t used for a certain time (a configurable timeout interval). When the server receives the back-to-back requests, it sends the objects back-to-back. The default mode of HTTP uses persistent connections with pipelining. Most recently, HTTP/2 [RFC 7540] builds on HTTP 1.1 by allowing multiple requests and replies to be interleaved in the same connection, and a mechanism for prioritizing HTTP message requests and replies within this connection.

I am confused. The only way I can see this working is: Although browsers may open several connections and thus receive data in parallel, each of those connections is persistent. Does this make any sense? Or am I missing/misunderstanding something?

Thanks in advance!

  • Are you looking to learn how the protocol works, what browsers do, or whether your book has an error? – Michael Hampton Jul 28 at 17:01
  • @MichaelHampton I assumed the book has no errors. I understand each of the two options presented, but I'd like to know how it works in real life. – 89f3a1c Jul 28 at 17:05
  • Everything made by humans has errors. Your book is full of them, in fact. You should always search for the errata for your textbooks. Someone will probably answer this shortly, but you could also consider experimenting for yourself. – Michael Hampton Jul 28 at 17:09
  • @MichaelHampton thanks for pointing the errata page out! I checked, and the question doesn't seem to be affected by any errata. – 89f3a1c Jul 28 at 17:35
  • 1
    Oops, I accidentally linked to the 6th edition errata, and it appears you have the 7th edition. Those errata can be found here (unfortunately it requires a login to access). – Michael Hampton Jul 28 at 20:16
3

Mozilla's pages on HTTP protocol are quite accurate. Connection header explains how connections are handled.

In HTTP/1.0, connections are closed by default after response is sent.

In HTTP/1.1, connections are persistent by default.

Browsers opened multiple connections with HTTP/1.1, because otherwise the server could be able to send only a single file at a time, which causes delays in showing the complete page. Drawback with this approach is the additional TCP handshakes and the slow start mechanism, which limits throughput.

HTTP/2 improved this by introducting multiplexed connection, which eliminates the additional TCP handshakes and slow start effect on throughput.

Connection persistency and multiple requests are independent from each other.

Browsers can also do things differently.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.