TCP is a stateful protocol then why not http?

Y

ypjofficial

Hi,
I have a following doubts.
HTTP is based on TCP protocol.
But tcp is a stateful protocol then why HTTP is stateless?

Can't http inherit the statefulness property of tcp protocol?


HTTP uses a stateful protocol internally and even then it is statelss?
how come?


Regards,
Yogesh Joshi
 
R

relogout

Hi,
I have a following doubts.
HTTP is based on TCP protocol.
But tcp is a stateful protocol then why HTTP is stateless?

Can't http inherit the statefulness property of tcp protocol?


HTTP uses a stateful protocol internally and even then it is statelss?
how come?


Regards,
Yogesh Joshi

they work on different levels
tcp work on transport level and http work on application level
http has to build a connection wiht port 80 using TCP
the conncetion is stateful, but the applications on it may stateless
 
G

Gordon Beaton

I have a following doubts.
HTTP is based on TCP protocol.
But tcp is a stateful protocol then why HTTP is stateless?

Can't http inherit the statefulness property of tcp protocol?

HTTP is stateless because it was designed that way. The statefulness
of TCP has no relevance to the statefulness of HTTP.

What does this have to do with Java programming? There are more
suitable groups for these quesstions.

/gordon
 
A

Alex Hunsley

Hi,
I have a following doubts.
HTTP is based on TCP protocol.
But tcp is a stateful protocol then why HTTP is stateless?

The statefulness of a transport layer (TCP) has nothing at all to do
with whether or not the application level traffic (HTTP) is stateful or
not. TCP doesn't know anything in particular about what it is
transporting. It is just good at transporting data, and doing it in an
ordered way (and with guaranteed delivery, unlike UDP).

Here's an analogy for you: suppose you had a armoured shopping basket.
Inside you put some eggs. Even though eggs are inside an armoured
shopping basket, the eggs themselves aren't armoured, and are still easy
to break. You wouldn't expect the armoured basket to magically make the
eggs armoured.
 
D

Daniel Pitts

Hi,
I have a following doubts.
HTTP is based on TCP protocol.
But tcp is a stateful protocol then why HTTP is stateless?

Can't http inherit the statefulness property of tcp protocol?


HTTP uses a stateful protocol internally and even then it is statelss?
how come?


Regards,
Yogesh Joshi

HTTP is intentionally stateless. It simplifies the common case for
which HTTP was intented: Transfering Hypertext.

Also, an HTTP request is sent over TCP, but that doesn't mean that
there is one HTTP request per TCP connection. Often times, a
user-agent will open several TCP sockets to download a webpage (one for
the HTML, and a few for other resources such as javascript and images).


If you were to allow statefulness based the the statefulness of the TCP
protocol, then you would limit browsing to only use one connection.
This can be extremely bad if you have high-latency or a
low-transfer-rate connection.

HTTP isn't stateless because of technical limitations, but rather by
design. It puts the burdon of state on the client end (in the form of
cookies), and allieviates the need to worry about cross-connection
state.
 
C

Chris Uppal

Daniel said:
HTTP isn't stateless because of technical limitations, but rather by
design. It puts the burdon of state on the client end (in the form of
cookies), and allieviates the need to worry about cross-connection
state.

It may be worth adding the observation that HTTP makes heavy use of
the statefullness of TCP. If TCP weren't stateful, then it wouldn't be able
to provide reliable end-to-end communication. And if HTTP had to cope with the
likelihood that messages would be scrambled and/or go missing, then that
protocol would be /vastly/ more complex than it is (and it would have to be
stateful too).

You could say that HTTP can get away with being stateless /because/ it assumes
a stateful network transport...

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top