File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes HTTP and concept of connectionless Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "HTTP and concept of connectionless" Watch "HTTP and concept of connectionless" New topic
Author

HTTP and concept of connectionless

Jack Zhou
Ranch Hand

Joined: Dec 27, 2003
Posts: 93
I encoutnered some discusssion regarding wether or not http is a connectionless protocoal. I thought the TCP over IP is connection oriented.
Connection oriented vs connectionless is a characteristic of transport layer not the high level application protocal. So asking whether or not http is connection less protocal simply does not make sense. Please correct me if I am wrong.
Thanks,


Thanks,<br />Jack Zhou<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS,SCEA
stevens sun
Greenhorn

Joined: Mar 22, 2004
Posts: 4
HTTP is connectionless protocol, although TCP is connection.
Steve Agarwal
Ranch Hand

Joined: Feb 02, 2003
Posts: 51
http is like make a conneciton and get the ack and then dont maintaint the socket connection.
Its more like Fed Ex rather than Telephone conversation.
Abhishek


SCJP1.4,SCWCD, SCBCD, SCEA part 1<br />"Its feels good to know the stuff in detail."
Jack Zhou
Ranch Hand

Joined: Dec 27, 2003
Posts: 93
Thanks guys but not convinced.
The request and response cycle is completed in a connecton, right?
Then, how can say http is connectionless. Wekk it certainly stateless. So Http is like you make phone call but the receiver and you each only talk once. You have to dial gain if you wan to talk more.
dial number (connect)
caller:"hello"
receiver:" hello back"
disconnected;
dial number (connect).
caller: "how are you?"
receiver:"Very good thank and how are you?"
disconnected;
dial number (connect)
caller: "Just so so"
.............
When you want to brows a page and browser send the request. A connetion
is created and a response is sent back to you and connection is closed.
I got see the page and business id done. You can't say this is a connection less communication.
However I am only interested to know if such question exists and what the ansser will be accepted on on Part I exam.
THANGAMANI Vaiyapuri
Greenhorn

Joined: Sep 27, 2002
Posts: 7
HTTP is a stateless(Application level) and connection oriented (Transport layer level) protocol.
Ade Barkah
Ranch Hand

Joined: Mar 17, 2004
Posts: 65
Jack,
The short answer is: for the exam you need to know that HTTP is a stateless protocol; TCP is connection-oriented; and that UDP is connectionless. Also, with HTTPS a web container can leverage the SSL's SessionID to maintain client state.
For the long answer:
The concept of "connectionless" is not limited to only the transport layer but apply throughout the protocol stack. A protocol is connection-oriented if each party maintains communication state between multiple requests or packets. So HTTP is clearly a connectionless protocol. In general, stateless protocols are by definition connectionless.
HTTP/1.1 introduced the notion of "persistent connections" where the underlying connection may be "kept-alive" between requests. Requests may also be "pipelined" (where multiple requests are sent before responses are received.) However, HTTP/1.1 makes no guarantee that the connection will remain open, does not maintain any state between request-response pairs, and therefore it is still a connectionless protocol.
HTH,
-Ade


-Ade<br /><a href="http://www.barkah.org" target="_blank" rel="nofollow">www.barkah.org</a>
Ade Barkah
Ranch Hand

Joined: Mar 17, 2004
Posts: 65
Jack,
The short answer is: for the exam you need to know that HTTP is a stateless protocol; TCP is connection-oriented; and that UDP is connectionless. Also, with HTTPS a web container can leverage the SSL's SessionID to maintain client state.
For the long answer:
The concept of "connectionless" is not limited to only the transport layer but apply throughout the protocol stack. A protocol is connection-oriented if each party maintains communication state between multiple requests or packets. So HTTP is clearly a connectionless protocol. In general, stateless protocols are by definition connectionless.
HTTP/1.1 introduced the notion of "persistent connections" where the underlying connection may be "kept-alive" between requests. Requests may also be "pipelined" (where multiple requests are sent before responses are received.) However, HTTP/1.1 makes no guarantee that the connection will remain open, does not maintain any state between request-response pairs, and therefore it is still a connectionless protocol.
HTH,
-Ade
Jack Zhou
Ranch Hand

