DEV Community

Cover image for DNS, FTP & SMTP: Real Protocols Through the OSI Model
Roboticela
Roboticela

Posted on • Edited on

DNS, FTP & SMTP: Real Protocols Through the OSI Model

The Internet Runs on More Than Just Web Pages

When most people think about networking protocols, they think about HTTP and HTTPS.

Those protocols certainly power much of the modern web, but they represent only a small part of the internet's vast ecosystem.

Every day, countless other protocols work behind the scenes to:

  • Resolve domain names
  • Transfer files
  • Deliver email
  • Synchronize services
  • Manage networks

Three of the most important are:

  • DNS (Domain Name System)
  • FTP (File Transfer Protocol)
  • SMTP (Simple Mail Transfer Protocol)

Each operates at the Application Layer, yet each behaves very differently as it moves through the OSI Model.

Understanding these protocols provides a deeper appreciation for how specialized internet communication really is.

DNS – The Internet's Phone Book

Why DNS Exists

Humans prefer names.

Computers prefer numbers.

When you type:

google.com
Enter fullscreen mode Exit fullscreen mode

your computer cannot route traffic using that name alone.

Routers require IP addresses.

DNS solves this problem by translating human-friendly domain names into machine-friendly IP addresses.

For example:

google.com
↓
142.250.80.46
Enter fullscreen mode Exit fullscreen mode

Without DNS, users would need to memorize IP addresses for every website they visit.

The modern internet would be far less usable.

Where DNS Fits in the OSI Model

DNS is an:

Application Layer (Layer 7)
Enter fullscreen mode Exit fullscreen mode

protocol.

It provides a service directly to applications that need to locate resources on the network.

Before a browser can establish an HTTPS connection, it usually performs a DNS lookup first.

DNS and the Transport Layer

One of DNS's most interesting characteristics is its use of UDP.

Most DNS queries use:

UDP Port 53
Enter fullscreen mode Exit fullscreen mode

instead of TCP.

Why?

Because DNS queries are typically:

  • Small
  • Simple
  • Short-lived

Using TCP would require a three-way handshake before every lookup, increasing latency.

UDP allows DNS to prioritize speed.

A Typical DNS Lookup

A DNS interaction usually follows this sequence:

Browser
    ↓
DNS Query
    ↓
DNS Server
    ↓
IP Address Returned
Enter fullscreen mode Exit fullscreen mode

For most websites, this process completes in milliseconds.

Only after DNS provides the destination IP address can the browser begin communicating with the web server.

DNS Through the OSI Stack

A DNS request travels through the OSI layers like this:

DNS Query
     ↓
UDP Datagram
     ↓
IP Packet
     ↓
Ethernet Frame
     ↓
Bits
Enter fullscreen mode Exit fullscreen mode

Notice that only the Application Layer content changes.

The lower layers continue performing their standard responsibilities.

FTP – Moving Files Across Networks

What Is FTP?

FTP stands for:

File Transfer Protocol

It is one of the oldest internet protocols still in use today.

Originally developed in the early days of ARPANET, FTP was designed to move files between computers across a network.

Common FTP tasks include:

  • Uploading files
  • Downloading files
  • Managing directories
  • Transferring large datasets

Although modern alternatives such as SFTP and cloud storage are increasingly popular, FTP remains an important protocol for understanding networking fundamentals.

FTP Uses TCP

Unlike DNS, FTP prioritizes reliability.

File transfers cannot tolerate missing or corrupted data.

For this reason, FTP relies on:

TCP
Enter fullscreen mode Exit fullscreen mode

at the Transport Layer.

TCP ensures:

  • Ordered delivery
  • Error recovery
  • Retransmission of lost dat a

A damaged file transfer is rarely useful, so reliability takes precedence over speed.

FTP's Unique Dual-Connection Design

One of FTP's most distinctive features is that it uses two separate TCP connections.

Control Connection

Typically uses:

TCP Port 21
Enter fullscreen mode Exit fullscreen mode

This connection carries:

  • Commands
  • Authentication requests
  • Server responses

Data Connection

Typically uses:

TCP Port 20
Enter fullscreen mode Exit fullscreen mode

or a negotiated port.

This connection carries the actual file contents.

Why Two Connections?

Imagine uploading a large file.

The file transfer may take minutes.

Meanwhile, you still need the ability to send commands such as:

  • Pause
  • Resume
  • Change directory
  • List files

Separating control traffic from file data makes this possible.

It was a clever design choice for its era.

FTP Through the OSI Model

An FTP upload follows a familiar path:

FTP Command
      ↓
TCP Segment
      ↓
