1

I know that HTTP 1.1 supports pipelining, where multiple requests can be sent over single connection but these requests need to be served by server in the same order they were sent from the client.

Also, from a client you can make multiple HTTP requests in parallel, but then each would require a separate TCP connection.

Also HTTP 2 supports making multiple requests over a single TCP connection because of multiplexing and hence the HTTP 1.1 limitation of maintaining the sequence is not there.

If multiple requests are sent in parallel over http 1.x, then it doesn't work well. What is it, that http 1.x does not provide because of which http 2 like multiplexing cannot be done.

Gaurav Kumar
  • 1,091
  • 13
  • 31
  • don't understand, why people downvoted. Do you know the answer to this? I bet you don't. I have done my research and i know I lack the network level knowledge to the level required to understand. So I am looking for a simple explanation for understanding. – Gaurav Kumar Mar 29 '19 at 18:34
  • While I did not downvote I could imagine the reason: you are basically ask why a protocol created 20 years ago was designed the way it would be needed today. – Steffen Ullrich Mar 29 '19 at 18:53
  • Probably I need to reframe the question. I guess, people aren't understanding my intent. – Gaurav Kumar Mar 29 '19 at 19:02

2 Answers2

3

Because request-response pairs don't have identifiers in HTTP/1, so when either server or client would receive a partial request or response, they wouldn't know which request-response pair it would belong to.

Therefore requests and responses need to be sent and received completely, in order.

HTTP/2 has multiplexing, where each pair (or "session") has a unique identifier, which is sent with each "frame" so the receiver of a partial request or response knows which pair it belongs to.

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
  • And identifiers are not there in HTTP 1.x packets as in those times when it was designed, there was never a need to have such things to cater to internet of that time. Understood. Thanks – Gaurav Kumar Mar 29 '19 at 19:07
1

HTTP/1.1 was standardized in 1999 and it was just a small evolution of HTTP/1.0 (standardized 1996) which basically added support for HTTP pipelining, HTTP chunked encoding (content length not known up front) and HTTP keep alive active by default. The internet was very different in 1999 from today (as it will be likely very different in another 20 years). At this time Javascript was just the fancy tool to make it possible to scroll some text over the page (i.e. news ticker etc), there was no Ajax and dynamic updating parts of the client side and the whole Web 2.0 idea was still far away.

In other words: there was simply no urgent need at this time to have a more complex protocol which supports multiplexing. Ask again in 20 years why HTTP/2 or HTTP/3 did not already have all the features you need in 2039.

Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172