Data Link Layer
Data Link Layer
(OSI) model, responsible for transforming raw data into frames and managing the physical
link between two directly connected nodes.
● It's concerned with local delivery of frames between nodes on the same network
segment, not inter-network routing or global addressing, which are handled by
higher layers.
● It provides the functional and procedural means to transfer data between network
entities and may also provide the means to detect and possibly correct errors that
can occur in the physical layer.
Services Provided:
● Framing:
The data link layer encapsulates data into frames by adding headers and trailers, which
include information like destination and source addresses, and error-checking fields.
It implements mechanisms to detect and, in some cases, correct errors that may occur
during transmission, ensuring reliable data delivery.
● Flow Control:
The data link layer manages the flow of data to prevent the sender from overwhelming the
receiver, ensuring efficient and reliable communication.
It manages access to the shared physical network medium, arbitrating between multiple
devices trying to transmit data, like Ethernet's MAC protocol.
● Addressing:
It uses physical (MAC) addresses to identify network devices on the same network segment,
enabling proper frame delivery.
● Link Management:
The data link layer manages the establishment, maintenance, and termination of
connections between network nodes.
It regulates the rate at which data is transmitted over the physical link, ensuring
compatibility and efficient communication.
At the data link layer, error detection and correction ensure data integrity during
transmission. Techniques include Parity (detects single-bit errors), CRC (detects multiple-bit
errors), and Hamming code (detects and corrects single-bit errors).
● Purpose:
The data link layer is responsible for ensuring reliable transmission of data between two
directly connected nodes. Error detection and correction techniques are crucial for
identifying and potentially fixing errors that may occur during transmission.
● Error Detection:
This involves checking whether any errors have occurred during transmission.
● Error Correction:
This goes a step further by not only detecting errors but also identifying the location of the
errors, allowing for their correction.
● Parity Check:
● How it works: A parity bit is added to each data block, making the total
number of 1s either even (even parity) or odd (odd parity). The receiver
checks the parity of the received data block; if it doesn't match the expected
parity, an error is detected.
● Limitations: Parity checks can only detect single-bit errors and cannot correct
them.
● Advantages: CRC is more robust than parity checks and can detect a wider
range of errors, including burst errors.
● Hamming Code:
● How it works: Hamming codes add redundant bits (parity bits) to the data
block to enable both error detection and correction. The receiver can use the
parity bits to identify the location of the error and correct it.
● Advantages: Hamming codes can detect and correct single-bit errors.
● They are crucial for both wired and wireless networks, enabling efficient and
reliable data transmission.
● MAC protocols are implemented in the data link layer of the OSI model.
● ALOHA:
● If the channel is busy, the node defers its transmission until the channel
becomes idle.