IP Packet
      ↓
Frame
      ↓
Bits
Enter fullscreen mode Exit fullscreen mode

The lower layers remain unchanged.

Only the Application Layer behavior differs.

This demonstrates one of the OSI Model's greatest strengths: separation of responsibilities.

SMTP – Delivering Email Across the Internet

What Is SMTP?

SMTP stands for:

Simple Mail Transfer Protocol

Every email you send relies on SMTP.

Its job is to move email messages between:

  • Email clients
  • Mail servers
  • Mail gateways

SMTP is responsible for sending email.

Receiving email typically involves:

  • POP3
  • IMAP

which are separate protocols.

How Email Travels

Imagine sending an email.

The process typically looks like this:

Email Client
      ↓
SMTP Server
      ↓
Recipient Mail Server
      ↓
Recipient Inbox
Enter fullscreen mode Exit fullscreen mode

SMTP acts as the delivery system connecting these components.

SMTP Ports

SMTP commonly uses:

Port Purpose
25 Server-to-server email transfer
587 Client submission with authentication
465 SMTPS (legacy encrypted SMTP)

Modern email systems often combine SMTP with TLS encryption for secure transmission.

SMTP Commands

Unlike HTTP requests, SMTP communication uses commands designed specifically for email handling.

Examples include:

MAIL FROM:
RCPT TO:
DATA
QUIT
Enter fullscreen mode Exit fullscreen mode

These commands allow mail servers to exchange structured email information.

What Happens During an SMTP Session?

A simplified SMTP exchange might look like:

MAIL FROM: sender@example.com
RCPT TO: receiver@example.com
DATA
Subject: Hello
Message Body
QUIT
Enter fullscreen mode Exit fullscreen mode

These Application Layer commands are eventually encapsulated into TCP segments and transmitted through the network.

SMTP Through the OSI Model

SMTP follows a familiar path:

SMTP Commands
       ↓
TCP Segment
       ↓
IP Packet
       ↓
Frame
       ↓
Bits
Enter fullscreen mode Exit fullscreen mode

Although the Application Layer content differs dramatically from DNS or FTP, the lower layers function almost identically.

Comparing DNS, FTP, and SMTP

The differences become clearer when viewed side by side.

Feature DNS FTP SMTP
Purpose Name Resolution File Transfer Email Delivery
OSI Layer Application Application Application
Transport Protocol UDP (mostly) TCP TCP
Common Ports 53 21 / 20 25 / 587
Reliability Priority Speed Reliability Reliability
Typical Communication Query / Response Commands + Data Mail Commands

Despite their differences, all three rely on the same lower-layer networking infrastructure.

The Elegance of the OSI Model

One of the most important lessons from these protocols is this:

The lower layers don't care what application protocol is being used.

Whether the payload contains:

  • A DNS lookup
  • An FTP file transfer
  • An SMTP email

the Network Layer still routes packets.

The Data Link Layer still builds frames.

The Physical Layer still transmits bits.

This separation of responsibilities is what makes modern networking scalable and flexible.

Explore DNS, FTP & SMTP in the OSI Model Simulator

The Roboticela OSI Model Simulator allows you to compare protocols side by side and observe how their Application Layer behavior differs.

Try running:

  • DNS
  • FTP
  • SMTP

back-to-back and watch:

  • Different headers appear
  • Different ports get assigned
  • Different encapsulation details emerge

while the lower layers remain largely unchanged.

Landing Page:
https://osi-model-simulator.roboticela.com

Launch Simulator:
https://app.osi-model-simulator.roboticela.com

Pay special attention to how DNS uses UDP while FTP and SMTP rely on TCP. It's one of the clearest demonstrations of protocol design trade-offs.

Key Takeaways

  • DNS translates domain names into IP addresses.
  • DNS primarily uses UDP port 53 for fast query-response communication.
  • FTP transfers files and uses separate control and data connections.
  • SMTP is responsible for sending email across networks.
  • FTP and SMTP rely on TCP for reliable delivery.
  • All three protocols operate at the Application Layer.
  • The lower OSI layers remain largely unchanged regardless of the protocol being used.

Conclusion

DNS, FTP, and SMTP demonstrate the remarkable versatility of the Application Layer.

Although they solve completely different problems—name resolution, file transfer, and email delivery—they all rely on the same underlying OSI architecture to move data across networks.

By studying these protocols through the OSI Model, you gain a deeper understanding of how specialized services coexist on the same global internet infrastructure.

In the next article, we'll shift from protocol theory to practical troubleshooting and learn how network engineers use the OSI Model to systematically diagnose real-world connectivity problems.

Top comments (0)