Files
system-design-101/data/guides/what-is-osi-model.md
Kamran Ahmed ee4b7305a2 Adds ByteByteGo guides and links (#106)
This PR adds all the guides from [Visual
Guides](https://bytebytego.com/guides/) section on bytebytego to the
repository with proper links.

- [x] Markdown files for guides and categories are placed inside
`data/guides` and `data/categories`
- [x] Guide links in readme are auto-generated using
`scripts/readme.ts`. Everytime you run the script `npm run
update-readme`, it reads the categories and guides from the above
mentioned folders, generate production links for guides and categories
and populate the table of content in the readme. This ensures that any
future guides and categories will automatically get added to the readme.
- [x] Sorting inside the readme matches the actual category and guides
sorting on production
2025-03-31 22:16:44 -07:00

1.7 KiB

title, description, image, createdAt, draft, categories, tags
title description image createdAt draft categories tags
OSI Model Explained Learn about the OSI model and how data is transmitted over a network. https://assets.bytebytego.com/diagrams/0295-osi-model.jpeg 2024-03-13 false
computer-fundamentals
Networking
OSI Model

How is data sent over the network? Why do we need so many layers in the OSI model?

The diagram below shows how data is encapsulated and de-encapsulated when transmitting over the network.

  • Step 1: When Device A sends data to Device B over the network via the HTTP protocol, it is first added an HTTP header at the application layer.

  • Step 2: Then a TCP or a UDP header is added to the data. It is encapsulated into TCP segments at the transport layer. The header contains the source port, destination port, and sequence number.

  • Step 3: The segments are then encapsulated with an IP header at the network layer. The IP header contains the source/destination IP addresses.

  • Step 4: The IP datagram is added a MAC header at the data link layer, with source/destination MAC addresses.

  • Step 5: The encapsulated frames are sent to the physical layer and sent over the network in binary bits.

  • Steps 6-10: When Device B receives the bits from the network, it performs the de-encapsulation process, which is a reverse processing of the encapsulation process. The headers are removed layer by layer, and eventually, Device B can read the data.

We need layers in the network model because each layer focuses on its own responsibilities. Each layer can rely on the headers for processing instructions and does not need to know the meaning of the data from the last layer.