flow and error control with all numerical -pyqs

126
Flow and Error Control With all Numerical -PYQs

Upload: others

Post on 07-Apr-2022

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Flow and Error Control With all Numerical -PYQs

Flow and Error Control

With all Numerical -PYQs

Page 2: Flow and Error Control With all Numerical -PYQs

Welcome to Unify Study

• I am Priyanka Chatterjee.

• UGC NET Qualified with 99.46 Percentile. (Dec 2019)

• 5 years Industry Experience.

• MCA (2008 – 2011 )

• BSc. Honors in Computer Science (2004 - 2007)

• From last 15 years I am learning Computer Science in a Practical Way.

• Less is More……………….

Page 3: Flow and Error Control With all Numerical -PYQs

Difference between Period and Frequency

1.Definition of Period and Frequency

Both the terms period and frequency are related because they exhibit a certain pattern of movement,

Period refers to the amount of time it takes a wave to complete one full cycle of oscillation or

vibration.

Frequency, refers to the number of complete cycles or oscillations occur per second.

Period is a quantity related to time, whereas frequency is related to rate.

Period simply refers to the time for something to occur periodically,

whereas frequency means how often that happens.

2.Relationship of Period and Frequency

Both the quantities are inversely proportional to each other.

The frequency is usually denoted by the letter “f”. The unit of frequency is Hertz (Hz) .

The period is expressed in seconds per cycle. “T” represents the time period of one complete

oscillation.

frequency and period are expressed as:

f = 1/T, where f is frequency and T is period.

It can also be expressed as:

T = 1/f

Page 4: Flow and Error Control With all Numerical -PYQs

Difference between Bit Rate and Baud Rate

Both Bit rate and Baud rate are generally used in data communication,

Bit rate is the transmission of number of bits per second. On the other

hand, Baud rate is defined as the number of signal units per second. The

formula which relates both bit rate and baud rate is given below:

Bit rate = Baud rate x the number of bit per baud.

Baud rate = Bit rate / number of bit per baud.

Page 5: Flow and Error Control With all Numerical -PYQs
Page 6: Flow and Error Control With all Numerical -PYQs
Page 7: Flow and Error Control With all Numerical -PYQs

What Is Throughput and Bandwidth in Networking?

Throughput tells you how much data was transferred from a source at any given time.

Bandwidth tells you how much data could theoretically be transferred from a source at any given time.

Page 8: Flow and Error Control With all Numerical -PYQs

File Size : KB (Kilo Byte)

Data Transfer Speed : Kbps (Kilo bit / sec)

Bandwidth is always measers in power of 10 (Gbps) = 10 ^9

Data is always measers in power of 2 (GB) = 2^30.

1 Kilo bytes = 210 bytes

1 kilo bits = 210 bits

1 Mega bytes = 220 bytes

1 kilo bytes per second = 103 bytes per second

1 kilo bits per second = 103 bits per second

1 Mega bytes per second = 106 bytes per second

Page 9: Flow and Error Control With all Numerical -PYQs
Page 10: Flow and Error Control With all Numerical -PYQs

1. Transmission Delay-

•Transmission delay ∝ Length / Size of data packet•Transmission delay ∝ 1 / Bandwidth

Page 11: Flow and Error Control With all Numerical -PYQs

2. Propagation Delay-

Mathematically,•Propagation delay ∝ Distance between sender and receiver•Propagation delay ∝ 1 / transmission speed

Time taken for one bit to travel from sender to receiver end of the link is called as propagation delay.

Page 12: Flow and Error Control With all Numerical -PYQs

3. Queuing Delay-

Time spent by the data packet waiting in the queue before it is taken for execution is called as queuing delay.

•It depends on the speed of the processor.•Processing of the data packet helps in detecting bit level errors that occurs during transmission.

Page 13: Flow and Error Control With all Numerical -PYQs

Important Points-

Note-01:

Total delay in sending one data packet or End to End time= Transmission delay + Propagation delay + Queuing delay + Processing delay

Note-02:

Both queuing delay and processing delay are dependent on the state of the system.

This is because-•If destination host is busy doing some heavy processing, then these delays will increase.•If destination host is free, then data packets will be processed immediately and these delays will decrease.

Page 14: Flow and Error Control With all Numerical -PYQs

