Anda di halaman 1dari 15

Lab 5: Implementation and study of Go back N and Selective Repeat

Protocol
5.1 Introduction:
The purpose of this experiment is to introduce you to the basics of error correction, time outs
and state machines. In this lab, you will be able to provide reliable data transfer between two nodes
over an unreliable network using Go back N and selective repeat protocol.
5.2 Hardware Requirement:

3PCs with NIU card


Network Emulation Unit
Jumper Cables

5.3 Background
Go-Back-N ARQ is a specific instance of the Automatic Repeat-request (ARQ) Protocol,
in which the sending process continues to send a number of frames specified by a window size
even without receiving an ACK packet from the receiver. It is a special case of the general sliding
window protocol with the transmit window size of N and receive window size of 1.
The receiver process keeps track of the sequence number of the next frame it expects to receive,
and sends that number with every ACK it sends. The receiver will ignore any frame that does not
have the exact sequence number it expects whether that frame is a "past" duplicate of a frame it
has already ACK'ed [1] or whether that frame is a "future" frame past the last packet it is waiting
for. Once the sender has sent all of the frames in its window, it will detect that all of the frames
since the first lost frame are outstanding, and will go back to sequence number of the last ACK it
received from the receiver process and fill its window starting with that frame and continue the
process over again.
Go-Back-N ARQ is a more efficient use of a connection than Stop-and-wait ARQ, since unlike
waiting for an acknowledgement for each packet, the connection is still being utilized as packets
are being sent. In other words, during the time that would otherwise be spent waiting, more packets
are being sent. However, this method also results in sending frames multiple times if any frame
was lost or damaged, or the ACK acknowledging them was lost or damaged, then that

frame and all following frames in the window (even if they were received without error) will be
re-sent. To avoid this, Selective Repeat ARQ can be used.
Selective Repeat ARQ / Selective Reject ARQ is a specific instance of the Automatic
Repeat-request (ARQ) Protocol. It may be used as a protocol for the delivery and
acknowledgement of message units, or it may be used as a protocol for the delivery of subdivided
message sub-units.
When used as the protocol for the delivery of messages, the sending process continues to send a
number of frames specified by a window size even after a frame loss. Unlike Go-Back-N ARQ,
the receiving process will continue to accept and acknowledge frames sent after an initial error;
this is the general case of the sliding window protocol with both transmit and receive window sizes
greater than 1.
The receiver process keeps track of the sequence number of the earliest frame it has not received,
and sends that number with every ACK it sends. If a frame from the sender does not reach the
receiver, the sender continues to send subsequent frames until it has emptied its window. The
receiver continues to fill its receiving window with the subsequent frames, replying each time with
an ACK containing the sequence number of the earliest missing frame. Once the sender has sent
all the frames in its window, it re-sends the frame number given by the ACKs, and then continues
where it left off.
The size of the sending and receiving windows must be equal, and half the maximum sequence
number (assuming that sequence numbers are numbered from 0 to n1) to avoid
miscommunication in all cases of packets being dropped. To understand this, consider the case
when all ACKs are destroyed. If the receiving window is larger than half the maximum sequence
number, some, possibly even all, of the packages that are resent after timeouts are duplicates that
are not recognized as such. The sender moves its window for every packet that is acknowledged.
When used as the protocol for the delivery of subdivided messages it works somewhat differently.
In non-continuous channels where messages may be variable in length, standard ARQ or Hybrid
ARQ protocols may treat the message as a single unit. Alternately selective retransmission may be
employed in conjunction with the basic ARQ mechanism where the

message is first subdivided into sub-blocks (typically of fixed length) in a process called Packet
segmentation. The original variable length message is thus represented as a concatenation of a
variable number of sub-blocks. While in standard ARQ the message as a whole is either
acknowledged (ACKed) or negatively acknowledged (NAKed), in ARQ with selective
transmission the NAKed response would additionally carry a bit flag indicating the identity of each
sub-block successfully received. In ARQ with selective retransmission of sub-divided messages
each retransmission diminishes in length, needing to only contain the sub-blocks that were NAKed.

In most channel models with variable length messages, the probability of error-free reception
diminishes in inverse proportion with increasing message length. In other words it's easier to
receive a short message than a longer message. Therefore standard ARQ techniques involving
variable length messages have increased difficulty delivering longer messages, as each repeat is
the full length. Selective retransmission applied to variable length messages completely eliminates
the difficulty in delivering longer messages, as successfully delivered sub-blocks are retained after
each transmission, and the number of outstanding sub-blocks in following transmissions
diminishes.
5.4 Pre lab questions
1. Explain the mechanism of Go back N ARQ.
2. In sliding window flow control if the window size is 63 what is the range of sequence numbers?
3. For a sliding window of size n-1 (n-sequence numbers) there can be a maximum of ------frames sent but unacknowledged.
4. Differentiate between bit rate and baud rate.
5. Explain the mechanism of selective repeat ARQ.
6. Compare selective repeat and Goback N ARQ schemes.

Calculation of Practical Throughput:

Model Tabulation:
Go-Back N Protocol

5.5 Procedure:
5.5.1 Go Back N Protocol

1. Click on the Sliding Window GBN icon

2. Click the Configuration button

from the desktop on both PCs.

in the window in both the Pcs.

Setting the configuration menu:

Note: The No of Packets parameter defines the window size.

Model Graph:
Go-Back N Protocol

Observation Table :

3. Set the Inter Packet Delay to 400msecs

4. Click OK button and Download the driver to the NIU using the BOOT

button

command.Booting from any one of the applications is enough.

5. Run the experiment by clicking button

or by choosing RUN _ Start from each

application.

6. Set the Timeout Value to 1500 ms

7. Note down the no of successfully Transmitted Packets.


8. Repeat the above steps for various time out values and plot the graph between timeout Value
&Throughput. Find the optimum timeout value from the plot.
9. Explain why the throughput is less compared to CSMACD protocol.

Calculation of Practical Throughput:

Model Tabulation:

Model Graph:
Selective Repeat Protocol

5.5.2 Selective Repeat Protocol

1. Click on the Selective Repeat icon

2. Click the Configuration button

from the desktop on both PCs.

in the window in both the Pcs.

Setting the configuration menu:

Note: The No of Packets parameter defines the window size.

Observation Table:

3. Set the Inter Packet Delay to 400msecs


4. Click OK button and Download the driver to the NIU using the BOOT
command.Booting from any one of the applications is enough.

button

5. Run the experiment by clicking button


or by choosing RUN _ Start from each
application.
6.Set the Timeout Value to 1000 ms
7. Note down the no of successfully Transmitted Packets.
8. Repeat the above steps for various time out values and plot a graph between timeout Value &
Throughput. Find the optimum timeout value from the plot.

5.6 Post lab questions


1. Draw the sender and receiver windows for a system using Go-back-N ARQ given the following
.
a. Frame 0 is sent, frame 0 is acknowledged.
b. Frames 1 and 2 are sent, frames 1 and 2 are acknowledged.
c. Frame 3,4 and 5 are sent, NAK4 is received.
d. Frame 4,5,6 and 7 are sent; frames4 through 7 are acknowledged.

2. A sliding window protocol uses a sliding window of size15. How many bits are needed to
define the sequence numbers?
3. Draw the sender and receiver windows for a system using selective repeat ARQ given the
following.
a. Frame 0 is sent, frame 0 is acknowledged.
b. Frames 1 and 2 are sent, frames 1 and 2 are acknowledged.
c. Frame 3,4 and 5 are sent, NAK4 is received.
d. Frame 4, 5,6 and 7 are sent; frames4 through 7 are acknowledged.
4.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3

a. Show the window after the sender has sent packets 0 to 11 and has received ACK8.
The receiver has sent ACK6 and ACK9 but ACK6 is lost. Show the sender window

Anda mungkin juga menyukai