Skip to main content

Command Palette

Search for a command to run...

Internet Protocols Explained: The Language of the Web

How Devices Talk to Each Other — From TCP/IP to DNS, Made Simple

Published
10 min read
Internet Protocols Explained: The Language of the Web

Imagine This First

You’re sending a letter to your friend in another city. You write it, put it in an envelope, add an address, stamp it, and drop it in the mailbox. Behind the scenes, a system of rules, vehicles, and people ensures your letter gets to the right place.

That entire system is like a network protocol—a set of rules that governs how information travels from one computer to another.

What Are Network Protocols?

A network protocol is a formal set of rules and standards that defines how data is transmitted, received, formatted, and processed across computer networks.

It’s like a language two devices use to understand each other over a network.

Without protocols, your computer and the server on the other end would not know:

  • When a message starts or ends

  • Whether the message is complete or broken

  • What to do if the message fails

  • How to respond

Common Network Protocols

  • TCP/IP(Transmission Control Protocol / Internet Protocol): Reliable delivery and routing of data

  • FTP/SFTP((Secure) File Transfer Protocol): Uploading/downloading files

  • SMTP/IMAP/POP3(Email protocols): Sending and receiving emails

  • DNS(Domain Name System): Converts domain names (like google.com) into IP addresses

  • DHCP(Dynamic Host Configuration Protocol): Automatically assigns IP addresses to devices

  • UDP(User Datagram Protocol): Fast, no-guarantee delivery (like video streaming or online games)

  • HTTP/HTTPS(HyperText Transfer Protocol (Secure)): Loads websites from servers

Key Characteristics of Protocols

  • Standardized: All devices can follow the same rules

  • Scalable: Works across small home networks to global internet

  • Layered: Easier to design, troubleshoot, and upgrade

  • Secure (when needed): Helps protect privacy and data integrity

Why Do Network Protocols Matter?

  1. Interoperability: Different devices (Apple, Android, Windows, Linux) can talk to each other because they follow the same standard protocols.

  2. Reliable Communication: Protocols like TCP ensure that no data is lost during transmission—even over unstable networks.

  3. Security: Protocols like HTTPS, SSL/TLS, and SSH keep data safe from eavesdropping or tampering.

  4. Scalability: The internet has billions of devices. Protocols like IP help route data efficiently, even at massive scale.

  5. Automation: Protocols like DHCP allow networks to configure devices automatically—without manual settings.

How Network Protocols Work

Most network protocols are organized into layers, based on the OSI Model (Open Systems Interconnection). Each layer focuses on a specific task.

OSI Model

The OSI Model (Open Systems Interconnection Model) is a conceptual framework used to understand and describe how data moves from one device to another over a network. It divides the communication process into 7 distinct layers, each with specific functions and protocols.

  1. Physical Layer: Transmits raw bits over a physical medium

  2. Data Link Layer: Error detection/correction, MAC addressing, switches

  3. Network Layer: Routing and forwarding of data packet

  4. Transport Layer: Reliable data transfer, error recovery, flow control

  5. Session Layer: Manages sessions or connections between applications

  6. Presentation Layer: Data translation, encryption/decryption, compression

  7. Application Layer: User-facing layer: provides network services to applications

Layer-by-Layer Breakdown

1. Physical Layer

Role:

  • Transmits raw bits (0s and 1s) over a physical medium.

  • Deals with hardware-level signaling, voltages, cables, and connectors.

  • Defines physical characteristics: pin layout, signal type, and data rate.

Key Concepts:

  • Bit synchronization

  • Bit rate control

  • Modulation

  • Transmission medium (wired/wireless)

Devices:

  • RS232, DSL, USB, IEEE 802.11 (Wi-Fi Physical Layer)

  • Bluetooth, Ethernet (physical aspect)

Example:

  • Sending 10101010 through an Ethernet cable as electrical pulses.

Role:

  • Ensures error-free transmission between two directly connected nodes.

  • Adds MAC (Media Access Control) address to frames.

  • Responsible for framing, error detection, and flow control.

Sublayers:

  1. LLC (Logical Link Control) – Multiplexing protocols, error correction.

  2. MAC (Media Access Control) – Defines how devices access the network medium.

Devices:

  • Switches

  • Bridges

  • Network cards (with MAC)

