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

Unit 2

This document discusses various sources of errors that can occur during data transmission and techniques for error detection and correction at the data link layer. It describes three main sources of transmission errors as interference, distortion, and attenuation. It then discusses error detection techniques like parity checks, checksums, and cyclic redundancy checks. It also covers error correction techniques using forward error correction codes and retransmissions.
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)
83 views44 pages

Unit 2

This document discusses various sources of errors that can occur during data transmission and techniques for error detection and correction at the data link layer. It describes three main sources of transmission errors as interference, distortion, and attenuation. It then discusses error detection techniques like parity checks, checksums, and cyclic redundancy checks. It also covers error correction techniques using forward error correction codes and retransmissions.
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

Unit-2

Data Link Layer


Errors

Problem: All data communications systems are susceptible to errors


• The physics of the universe causes errors.
• Devices fail and/or equipment does not meet engineering standards.
 
Thus: We need ways/mechanisms to control and recover from errors.
 
Note: Small errors are often more difficult to detect than complete failures.

Three Main Sources of Transmission Errors


 
1. Interference
Example: Electromagnetic radiation interferes with electrical signals

2. Distortion
Rule: All physical systems distort signals

3. Attenuation
Example: As a signal passes across a medium, the signal becomes weaker
 
Errors
When bits are transmitted over the computer network, they
are subject to get corrupted due to interference and
network problems. The corrupted bits leads to spurious
data being received by the destination and are called
errors.
Effect of Transmission Errors on Data

Two key Characteristics


of errors:

1. BER bit error rate: Probability P of a


single bit being corrupted in a defined
time interval.

2. Random (or burst) errors: Whether


the errors occur as random single-bit
errors or as groups of contiguous
errors.
Error Control
Error control can be done in two ways
•Error detection − Error detection involves checking whether
any error has occurred or not. The number of error bits and the
type of error does not matter.
•Error correction − Error correction involves ascertaining the
exact number of bits that has been corrupted and the location
of the corrupted bits.

For both error detection and error correction, the sender needs to send some additional bits
along with the data bits. The receiver performs necessary checks based upon the additional
redundant bits. If it finds that the data is free from errors, it removes the redundant bits before
passing the message to the upper layers.
Error Detection uses the concept of
redundancy which means adding extra
bits for detecting errors at destination.
Error Detection Techniques
There are three main techniques for detecting errors in frames: Parity
Check, Checksum and Cyclic Redundancy Check (CRC).
Parity Check
The parity check is done by adding an extra bit, called parity bit to the data
to make a number of 1s either even in case of even parity or odd in case of
odd parity.
While creating a frame, the sender counts the number of 1s in it and adds
the parity bit in the following way

•In case of even parity: If a number of 1s is even then parity bit value is 0.
If the number of 1s is odd then parity bit value is 1.

•In case of odd parity: If a number of 1s is odd then parity bit value is 0. If
a number of 1s is even then parity bit value is 1.

On receiving a frame, the receiver counts the number of 1s in it. In case of


even parity check, if the count of 1s is even, the frame is accepted,
otherwise, it is rejected. A similar rule is adopted for odd parity check.
The parity check is suitable for single bit error detection only.
Example
Error Control (FEC & BEC)
 
Basic idea of Error Control: Add additional information to the data that allows
a receiver to verify that data arrives correctly and to correct errors (if possible).

Backward error control (error detecting): Each transmitted character or frame


contains additional information so that the receivers can detect but not correct errors.
A retransmission scheme must also be used.

Forward error control (error correcting): Each transmitted character or frame


contains additional information so that the receivers can detect and correct errors.
 
Two-Dimensional Parity (Block sum check)

• Used with blocks of characters


• Use a row parity bit for each byte
• Use a column parity for each bit column position in the complete frame
Cyclic Redundancy Check (CRC)
Cyclic Redundancy Check (CRC) involves binary division of the
data bits being sent by a predetermined divisor agreed upon by the
communicating system. The divisor is generated using polynomials.
•Here, the sender performs binary division of the data segment by
the divisor. It then appends the remainder called CRC bits to the
end of the data segment. This makes the resulting data unit exactly
divisible by the divisor.
•The receiver divides the incoming data unit by the divisor. If there
is no remainder, the data unit is assumed to be correct and is
accepted. Otherwise, it is understood that the data is corrupted and
is therefore rejected.
Example-2
Example-2
Example-3 Data unit 1001000 is divided by 1011.
                                
Consider the following message M = 1010001101. The cyclic redundancy check
(CRC) for this message using the divisor polynomial x 5 + x4 + x2 + 1 is :
 
(A) 01110
(B) 01011
(C) 10101
(D) 10110
Cyclic Redundancy Code (CRC)
 
A form of channel coding known as a Cyclic Redundancy Code (CRC) is used in
high-speed data networks

Key properties of CRC are summarized below:


CRC (cont’d)

Cyclic redundancy codes:


• Uses a mathematical function
• More complex to compute than checksums
• Handles more errors
• Used with frame transmission schemes
• A single set of check digits is generated and appended at the end of each frame
transmitted
• In this method the bits of data are treated as coefficients of a polynomial
CRC (cont’d)

CRC Coding:

A k-bit message is regarded as the coefficient list for a polynomial with k terms,
ranging from x(k-1) to x0. The high-order (leftmost) bit is the coefficient of x(k-1); the
next bit is the coefficient of x(k-2), and so on.

The check digits are generated by multiplying the k-bit message by xn and dividing
the product by an (n+1)-bit code polynomial (modulo 2). The n-bit remainder is
used as the check digits.

Decoding:

The complete received bit sequence is divided by the same generator polynomial
(modulo 2).

If the remainder is zero, no errors occurred.

If the remainder is nonzero, a transmission error has occurred.


