Data Communication and Networking
TCP/IP Model; Transport Layer — TCP vs UDP
C-CAT
TCP/IP Model
What is TCP/IP Model?
The TCP/IP Model (Internet Model) is the practical model used in real-world networking (the Internet).
Developed by DARPA for the ARPAnet (predecessor to the internet).
Comparison with OSI:
OSI Model (7 layers) TCP/IP Model (4 layers)
----------------------- -------------------------
7. Application Application
6. Presentation → (merged into Application)
5. Session (merged into Application)
4. Transport Transport
3. Network → Internet
2. Data Link → Network Access (Link)
1. Physical (merged into Network Access)
TCP/IP Layers
| Layer | OSI Equivalent | Protocols |
|---|---|---|
| Application | Layers 5, 6, 7 | HTTP, HTTPS, FTP, SMTP, DNS, DHCP, SSH |
| Transport | Layer 4 | TCP, UDP |
| Internet | Layer 3 | IP (IPv4/IPv6), ICMP, IGMP |
| Network Access | Layers 1, 2 | Ethernet, Wi-Fi, ARP |
Key TCP/IP Protocols
| Protocol | Port | Purpose |
|---|---|---|
| HTTP | 80 | Web browsing |
| HTTPS | 443 | Secure web browsing |
| FTP | 20, 21 | File transfer |
| SFTP | 22 | Secure file transfer |
| SSH | 22 | Secure remote login |
| TELNET | 23 | Remote login (insecure) |
| SMTP | 25 | Send email |
| DNS | 53 | Domain name resolution |
| DHCP | 67, 68 | IP address assignment |
| POP3 | 110 | Receive email (download) |
| IMAP | 143 | Receive email (server-side) |
| SNMP | 161 | Network device management |
Transport Layer — TCP vs UDP
TCP — Transmission Control Protocol
TCP provides reliable, ordered, error-checked delivery of data between applications.
TCP Characteristics:
| Feature | Description |
|---|---|
| Connection | Connection-oriented; 3-way handshake before data |
| Reliability | Guaranteed delivery (ACK for every segment) |
| Order | Segments reassembled in order (sequence numbers) |
| Error control | Retransmission of lost segments |
| Flow control | Sliding window prevents overwhelming receiver |
| Congestion control | Adjusts speed based on network congestion |
| Overhead | High (more header fields) |
| Use case | Web (HTTP), email, file transfer, SSH |
TCP Three-Way Handshake
Client Server
| |
|──── SYN ────────────────>| (Client: I want to connect; seq=x)
| |
|<─── SYN-ACK ────────────| (Server: OK, I'm ready; seq=y, ack=x+1)
| |
|──── ACK ────────────────>| (Client: Got it; ack=y+1)
| |
| ← DATA TRANSFER BEGINS →|
Connection Termination (4-way):
Client → FIN → Server
Client ← ACK ← Server
Client ← FIN ← Server
Client → ACK → Server
UDP — User Datagram Protocol
UDP provides fast, connectionless, unreliable data transmission.
UDP Characteristics:
| Feature | Description |
|---|---|
| Connection | Connectionless; no handshake |
| Reliability | No guarantee of delivery |
| Order | No sequence numbers |
| Error control | No retransmission |
| Overhead | Low (small header) |
| Speed | Much faster than TCP |
| Use case | Video/audio streaming, DNS, gaming, VoIP |
TCP vs UDP Comparison
| Feature | TCP | UDP |
|---|---|---|
| Connection | Connection-oriented | Connectionless |
| Reliability | Guaranteed delivery | Best effort |
| Order | In-order delivery | May arrive out of order |
| Speed | Slower | Faster |
| Header | 20 bytes minimum | 8 bytes |
| Overhead | High | Low |
| Flow control | Yes | No |
| Congestion control | Yes | No |
| Use | HTTP, FTP, SSH, SMTP | DNS, DHCP, video streaming, VoIP, gaming |
Port Numbers
Port numbers identify specific applications/processes on a device.
Range:
| Range | Type | Description |
|---|---|---|
| 0 – 1023 | Well-Known | Reserved for standard protocols |
| 1024 – 49151 | Registered | Assigned to non-standard apps |
| 49152 – 65535 | Dynamic/Ephemeral | Temporary client ports |
Continue learning
Related notes
Definition of AI; Need of AI
Artificial Intelligence
Introduction to Data Engineering; Big Data — The 5 V's; Types of Data
Big Data and Data Engineering
Introduction to C Programming; C Program Structure; Data Types and Variables
C Programming
What Is a Computer?; Machine Cycle: Fetch–Decode–Execute; CPU Organization
Computer Architecture
Put this topic into timed practice
Open mock tests when you want full-exam pacing, or keep drilling in practice mode.