Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Data Link Layer in Computer Networks: Protocols, Framing, and Error Detection

Tech 1

Overview of Data Link Layer Channels

Data link layer utilizes two types of channels:

  • Point-to-Point Channel: Employs one-to-one communication.
  • Broadcast Channel: Uses one-to-many broadcast communication, requiring specialized protocols for coordination.

Point-to-Point Channel Data Link Layer

Data Link and Frames

  • Link (Physical Link): A physical segment from one node to an adjacent node without intermediate switching nodes. It forms part of a communication path between two computers.
  • Data Link (Logical Link): Combines hardware and software implementing communication protocols with the physical link, encompassing both data link and physical layer functionalities.
  • Network Adapter: Integrates hardware and software to implement protocols, covering data link and physical layers.
  • Frame: Protocol data unit in point-to-point channel data link layer.

Key steps in data link layer communication:

  1. Node A's data link layer encapsulates an IP datagram from the network layer with headers and trailers to form a frame.
  2. Node A transmits the frame to Node B's data link layer.
  3. If Node B's data link layer receives the frame error-free, it extracts the IP datagram and passes it to the network layer; otherwise, it discards the frame.

Three Fundamental Issues

1. Framing

  • Framing: Adding headers and trailers to data to define frame boundaries.
  • Purpose: Frame delimitation and inclusion of control information.
  • Frame Length: Total length including data, header, and trailer.
  • Maximum Transmission Unit (MTU): Upper limit for data part length in a frame as per link layer protocol.
  • Frame Delimiters: Special characters like SOH (Start of Header) and EOT (End of Transmission) in ASCII for frame boundaries.

2. Transparent Transmission

  • Transparent Transmission: Ensuring data passes through the data link layer without alteration or hindrance.
  • Issue: If data bytes match frame delimiters, errors occur.
  • Solution: Byte stuffing—insert an escape character (ESC) before control or special characters, but not before actual headers and trailers.

3. Error Detection

  • Bit Error: Occurs when bits change during transmission (e.g., 1 to 0 or 0 to 1).
  • Bit Error Rate: Ratio of erroneous bits to total transmitted bits, influenced by signal-to-noise ratio.
  • Cyclic Redundancy Check (CRC):
    • Principle: Divides data into groups, appends redundant bits for error detection. Receiver divides received data by a divisor; remainder zero indicates no error.
    • Redundant Bit Calculation: Append n zeros to data M, divide by divisor P to get quotient Q and remainder R. Append R as redundant bits.
    • Frame Check Sequence (FCS): Redundant bits for error checking, equivalent to remainder R.
    • Limitation: CRC detects bit errors but not all transmission errors (e.g., frame loss, duplication, misordering), making it unreliable for full error-free transmission.

Point-to-Point Protocol (PPP)

Widely used for point-to-point links, especially between user computers and ISPs.

PPP Characteristics

PPP requirements include simplicity, framing, transparency, support for multiple network layer protocols, link types, error detection, connection state monitoring, MTU settings, address negotiation, and data compression negotiation. It operates only on point-to-point, full-duplex links and excludes functions like error correction, flow control, and sequence numbering.

PPP components:

  1. Method for encapsulating IP datagrams over serial links.
  2. Link Control Protocol (LCP) for establishing, configuring, and testing links.
  3. Network Control Protocol (NCP) for supporting various network layer protocols.

PPP Frame Format

  • Flag Field (F): 0x7E, indicates frame start or end.
  • Address Field (A): 0xFF.
  • Control Field (C): 0x03.
  • Protocol Field: Specifies content type (e.g., 0x0021 for IP datagrams, 0xC021 for LCP data, 0x8021 for network control data).
  • Information Field: Variable length up to 1500 bytes.
  • Frame Check Sequence (FCS): CRC-based redundant code.

Transparent transmission methods:

  • Asynchronous Transmission - Byte Stuffing: Replaces 0x7E with 0x7D 0x5E, 0x7D with 0x7D 0x5D, and prefixes control characters with 0x7D.
  • Synchronous Transmission - Zero Bit Stuffing: Inserts a 0 after five consecutive 1s in the information field; receiver removes the 0 after five 1s.

PPP Operational States

PPP transitions through states like link establishment, authentication, network layer protocol configuration, and link termination.

Broadcast Channel Data Link Layer

Local Area Network (LAN) Data Link Layer

LANs are owned by single entities with limited geographical scope and node count, offering benefits like broadcast capability, easy expansion, and high reliability.

LAN topologies include bus, ring, and star networks.

Media sharing techniques:

  • Static Channel Division: Frequency, time, wavelength, or code division multiplexing.
  • Dynamic Media Access Control:
    • Random access with collision protocols (e.g., CSMA/CD).
    • Controlled access (e.g., polling).

Ethernet standards: DIX Ethernet V2 and IEEE 802.3.

Data link sublayers:

  • Logical Link Control (LLC): Provides uniform interface to network layer (obsolete).
  • Media Access Control (MAC): Handles media access.

Network adapter functions: serial/parallel conversion, data buffering, driver installation, and Ethernet protocol implementation.

CSMA/CD Protocol

Used in bus networks for collision detection in half-duplex communication.

Key aspects:

  • Multiple Access: Bus-type network.
  • Carrier Sense: Continuous channel monitoring before and during transmission.
  • Collision Detection: Stop transmission upon collision, wait random time before retransmission.

Collision window (contention period): 2τ (round-trip time). Binary exponential backoff algorithm determines retransmission delay.

Process:

  1. Prepare frame and check channel.
  2. If channel idle for 96 bit times, transmit.
  3. Monitor during transmission; if collision detected, stop, send jamming signal, and back off.

Hub-Based Star Topology

Hubs operate at physical layer, forwarding bits without collision detection, maintaining logical bus network with CSMA/CD.

Ethernet Channel Utilization

Channel utilization affected by collisions; parameter a = τ/T0 (propagation delay to frame transmission time ratio). Lower a imprvoes utilization. Maximum utilization Smax = 1/(1 + a).

Ethernet MAC Layer

  • MAC Address: 48-bit hardware address unique to adapter, with bits for individual/group and global/local management.
  • Frame Types: Unicast, broadcast, multicast.
  • MAC Frame Format: Includes type, data (46-1500 bytes), and FCS fields. Minimum frame length 64 bytes, maximum 1518 bytes.
  • Invalid Frames: Non-integer byte length, FCS error, or length out of range.

Extending Ethernet

Physical extension via hubs and fiber optics.

Data Link Layer Extension

  • Bridges: Forward and filter frames based on MAC address tables.
  • Switches: Multi-port bridges operating at data link layer, enabling full-duplex communication without collisions.
  • Self-Learning: Switches build address tables by observing source addresses and broadcasting unknown destinations.
  • Spanning Tree Protocol (STP): Prevents loops in network topology.

Virtual LAN (VLAN)

Logical groups independent of physical location, using VLAN tags in MAC frames to restrict broadcast domains.

Exercises

  1. Network Adapter Role and Layer: Implements data link and physical layer protocols; operates at these layers.
  2. Necessity of Three Basic Issues: Framing for packet switching, transparent transmission to avoid delimiter confusion, error detection to prevent resource waste.
  3. LAN Topologies: Star, bus, ring, tree; star is now popular due to cost and reliability improvements over early bus structures.
  4. CSMA/CD vs. TDM: CSMA/CD offers dynamic resource use with high low-load efficiency but complexity and high-load collisions; TDM provides static allocation with high uniform-load efficiency but waste under low or uneven loads.
  5. Minimum Frame Length for 1 Gb/s Network: Propagation delay 5 μs one-way, 10 μs round-trip. Minimum frame transmission time ≥10 μs, yielding 10,000 bits at 1 Gb/s.
  6. Bandwidth Scenarios: (1) 10 stations share 10 Mb/s hub, (2) share 100 Mb/s hub, (3) each station has 10 Mb/s dedicated on switch.
  7. Ethernet Switch and VLAN: Switch operates at data link layer for transparent switching; VLANs use tags in MAC frames to define logical groups.
  8. Maximum Throughput Calculation: 1100 Mbit/s based on host-server and router access patterns.
  9. Switch Table Completion: Based on MAC address learning and forwarding logic.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.