0% found this document useful (0 votes)
23 views28 pages

Slide - 5.1 Data Link Layer

The document discusses the data link layer of the OSI model. It describes that the data link layer has two sub-layers: the logical link control and the media access control. It also explains some of the key functions and responsibilities of the data link layer such as framing, addressing, error control, flow control and access control.

Uploaded by

Silent Boy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views28 pages

Slide - 5.1 Data Link Layer

The document discusses the data link layer of the OSI model. It describes that the data link layer has two sub-layers: the logical link control and the media access control. It also explains some of the key functions and responsibilities of the data link layer such as framing, addressing, error control, flow control and access control.

Uploaded by

Silent Boy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

CSE 233

Computer Networks
Lecture 6 – Data Link Layer

Presented By
Prof. Dr. Boshir Ahmed
Professor
Dept. of Computer Science & Engineering
Rajshahi University of Engineering & Technology

1
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Data Link Layer

Data Link Layer is second layer of OSI Layered Model. This layer is one of the most
complicated layers and has complex functionalities and liabilities.

• DLL is responsible for delivering frames of information.


• It handles transmission errors and
• it regulates the flow of data.

Data link layer has two sub-layers:


1. Logical Link Control: It deals with protocols, flow-control, and error control
2. Media Access Control: It deals with actual control of media

2
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Note

The data link layer is responsible for moving


frames from one hop (node) to the next.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Functions of Data Link Layer

Data Link Layer Responsibilities

Physical Error Flow Access


Framing
Addressing Control Control Control

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Functions of Data Link Layer

• Framing: Data-link layer takes packets from Network Layer and encapsulates them into Frames.
Then, it sends each frame bit-by-bit on the hardware. At receiver’ end, data link layer picks up
signals from hardware and assembles them into frames.

• Addressing: Data-link layer provides layer-2 hardware addressing mechanism. Hardware address
is assumed to be unique on the link. It is encoded into hardware at the time of manufacturing.

• Error Control: Sometimes signals may have encountered problem in transition and the bits are
flipped. These errors are detected and attempted to recover actual data bits. It also provides error
reporting mechanism to the sender.

• Flow control: Stations on same link may have different speed or capacity. Data-link layer ensures
flow control that enables both machine to exchange data on same speed.

• Access control: When host on the shared link tries to transfer the data, it has a high probability of
collision. Data-link layer provides mechanism (such as CSMA/CD) to equip capability of accessing a
shared media among multiple Systems.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Framing

6
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Framing

• Link layer accepts packets from the network layer, and encapsulates them into frames
that it sends using the physical layer; reception is the opposite process.

• Frame is made of a frame header, a payload field and a frame trailer.

7
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Framing Method

1)Byte count
2)Flag bytes with byte stuffing
3)Flag bytes with bit stuffing
4)Physical layer coding violations
- (Use non-data symbol to indicate frame)

***Many DL protocols use a combination of the above framing methods for additional safety

8
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
1. Byte count

• Frame begins with a count of the number of bytes in it.


• Simple, but difficult to resynchronize after an error.

9
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
2. Flag Bytes with Byte Stuffing

• Special flag bytes delimit frames.


• Longer, but easy to resynchronize after error.

Fig (a): A frame delimited by flag bytes.

10
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Error Control

11
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Error

• Error is a situation when the sender's data does not match the data
at the receiver's end.

• These errors may cause due to noise or any other impairments


during transmission from transmitter to the receiver, in
communication system.

12
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Types of Error

• Single bit Error: When there is a change in only one bit of the sender's data then it is called a
single bit error.

• Burst Error: When there is a change in two or more bits of the sender’s data then it is called a
burst error.

13
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Error Control

Error Control is a process of detecting and correcting/retransmitting the data which has been lost or corrupted
during the transmission of data. Any reliable system must have a mechanism for detecting and correcting such
errors.

There are basically two ways of doing Error control:

14
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Error Control (cont.)

1. Error Detection :
Error detection simply means detection or identification of errors.

2. Error Correction :
Error correction, as name suggests, simply means correction or solving or fixing of errors. It
simply means reconstruction and rehabilitation of original data that is error-free. But error
correction method is very costly and is very hard.

15
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Error Detection and Correction Methods

Error detection methods: (used on fiber and high quality wire)


• Parity check
• Checksum
• Cyclic Redundancy Check (CRC)

Error correction methods: (used on wireless links = high error environments)


• Hamming code
• Binary convolutional code
• Reed-Solomon and Low-Density Parity Check code
- (Mathematically complex, widely used in real systems)

***Error detection/correction adds redundant bit with data so errors can be either detected, or corrected.

16
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Simple Parity Check

A redundant bit called a parity bit is added to every data unit so the total number of 1s in the unit
(including the parity bit) become even.

Example:

Fig: One-bit even parity

***Simple parity check can detect single-bit


errors.

17
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Sender Node Receiver Node

Accept Data
Data
Yes
1100001 Reject
Data
Even
No 1?
Calculate
Parity Bit Count Bits

1100001 1 Bits

Transmission Medium

Fig: Simple (Even) Parity check scheme

18
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
2D Parity Check

In simple parity checker parity bits are calculated for each row. But in two-dimensional parity check, a
block of bits is divided into rows & column and a redundant row of bits is added to the whole block.

19
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
3. Checksum

• In checksum method the data is divided into k segments each of m


bits.
• Calculates the sum of all segments (allowing for the carry bit wrap
around).
• The result of the sum is then complemented using 1's complement
arithmetic.
• The value so obtained is called as checksum.
• The checksum segment is sent along with the data segments.

20
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
3. Checksum – Operation at sender side
1. Break the original message in to 'k' number of blocks with 'n' bits in each block.
2. Sum all the 'k' data blocks.
3. Add the carry to the sum, if any.
4. Do 1's complement to the sum = Checksum.

21
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
22
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
23
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Example

Suppose the following block of 16 bits is to be sent using a checksum of 8 bits.


10101001 00111001
What will be the data sent to the receiver?

Solution The numbers are added using one’s complement


10101001
00111001
------------
Sum 11100010
Checksum 00011101
The pattern sent is 10101001 00111001 00011101

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Example

Now suppose the receiver receives given the pattern sent using 8-bit checksum:
10101001 00111001 00011101
Check if there is any error.

Solution 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 11111111
Complement 00000000 means that the pattern is OK.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Hamming Code

• Hamming code is a set of error-correction code that can be used to


detect and correct single bit errors.
• In this coding method, the source encodes the message by inserting
redundant parity bits within the message.
• These redundant bits are extra bits that are generated and inserted
at specific positions in the message for error detection and
correction. Data bits

P1 P2 D3 P4 D5 D6 D7 P8 D9 D10 D11 D12

Parity
bits

26
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Hamming Code (cont.)

Steps:
1. Calculation of total numbers of redundant bits.

2. Checking the position of the redundant bits.

3. Lastly, calculating the values of these redundant bits.

27
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Hamming Code (cont.)

Watch This:
https://www.youtube.com/watch?v=373FUw-2U2k

28
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000

You might also like