wood burning stoves 2.0*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Is HTTP connectionless or connection-based protocol? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Is HTTP connectionless or connection-based protocol?" Watch "Is HTTP connectionless or connection-based protocol?" New topic
Author

Is HTTP connectionless or connection-based protocol?

Ray Ye
Ranch Hand

Joined: Jun 02, 2004
Posts: 58
I see there are two groups behind each claimation with their logics. But what is Sun's point of view to this question? That is the authority to the exam at least.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
HTTP is a stateless protocol, which means that two subsequent commands are executed independently. Different techniques, such as cookies, URL rewriting, etc, provide support for making HTTP stateful.

In contrary, HTTPS is a stateful (and secure) version of HTTP that maintains state between two invocations.


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Ray Ye
Ranch Hand

Joined: Jun 02, 2004
Posts: 58
Thanks Valentin. I have no doubt about the statelessness of http and statefulness of https, and I know https is for sure connection-based.

What I am not so sure is about the connection state about http. Personally, I fall into the group that consider http is connection-based protocol. Since it has to open socket and make a tcp/ip connection to the web server. But obviously, some other people think differently. What I really want to know is as to SCEA test, what will be the correct answer.
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
ryester,

Thanks for joining JavaRanch.
Unfortunately your name violates our naming policy. Please take a quick look at the rules and edit your profile accordingly.

Thank you!


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Joseph Zhou
Ranch Hand

Joined: Aug 01, 2000
Posts: 129
This is the "connectionless" definiton from http://www.webopedia.com/TERM/C/connectionless.html:

Refers to network protocols in which a host can send a message without establishing a connection with the recipient. That is, the host simply puts the message onto the network with the destination address and hopes that it arrives. Examples of connectionless protocols include Ethernet, IPX, and UDP.

So, HTTP is connection based.
Ray Ye
Ranch Hand

Joined: Jun 02, 2004
Posts: 58
Thanks for the clarification, Yanqu.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Sorry for the misunderstanding

When looking at RFC 2616, it states that:

HTTP communication usually takes place over TCP/IP connections. The default port is TCP 80 [19], but other ports can be used. This does not preclude HTTP from being implemented on top of any other protocol on the Internet, or on other networks. HTTP only presumes a reliable transport; any protocol that provides such guarantees can be used; the mapping of the HTTP/1.1 request and response structures onto the transport data units of the protocol in question is outside the scope of this specification.


Bottom line: since HTTP presumes reliable transport, UDP and the like cannot be used since they are not reliable transport protocol. A connection has to be made between the client and the server, so HTTP is definitely connection-based.

Hope this helps.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
i think UDP may still be used to transfer web pages on HTTP.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Technologically, it may be used of course, but then it won't conform to the RFC.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Is HTTP connectionless or connection-based protocol?