Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is HTTP connectionless or connection-based protocol?

 
Ray Ye
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ray Ye
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Joseph Zhou
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the clarification, Yanqu.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think UDP may still be used to transfer web pages on HTTP.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Technologically, it may be used of course, but then it won't conform to the RFC.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic