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
CSMA/CD and CSMA/CA in Computer Networks
CSMA kya hota hai? (Carrier Sense Multiple Access)
ALOHA Protocol ki sabse badi kami yeh thi ki station transmit karne se pehle channel ko check nahi karta tha, jisse bohot collisions hote the.
Is problem ko solve karne ke liye CSMA (Carrier Sense Multiple Access) introduce kiya gaya. CSMA ka golden rule hai: “Listen Before Talk” (Bolne se pehle suno).
Jab bhi kisi station ko data frame send karna hota hai, wo pehle shared transmission medium (carrier) ko sense karta hai:
- Agar channel Idle (free) hai, tabhi station transmit karta hai.
- Agar channel Busy hai, toh station wait karta hai.
Lekin Propagation Delay ki wajah se abhi bhi collision ho sakta hai (e.g. Station A ne transmit kiya, lekin uske signal ko Station B tak pahunchne mein kuch milliseconds lagenge. Usi beech agar B ne sense kiya toh use channel idle lagega aur wo bhi transmit kar dega!).
Is collision issue ko tackle karne ke liye do specialized variations develop kiye gaye: CSMA/CD (Wired LANs ke liye) aur CSMA/CA (Wireless LANs ke liye).
1. CSMA Persistence Methods
Jab koi station channel ko sense karta hai aur channel Busy milta hai, toh wo aage kya karta hai? Yeh decide karne ke teen strategies hote hain:
| Method | Working Principle | Collision Chance |
|---|---|---|
| 1-Persistent CSMA | Channel ko continuously sense karta rehta hai. Jaise hi channel free hota hai, 100% probability (p = 1) ke saath turant transmit kar deta hai. | High (agar do stations wait kar rahe the, dono ek saath transmit karenge). |
| Non-Persistent CSMA | Channel busy milne par lagatar sense nahi karta. Ek random time ke liye so jaata hai aur fir dubara sense karta hai. | Low (lekin channel idle rehne par delay badhta hai). |
| p-Persistent CSMA | Slotted channels ke liye use hota hai. Channel free milne par p probability ke saath transmit karta hai, aur (1 - p) probability ke saath agle slot ka wait karta hai. |
Balanced (Collision aur delay dono control hote hain). |
2. CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
CSMA/CD traditional Wired Ethernet (IEEE 802.3) networks mein use hota hai. Iska basic principle hai: “Listen While Talking” (Transmit karte waqt bhi sunte raho).
[ Sense Channel ] ---> Busy? Wait (Persistence Algorithm)
|
Idle?
|
v
[ Start Transmission ]
|
[ Monitor Channel for Collision ] <--- Transceiver checks electrical voltage
|
+---> Collision Detected?
|
+--- Yes: 1. Send Jamming Signal (alert everyone)
| 2. Abort Transmission immediately
| 3. Wait Random Backoff Time (Binary Exponential Backoff)
| 4. Retry transmission (up to limit)
|
+--- No: Transmission Successful!
CSMA/CD ka Minimum Frame Size Rule (Exam High-Yield!)
CSMA/CD mein collision tabhi detect ho sakta hai jab station apna frame transmit kar raha ho. Agar frame transmission khatam hone ke baad collision ka signal wapas aaya, toh sender ko pata hi nahi chalega ki uska frame corrupt ho gaya!
Isliye rule yeh hai ki Transmission Time (Tt) kam se kam Round Trip Time (2 * Tp) ke barabar ya bada hona chahiye:
Jahan: L = Minimum Frame Size, B = Bandwidth, d = Distance, v = Propagation Speed.
Isi formula ki wajah se Standard 10 Mbps Ethernet mein Minimum Frame Size 64 Bytes (512 bits) rakha gaya hai.
3. CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)
Wireless networks (jaise Wi-Fi – IEEE 802.11) mein collision detect karna lagbhag impossible hota hai kyunki:
Wireless antenna transmit karte waqt receive nahi kar sakta (Half-duplex nature).
Transmitted signal ki power local antenna par bohot high hoti hai, jisse received weak collision signal drown ho jaata hai.
Hidden Terminal Problem: Station A aur Station C dono Access Point (B) ke range mein hain, lekin A aur C ek doosre ki radio range se bahar hain, isliye wo ek doosre ko sense nahi kar sakte.
Isliye wireless networks mein collision ko detect karne ke bajaye Avoid (rokne) ka try kiya jaata hai — isi ko CSMA/CA kehte hain.
Collision Avoidance Mechanism in CSMA/CA
-> IFS (Inter-Frame Space): Channel idle milne ke baad bhi station turant transmit nahi karta, balki ek specific period (DIFS / SIFS) wait karta hai.
-> Contention Window (Random Backoff): Station ek random number of slots wait karta hai. Timer zero hone par hi transmit karta hai.
-> RTS / CTS Handshake (Virtual Carrier Sensing):
Large frames ke liye sender pehle ek chota RTS (Request to Send) frame bhejta hai. Receiver use approve karke CTS (Clear to Send) frame broadcast karta hai. CTS sunkar baaki sabhi stations apna transmission pause kar dete hain (NAV – Network Allocation Vector set kar lete hain).
-> Positive Acknowledgments (ACK): Receiver har successful frame ke baad ACK bhejta hai. Agar ACK na mile toh sender retransmit karta hai.
CSMA/CD vs CSMA/CA Comparison Table
| Property | CSMA/CD (Collision Detection) | CSMA/CA (Collision Avoidance) |
|---|---|---|
| Network Environment | Wired Networks (Ethernet – IEEE 802.3) | Wireless Networks (Wi-Fi – IEEE 802.11) |
| Core Philosophy | Collision hone par detect karo aur transmit abort karo. | Collision hone hi mat do (avoid karo). |
| Collision Recovery | Jamming signal bhej kar turant transmission roki jaati hai. | ACK na aane par timeout se pata chalta hai. |
| Control Frames | No RTS/CTS needed | RTS (Request to Send) aur CTS (Clear to Send) frames use hote hain |
| Efficiency | High (wired medium mein fast recovery hoti hai) | Moderate (IFS aur RTS/CTS se thoda overhead hota hai) |
Summary Table
| Protocol | Summary |
|---|---|
| CSMA | Listen Before Talk: Transmit karne se pehle channel sense karta hai. |
| CSMA/CD | Used in Wired Ethernet. Minimum frame condition: Tt >= 2 * Tp. |
| CSMA/CA | Used in Wireless LANs (Wi-Fi). Uses IFS, Backoff, RTS/CTS, aur ACK to prevent collisions. |