OSI Model (Networking)

Rishavmehra
5 min readApr 22, 2021

WHAT IS OSI MODEL?

The modern internet is not based on OSI, but on the simpler TCP/IP model. however, the OSI 7-layer model is still widely used, as it helps visualize and communicate how networks operate and help isolate and troubleshoot networking problems. The OSI model is a reference model for how applications can communicate over networks.

  1. Application: End User Layer {HTTP,FTP, IRC,SSH,DNS}
  2. Presentation: Syntax Layer {SSL,SSH,IMAP,FTP,MPEG,JPG}
  3. Session: Synch And Send to Port {APIs,Sockets,WinSock}
  4. Transport: End-to-End Connection {TCP,UDP}
  5. Network: Packets {IP,ICMP,IPSec,1GMP}
  6. Data Link: Frames {Ethernet,PPP,Switch,Bridge}
  7. Physical: Physical Structure{Coax,Fiber,Wireless,Hubs,Repeaters}

1. APPLICATION (layer 7):

At the very top of the OSI Reference Model stack of layers, we find the Application layer which is implemented by the network applications. These applications produce the data, which has to be transferred over the network. This layer also serves as a window for the application services to access the network and for displaying the received information to the user.

Ex: Application — Browsers, Skype Messenger, etc.
**Application Layer is also called as Desktop Layer

The functions of the Application layer are :

Network Virtual Terminal

FTAM-File transfer access and management

Mail Services

Directory Services

2. PRESENTATION(layer 6):

The presentation layer is also called the translation layer. The data from the application layer is extracted here and manipulated as per the required format to transmit over the network.
The functions of the presentation layer are :

Translation: For example, ASCII to EBCDIC.

Encryption/ Decryption: Data encryption translates the data into another form or code. The encrypted data is known as the ciphertext and the decrypted data is known as plain text. A key value is used for encrypting as well as decrypting data.

Compression: Reduces the number of bits that need to be transmitted on the network.

3. Session (layer 5):

This layer is responsible for the establishment of connection, maintenance of sessions, authentication, and also ensures security.
The functions of the session layer are :

Session establishment, maintenance, and termination: The layer allows the two processes to establish, use and terminate a connection.

Synchronization: This layer allows a process to add checkpoints which are considered as synchronization points into the data. These synchronization points help to identify the error so that the data is re-synchronized properly, and ends of the messages are not cut prematurely and data loss is avoided.

Dialog Controller: The session layer allows two systems to start communication with each other in half-duplex or full-duplex.

4. Transport(layer4):

The transport layer provides services to the application layer and takes services from the network layer. The data in the transport layer is referred to as Segments. It is responsible for the End to End Delivery of the complete message. The transport layer also provides the acknowledgment of the successful data transmission and re-transmits the data if an error is found.

At sender’s side:
The transport layer receives the formatted data from the upper layers, performs segmentation, and also implements Flow & Error control to ensure proper data transmission. It also adds Source and Destination port number in its header and forwards the segmented data to the Network Layer.
Note: The sender needs to know the port number associated with the receiver’s application.
Generally, this destination port number is configured, either by default or manually. For example, when a web application makes a request to a web server, it typically uses port number 80, because this is the default port assigned to web applications. Many applications have default port assigned.
• At receiver’s side:
Transport Layer reads the port number from its header and forwards the Data which it has received to the respective application. It also performs sequencing and reassembling of the segmented data.

5. NETWORK (layer 3 ):

The network layer works for the transmission of data from one host to the other located in different networks. It also takes care of packet routing i.e. selection of the shortest path to transmit the packet, from the number of routes available. The sender & receiver’s IP address are placed in the header by the network layer.
The functions of the Network layer are :

Routing: The network layer protocols determine which route is suitable from source to destination. This function of the network layer is known as routing.

Logical Addressing: In order to identify each device on internetwork uniquely, the network layer defines an addressing scheme. The sender & receiver’s IP address are placed in the header by the network layer. Such an address distinguishes each device uniquely and universally.

The segment in the Network layer is referred to as a packet.

6. Data Link(layer 2):

The data link layer is responsible for the node-to-node delivery of the message. The main function of this layer is to make sure data transfer is error-free from one node to another, over the physical layer. When a packet arrives in a network, it is the responsibility of DLL to transmit it to the Host using its MAC address.
Data Link Layer is divided into two sub-layers :

Logical Link Control (LLC)

Media Access Control (MAC)

The packet received from the Network layer is further divided into frames depending on the frame size of NIC(Network Interface Card). DLL also encapsulates Sender and Receiver’s MAC address in the header.

The Receiver’s MAC address is obtained by placing an ARP(Address Resolution Protocol) request onto the wire asking “Who has that IP address?” and the destination host will reply with its MAC address.

7. Physical (layer 1 ):

The lowest layer of the OSI reference model is the physical layer. It is responsible for the actual physical connection between the devices. The physical layer contains information in the form of bits. It is responsible for the actual physical connection between the devices. When receiving data, this layer will get the signal received and convert it into 0s and 1s and send them to the Data Link layer, which will put the frame back together.

7 LAYER

ADVANTAGES:

Determine the required hardware and software to build their network.

Understand and communicate the process followed by the components communicating across a network.

Perform troubleshooting by identifying which network layer is causing an issue and focusing efforts on that layer.

Why we need to look at OSI Model:

suppose we need to use Nmap, to understand Nmap we need to understand the flow of the packets and how they are sent. NMAP uses the network layer and the transport layer.

Need any help contact me on Twitter.

Thanks, everyone for reading :)

--

--