0% found this document useful (0 votes)
22 views44 pages

Lecture#33-40 Logical Link Control (LLC) Layer

The document covers the Logical Link Control Sub Layer, detailing link layer services, error detection methods (including parity checks, cyclic redundancy checks, and Hamming codes), and flow control techniques such as Stop and Wait and Sliding Window Protocols. It emphasizes the importance of error detection and correction in ensuring reliable communication over data links. Additionally, it discusses Automatic Repeat Request (ARQ) mechanisms for managing data transmission reliability.

Uploaded by

aryanrajjpsps03
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)
22 views44 pages

Lecture#33-40 Logical Link Control (LLC) Layer

The document covers the Logical Link Control Sub Layer, detailing link layer services, error detection methods (including parity checks, cyclic redundancy checks, and Hamming codes), and flow control techniques such as Stop and Wait and Sliding Window Protocols. It emphasizes the importance of error detection and correction in ensuring reliable communication over data links. Additionally, it discusses Automatic Repeat Request (ARQ) mechanisms for managing data transmission reliability.

Uploaded by

aryanrajjpsps03
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/ 44

Logical Link Control Sub Layer

Lecture#33-40

Dr. Sanjeev Patel


Asst Professor, CSE Dept.
NIT Rourkela
4/14/2024 Logical Link Control Sub Layer 1
Outline
• Link Layer Services
• Error Detection
• Parity Check
• Cyclic Redundancy Check
• Hamming Code
• Flow control : Stop and Wait, Sliding Window Protocol
• Error control : ARQ mechanism

4/14/2024 Logical Link Control Sub Layer 2


Link Layer Services(Design Issues)
• Framing, link access:
– encapsulate datagram into frame, adding header, trailer
– channel access if shared medium

• Flow Control:
– pacing between adjacent sending and receiving nodes

• Error Detection:
– errors caused by signal attenuation, noise, and receiver detects presence of
errors:

• Error Correction:
– receiver identifies and corrects bit error(s) without resorting to retransmission
• Half-duplex and full-duplex
– with half duplex, nodes at both ends of link can transmit, but not at same time
4/14/2024 Logical Link Control Sub Layer 5-3
Error Detection
• Error are likely to occur even when there is a sufficient
SNR to provide a low bit error rate
• To control error and improve the reliability of a
communication line, first we must be able to detect the
errors
• CRC one of the best techniques to detect the error
• Bit Error Rate(BER): It is the ratio of number Ne of errors
appearing over a certain time interval t to the number Nt
of 1 and 0 pulses transmitted during this interval. BER =
Ne/ Nt = Ne / R*t
4/14/2024 Logical Link Control Sub Layer 4
Types of Error

• Single Bit Error: In a single-bit error, only one


bit in the data unit has changed

4/14/2024 Logical Link Control Sub Layer 5


Burst Error [5]
• A burst error means that 2 or more bits in the
data unit have changed

4/14/2024 Logical Link Control Sub Layer 6


Detection

Redundancy: adding extra bits for detecting


errors at the destination.
- Parity Check: a parity bit is added to every data
unit so that the total number of 1s is even
(or odd for odd-parity).
- Cyclic Redundancy Check (CRC)
- Checksum

4/14/2024 Logical Link Control Sub Layer 7


Error Detection [6]
EDC= Error Detection and Correction bits (redundancy)
D = Data protected by error checking, may include header fields

• Error detection not 100% reliable!


• protocol may miss some errors, but rarely
• larger EDC field yields better detection and correction

4/14/2024 Logical Link Control Sub Layer 5-8


10.5 Even-parity concept [5]

4/14/2024 Logical Link Control Sub Layer 9


Example 1 [5]
Suppose the sender wants to send the word world. In
ASCII the five characters are coded as
1110111 1101111 1110010 1101100 1100100
The following shows the actual bits sent
11101110 11011110 11100100 11011000 11001001

4/14/2024 Logical Link Control Sub Layer 10


Example 2 [5]
Now suppose the word world in Example 1 is received by
the receiver without being corrupted in transmission.
11101110 11011110 11100100 11011000 11001001
The receiver counts the 1s in each character and comes up
with even numbers (6, 6, 4, 4, 4). The data are accepted.

4/14/2024 Logical Link Control Sub Layer 11