•For any particular transmission link, bandwidth and transmission speed are always constant.•This is because they are properties of the transmission medium.

Note-03:

Page 15: Flow and Error Control With all Numerical -PYQs

Window size 1

Page 16: Flow and Error Control With all Numerical -PYQs

Simple Stop and Wait

Sender:

Rule 1) Send one data packet at a time.

Rule 2) Send next packet only after receiving acknowledgement for previous.

Receiver:

Rule 1) Send acknowledgement after receiving and consuming of data

packet.

Rule 2) After consuming packet acknowledgement need to be sent (Flow

Control)

Page 17: Flow and Error Control With all Numerical -PYQs
Page 18: Flow and Error Control With all Numerical -PYQs

Problems :

1. Lost Data

Page 19: Flow and Error Control With all Numerical -PYQs

2. Lost Acknowledgement:

3. Delayed Acknowledgement/Data: After timeout on sender side, a long delayed acknowledgement might be wrongly considered as acknowledgement of some other recent packet.

Page 20: Flow and Error Control With all Numerical -PYQs

Stop and Wait ARQ (Automatic Repeat Request)

Above 3 problems are resolved by Stop and Wait ARQ (Automatic Repeat Request) that does both

error control and flow control.

Page 21: Flow and Error Control With all Numerical -PYQs

1. Time Out:

Page 22: Flow and Error Control With all Numerical -PYQs

2. Sequence Number (Data)

Page 23: Flow and Error Control With all Numerical -PYQs

3. Delayed Acknowledgement:

This is resolved by introducing sequence number for acknowledgement also.

Page 24: Flow and Error Control With all Numerical -PYQs
Page 25: Flow and Error Control With all Numerical -PYQs

Working of Stop and Wait ARQ:

1) Sender A sends a data frame or packet with sequence number 0.

2) Receiver B, after receiving data frame, sends and acknowledgement with sequence number 1 (sequence number of next expected data frame or packet)

There is only one bit sequence number that implies that both sender and receiver have buffer for one frame or packet only.

Characteristics of Stop and Wait ARQ:

•It uses link between sender and receiver as half duplex link

•Throughput = 1 Data packet/frame per RTT

•If Bandwidth*Delay product is very high, then stop and wait protocol is not so useful. The sender has to

keep waiting for acknowledgements before sending the processed next packet.

•It is an example for “Closed Loop OR connection oriented “ protocols

•It is an special category of SWP where its window size is 1

•Irrespective of number of packets sender is having stop and wait protocol requires only 2 sequence

numbers 0 and 1

Page 26: Flow and Error Control With all Numerical -PYQs
Page 27: Flow and Error Control With all Numerical -PYQs

Stop and Wait ARQ

•Used in Connection-oriented communication.

•It offers error and flow control

•It is used in Data Link and Transport Layers

•Stop and Wait ARQ mainly implements Sliding Window Protocol concept

with Window Size 1

Page 28: Flow and Error Control With all Numerical -PYQs

The Stop and Wait ARQ solves main three problems, but may cause big performance issues as

sender always waits for acknowledgement even if it has next packet ready to send. Consider a

situation where you have a high bandwidth connection and propagation delay is also high (you are

connected to some server in some other country though a high speed connection). To solve this

problem, we can send more than one packet at a time with a larger sequence numbers. We will be

discussing these protocols in next articles.

So Stop and Wait ARQ may work fine where propagation delay is very less for example LAN

connections, but performs badly for distant connections like satellite connection.

Page 29: Flow and Error Control With all Numerical -PYQs

Useful Terms:

•Propagation Delay: Amount of time taken by a packet to make a physical journey from one router

to another router.

Propagation Delay = (Distance between routers) / (Velocity of propagation)

•RoundTripTime (RTT) = 2* Propagation Delay

•TimeOut (TO) = 2* RTT

•Time To Live (TTL) = 2* TimeOut. (Maximum TTL is 180 seconds)

Page 30: Flow and Error Control With all Numerical -PYQs
Page 31: Flow and Error Control With all Numerical -PYQs
Page 32: Flow and Error Control With all Numerical -PYQs
Page 33: Flow and Error Control With all Numerical -PYQs
Page 34: Flow and Error Control With all Numerical -PYQs

Sliding Window Protocol | (Sender Side)

The Stop and Wait ARQ offers error and flow control, but may cause big performance issues as

sender always waits for acknowledgement even if it has next packet ready to send. Consider a

situation where you have a high bandwidth connection and propagation delay is also high (you are

connected to some server in some other country though a high speed connection), you can’t use

this full speed due to limitations of stop and wait.

Sliding Window protocol handles this efficiency issue by sending more than one packet at a time

with a larger sequence numbers. The idea is same as pipelining in architectures.

Page 35: Flow and Error Control With all Numerical -PYQs
Page 36: Flow and Error Control With all Numerical -PYQs

Maximum packets That can be Transmitted in total cycle time = 1+2*a

Let me explain now with the help of an example.

Consider Tt = 1ms, Tp = 1.5ms.

In the picture given, after sender has transmitted packet 0, it will immediately transmit packets 1, 2, 3.

Acknowledgement for 0 will arrive after 2*1.5 = 3ms. In Stop and Wait, in time 1 + 2*1.5 = 4ms, we

were transferring one packet only. Here we keep a window of packets which we have transmitted

but not yet acknowledged.

After we have received the Ack for packet 0, window slides and the next packet can be assigned

sequence number 0. We reuse the sequence numbers which we have acknowledged so that header size can be kept minimum as shown in the diagram given below.

Page 37: Flow and Error Control With all Numerical -PYQs
Page 38: Flow and Error Control With all Numerical -PYQs

Sliding Window Protocol | (Receiver Side)

Sliding Window Protocol is actually a theoretical concept in which we have only talked about what

should be the sender window size (1+2a) in order to increase the efficiency of stop and wait arq. Now

we will talk about the practical implementations in which we take care of what should be the size of

receiver window. Practically it is implemented in two protocols namely :

1.Go Back N (GBN)

2.Selective Repeat (SR)

Page 39: Flow and Error Control With all Numerical -PYQs
Page 40: Flow and Error Control With all Numerical -PYQs
Page 41: Flow and Error Control With all Numerical -PYQs
Page 42: Flow and Error Control With all Numerical -PYQs
Page 43: Flow and Error Control With all Numerical -PYQs
Page 44: Flow and Error Control With all Numerical -PYQs
Page 45: Flow and Error Control With all Numerical -PYQs
Page 46: Flow and Error Control With all Numerical -PYQs

Go Back N (GBN) Protocol

The three main characteristic features of GBN are:

1.Sender Window Size (WS)

It is N itself. If we say the protocol is GB10, then Ws = 10. N should be always greater than 1 in

order to implement pipelining. For N = 1, it reduces to Stop and Wait protocol.

2.Receiver Window Size (WR)

WR is always 1 in GBN.

Page 47: Flow and Error Control With all Numerical -PYQs
Page 48: Flow and Error Control With all Numerical -PYQs

•Acknowledgements

There are 2 kinds of acknowledgements namely:

•Cumulative Ack: One acknowledgement is used for many packets. The main advantage is traffic is

less. A disadvantage is less reliability as if one ack is the loss that would mean that all the packets sent

are lost.

•Independent Ack: If every packet is going to get acknowledgement independently. Reliability is high

here but a disadvantage is that traffic is also high since for every packet we are receiving independent

ack.

Page 49: Flow and Error Control With all Numerical -PYQs
Page 50: Flow and Error Control With all Numerical -PYQs

GBN uses Cumulative Acknowledgement. At the receiver side, it starts a acknowledgement timer

whenever receiver receives any packet which is fixed and when it expires, it is going to send a

cumulative Ack for the number of packets received in that interval of timer. If receiver has received N

packets, then the Acknowledgement number will be N+1. Important point is Acknowledgement timer will not start after the expiry of first timer but after receiver has received a packet.

Time out timer at the sender side should be greater than Acknowledgement timer.

Relationship Between Window Sizes and Sequence Numbers

We already know that sequence numbers required should always be equal to the size of window in any sliding window protocol.

Minimum sequence numbers required in GBN = N + 1

Bits Required in GBN = ceil(log2 (N + 1))

Page 51: Flow and Error Control With all Numerical -PYQs
Page 52: Flow and Error Control With all Numerical -PYQs
Page 53: Flow and Error Control With all Numerical -PYQs
Page 54: Flow and Error Control With all Numerical -PYQs
Page 55: Flow and Error Control With all Numerical -PYQs
Page 56: Flow and Error Control With all Numerical -PYQs
Page 57: Flow and Error Control With all Numerical -PYQs

