Understanding the OSI model for developers.

Njunu-sk
4 min readApr 6, 2021

--

OSI model layers.

Every developer should be able to understand networking concepts and the request response cycle.

Basic understanding of encapsulation and de-encapsulation process in networking and how it relates to the OSI model is fundamental for a developer.

The OSI

The Open System Interconnection Model is a conceptual framework that describes how a network functions.

It is a tool for understading how network functions and helps standardize the way computers communicate.

Common terms

Nodes — represent a single device hooked up to a network.

Links — connects nodes to a network.

Protocol — rules that allow two nodes to exchange data.

Network — group of devices that want to share data.

Topology — how nodes and links fit together in a network configuration, illustrated by a diagram.

What is a Layer ?

A layer is a way of categorizing and grouping functionality on and behaviour on a network.

Layers abstract a low level functionality, all inner workings are hidden from the end user.

Request response cycle

When the client sends a request from the web page, the request goes through various processes to the serve and back as a response.

When data is transported from one node to another in a computer network, extra information is added to the data item to add some feature to it, this process is known as encapsulation.

De- capsulation is the reverse of encapsulation.

Encapsulation and De-encapsulation.

Encapsulation

Step 1: The Application, Presentation and Session layer in the OSI model takes user data in forms of data streams (GET/ request) encapsulates it and forwards it to the Transport layer. In the application layer cookies and headers can be assigned. Presentation layer(optional), request is encrypted for security purpose and Session layer request is tagged to a specific session id.

Step 2: Transport layer, takes data streams and divides it into multiple pieces. Encapsulates data by adding appropriate header to each piece called segments. Headers (destination and source port) contains information so that data segments can be reassembled at receivers end.

Step 3: Network layer, takes data segments and encapsulates it adding additional headers(source and destination ip address). The data headers contains all routing information for proper delivery of the data. The encapsulated data is termed as data packets or datagrams.

Step 4: Data link, takes data packets and encapsulates it by adding additional header and footer to the datagram, headers contains switching information for the proper delivery of data to the appropriate hardware component,trailer contains all information related to error detection and control. MAC address is included here and encapsulated data is termed as the data frame.

Step 5: Physical layer, takes data frames and encapsulates it by converting it to appropriate data signals (bits).

De — Encapsulation

Step 1: Physical layer, takes encapsulated data signals from sender and de-encapsulates it in form of data frames back to top layer.

Step 2: Data-link layer, takes data frames and de-encapsulates it checking whether data frames are switched to correct hardware or not. This is determined by MAC address, if the frame is switched to the incorrect destination it is discarded else checks for trailer information.

Step 3: Network layer, takes datagram and de-encapsulates it checking header packets ( source and destination ip) whether it is routed to the correct destination or not, packet is discarded if routed to the wrong destination.

Step 4: Transport layer, takes data segments and de-encapsulates it, checks segments header and re assembles the data in form of data streams attaching session_id to it.

Step 5: Application, presentation and session layer, takes encapsulated data and de-encapsulates it and forwards application-specific data to the application. Session layer recognizes data with session_id and presentation layer decrypts data.

Hope you learned something. Credits to this https://afteracademy.com/blog/what-is-data-encapsulation-and-de-encapsulation-in-networking guy for sharing this blog.

This is his work and some sprinkles of my thoughts.

Share this to friends and family. Keep learning :)

--

--