TCP/IP

What is TCP/IP?

TCP/IP (Transmission Control Protocol/Internet Protocol) is the fundamental suite of communication protocols that allows computers to communicate over the Internet and other networks.

It is a set of rules (protocols) that dictate how data should be packaged, addressed, transmitted, routed, and received.


🌐 Why is TCP/IP Important?

  • Foundation of the Internet and local networks.

  • Ensures reliable data transfer between devices.

  • Used by nearly all modern networks for email, websites, file sharing, etc.


🔑 Key Components of TCP/IP:

Layer
Description
Protocol Examples

Application Layer

User interaction, services

HTTP, HTTPS, FTP, SMTP, DNS

Transport Layer

End-to-end connection, data reliability

TCP, UDP

Internet Layer

Logical addressing and routing

IP, ICMP, ARP

Network Access Layer

Physical transmission of data (hardware, drivers)

Ethernet, Wi-Fi, PPP


📊 TCP vs. IP - Explained Simply:

Aspect
TCP (Transmission Control Protocol)
IP (Internet Protocol)

Function

Ensures reliable delivery, error checking

Addresses and routes packets

Role

Splits data into packets, ensures they arrive

Assigns IP addresses, handles packet delivery

Connection Type

Connection-oriented (requires handshake)

Connectionless

Reliable?

✅ Yes (retransmits lost packets)

❌ No (best effort delivery)

Used for

Web browsing, email, file transfer

Routing packets to correct destination


⚙️ How TCP/IP Works (Step by Step):

  1. Data Creation: User sends data (e.g., opening a website).

  2. TCP Segment: TCP divides data into packets and adds sequence numbers for ordering and error correction.

  3. IP Packet: Each TCP packet is wrapped in an IP packet, which contains source and destination IP addresses.

  4. Physical Transmission: Data is sent over the network (Ethernet, Wi-Fi).

  5. Routing: Routers forward the packets to the destination.

  6. Reassembly: TCP on the receiving end reassembles packets and checks for errors.

  7. Delivery to Application: Data is passed to the correct application (browser, email client).


💡 TCP/IP Model vs. OSI Model:

OSI Layer
TCP/IP Layer

Application

Application

Presentation

Application

Session

Application

Transport

Transport

Network

Internet

Data Link

Network Access

Physical

Network Access

🔑 Note: TCP/IP combines some OSI layers for simplicity.


🚀 Common TCP/IP Protocols by Layer:

Layer
Protocols

Application

HTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS

Transport

TCP, UDP

Internet

IP (IPv4, IPv6), ICMP, ARP

Network Access

Ethernet, Wi-Fi, PPP


🔐 Important Concepts in TCP/IP:

Concept
Description

IP Address

Unique identifier for a device on a network

Port Number

Identifies specific application or service

Packet

Small unit of data transferred over a network

Routing

Determining the path packets take to reach destination

Subnet Mask

Defines network and host portions of an IP address

DNS

Domain Name System, resolves names to IP addresses

Gateway

Device (router) that connects local network to outside networks


🧭 IP Address Example:

Term
Example

IPv4 Address

192.168.1.10

Subnet Mask

255.255.255.0

Default Gateway

192.168.1.1

DNS Server

8.8.8.8 (Google DNS)


📡 TCP Three-Way Handshake (Connection Setup):

Step
Sender (Client)
Receiver (Server)

1

SYN (Synchronize, request connection)

2

SYN-ACK (Acknowledge and reply)

3

ACK (Acknowledge response)

✅ After the handshake, data transmission begins.


Summary Table:

Feature
TCP/IP

Full Form

Transmission Control Protocol / Internet Protocol

Purpose

Networking and communication protocols

Layers

4 (Application, Transport, Internet, Network Access)

Transport Protocols

TCP, UDP

Addressing

IP addresses (IPv4, IPv6)

Reliability

Ensured by TCP

Connection Type (TCP)

Connection-oriented

Common Ports

80 (HTTP), 443 (HTTPS), 21 (FTP), 25 (SMTP), 53 (DNS)


📖 Real-life Example:

➡️ When you visit https://example.com:

  • DNS resolves "example.com" to an IP address.

  • Your browser uses TCP/IP to create a connection to that IP address on port 443 (HTTPS).

  • Data is transferred via TCP/IP stack.

Last updated