How does the Internet Work : From OSI Model to DNS Resolution


When we browse a website, watch a video, or join a Zoom call, a complex series of events occurs behind the scenes. Understanding how the internet works requires exploring the OSI Model, TCP/IP protocols, HTTP communication, and DNS Resolution.
OSI Model : The Foundation of Networking
The Open Systems Interconnection (OSI) model is a conceptual framework used to understand how data travels across a network. It consists of 7 layers, each with a specific responsibility.
Quick Overview of Layers
Application Layer – Direct interaction with user applications (e.g., web browsers using HTTP).
Presentation Layer – Handles data translation, compression, encryption.
Session Layer – Establishes, manages, and terminates communication sessions.
Transport Layer – Ensures data delivery using TCP (reliable) or UDP (fast but unreliable).
Network Layer – Responsible for routing and IP addressing.
Data Link Layer – Converts data into frames and manages MAC addresses.
Physical Layer – Transmits raw bits (0 and 1) over cables, Wi-Fi, or fiber.
Transport Layer: TCP and UDP
The Transport Layer is where data integrity and delivery are managed. It has two major protocols:
TCP (Transmission Control Protocol)
Key Characteristics:
Reliable: Ensures all packets reach the destination.
Ordered: Reassembles packets in the correct order.
Connection-Oriented: Uses a 3-Way Handshake.
TCP 3-Way Handshake
Client Server
| ----------- SYN ----------> |
| <-------- SYN-ACK --------- |
| ----------- ACK ----------> |
|------ Connection Established ------|
SYN: Client requests a connection.
SYN-ACK: Server acknowledges and responds.
ACK: Client confirms; connection established.
TCP ensures reliability but introduces latency, making it slower for real-time communication.
UDP (User Datagram Protocol)
Fast and lightweight
Unreliable: Packets can be lost or arrive out of order.
No Handshake: Lower latency.
Use Cases:
Video calls (like Zoom)
Live gaming
VoIP calls
Real-World Scenarios
Application | Protocol Used | Reason |
Cricket Score Update (live website) | TCP | Reliability is more important than speed |
Video Call (Zoom, Meet) | UDP | Low latency is critical |
YouTube Live Streaming | TCP | Acceptable latency for reliable playback |
Zoom optimizes by using UDP for hosts and TCP for muted participants, ensuring a mix of low latency and reliability.
HTTP and its Evolution
The HyperText Transfer Protocol (HTTP) is the backbone of web communication. It works at the Application Layer and typically uses TCP at the Transport Layer.
HTTP Versions: 1.0 → 1.1 → 2 → 3
Evolution of HTTP
HTTP 1.0 – A new TCP handshake was required for every request.
HTTP 1.1 – Introduced persistent connections, reusing the TCP handshake.
HTTP 2 – Added multiplexing, sending multiple requests over one connection.
HTTP 3 – Uses QUIC over UDP for faster, low-latency communication.
TCP vs UDP in Web Communication
TCP: Reliable but slower (used in standard web browsing, YouTube Live).
UDP: Faster with acceptable packet loss (used in real-time apps like Zoom calls).
DNS : The Phonebook of the Internet
Even with TCP and HTTP, your computer cannot connect to a website without knowing its IP address. This is where DNS (Domain Name System) comes in.
What is DNS?
DNS translates human-readable domain names (e.g., www.google.com
) into machine-readable IP addresses (e.g., 142.250.182.206
).
Without DNS, we would need to remember IPs for every website.
Step-by-Step DNS Resolution
User types
www.example.com
in a browser.Local DNS Resolver (ISP or OS) checks its cache.
If not found, it queries the Root DNS Server.
Root DNS returns the TLD Server (like
.com
).TLD server returns the Authoritative DNS Server for the domain.
Authoritative server provides the IP address.
Resolver returns IP to the browser.
Browser connects to the web server using that IP.
Which Protocol Does DNS Use?
UDP on Port 53 – Fast and efficient for small queries.
TCP – Used for large responses or zone transfers.
DNS Records
DNS records are instructions stored in authoritative DNS servers that provide information about a domain, such as its IP address, mail server, and other essential data. Learn more about DNS records here: Cloudflare DNS Records Guide
DNS Records and Their Types
DNS Records define how a domain should be resolved.
Record Type | Purpose | Example |
A | Maps to IPv4 address | example.com → 192.0.2.1 |
AAAA | Maps to IPv6 address | example.com → 2001:db8::1 |
CNAME | Alias of another domain | www → example.com |
MX | Mail Exchange server | example.com → mail.com |
TXT | Stores arbitrary text / verification | SPF, DKIM records |
NS | Points to authoritative name servers | ns1.example.com |
PTR | Reverse lookup (IP → Domain) | 192.0.2.1 → example.com |
Fun Experiment : Performing a DNS Lookup Command
You can use the dig
command to perform a DNS lookup:
dig example.com
This command queries the DNS system and returns information about the domain, including its IP address and other DNS records.
Putting It All Together
When you open a website:
Application Layer (HTTP) – You request
www.example.com
.DNS Lookup – Translates domain to IP.
Transport Layer (TCP/UDP) – Establishes connection (TCP) or sends packets (UDP).
Network Layer (IP) – Routes packets to the destination server.
In short:
OSI Model gives the framework.
TCP/UDP ensures data transport.
HTTP handles web communication.
DNS resolves names to IPs.
All these layers work together to make the modern internet function seamlessly.
Subscribe to my newsletter
Read articles from Anushka Banerjee directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
