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
Data Link Layer in Computer Networks
Data Link Layer kya hota hai?
Data Link Layer OSI model ka 2nd layer hota hai, jo Physical Layer ke upar hota hai.
Iska main kaam hota hai:
Reliable data transfer karna do directly connected devices ke beech (jaise same LAN pe 2 computers).
Yeh layer data ko frames mein convert karti hai, error check karti hai, aur ensure karti hai ki data sahi tarike se pahunch raha hai.
OSI Model mein iska position
Layer 7 - Application
Layer 6 - Presentation
Layer 5 - Session
Layer 4 - Transport
Layer 3 - Network
-> Layer 2 - Data Link
Layer 1 - Physical
Data Link Layer ke Functions
1. Framing
Data ko small units (frames) mein divide karta hai.
Har frame ke saath header aur trailer attach karta hai — jisse pata chale data ka start aur end.
Example:
Jaise ek movie ko scenes mein divide kar diya jaye, har scene ke starting aur ending title ke saath.
2. MAC Addressing (Physical Addressing)
Sender aur Receiver ka MAC address frame mein daala jaata hai.
Ye ensure karta hai ki data sahi device tak pahunch raha hai.
Example:
Parcel bhejna ho to From aur To address likhna zaroori hota hai — yahi kaam MAC address karta hai.
3. Error Detection and Correction
CRC (Cyclic Redundancy Check) jaise methods se check karta hai ki data mein koi error to nahi.
Agar error mile, to data dobara bhejne ka system hota hai (ACK/NACK ke through).
Example:
Jaise kisi letter ko post karne se pehle grammar/spelling check karte ho.
4. Flow Control
Ye dekhta hai ki sender zyada fast data na bhej de, jisse receiver handle hi na kar paaye.
Dono devices ke beech ka speed match karta hai.
Example:
Agar teacher bahut fast bol raha ho aur student dheere likh raha ho, to notes miss ho jaate hain.
5. Access Control
Jab ek channel (jaise LAN wire) multiple devices use karte hain, to ye decide karta hai ki kis device ko kab bhejna hai.
Collision ko avoid karta hai.
Example:
Group discussion mein ek time pe ek hi banda bolta hai — yahi rule ye layer apply karti hai.
Data Link Layer ke 2 Sublayers
| Sublayer | Function |
|---|---|
| LLC (Logical Link Control) | Upper layers ke saath data manage karta hai, error detect karta hai |
| MAC (Media Access Control) | Decide karta hai ki data kab aur kis order mein bhejna hai |
Ek Simple Example Scenario
Maan lijiye Computer A ko Computer B ko file bhejni hai (same LAN pe):
File ko Network Layer packets mein todta hai
Data Link Layer har packet ko frame mein convert karti hai
MAC addresses aur CRC error checking add karta hai
Frame wire (Physical Layer) se transmit hota hai
Receiver side ka Data Link Layer frame ko check karta hai, framing hataata hai aur Network Layer ko bhej deta hai
Protocols Used
Ethernet
Wi-Fi (802.11)
PPP (Point-to-Point Protocol)
HDLC (High-Level Data Link Control)
Quick Summary Table
| Feature | Details |
|---|---|
| Layer No. | 2nd Layer in OSI Model |
| Data Unit | Frame |
| Main Kaam | Framing, Error Check, MAC Addressing, Flow Control, Access Control |
| Devices | Switches, NICs (Network Interface Card) |
| Examples | Ethernet, Wi-Fi, PPP, HDLC |
Real Life Analogy
Letter bhejne ka example:
Envelope = Frame
Address = MAC address
Spelling check = Error detection
Queue system = Access control