OSI Model Layers and their Functions

Before you start

Objectives: learn the names of layers and layer tasks. Learn which protocol exist in which layer.

Prerequisites: you should be familiar with general OSI model concepts.

Key terms: osi model layers, application layer, presentation layer, session layer, transport layer, tcp, udp, ports, network layer, data link layer, physical layer


OSI Model Layers

OSI model layers are numbered seven through one. We often refer to the layers as layer one or layer three, rather than saying the name of the layer.

Layers and Protocols

Image 125.1 – Layers and Protocols

Application Layer – Layer 7

The application layer is responsible for integrating network services with the operating system. The application layer really provides the interface between the applications and the rest of the network. Different protocols are associated with the application layer, such as HTTP, TELNET, FTP, TFTP, SMTP and many others. We talk about these protocols as being in the application layer, but in reality, most of these protocols actually extend down through the session layer. In reality, most services or protocols can span multiple layers, but we talk about these as being application layer protocols because that is the highest layer that these protocols function at.

Presentation Layer – Layer 6

The sixth OSI model layer is the presentation layer. The presentation layer is a formatting layer. It deals with things such as syntax, encryption and compression. For example, when we visit a web page using the HTTP protocol, if we want to use encrypted connection, the presentation layer will perform that encryption. In this case HTTP uses another protocol, referred to as SSL, to provide that encryption.

Session Layer – Layer 5

The session layer is responsible for creating sessions between communicating devices. Each client connection is referred to as a session. For example, each client that connects to some server is identified as a session. It is also possible that the same user creates multiple sessions on the same server, for example, if the user opens a web page from different browsers. The session layer uses a session ID to identify each unique session which keeps the data stream from different clients separate. The session layer is responsible for setting up communication sessions and terminating them. Termination happens when a session is idle for some period of time.

Transport Layer – Layer 4

The transport layer is concerned with how data is delivered through the network. The transport layer receives information from the upper OSI model layers that’s formatted as data. The transport layer is responsible for segmentation of that data. With segmentation, larger pieces of data are divided into smaller blocks. Each block is identified with a sequence number. As these blocks are sent through the network, the sequence number helps the receiving device reassemble those blocks into the correct order. It also helps the receiving device realize when one of those segments is missing. Those units of data that are created at the transport layer are called segments. Segmentation also requires sequencing and combination on the receiving device. We often refer to this segmentation and the error correction that can be preformed as host-to-host error correction. The receiving device can identify segments that have been corrupted and request retransmission, if necessary. Another thing that takes place at the transport layer is something called flow control. Again, flow control in this case is preformed between the two hosts. Flow control means that if the sending device is sending data quickly, the receiving device may not be able to keep up, in which case it can send a message back to the sending device to slow down or to speed up.

TCP and UDP

Two specific protocols that are used at the transport layer are TCP and UDP. TCP is referred to as a connection oriented protocol, because it takes advantage of sequencing, error correction and flow control to ensure that data sent from upper layers is received at the receiving device. UDP is referred to as a connectionless protocol, because it is more concerned with moving data through the network, without necessarily ensuring that everything arrives at the destination device. When using UDP, error correction can be preformed somewhere in the upper layers.

Port Numbers

Another thing that happens at the transport layer is the assignment of port numbers. A port is a number which identifies an upper layer service running on a server. For example, our server can be a web server, an email server, a DNS server or it can run any other supported service at the same time. In this case, information received from lower levels, up to the transport layer, needs to be routed to the appropriate service running on the server. This is done by the port number. Each service is associated with a unique port number such as 80 for web server, or 53 for DNS. By using port numbers the transport layer can identify the upper layer protocol that is used and then send that data to the correct protocol.

Network Layer – Layer 3

The network layer is responsible for moving data between systems throughout the internetwork. This is where routing occurs. Routing takes a message sent from an end device to a router or through many connected routers, to the final destination device. With routing, protocols specify how each router identifies destination networks and the path that it should take to arrive at that destination network. One of the important things in network layer is the assignment of the IP address. The IP address is often referred to as a network layer address, or a layer three address. It’s also referred to as a logical address. Data at the transport layer is called a segment. As that segment is passed off to the network layer, the source and destination IP addresses are appended to the segment. Data at the network layer then becomes a packet.

