TCP/IP Model: Layers & Protocols

Nerd Cafe

Introduction to the TCP/IP Model

The TCP/IP model (Transmission Control Protocol/Internet Protocol) is a networking framework that defines how data is transmitted across networks, including the internet. It was developed by the Department of Defense (DoD) and is widely used for modern networking.

Unlike the OSI model, which has seven layers, the TCP/IP model has only four layers, which map to the OSI model but in a simplified manner.

TCP/IP Model Layers

The TCP/IP model consists of the following four layers, from top to bottom:

TCP/IP Layer
OSI Equivalent Layers

Application Layer

Application, Presentation, Session

Transport Layer

Transport

Internet Layer

Network

Network Access Layer

Data Link, Physical

Each layer is responsible for a specific function in the data transmission process. Let’s examine them one by one.

Function:

  • Responsible for the physical transmission of data.

  • Defines how bits are transmitted over cables, Wi-Fi, or fiber optics.

  • Includes addressing (MAC addresses), frame formatting, and error detection.

Protocols & Technologies:

  • Ethernet (IEEE 802.3) – Used for wired connections.

  • Wi-Fi (IEEE 802.11) – Wireless networking.

  • PPP (Point-to-Point Protocol) – Used in dial-up and some VPNs.

  • MAC (Media Access Control) Address – A unique address for network interfaces.

Practical Example:

  1. Connect two computers using an Ethernet cable.

  2. Use the ipconfig /all (Windows) or ifconfig (Linux/macOS) command to view the MAC address of your network adapter.

  3. Send a ping command (ping 192.168.1.1) and capture packets using Wireshark to observe the Ethernet frame structure.

2. Internet Layer (Network Layer in OSI)

Function:

  • Handles routing and logical addressing (IP addresses).

  • Defines how packets move across networks.

  • Uses IP addresses instead of MAC addresses for global communication.

Protocols:

  • IP (Internet Protocol) – Responsible for addressing and routing packets.

    • IPv4 (Internet Protocol Version 4) – Uses 32-bit addresses (e.g., 192.168.1.1).

    • IPv6 (Internet Protocol Version 6) – Uses 128-bit addresses (e.g., 2001:db8::ff00:42:8329).

  • ICMP (Internet Control Message Protocol) – Used for error reporting (ping command).

  • ARP (Address Resolution Protocol) – Translates IP addresses to MAC addresses.

Practical Example:

  1. Open Command Prompt (Windows) or Terminal (Linux/macOS).

  2. Use ping 8.8.8.8 to test connectivity with Google’s public DNS.

  3. Use tracert 8.8.8.8 (Windows) or traceroute 8.8.8.8 (Linux) to see the path taken by packets.

  4. Use arp -a to display the ARP table.

3. Transport Layer (Same as OSI Transport Layer)

Function:

  • Manages end-to-end communication between devices.

  • Ensures error checking and data integrity.

  • Uses port numbers to differentiate services (e.g., web, email, FTP).

Protocols:

  • TCP (Transmission Control Protocol) – Reliable, connection-oriented protocol.

    • Used by HTTP, HTTPS, FTP, SMTP, etc.

  • UDP (User Datagram Protocol) – Unreliable, connectionless protocol.

    • Used by DNS, VoIP, video streaming.

Protocol
TCP Port
UDP Port
Function

HTTP

80

-

Web Browsing

HTTPS

443

-

Secure Web Browsing

FTP

21

-

File Transfer

DNS

-

53

Domain Name Resolution

DHCP

-

67, 68

Dynamic IP Addressing

Practical Example:

  1. Use Wireshark to capture TCP and UDP packets.

  2. Open Command Prompt/Terminal and type:

    • netstat -an (Windows) or ss -tulnp (Linux) to see active TCP/UDP connections.

  3. Open a website in a browser and observe TCP three-way handshake in Wireshark.

4. Application Layer (Application, Presentation, Session in OSI)

Function:

  • Provides network services to applications.

  • Handles data encoding and encryption.

  • Includes common network applications like web browsing, email, file transfer.

Protocols:

  • HTTP/HTTPS – Web Browsing.

  • FTP (File Transfer Protocol) – File sharing.

  • SMTP (Simple Mail Transfer Protocol) – Sending Emails.

  • POP3/IMAP – Receiving Emails.

  • DNS (Domain Name System) – Resolving domain names to IP addresses.

  • DHCP (Dynamic Host Configuration Protocol) – Assigning IP addresses.

Practical Example:

  1. Open a web browser and visit https://www.google.com.

  2. Use nslookup google.com (Windows) or dig google.com (Linux) to find Google’s IP address.

  3. Use telnet google.com 80 to simulate a raw HTTP request.

Summary

Layer
Function
Protocols

Application

Provides network services

HTTP, FTP, SMTP, DNS, DHCP

Transport

Manages connections

TCP, UDP

Internet

Handles routing & IP addressing

IP, ICMP, ARP

Network Access

hysical data transmission

Ethernet, Wi-Fi, PPP

Keywords

TCP/IP model, network layers, application layer, transport layer, internet layer, network access layer, IP addressing, MAC address, routing, TCP protocol, UDP protocol, HTTP, DNS, DHCP, ICMP, ARP, Ethernet, Wi-Fi, packet switching, network protocols, نتورک پلاس

Last updated