Unit 2
Unit 2
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
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.
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).
Figure 8.12
CRC (cont’d)
•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)
• 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.