Data Link Layer – Layer 2

The data link layer is an interface between the physical transmission media or the physical devices and the network layer. It is divided into two sub layers. The top sub layer is referred to as the LLC, or Logical Link Control layer. It provides the interface between the lower layers and the upper layers. The bottom sub layer is referred to as the Media Access Control, or MAC sub layer. It is responsible for identifying how devices can access the physical medium. Data Link layer is where the MAC address is assigned. In this case, a packet coming from the network layer has the MAC address appended to the packet. Data at the data link layer is called a frame. The frame includes the network layer packet, with the MAC address of the source and destination devices. It also includes a CRC or a Cyclic Redundancy Check. CRC is a mathematical value that helps the receiving device identify when there are errors in transmission.

Physical Layer – Layer 1

This is where we actually get into actual hardware. For example, here we’ll have protocols that identify how cables are put together such as CAT5, which applies to twisted pair cable. Another protocol is RJ45, which specifies how this cable is connected within the connector, and the connector that is used between two devices. Another example of a protocol at the physical layer is V.35, which is the protocol used by modems for sending data across the network.

The data that comes down to the physical layer is just a series of bits. Those bits become electrical impulses, or light pulses, or sound in the case of a modem, or some kind of a radio signal with wireless devices.

Layer Grouping

OSI layers are often grouped. One method of layer grouping is to separate the bottom two layers from the upper five layers. The bottom layer is concerned with the network architecture, such as Ethernet, and the top layer is the networking protocol suite, such as TCP/IP.

Layer Grouping

Image 125.2 – Layer Grouping

With the modularity of the OSI model layer we can substitute a different network architecture while using the same upper protocol suites. For example, when we are connecting two devices together in a WAN, we might use a protocol such as ATM, or Frame Relay. The lower layer protocols dictate how devices are connected together and how the electrical, or other signals, are sent between the two devices. Once we get to the upper layers, we are no longer concerned with the hardware, but with the software, the applications and services that are running on the computer.

Another way to divide the OSI model layers is to separate the two middle layers, or layers three and four, from the upper layers. The upper layers are referred to as the application layers, and the middle layers are referred to as the transport layers.

Layer Grouping 2

Image 125.3 – Layer Grouping 2

The upper layers represent protocols that are services, such as HTTP, DNS, and other protocols that actually provide a service. The middle layers are concerned with how messages get from one device to another through the network. It doesn’t concern itself with signaling and the format of the physical devices on the network, but rather it determines how a message is sent from one device to another.

Remember

The application layer provides the interface between the applications and the rest of the network. Different protocols are associated with the application layer, such as HTTP, TELNET, FTP, TFTP, SMTP and many others. The presentation layer is a formatting layer. It deals with things such as syntax, encryption and compression. The session layer is responsible for creating sessions between communicating devices. Each client connection is referred to as a session. Session ID is used to identify each unique session which keeps the data stream from different clients separate. The transport layer is concerned with how data is delivered through the network. It is responsible for segmentation of the data. Each block of data is identified with a sequence number. Those units of data that are created at the transport layer are called segments. Two specific protocols that are used at the transport layer are TCP and UDP. TCP is referred to as a connection oriented protocol because it takes advantage of sequencing, error correction and flow control. UDP is referred to as a connectionless protocol because it is more concerned with moving data through the network, without necessarily ensuring that everything arrives at the destination device. The network layer is responsible for moving data between systems throughout the internetwork. This is where routing occurs. One of the important things in network layer is the assignment of the IP address. The IP address is often referred to as a logical address. Data at the network layer is called a packet. The data link layer is an interface between the physical transmission media or the physical devices and the network layer. It is divided into two sub layers: Logical Link Control layer and Media Access Control layer. Data Link layer is where the MAC address is assigned. Data at the data link layer is called a frame. The data that comes down to the physical layer is just a series of bits. OSI model is modular which means that we can combine different network architectures with different upper protocol suites.