Skip to content

Introduction to Datalink Layer

  • Physical layer describes the way data is actually transmitted on the network medium.
  • Data link layer defines how these streams of bits are put together into manageable chunks of data.
  • Data link layer is responsible for converting data stream to signals bit by bit and to send that over the underlying hardware. At the receiving end, Data link layer picks up data from hardware which are in the form of electrical signals, assembles them in a recognizable frame format, and hands over to upper layer.
  • Framing

    • Data link layer takes packets from network layer and encapsulate them into frames.
    • Then it sends each frame bit by bit on the hardware.
    • At the receiver's end, datalink layer picks up signals from the hardware and assembles them into frame.
  • Addressing

    • Data link layer provides hardware addressing mechanism.
    • A unique identification number is encoded into network device at the time of manufacturing.
  • Synchronization

    • When the data frame is sent from the sender to receiver, both the network device must be synchronized in order for data tranfer to take place.
  • Flow Control

    • Stations on the same link may have different speed or capacity.
    • Data link layer enables the flow control that enables both machine to exchange data on same speed.
  • Error Detection and Error Correction

    • Data Link Layer protocol provides a mechanism to detect one or more errors.
    • This is achieved by adding error detection bits in the frame and then receiving node can perform an error check.
    • If errors are detected then data link layer will attempt to recver the actual data bits.

Types of Errors

  1. Single Bit Error: one bit is corrupted
  2. Multiple Bit Error: multiple bits are corrupted
  3. Burst Error: multiple consecutive bits are corrupted

Error Detection

  • Few extra bits are sent along with the actual data to confirm that bits received at other end are same as they were sent.
  • There are 3 ways:
    • Parity Check
    • Cyclic Redundancy Check
    • Checksum Method

Error Correction

  • There are two ways:
    • Backward Error Correction: When the receiver detects an error in the data received, it request back the sender to re-transmit the data unit.
    • Forward Error Correction: When the receiver detects an error in the data received, it executes the error-correcting code, which helps it to auto-revover and to correct some kinds of errors.