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
MAC Sublayer and MAC Addressing in Computer Networks
MAC Sublayer kya hai? (What is MAC Sublayer?)
Data Link Layer (Layer 2) ko IEEE 802 committee ne do sublayers mein divide kiya hai: LLC (Logical Link Control) aur MAC (Medium Access Control).
MAC Sublayer lower sublayer hai jo physical transmission medium (cables, radio waves) ke directly contact mein rehti hai.
Iska main kaam hai yeh decide karna ki jab multiple devices ek common shared communication channel (jaise Wi-Fi ya shared Ethernet) par connected hon, toh kaunsa device kab data transmit karega taaki collision na ho.
Shared medium ka simple matlab yeh hai ki ek hi pipe ya wire se sabhi devices connected hain. Agar do devices ek saath bolein (transmit karein), toh data mix hokar corrupt ho jayega (jise Collision kehte hain). MAC sublayer isi collision ko prevent aur resolve karta hai.
LLC vs MAC Sublayer
Data Link Layer ko do parts mein kyu baanta gaya? Inka division samajhna bohot zaroori hai:
+-------------------------------------------------------+ | Network Layer (Layer 3 - IP) | +-------------------------------------------------------+ | LLC Sublayer (Logical Link Control - IEEE 802.2) | <-- Upper Sublayer (Flow & Error Control) +-------------------------------------------------------+ | MAC Sublayer (Medium Access Control) | <-- Lower Sublayer (Framing, MAC Addressing, Channel Access) +-------------------------------------------------------+ | Physical Layer (Layer 1 - Bits/Cables) | +-------------------------------------------------------+
| Feature | LLC Sublayer (Logical Link Control) | MAC Sublayer (Medium Access Control) |
|---|---|---|
| Position | Data Link Layer ka Upper Sublayer hai. | Data Link Layer ka Lower Sublayer hai. |
| IEEE Standard | IEEE 802.2 | IEEE 802.3 (Ethernet), 802.11 (Wi-Fi), 802.15 (Bluetooth) |
| Primary Responsibilities | Flow control, Error control, aur Network Layer protocols (IPv4, IPv6) ko identify karna. | Framing, Physical (MAC) Addressing, aur Channel Access Control (CSMA/CD, ALOHA). |
| Hardware Dependency | Software-oriented hai, physical hardware technology se independent rehta hai. | Hardware-dependent hai (Network Interface Card - NIC chip par implement hota hai). |
Key Functions of MAC Sublayer
-> Medium Access Control: Shared channel ko efficiently share karne ke protocols (jaise CSMA/CD, CSMA/CA, ALOHA, Token Ring) provide karta hai.
-> Physical Addressing: Har outgoing frame mein Sender aur Receiver ka unique 48-bit MAC Address embed karta hai.
-> Framing: Upper LLC layer se aane wale packets ko frames mein encapsulate karta hai (Preamble, Flags, Header aur Trailer add karke).
-> Error Detection: Frame ke end mein CRC (Cyclic Redundancy Check) calculate karke attach karta hai taaki receiver corrupted frame ko identify karke reject kar sake.
MAC Addressing kya hai? (Physical Addressing)
MAC Address (Media Access Control Address) ek unique 48-bit (6 Bytes) hardware address hota hai jo har Network Interface Card (NIC) ko manufacturer dwara permanently assign kiya jaata hai.
Is address ko Physical Address, Hardware Address, ya Burned-In Address (BIA) bhi kaha jaata hai kyunki yeh NIC ke ROM chip par permanently likha (burn) hota hai.
Aap chahe apna router, Wi-Fi, ya location change kar lein, aapke computer ke NIC ka MAC address globally unique aur fixed rehta hai (unlike IP address jo change hota rehta hai).
Structure of MAC Address
Ek standard 48-bit MAC address ko 12 Hexadecimal digits mein likha jaata hai, jise colon (:) ya hyphen (-) se separate karte hain:
Format: XX : XX : XX : XX : XX : XX (Total: 48 bits = 6 Bytes) Example: 00 : 1A : 2B : 3C : 4D : 5E |------------------ 24 Bits ------------------|------------------ 24 Bits ------------------| | OUI (Organizationally Unique ID) | NIC Specific / Device ID | | (Manufacturer Identifier) | (Serial number by Vendor) | |---------------------------------------------|---------------------------------------------|
1. First 24 Bits (First 3 Bytes) - OUI:
Yeh Organizationally Unique Identifier hota hai jo IEEE dwara hardware manufacturing companies (jaise Intel, Cisco, Realtek, Apple) ko assign kiya jaata hai. Initial 24 bits se pata chal jaata hai ki device kis company ne banaya hai.
2. Last 24 Bits (Last 3 Bytes) - NIC / Device Identifier:
Yeh specific hardware piece ka unique serial number hota hai jo manufacturing company apne har card ko allocate karti hai.
Types of MAC Addresses
Transmission nature ke according MAC addresses teen categories mein classify hote hain:
| Address Type | Pattern / Example | Description |
|---|---|---|
| Unicast MAC Address | First Byte ka LSB bit 0 hota hai.Ex: 00:1A:2B:3C:4D:5E |
Frame sirf ek single destination NIC ke liye intended hota hai (Point-to-Point delivery). |
| Multicast MAC Address | First Byte ka LSB bit 1 hota hai.Ex: 01:00:5E:00:00:01 |
Frame ek specific group of devices (multicast group) ke liye send kiya jaata hai. |
| Broadcast MAC Address | Sabhi 48 bits 1 hoti hain.FF:FF:FF:FF:FF:FF |
Frame local network ke sabhi connected devices dwara accept aur process kiya jaata hai (jaise ARP Request). |
IP Address vs MAC Address
College students ke beech common doubt hota hai ki jab IP address hai toh MAC address ki zaroorat kyu hai? Dono mein main difference samajhte hain:
| Parameter | MAC Address (Physical) | IP Address (Logical) |
|---|---|---|
| Operating Layer | Data Link Layer (Layer 2) | Network Layer (Layer 3) |
| Address Size | 48 bits (6 Bytes) | 32 bits (IPv4) ya 128 bits (IPv6) |
| Permanence | Fixed & Permanent (Hardware level par burned) | Dynamic / Changeable (Network location par depend karta hai) |
| Scope of Delivery | Hop-to-Hop delivery (same local subnet ke andar) | End-to-End delivery (source host se destination host across global internet) |
| Resolution Protocol | ARP (Address Resolution Protocol) IP se MAC pata karta hai | DNS domain name se IP resolve karta hai |
Advantages and Disadvantages
Advantages of MAC Addressing
-> Unique Identity: Har network device ko globally unique identity milti hai jisse local network par collisions aur duplicate frame issues nahi hote.
-> Fast Switching: Hardware switches MAC table lookup karke wire-speed par frame forwarding karte hain.
-> Plug and Play: Network se connect hote hi device apna MAC address use karne ke liye ready rehta hai, manual configuration ki zaroorat nahi hoti.
Disadvantages of MAC Addressing
-> Flat Structure: MAC addresses hierarchical nahi hote (unlike IP addresses jo network ID aur host ID mein split hote hain). Isliye internet-scale routing ke liye use nahi ho sakte.
-> MAC Spoofing: Software tools ke zariye attacker apna MAC address temporarily change karke access controls ko bypass kar sakta hai.
Summary Table
| Concept | Key Takeaway |
|---|---|
| MAC Sublayer | Data Link Layer ka lower sublayer jo shared medium access, framing aur physical addressing manage karta hai. |
| MAC Address Size | 48 bits (6 Bytes), written as 12 hexadecimal characters. |
| Structure | First 24 bits = OUI (Vendor ID), Last 24 bits = Device Serial Number. |
| Broadcast MAC | FF:FF:FF:FF:FF:FF (All 48 bits set to 1). |