Computer Networks
CN Part-1
- What is a Computer Network?
- Goals and Applications of Computer Networking
- Computer Network Components
- Types of Computer Networks
- Network Topology
- Difference between Client Server and Peer to Peer Network
- Layered Architecture in Computer Networks
- Protocol Hierarchy in Computer Networks
- Interfaces and Services in Computer Networks
- Connection Oriented and Connectionless Services
- Service Primitives
- OSI Model
- TCP/IP Model
- Difference between OSI Model and TCP/IP Model
- Encapsulation and Decapsulation in Computer Networks
- Queueing Models in Computer Network
CN Part-2
- Physical Layer in Computer Networks
- Transmission Media in Computer Networks
- Analog and Digital Signals
- Data Rate and Bandwidth
- Encoding Techniques
- Multiplexing in Computer Networks
- Transmission Modes in Computer Networks
- Data Link Layer
- Framing in Data Link Layer
- Flow Control in Data Link Layer
- Error Control in Data Link Layer
- Error Detection and Correction in Computer Networks
- Stop and Wait Protocol
- Sliding Window Protocol
- SDLC(Synchronous Data Link Control) Protocol
- High-Level Data Link Control (HDLC) Protocol
- Point-to-Point Protocol (PPP)
CN Part-3
- MAC Sublayer and MAC Addressing
- Channel Allocation Methods
- ALOHA Protocol (Pure and Slotted ALOHA)
- CSMA/CD and CSMA/CA in Computer Networks
- Ethernet (IEEE 802.3)
- Wireless LANs (IEEE 802.11, Wi-Fi, and Bluetooth Basics)
- Network Layer and Design Issues
- IPv4 and IPv6 Protocols
- Addressing: IP Address, Subnetting, and Supernetting
- Routing Algorithms: Static vs Dynamic, Distance Vector, and Link State
- Routing Protocols: RIP, OSPF, and BGP
- Packet Switching and IP Fragmentation
- Network Layer Protocols: ICMP, ARP, RARP, DHCP, and NAT
CN Part-4
- Transport Layer and Functions
- Process-to-Process Delivery, Ports, and Sockets
- TCP Segment and Three-Way Handshake Connection Establishment
- UDP (User Datagram Protocol): Format and Features
- Flow Control and Error Control in Transport Layer
- Congestion Control: Leaky Bucket, Token Bucket, and TCP Congestion Control
CN Part-5
- Application Layer Architecture and Principles
- Domain Name System (DNS)
- Email Protocols: SMTP, POP3, and IMAP
- File and Web Protocols: FTP, HTTP, and HTTPS
- Remote Access Protocols: Telnet and SSH
- World Wide Web (WWW) and Web Architecture
- Network Security Basics: SSL, TLS, and Cryptography Fundamentals
UDP (User Datagram Protocol): Format and Features in Computer Networks
UDP kya hai? (What is User Datagram Protocol?)
User Datagram Protocol (UDP) Transport Layer ka ek lightweight, connectionless aur extremely fast protocol hai jise RFC 768 dwara define kiya gaya tha.
TCP ke opposite, UDP “Send and Forget” (Fire and Forget) principle par kaam karta hai. Isme na koi 3-way handshake hota hai, na flow control, aur na hi koi error recovery mechanism.
Agar koi packet network par lost ho jaye, toh UDP na uski parwah karta hai aur na hi use dubara bhejta hai.
Toh fir UDP kyu use hota hai?
Speed aur Low Latency ke liye! Online multiplayer gaming (BGMI, CS), live video streaming (YouTube Live, Hotstar), aur voice calls (VoIP/Zoom) mein 100% data reliability se zyada important real-time delivery hoti hai. Agar live video ka ek frame miss ho jaye, toh purane frame ko retransmit karne se stream freeze ho jayegi jo bilkul unacceptable hai.
1. UDP Datagram Format
UDP header bohot compact aur simple hota hai. Iska size fixed 8 Bytes (64 bits) hota hai:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Data (Payload) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Field | Size | Purpose aur Description |
|---|---|---|
| Source Port | 16 bits (2 Bytes) | Sending application ka Port number. Optional hota hai (agar reply ki zaroorat na ho toh 0 set kar sakte hain). |
| Destination Port | 16 bits (2 Bytes) | Receiving application process ka Port number (Mandatory). |
| Length | 16 bits (2 Bytes) | Poore UDP packet ka total size bytes mein (UDP Header [8B] + Data Payload). Minimum length 8 Bytes hoti hai (jab data empty ho). |
| Checksum | 16 bits (2 Bytes) | Error detection ke liye. IPv4 mein Checksum optional hota hai (0 ka matlab no checksum), lekin IPv6 mein mandatory hota hai. |
Key Features of UDP
-> Connectionless: Koi handshaking ya connection setup delay nahi hota. Data turant chala jaata hai.
-> Low Overhead: Sirf 8 bytes ka header (jabki TCP ka minimum 20 bytes hota hai). Isse network bandwidth save hoti hai.
-> No Flow and Congestion Control: UDP sender channel capacity ya receiver speed dekhe bina full speed par packets send karta hai.
-> Message-Oriented (Preserves Boundaries): Application jitne size ka chunk bhejti hai, UDP exactly utna hi datagram banata hai (unlike TCP jo continuous byte stream ki tarah data tod deta hai).
-> Broadcast and Multicast Support: TCP sirf 1-to-1 (Unicast) support karta hai, jabki UDP Unicast, Multicast, aur Broadcast teeno smoothly support karta hai.
When to Use UDP? Popular Applications
DNS (Domain Name System – Port 53): Single query and single response application. 3-way handshake ka extra overhead DNS ko bohot slow bana dega.
DHCP (Dynamic Host Configuration Protocol – Port 67/68): Broadcast communication use karta hai jo TCP mein possible nahi hai.
SNMP (Simple Network Management Protocol): Network routers aur switches ki health monitoring.
VoIP & Video Conferencing (RTP Protocol): Real-time audio/video transmission.
Online Gaming: Fast player positions updates jahan purane packet ki koi value nahi hoti.
TCP vs UDP Detailed Comparison (Exam High-Yield!)
| Feature | TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) |
|---|---|---|
| Connection | Connection-oriented (3-way handshake). | Connectionless (No setup phase). |
| Reliability | Guaranteed delivery (ACK & Retransmissions). | Best effort (No ACK, packets can be lost). |
| Header Size | 20 to 60 Bytes. | Fixed 8 Bytes. |
| Data Nature | Byte Stream. | Message Oriented (Datagram boundaries preserved). |
| Transmission Speed | Moderate / Slower. | Extremely Fast. |
| Broadcast / Multicast | Not supported (Only Unicast). | Supported (Unicast, Multicast, Broadcast). |
Summary Table
| Aspect | Summary |
|---|---|
| Header Size | Fixed 8 Bytes (Source Port, Dest Port, Length, Checksum). |
| Core Strength | Minimum latency and zero connection overhead. |
| Primary Use | DNS, DHCP, Live Audio/Video streaming, Online Gaming. |