CRC Calculation
This figure shows the division of 1010 (k=4) which represents the data by a constant
generator function: 1011 (n+1=4).

Figure 8.12
CRC (cont’d)

A generator polynomial of N+1 bits will detect:


• all single-bit errors
• all double-bit errors
• all odd-number of bit errors
• all error bursts < N+1 bits
• most error bursts >= N+1 bits
CRCs and Polynomial Representation
 
We can view the above process as a polynomial division:
 
Think of each bit in a binary number as the coefficient of a term in a polynomial
 
For example, we can think of the divisor in Figure 8.12, 1011, as coefficients in
the following polynomial:

Similarly, the dividend in Figure 8.12, 1010000, represents the polynomial:


Code Polynomials (or generator polynomials):

Code polynomials are usually of degree 12 or 16 or 32


 
Six polynomials are in widespread use:
 
• Ethernet and FDDI use CRC-32
• HDLC uses CRC-CCITT
• ATM uses CRC-8 and CRC-10
• Three polynomials are international standards: CRC-12, CRC-16, and CRC-
CCITT
Test yourself

Hamming Code Numerical Questions as available in End term Question Paper


Error Correction Techniques
Error correction techniques find out the exact number of bits that have
been corrupted and as well as their locations. There are two principle
ways

•Backward Error Correction (Retransmission) −  If the receiver


detects an error in the incoming frame, it requests the sender to
retransmit the frame. It is a relatively simple technique. But it can be
efficiently used only where retransmitting is not expensive as in fiber
optics and the time for retransmission is low relative to the
requirements of the application.
•Forward Error Correction −  If the receiver detects some error in the
incoming frame, it executes error-correcting code that generates the
actual frame. This saves bandwidth required for retransmission. It is
inevitable in real-time systems. However, if there are too many errors,
the frames need to be retransmitted.

•Hamming Codes
Checksum
In this error detection scheme, the following procedure is
applied
•Data is divided into fixed sized frames or segments.
•The sender adds the segments using 1’s complement
arithmetic to get the sum. It then complements the sum to get
the checksum and sends it along with the data frames.
•The receiver adds the incoming segments along with the
checksum using 1’s complement arithmetic to get the sum and
then complements it.
•If the result is zero, the received frames are accepted;
otherwise, they are discarded.
Internet Checksum Algorithm
 
The Internet checksum is a simple error detection technique used by TCP/IP.
 
The Internet Checksum Algorithm is simple:
• treat the data being transmitted as 16-bit integers,
• add them together using 16-bit ones-complement arithmetic,
• take the complement of the sum as the checksum,
• send the checksum across the network with the original data.
 
The Internet checksum:
 
• Does not have strong error detection properties, but handles many multiple bit
errors
• Cannot handle all errors
• It is easy to implement in software
• It is used in a end-to-end manner, so lower layer protocols catch most of the errors
Internet Checksum Algorithm (Cont’d)

The Internet checksum:


• does not have strong error detection properties, but handles many multiple bit
errors
• Cannot handle all errors
• is easy to implement in software
• is used in a end-to-end manner, so lower layer protocols catch most of the errors
ALOHA
• ALOHA is a system for coordinating and arbitrating
access to a shared communication Networks
channel.
• It was developed in the 1970s by Norman Abramson
and his colleagues at the University of Hawaii.
• The original system used for ground based radio
broadcasting, but the system has been implemented
in satellite communication systems.
ALOHA
• A shared communication system like ALOHA requires a
method of handling collisions that occur when two or more
systems attempt to transmit on the channel at the same time.
• In the ALOHA system, a node transmits whenever data is
available to send. If another node transmits at the same
time, a collision occurs, and the frames that were
transmitted are lost.
• However, a node can listen to broadcasts on the medium,
even its own, and determine whether the frames were
transmitted.
• Aloha means "Hello". Aloha is a multiple access protocol at
the datalink layer and proposes how multiple terminals
access the medium without interference or collision.
• In 1972 Roberts developed a protocol that would increase the
capacity of aloha two fold.
• The Slotted Aloha protocol involves dividing the time
interval into discrete slots and each slot interval corresponds
to the time period of one frame.
• This method requires synchronization between the sending
nodes to prevent collisions.
PURE ALOHA
• In pure ALOHA, the stations transmit frames whenever they have data
to send.

• When two or more stations transmit simultaneously, there is collision


and the frames are destroyed.

• In pure ALOHA, whenever any station transmits a frame, it expects the


acknowledgement from the receiver.

• If acknowledgement is not received within specified time, the station


assumes that the frame (or acknowledgement) has been destroyed.

• If the frame is destroyed because of collision the station waits for a


random amount of time and sends it again. This waiting time must be
random otherwise same frames will collide again and again.

• Therefore pure ALOHA dictates that when time-out period passes, each
station must wait for a random amount of time before resending its frame.
This randomness will help avoid more collisions.
Slotted ALOHA

• Slotted ALOHA was invented to improve the efficiency of pure ALOHA as chances of collision in
pure ALOHA are very high.
• In slotted ALOHA, the time of the shared channel is divided into discrete intervals called
slots.
• The stations can send a frame only at the beginning of the slot and only one frame is
sent in each slot.
• In slotted ALOHA, if any station is not able to place the frame onto the channel at the
beginning of the slot i.e. it misses the time slot then the station has to wait until the beginning
of the next time slot.
• Slotted ALOHA still has an edge over pure ALOHA as chances of collision are reduced to one-
half.
Explanation:
• A station which has a
frame ready will send it.
• Then it waits for some
time.
• If it receives the
acknowledgement then
the transmission is
successful.
• Otherwise the station
uses a backoff strategy,
and sends the packet
again.
• After many times if
there is no
acknowledgement then
the station aborts the
idea of transmission.

You might also like