MODULE 2 – DATA LINK LAYERS
1. Data Link Layer Services
The Data Link Layer (DLL) is the 2nd layer in the OSI model.
It provides services to the Network Layer to ensure reliable transfer of data
between two devices on the same network link.
Main services:
1. Framing – Dividing data from the Network Layer into manageable frames
for transmission.
2. Physical Addressing – Adding source and destination MAC addresses to
frames.
3. Flow Control – Preventing a fast sender from overwhelming a slow
receiver.
4. Error Control – Detecting and possibly correcting errors that occur
during transmission.
5. Access Control – Deciding which device has control over a shared
communication channel (e.g., Ethernet CSMA/CD).
2. Error Detection
During data transmission, noise or interference can change some bits, causing
errors.
Error detection techniques do not fix the error, but they detect whether data
has been corrupted.
3. Types of Errors
a) Single-bit Error
• Definition: Only one bit in the data unit changes from 0 to 1 or from 1 to
0.
• Example:
Sent: 1000110
Received: 1001110 (3rd bit changed)
b) Burst Error
• Definition: Two or more bits in the data unit are altered, not necessarily
consecutive.
• Caused by: noise spikes, signal distortion.
• Example:
Sent: 1000110
Received: 1111010 (multiple bits changed)
4. Error Detection Methods
a) Vertical Redundancy Check (VRC) – Parity Bit
• Method: Add one extra bit (parity bit) to the data to make the number
of 1’s either even (even parity) or odd (odd parity).
• Detection: Receiver recalculates parity; mismatch means error.
• Limitation: Can detect single-bit errors, but fails for some burst errors.
b) Longitudinal Redundancy Check (LRC)
• Method: Arrange data in a table (rows of bits), calculate parity bit for
each column, and send them as an extra row.
• Detection: Receiver checks column parity.
• Advantage: Detects more burst errors than VRC.
• Limitation: Still cannot detect all burst errors.
c) Cyclic Redundancy Check (CRC)
• Method:
1. Sender treats data bits as a binary number (dividend).
2. Divides it by a fixed generator polynomial (divisor).
3. Remainder (CRC bits) is appended to data.
4. Receiver divides again; non-zero remainder means error.
• Strength: Detects most single-bit and burst errors.
• Common use: Ethernet, USB.
d) Checksum
• Method:
1. Break data into fixed-size words (e.g., 16 bits).
2. Add all words using binary addition.
3. Take 1’s complement of the sum → checksum.
4. Receiver adds all words + checksum; result should be all 1’s.
• Use: Internet protocols like TCP/IP.
• Limitation: Cannot detect some complex errors.
5. Error Correction
Error correction not only detects errors but fixes them without retransmission.
Single-bit Error Correction – Hamming Code
• Purpose: Detect up to two-bit errors and correct single-bit errors.
• Method:
1. Insert redundant bits at positions that are powers of 2 (1, 2, 4, 8,
…).
2. Each redundant bit covers certain positions according to binary
representation.
3. Receiver checks parity bits to locate and fix the wrong bit.
Example (Hamming (7,4) code):
• Data bits: D3 D2 D1 D0
• Parity bits: P1, P2, P4 inserted at positions 1, 2, and 4.
• If parity check indicates bit 5 is wrong → flip it to correct.
Summary Table:
Method Type Detects Corrects Use
VRC Detection Single-bit errors No Simple links
LRC Detection Many burst errors No Older comms
CRC Detection Most single & burst No Ethernet, storage
Checksum Detection Most errors No TCP/IP
Hamming Single-bit + detect Yes (single- Memory, reliable
Correction
Code double-bit bit) links
1. Error Correction Techniques
Error correction ensures that corrupted data is repaired before delivery.
Two main approaches:
a) Forward Error Correction (FEC)
• Definition: Errors are corrected at the receiver without retransmission.
• Method: Add redundant bits (error-correcting codes) to enable
correction.
• Example: Hamming Code, Reed–Solomon, Convolutional codes.
• Used in: Satellite communication, CDs/DVDs, live streaming.
• Advantage: No need for retransmission → good for real-time.
• Limitation: Extra bandwidth needed for redundancy.
b) Automatic Repeat Request (ARQ)
• Definition: If error is detected, receiver requests retransmission.
• Method: Combination of error detection (CRC, checksum) and feedback
(ACK/NACK).
• Used in: TCP, Ethernet.
• Advantage: Less redundancy.
• Limitation: Retransmission causes delay.
2. Error Recovery Protocols (ARQ Protocols)
a) Stop-and-Wait ARQ
• Working:
1. Sender sends one frame.
2. Waits for ACK from receiver.
3. If ACK not received within timeout → resend frame.
• Advantages: Simple, easy to implement.
• Disadvantages: Low efficiency (only one frame in transit at a time).
Timeline Example:
Sender: Frame1 → Wait → ACK → Frame2
b) Go-Back-N ARQ
• Working:
1. Sender can send multiple frames (window size = N) before waiting
for ACK.
2. If an error occurs in frame k, all frames from k onwards are
retransmitted.
• Advantages: Higher efficiency than Stop-and-Wait.
• Disadvantages: Retransmits many frames even if only one had an error.
Example (N=4):
Frames 1,2,3,4 sent → ACK for 1,2 → Error in 3 → Resend 3,4
c) Selective Repeat ARQ
• Working:
1. Sender sends multiple frames (window size ≤ sequence number
space / 2).
2. Receiver ACKs each correctly received frame individually.
3. Only erroneous frames are retransmitted.
• Advantages: Saves bandwidth by retransmitting only lost/damaged
frames.
• Disadvantages: More complex to implement (requires frame buffering).
Example:
Frames 1,2,3,4 sent → ACK for 1,2,4 → Resend only 3
Comparison Table:
Window
Protocol Retransmission Efficiency Complexity
Size
Stop-and-
1 One frame at a time Low Simple
Wait
All frames from error
Go-Back-N N Medium Moderate
onwards
Selective
N Only erroneous frames High Complex
Repeat
1. Multiple Access Protocols
When multiple devices share the same communication channel, multiple
access protocols decide who gets to transmit and when, to avoid collisions
and ensure efficient usage.
They can be classified into three main categories:
1. Channel Partitioning Protocols – Divide the channel before transmission.
2. Random Access Protocols – Devices transmit when ready; handle
collisions later.
3. Controlled Access Protocols – Centralized or polling methods control
access.
2. Channel Partitioning Protocols
a) FDMA (Frequency Division Multiple Access)
• Principle: The available bandwidth is divided into frequency bands; each
user gets a fixed band.
• Example: Traditional radio/TV broadcasting, 1G mobile networks.
• Advantage: No collisions, continuous transmission possible.
• Disadvantage: Wastes bandwidth if the user is idle.
b) TDMA (Time Division Multiple Access)
• Principle: The channel is divided into time slots; each user gets a slot in a
repeating cycle.
• Example: 2G GSM mobile networks.
• Advantage: Efficient if all users have equal traffic.
• Disadvantage: Idle slots waste bandwidth.
c) CDMA (Code Division Multiple Access)
• Principle: All users transmit over the same frequency at the same time
but with unique codes to separate signals.
• Technique: Uses spread spectrum; receiver uses the same code to
extract the signal.
• Example: 3G mobile networks, GPS.
• Advantage: High capacity, resistant to interference.
• Disadvantage: Complex design, needs precise power control.
3. Random Access Protocols
a) CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
• Used in: Wired Ethernet (legacy).
• Principle:
1. Carrier Sense: Listen to channel before sending.
2. If busy → wait; if free → transmit.
3. Collision Detection: If collision occurs, stop transmission and wait
random time before retry.
• Advantage: Reduces wasted transmission time after detecting collision.
• Limitation: Not suitable for wireless (hard to detect collisions).
b) CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)
• Used in: Wi-Fi (IEEE 802.11).
• Principle:
1. Listen to channel.
2. If free → send a short Request to Send (RTS) signal.
3. Receiver replies with Clear to Send (CTS).
4. Transmit data.
• Advantage: Avoids most collisions before they happen.
• Limitation: Extra overhead (RTS/CTS adds delay).
Quick Comparison Table:
Protocol Channel Division Example Use Collision Handling
FDMA Frequency bands Radio, 1G No collisions
TDMA Time slots GSM No collisions
CDMA Codes 3G, GPS No collisions
CSMA/CD Random access Ethernet Detect after collision
CSMA/CA Random access Wi-Fi Avoid before collision
1. Data Link & MAC Addressing
Data Link Layer Addressing
• Purpose: Identify the physical device on a network.
• Type: MAC (Media Access Control) address.
• Format:
o 48-bit address (6 bytes).
o Written in hexadecimal (e.g., 00:1A:2B:3C:4D:5E).
o First 3 bytes → OUI (Organizationally Unique Identifier) assigned
to manufacturer.
o Last 3 bytes → Device-specific number.
• Nature: Unique, hardcoded into the NIC (Network Interface Card).
Role in Networking:
• Used for local delivery in a LAN.
• Works with ARP (Address Resolution Protocol) to map IP addresses to
MAC addresses.
2. Ethernet
• Definition: A family of LAN technologies that use frames for data
transmission.
• Standard: IEEE 802.3.
• Topology: Originally bus topology; now mostly star topology with
switches.
• Speed: 10 Mbps → 100 Mbps (Fast Ethernet) → 1 Gbps → 10 Gbps.
• Frame Structure:
• Preamble | Destination MAC | Source MAC | Type/Length | Data | CRC
• Access Method: Uses CSMA/CD in half-duplex mode (modern Ethernet
with switches is full-duplex, so no collision detection needed).
Advantages:
• Simple, inexpensive.
• High reliability for local networks.
3. Polling
• Definition: A controlled access method where a master device asks each
device in turn if it has data to send.
• Process:
1. Master sends a poll message to a device.
2. If device has data → sends it; else → sends “no data” signal.
3. Master polls the next device.
• Advantages:
o Avoids collisions.
o Works well in small, controlled networks.
• Disadvantages:
o Slower when many devices have no data (wasted polling).
o Master device is a single point of failure.
Quick Table Summary:
Concept Key Purpose Example Use
MAC Address Identify device in LAN All LAN devices
Ethernet LAN communication standard Office networks
Polling Controlled channel access Industrial systems, old LANs
1. IEEE Standards Overview
The IEEE (Institute of Electrical and Electronics Engineers) defines networking
standards under the IEEE 802 family for LANs and MANs.
2. Wireless LANs – IEEE 802.11
• Purpose: Defines Wi-Fi standards for wireless local area networks.
• Frequency Bands: 2.4 GHz, 5 GHz, 6 GHz (depending on version).
• Access Method: CSMA/CA (Collision Avoidance).
Common Versions:
Standard Speed Frequency Range Notes
802.11b 11 Mbps 2.4 GHz ~100 m First widely adopted
802.11a 54 Mbps 5 GHz ~50 m Less interference
802.11g 54 Mbps 2.4 GHz ~100 m Backward compatible with b
802.11n 600 Mbps 2.4 & 5 GHz ~125 m MIMO technology
802.11ac >1 Gbps 5 GHz ~100 m High-speed Wi-Fi
802.11ax 9.6 Gbps 2.4 & 5 & 6 GHz ~125 m Wi-Fi 6, more capacity
3. Ethernet – IEEE 802.3
• Purpose: Wired LAN standard.
• Medium: Twisted pair, fiber optic, or coaxial cables.
• Access Method: CSMA/CD (in half-duplex; not used in modern full-
duplex switched Ethernet).
• Data Rate Evolution:
Version Speed Medium
10BASE-T 10 Mbps Twisted pair
Fast Ethernet 100 Mbps Twisted pair/fiber
Gigabit Ethernet 1 Gbps Twisted pair/fiber
Version Speed Medium
10 Gigabit Ethernet 10 Gbps Fiber, twisted pair
Higher versions 40/100/400 Gbps Data centers, backbone links
4. Bluetooth – IEEE 802.15.1
• Purpose: Short-range wireless communication.
• Frequency Band: 2.4 GHz ISM band.
• Range: Class 1 (~100 m), Class 2 (~10 m), Class 3 (~1 m).
• Data Rates:
o Bluetooth 1.0: 1 Mbps
o Bluetooth 2.0 + EDR: 3 Mbps
o Bluetooth 4.0: Low Energy (BLE) for IoT
o Bluetooth 5.x: Up to 50 Mbps, longer range.
• Network Type: PAN (Personal Area Network) using piconets and
scatternets.
• Applications: Wireless headsets, file sharing, IoT devices, wearable tech.
Summary Table:
IEEE
Standard Range Speed Frequency
Version
Up to 9.6 2.4, 5, 6
Wi-Fi 802.11 30–125 m
Gbps GHz
100 m (copper) / longer Up to 400
Ethernet 802.3 Wired
(fiber) Gbps
IEEE
Standard Range Speed Frequency
Version
Up to 50
Bluetooth 802.15.1 1–100 m 2.4 GHz
Mbps