19-03-2025
The Data Link Layer
Position of the data-link layer
Framing
1
19-03-2025
Data Link Layer is logically divided into 2
sublayers depending upon functionality
Vijay S. Katta 3
Functions of MAC Sublayer
Functions of MAC Sublayer:
1. Framing: Divides data into frames for transmission.
2. Addressing: Provides unique MAC addresses for devices on a network.
3. Error Detection: Uses CRC (Cyclic Redundancy Check) for error detection.
4. Access Control: Controls access to the shared medium (e.g., CSMA/CD in Ethernet, CSMA/CA in Wi-Fi).
5. Flow Control: Prevents data congestion between sender and receiver.
6. Packet Prioritization: Manages Quality of Service (QoS) for different types of data.
7. Collision Handling: Detects and resolves collisions in a shared medium.
2
19-03-2025
Functions of Data Link Control (DLC) Sublayer:
1. Establishing and Terminating Links: Manages the establishment and termination of communication links.
2. Error Control: Ensures error-free transmission using techniques like Automatic Repeat request (ARQ).
3. Flow Control: Prevents overwhelming the receiver by regulating the data flow.
4. Data Sequencing: Ensures frames are delivered in the correct order.
5. Acknowledgment Mechanism: Confirms the receipt of frames.
6. Logical Link Control (LLC): Provides multiplexing of network protocols on the same network interface.
Summary:
• MAC sublayer: Focuses on physical addressing and medium access control.
• DLC sublayer: Ensures reliable, error-free communication between devices.
Data Link Layer Design Issues
• Services Provided to the Network
Layer
• Framing
• Line Discipline
• Error Control
• Flow Control
3
19-03-2025
Functions of the Data Link Layer (2)
Relationship between packets and frames.
Services Provided to Network Layer (2)
Placement of the data link protocol.
4
19-03-2025
Data link layer duties
Framing
Framing
Framing
1. A character Count.
fig(a) Without errors..
fig(b) With one error.
5
19-03-2025
Framing (2) Character flag with character
stuff
(a) A frame delimited by flag bytes.
(b) Four examples of byte sequences before
and after stuffing.
Framing (3) Bit flag with bit stuffing
Bit stuffing
(a) The original data.
(b) The data as they appear on the line.
(c) The data as they are stored in receiver’s memory
after destuffing.
6
19-03-2025
Data Link Control sublayer Design Issues
7
19-03-2025
ENQ/ACK
8
19-03-2025
ENQ/ACK
Multipoint Discipline
9
19-03-2025
Select
Poll
10
19-03-2025
Error Detection
and Correction
Types of Errors
Detection
Correction
Note:
Data can be corrupted during
transmission. For reliable
communication, errors must be
detected and corrected.
11
19-03-2025
Types of Errors
Single-bit error
12
19-03-2025
Multiple-bit error
Burst error
13
19-03-2025
Error Detection
Note:
Error detection uses the
concept of redundancy, which
means adding extra bits for
detecting errors at the
destination.
14
19-03-2025
Error Detection Methods
VRC
15
19-03-2025
LRC
VRC and LRC
16
19-03-2025
Cyclic Redundancy Check
Polynomial
17
19-03-2025
Polynomial and Divisor
Figure 9-14
Standard Polynomials
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
18
19-03-2025
Table of Standard polynomials
Name Polynomial Application
CRC-8 x8 + x2 + x + 1 ATM header
CRC-10 x10 + x9 + x5 + x4 + x 2 + 1 ATM AAL
ITU-16 x16 + x12 + x5 + 1 HDLC
x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10
ITU-32 LANs
+ x8 + x7 + x5 + x4 + x2 + x + 1
Example:1
Data :- 100100
Divisor :- x3 + x2 +1
Solution:-
Divisor :- 1101
Use modulo 2 Division
(X-OR Operation)
19
19-03-2025
Binary division in a CRC generator
10.9 Binary division in CRC checker
20
19-03-2025
Calculation of the polynomial code checksum.
Example
It is obvious that we cannot choose x (binary 10) or x2 + x
(binary 110) as the polynomial because both are divisible
by x.
However, we can choose x + 1 (binary 11) because it is
not divisible by x, but is divisible by x + 1. We can also
choose x2 + 1 (binary 101) because it is divisible by x + 1
(binary division).
21
19-03-2025
Example
The CRC-12
x12 + x11 + x3 + x + 1
which has a degree of 12, will detect all burst errors
affecting an odd number of bits, will detect all burst
errors with a length less than or equal to 12.
Data Unit and Checksum
22
19-03-2025
Note:
The sender follows these steps:
•The unit is divided into k sections, each of n bits.
•All sections are added using one’s complement to get the sum.
•The sum is complemented and becomes the checksum.
•The checksum is sent with the data.
Note:
The receiver follows these steps:
•The unit is divided into k sections, each of n bits.
•All sections are added using one’s complement to get the sum.
•The sum is complemented.
•If the result is zero, the data are accepted: otherwise, rejected.
23
19-03-2025
Example 7
Suppose the following block of 16 bits is to be sent using a
checksum of 8 bits.
10101001 00111001
The numbers are added using one’s complement
1 0 1 0 1 0 0 1
0 0 1 1 1 0 0 1
--------------------------------------------------
Sum 1 1 1 0 0 0 1 0
Checksum 00011101
The pattern sent is 10101001 00111001 00011101
Example
Now suppose the receiver receives the pattern sent in Example and there
is no error.
10101001 00111001 00011101
When the receiver adds the three sections, it will get all 1s, which, after
complementing, is all 0s and shows that there is no error.
10101001
00111001
00011101
-------------------------------------------------------------
Sum 111 11111
Complement 0 0 0 0 0 0 0 0 means that the pattern is OK.
24
19-03-2025
Figure 9-17
Error Correction
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Figure 9-18
Hamming Code
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
25
19-03-2025
Figure 9-19
Hamming Code
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Figure 9-19-continued
Hamming Code
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
26
19-03-2025
Figure 9-20
Example of Hamming Code
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Figure 9-21
Single-bit error
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
27
19-03-2025
Figure 9-22
Error
Detection
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Error-Correcting Codes
Use of a Hamming code to correct burst errors.
28