In the _________ protocol we avoid unnecessary transmission by sending only

frames that are corrupted.

A) Stop-and-Wait ARQ

B) Go-Back-N ARQ

C) Selective-Repeat ARQ

D) none of the above

Page 58: Flow and Error Control With all Numerical -PYQs

In the _________ protocol we avoid unnecessary transmission by sending only

frames that are corrupted.

A) Stop-and-Wait ARQ

B) Go-Back-N ARQ

C) Selective-Repeat ARQ

D) none of the above

Page 59: Flow and Error Control With all Numerical -PYQs

In Go-Back-N ARQ, if 5 is the number of bits for the sequence number, then the

maximum size of the send window must be _____.

5

32

31

10

Page 60: Flow and Error Control With all Numerical -PYQs

In Go-Back-N ARQ, if 5 is the number of bits for the sequence number, then the

maximum size of the send window must be _____.

5

32

31

10

Page 61: Flow and Error Control With all Numerical -PYQs

In Go-Back-N ARQ, if 5 is the number of bits for the sequence number, then the

maximum size of the receive window must be _____.

a. 15

b. 16

c. 31

d. 1

Page 62: Flow and Error Control With all Numerical -PYQs

In Go-Back-N ARQ, if 5 is the number of bits for the sequence number, then the

maximum size of the receive window must be _____.

a. 15

b. 16

c. 31

d. 1

Page 63: Flow and Error Control With all Numerical -PYQs

In Selective Repeat ARQ, if 5 is the number of bits for the sequence number, then the

maximum size of the send window must be _____.

a. 15

b. 16

c. 31

d. 1

Page 64: Flow and Error Control With all Numerical -PYQs

In Selective Repeat ARQ, if 5 is the number of bits for the sequence number, then the

maximum size of the sender window must be _____.

a. 15

b. 16

c. 31

d. 1

Page 65: Flow and Error Control With all Numerical -PYQs

In Selective Repeat ARQ, if 5 is the number of bits for the sequence number, then the

maximum size of the receiver window must be _____.

a. 15

b. 16

c. 31

d. 1

Page 66: Flow and Error Control With all Numerical -PYQs

In Selective Repeat ARQ, if 5 is the number of bits for the sequence number, then the

maximum size of the receiver window must be _____.

a. 15

b. 16

c. 31

d. 1

Page 67: Flow and Error Control With all Numerical -PYQs

In GB3, If every 5th packet that is being transmitted is lost and if we have to

send 10 packets. Then how many transmission are required?

A 10

B 15

C 18

D 20

Page 68: Flow and Error Control With all Numerical -PYQs

In GB3, If every 5th packet that is being transmitted is lost and if we have to

send 10 packets. Then how many transmission are required?

A 10

B 15

C 18

D 20

Page 69: Flow and Error Control With all Numerical -PYQs

In GB4, If every 6th packet that is being transmitted is lost and if we have to send

10 packets. Then how many transmission are required?

A 15

B 18

C 17

D 20

Page 70: Flow and Error Control With all Numerical -PYQs

In GB4, If every 6th packet that is being transmitted is lost and if we have to send

10 packets. Then how many transmission are required?

A 15

B 18

C 17

D 20

Page 71: Flow and Error Control With all Numerical -PYQs

In GBN sender Window size = 10 and Tp = 49.5ms & Tt = 1ms and given Bandwidth = 1000 bps What

is the Efficiency of the protocol ?

50%

10%

20%

25%

Page 72: Flow and Error Control With all Numerical -PYQs

Efficiency = N/(1+2a), N = 10 (given), a = Tp/Tt = 49.5

Efficiency = 10/(1 + 2 * 49.5) = 10/100 = 0.1 or 10%

Throughput = Efficiency * Bandwidth

= 0.1 * 1000 = 100

Page 73: Flow and Error Control With all Numerical -PYQs

In GBN sender Window size = 10 and Tp = 49.5ms & Tt = 1ms and given Bandwidth = 1000 bps What

is the Efficiency of the protocol ?

50%

10%

20%

25%

Page 74: Flow and Error Control With all Numerical -PYQs

Station A uses 32 byte packets to transmit messages to station B using sliding

window protocol. The round trip delay between A and B is 40 milliseconds and

the bottleneck bandwidth on the path between A and B is 64 kbps. The

optimal window size of A is

20

10

30

40

UGC NET CS 2017 Jan – III

Page 75: Flow and Error Control With all Numerical -PYQs

Round Trip propagation delay = 40 ms

Frame size = 32 * 8 bits

Bottleneck Bandwidth = 64 kbps

Total data 40 ms * 64 kbps

= (40 * 10 ^ -3) * (64 bits * 10 ^3)

= 40 * 64 bits

= 40 * 64 / 8 bytes

= 320 bytes.

packet size 32 bytes.

number of packets = total data / packet size.

= 320 B / 32 B

= 10 packets.

Page 76: Flow and Error Control With all Numerical -PYQs

Station A uses 32 byte packets to transmit messages to station B using sliding

window protocol. The round trip delay between A and B is 40 milliseconds and

the bottleneck bandwidth on the path between A and B is 64 kbps. The

optimal window size of A is

20

10

30

40

UGC NET CS 2017 Jan – III

Page 77: Flow and Error Control With all Numerical -PYQs

In a fully-connected mesh network with 10 computers, total ______ number

of cables are required and ______ number of ports are required for each

device.

40,9

45,10

45,9

50,10

UGC NET CS 2016 July – II

Page 78: Flow and Error Control With all Numerical -PYQs

Since each two host need a cable so n(n-1)/2 cabels needed and n – 1 number of ports are required.

i.e. 10(10 – 1) / 2 = 5 * 9 = 45 cables.

9 number of ports are required for each device.

Page 79: Flow and Error Control With all Numerical -PYQs

In a fully-connected mesh network with 10 computers, total ______ number

of cables are required and ______ number of ports are required for each

device.

40,9

45,10

45,9

50,10

UGC NET CS 2016 July – II

Page 80: Flow and Error Control With all Numerical -PYQs

Assume that we need to download text documents at the rate of 100 pages

per minute. A page is an average of 24 lines with 80 characters in each line

and each character requires 8 bits. Then the required bit rate of the channel is _____.

(A) 1.636 Kbps

(B) 1.636 Mbps

(C) 3.272 Mbps

(D) 25.6 Kbps

UGC NET CS 2016 July – III

Page 81: Flow and Error Control With all Numerical -PYQs

100 pages , each page contain 24 line, each line have 80 character and each character weighted 8 bit, we have to download 100 pages per minute.

i.e. 100 * 24 * 80 * 8 / 60 = 25.6 kbps.

So, option (D) is correct.

Page 82: Flow and Error Control With all Numerical -PYQs

Assume that we need to download text documents at the rate of 100 pages

per minute. A page is an average of 24 lines with 80 characters in each line

and each character requires 8 bits. Then the required bit rate of the channel is _____.

(A) 1.636 Kbps

(B) 1.636 Mbps

(C) 3.272 Mbps

(D) 25.6 Kbps

UGC NET CS 2016 July – III

Page 83: Flow and Error Control With all Numerical -PYQs

Suppose we want to download text documents at the rate of 100 pages per

second. Assume that a page consists of an average of 24 lines with 80

characters in each line. What is the required bit rate of the channel?

192 kbps

512 kbps

1.248 Mbps

1.536 Mbps

UGC-NET CS 2017 Nov – III

Page 84: Flow and Error Control With all Numerical -PYQs

Downloading rate = 100 pages

= 100 pages *24 line * 80 character * 8 bits

= 1536000 bits per second

ie 1.536 Mbps.

Page 85: Flow and Error Control With all Numerical -PYQs

Suppose we want to download text documents at the rate of 100 pages per second. Assume that a

page consists of an average of 24 lines with 80 characters in each line. What is the required bit rate of

the channel?

192 kbps

512 kbps

1.248 Mbps

1.536 Mbps

UGC-NET CS 2017 Nov – III

Page 86: Flow and Error Control With all Numerical -PYQs

Suppose that the stop-and-wait protocol is used on a link with a bit rate of

64 kilobits per second and 20 milliseconds propagation delay. Assume that

the transmission time for the acknowledgment and the processing time at

nodes are negligible. Then the minimum frame size in bytes to achieve a link utilization of at least 50% is _________.

GATE 2015 SET 1

Page 87: Flow and Error Control With all Numerical -PYQs

Suppose that the stop-and-wait protocol is used on a link with a bit rate of

64 kilobits per second and 20 milliseconds propagation delay. Assume that

the transmission time for the acknowledgment and the processing time at

nodes are negligible. Then the minimum frame size in bytes to achieve a link utilization of at least 50% is _________.

GATE 2015 SET 1

Ans: (l>=320)

So minimum frame size 320.

Page 88: Flow and Error Control With all Numerical -PYQs

A link has a transmission speed of 106 bits/sec. It uses data packets of size 1000 bytes each. Assume

that the acknowledgement has negligible transmission delay, and that its propagation delay is the

same as the data propagation delay. Also assume that the processing delays at the nodes are

negligible. The efficiency of the stop-and-wait protocol in this setup is exactly 25%. The value of the

one-way propagation delay (in milliseconds) is ___________.

GATE 2015 SET 2

Page 89: Flow and Error Control With all Numerical -PYQs

A link has a transmission speed of 106 bits/sec. It uses data packets of size 1000 bytes each. Assume

that the acknowledgement has negligible transmission delay, and that its propagation delay is the

same as the data propagation delay. Also assume that the processing delays at the nodes are

negligible. The efficiency of the stop-and-wait protocol in this setup is exactly 25%. The value of the

one-way propagation delay (in milliseconds) is ___________.

GATE 2015 SET 2

Ans: 12 mili Sec

Page 90: Flow and Error Control With all Numerical -PYQs
Page 91: Flow and Error Control With all Numerical -PYQs
Page 92: Flow and Error Control With all Numerical -PYQs
Page 93: Flow and Error Control With all Numerical -PYQs
Page 94: Flow and Error Control With all Numerical -PYQs

Stop and Wait Protocol-

We have discussed-

•Stop and wait protocol is a simplest flow control protocol.

•Sender sends a data packet to the receiver and then waits for its

acknowledgement.

•On receiving the acknowledgement, sender sends the next data packet.

•Propagation Delay: Amount of time taken by a packet to make a physical journey from one router to

another router.

•Propagation Delay = (Distance between routers) / (Velocity of propagation)

•RoundTripTime (RTT) = 2* Propagation Delay

•TimeOut (TO) = 2* RTT

•Time To Live (TTL) = 2* TimeOut. (Maximum TTL is 180 seconds)

Useful Terms:

Page 95: Flow and Error Control With all Numerical -PYQs

NTA NET Dec 2019

Page 96: Flow and Error Control With all Numerical -PYQs

NTA NET Dec 2019

Page 97: Flow and Error Control With all Numerical -PYQs

NTA NET June 2019

Page 98: Flow and Error Control With all Numerical -PYQs
Page 99: Flow and Error Control With all Numerical -PYQs

NET June 2018

Page 100: Flow and Error Control With all Numerical -PYQs

NET June 2018

Page 101: Flow and Error Control With all Numerical -PYQs
Page 102: Flow and Error Control With all Numerical -PYQs
Page 103: Flow and Error Control With all Numerical -PYQs

NTA NET June 2019

Page 104: Flow and Error Control With all Numerical -PYQs

NTA NET June 2019

Page 105: Flow and Error Control With all Numerical -PYQs

Suppose that the stop-and-wait protocol is used on a link with a bit rate of

64 kilobits per second and 20 milliseconds propagation delay. Assume that

the transmission time for the acknowledgment and the processing time at

nodes are negligible. Then the minimum frame size in bytes to achieve a link utilization of at least 50% is _________.

GATE 2015 SET 1

Page 106: Flow and Error Control With all Numerical -PYQs

A link has a transmission speed of 106 bits/sec. It uses data packets of size 1000 bytes each. Assume

that the acknowledgement has negligible transmission delay, and that its propagation delay is the

same as the data propagation delay. Also assume that the processing delays at the nodes are

negligible. The efficiency of the stop-and-wait protocol in this setup is exactly 25%. The value of the

one-way propagation delay (in milliseconds) is ___________.

GATE 2015 SET 2

Page 107: Flow and Error Control With all Numerical -PYQs

Error Control in Networks

VRC - LRC - CRC - Checksum

Page 108: Flow and Error Control With all Numerical -PYQs

What is Error-Control in Networking?

