TCP/IP stands for Transmission Control Protocol/Internet Protocol. It’s a set of rules (protocols) that enable computers to communicate over a network like the internet.
It works by breaking down communication into layers, each responsible for a specific task.
TCP/IP is divided into 4 main layers:
-
Application Layer:
- This layer interacts directly with software applications. It decides what data needs to be sent or received.
- Example: Web Browsing (HTTP), emails (SMTP), file transfer (FTP).
- HOW IT WORKS:
- A web browser sends an HTTP request for a webpage.
- The application prepares the data and hands it to the transport layer.
-
Transport Layer:
- This layer ensures reliable delivery of data between devices.
- Key Protocols:
- TCP (Transmission Control protocol) : Reliable, ensures data arrives error-free, in order, and fully delivered.
- UDP (User Datagram Protocol) : Faster but unreliable(for video streaming or gaming).
- HOW IT WORKS:
- Splits data into smaller chunks called segments.
- Adds information like sequence numbers to reassemble the data on the receiver’s side.
- Uses acknowledgments (ACKs) to confirm delivery.
-
Internet Layer:
- This layer handles addressing and routing of data packets so they reach the right destination.
- Key Protocol :
- IP (Internet Protocol) : Every device has an IP address that identifies it on the network.
- HOW IT WORKS:
- Wraps segments into packets and adds a “destination address” (like a postal address.
- Ensures the packets are routed through different networks to reach the correct device.
-
Network Access Layer:
- This layer manages the physical transmission of data over the network hardware.
- Key Protocol : Ethernet , Wi-Fi
- HOW IT WORKS:
- Converts packets into electrical signals, lights pulses, or radio waves, depending on the medium.
- Sends the data to the next device (router, switch , etc..) in the path.
Data Flow Example: Visiting a Website
- Application Layer:
- Your browser sends an HTTP request for
www.example.com
.
- Transport Layer:
- TCP breaks the request into segments, ensures reliable delivery, and hands it to the Internet Layer.
- Internet Layer:
- IP adds the destination address (IP of
www.example.com
) to each packet.
- The packets are routed across multiple networks.
- Network Access Layer:
- Ethernet or Wi-Fi sends the data over the physical network.
When the server responds, the process works in reverse to deliver the webpage back to your browser