Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I assume this is a very general question about the relationship between sockets and HTTP connections. I also assume that "HTTPConnection" does not refer to something involving a specific API/runtime/environment even though the way it's a <a href="http://HTTPConnection" rel="noreferrer">camel cased</a> term with spaces removed could suggest otherwise.</p> <p>Now that that's out of the way, I present to you, the <a href="http://en.wikipedia.org/wiki/OSI_model" rel="noreferrer">OSI model</a>:</p> <p><img src="https://i.stack.imgur.com/WZ54s.png" alt="The OSI Model"></p> <p>The OSI Model describes levels of abstraction for network communication. A <a href="http://en.wikipedia.org/wiki/Internet_socket" rel="noreferrer">socket</a> is a concept which would exist somewhere on layer 3, the <a href="http://en.wikipedia.org/wiki/Network_Layer#Relation_to_TCP.2FIP_model" rel="noreferrer">Network Layer</a>, as part of the <a href="http://en.wikipedia.org/wiki/Internet_Protocol" rel="noreferrer">Internet Protocol (IP)</a>.</p> <p><a href="http://en.wikipedia.org/wiki/HTTP" rel="noreferrer">HTTP</a> is higher abstraction than IP, usually regarded as being up in the Application Layer, at the "top" of the OSI model.</p> <h2>An Analogy</h2> <p>You could define a city's transportation and traffic at different "layers" the same way we define network stuffs.</p> <ul> <li>At its simplest, a city is a bunch of buildings.</li> <li>As the city grows people need to travel from building to building, so they develop roads. The roads are a new "layer" to the city.</li> <li>As more people use the roads, they begin to need a system of rules and laws to help keep everyone safe.</li> <li>Once people are safe on the roads though, they want the roads to be efficient and quick, so a system of lights and signs help coordinate people on the roads.</li> </ul> <p>Two important things:</p> <p>First, each layer depends on the one "below" it. Without buildings (destinations) roads become silly. Without roads, traffic laws are silly. Without traffic laws, traffic lights are silly.</p> <p>Second, the specifics of the higher layers vary depending on the city you're in: sometimes you find yourself in a country where people drive on the left, sometimes they drive on the right. Sometimes you can turn on a red, sometimes not. Sometimes there are roads, but they are without laws.</p> <h2>End of Analogy</h2> <p>So on the Internet, sometimes you communicate with different kinds of servers. Underneath, they may all rely on sockets (the "roads" of he internet) but they all have their own "traffic laws" that you have to respect - protocols like HTTP or FTP or SOAP.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload