0% found this document useful (0 votes)
3 views17 pages

CN Unit 2

The document discusses various types of errors in digital signal transmission, including single-bit, multiple-bit, and burst errors, as well as methods for error detection such as simple parity checks, two-dimensional parity checks, checksums, and cyclic redundancy checks (CRC). It also covers flow control protocols like Stop and Wait and Go Back N ARQ, explaining their mechanisms, advantages, and disadvantages. Additionally, it introduces the concept of Hamming distance for error detection and correction in binary data strings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views17 pages

CN Unit 2

The document discusses various types of errors in digital signal transmission, including single-bit, multiple-bit, and burst errors, as well as methods for error detection such as simple parity checks, two-dimensional parity checks, checksums, and cyclic redundancy checks (CRC). It also covers flow control protocols like Stop and Wait and Go Back N ARQ, explaining their mechanisms, advantages, and disadvantages. Additionally, it introduces the concept of Hamming distance for error detection and correction in binary data strings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

ERROR-

Error is a condition when the receiver’s information does not match the sender’s. Digital signals
suffer from noise during transmission that can introduce errors in the binary bits traveling from
sender to receiver. That means a 0 bit may change to 1 or a 1 bit may change to 0.

Types of Errors

Single-Bit Error

A single-bit error refers to a type of data transmission error that occurs when one bit (i.e., a single
binary digit) of a transmitted data unit is altered during transmission, resulting in an incorrect or
corrupted data unit.

Multiple-Bit Error

A multiple-bit error is an error type that arises when more than one bit in a data transmission is
affected. Although multiple-bit errors are relatively rare when compared to single-bit errors, they can
still occur, particularly in high-noise or high-interference digital environments.

Burst Error
When several consecutive bits are flipped mistakenly in digital transmission, it creates a burst error.
This error causes a sequence of consecutive incorrect values.

Error Detection Methods

To detect errors, a common technique is to introduce redundancy bits that provide additional
information. Various techniques for error detection include:

 Simple Parity Check

 Two-Dimensional Parity Check

 Checksum

 Cyclic Redundancy Check (CRC)

Simple Parity Check

Simple-bit parity is a simple error detection method that involves adding an extra bit to a data
transmission. It works as:

 1 is added to the block if it contains an odd number of 1’s, and

 0 is added if it contains an even number of 1’s

 This scheme makes the total number of 1’s even, that is


why it is called even parity checking.

 Advantages of Simple Parity Check


 Simple parity check can detect all single bit error.

 Simple parity check can detect an odd number of errors.

 Implementation: Simple Parity Check is easy to implement in both hardware and software.

 Minimal Extra Data: Only one additional bit (the parity bit) is added per data unit (e.g., per
byte).

 Fast Error Detection: The process of calculating and checking the parity bit is quick, which
allows for rapid error detection without significant delay in data processing or
communication.

 Single-Bit Error Detection: It can effectively detect single-bit errors within a data unit,
providing a basic level of error detection for relatively low-error environments.

 Disadvantages of Simple Parity Check

 Single Parity check is not able to detect even no. of bit error.

 For example, the Data to be transmitted is 101010. Codeword transmitted to the receiver is
1010101 (we have used even parity).

 Two-Dimensional Parity Check


 Two-dimensional Parity check bits are calculated for
each row, which is equivalent to a simple parity check bit.
Parity check bits are also calculated for all columns, then
both are sent along with the data. At the receiving end,
these are compared with the parity bits calculated on the
received data.

Advantages of Two-Dimensional Parity Check

 Two-Dimensional Parity Check can detect and correct all single bit error.

 Two-Dimensional Parity Check can detect two or three bit error that occur any where in the
matrix.

Disadvantages of Two-Dimensional Parity Check

 Two-Dimensional Parity Check can not correct two or three bit error. It can only detect two
or three bit error.

 If we have a error in the parity bit then this scheme will not work.

Checksum

Checksum error detection is a method used to identify errors in transmitted data. The
process involves dividing the data into equally sized segments and using a 1’s complement to
calculate the sum of these segments. The calculated sum is then sent along with the data to
the receiver. At the receiver’s end, the same process is repeated and if all zeroes are
obtained in the sum, it means that the data is correct.

Checksum – Operation at Sender’s Side

 Firstly, the data is divided into k segments each of m bits.

 On the sender’s end, the segments are added using 1’s complement arithmetic to get the
sum. The sum is complemented to get the checksum.

 The checksum segment is sent along with the data segments.


Checksum – Operation at Receiver’s Side

 At the receiver’s end, all received segments are added using 1’s complement arithmetic to
get the sum. The sum is complemented.

 If the result is zero, the received data is accepted; otherwise discarded.

Cyclic Redundancy Check (CRC)

 Unlike the checksum scheme, which is based on addition, CRC is based on binary division.

 In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are appended to
the end of the data unit so that the resulting data unit becomes exactly divisible by a second,
predetermined binary number.

 At the destination, the incoming data unit is divided by the same number. If at this step there
is no remainder, the data unit is assumed to be correct and is therefore accepted.

 A remainder indicates that the data unit has been damaged in transit and therefore must be
rejected.
CRC
Working
We have given dataword of length n and divisor of length k.
Step 1: Append (k-1) zero’s to the original message

Step 2: Perform modulo 2 division

Step 3: Remainder of division = CRC

Step 4: Code word = Data with append k-1 zero’s + CRC

Note:

 CRC must be k-1 bits

 Length of Code word = n+k-1 bits

Example: Let’s data to be send is 1010000 and divisor in the form of polynomial is x3+1. CRC
method discussed below.

Advantages of Error Detection

 Increased Data Reliability: Error detection ensures that the data transmitted over the
network is reliable, accurate, and free from errors. This ensures that the recipient receives
the same data that was transmitted by the sender.

 Improved Network Performance: Error detection mechanisms can help to identify and
isolate network issues that are causing errors. This can help to improve the overall
performance of the network and reduce downtime.

 Enhanced Data Security: Error detection can also help to ensure that the data transmitted
over the network is secure and has not been tampered with.

Disadvantages of Error Detection


 Overhead: Error detection requires additional resources and processing power, which can
lead to increased overhead on the network. This can result in slower network performance
and increased latency.

 False Positives: Error detection mechanisms can sometimes generate false positives, which
can result in unnecessary retransmission of data. This can further increase the overhead on
the network.

 Limited Error Correction: Error detection can only identify errors but cannot correct them.
This means that the recipient must rely on the sender to retransmit the data, which can lead
to further delays and increased network overhead.

Hamming Distance

Hamming distance is a metric for comparing two binary data strings. While comparing two
binary strings of equal length, Hamming distance is the number of bit positions in which the
two bits are different.

The Hamming distance between two strings, a and b is denoted as d(a,b).


It is used for error detection or error correction when data is transmitted over computer
networks. It is also using in coding theory for comparing equal length data words.

Calculation of Hamming Distance

In order to calculate the Hamming distance between two strings, and , we perform their XOR
operation, (a⊕ b), and then count the total number of 1s in the resultant string.

Example

Suppose there are two strings 1101 1001 and 1001 1101.

11011001 ⊕ 10011101 = 01000100. Since, this contains two 1s, the Hamming distance,
d(11011001, 10011101) = 2.

Minimum Hamming Distance


In a set of strings of equal lengths, the minimum Hamming distance is the smallest Hamming
distance between all possible pairs of strings in that set.

Example

Suppose there are four strings 010, 011, 101 and 111.

010 ⊕ 011 = 001, d(010, 011) = 1.

010 ⊕ 101 = 111, d(010, 101) = 3.

010 ⊕ 111 = 101, d(010, 111) = 2.

011 ⊕ 101 = 110, d(011, 101) = 2.

011 ⊕ 111 = 100, d(011, 111) = 1.

101 ⊕ 111 = 010, d(011, 111) = 1.

Hence, the Minimum Hamming Distance, dmin = 1.

Stop and Wait Protocol

 While transmitting data from sender to receiver, the flow of data is required to be controlled.

 It uses a link between sender and receiver as a half-duplex link.

 Suppose there is a situation where the sender is sending the data at a rate higher than the
rate of the receiver to process and receive the data. Flow Control protocol ensures that the
data does not get lost.

 The flow control protocols ensure that the sender sends the data only at a rate that the
receiver can receive and process it.

 This is a flow control protocol that works in a noiseless channel.

 Noiseless channel is an idealistic channel in which no data frames are lost, corrupted, or
duplicated.

 After sending the data, the sender will stop and wait until he receives an acknowledgment
from the receiver.
 Flow control service is provided by the data link layer of the OSI suite.

Sender Side
 Rule 1: Sender will send one packet at a time
 Rule 2: Sender will send the next packet to the receiver only when
it receives the acknowledgment of the previous packet from the
receiver. So, in the stop-and-wait protocol, the sender-side process
is very simple.
 Note: The sender sends one packet at a time and does not send the
next packet until it receives an acknowledgment of the previous
packet from the receiver.
Receiver Side
 Rule 1: The receiver receives the data packet and then consumes
the data packet. Rule 2: The receiver sends acknowledgment when
the data packet is consumed. So, in this protocol, the receiver-side
process is also very simple.

 Working of Stop and Wait


