Professional Documents
Culture Documents
the first protocol which is GBN in terms of three main characteristic features and in the
last part we will be discussing SR as well as comparison of both these protocols
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.
Efficiency Of GBN = N/(1+2a) Where a = Tp/Tt
If B is the bandwidth of the channel, then Effective Bandwidth or Throughput =
Efficiency * Bandwidth = (N/(1+2a)) * B.
Receiver Window Size (WR) WR is always 1 in GBN.
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.
Acknowledgements
There are 2 kinds of acknowledgements namely :
Cumulative ACK – One acknowledgement is used for many packets. Main
advantage is traffic is less. Disadvantage is less reliability as if one ack is 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 disadvantage is that traffic is also
high since for every packet we are receiving independent ack.
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.
Selective Repeat
Go-Back-N Protocol is
4. protocol is more
less complex. complex.
In selective Repeat
In Go-Back-N Protocol, protocol, receiver side
5. neither sender nor at needs sorting to sort the
receiver need sorting. frames.
Go back N is more often used than other protocols.
SR protocol is less used because of its complexity.
Stop and Wait ARQ is less used because of its low efficiency.
Protocols at data link layer like HDLC (Low level protocols) use Go back N.
This is because-
Bandwidth is high
CPU is very busy doing routing job
Error rate is low since out of order packets are not possible in wired medium
Note-02:
Protocols at transport layer like TCP (High level protocols) use selective repeat.
Problem-01:
If the bandwidth between the sender and receiver is sufficient, CPU and buffers are
moderate, then which flow control protocol would you suggest to use?
Solution-
Problem-02:
If the bandwidth between the sender and receiver is moderate, CPU and buffers are
sufficient, then which flow control protocol would you suggest to use?
Solution-
In what protocols is it possible for the sender to receive an acknowledgement for a
packet that falls outside its current window?
1.Stop and Wait
2.Selective Repeat
3.Go back N
4.All of the above
Solution-
•Delayed Acknowledgements fall outside the current window.
•They may occur in any of the flow control protocols and received by the sender.
Thus, correct option is (D).
Problem-02:
On a wireless link, the probability of packet error is 0.2. A stop and wait protocol is used to transfer data across the link. The
channel condition is assumed to be independent from transmission to transmission. What is the average number of
transmission attempts required to transfer 100 packets?
1.100
2.125
3.150
4.200
Solution-
Method-01:
Given-
•Probability of packet error = 0.2
•We have to transfer 100 packets
Now,
•When we transfer 100 packets, number of packets in which error will occur = 0.2 x 100 = 20.
•Then, these 20 packets will have to be retransmitted.
•When we retransmit 20 packets, number of packets in which error will occur = 0.2 x 20 = 4.
•Then, these 4 packets will have to be retransmitted.
•When we retransmit 4 packets, number of packets in which error will occur = 0.2 x 4 = 0.8 ≅ 1.
•Then, this 1 packet will have to be retransmitted.
Basic approach used for error detection is the use of redundancy bits, where
additional bits are added to facilitate detection of errors.
Some popular techniques for error detection are:
1. Simple Parity check
2. Two-dimensional Parity check
3. Checksum
4. Cyclic redundancy check
1. Simple Parity check
Blocks of data from the source are subjected to a check bit or parity bit generator form,
where a parity of :
1 is added to the block if it contains odd number of 1’s, and
0 is added if it contains even number of 1’s
This scheme makes the total number of 1’s even, that is why it is called even parity
checking.
2. Two-dimensional Parity check
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.
3. Checksum
In checksum error detection scheme, the data is divided into k segments each of m bits.
In 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.
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.
4. Cyclic redundancy check (CRC)
•Unlike 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 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, t
he data unit is assumed to be correct and is therefore accepted.
•A remainder indicates that the data unit has been damaged in transit and the
refore must be rejected.