Protocols:

  • Ethernet (802.3)

  • ARP (Address Resolution Protocol)

  • PPP, HDLC, Frame Relay

  • VLAN (802.1Q)

Example:

  • When your laptop connects to a router via Wi-Fi, the MAC address helps the router identify your device.

3. Network Layer

Role:

  • Handles routing, addressing, and packet forwarding.

  • Adds IP addresses to packets.

  • Determines the best path across networks (routing).

Key Concepts:

  • Logical addressing (IP address)

  • Packet fragmentation

  • Routing tables

Devices:

  • Routers

  • Layer 3 switches

Protocols:

  • IP (IPv4, IPv6)

  • ICMP (ping, traceroute)

  • IGMP (multicast)

  • Routing protocols: OSPF, RIP, BGP

Example:

  • You visit masterji.com → the network layer ensures your request is routed through the internet to the server hosting masterji.com using its IP address.

4. Transport Layer

Role:

  • Ensures complete and reliable data transfer between devices.

  • Handles segmentation, error recovery, flow control.

  • Uses port numbers to direct data to the right application.

Key Concepts:

  • Segmentation/reassembly

  • Port numbers (e.g., HTTP: 80, HTTPS: 443)

  • Connection-oriented (TCP) vs. connectionless (UDP)

Protocols:

  • TCP (Transmission Control Protocol)

  • UDP (User Datagram Protocol)

Devices:

  • Host devices (end systems)

Example:

  • A YouTube video stream uses UDP for fast transfer with no delay; a file download uses TCP for reliable transfer.

5. Session Layer

Role:

  • Manages sessions (conversations) between two applications.

  • Handles start, manage, and end of a session.

  • Ensures the sessions can recover from interruptions.

Key Tasks:

  • Synchronization

  • Session checkpointing (recovery after interruption)

  • Token management

Protocols:

  • NetBIOS

  • PPTP (VPN)

  • RPC (Remote Procedure Call)

  • SMB (used in Windows file sharing)

Example:

  • You log in to a banking website and stay logged in for 10 minutes — that's a session.

6. Presentation Layer

Role:

  • Translates data between the application and the network.

  • Handles data format translation, encryption, compression.

  • Ensures data is readable by the receiving system.

Key Tasks:

  • Data encoding/decoding

  • Encryption/decryption (SSL/TLS)

  • Compression (e.g., JPEG, MP3)

Protocols/Formats:

  • SSL/TLS

  • JPEG, PNG, GIF

  • ASCII, EBCDIC, MPEG, MP3

Example:

  • A browser decrypts a TLS-encrypted message from an HTTPS site before showing you the content.

7. Application Layer

Role:

  • Closest to the user.

  • Interfaces with software applications to provide network services.

  • Does NOT include the actual application, but rather the protocols that support it.

Key Tasks:

  • Identifies communication partners

  • Determines resource availability

  • Synchronizes communication

Protocols:

  • HTTP/HTTPS (Web)

  • FTP (File Transfer)

  • SMTP, POP3, IMAP (Email)

  • DNS (Domain Name System)

  • SNMP (Network Monitoring)

Example:

  • When you type "masterji.com" into your browser, the browser uses HTTP/HTTPS (Application layer) to communicate with the website.

Understanding TCP/IP and UDP is essential after learning the OSI model, especially since these protocols power almost all internet communication.

TCP/IP Basics: The Foundation of Internet Communication

Imagine you're sending a letter to a friend in another city. You write it, put it in an envelope, write their address, and drop it at the post office. Now think of your computer doing something similar every time you visit a website, send a message, or stream a video. The system that makes this all work over the internet is called TCP/IP — the invisible post office of the digital world.

What is TCP/IP?

TCP/IP stands for:

  • TCP – Transmission Control Protocol

  • IP – Internet Protocol

Together, they form the basic communication rules of the internet — like the grammar and vocabulary of how computers talk to each other.

What Does IP Do?

At its core, IP is responsible for identifying and locating devices on a network and routing data between them.

When you:

  • Open a website,

  • Send a message,

  • Watch a YouTube video,

… your computer must know where to send and receive data. That “where” is handled by IP addresses.

How IP Works in Action

