Professional Documents
Culture Documents
Achieve CO2
1/20/20 KL Hyderabad 1
Where is Data Link Layer in OSI model?
1/20/20 KL Hyderabad 2
Logical Link Control(LLC)
• The LLC sub-layer acts as an interface between the media access control (MAC) sub layer and
the network layer.
• Application example: Local area network (LAN) Protocols like IEEE 802.2, 802.3
[ Details of this topic is out of scope]
3
Functions
1. Framing
2. Addressing
3. Flow Control
4. Error Control
5. Access Control
4
1 Framing
5
Character oriented or Byte Oriented protocol
• Problem: Any pattern used for the flag could also be part of the
information. If this happens, the receiver, when it encounters this pattern
in the middle of the data, thinks it has reached the end of the frame.
• Solution: Byte Stuffing
6
Byte stuffing (with ESC) is the process of adding 1 extra byte whenever there is a flag
or escape character in the text.
7
Bit Oriented Protocol
• Use reserved bit patterns to indicate the start and end of a frame. For instance, use the 8-bit
sequence of 01111110 to delimit consecutive frames. A frame consists of everything between
two delimiters.
8
Bit stuffing and un-stuffing
9
3 Flow Control
10
3 Flow Control
11
Link Utilization
Let us assume the following:
Transmission time: The time it takes for a station to transmit a frame (normalized to a value of 1).
Propagation delay: The time it takes for a bit to travel from sender to receiver (expressed as a).
a < 1 :The frame is sufficiently long such that the first bits of the
frame arrive at the destination before the source has completed
transmission of the frame.
1/20/20 KL Hyderabad 12
3 Flow Control
13
Drawbacks:
• Firstly, if the receiver had the capacity to accept more than one frame, its resources are being
underutilized.
• Secondly, if the receiver was busy and did not wish to receive any more packets, it may delay
the acknowledgement. However, the timer on the sender's side may go off and cause an
unnecessary retransmission.
------These drawbacks are overcome by the sliding window protocols.
1/20/20 KL Hyderabad 14
• Piggybacking
The technique of temporarily delaying outgoing acknowledgments so that they
can be hooked onto the next outgoing data frame is known as piggybacking.
Add acknowledgement to data frames going in reverse direction.
Advantage : It is used to improve the efficiency of bidirectional
transmission.
Disadvantage: If the data link layer waits longer than the sender’s
timeout period, the frame will be retransmitted, defeating the whole
purpose of having acknowledgments.
1/20/20 KL Hyderabad 15
• Piggybacking
1/20/20 KL Hyderabad 16
3 Flow Control
Sliding window Concept
• Sending window
• Receiving Window
Sliding window flow control: Example (assume no errors)
17
Link Utilization
The link utilization in case of Sliding Window Protocol
U = 1, for N > 2a + 1
N/(1+2a), for N < 2a + 1
Where N = the window size
a = Propagation time / transmission time
1/20/20 KL Hyderabad 18
Error Control
1. Error Detection
2. Error Correction
19
Error Detection
Types of Errors
Concept of Redundancy in Error detection
Error Detection Schemes
• Parity Check
• Cyclic Redundancy Check(CRC)
• Checksum
20
Types of Errors
• Single-Bit error
The term single-bit error means that only 1 bit of a given data unit (such as a
byte, character, or packet) is changed from 1 to 0 or from 0 to 1.
• Multiple-Bit error
21
Types of Errors
• Burst Error
The term burst error means that 2 or more bits in the data unit have changed
from 1 to 0 or from 0 to 1.
22
Redundancy
To be able to detect or correct errors, we need to send some extra bits with our
data. These redundant bits are added by the sender and removed by the
receiver. Their presence allows the receiver to detect or correct corrupted bits.
23
Error Detection Schemes
Block Coding
Error can be detected by using block coding:
• Divide the message into blocks, each of k bits, called dataword.
• Add r redundant bits to each block to make the length n = k + r.
• The resulting n bits blocks are called codeword.
24
Error Detection Schemes
Parity Check
Single Bit Parity Check
In this technique, a redundant bit called a parity bit is added to every data unit so that the total
number of 1’s in the unit (including the parity bit) becomes even (or odd).
25
Error Detection Schemes
Parity Check
Even Parity Concept
26
Error Detection Schemes
Performance
Simple parity check can detect all single-bit errors. It can also detect burst errors as long as the total
number of bits changed is odd. This method cannot detect errors where the total number of hits
changed is even.
27
Error Detection Schemes
2D Parity Check
28
Error Detection Schemes
2D Parity Check
Performance
Consider for example, two data units: 11110000 and 11000011. If the first and
last bits in each of them are changed, making the units read 01110001 and
01000010 the errors cannot he detected by this method.
29
Error Detection Schemes
To be valid, a CRC must have two qualities: It must have exactly one
less bit than the divisor, and appending it to the end of the data string
must make the resulting bit sequence exactly divisible by the divisor.
30
Error Detection Schemes
Cyclic Redundancy Check(CRC)
31
Error Detection Schemes
Cyclic Redundancy Check(CRC)
• The divisor in CRC generator is most often represented not as string of 1s and 0s, but as an algebraic polynomial.
• The polynomial is used for two reasons: it is Short and Can be used to prove the concept mathematically
• A polynomial should be selected to have the following :
1.It should not be divisible by x.( i.e the coefficient of term X 0 should be 1)
2.It should be divisible by x+1.
• The first condition: guarantees that all the burst errors of a length equal to the degree of the polynomial are
detected.
• The Second condition: guarantees that all the burst errors affecting an odd number of bits are detected.
34
Error Detection Schemes
Cyclic Redundancy Check(CRC)
A Polynomial
35
Error Detection Schemes
Cyclic Redundancy Check(CRC)
36
Error Detection Schemes
Cyclic Redundancy Check(CRC)
37
Error Detection Schemes
Cyclic Redundancy Check(CRC)
Performance of CRC
1.CRC can detect all burst errors that affect an odd number of bits.
2.CRC can detect all burst errors of length less than or equal to the degree of
the polynomial
3.CRC can detect, with a very high probability, burst errors of length greater
than the degree of the polynomial.
38
Error Detection Schemes
Checksum
Like parity checks and CRC, the checksum based on redundancy. The
checksum is used in the Internet by several protocols.
39
Error Detection Schemes
Checksum
40
Error Detection Schemes
Checksum
41
Error Detection Schemes
Checksum
Performance of checksum
• If one or more bits of a segment are damaged and the corresponding bit or bits of opposite
value in a second segment are also damaged,
then the sum of columns will not change. Receiver will not be able to detect the error
42
Error Correction
43
Error Correction
Hamming Code
44
Error Correction
Hamming Code
45
Error Correction
Hamming Code
Table 1
46
Error Correction
Hamming Code
47
Error Correction
Hamming Code
48
Error Correction
Hamming Code
49
Error Correction
Hamming Code
50
Error Correction
Hamming Code
51
Error Correction
52
Error Correction
Burst error correction
53
Error Correction
Burst error correction
54
Where is Data Link Layer in OSI model?
Heading2-Cambria 32 Blue Accent-1 Align left
This is a running text-Cambria 24 Black Align left
Use this bullet. Align left
• You can highlight a keyword in red Align left
1/20/20 KL Hyderabad 55