The Open Systems Interconnection model (OSI Model) is a reference model from the International Organization for Standardization (ISO) that "provides a common basis for the coordination of standards development for the purpose of systems interconnection." In the OSI reference model, the communications between systems are split into seven different abstraction layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application.The model partitions the flow of data in a communication system into seven abstraction layers to describe networked communication from the physical implementation of transmitting bits across a communications medium to the highest-level representation of data of a distributed application. Each intermediate layer serves a class of functionality to the layer above it and is served by the layer below it. Classes of functionality are realized in all software development through all standardized communication protocols.

Each layer in the OSI model has well-defined functions, and the methods of each layer communicate and interact with those of the layers immediately above and below as appropriate.

The Internet protocol suite as defined in RFC 1122 and RFC 1123 is a model of networking developed contemporarily to the OSI model, and was funded primarily by the U.S. Department of Defense. It was the foundation for the development of the Internet. It assumed the presence of generic physical links and focused primarily on the software layers of communication, with a similar but much less rigorous structure than the OSI model.

In comparison, several networking models have sought to create an intellectual framework for clarifying networking concepts and activities, but none have been as successful as the OSI reference model in becoming the standard model for discussing and teaching networking in the field of information technology. The model allows transparent communication through equivalent exchange of protocol data units (PDUs) between two parties, through what is known as peer-to-peer networking (also known as peer-to-peer communication). As a result, the OSI reference model has not only become an important piece among professionals and non-professionals alike, but also in all networking between one or many parties, due in large part to its commonly accepted user-friendly framework.

Wikipedia


Source: Network Protocols Run the Internet - by Alex Xu (bytebytego.com)

What is the OSI Model?

7 Layers each describe a specific networking component we will understand by an example sending a POST request to an HTTPS webpage:

  1. Layer 7 - Application - HTTP/FTP/gRPC
    1. POST request with JSON data to HTTPS server
  2. Layer 6 - Presentation - Encoding, Serialization → JSON
    1. Serialize JSON to flat byte strings
  3. Layer 5 - Session - Connection establishment, TLS → state in client/server
    1. Request to establish CP connection/TLS
  4. Layer 4 - Transport - UDP/TCP → Segments (In this layer port comes into the picture)
    1. Sends SYN request target port 443
  5. Layer 3 - Network - IP → Packets
    1. SYN is placed an IP packet(s) and adds the source/dest IPs
  6. Layer 2 - Data link - Frames, Mac address Ethernet → Frames
    1. Each packet goes into a single frame and adds the source/dest MAC addresses
  7. Layer 1 - Physical - Electric signals, fiber, or radio waves
    1. Each frame becomes string of bits which converted into either a radio signal (wifi, electric signal (ethernet), or light (fiber)
Note

Layer 4 and 7 i.e. Transport and Application layers are bread and butter of a Backend Engineer.

The shortcomings of the OSI Model

• OSI Model has too many layers which can be hard to comprehend
• Hard to argue about which layer does what
• Simpler to deal with Layers 5-6-7 as just one layer, application
• TCP/IP Model does just that

TCP/IP Model

Thoughts 🤔 by Soumendra Kumar Sahoo is licensed under CC BY 4.0