0% found this document useful (0 votes)
10 views28 pages

Unit - 2 CN

Uploaded by

parnikakakollu
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)
10 views28 pages

Unit - 2 CN

Uploaded by

parnikakakollu
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/ 28

UNIT - 2

1.What is an error? Explain types of error?


In computer networks, an error occurs when the data received at the
destination differs from the data that was originally transmitted. This
discrepancy can arise from various issues during data transmission, such as
noise, interference, or hardware malfunctions. Errors can manifest as bit
errors, where individual bits are flipped, or packet errors, where entire data
packets are lost, corrupted, or duplicated.
(Or)

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.
What causes errors?
 Noise:
External factors like electromagnetic interference or electrical noise can disrupt the
signal during transmission, causing bits to flip.
 Interference:
Signals from other sources can interfere with the intended signal, leading to errors.
 Hardware malfunctions:
Faulty network equipment or cables can also introduce errors.
 Network congestion:
Overloaded networks can cause packets to be dropped or delayed, leading to errors
at the receiving end.
Types of errors:
 Single-bit error: A single bit in the transmitted data is flipped (e.g., a 0 becomes a 1 or
vice versa).
 Multiple-bit error: More than one bit in the transmitted data is flipped.
 Burst error: A sequence of consecutive bits is corrupted.
Consequences of errors:
 Data corruption: Received data may be incorrect or unusable, leading to application
errors or system crashes.
 Network performance degradation: Retransmission of corrupted data can slow down
network speeds.
Error detection and correction:
 Error detection:
Techniques like checksums, CRCs, and parity checks are used to identify the
presence of errors.
 Error correction:
Techniques like ARQ (Automatic Repeat Request) and FEC (Forward Error
Correction) are used to correct detected errors

.
2.write crc? with example
A Cyclic Redundancy Check (CRC) is an error-detecting code used to verify the
integrity of digital data, most commonly in digital networks and storage devices
. The process involves treating binary data as a polynomial and performing a modulo-2
division, which uses the XOR operation instead of subtraction. The remainder of this
division, the CRC, is appended to the original data and sent to the receiver

How CRC works


At the sender's end:

1. Define a generator polynomial: Both the sender and receiver must agree on a
predefined divisor, or generator polynomial, to use for the calculation. This polynomial is
represented in binary format. The number of CRC bits generated will be one less than the
number of bits in the divisor.
2. Append zeros: The sender appends a number of zeros equal to the highest degree of the
generator polynomial to the end of the original data.
3. Perform binary division: The modified data is divided by the generator polynomial
using modulo-2 binary division.
4. Append the remainder: The remainder from this division is the CRC checksum. The
sender replaces the appended zeros with this CRC checksum to form the final transmitted
data.

At the receiver's end:

1. Divide the received data: The receiver performs the same modulo-2 division on the
entire received data (the original data + the appended CRC) using the same generator
polynomial.
2. Check the remainder:
o If the remainder is zero, the data is considered error-free.
o If the remainder is not zero, the receiver knows an error occurred during
transmission.

CRC example
Assume we want to transmit the message 110101, and our agreed-upon generator polynomial is

x3+x2+1x cubed plus x squared plus 1


𝑥3+𝑥2+1
.
Step 1: Get the binary divisor
The generator polynomial

x3+x2+1x cubed plus x squared plus 1


𝑥3+𝑥2+1
has powers of 3, 2, and 0 (

x0x to the 0 power


𝑥0
is the constant 1). This translates to the binary divisor 1101.
Step 2: Append zeros to the data
The divisor has 4 bits, so we append

4−1=34 minus 1 equals 3


4−1=3
zeros to the original data 110101.

 Data: 110101
 Modified data: 110101000
Step 3: Perform modulo-2 division
Divide the modified data 110101000 by the divisor 1101 using the XOR operation.
100101
_______
1101|110101000
-1101
-----
000001000
- 0000
-------
1000
- 1101
-------
1010
- 1101
-------
1110
- 1101
-------
110
The remainder is 110, which is the CRC checksum.
Step 4: Transmit the data
The sender replaces the appended zeros with the CRC checksum.

 Original data: 110101


 CRC: 110
 Transmitted data: 110101110

Checking for errors at the receiver