Joined: Dec 27, 2003
Posts: 93
Thanks Ade and THANGAMANI,
I am much clear about the concept now. Especially I was, I don't know why, under the impression that the concept of connection does not apply to application layer protocol. I also learned that HTTP spec does not require it to be implemented on top of a connection oriented transport layer. Now I can conlucde that one cannot say that HTTP is connection oriented.
Satya Kondur
Greenhorn

Joined: Mar 19, 2004
Posts: 8
------------------------------------------------------------
I also learned that HTTP spec does not require it to be
implemented on top of a connection oriented transport layer.
------------------------------------------------------------
Are you sure about that ? The RFC says HTTP MUST be implemented over a Reliable Transport Layer. Does a Connection less protocol provide a reliable transport layer ? I guess NO.
Ade Barkah
Ranch Hand

Joined: Mar 17, 2004
Posts: 65
Satya,
There are indeed reliable-yet-connectionless protocols. The Wireless Transaction Protocol (WTP) used in millions of WAP-enabled mobile phones is one example. The ESRO protocol is another.
In fact HTTP itself can be classified as a reliable connectionless protocol. It can reliably transport, for example, SOAP messages, without prior setup or teardown.
-Ade Barkah
Satya Kondur
Greenhorn

Joined: Mar 19, 2004
Posts: 8
Ade,
Connection-less protocol like say UDP doesn't by itself provide a reliable transport. However, you can build application layer protocol over UDP that provides this reliability. Your example of ESRO Protocol is built over non-reliable connectionless transport UDP. The reliability aspect is handled by ESRO Protocol and not by the underlying transport layer. Likewise WTP also runs over an connectionless unreliable datagram transport layer.
Ade Barkah
Ranch Hand

Joined: Mar 17, 2004
Posts: 65
No one is saying that UDP is reliable. The point is there are reliable-yet-connectionless protocols. As mentioned WTP and ESRO fall into this category, hence the HTTP spec is correct in requiring a reliable protocol but not necessarily a connection-oriented one.
Also, the concept of "reliability" is not limited to just (layer 4) transport protocols, and reliability is not synonymous with connection-oriented.
Some examples:
- X.25 is a reliable network (layer 3) protocol. LAPB and LLC (802.2) are reliable data-link protocols. Various multicasting protocols (such as REALM) and so called "overlay" protocols (such as RON) are reliable at the application layer.
- As mentioned there are many protocols which are connectionless but reliable. Besides WTP & ESRO... Novell's NCP, MTP (used in telecom), Lucent's RAL, etc.
- Frame Relay and ATM are examples of connection-oriented protocols which are in fact unreliable. With both of these technologies, a connection ("virtual circuit") must be established, yet frames/cells can still be lost.
I think we're far beyond the exam's objectives by now.
Regards,
-Ade Barkah
Rams alak
Greenhorn

Joined: Apr 03, 2004
Posts: 3
jack,
Can you explian how when browser send request to server, the HTTP, tcp, Ip protocals are interrelated
Jack Zhou
Ranch Hand

Joined: Dec 27, 2003
Posts: 93
http is on top of tcp that is on top ip. In OSI terms, http is an "application protocol" and tcp is a "transport layer protocol", ip is a "network protocol".
here is a related link about osi model.
http://www.acm.org/sigcomm/standards/iso_stds/OSI_MODEL/ISO_IEC_7498-1.TXT
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Excellent discussion!
Unfortunately we are indeed beyond the exam's objectives. I am transferring this thread to Sockets and Internet Protocols forum. Feel free to continue the discussion there.
Cheers


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
See if this sounds right ... I got a good grade in my network class, but we had open book tests
HTTP is connectionless. So after a single request & response, the HTTP server does not remember anything about the client. (Servlet servers do, of course, but their session management is J2EE business, nothing specified in HTTP.)
To accomplish that single request and response, HTTP makes a TCP/IP connection and carries on a little conversation with the server. Connect. Are you there? Yes, I am. Here's some stuff. Ok, here's something back. Disconnect. During this conversation, the server holds information about the client and the state of the conversation, which is really all any connection is.
So TCP is connection oriented, but the connections and sessions are VERY short. On a good day. HTTP uses TCP, but that doesn't make HTTP connection oriented.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP and concept of connectionless