Layered communication in the Post Office

What happens when you send a letter to a friend? (I have not checked this with the Post Office, but it is something like this):
  1. You are in Los Angeles, and write a letter to your friend in New York.
  2. You drop it in a mail box near your house.
  3. The mail is picked up by a postal employee named Fred.
  4. Fred drops the mail he has picked up at a local Post Office.
  5. A postal employee named Jennifer takes all waiting mail from the local post office to a central post office near the airport.
  6. The letters are sorted by geographic area.
  7. Your letter goes into a batch headed for New York and is taken to a plane by a driver named Ethyl.
  8. A pilot called Bob flies the plane to New York.
  9. A postal employee named Marcela drives it to a central sorting station.
  10. The letter are sorted by zip code.
  11. The batch containing your letter is put in a truck and driven by a postal employee named Robert to a post office near your friend's house.
  12. The mail is sorted by address, and your letter is given to a mail carrier named George who delivers it to your friend's house.
  13. Your friend opens the letter and reads it.
This example has several parallels to layered communication in a computer network.

Postal system Layered network
As you are writing the letter, you are concerned only with what you want to say to your friend. Similarly, when your friend reads it, he or she is only thinking about what you are saying. You do not care about the details of the delivery system and they are hidden from you. You do not know the names of the people who handle your letter, whether the trucks are made by Ford or Toyota, whether a given truck has a near empty gas tank or a flat tire during its trip, etc. The client and server programs communicating at the application layer are independent of the nature of the network. The links between the hosts might be fast or slow, wired or wireless, etc. The routers might be manufactured by Cisco or Juniper. They may be slow or fast. The client and server may be in the same building or on different continents. They may be on an intranet or an extranet. The application programmer is free to focus on the application features.
After you write a letter, you put it in an envelope, write a street address on it, and drop it in a mailbox. An application program composes a message and puts the address of the receiving computer in a header that precedes the message content. That address, for example som.csudh.edu, is the receiving computer's domain name.
When you write a letter and drop it in a mailbox, you trust the postal system to somehow get it to the correct address. The application program trusts a transport layer program like transmission control protocol (TCP) to get the message to the correct computer. (The transport program must first convert the domain name to an IP address like 155.135.1.1).
There may be several people living at the street address. The person writing the letter puts a recipient name on the envelope specifying which one should open and read the letter. There may be several programs running on the receiving computer. The application program sending the message puts a port number in the message header specifying which program it is for.
A letter is routed within a city or local geographic area by the Postal Service and its employees. Data is moved within a local area network (LAN) by programs running at the Data Link layer. Ethernet is probably the most common Data Link protocol.
Letters are moved between cities on planes operated by contracting airlines. Data is moved between networks by programs running at the network layer. The Internet Protocol (IP) is used to route messages between networks, and the computers that are programmed to do that are called routers.
Message handling is independent of content. Postal employees treat love letters, nasty letters, letters with checks and money orders, letters with photographs, etc. in the same manner. The letters are sealed. An end-to-end network does not distinguish between packets containing text email, pictures of your last vacation, Web pages, etc. The network ignores the nature of the application and the data type (text, image, video, etc.).
There may be alternative transport mechanisms. For example, if your letter is urgent, you may send it by Express Mail. If it is large, you may send it Parcel Post. In these cases, it is handled differently. Different application programs might use different transport mechanisms. Email applications use TCP for transport because it checks for errors and automatically retransmits the data if an error is detected. Voice over IP applications use the user datagram protocol (UDP) for transport because error checking is optional with UDP. Error checking takes time, and keeping up with a steady stream of speech data requires speed. Furthermore, there would be no point in re-transmitting an bad packet. Spoken and received words flow continuously and at the same rate. You would not want to hear a corrected syllable in the middle of the following sentence.


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.