The receiver performs the same modulo-2 division on the full transmitted data 110101110 using
the divisor 1101.
100101
_______
1101|110101110
-1101
-----
000001110
- 0000
-------
1110
- 1101
-------
1101
- 1101
-------
000
Since the remainder is 000, the receiver confirms that the data was transmitted without errors. If
an error had occurred, the remainder would have been non-zero.
explain hamming ?code with explain?
Thinking
Kicking off 6 searches
Looking at 53 sites
3.Hamming Code: What is it? (Formula & Explanation) | Electrical4U
Visit

Images may be subject to copyright. Learn more


Share
Save
Hamming code is an error-correcting technique that adds redundant bits to a data message to
detect and correct single-bit errors that can occur during transmission. It is widely used to ensure
data accuracy in digital communication and storage, such as in computer memory (ECC RAM)
and satellite communications.
The key to the Hamming code is the strategic placement of these extra "parity" or "check" bits at
positions that are powers of 2 (1, 2, 4, 8, etc.). Each parity bit is responsible for checking the
parity (even or odd count of 1s) for a specific group of bits in the message. This setup allows the
receiver to pinpoint the exact location of a single error by checking all the parity bits.
Encoding a Hamming code
Let's walk through an example of encoding the 4-bit data message 1011 into a 7-bit Hamming
code using even parity.
Step 1: Determine the number of redundant bits
The number of redundant bits (

rr
𝑟
) needed for a given number of data bits (

dd
𝑑
) is determined by the formula

2r≥d+r+12 to the r-th power is greater than or equal to d plus r plus 1


2𝑟≥𝑑+𝑟+1
.

 For our 4-bit data message (

d=4d equals 4

𝑑=4

), we can find
rr

o If

r=3r equals 3

𝑟=3

23≥4+3+1⇒8≥82 cubed is greater than or equal to 4 plus 3 plus 1 implies 8 is


greater than or equal to 8

23≥4+3+1⇒8≥8

. This is true, so we need 3 redundant bits.

The resulting message, or codeword, will have a total of

d+r=7d plus r equals 7


𝑑+𝑟=7
bits.
Step 2: Place parity and data bits
Assign the parity bits (

P1,P2,P4cap P sub 1 comma cap P sub 2 comma cap P sub 4


𝑃1,𝑃2,𝑃4
) to positions that are powers of 2, and the data bits (

D3,D5,D6,D7cap D sub 3 comma cap D sub 5 comma cap D sub 6 comma cap D sub 7
𝐷3,𝐷5,𝐷6,𝐷7
) to the remaining positions.
Bit
1 2 3 4 5 6 7
Position

Type P1cap P P2cap P D3cap D P4cap P D5cap D D6cap D D7cap D


sub 1 sub 2 sub 3 sub 4 sub 5 sub 6 sub 7
𝑃1 𝑃2 𝐷3 𝑃4 𝐷5 𝐷6 𝐷7
Data
1 0 1 1
Message
Step 3: Calculate the parity bits
Using even parity, each parity bit is calculated to ensure the total number of 1s in its covered bit
positions is even.

P1cap P sub 1

𝑃1

checks positions 1, 3, 5, 7: (Binary representation of each position has a 1 in the least


significant bit).

o Bits are at positions:

P1,D3,D5,D7cap P sub 1 comma cap D sub 3 comma cap D sub 5 comma cap D
sub 7

𝑃1,𝐷3,𝐷5,𝐷7

o Known values:

P1,1,0,1cap P sub 1 comma 1 comma 0 comma 1

𝑃1,1,0,1

o Current number of 1s: 2. This is already an even number, so


P1=0cap P sub 1 equals 0

𝑃1=0

P2cap P sub 2

𝑃2

checks positions 2, 3, 6, 7: (Binary representation has a 1 in the second least significant


bit).

o Bits are at positions:

P2,D3,D6,D7cap P sub 2 comma cap D sub 3 comma cap D sub 6 comma cap D
sub 7

𝑃2,𝐷3,𝐷6,𝐷7

o Known values:

P2,1,1,1cap P sub 2 comma 1 comma 1 comma 1

𝑃2,1,1,1

o Current number of 1s: 3. This is an odd number, so

P2=1cap P sub 2 equals 1

𝑃2=1

to make it even.

P4cap P sub 4

𝑃4

checks positions 4, 5, 6, 7: (Binary representation has a 1 in the third least significant


bit).

o Bits are at positions:

P4,D5,D6,D7cap P sub 4 comma cap D sub 5 comma cap D sub 6 comma cap D
sub 7

𝑃4,𝐷5,𝐷6,𝐷7

o Known values:

P4,0,1,1cap P sub 4 comma 0 comma 1 comma 1

𝑃4,0,1,1

o Current number of 1s: 2. This is already an even number, so

P4=0cap P sub 4 equals 0

𝑃4=0

The final codeword


The encoded Hamming codeword for 1011 is 0110011.
Bit Position 1 2 3 4 5 6 7
Codeword 0 1 1 0 0 1 1
Decoding and error correction
Now, let's assume the codeword 0110011 is transmitted, but the bit at position 5 is flipped due to
noise during transmission. The received message is 0110111.
Step 1: Re-calculate the parity bits at the receiver
The receiver re-calculates the parity bits using the same groups as the sender, based on the
received data.

 Check parity for

P1cap P sub 1

𝑃1

(positions 1, 3, 5, 7):

oReceived bits: 0, 1, 1, 1
oNumber of 1s: 3. This is an odd number, which is an error.
oSyndrome bit 1: 1
 Check parity for

P2cap P sub 2

𝑃2

(positions 2, 3, 6, 7):

oReceived bits: 1, 1, 1, 1
oNumber of 1s: 4. This is an even number, which is correct.
oSyndrome bit 2: 0
 Check parity for

P4cap P sub 4

𝑃4

(positions 4, 5, 6, 7):

o Received bits: 0, 1, 1, 1
o Number of 1s: 3. This is an odd number, which is an error.
o Syndrome bit 4: 1
Step 2: Determine the error location
The calculated parity bits form a "syndrome" in reverse order (

P4,P2,P1cap P sub 4 comma cap P sub 2 comma cap P sub 1


𝑃4,𝑃2,𝑃1
) that directly points to the position of the error.

 Syndrome binary: 101


 Convert to decimal:

1⋅22+0⋅21+1⋅20=4+0+1=51 center dot 2 squared plus 0 center dot 2 to the first power
plus 1 center dot 2 to the 0 power equals 4 plus 0 plus 1 equals 5

1⋅22+0⋅21+1⋅20=4+0+1=5

The syndrome value of 5 indicates that the error occurred at the 5th bit position.
Step 3: Correct the error
To correct the error, the receiver simply flips the bit at the identified position.

 The original bit at position 5 was 0. The received bit was 1.


 The receiver flips the bit back to 0, restoring the original data
6.what is HDLC?explain?
High-Level Data Link Control (HDLC) generally provides flexibility to simply
support all options that are possible in various data transfer modes and
configurations. To provide flexibility, HDLC basically uses and explains three
different types of frames. Type of frame is basically determined by control
field of frame. Each type of frame generally serves as an envelope for
transmission of various types of messages. These three different classes of
frames used in HDLC are given below.

field
1. I-frame : I-frame stands for Information frames. This frame is generally
used for transporting user data from network layer. These frames actually
carry actual data or information of upper layer and some control information.
This frame carries data along with both send sequence number and an
acknowledgment number. It can also be used to piggyback
acknowledgement information in case of ABM (Asynchronous Balanced
Mode). The first bit of this frame of control field is 0.
2. S-frame : S-frame stands for Supervisory frames. These frames are
basically required and essential for error control and flow control. They also
provide control information. It contains or includes only an Acknowledgment
number. First two bit of this frame of control field is 10. S-frame does not
have any information fields. This frame contains send and receive sequence
numbers.

Example -
 Receive Ready (RR)
 Receive Not Ready (RNR)
 Reject on frame N(R) (REJ)
 Selective reject on N(R) (SREJ), etc.
3. U-frame : U-frame stands for Unnumbered frames. These frames are also
required in various functions like link setup and disconnections. These
frames basically support control purposes and are not sequenced. First, two-
bit of this frame of control field is 11. Some U-frame contains an information
field depending on the type. These frames are also used for different
miscellaneous purposes along with link management. U-frame is required for
managing link itself. This frame does not include any type of
acknowledgment information i.e. in turn it includes or is contained in
sequence number. These frames are generally reserved for system
management.
Example -
 Set Normal Response Mode (SNRM)
 Set Asynchronous Response Mode (SARM)
 Set Asynchronous Balanced Mode (SABM)
 Unnumbered Polling (UP)
 Unnumbered Acknowledge (UA), etc.

7. Explain about slidding window protocols?

The Sliding Window protocol is a data link layer and TCP protocol that allows
a sender to transmit multiple data frames to a receiver before needing an
acknowledgment for each one, improving efficiency over the simpler stop-and-
wait protocol. It uses an "imaginary window" to manage which frames have
been sent and which are awaiting acknowledgment, and it relies on sequence
numbers to order frames and detect lost or duplicate packets at the receiver.

How it Works
1. 1. Sender and Receiver Windows:
Both the sender and receiver maintain an "imaginary box" or window.
 The sender's window holds frames that have been sent but not yet acknowledged.
 The receiver's window holds frames that have been received but not yet
acknowledged or are awaiting further frames to be considered in sequence.
2. 2. Sequence Numbers:
Each data frame is assigned a unique sequence number. This allows the receiver to:
 Order frames: correctly, even if they arrive out of sequence.
 Identify missing frames .
 Detect duplicate frames .
3. 3. Window Sliding:
 The sender can send a number of frames up to its window size.
 Once an acknowledgment (ACK) for a frame arrives, the sender's window "slides" to
the next position, allowing it to send a new frame.
 The receiver only accepts frames that are within its current window.
4. 4. Reliable Delivery:
The protocol ensures reliable delivery by requiring acknowledgments and using
sequence numbers to manage the flow and prevent data loss or duplication.
Key Advantages
 Increased Efficiency:
By sending multiple frames at once, the protocol keeps the communication channel
busy, leading to higher throughput and faster data transmission compared to single-
frame protocols like stop-and-wait.
 Reliable Data Transfer:
It provides reliable, in-order delivery of data frames by using sequence numbers and
acknowledgments to handle lost or damaged packets.
 Full-Duplex Communication:
The mechanism supports full-duplex transmission, allowing data to be sent and
received concurrently.
Types of Sliding Window Protocols
The general concept of a sliding window has variations, most notably the two
main error control methods:
 Go-Back-N ARQ:
If a frame is lost, the receiver rejects all subsequent frames, and the sender must
retransmit the lost frame and all following frames.
 Selective Repeat ARQ:
If a frame is lost, the receiver can still accept subsequent frames if they are within its
window. The sender only retransmits the specific lost frame(s).
8.Explain about ppp transition phase? Authentication and multiplexing
protocol?
Point-to-Point Protocol (PPP) was generally invented by Internet Engineering
Task Force (IETF) simply to create and develop a data link protocol for point
to point lines that can be helpful in solving many of the problems that are
present in SLIP. PPP can operate on different DTE/DCE (Data Terminal
Equipment/Data Circuit-Terminating Equipment) physical interfaces along
with asynchronous serial, synchronous serial, ISDN, etc. It can also operate
on various network layer protocols such as IPX, AppleTalk, whereas on the
other hand, SLIP only operates on TCP/IP-based protocols. All of the point-
to-point links that utilize PPP protocol needs to be able to support full-duplex
communication. PPP Phase Diagram : PPP connection generally goes
through different phases that can be seen in Transition Phase Diagram as
shown below :
1. Dead - In this phase, link basically starts and stops. Carrier Detection is
an event that is used to indicate that physical layer is ready, and now the
PPP will proceed towards establishment phase. Disconnection from
modem line must bring back the line or connection to this phase. LCP
automation is usually in the initial or starting phase during this phase.

2. Establish - Link then proceeds towards this phase after the presence of
peer is being detected. When one of nodes starts communication, then
connection goes into this phase. By the exchange of LCP Frames or
packets, all of configuration parameters are negotiated. If somehow
negotiation meets at a point, link is developed and then system goes
either into authentication protocol or network layer protocol. The end of
this phase simply indicates open state of LCP.
3. Authenticate - In PPP, authentication is optional. Peer authentication can
be requested by one or both of the endpoints. PPP enters authentication
phase if Password Authentication Protocol (PAP) or Challenge-
Handshake Authentication Protocol (CHAP) is configured.
4. Network - PPP basically sends or transmits NCP packets to choose and
configure one or more network-layer protocols such as IP, IPX, etc. once
LCP state is being open and link or connection is established. This is
especially required to configure the appropriate network layer. In this
phase, Each of Network control protocols might be opened and closed at
any time and negotiation for these protocols also takes place. At network
layer, PPP also supports various protocols due to which PPP specifies
that two of nodes establish or develop a network layer agreement before
data is exchanged at network layer.
5. Open - Usually transferring of data takes place in this phase. Once
endpoints want to end the connection, connection is then transferred to
terminate phase, till then connection remains in this phase.
6. Terminate - Connection can be terminated at any point of time as per the
request of either of the endpoints. LCP is basically required to close or
terminate link through the exchange of terminate packets.