Let’s say you open a browser and type masterji.com.

  1. Your browser asks a DNS server:
    “What is the IP address of masterji.com?”
    (DNS = like a phone book of the internet)

  2. DNS replies:
    “It’s 142.250.190.78” (example)

  3. Your browser now knows where to send a request.

  4. Your computer uses this IP address to send a request across the internet.

  5. The server (at that IP) sends back the webpage.

💡 Without IP, your computer would be blindly shouting into space without knowing where to send or receive anything.

What is an IP Address?

An IP address is a unique number that identifies a device on a network — like a digital home address.

It looks like this:

  • IPv4: 192.168.1.1
    (4 numbers from 0 to 255, separated by dots)

  • IPv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
    (A longer format designed to support more devices)

Types of IP Addresses

  1. Public IP: Used on the Internet

  2. Private IP: Used within a local network (home/office)

  3. Static IP: Doesn't change

  4. Dynamic IP: Changes automatically

What is TCP?

TCP is a connection-oriented and reliable transport protocol used to send data across networks like the Internet. It ensures:

  • Data reaches its destination

  • In the correct order

  • Without loss, duplication, or corruption

How TCP Works

1. Three-Way Handshake

To establish a reliable connection between two devices:

  1. SYN → Client sends a synchronize (SYN) packet to the server

  2. SYN-ACK → Server responds with SYN and Acknowledgement (SYN-ACK)

  3. ACK → Client sends acknowledgment (ACK)
    Now the connection is established.

2. Segmentation & Reassembly

  • Large data is split into segments.

  • Each segment has a sequence number.

  • The receiver uses these numbers to reorder segments if needed.

3. Reliability with Acknowledgments

  • Each time data is sent, the sender waits for an ACK (acknowledgment).

  • If no ACK is received in time → it retransmits.

4. Flow Control (Sliding Window Protocol)

  • Prevents sender from overwhelming the receiver.

  • Sender can only send a specific amount of data before stopping to wait for ACKs.

  • The "window size" tells how much data can be sent without waiting.

5. Error Detection

  • TCP uses checksums to detect errors in data.

  • If a checksum doesn't match → the receiver discards the segment.

6. Congestion Control

  • TCP monitors network traffic to avoid congestion.

  • Algorithms like Slow Start, Congestion Avoidance, and Fast Retransmit are used.

7. Connection Termination (Graceful Close)

  • When the session ends, both sides must agree to terminate.

Steps:

  1. Client sends FIN

  2. Server sends ACK, then FIN

  3. Client sends ACK
    Connection closed

The TCP/IP Model (4 Layers)

The TCP/IP model has 4 layers, each with its own role:

Just like sending a letter needs a writer, paper, address, and delivery truck — the internet needs all these layers to move data smoothly.

Why TCP/IP Matters

  • Universal – Every website, email, or online service uses TCP/IP

  • Reliable – Ensures your data is complete and accurate

  • Scalable – Works for billions of devices globally

  • Flexible – Used in home Wi-Fi, mobile networks, satellites, etc.

UDP: User Datagram Protocol

UDP is like sending a postcard without checking if it arrives. It's fast, simple, and doesn’t wait around for a reply.

What is UDP?

UDP is a transport layer protocol in the TCP/IP model, just like TCP — but it's simpler, faster, and less reliable.

Where TCP is like a registered courier (with delivery confirmation), UDP is more like dropping a letter in a public mailbox and hoping it gets there — no guarantee, no tracking, no follow-up.

How UDP Works

  1. Sender breaks data into chunks called datagrams

  2. Each datagram includes:

    • Destination IP address

    • Port number (who to talk to on that machine)

    • The data

  3. It sends the datagram directly to the receiver, without setting up a connection

  4. Receiver may or may not get the data

  5. No checks, no acknowledgments, no retransmissions

UDP Packet Structure

A UDP packet (datagram) is simple:

mathematicaCopyEdit| Source Port | Destination Port | Length | Checksum | Data |
  • Very lightweight — only 8 bytes of header!

  • The rest is your data payload

Why Use UDP?

AdvantageDescription
SpeedNo handshakes or checks = very fast
Low OverheadSmaller packet size than TCP
Broadcast FriendlyWorks well for one-to-many communication
Real-TimePerfect for apps that need speed over perfection

Limitations of UDP

  • ❌ No guarantee of delivery

  • ❌ Packets may be lost, duplicated, or arrive out of order

  • ❌ No automatic error checking or correction

  • ❌ Not ideal for critical data (like file transfers)