Example 3 [5]
Now suppose the word world in Example 1 is corrupted
during transmission.
11111110 11011110 11101100 11011000 11001001
The receiver counts the 1s in each character and comes up
with even and odd numbers (7, 6, 5, 4, 4). The receiver
knows that the data are corrupted, discards them, and asks
for retransmission.
Note: Simple parity check can detect all single-bit
errors. It can detect burst errors only if the total
number of errors in each data unit is odd
4/14/2024 Logical Link Control Sub Layer 12
Parity Checking [6]
Single Bit Parity: Two Dimensional Bit Parity:
Detect single bit errors Detect and correct single bit errors

0 0

4/14/2024 Logical Link Control Sub Layer 5-13


10.6 Two-dimensional parity [5]

4/14/2024 Logical Link Control Sub Layer 14


Example 4 [5]

Suppose the following block is sent:


10101001 00111001 11011101 11100111 10101010
However, it is hit by a burst noise of length 8, and some bits are
corrupted.
10100011 10001001 11011101 11100111 10101010
When the receiver checks the parity bits, some of the bits do not follow
the even-parity rule and the whole block is discarded.

10100011 10001001 11011101 11100111 10101010

4/14/2024 Logical Link Control Sub Layer 15


Checksumming: Cyclic Redundancy Check [6]
• view data bits, D, as a binary number
• choose r+1 bit pattern (generator), G
• goal: choose r CRC bits, R, such that
– <D,R> exactly divisible by G (modulo 2)
– receiver knows G, divides <D,R> by G. If non-zero remainder: error
detected!
– can detect all burst errors less than r+1 bits
• widely used in practice (ATM, HDLC)

4/14/2024 Logical Link Control Sub Layer 5-16


10.7 CRC generator and checker [5]

4/14/2024 Logical Link Control Sub Layer 17


CRC Example 5 [6]

Want:
D.2r XOR R = nG
equivalently:
D.2r = nG XOR R
equivalently:
if we divide D.2r by G,
want remainder R

D.2r
R = remainder[ ]
G

4/14/2024 Logical Link Control Sub Layer 5-18


Example 6 for CRC Generator [5]

4/14/2024 Logical Link Control Sub Layer 19


Example 7 for CRC checker [5]

4/14/2024 Logical Link Control Sub Layer 20


10.11 A polynomial representing a divisor [5]

4/14/2024 Logical Link Control Sub Layer 21


Table 10.1 Standard polynomials [5]

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

4/14/2024 Logical Link Control Sub Layer 22


Example 8 [5]
Polynomial Properties(Divisor):
1. It should not be divisible by x
2. It should be divisible by x+1
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).

4/14/2024 Logical Link Control Sub Layer 23


Example 9 [5]
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, and will
detect, 99.97 percent of the time, burst errors with a
length of 12 or more.

4/14/2024 Logical Link Control Sub Layer 24


Hamming Code
• Hamming Code-
– It is error detection and correction technique used at data link
layer
– It is developed by Richard W. Hamming in 1950
• Hamming Distance-
– It is measure of altered bit or error among the binary numbers
and determines the number of bits which is not matched
– Hamming distance between two words (of the same size) is
the number of differences between the corresponding bits.
– Hamming distance between 111 and 000 is 3
i.e. (d(111, 000) = 3)

4/14/2024 Logical Link Control Sub Layer 25


Data and redundancy bits [5]

Number of Number of Total


data bits redundancy bits bits
m r m+r
1 2 3
2 3 5
3 3 6
4 3 7
5 4 9
6 4 10
7 4 11

Find min r : (2^r > m+r)

4/14/2024 Logical Link Control Sub Layer 26


FEC [5]
Positions of redundancy bits in Hamming code
Each r bit is the parity bit for one combination of data bits

r1: 1, 3, 5, 7, 9, 11, . . .
r2: 2, 3, 6, 7, 10, 11, . . .
r4: 4, 5, 6, 7, . . .
r8: 8, 9, 10, 11, . . .

4/14/2024 Logical Link Control Sub Layer 27


Redundancy bits calculation [5]

4/14/2024 Logical Link Control Sub Layer 28


Example of redundancy bit calculation [5]

4/14/2024 Logical Link Control Sub Layer 29