Protocol
If there is a communication between sender and receiver, then the sender sends the packet
to the receiver, and the packet is called a data packet.

The sender will not send the second packet to the receiver until acknowledgment of the first
packet is received.

The receiver will send the acknowledgment for the packet that the receiver has received.

When the sender receives the acknowledgment, it sends the next packet to the receiver.

This process of sending data and receiving acknowledgment continues until all the packets
are not sent.

The main benefit of stop and wait protocol is its simplicity

But this protocol has some disadvantages, too; for example, if the sender wants to send
10,000 data packets, and the sender can not send all 10,000 packets at a time in this
protocol, one packet is allowed to be sent at a time.

Refer to the below image to see the working of data transmission in the stop-and-wait
protocol

Advantages of Stop and Wait Protocol

 This protocol provides flow control.

 One of the main advantages of the stop-and-wait protocol is its simplicity.


 Stop and wait protocol is useful in LAN as its efficiency decreases with the increasing
distance between sender and receiver.

 If we increase the data packet size, the efficiency is going to increase. Hence, it is suitable for
transmitting big data packets.

 Stop & wait protocol is accurate as the sender sends the next frame to the receiver only
when the acknowledgment of the previous packet is received. So there is less chance of the
frame being lost.

Disadvantages of Stop and Wait Protocol

Kk

Problems Occur Due to Lost Data

Suppose the sender sends the data packet, but the data packet is lost due to some reason. Since the
receiver has not received the packet for a long time, the sender does not receive any
acknowledgment from the receiver, so it will not send the next packet.

In this case, two problems occur in data transmission:

 For an acknowledgment, the sender has to wait for an infinite amount of time.

 The receiver will also have to wait for an infinite amount of time to receive the data.

Refer to the below image to see data loss in the stop-and-wait protocol
l

Problems Occur Due to Lost Acknowledgment

Suppose the sender sends the packet, and the receiver will send an acknowledgment. But the
acknowledgment sent by the receiver will be lost in the network, therefore sender will not send the
next packet as the acknowledgment is not received In this case, one problem occurs in data
transmission:

 The sender has to wait for an infinite amount of time due to acknowledgment loss in the
network.

Refer to the below image to see acknowledgment loss in the stop-and-wait protocol

Problem Due to the Delay in Data or Acknowledgment

Suppose the sender sends the data packet, and the receiver will also send the acknowledgment, but
the acknowledgment is received by the sender after the timeout period. So sender will not consider
this acknowledgement as there may be a situation that the sender will retransmit the packet after
time out.

Refer to the below image to see delayed data and acknowledgment in the stop-and-wait protocol
l

Go Back N ARQ is a sliding window protocol which is used for flow control purposes. Multiple
frames present in a single window are sent together from sender to receiver.

Pipelining is allowed in the Go Back N ARQ protocol. Pipelining means sending a frame before
receiving the acknowledgment for the previously sent frame.

Sender Window and Receiver Window in Go-Back-N ARQ Protocol

The sender window is a fixed-sized window that defines the number of frames that are transmitted
from sender to receiver at once. The integer ‘N’ in the Go Back ‘N’ is the frame size.

For example in Go Back 4 ARQ, the size of the sender window is 4.

is 4.

The Receiver window in the Go Back N ARQ protocol is always of size 1. This means that the
receiver takes at most 1 frame at a single time.

Working of Go-Back-N ARQ Protocol

Given below are the steps to clearly explain how the Go Back N ARQ algorithm works.

Data packets are divided into multiple frames. Each frame contains information about the
destination address, the error control mechanism it follows, etc. These multiple frames are
numbered so that they can be distinguished from each other.

2. The integer ‘N’ in Go Back ‘N’ ARQ tells us the size of the window i.e. the number of frames that
are sent at once from sender to receiver. Suppose the window size ‘N’ is equal to 4. Then, 4 frames
(frame 0, frame 1, frame 2, and frame 3) will be sent first from sender to receiver.

3. The receiver sends the acknowledgment of frame 0. Then the sliding window moves by one
and frame 4 is sent.
4. The receiver sends the acknowledgment of frame 1. Then the sliding window moves by one
and frame 3 is sent.

5. The sender waits for the acknowledgment for a fixed amount of time. If the sender does not get
the acknowledgment for a frame in time, it considers the frame to be corrupted. Then the sliding
window moves to the start of the corrupted frame and all the frames in the window are
retransmitted.

For example, if the sender does not receive the acknowledgment for frame 2, it retransmits all the
frames in the windows i.e. frames [2, 3, 4, 5].

For example, if the sender does not receive the acknowledgment for frame 2, it retransmits all the
frames in the windows i.e. frames [2, 3, 4, 5].

5. The sender waits for the acknowledgment for a fixed amount of time. If the sender does not get
the acknowledgment for a frame in time, it considers the frame to be corrupted. Then the sliding
window moves to the start of the corrupted frame and all the frames in the window are
retransmitted.
Characteristics of Go-Back-N ARQ

Given below are the characteristics of the Go-Back-N ARQ protocol.

1. The size of the sender window in Go Back N ARQ is equal to N.

2. The size of the receiver window in Go Back N ARQ is equal to 1.

3. When the acknowledgment for one frame is not received by the sender or the frames
received by the receiver are out of order, then the whole window starting from the
corrupted frame is retransmitted.

Go-Back-N ARQ follows the principle of pipelining i.e. a frame can be sent by the sender before
receiving the acknowledgment of the previously sent frame.

Advantages of Go-Back-N ARQ


Given below are some of the advantages of Go Back N ARQ.

1. It can send multiple frames at once. 2. Pipelining is present in the Go-Back-N ARQ i.e. a frame can
be sent by the sender before receiving the acknowledgment of the previously sent frame. This results
in a shorter waiting time for the frame. 3. It handles corrupted as well as out-of-order frames which
result in minimal frame loss.

Disadvantages of Go-Back-N ARQ

Given below are some of the disadvantages of Go Back N ARQ.

1. If acknowledgment for a frame is not received, the whole window of frames is retransmitted
instead of just the corrupted frame. This makes the Go Back N ARQ protocol inefficient.
2. Retransmission of all the frames on detecting a corrupted frame increases channel congestion and
also increases the bandwidth requirement.
3. It is more time-consuming because while retransmitting the frames on detecting a corrupted
frame, the error-free frames are also transmitted.

Stop and Wait GoBackN Selective Repeat

In the Stop and


Any frames that
Wait protocol,
were sent after Only the
the sender
the frame that is suspected
sends one
believed to have damaged or lost
frame and then
been damaged frames are
waits for the
or lost are retransmitted.
receiver to
resent.
acknowledge it.

In the Stop and


In the Go-Back- The Selective
Wait protocol,
N protocol, the Repeat approach
the Sender
Sender window has a Sender
window size is
size is N. window size of N.
1.

In the Stop and


In the Go-Back- The Selective
Wait protocol,
N protocol, the Repeat approach
the receiver
receiver window has a receiver
window size is
size is 1. window size of N.
1.

No particular The Go-Back-N Out-of-order


sequence protocol’s deliveries can also
needs to be receiver end will be accepted at
followed at the only accept the the receiving end
receiver end of correct of the Selective
the Stop and sequence. Repeat technique.
Stop and Wait GoBackN Selective Repeat

Wait protocol.

In the Stop and


In the Go-Back-
Wait protocol, In the Selective
N protocol, the
the Repeat protocol,
transmission
transmission the transmission
type is full
type is Half type is full duplex.
duplex.
duplex.

Efficiency
formula for the
Efficiency Efficiency formula
Go-Back-N
formula for the for the Selective
protocol is
Stop and Wait Repeat protocol is
N/(1+2*a),
protocol is N/(1+2*a), where
where a is the
1/(1+2*a), a is the ratio of
proportion of
where a is the propagation delay
propagation
ratio of to transmission
delay to
propagation delay and N is the
transmission
delay to number of
delay and N is
transmission packets
the number of
delay. transmitted.
packets
transmitted.

What is Selective Repeat

This protocol(SRP) is mostly identical to GBN protocol, except that buffers are used and the
receiver, and the sender, each maintains a window of size. SRP works better when the link is very
unreliable. Because in this case, retransmission tends to happen more frequently, selectively
retransmitting frames is more efficient than retransmitting all of them. SRP also requires full-
duplex link. backward acknowledgements are also in progress.

 Sender’s Windows ( Ws) = Receiver’s Windows ( Wr).

 Window size should be less than or equal to half the sequence number in SR protocol. This
is to avoid packets being recognized incorrectly. If the size of the window is greater than
half the sequence number space, then if an ACK is lost, the sender may send new packets
that the receiver believes are retransmissions.

 Sender can transmit new packets as long as their number is with W of all unACKed packets.

 Sender retransmit un-ACKed packets after a timeout – Or upon a NAK if NAK is employed.
 Receiver ACKs all correct packets.

 Receiver stores correct packets until they can be delivered in order to the higher layer.

 In Selective Repeat ARQ, the size of the sender and receiver window must be at most one-
half of 2^m.

You might also like