Unit3 2 1
Unit3 2 1
The Data Link Layer is the second layer in the OSI model, responsible for ensuring reliable data
transfer between directly connected nodes in a network. It bridges the Physical Layer (Layer 1) and
the Network Layer (Layer 3), organizing raw bits into structured data frames for error-free
transmission.
Common Protocols
Ethernet: Widely used in wired LANs.
Wi-Fi (IEEE 802.11): For wireless communica on.
HDLC (High-Level Data Link Control): Used in point-to-point connec ons.
Frame Relay: For WAN communica ons.
In summary, the Data Link Layer ensures smooth, error-free communica on between devices on the
same local network by organizing, addressing, and managing data frames efficiently
Example
Suppose we transmit 1010 using even parity:
The number of 1s is 2 (already even), so the parity bit added is 0.
Transmi ed data: 10100.
At the receiver end, if one bit flips (e.g., 10110), the total number of 1s becomes odd,
signaling an error.
Advantages
Simplicity: Easy to implement and requires minimal computa onal resources
Low Cost: Only one extra bit is added per data unit
Useful for detec ng single-bit errors.
Disadvantages
Cannot detect mul ple-bit errors (e.g., if two bits flip, parity remains unchanged)
Does not iden fy which specific bit is incorrect.
Applica ons
Used in hardware systems like RAM and communica on protocols for basic error
detec on
2. Checksum: A checksum is an error detec on technique used in data communica on to verify
the accuracy and integrity of transmi ed data. It ensures that the data received matches the
data sent by detec ng errors caused during transmission.
How Checksum Works
i. Data Division:
The sender divides the data into smaller blocks (segments), each containing a fixed
number of bits.
ii. Sum Calcula on:
All the blocks are added together using binary addi on.
If there is a carry generated during addi on, it is added back to the sum.
iii. Complementa on:
The final sum is complemented (inverted) to generate the checksum value.
This checksum is appended to the original data and sent to the receiver.
iv. Verifica on at Receiver:
The receiver divides the received data (including the checksum) into blocks of equal
size.
It adds all these blocks together, including the checksum, and complements the result.
If the result is all zeros, it means there are no errors in transmission. Otherwise, an
error is detected.
Example
Suppose we want to send the following 8-bit data:
10101011 and 00110011.
Step 1: Add the two blocks:
10101011+00110011=1110011010101011+00110011=11100110
Step 2: Complement the sum:
Complement of 11100110=00011001Complement of 11100110=00011001
The checksum 00011001 is appended to the original data and sent.
Step 3: At the receiver end, all blocks (including checksum) are added:
10101011+00110011+00011001=1111111110101011+00110011+00011001=11111111
Step 4: Complement the result:
Complement of 11111111=00000000Complement of 11111111=00000000
Since the result is all zeros, no error occurred during transmission.
Advantages
Simple to implement.
Effec ve for detec ng single-bit or small burst errors.
Requires minimal computa onal resources.
Disadvantages
Cannot correct errors; only detects them.
Less effec ve for detec ng mul ple-bit errors compared to more advanced techniques
like CRC (Cyclic Redundancy Check).
Applica ons
Used in network protocols like TCP/IP, UDP, and IP.
Commonly applied in file transfer protocols to ensure data integrity.
3. Cyclic Redundancy Check (CRC): Cyclic Redundancy Check (CRC) is a powerful error detec on
technique used in digital networks and storage devices to iden fy accidental changes in data
transmission. Here's a simplified explana on of how CRC works:
Basic Concept
1. Polynomial Division: CRC treats data as a large binary number and divides it by a
predetermined number called the "generator polynomial"24.
2. Remainder as Checksum: The remainder of this division becomes the CRC checksum3.
3. Appending Checksum: This checksum is added to the original data before transmission13.
How It Works
1. Sender's Side:
The data is divided by the generator polynomial.
The remainder (CRC) is appended to the original data.
2. Receiver's Side:
The received data (including CRC) is divided by the same generator polynomial.
If the remainder is zero, the data is considered error-free
Key Features
Error Detec on: CRC is par cularly good at detec ng common errors caused by noise in
transmission channels
Fixed Length: The CRC checksum has a fixed length, making it efficient for various data sizes
Hardware Implementa on: CRC can be easily implemented in binary hardware
Advantages
Simple to implement in hardware and so ware
Effec ve in detec ng mul ple-bit errors
Widely used in various network protocols and storage systems.
Example (Simplified)
Let's say we have data: 1010001101
Generator polynomial: 110101
1. Append zeros to data: 1010001101000
2. Divide by generator polynomial
3. Get remainder (e.g., 01110)
4. Append remainder to original data: 101000110101110
5. Transmit this new data
CRC is a crucial technique in ensuring data integrity in modern digital communica ons and storage
systems.
4. Automa c Repeat Request (ARQ): Automa c Repeat Request (ARQ) is an error-control
protocol used in data communica on to ensure reliable transmission. It works by detec ng
errors and automa cally reques ng retransmission of corrupted or lost data packets.
How ARQ Works
1. Acknowledgment (ACK):
When the receiver successfully receives a data packet, it sends an acknowledgment
(ACK) back to the sender.
This confirms that the packet was received correctly.
3. Timeout:
If the sender does not receive an ACK within a predefined meout period, it assumes
the packet is lost and retransmits it.
4. Retransmission:
The process con nues un l all packets are successfully received or a maximum number
of retransmissions is reached.
Types of ARQ Protocols
1. Stop-and-Wait ARQ:
The sender transmits one frame at a me and waits for an ACK before sending the next
frame.
Simple but inefficient for high-speed networks due to idle wai ng me.
2. Go-Back-N ARQ:
The sender can transmit mul ple frames without wai ng for individual
acknowledgments.
If an error occurs, all frames a er the erroneous one are retransmi ed.
Advantages
Ensures reliable data transmission over unreliable channels.
Reduces data corrup on and loss during communica on.
Disadvantages
Retransmissions can increase network traffic and latency.
Inefficient for channels with frequent errors or high-speed networks.
Applica ons
Used in protocols like TCP/IP for reliable internet communica on.
Found in wireless networks (e.g., IEEE 802.11), satellite communica on, streaming services,
and VoIP calls.