OSI Model


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