While sending the data from the sender to the receiver there is a high possibility that the data may

get lost or corrupted. Error is a situation when the sender's data does not match the data at the

receiver's end. When an error is detected then we need to retransmit the data. So, there are various

techniques of error control in computer networks. In this blog, we will see all these techniques. So let's get started.

Error Control

Error Control in the data link layer is a process of detecting and retransmitting the data which has

been lost or corrupted during the transmission of data. Any reliable system must have a mechanism

for detecting and correcting such errors. Error detection and correction occur at both the transport

layer and the data link layer. Here we will talk about the data link layer and check bit by bit that if there

is any error or not.

Page 109: Flow and Error Control With all Numerical -PYQs

Types of error

Single bit Error: When there is a change in only one bit of the sender's data then it is called a single bit

error.

Example: If the sender sends 101(5) to the receiver but the receiver receives 100(4) then it is a single bit

error.

101(sent bits) → 100(received bits)

Burst Error: When there is a change in two or more bits of the sender’s data then it is called a burst

error.

Example: If the sender sends 1011(11) to the sender but the receiver receives 1000(8) then it is a burst

error.

1011(sent bits) → 1000(received bits)

Page 110: Flow and Error Control With all Numerical -PYQs

Phases in Error Control

•Error Detection: Firstly, we need to detect at the receiver end that the data received has an error or

not.

•Acknowledgement: If any error is detected the receiver sends a negative acknowledgement(NACK)

to the receiver.

•Retransmission: When the sender receives a negative acknowledgement or if any acknowledgement

is not received from the receiver sender retransmits the data again.

Error Detection

1.Vertical Redundancy Check

2.Longitudinal Redundancy Check

3.Circular Redundancy Check

4.CheckSum

Page 111: Flow and Error Control With all Numerical -PYQs

Redundancy

The central concept in detecting or correcting errors is 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. The concept of including extra

information in the transmission for error detection is a good one. But instead of

repeating the entire data stream, a shorter group of bits may be appended to the end

of each unit. This technique is called redundancy because the extra bits are redundant

to the information: they are discarded as soon as the accuracy of the transmission has

been determined.

Page 112: Flow and Error Control With all Numerical -PYQs

Vertical Redundancy Check(VRC)

In this method, a redundant bit called parity bit is added to the data. This parity bit is added such that the

number of 1’s in the data is even. This is called even parity checking. If the number of 1’s is even then

the bit to be added is 0. If the number of 1's is odd then the bit to be added is 1.

Some systems may also check for the odd number of 1’s. This is called odd parity

checking. If the number of 1’s is odd then the bit to be added is 0. If the number of

1's is even then the bit to be added is 1.

Example: We have a data 1100001. Now, this data is sent to the even parity generator which adds a

redundant bit to it by checking the number of 1's. The even parity generator will add a 1 as it has odd

numbers of 1’s. So, the data which is going to be transmitted is original data along with the parity bit

i.e. 11000011. At the receiver side, we have a checking function that checks if the number of 1’s is even or not.

Page 113: Flow and Error Control With all Numerical -PYQs
Page 114: Flow and Error Control With all Numerical -PYQs

Limitation of VRC

Suppose in the above example, if at the transmission time two bits are altered such that the receivers

receive the data as 10000001. The receiver will successfully accept this data. This is because the

checking function will check for an even number of 1’s and the received data will satisfy this condition.

So, VRC fails when there is an even number of changes in the data.

Page 115: Flow and Error Control With all Numerical -PYQs

Longitudinal Redundancy Check(LRC)

In LRC we use a block of codes as the parity bit. We will take each block of data and calculate the

parity bit longitudinally instead of vertically. The sender will send the original data along with the block of

parity bit generated. This can be understood by the example below.

Example: Suppose we have to send the data, 11100111 11011101 00111001 10101001. So we will

calculate the parity bit by using even parity checking. We will start from the zeroth position of each block

of bits and gradually move towards the higher positions. We take all the bits present in the zerothposition i.e 1, 1, 1, 1. Now, the output is decided according to the following two rules:

1.If there are even number of 1's then the output will be 0.

2.If there are odd numbers of 1's then the output will be 1.

As '4' 1's are present which is an even number so the output at the zeroth position will be 0 and so on

for the higher positions.

Page 116: Flow and Error Control With all Numerical -PYQs