9. Difference between error detection and error correction


The main difference between error detection and error correction is in their capabilities:
error detection simply identifies that an error has occurred, while error correction can
both detect and fix the error. Both processes rely on adding extra, redundant
information to the original data, which the receiver can then use to check the data's
integrity. Comparison table

Feature Error Detection Error Correction

Primary To determine if data has been corrupted. To detect errors and reconstruct the original, error-free
Goal data.

Complexity Simpler to implement and computationally less More complex due to advanced coding schemes and
intensive. higher computational requirements.
Overhead Generally requires less additional data Requires more redundant data to not only detect but also
(redundancy). pinpoint the location of errors.

Latency Lower, as it only requires a consistency check. Higher, because it needs to decode and correct the data.

Action on An error is flagged. The typical action is to The receiver automatically corrects the error on its own
Error request that the sender re-transmits the data using the redundant information, without needing a
(a process known as Automatic Repeat retransmission (a process known as Forward Error
Request or ARQ). Correction or FEC).

Common Used in scenarios where retransmission is Used in one-way communication or environments where
Uses feasible, such as network protocols like TCP. retransmission is difficult or impractical, such as satellite
communication, real-time video streaming, or data stored
on CDs and DVDs.

Examples Parity checks, checksums, and Cyclic Hamming codes, Reed-Solomon codes, and Turbo
Redundancy Checks (CRC). codes.

10.stop and wait protocol?


The Stop and Wait protocol is a basic data link layer protocol used for reliable
data transmission over noisy channels. It ensures reliable data delivery by
requiring the sender to wait for an acknowledgment (ACK) from the receiver
before sending the next data packet. This mechanism helps in managing data
flow and detecting errors.
How it works:
1. Sender sends a packet: The sender transmits a data packet to the receiver.
2. Sender waits for ACK: The sender then stops sending further packets and waits for an
acknowledgment from the receiver.
3. Receiver acknowledges: The receiver processes the received packet and sends back
an ACK (or a negative acknowledgment NAK).
4. Sender sends next packet: If the ACK is received, the sender sends the next data
packet. If a NAK is received, the sender retransmits the previous packet.
5. Process repeats: This process repeats until all data packets are successfully
transmitted.
Key Features:
 Simplicity: It's a straightforward protocol, easy to understand and implement.
 Flow Control: Ensures that the receiver can handle the incoming data rate, preventing
buffer overflow.
 Error Detection: Can detect errors using checksums or other mechanisms.
 Reliability: Provides reliable data transmission by retransmitting lost or corrupted
packets.
 Unidirectional: Supports unidirectional data transmission (either sending or receiving
at a time).
Advantages:
 Ease of implementation: Simple logic and minimal hardware requirements.
 Accurate: Ensures data is sent and received in the correct order.
Disadvantages:
 Low throughput:
Due to the stop-and-wait nature, it can be slow, especially over long distances or with
noisy channels.
11.Go-Back-N (GBN) Protocol?

The Go-Back-N (GBN) protocol is a sliding window protocol used in


