Network Layers

Networking hardware and software is generally divided up into five layers. Some models add even more layers, but only the five most common layers are described here.

The Purpose of Layers

Today it is essential that application software developers be able to write software that communicates efficiently with other software over a network, in particular, the internet. For example, a program might need to make a connection to a database at a remote location, issue a query to the database, receive the results of the query, and close the connection. Many programmers can do this, but very few understand the complexity of the events their programs cause. This is due to the massive amount of information hiding inherent in network architecture.

Simple communication across the internet involves passing a message down through layers at the message origin and back up through similar layers (peer layers) at the message destination. In more complex communication, messages are delivered through several intermediate communication entities called routers. At each router, a message is passed up through some of the layers and then back down on the way to a different router or a destination machine.

Each layer serves a different purpose and uses a different protocol for communication. Kurose (2003) defines a protocol as follows:

A protocol defines the format and order of messages exchanged between two or more communicating entities, as well as the actions taken on the transmission and/or receipt of a message or other event. (p.~8)

Communicating entities are often a client, or process in need of a service, and a server, or process providing the service. Protocols generally involve a coding scheme for encoding and decoding data. However, they also cover dynamic aspects of communication. Many of the internet application protocols specify command languages that clients can use to direct servers.

Internet Layers

Communication in the internet can be described by the picture to the right, showing the 5 standard layers.

The Application Layer

The application layer is responsible for governing communication between client and server processes or between peer processes providing services to each other. There are many different protocols depending on the type of service.

  • Simple Mail Transfer Protocol (SMTP) is used for mail delivery
  • HyperText Transfer Protocol (HTTP) is used for transfer of web pages
  • Domain Name System (DNS) is used for looking up internet addresses
  • File Transfer Protocol (FTP) is used for transferring files

The Transport Layer

The transport layer is responsible for delivery of information between processes on different machines on the internet. The two protocols in the transport layer are

  • Transmission Control Protocol (TCP) for connection-oriented service
  • User Datagram Protocol (UDP) for connectionles service

TCP is the most interesting and complex. It fixes two major problems in the communication provided by the lower layers.

The first problem is unreliability of the data transmission - data can be corrupted or lost. Part of the solution of this problem is breaking up messages into small blocks of data to reduce the amount of data that is lost at one time. If one of the blocks is lost the receiving end can request retransmission.

The second major problem is that the blocks can arrive out of order due to taking different routes through the internet. TCP defines a complex algorithm used by both ends of the communication to ensure that the receiving end can put the blocks back in the correct order.

The Network Layer

The network layer is responsible for delivery of information between different machines on the internet. This simplifies the delivery problem for the transport layer. If you are sending email across the network, the network layer delivers blocks of data from your machine to the machine on which your mail server software runs.

Using services provided by the network layer, the transport layers at either end only have to deal with delivering data to and receiving data from processes on their respective machines - your mailer program on your machine, or the mail server at the other end.

The path taken by blocks of data through the internet is determined by the network layer. In the Internet Protocol (IP), the route is adjusted to use links that have less traffic. Each block is routed individually so that successive blocks in an application layer message may take different routes.