Error detection using Hamming code [5]

4/14/2024 Logical Link Control Sub Layer 30


Flow Control
• Flow control refers to a set of procedures used to restrict
the amount of data that the sender can send before waiting
for acknowledgment
• Ensuring the sending entity does not overwhelm the
receiving entity
– Preventing buffer overflow
• Transmission time
– Time taken to emit all bits into medium
• Propagation time
– Time for a bit to traverse the link

4/14/2024 Logical Link Control Sub Layer 31


Model of Frame Transmission [1]

4/14/2024 Logical Link Control Sub Layer 32


Stop and Wait
• Source transmits frame
• Destination receives frame and replies with
acknowledgement
• Source waits for ACK before sending next frame
• Destination can stop flow by not sending ACK
• Works well for a few large frames

4/14/2024 Logical Link Control Sub Layer 33


Contd.
• Large block of data may be split into small
frames
– Limited buffer size
– Errors detected sooner (when whole frame
received)
– On error, retransmission of smaller frames is needed
– Prevents one station occupying medium for long
periods
• Stop and wait becomes inadequate

4/14/2024 Logical Link Control Sub Layer 34


Automatic Repeat Request (ARQ)
• Collectively , these mechanisms are referred
as ARQ
• The effect of ARQ is to turn an unreliable data
link into a reliable one.
• Three version are:
- Stop and wait
- Go back N
- Selective reject (selective retransmission)
4/14/2024 Logical Link Control Sub Layer 35
Stop and Wait ARQ [1]
• Source transmits single frame
• Wait for ACK
• If received frame is damaged, discard it
– Transmitter has timeout
– If no ACK within timeout, retransmit
• If ACK damaged, transmitter will not recognize it
– Transmitter will retransmit
– Receiver gets two copies of frame
– Use ACK0 and ACK1
4/14/2024 Logical Link Control Sub Layer 36
4/14/2024 Logical Link Control Sub Layer 37
Contd.
• R: data rate of the link , in bps
• d= length , distance of the link in meters
• V= propagation speed in m/s
• B: length of the link in bits
B= R*d / V
• a = B/ L = propagation delay / transmission
delay
where L is no of bits in the frame(frame Length)
4/14/2024 Logical Link Control Sub Layer 38
Stop and Wait Link Utilization [1]

4/14/2024 Logical Link Control Sub Layer 39


Performance Evaluation
• Stop-Wait Protocol-
– Maximum utilization of a link, U= 1/(1+2a)
– a is the ratio of propagation delay to transmission
delay
• Sliding Window Protocol:Go-Back-N ARQ
– Link utilization, U= W/(1+2a) , if W < 2a+1
– Link utilization, U= 1 , if W >= 2a+1
– W is the window size

4/14/2024 Logical Link Control Sub Layer 40


Go Back N ARQ [1]
• Based on sliding window
• If no error, ACK is as usual with next frame expected
• Use window to control number of outstanding
frames
• If error, reply with rejection
– Discard that frame and all future frames until error
frame received correctly
– Transmitter must go back and retransmit that frame and
all subsequent frames

4/14/2024 Logical Link Control Sub Layer 41


4/14/2024 Logical Link Control Sub Layer 42
References
1. William Stallings, “Data and Computer Communications”, Seventh
Edition, PHI 2004.
2. Andrew S. Tanenbaum, ”Computer Networks” 4th Edition PHI
3. B. A. Fourozan, “TCP/IP Protocol Suite”, 3rd Edition, Singapore,
McGrawHill, 2004.
4. L. L. Peterson and B. S. Davie, Computer Networks-A System Approach,
Elsevier.
5. B. A. Fourozan, “Data Communications and Networking”, 4th Edition,
Singapore, McGrawHill, 2004.
6. James F. Kurose, Keith W. Ross, “Computer Networking: A Top-Down
Approach Featuring the Internet”, 3rd Edition , Pearson Education 2009.
7. https://gaia.cs.umass.edu/kurose_ross/ppt.htm
8. PPT available for the respective books
9. https://www.geeksforgeeks.org/difference-between-synchronous-and-
asynchronous-transmission/

4/14/2024 Logical Link Control


43 Sub Layer
Thank You

4/14/2024 Logical Link Control Sub Layer 44

You might also like