DEV Community

Cover image for How Data Travels Through the Internet: Networking | OSI model
EyaCode
EyaCode

Posted on

How Data Travels Through the Internet: Networking | OSI model

Have you ever wondered how your email is sent through the internet? Let’s find out! (😄)
Before we dive in, let’s describe some of the key network components that we always hear about :

A Look at the Components of a Home Network:

Cables:
Cables are usually made of coaxial or fiber-optic materials and carry internet data signals. These cables provide Ethernet connections to host computers or a LAN (Local Area Network).

DSL – Digital Subscriber Line:
DSL runs over a telephone line and is split into channels:

  • One channel is used for voice telephone calls.
  • A second channel is used for receiving information from the internet (download channel).
  • A third channel is used for sending information (upload channel), which is usually slower than the download channel.

Home Network Router
is a device that connects a local network (e.g., home devices) to the internet, providing wireless or wired access and managing data traffic between devices within the network and external networks. it has :

  • Ethernet Port: The internal switch portion of the router. All devices connected to the switch ports are on the same LAN (Local Area Network).

  • Internet Port: This is used to connect the router to another network, often via cable or DSL, to access the internet.

Let’s Send an Email!

to make the process easier we will use a common model called the OSI model
What Is the OSI Model?
Think of the OSI model as a framework that helps us understand the network architecture and communication protocols. It breaks down the process of communication into 7 layers, each responsible for a specific function. It provides a systematic approach for data transmission between devices connected to the internet.
Step-by-Step Email Process Through the OSI Model:

Image description

Layer 7: Application Layer
This is where you start! You write the email in an application like Gmail or Outlook. The application prepares the email by adding headers (e.g., sender, recipient) and body content (e.g., text, attachments). It uses SMTP (Simple Mail Transfer Protocol) to handle email sending.

Image description

Layer 6: Presentation Layer
At this layer, data are encoded or compressed for transmission and formatted correctly for the recipient’s system.

Image description

Layer 5: Session Layer
This layer manages the session between the sender and recipient. It ensures that communication remains open until all parts are successfully transferred.

Image description

Layer 4: Transport Layer
Here, the email data is divided into smaller chunks called segments. The TCP (Transmission Control Protocol) ensures that these segments are delivered reliably and in the correct order.

Image description

Layer 3: Network Layer
At this layer, each segment is encapsulated into a packet. A packet includes the segment plus the IP source and destination addresses (in this case, the IP address of the mail server). This information is crucial for routing the packet across networks.
Layer 2: Data Link Layer
The packet is further encapsulated into a frame at this layer. The frame adds the MAC address of your network interface card (NIC) and the next-hop device’s MAC address (e.g., router).

Image description

Layer 1: Physical Layer
At the Physical Layer, the frames are converted into physical signals (such as electrical impulses, light pulses, or radio waves) and transmitted through network hardware to the next destination.

Image description

And there you have it! Now you know how sending an Email works 🌐✨

Top comments (0)