TCP (Transmission Control Protocol) - Overview
TCP (Transmission Control Protocol) is a connection-oriented protocol that ensures reliable
communication between devices on a network. It operates at Layer 4 (Transport Layer) of the OSI
model.
Key Features of TCP:
- Connection-Oriented: A connection is established before data is transmitted.
- Reliable: TCP ensures that data is delivered in order and without errors.
- Error Checking: TCP uses checksums to verify data integrity.
- Flow Control: TCP uses windowing to prevent overwhelming the receiver.
- Congestion Control: TCP adjusts the data rate based on network conditions.
- Sequencing: Ensures packets are reassembled in the correct order.
- Acknowledgments: Each data segment is acknowledged upon receipt.
Three-Way Handshake:
1. SYN: The client sends a SYN (synchronize) message to the server.
2. SYN-ACK: The server responds with a SYN-ACK message.
3. ACK: The client sends an ACK (acknowledgment), and the connection is established.
TCP Header Fields:
- Source Port & Destination Port: Identify sending and receiving applications.
- Sequence Number: Keeps track of data segments.
- Acknowledgment Number: Indicates the next expected byte.
- Data Offset: Size of the TCP header.
- Flags: Control bits (SYN, ACK, FIN, etc.).
- Window Size: Controls flow of data.
- Checksum: Ensures integrity.
- Urgent Pointer: Indicates urgent data.
Common Applications that Use TCP:
- HTTP/HTTPS (Web Browsing)
- FTP (File Transfer Protocol)
- SMTP (Email)
- Telnet
- SSH