Data Link Layer: Protocols, Access Methods, and Frame Creation

Data Link Layer

Functionality

The data link layer facilitates data exchange using Protocol Data Units (PDUs) as frames. It provides two primary services:

  • Access to upper layers via frames.
  • Controlled data location and usage through media access control and error detection.

This layer encapsulates packets into frames and manages their placement and removal using media access control.

Sublayers

The data link layer comprises two sublayers:

  • Logical Link Control (LLC): Identifies the network layer protocol using the frame, enabling multiple protocols on the same interface.
  • Media Access Control (MAC): Handles data routing and protocol definition.

Frame Creation

Data link layer frames always contain:

  • Data Packet: From the network layer.
  • Header: Control information at the beginning of the PDU, including:
    • Start and end frame indicators
    • Source and destination addresses
    • PDU type
    • Flow control fields
  • Trailer: Control information at the end of the PDU, including:
    • Frame Check Sequence (FCS): Uses Cyclic Redundancy Check (CRC) to detect transmission errors.

These fields are common to all frames. Additional fields vary based on network topology (point-to-point, multi-access, or token-ring).

Addressing

Frame headers contain addressing information, specifying the destination node and sometimes the source address. Frames are used locally between nodes. Point-to-point topologies don’t require addressing, while ring topologies do.

Media Access Methods

Controlled Access

Network devices access the medium sequentially. If a device doesn’t need access, it passes to the next. Only one device can transmit at a time.

Contention-Based Access

Devices contend for media access using Carrier Sense Multiple Access (CSMA). If the medium is busy, the device waits and retries. Ethernet and wireless networks use this method, which can lead to collisions and data corruption.

As network usage and node count increase, the probability of collision-free transmission decreases.

Two common CSMA methods address collisions:

  • CSMA/Collision Detection (CSMA/CD): Devices transmit if the medium is free. If a collision is detected, transmission stops, and the device retries later. Ethernet uses this method.
  • CSMA/Collision Avoidance (CSMA/CA): Devices check the medium and send a notification before transmitting. Used in 802.11 wireless networks.

Link Layer Protocols

Link layer protocols include:

  • Ethernet
  • Point-to-Point Protocol (PPP)
  • High-Level Data Link Control (HDLC)
  • Frame Relay
  • Asynchronous Transfer Mode (ATM)

Ethernet (LAN Protocol)

Defines Layer 2 and Layer 1 technologies, supporting data rates of 10, 100, 1000, and 10,000 Mbps.

Point-to-Point Protocol (PPP) (WAN Protocol)

Used for frame delivery between two nodes, encapsulating multiple network protocols over a single link. Supports authentication, compression, and multilink (using multiple physical connections).

Data Monitoring Across a WAN Link

  1. The user requests access to a web page.
  2. The transport layer adds source/destination port and sequence information to the application data, creating a TCP or UDP segment.
  3. The network layer adds source/destination IP addresses and control information (e.g., TTL) to the segment, creating an IP packet.
  4. The link layer adds source/destination physical addresses and control information (e.g., start frame) to the packet, along with a trailer and FCS, creating a frame.
  5. The physical layer encodes the frame as an electrical signal for transmission over the WAN.
  6. Intermediate nodes process and re-encapsulate the packet based on the next link’s technology.
  7. The receiver’s physical layer reverses the process, delivering the web page.