Unit III: Data Link Layer and MAC Sublayer - CSE306 Computer Networks | B.Tech CSE Notes PDF | FineNotes4U


Unit III: Data Link Layer and MAC Sublayer


⭐DATA LINK LAYER


1. Data Link Layer Design Issues

  • Purpose: The Data Link Layer (DLL) provides reliable communication between directly connected nodes and is responsible for framing, addressing, error detection, and flow control.

Key Design Issues:

  1. Framing:

    • Definition: Process of dividing the stream of bits into manageable units called frames.
    • Methods:
      • Character Count: Frame includes a count of the number of characters in it.
      • Delimiter: Special characters (like flags) mark the start and end of frames.
      • Bit Stuffing: Insertion of non-data bits into the data stream to distinguish between data and control information.
  2. Error Control:

    • Purpose: Detect and correct errors that occur during transmission.
    • Types:
      • Error Detection: Identifies presence of errors (e.g., parity, checksums).
      • Error Correction: Mechanisms to fix detected errors (e.g., Hamming code).
  3. Flow Control:

    • Definition: Manages data transmission rates between sender and receiver to prevent overwhelming the receiver.
    • Techniques:
      • Stop-and-Wait: Sender transmits a frame and waits for an acknowledgment (ACK) before sending the next frame.
      • Sliding Window: Allows multiple frames to be in transit before requiring an ACK, increasing efficiency.
  4. Medium Access Control (MAC):

    • Definition: Determines how multiple devices share the same communication medium.
    • Purpose: Prevents collisions and ensures fair access to the medium.


2. Elementary Data Link Protocols

  1. Stop-and-Wait Protocol:

    • The sender transmits one frame and waits for an ACK before sending the next.
    • Advantages: Simple to implement.
    • Disadvantages: Inefficient due to idle time waiting for ACKs.
  2. Go-Back-N Protocol:

    • Allows the sender to transmit multiple frames before needing an acknowledgment.
    • If an error is detected, the sender must retransmit the erroneous frame and all subsequent frames.
    • Advantages: More efficient than Stop-and-Wait.
    • Disadvantages: Can lead to retransmission of many frames due to a single error.
  3. Selective Repeat Protocol:

    • Similar to Go-Back-N, but only retransmits frames that were detected as erroneous.
    • Advantages: More efficient than Go-Back-N, reduces unnecessary retransmissions.
    • Disadvantages: More complex to implement due to the need for buffering.


3. Error Detection and Correction

  1. Parity Bit:

    • Definition: A single bit added to a string of binary data.
    • Types:
      • Even Parity: Ensures the total number of 1s is even.
      • Odd Parity: Ensures the total number of 1s is odd.
    • Limitations: Can only detect single-bit errors and cannot correct them.
  2. Checksum:

    • Definition: A value calculated from the data in the frame, used to detect errors.
    • Process: Data units are summed, and the result is included in the frame. The receiver recalculates the checksum to verify integrity.
    • Limitations: May not detect all types of errors (e.g., two errors canceling each other).
  3. Cyclic Redundancy Check (CRC):

    • Definition: A more robust error detection mechanism.
    • Process: Data is treated as a polynomial and divided by a fixed polynomial (generator). The remainder becomes the CRC code, appended to the data.
    • Advantages: Can detect burst errors and is widely used in network protocols.
  4. Hamming Code:

    • Definition: An error correction code that adds redundant bits to the data.
    • Process: Uses specific positions for parity bits to allow the detection and correction of single-bit errors.
    • Advantages: Can correct one-bit errors and detect two-bit errors.


4. Switch Working

  • Function: A device that connects multiple devices within a network, forwarding frames based on MAC addresses.

Operation:

  1. Learning:

    • Switch builds a MAC address table by recording the MAC addresses of devices connected to each port.
  2. Forwarding:

    • When a frame is received, the switch checks the destination MAC address against its table and forwards the frame to the appropriate port.
  3. Filtering:

    • The switch will drop frames sent to the source MAC address to prevent loops and reduce unnecessary traffic.
  4. Collision Management:

    • In a switched network, each device has a dedicated bandwidth, which reduces the chances of collisions compared to shared media networks.

⭐MAC SUBLAYER