networking for reliable data transmission. It is part of the Automatic Repeat
reQuest (ARQ) protocols, which ensure that data is correctly received and
that any lost or corrupted packets are retransmitted.
For example, if packets 1, 2, 3, 4, and 5 are sent and packet 3 gets lost, the
sender will have to resend packets 3, 4, and 5, even if 4 and 5 were
received.
The three main characteristic features of GBN are:
1. Sender Window Size (WR)
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 the Stop and Wait protocol.
Efficiency Of GBN = N/(1+2a)
where,
a = Tp/Tt
Tp = Propagation Delay
Tt = Transmission Delay of sender
What will be the efficiency if processing delay, queuing delay and
transmission delay of acknowledgement is not zero?
Efficiency = N * (Useful time) / (Total Time)
where, useful time=Tt
Total time = Tt + 2 * Tp + Pr + Pq + Tt(ack)
where,
Tt =Transmission delay of sender side
Tp = Propagation Delay
Pr = Processing Delay
Pq = Queuing Delay
Tt(ack) = Transmission Delay of Acknowledgement
If B is the bandwidth of the channel, then
Effective Bandwidth or Throughput
= Efficiency * Bandwidth
= (N/(1+2a)) * B
2. Receiver Window Size (WR)
In the GB-N the receiver window size is one always. i.e. W R is always 1 in
GBN.
3. Acknowledgements
In flow control, acknowledgments (ACKs) are signals sent by the receiver to
the sender to confirm that data packets have been successfully received.
When the sender transmits data, it waits for an acknowledgment before
sending more. This process helps ensure that data is received correctly. If an
acknowledgment isn't received within a certain time, the sender assumes the
packet was lost and retransmits it.
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 then the reliability is high here but a disadvantage is that
traffic is also high since for every packet we are receiving independent
ack.
Working of GB-N Protocol
Now what exactly happens in GBN, we will explain with a help of example.
Consider the diagram given below. We have sender window size of 4.
Assume that we have lots of sequence numbers just for the sake of
explanation. Now the sender has sent the packets 0, 1, 2 and 3. After
acknowledging the packets 0 and 1, receiver is now expecting packet 2 and
sender window has also slided to further transmit the packets 4 and 5. Now
suppose the packet 2 is lost in the network, Receiver will discard all the
packets which sender has transmitted after packet 2 as it is expecting
sequence number of 2.
On the sender side for every packet send there is a time out timer which will
expire for packet number 2. Now from the last transmitted packet 5 sender
will go back to the packet number 2 in the current window and transmit all
the packets till packet number 5. That’s why it is called Go Back N. Go back
means sender has to go back N places from the last transmitted packet in
the unacknowledged window and not from the point where the packet is lost.
Relationship Between Window Size and Sequence Numbers
The window size and sequence numbers in a sliding window protocol, like
Go-Back-N or Selective Repeat, are closely related.
 The window size determines how many packets the sender can transmit
without needing an acknowledgment. It’s like a limit on how much data
can be sent before the sender has to stop and wait for confirmation.
 Sequence numbers are used to label packets so the receiver knows their
order and can detect any missing packets.
The window size should be smaller than or equal to the range of
available sequence numbers. If the window size is too large compared to
the sequence number range, the receiver might get confused because the
same sequence number could be reused before the first one is
acknowledged. This would make it hard to know if a packet is new or a
duplicate.
Relation between window size and sequence number is given by the
formula:
Ws + WR <= ASN
where,
W s is sender window size and W R is receiver window size, and ASN is
available sequence number.
Ws + 1 <= ASN because WR = 1 in GB-N protocol
So minimum sequence numbers required in GBN = N + 1
Bits Required in GBN = ⌈ log2 (N + 1)⌉
The extra 1 is required in order to avoid the problem of duplicate packets.
Example of GB-N Protocol
Consider an Example of GB4.
 Sender window size is 4 therefore we require a minimum of 4 sequence
numbers to label each packet in the window.
 Now suppose receiver has received all the packets(0, 1, 2 and 3 sent by
sender) and hence is now waiting for packet number 0 again (We can not
use 4 here as we have only 4 sequence numbers available since N = 4).
 Now suppose the cumulative ack for the above 4 packets is lost in the
network.
 On sender side, there will be timeout for packet 0 and hence all the 4
packets will be transmitted again.
 Problem now is receiver is waiting for new set of packets which should
have started from 0 but now it will receive the duplicate copies of the
previously accepted packets.
 In order to avoid this, we need one extra sequence number.
 Now the receiver could easily reject all the duplicate packets which were
starting from 0 because now it will be waiting for packet number 4 (We
have added an extra sequence number now).
This is explained with the help of the illustrations below. Trying with
Sequence numbers 4.
Now, trying with one extra sequence number.

Now it is clear as to why we need an extra 1 bit in the GBN protocol.


Advantages of GBN Protocol
 Simple to implement and effective for reliable communication.
 Better performance than stop-and-wait protocols for error-free or low-error
networks.
Disadvantages of GBN Protocol
 Inefficient if errors are frequent, as multiple frames might need to be
retransmitted unnecessarily.
 Bandwidth can be wasted due to redundant retransmissions.

You might also like