I am a bit confused with HTTP lately.

Some facts are that TCP can operate connection orientated or connectionless, this I understand. TCP though is connection-oriented while UDP is connectionless which is used when the message itself can fit into a single message.


If HTTP uses TCP, and TCP provides reliable connections for multiple message exchange, and HTTP is said to be connectionless then how is this possible?

TCP is connection-oriented? So how is HTTP connectionless????


HTTP (1.0 without connection keep alive) is connectionless because once a single HTTP request is serviced, the connection is closed and not reused. HTTP requests are not TCP protocol data units, so that TCP is connection-oriented with respect to TCP protocol data units doesn't stop HTTP from being connectionless with respect to HTTP protocol data units.

When we look at the HTTP protocol itself, we don't care what protocol it's layered on top of. It could be TCP, but theoretically, it could be something else. So the properties of TCP are completely irrelevant.


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.