The transmitted data will be 11100111 11011101 00111001 10101001 10101010.

Page 117: Flow and Error Control With all Numerical -PYQs

Limitation of LRC

Suppose in the above example, during transmission some of the bits get changed and the received data

is 11100111 11011101 00110011 10100011. If we calculate the parity bit for this received data then it will

again come out to be 10101010 at the receiver's end.

So even if the data bits have changed this error won't be detected at the receiver's end.

So, if two bits in one data unit are damaged and the two bits at the exact same

position in another data unit are damaged the LRC will not be able to detect it.

Page 118: Flow and Error Control With all Numerical -PYQs

2 Dimensional Parity Check

Page 119: Flow and Error Control With all Numerical -PYQs

Checksum

There are two processing methods involved in this. The sender generates the checksum and sends the

original data along with the checksum. The receiver end also generates the checksum from the received

data. If the generated sum at the receiver side is all zeroes then only the data is accepted.

The sender follows these steps:

1.Data is divided into k sections or blocks of given ‘n’ bits.

2.All the sections are added using 1’s complement(data).

3.The final sum is bitwise complemented(convert 0 to 1 and 1 to 0) to get the checksum.

4.The sender sends the original data along with the checksum.

The receiver follows the following steps:

1.Data is divided into k sections or blocks of given 'n' bits.

2.All the sections are added using 1’s complement(data+checksum).

3.The final sum is bitwise complemented(convert 0 to 1 and 1 to 0).

4.If the result is all zeros then it accepted else rejected.

Page 120: Flow and Error Control With all Numerical -PYQs

Example: We have to send the data where data is divided into four sections each of 8 bits. Suppose we

have to send 10110011 10101011 01011010 11010101. So, there are 32 bits and we will divide the whole 32 bit data into a group of 8 bits i.e. 4 groups.

In the sender's side

1.Take any two blocks of data and perform 1's complement arithmetic.

2.Take the next block of data and add it to the result of the last addition. Perform the addition until all

the blocks are added.

3.Take 1's complement of the last sum obtained. It is a checksum.

4.Transmit the original bits along with the checksum to the receiver's side.

Page 121: Flow and Error Control With all Numerical -PYQs
Page 122: Flow and Error Control With all Numerical -PYQs

In the receiver's side

1.Take any two blocks of data and perform 1's complement arithmetic.

2.Take the next block of data and add it to the result of the last addition. Perform the addition until all

the blocks are added.

3.Take 1's complement of the last sum obtained. If the complement is all zeros then only the data is

accepted. Here, the result is all zeros hence the receivers accept the data.

Page 123: Flow and Error Control With all Numerical -PYQs

Since the result is 00000000. So, the received data is correct.

Page 124: Flow and Error Control With all Numerical -PYQs

Cyclic Redundancy Check(CRC)

The cyclic redundancy check is based on binary division. The sender and the receiver both agree upon

a generator polynomial. A generator polynomial can be any polynomial expression. This generator

polynomial helps in finding the CRC generator. CRC bit(having the same number of bits as the CRC

generator) is generated at the sender's side by dividing the bit sequence of the data by the CRC

generator. Before dividing the bit sequence by the CRC generator we will append the original data

with n-1 bits of 0's assuming that the CRC generator has n bits. The sender will then append the data

with the CRC bit and send it to the receiver.

Example: Given any generator polynomial, we can find the CRC generator by taking the coefficient of each variable.

At the receiver end, the received bits are divided again by the CRC generator. If the remainder of the division is zero then the data is accepted else rejected.

Page 125: Flow and Error Control With all Numerical -PYQs

Example: We have our data as 100100. The generator Polynomial is as in the above explanation i.e.

1.x^3+1.x^2+0.x^1+1.x^0. So, our CRC generator will be 1101(4 bits). Now, we have to append the

original data with n-1 numbers of 0’s where 'n' is the number of bits in the CRC generator. Here n is 4.

So, the dividend is 100100000(i.e. 100100 and 000) and the divisor is 1101. Now while dividing we

will perform the XOR operation as follows. This division will be performed on both the sender and

receiver sides. For the receiver side, the divisor would be the same and the dividend would be the

original data along with the CRC bits. If the remainder at the receiver side is zero then only the data is accepted.

Page 126: Flow and Error Control With all Numerical -PYQs