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. |