1. Multiple Access Protocols

  • Definition: Protocols that manage how multiple devices share the same communication medium to prevent collisions and ensure efficient communication.

A. ALOHA Protocol

  1. Pure ALOHA:

    • Mechanism: Devices transmit data whenever they have it. After transmission, they wait for an acknowledgment (ACK).
    • Collision Handling: If a collision occurs (i.e., two devices transmit simultaneously), the devices wait a random amount of time before retransmitting.
    • Efficiency: Maximum throughput is 18.4%, meaning only a small fraction of transmissions can be successful.
  2. Slotted ALOHA:

    • Mechanism: Time is divided into discrete slots, and devices can only transmit at the beginning of a time slot.
    • Collision Handling: Similar to Pure ALOHA, but collisions only occur within the time slot.
    • Efficiency: Maximum throughput is 36.8%, effectively doubling the efficiency compared to Pure ALOHA.


B. Carrier Sense Multiple Access (CSMA)

  • Definition: A protocol where devices listen to the medium before transmitting to avoid collisions.
  1. CSMA:

    • Mechanism: Devices sense the channel; if it is idle, they transmit; if it is busy, they wait.
    • Limitations: Collisions can still occur if two devices sense the channel as idle and transmit simultaneously.
  2. CSMA with Collision Detection (CSMA/CD):

    • Definition: An enhancement to CSMA that detects collisions during transmission.
    • Mechanism:
      • Devices listen while transmitting. If they detect a collision, they stop transmitting immediately.
      • After a collision, devices wait a random backoff time before attempting to retransmit.
    • Applications: Widely used in wired Ethernet networks.
    • Efficiency: Performance decreases as network load increases due to increased collisions.


C. Random Access Protocols

  • Definition: Protocols that allow devices to transmit whenever they have data, with methods to manage collisions.
  • Examples: ALOHA and CSMA are both examples of random access protocols, where devices transmit without prior coordination.


D. Controlled Access Protocols

  • Definition: Protocols that regulate access to the communication medium to avoid collisions and ensure orderly communication.
  1. Polling:

    • Mechanism: A central controller polls devices in a round-robin fashion, allowing each one to transmit in turn.
    • Advantages: Eliminates collisions and provides predictable access.
    • Disadvantages: Can introduce delays and overhead.
  2. Token Passing:

    • Mechanism: A token circulates in the network; only the device holding the token can transmit.
    • Advantages: Guarantees that only one device transmits at a time, preventing collisions.
    • Applications: Used in Token Ring and other token-based networks.


2. Ethernet Protocol

  • Definition: A widely used networking technology for local area networks (LANs) that uses a specific set of rules for accessing the physical medium.

Key Features:

  1. Frame Structure:

    • Preamble: Synchronizes the receiver with the sender.
    • Destination MAC Address: Specifies the recipient of the frame.
    • Source MAC Address: Specifies the sender of the frame.
    • Type/Length Field: Indicates the type of payload or the length of the data field.
    • Data Field: Contains the actual data being transmitted.
    • CRC: Used for error detection.
  2. Access Method:

    • CSMA/CD: Uses the CSMA/CD protocol for managing access to the medium.
    • Collision Handling: If a collision occurs, the devices involved stop transmitting and wait for a random backoff time.
  3. Variants:

    • 10BASE-T: 10 Mbps over twisted-pair cables.
    • 100BASE-TX: 100 Mbps (Fast Ethernet) over twisted-pair cables.
    • 1000BASE-T: 1 Gbps (Gigabit Ethernet) over twisted-pair cables.
    • 10GBASE-T: 10 Gbps Ethernet over twisted-pair cables.
  4. Physical Layer Technologies:

    • Utilizes twisted pair cables, coaxial cables, or fiber optics depending on the variant.
  5. Switching:

    • Ethernet networks use switches to forward frames based on MAC addresses, increasing efficiency and reducing collisions.


🚨Thanks for visiting finenotes4u✨

Welcome to a hub for 😇Nerds and knowledge seekers! Here, you'll find everything you need to stay updated on education, notes, books, and daily trends.

💗 Bookmark our site to stay connected and never miss an update!

💌 Have suggestions or need more content? Drop a comment below, and let us know what topics you'd like to see next! Your support means the world to us. 😍

Post a Comment

Previous Post Next Post