Hacker News new | ask | show | jobs
by schaaf 6642 days ago
Suppose there is no electricity. Suppose you're a tyrant ruling over a massive empire that spans a continent or two. For military and economic reasons, you need an official communication system, but the obvious method of having someone physically carry the messages sucks. It's slow. It's terrain-dependent. And your messengers can be captured or eaten by wolves.

Suppose you have really good telescopes, and can construct watchtowers that are tall and easy to defend. With two watchtowers 10 miles apart, a sergeant in one tower can wave a red flag or a blue flag, which the other tower can see with its telescope. With some convention like Morse code, you can relay information between the two watchtowers.

Suppose now that you build a massive network of these towers. You want to enable communication from any tower to any other tower. Clearly this is possible, but there are issues. How do the towers agree to relay messages? How do they deal with congestion? How do they recover from small errors?

So you assemble your finest engineers, give them a large military grant, and they develop some common conventions (protocols) for the tower operators to adopt. They develop Imperial Protocol (IP), a system that gives each tower a unique address and lets any tower try to send a small message packet (a few sentences) to any other tower. But IP does not ensure that the message will get through.

With IP in place, they then develop Tower Channel Protocol (TCP), which operates on top of IP and ensures reliability. Basically, the source tower and the destination tower strike up a metaconversation, notifying each other about how many words they've received so far, and resending IP packets that got lost in transmision. TCP offers a reliable point to point communication line.

With TCP in place, they develop Hannibalesque Tome Transfer Protocol (HTTP). When a general wants to send a large report, the tower operators first send some headers (like the headers on a fax) describing the document that is about to be sent and mentioning how many words long it is, then the words themselves. This is all done over a TCP connection.

When a general in province 7 wants to get the report http://province13.empire.mil/report/OPERATIONAJAX.pdf, the tower operators find the tower named "province13.empire.mil" and send it an HTTP request asking for the document named "report/OPERATIONAJAX.pdf". That tower gets this request, and sends back the report as its response.

So HTTP is built on top of TCP which is built on top of IP which is built on top of red and blue flags.

Replace Tower Channel Protocol by Transmission Control Protocol and Imperial Protocol by Internet Protocol, flags by cables, and towers by computers, and you have the internet. Replace Hannibalesque Tome Transfer Protocol by Hypertext Transfer Protocol, and you have the web.

Note: http://en.wikipedia.org/wiki/Semaphore_line Note: Are we actually seeing a practical application of the Slashdotesque "TCP/IP over *!!" meme?