25
In the case of reliable service, both approaches are implemented. In situa- tions where errors are infrequent, end-to-end mechanisms are preferred. The TCP reliable stream service introduced later in this chapter provides an example of such an end-to-end mechanism. In situations where errors are likely, hop- by-hop error recovery becomes necessary. The HDLC data link control is an example of a hop-by-hop mechanism. The end-to-end versus hop-by-hop option appears in other situations as well. For example, ¯ow control and congestion control can be exercised on a hop-by- hop or an end-to-end basis. Security mechanisms provide another example in which this choice needs to be addressed. The approach selected typically deter- mines which layer of the protocol stack provides the desired function. Thus, for example, mechanisms for providing congestion control and mechanisms for pro- viding security are available at the data link layer, the network layer, and the transport layer. 5.2 ARQ PROTOCOLS Automatic Repeat Request (ARQ) is a technique used to ensure that a data stream is delivered accurately to the user despite errors that occur during trans- mission. ARQ forms the basis for peer-to-peer protocols that provide for the reliable transfer of information. In this section we develop the three basic types of ARQ protocols, starting with the simplest and building up to the most complex. We also discuss the settings in which the three ARQ protocol types are applied. This discussion assumes that the user generates a sequence of information blocks for transmission. The ARQ mechanism requires the block to contain a header with control information that is essential to proper operation, as shown in Figure 5.8. The transmitter will also append CRC check bits that cover the header and the information bits to enable the receiver to determine whether errors have occurred during transmission. We assume that the design of the CRC ensures that transmission errors can be detected with very high probability, as discussed in Chapter 3. Recall from Chapter 2 that we use the term frame to refer to the binary block that results from the combination of the header, user information, and CRC at the data link layer. We refer to the set of rules that govern the operation of the transmitter and receiver as the ARQ protocol. The ARQ protocol can be applied in a number of scenarios. Traditionally, the most common application involves transmission over a single noisy commu- nication channel. ARQ is introduced here to ensure a high level of reliability across a single transmission hop. As communication lines have become less noisy, the ARQ protocol has been implemented more often at the edges of the network to provide end-to-end reliability in the transmission of packets over multiple hops in a network, that is, over multiple communication channels and other network equipment. In this section we assume that the channel or 272 CHAPTER 5 Peer-to-Peer Protocols | | | Textbook Table of Contents e-Text Main Menu

5.2 ARQ PROTOCOLS | |

  • Upload
    vohanh

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 5.2 ARQ PROTOCOLS | |

�� ��� ��� � �� ��� � ������� ��� �������� ��� ��� �������� �� �������� ����� ���� ��� ����������� ��������� �������� ��� ���������� ������ �� ��� � ����� ������ ��������� ���� �� ��� ������� ������ �� ����� �� ��� �� ��������� ��������� �� ������� ����� ���� ��� ��� �� �������� ���� ������� ����� �������� ��� !"� ���� ��� ���� � ������� � � � �������� ���������

��� ��������� ���� �������� ���� ������ �� ���� ������� � �� �#� ����� �� $� ���� ��� ��%���� ���� ��� �� �������� � � �������� � �� ��������� ���� &������� �������� ������ ������ ����� � ������� ��� ����� ���� � �� �������� ��� ������� � ����� ������ � ���������� ����� ���� � ��� ���� ���� ������ ��� ������ �������� ���� ������� �� �������� �� �������% ��%���� ���� ��� �������� �� ��������% ������� ��� ���� �� � �� ��� ���� ��� ����� ��� ������ ����� ��� ���������� �����

��� ��� ����

��������� ������ ������� ����� � � ��������� ��� � ����� ���� � ��������� � �� ������ �������� � � ��� ��� ������ ���� ���� ���� �����% ���������� '() ��� ��� ��� �� ����������� ���� ���� ������ �� ����� ��� � ������� � ���������� �� ��� ����� �� ���� � ��� ����� ���� ����� '() ���� � ������% ���� ��� ��� �� ��� ��� ���% �� � ��� ����� ��� *� � ���� ��� �����% �� ����� ��� ����� '() ���� ������� ��� ����

��� ������ ���� ���� ��� ��� %������� � ������� � ���������� �� �� ��������� ��� '() �������� ������� ��� � �� � ������ ������� ���� ���� ��������� ���� � ������ � ����� �������� � ����� #�%��� +�,� ��� ���������� �� � ������ �(� ����� ��� ���� ���� ��������� ��� ��� ��������� ��� � ���� � ��� �������� � ��������� ����������� ���� ������� �����% ��������� *� ���� ���� ��� ���%� � ����(� ����� ���� �������� ���� ��� �� �������� ���� ���� ��%� ������ ����� ������ �� ������� -� (��� ��� ������� . ���� �� �� ��� ���� ����� ������ � ��� ������ � �� ���� ��� � ��� ��� ��������� � ��� ������� ������������� ��� �(� �� ��� ���� ��� ����� *� ����� � ��� �� � �� � ����%���� ��� ������� � ��� ���������� ��� �������� � ��� ��� ���������

��� '() ���� ��� �� ��� ��� �� � ������ � ������� ��������� ����� �� ���� ��� ������ ��� �� �������� ��� � ��% � ��� ������������ ������ � '() � ��������� ���� � ����� � ��%� ��� � �� ���� ������ � ��% � �������� ��� ' ����������� ��� ���� ����� ����� ��� '() ���� �� ���� ��� ������� ��� ���� �� ��� ��%� � ��������� � ������ ��������� �� ���� ��� �� ��� �������� � ������ ����� ��� � �� �� � ������� ���� �� ��� �� ��� � ����������� ������ ��� ���� ������ ���������� �� ��� ����� �� ���� ���� ��� ������ �

./. � '��0( + ����������� ����

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 2: 5.2 ARQ PROTOCOLS | |

������� � ������ � 11���� ���22 �� ��� ��� ���� ��� ����� ������ �� ������������ �� ���� ������ �� � � �� ��� ��� ���� �� ����� ���� ���� ���� �� ������ � �� ��� � �� ��� � ������� ��� ������� �� � � � ���� � ��������� � �� �� ��� ����� � ����� � � ��� ��� ����� � �� ����� �� �� �'�3 ������� �� ������� ��� �� ���� ���� ������ ��� � �� ������� ������� ������ � ���������� ������- �� ������� ����� ���� ������� � ����� �4������ � ��� '() ���� � � ����� ���� ������ ��� �� ������ �������� � ��� ���������� ����� � ��� ������ ��� ������ �� ��� ��� ���� ������� ���� ���� �����������

�� ������� � ��� ������������� ���� ��� ���� ���� � ����� � '()���� ���� � ����������� ������ �� ������� ���� ������� ��� ��� ����������� ������ ��� ������� ��������� � ��� �� #�%��� +�,� ������� ��������� ��� ������ � �� ���� ���� � � ������ ���� ������ ��� ���� ���������� � ��� �� ��� �(�� ��� ���� ����� ��� ��� ��!�� ����� ����� ���%� ��� ������ ������� � � %���� ����� � %��� � �����5 "�!�� ������������� ���� � ����� �� ���� �������� �� ���� ��� ���� ��� �������� � �����%������� �����5 ��� �� ������# ����� $"�� ����� ������ ��� �������� ������ �� ����� ��� ������� �������� ��� �������� � ����� ������������ � �������� ��� $� � ������ *� ��� ���� �6� ��� ���������� ����������� � �����% 4��� � � ������% ��� ������ ��� ���� � �� ����� � ���������� � ������ ������� �� ��� ������

*� ��%�� ���� ��� ��� � ��� ����� ��������� $� � � �� �� ������������ ��� ���������� � ��� ��������� ��� ������ ����������� ������ � ���� � �� ��� �������� � ���� ���������� "���� �� ��� ����� �� ��������� ��� � ����������� ������� � ����������

+�. '() ���� ./-

Packetsequence

Error-freepacket

sequenceInformation frames

Information frame

Informationpacket

Control frame

CRC HeaderCRC Header

Controlframes

Transmitter Receiver

Station BStation A

%�&'�$ ��( 7��� � ����� � '()

-*� ������ ��� ��� ����� ����� ��� ������ �� � ���� ���� �� ��� ��������

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 3: 5.2 ARQ PROTOCOLS | |

����) ��� ��* +��� ���

��� 8�� ���� �� ������ � ��� ��* +��� ��� ����� ��� ���������� ����������� ��� � ��� �� ����� � �� ����� �� � ���� ����%� �� � �������� ������� �� #�%��� +�9� �� �� �� '�: ��� ������� ��� �� ��� � ������������� ��� �������� ����� �� ��� ��� � � ������ '� ��� ������ ���� ����� 8%���� ����� ' ��� 7 ��� �����% � ��� �������� � ����� ;� <������ ���� ���� ����� ' ��� �� �������� �� ���� �� � ����� ����� ���� �� ������ ����� �� ������� ������ ��� ������� ����� � � ����� ���� �� �%������ ���� ��� ���� �������� � �������� ��� ���������% '�: ������ #�%���+�9� �� ��� � ���% ������� � �����=

>� &����� ' ������� ����� ; ��� ���� ���� �� �� '�: ����� ��� ������������

.� #���� ; � ���������� ������ ����� ����� 7 ������� �� '�: ������-� ��� '�: ��� ����� 7 � � �������� ������ ����� ����� ' ������ ����� ; �� ���� �������� ������ ��

?� &����� ' �� ������ � ������� ����� > ��� ���� ���� ��� ������+� #���� > �����%� ���� �� ��������� �� � ��� � ���� ����� 7 ������������ > ��� ������ ��� ���� ����%� ��� �(� �����5 �� � � ��� � ��������� > �� ��� � %��� �� ���� ����� 7 � ������� � ��� ���������?

�� ������ ��� ����� 7 �� �� ���� ��� ������@� ��� ������� ����� ������� ��� ����� > � �������������

./? � '��0( + ����������� ����

(a) Frame 1 lost

A

BACK ACK

Frame 0

ACK

Frame 0

ACK

Frame 1

ACK

Frame 1 Frame 2

Frame 1 Frame 1 Frame 2

(b) ACK lost

Time-out

Time-out

Time

Time

In parts (a) and (b) transmitting station A acts the same way, but part (b) receiving station B acceptsframe 1 twice.

%�&'�$ ��, ��� � ����%����� ���� ����� ��� ����������

?�� %����� � ���� ���� ��� �������� �� � ������ ��� ����� � �%����� ��� �������� ����� ���� ��� � ���

���� �� ��� ����� ���� �� ������� ��� ����� ���� ��� ����� ���� � ��� ������ � ��� ����� �������

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 4: 5.2 ARQ PROTOCOLS | |

��� ���� ������� �� ��� ������ ���� ����� > � �������� ��� ����� ���%��� ��� ���� ���� ������ � ����� .� ��� ��

�������� ���� �� ��� ������ ������ ��� � ����%����� �� ��� &�������*��� ���� ���� ���� � �� ��������� #�%��� +�9� �� ��� ������� ������%�� � �� #�%��� +�9�� ��� ����� ����� > � �������� ������ �� ��� �� ����� ���%���� �����%� ����� '���� ��������% ����� > ����� 7 �� ���� �� ������� ��� ���������� &����� ' �� �� ������� ��� ����� ��%���� �� ����� >� ��� ������� ����� ������� <�� ���� �� ��� ���� ����� ' ����� ������%��� ������� ��� ������� � ����� �� ���� A�B ��� A�B � #�%��� +�9� &����� '������ � ��������� ��� ������ �� ��� ����� � �������� ������ � �� ����� 7�� ��� �� ��� 8%���� ���� ����� 7 �� ������ ����� > � � ��� ����� ������� ���� �� � ��� ���� ��� �� �� ���� ��� � �� '�: ��� ��� � �� ����� ����� � � ��� ����� ������� ��� ����%���� ��� �� � �������� �� ��� ����% �������� ������ �� ��� ������ � ���� �������� &����� 7 �� � ���� ���%��6����� ��� ���� �������� � ����� > �� � ��� ������ ������ ��� ������ �������� ��� '�: �� ����� >�

' ���� ���� � ����%���� ���� �� ��� '�: � �� ������ � �������������� �� #�%��� +�>; ����� ; � ����������� ��� ��� ������� ������ ���������� �� #���� ; � �������� ������ �� ��� ��� A����������B '�: � ��������� ����� �������� ����� ' �� ����� ����� ;� &��� � ����������� ����� ' ��������� '�: ��� ���� �� � �� ��� �� ������ &����� ' ���� ������ � �������� >� ����� ����� �������� ����� �� ��� �������� ��� ���� ��������� � ����� ; �� ���� �������� ��� ����� ��%�� �� ����� 7� *��� �����' ������� ��� ���� '�:� ��� ����� ���� ��� '�: � �� ����� > ��������� � ������� ����� .� ��� �������� ��� ������ ����� > � �� �� �������� ��� ����� � �� ���� ��������� ������� �� ������� ����� ���������� ���� �� ������� ��� ������ � ���� � ��� �������� ������ ��������� �������%���� � �� ��� �� �������% � ������� ������ �� ��� ����� ��%��������� ���� ���� � ��� ���������� � ��������� ����� ����� ���� �������������

��� ������� ������ ����� �� � ��� � ����� ��������� � ��%� ������� � � 8���� ������ � ��� ��� ���� �� � �� ��� ����� ������� *� �� �� ����� ������ ������� ������ ��8�� � ����� ��� ���� ����%����� �� ��� &�������*��� ���� � #�%��� +�>> �� ��� ��������� � 11����22 ���� � �����

+�. '() ���� ./+

Time-out

Frame 0

ACK

A

B

Transmitting station A misinterprets duplicate ACKs

ACK

Frame 0 Frame 1 Frame 2

Time

%�&'�$ ��)- ��� � ����%����� ���� '�: ��� ����������

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 5: 5.2 ARQ PROTOCOLS | |

������ �� ��� ���������� ��� ��������� ��� ���������� ��� ���� ����� � ���������� ������ & �� � ��� ����� ����% ���� �� ������� ������ ��� ��� �������� � �� ��� ���������� � ��������� ��� �������� ���� ����� � � � ���������� ������ (���� � ��� ���� ����� �� � ��������% � ��������

&���� ���� ������ � ��� ���������� ��� �������� ��� �������6�� �� ������ ���� ����� ' � ���� � ��� � ����� ���� & ��C; ��� ����� 7 ���������% (����C;� �� #�%��� +�>> ��� % �� ���� � ��� ���� � ��8��� ����� ���� A& ��� (����B� ������ � ��� ���� � �� ���� A;�;B�

��� ���� ���� �� �� ����%� ���� ����� 7 ������� �� ��������� ������ ����� ;� ���� �� ����� ' �� ������� �������% ����� ; � �������� �� ���������� ��������� 0������ � ����� 7 ������� ����� ;� ����� 7 ����%�(���� � > ��� ��� �� ����� ��%���� � ����� ' ���� (����C> ��� ���� ������ ��%��% ��� ������� � ����� ;� '� ��� ���� ��� ���� � ��� ���� �A;�>B� '�� �������� �������� ����� ���� ���� ������� ������ ; ��� ���%���6�� � ��� ����� ��� �������� �� ����� 7� ��� �� ����� ��%���� ����(����C> � ������ 0������ � ����� ' ������� �� ����� ��%���� ����(����C> ��� ���� ��%�� ����������% ��� ���� ������ ���% ������� ������& ��C>� ��� ���� � �� �� ���� A>�>B� ��� ���������� ��� �������� ��� �%����������6��� ��� ���� �� ������ � ��� �%����� � ��� ������� � ����� >���������� � ���� ���� ��� ����� ��� �������� ���� � � ��� �� ���8��� ������� � ���� ��� �� #�%��� +�>> ��� ����� ��� ������ ������� � �� ����� � ����� � ��� ����������

./@ � '��0( + ����������� ����

1 10 0 10 1

Timer

Slast

SlastReceiverTransmitter

Station A Station B

Error-free frame 0arrives at receiver

Error-free frame 1arrives at receiver

ACK forframe 1arrives attransmitter

(0,1)

(1,1)(1,0)

(0,0)

ACK forframe 0arrives attransmitter

Global state:(Slast, Rnext)

Rnext

Rnext

0 10 10 10 10

%�&'�$ ��)) &���� ���� ��������� �� &�������*��� '()

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 6: 5.2 ARQ PROTOCOLS | |

' ������ � ���8����� ��� �� ���� � ��� ���� '() �������� ����� �� � �������� ���� ������ #� ����� �� �� �.��/�������0 ��� ����������� ��� �� ��������� ����%� ��� �� � � ��� ���� ����� �� �� ���������� ����� A0<)B� *��� � ������� ������� �� ��� ����� ���� ���� � �������������� � ���� �%� ��� ���������� ��� ��� �� 0<)� *��� � ������������ ��� � ����� ���� ����� � ���� �� � ��������� �� ������ ������' ��� �� #�%��� +�>.� ����� 7 ���� ������ � ��������� �� �� '�:������ ����� ���� �������� �� ����� ' �� �� ��� ����%����� &����� ' ������� ������ ���� ��� �������� � ��� ���������� ������ � ��� �� ���8%���� 7� �������� '�: ��� <': ����� ������ (����� ���������% ��� ��������� ���� � �������� �� ��� �������� ��� ��� ���� � ����� ��%��% �� ����� � � ���� ������

&�������*��� '() ����� ����8����� ���� ��� ����%���� �� �� ����� %������ ���� ��� ���� � ������� � ������ #� ����� �� ���� ���� ����� ����������% ����� ���� ��� >;;; ��� �% ��� � ������ ���� �� � ���� �>�+ ��%����D���� ��� ���� ���� ��� ���� ���� � ��� ��� ��� ��%�����%� ��� ����� �������� � ��� ������� � �� ����� ��%���� � ?; �� ��������� � ��� ���� ��� �� ���������� ��� ��� ������ �� ?; � �?;� >;�- � >�+� >;@ � @;�;;; ���� ������ &�������*��� '() ��� �������� � � >;;; ��� �� ��� ����� ����� ��� ����� ����8������ � ��� � �������������� ���� ��� ���������� ���� �� ��� ����� ��%���� � � ����� �������������% ���� ���� ��������� "���� �� ��� ����� �� �� ���� ���������� ����� ���� ��� �� ��� ������� � �������� ���� ���� ���%%�������������

��� *���# 1��*2�*�. ���*��� � ��� ������ � ��� ��� ���� ��� ��� �� �� ����� ��� ����� �� ����� ��� ���� � ���� �� ��� ��������% ����� � ��� �� ���

+�. '() ���� .//

(a) Frame 1 lost

(b) ACK for frame 1 lost

Frame 0 Frame 1 Frame 1

ACK 1

ENQ

ACK 1

Frame 0 Frame 1 Frame 0ENQ

ACK 1 ACK 0 ACK 0

A

B

A

B

Time-out

Time-out

Time

Time

%�&'�$ ��)� &�������*��� '() ������� �����

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 7: 5.2 ARQ PROTOCOLS | |

��������� ������ � @;�;;; ���� �� &�������*��� '() ��� �� ������������������ ��� �� ������ � � ������ � � ��������� �� ���� � �������������� ��� ����� ���� � � ���������� �������� �� ���� ������ ��� ���

$3�����45��#��

&����������� '() �� ��� �� �732 7����� &������� �����������A7����B ���� � 7���� � � ����������������� ���� ��� ���� ���� �� ���'&��� ��������� ��� ��� ����% ����� ���� ���������� �� 7����� ���� ��������� �� ������� �� ����������� � �� ����% ����� ���� �������� ���������� �� � ������ ��� �������� ��� ����� �� ���� � �������� ��������� ��������� � � ������ 7���� �� ���� ��� ���� �� ���� ��� ���� ���� � !"�� ����� � ������ ���� �� ��� ��������

$3�����46��*��

E����� � ��� �� 8 � ������� ���� �� ����� ��������� � ��� �&�������*��� '()� ��������� � ���������� �� 8���� ��%�� � �� �������% � � -����� ������� >., ���� � ����� ��� � ������� �������� ��� ���������� � � ����� ������������� ���������� � ������� ������� ������� ���� . ��� ����� � ��� ������� ������� ��� ����� ��������� � ������� �������% ��� ��� . �� � ��� >., ���� ����� ��� �������� ������� �� '�:� <': ��������� ����� ��������% ���� � ���

����� &� 5��/ " ���

�� ��� ����� �� �� ���� ��� ����8������ � &�������*��� '() ��� �������� �� � ���% ��� ���������� � ������� �����% ���%� ����� ���� ��� ������ � ���� ��� ��� � ��� ���������� ���� �� ����� ��%�����*� ���� � ��� F�7����< ���� ���� ��� ��� ��� �� ��� !"� ���� ��� ���� � ����� � ������ �� ��� ��� � ��� �������� &���� �� �� ��������� ��� �������� ;� >� .� -� � � � ��� ���������� �� � ���� � ��� ������ ������ *& ���� ��� �� ��������%� *& � ���� ��%�� ���� ��� �� ������������� ������ � ����� ���� ��� ������ ��� �� ���� ����

��� ���� � ��� 5���� &� 5��/ " ��� � � � �= ������ ��� ������� �� ��������� ������ ��� ����� ;� '���� ����� ; � ���� ��� ���������� ���*&� > �������� ����� ��� ��� ������ � �������� ���� ����� ; �� ���������� ������ � ��� �� ������� ����������� �� ����% ���� �� � ����������� '�: �� ����� ; �� ������ �� ��� ���� ��� � ��� ���������� � �� ��������% ����� ��� ��� ������ � � ��� �� #�%��� +�>-� ��� ���� � ����� ���� ����� ;� <��� ������� ���� ��� ���� ��% � ����� > ��� ������������� � � ����� �� ��������� ' �������� ����� ��� ������% � � ��� ���� ��%�� ����� ��� ��� ���� � ��� ������ ��� � ��� � �� ��������*� ��

./, � '��0( + ����������� ����

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 8: 5.2 ARQ PROTOCOLS | |

������ F�7����< '() ���� ��� ��� ������% � ����� � ���� ��� ������ ����

F�7����< '() %�� �� ���� ��� ��� ����� ���� � ����� ���� �� ��������� ' ��� �� #�%��� +�>-� ����� ����� - �����%� �������� ����� ����������� �%��� ����� - ��� � �������� ������ 0������ � ��� ���������������� ��� ������� ������ � ��������% ������ �� � ���� ����� � 11%���� <22 ������ ����� <C*&� ��� ��%�� ������������% � ������ ��� -������

�� ��� ������ ������ � &�������*���� �� ��� ��� ���� � � % �� ���� A& ��� (����B � ��������� ��� ������ ������� � ��� ���� �� ������ � �� ������% ��� ������ ���� ���� ��� �� ����� #�%��� +�>? �� ������ ������ ������� F�7����< '() ��� &�������*��� '() �� ���� � ������������ �� &�������*��� '()� ��� ��������� � � �������������� ������� � �� ��� � �������� ���� ���� � ��� ������� � ��� ������������� �� F�7����< '()� ��� ��������� � � �������������� ������� � �� ��� � �������� ���� ���������% � *& ������ �� &�������*��� ��� �������� � ���% �� ��� ����� ���� ������� ������ (����5 ��F�7����< ��� �������� � ���% �� � ����� ���� � ����8� ������� ���������� (����� �� �� �������� ��� ��� ��������% A���������� ��� �������� ��%��B ����� �� F�7����< ���� ��� & �� ����� �� &�������*���� �� ������ ��� ������ ������� � ��� F�7����< ���� ������ � ������%���� ��� ��� ����� � ������� � �� ������ ������ �� ��� ���� �� ���%�%�� � ���������� � & �� ��� ��� �������� *&� > ����� ���� ���� ��� �������� � ��������� ��������� � �% � ����� � � ��6�� ������ ��� ���������� ����� ��������� ��� ������� ��������� �������� � & �� ������ ��� ��� ���� �� ������ ������ �� *� ���� ����� ��� ���� ����� �� ���� ���� ��� � ��� �����

��� F�7����< '() � ����� ���� ������ � ��� ���������� ��������%�� ������� ������ � ��������% ����� � ���%%�� ��� ���������� � ������� ��� ��� ���� ��� ������ � � �% � ��� ���������� �� ���� ������ ��� � � ������ ���� ���� � �� ����������� �� ������� �����

+�. '() ���� ./9

Go-back-4 Four frames are outstanding, so go back 4

Out-of-sequenceframes

Error

AC

K 1

AC

K 2

AC

K 3

AC

K 4

AC

K 5

AC

K 6

AC

K 7

AC

K 8

AC

K 9

fr0

fr1

fr2

fr3

fr4

fr5

fr6

fr3

fr4

fr5

fr6

fr7

fr8

fr9

TimeA

B

%�&'�$ ��)7 7��� F�7����< '()

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 9: 5.2 ARQ PROTOCOLS | |

������ ������ ������� �� ����� ��� �� �� *&� > �������� ����������� ��� ��� ���������� ��� �� ���%%����� ���� ��� ����� � �� ������������ ��� �� � ��� � �� ��� �� �������% F�7����< '() ��� ���� � ������ ������� ���� ���� ���������� ������

#�%��� +�>+ �� �� ��� ��� ���% F�7����< '() ���� ���������� ���������� ��� �� �������� � �� � ��� ����� �� � ������%� �����& �� � ��� ������ � ��� �� ���������� ����� ���� ������ ������� ��%����� &������ � ��� ������ � ��� �� ������ � ���������� ������ ��� ������������� � �������� � ����� �� ���� ���������� ����� ��� ��� � ������ � ����� ���� ���� ���� ���������� ��� ���� �� ��� ���� ����� ��%��� '� ������� �� ���� ��� ���������� �� � ���* 2��*�2 � ���� �� � ������� ���������� ��� ��� � ��� ����� � %���� �� & ��� ��� ��� ����� ���� � ��� ����������� ����� � & ��G*&� >� �� &������ ������ ��� ����� ���� � ��� ��������� ���������� � �� � ��� � ������� ������� ��� ����� ���� ��� �������� ��� ������ ���� ��� ������� � � ��� ����� ��%�����

��� F�7����< ���� � �� ����� � � � ���*��0 2��*�2 ��������� ����������� �������� � �����8� 2��*�2 � �6� > ���� ���� � ��� ���� ����� (������ ������ � �������� �� �� �������% ����� ��� ��� �(� ����� ��� �� ��������� ������� ������� ���� �� (����� ���� �� � �������� ��� (���� � ������������� *� �� ���� ��� ������� ����� ��� ������� ��� �������� ���� ��� ������� ��%���� ��������% ��� ����������� ������� ������ (����� �����

.,; � '��0( + ����������� ����

Stop-and-Wait ARQ

Go-back-N ARQ

Time-out expires

Four frames are outstanding, so go back 4

Out-of-sequenceframes

Error

Error

AC

K 1

AC

K 1

AC

K 2

AC

K 3

AC

K 4

AC

K 5

AC

K 6

Time

Time

fr0

fr0

fr1

fr2

fr3

fr0

fr1

fr2

fr3

fr4

fr5

fr6

A

B

A

B

fr0

fr1

%�&'�$ ��)9 (� ������� � &�������*��� '() ��� F�7����< '()

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 10: 5.2 ARQ PROTOCOLS | |

��� ���� � ����� ��%� ������� � � ����� ���� � (����� <�� �� �� ��������% �� � ��� ������� ���� ��� ������ � ���� ���= *��� ��� ����������������� �� '�: ���� � %���� �� �� (����� �� ��� ���� ���� � ���� ��������� ���� �������� ������ �� ���� �� �� �� �� �������� '�: �� ��� ������������ ������ ���� ���� � � ������ ��� �������� ��� �� � ��� �����H�� ��������% �� '�: ���� � %���� �� �� (����� ��� ���������� ������ ���� �� � & �� � (���� ��� �� ���% ��� ��� ����� ��� ������� A<�� ������� ����� ��� �� ���� & �� � (����� <�� � �� ���� (���� � &������� ���� &������� ��� �� �� ��� �������� ������B

��� ������ � ��� ���� ��� �� � ���� ������ � ������ ��� ������� ������� ������ � �� ������� ��� �� ����� ���� � � � � �������� �� �� .�

��� � ������� ������� ��� ������� ������ ��� �� ������ ���%��� .�� ��� �� � � -� ���� ��� ������� � ����� �� � ����� ��� ������������� ;� >� .� -� ?� +� @� /� ;� >� .� -� � � � *��� �� ��������� ����� ������� ����������� ��� �� �� � � ������%�� � ��������� ����� ����� �� ������������� �����% ��� ������ ���� ��� ������� ������ ���� ����� ������� ���� ������ .�� *� �� ���� �� ���� ��� �������� ��� ��������� ��������� ����� �� ��� ����� �6� � �� �� ���� .��

��� ����� � �� #�%��� +�>@ �� ��� ����%����� ���� ���� ���� ��� ���������� ��� � �� ���8��� ��� ����� � �� .� � .. � ? ������� ������� ������������� ������ � ��� ��� ����� �� � ��� ��� �������� ��� ��� ����������% ����� ��%����� ����� ��� � � �������� �� ��� ������ ������ �*��� ��� ���������� ������ �� ���� �� � ����� ������� �� %� ���� ������ ��%�� ������������% ��� ����� ;� *��� ����� ; ������ �� ��� ��������� ����������� �� (����C;� �� ������ ��� ������ ������ ��� �������� �� ����� ������� ��� '�: �� ��� ������ ����� ; �� ��������� �������� �� ���

+�. '() ���� .,>

The receiver will only accepta frame that is error free andthat has sequence number Rnext

ReceiverTransmitter

Send window Receive window

Framesreceived

Framestransmittedand ACKed

Timer

Buffers

Slast

Slast

Slast + 1

Slast + Ws −1

Slast + Ws −1

Srecent

Srecent Rnext

Timer

Timer

���

���

���

%�&'�$ ��)� F�7����< '()

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 11: 5.2 ARQ PROTOCOLS | |

�������� ����� ��������� ������� ��� � � ��� ����� ; � �� � ����� ;� ������� ����� � �� #�%��� +�>@ �� .� � ? ������� ��������%� ��� � ������6� � -� �� ��� ��� �� �%��� ���� ���� ��� ���������� ��� ����� ���������� ����� ��� ���� ����� ��%���� ��� � �� ��� ������ ������ � *��� ��������������� ����� ; ������ �� ��� ��������� (����C-� ��� ����� � ���%��6��� �� �� � ���

*� ��� %����� �6� #�%��� +�>@ � � �� �� %����� � ���� ��� ������6� *& � .

� � > � � ��� ���� ���� ��� ������� ��� ����� � ; �� �*&� >� &���� ���� ����� ; � ��������� ��� ��� ����� ��%���� �� ����� ;� �� ��� ���������� ��� � � ������� ��� ����� �� � ����� *&� >�!�������% � ����� �������� ������ ������ ����� (���� �� �� �� ������%� � > � *&� ������ �� ��� �������� �� �� ������� ����� *& ���� �������� ��%���� �� ����� ; �� ���� �������� �� ��� ����������� ������������ ������� � ����� ; ���� � ����� *& �������� � ��� ����� �������� ������ ;�

#�%��� +�>/ �� ���� ��� ���������� � F�7����< '() ��� ��������� �� �����% ��� �������� ��� � <': ���%� ��������� � ����� ���8�� ������������ ����� � ��������� ��� <': ���� ������� ������ (��������� ��%� � ����� �� � (����� > ��� ����� ��� ���������� ���� �� ����

.,. � '��0( + ����������� ����

Receiver has Rnext = 0, but it doesnot know whether its ACK forframe 0 was received, so it does notknow whether this is the old frame 0or a new frame 0.

M = 22 = 4, Go-back-4

fr0

A

B

A

B

fr1

fr2

fr0

fr1

fr2

fr0

fr1

fr2

fr3

AC

K 1

AC

K 2

AC

K 3

AC

K 1

AC

K 2

AC

K 3

AC

K 4

fr0

fr1

fr2

fr3

Transmitter goes back 4

M = 22 = 4, Go-back-3 Transmitter goes back 3

Time

Time

Receiver has Rnext = 3, so it rejectsthe old frame 0.

%�&'�$ ��): ��� ����� �6� �� � �� � ���� .�

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 12: 5.2 ARQ PROTOCOLS | |

������� �� ���� �������� �� ����� (����� ��� <': ����� ��� �������������� ��� �������� � �� ��������% ����� ���� � ��� (���� ��� ������� ������������� � % ���� ��� ��������� (���� ��� � �������� ������� 7������% ��� <':� ��� �������� �� � ������� ���� ����� �� � ����� ���� ����� (���� � ��������� #� ��� ����� ��� �������� � � ��� � ��� � ��� <': �� ��� %���� ������ �� ��� <': ������ ��� � ���� �� ��� <': � � � ��� ����� �������� ��� � ���� ��� �������� �� ������ � ��� ������� �������� � ���%%�� �������� ����������� <�� ���� �� %����� ���<': �������� ��� � �� �����% ��� ���������� % ���� � ���� *& ������

#��� � �� ������ ��� ��� ����� ��� ��������� $� � ����������� � ������������� ��� �������� ������� � ��� ���8�� F�7����< ���� ��� ����� ������� �� ��� ����� ' ��� 7� �� ��� ������ ��� ��������� ��� $� ������ �������� ���� � ��������� ����� ��� ���� ������ 3��� � ������� ����� ��� �� � �������� �� ��00#1��/��0 ��� ����� ��%���� �� ��������� � ��� ��������� ����� � ��� �� #�%��� +�>,�

��� �� � ��%%�������% ��� ��� � �� �%��8���� ���������� �� ��� �� ����������� *��� � �������� ������ �� ��������� ������ ��� �������� ��� �������� ����� ��%���� ��� ��� ���� ��������% ��������� ������ �� � ���������� ����� ��� ����� �� �� ��������� ��� �������� ��� �� �� ��! ��������� ��8�� ��� ������� ���� �� �� ���� �� ��� ���� ��� ��� � �� ��������������� *��� ��� ���� ������ � ���� ����� �� �� ��� � ����� ��� ����� ���%�����

�� ��� ����������� ��� ��� �������� ���� � ������������ ������ � ��� ���������� �� ' ����� ���� ������ �� ���� � �%����� &�������� ����� ���� ����� � ������� ��� ���� ���� ��� �������� ����� ��� '�: A����� (����B �� ������������� ��� (���� � ��� � ������ ��� �� & ���

��� ������� ������� �� �� �� � �� � ����� ���� �� ������ ��� �������� � �������� � ������� � ����� ����� ��%����� ' ��� �� #�%��� +�>9���� ���� ����� ��� ��� ��� ��������� ����%���� �� �� .������ �� �������� ��%�� ����� �������� ���� � ��� ������ ������ .����

� ��� ��� �����

+�. '() ���� .,-

Go-back-7

Error

B

A

AC

K 1

AC

K 2

AC

K 3

AC

K 4

AC

K 5

AC

K 6

AC

K 7

NA

K 1

Transmitter goes back to frame 1

Out-of-sequenceframes

fr0

fr1

fr2

fr3

fr4

fr5

fr1

fr2

fr3

fr4

fr5

fr6

fr7

fr0

Time

%�&'�$ ��); <': ���� �������

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 13: 5.2 ARQ PROTOCOLS | |

������% ���� �����+ ��� �������� ���� � ��� ����� �� ��� ������ ������

��� ��� ��� '�: ������� ��� ������ �� ��� ������������ ����� ��������� �����

���� � .����� � .���� � ����

' �� ��� ��� � &�������*��� '()� ��� ���������� � ��� ���8�� F�7����< '() ���� � �������� �� ���� �� ��� ��������� ����� ��� ������ ��� ����� ��%����� ��� �������� � �% ��������� ����� �� ����������� ��� ��� �� �� ��� �������� � ����� ��%����� ����� ��� ��� ��� ��� ������ � ������� �� ��� ���������� ��� ��� �� ���� ���%%�� �������������������� ���� �% �� �� ��� �� ������ �� �� ���% ��%%�������%��� ������ �����% ��� ��� ���� ����� ����� � ��� �% ���������������

.,? � '��0( + ����������� ����

Station A

Transmitter

Receiver

Station B

Receive window B

ACKs are piggybacked in headers

Receive window A

Send window BSend window A

Timer

Timer

Timer

Timer

Buffers

Timer

Timer

Timer

Timer

Buffers

SArecent R

Anext

SBrecent R

Bnext

SBlast SB

last + WBs -1

SBlast + WB

s -1

SBlast + 1

SBrecent

SBlast

SAlast SA

last + WAs -1

SAlast

SAlast + 1

SArecent

SAlast + WA

s -1

RBnextRA

next

Receiver

Transmitter

��� ���

���

���

���

���

%�&'�$ ��)( &���� ��������� �� ����������� F�7����< '()

+<�� ���� #�%��� +�>9 � ��� ����� �� ���� ������ 8%��� �� ���� ��� ��� ��%�����% ��� ��� � ����

����� �������� ���� � �� ��� ��� ���� ��

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 14: 5.2 ARQ PROTOCOLS | |

$3�����4<=��

��� �%�� ��� !��� "��� ���� A !"�B � � ���� ��� ���� ����������� ��� �� ��� ����������� &������� I�%���6����� !"� � � ��������������� ���� �� ��� �(��>@ ��� �(��-. ������������� ��� ������ ��������� -� !"� ��� �� ������� ���� �� �� F�7����< '()� � �������� ��� ������ � &� ������ (����� '()� ����� � ������ �� ����� +�.�-� !"� � ������ �� ����� ���� �� ��� ����������� �� ���� �� � !"� � ��� "��� '��� ��������J7� �����

A"'�7B ������ ���� �� ��� �������� &����� �������� � ��� "'�7 ��� ������ ��������� ��� ������� #� ����� �� "��� '��� ��������J!��� A"'�!B ���� ���� ��� ������� �� ��� ���� ������ �� �&!<� '����� ����� � � 3�� �!��� "��� ���� A3!"�B� ����� � � �������� � "'�! ���� �� ���� ����� �� � �� !�%��� ������ !��� ���� ���� ������� ��%��� ��������� ���'3�& ��� ��%��� �� � �� �� ����� �������

$3�����4>�9� ?�*�� ���*��*

0��� ���� � ������ �� �� ����� ���� ����������� � ������ ��������� �%���� ���������� ���� ������ ��� ���������� �%�� � ��� ��H��K�?. ������� �� ���� ��� � ������ ���� ���� �� �������� ������� ���� K�?. ����8� ��� "��� '��� �������� �� 3��� A"'�3B� ������ ��� ���� ���� � "'�3 � ������� ��� !"� ��� ������ �������� �� ���� ��� K�?. � ����� ��� 3����� <����� ���� A3<�B ������������� ���� � �� ����� ���� � ��� ���� ����� �K�?.� ���� ��� � ���� ���� �� ���� ������� �� ���� ���� �� �����

����7 ������8� ������ ���

�� ������ ���� ���� ��%� ���� ����� ��� F�7����< '() ���� � ����8������ ������ � ��� ���� � ��������� ��� ����� �� ���� ��� � ��� ��������

+�. '() ���� .,+

Tout Tproc

Tprop TpropTfTf

%�&'�$ ��), �� �� ���� � ������� �� ��

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 15: 5.2 ARQ PROTOCOLS | |

������ ' ��� ��8����� '() ���� ��� �� ������� �� �����% �� ����������= 8��� ��� ������� ����� � ���� ��%�� ���� �� ����� ���� ����������� ��� ������ ����� ���� ��� �� � ���� ��� ���� ����5 ����� ������������� �������� � ���8�� ���� � � ��������� ����� ��� �������������� *� ����� � ��� ���� � ������8� ������ ���� *� ������� � �������� ��� �������� ���� ��� '() ���� ��� �� ���� �� ��������� ��������� ������� � ������ � ��� ����������

#�%��� +�.; �� ���� ��� ��� ����� �� ��� ���������� � ������%�� ������� ��� ������� ����� �� ���� � � ���%� � ����� ������ ������% ���(���� � (����G*(� >� ����� *( � ��� ������� ������ � ����� ���� ����������� � �� ��% � ������ �� � %���� ����� ' ������ ��� ���� �4������ � ������� � � ������� ��� �� �� � (���� ��� & �� ����%� ��� �� ����� � ��� ��� ��������% ������ ��� '�: ����� ����� (����� ��� ��� ����� ������ �� ��� ���� ��������� ��� ������� ����� � �������� ���� ��� ������� � ����������� ����� ���� ������� ������ (����� H� ��� ��� ��� � F�7����<'()� ��� ������� ����� ��� �� �������� �� ����� ������ ��� ��� �������� �� � ��� ����� ���� � � (���� ���� � ����� ���� �������� ������ ���� ��� �������� �� ��� ��������� (���� ��� ��� � ���% ��������� ������ ����� ������ � ��� ��������� �� ��� �����

<� ������ ��� ���������� �������� �� &� ������ (����� '()� ������� ��% � ����� �� ��� ���������� � ��� � � �� *��� ��� ����� �������� � ��� ���������% ����� � ������������� ����� � � �%�� � � ��� ������������ ������� ��� �%� � ��� ����� ��� ��� ������� ������� ��� �������� ��� � �� � �������� � ������� �� ��� ������ *������� �� ������������ ����� � ������ �� ��� ��������� � <': ����� � ��� ���� ������������� (����� *��� ��� ���������� ������� ��� � <': ������ �� ���������

.,@ � '��0( + ����������� ����

Transmitter

Framestransmittedand ACKed

Framesreceived

Timer

Timer

Timer

Buffers Buffers

Send window

Receiver

Receive window

���

��� ���

���

Slast

Slast

Slast + 1

Rnext + 1

Rnext

Rnext + 2

Srecent

Srecent

Slast + Ws −1

Slast + Ws −1

Rnext + Wr −1

Rnext + Wr −1

%�&'�$ ���- &� ������ (����� '()

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 16: 5.2 ARQ PROTOCOLS | |

��� ����8� ������ ���� �� (����� #��� �� �� ��� ���� ��� ��%%������� ����� ���%���� �� ��� ��������� ����� ������� � ����� (�����

#� ����� �� �� #�%��� +�.> ���� ��� ����� ���� ������� ������ . 8�� ������� ������ � �� ��� ��������� ����� -� ?� +� ��� @ ���� � ����� ���� �������������� �� �������� �� ��� ������� � ����� . ��� � �� � ����% � ��� ����������� �� 8�� ������

������ �� ��� ������ � ��� ������� ��� ����� �6� ���� � � ����� � %���� ������� ��������% .�� �� #�%��� +�.. �� �� �� ����� � �� �������� ������� ��������% � .. � ? ��� �� ����� ��� ��� ����� ��� ������������ ��� � �6� -� ������ � ����� ' ������� ����� ;� >� ��� .�

' ����� ����� ������ ������ � �� ����� 7� ��� ��� ������� ����� ��������� � L-� ;� >M� H��������� � � ����� ����� ��%���� ��� �� ������� ����� �� ����� ; ������� ����� ; � ������������� ��� ���������� � �������� �6� �� ����� �������� H�� ��������% ����� ;� ����� 7 �������������� ������� �� � ��� � ����� ; � ��� ��� ����� ;� & � ��� �� ��� ���������� ����� � �6� .� � > ��� � ��%��

�� ���� �� ���� ��� ������� � ��� � ����� �6� � *& �*( � .��>����� �� �� � ��� ������� ������ ����� � �� ��� �� ������� ��� ��%�������� �� ��� ��� � F�7����< '()� &���� ��� ����� �6� *& � .

��> � ���� ���� ���� ��� ������� ��� ����� � ; � *&� >� &���� � ���� ��������� ������� ����� � ; � *&� >� <� ���� ���� ����� ; � �������������� � ��� ���� ��� ����� ��%���� �� ����� ; � �� ��� ���������� ���������� ��� ����� � � �� � ����� *&� >� !�������% � ����� ��������� ������ ������ ����� (���� �� �� �� ��� ���%� ������� > ��� *& ��� �(����G*(� > �� �� �� ��� ���%� � > � .*&� >� ��� ������� �� �� � (�������� ���� ����� ; ����%� *&� > ��� �������� ������ �� ��� �� �� � (����� *& ��� ��� �� �� � (����G*(� > ������� � .*&� >� ������ �� ����������� �� �� ������� ����� .*& ���� ��� ����� ��%���� �� ����� ; ������ �������� �� ��� ����������� '�� ������� � ����� ; ���� � ����� .*&

�������� � ��� ����� �������� � ����� ;� ��������� ��� ������� �6������ ���� *&C*( � .

��>��� ��� ���� ����� �� ���� � ���������� ��� �� ��� '() ���� �

*� �� ���� &� ������ (����� '() �������� F�7����< ��� &�������

+�. '() ���� .,/

fr0

fr1

fr2

fr3

fr4

fr5

fr6

fr2

fr7

fr8

fr9

fr10

fr11

fr12

TimeA

B

Error

AC

K 1

AC

K 2

AC

K 2

AC

K 2

AC

K 2

AC

K 7

AC

K 8

AC

K 9

AC

K 1

0

AC

K 1

1

AC

K 1

2

NA

K 2

%�&'�$ ���) 0��� ������� �� &� ������ (����� '()

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 17: 5.2 ARQ PROTOCOLS | |

*��� '()� I� ����� ��� ���������� ��� � �� ������%� �� �%��8���� �%������ ��� ������

$3�����4����������� ������� ��������

��� �������� ���� ���� A���B �� � ��� � &� ������ (����� '()� ������ ��������� ���� ���� ��� � ������� ��� � ���� � ��� ����������� ���� �� �� � ������� ������ �� �������� � ���� ��� ����������� ������ ���� ��� ������� � �!H ���� ��� ������ �� � �������� �� �� � ��� ���������� � ���� ���%� � ������� �� ��� *� ��� ����� ��� �� '() � ������ ��� ��� � ��� ��� ������ ���� � �� ��� ������������������ ����� ������ �� ����� +�-�-�

$3�����4 ��8��� ����@� ���������� ������* ��������

��� &������ &����8� �������� I������� ���� A&&�I�B ������ ���� ����� �� �%�� ��% ���%� �� '�3 ������� &&�I� �� � �������� � &� ������(����� '() ���� ������ ��� � ��������� �� �������% ��� ������������� � � �� � ��������� ���� ���� ���� �������� ��� ��������% � ����������������� ��� '() ���� �� &&�I� �� ��%��� � ���%��� �� �� ����%������ ��� ��� ���� ���� ��� ���� � ��%� �� ������������ �������

.,, � '��0( + ����������� ����

Frame 0 resent

M = 22 = 4, selective repeat: send window = receive window = 3

Send window = receive window = 2

Frame 0 resent

Frame 0 rejected

Receive window {3,0,1}

Receive window {2,3}

Time

TimeA

B

A

B

fr0

fr1

fr2

AC

K 1

AC

K 2

AC

K 1

AC

K 2

AC

K 3

fr0

fr1

fr0

fr0

%�&'�$ ���� 3������ ����� �6� �� &� ������ (����� '()

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 18: 5.2 ARQ PROTOCOLS | |

��� ���� �� � ���� ���� �� '�3 ������� ����� � ������� ��%��� ������������ ������� &&�I� � ������ �� ������� 9�

����9 ����������� $�@�����# �� ��� ���������

�� ��� ������ ����� �� � ����� ��������� ��� ���������� ����������������� &�������*���� F�7����<� ��� &� ������ (����� '() ���� � ����� ����� �� ���� ���������� ��� � �� ���� ���� ��� ������ ������������� ������� � ����� �������� ��8������� *� �� ���� ����� ������������ ������� ��� ����� ���� ����� ��� ��� ����� ��%�� ��� ������������ �� ����������% ���� �����������

#� ��� ����� �� ��� ���� � ��� ��� ����� ��� ��������� � ������������� ��� ����� ��� ������ ������ � ��� � � �� ����� ��%����� *� � ���� ���� � ��������� ����� ���� ��� ��� ��%�� ��� ���� ��� ����������� ��� �� ����� � ������� � ��� ��������� #�%��� +�.- �� ��� ��������� ��� ���� �� �� �; ���� �������� �� &�������*��� '() ��� ��� ������ ������ � ���������� ��� ��� ������ � ��� ������ ���� ��� ����� ��%���� ���8����� ��� 8�� ��� ���� � ����� ��� ��� ������ ������ �� ��� ����� � ��������� ����� � ����%���� ���� �����5 ��� ��� � ��� ����� � �������� �� �����7 ����� � �������� ����� &����� 7 ������� ���� ���� � ������� ��

+�. '() ���� .,9

���A �5' "$ �"= �=���>�B

��� F����� �� �������% �� �� � �������� � �� ���� �� ������� ������������ �� >9,?� ���� ��� � ���% ������ ���� '()= 11A'()B � ��� ��� �������% � ��� � ���� ���� ��� ������ A������� �� � �� ������%��B ���� �� ��� � �� ��2� �� � �����2 �� � �������% �����22 '() ���������� �� ���'� ��� !����� �����% *� � *�� �� � ������ �� ��� ��������� � ��������� ��� ����� �� �� ���� ���� �������� ��������������� � � ��������� � ��� ���� A>B ��� ����� ���� A;B� ����������� � ��� ���� ��������� � ��� �� � � ������ �� �������������� ��� � ���� �� � ��� ���� ����� � ��� ���� ����� ���� �������� '() � ����� ����

&��� ����� � �� ��� � � ���� �� ��� ���� � '()� 0���������� ��������� ��� ���� � �������� ��������� � '()� ��� ������������������ %��� '() ��� ��� ��� � ����� � ������ � ��� �����������% ������� �������� �� � ������ � � ���� ���� '() ������ �� �� ��8����� �������� �� � ������ ����� ���� ���� '() ����� ��� �������� ���� � ��������� ��� � ��� ������ � ��� ���������� ���� '() �� ����� � ���� ���������� � ������ ������� ��� ����� ��� � ��� � ������ ����� ����� ��%� � ��� ������ ��������������

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 19: 5.2 ARQ PROTOCOLS | |

����� ��%���� ����� ���� �� ������� �� ���� � �������� ����� '������ �������� ����%���� �� ��� ��� ����� ��%���� ����� � �������� �� ������ '� #��� �� ���� �������� ���� ��� �������� � ����� �� ��� �(� ��������� ���� ���� � ��� � ����� ��� ������� �� '�:� �� ��� ������ � ����� ����� %���� ��

�; � .����� � .���� � � � �� � .����� � .���� ���

� ���

����� � � ��� ������ � ��� �� ��� ��������� ������ �� � ��� ������ � ����� ��� ����� ��%���� ������ ��� � � ��� ��� ���� � ��� �������� ������ �

��� ��������� ��������� �������� ���� � ��� ���� �� ��� ������ ����� � ���� %���� ��

�;� ������� � ��������� ��� �� ������ � ���������

��� ���� �������� � �� ���� ��� ��������� ���� � � ��

�;

����� �� � ��� ������ � ������� ��� �� � ����� ��� � %���� �� ��� ��� ������ � ��� �� ��� ������ ��� ��� ������ � �(� ����� ���� ��� ��������� ��8������ � &�������*��� '() � %���� �� ��� ���� �;� � �=

�; �� � ��

�;�

�>� ��

>� ���

� .������ � �������

��� ��������% ������� ������8� � ��� � ��� ���� � ����8������ �� ���������� �� ��� �������� ��� ���� ���� �������� ��� �� ����������8������ ��� � ��� ���� � ������ ������ ��� �(� ������ �� ��� ���������� ��� ���� ���� � ��� �� ��8������ ��� � ��� ���� �������� �� �������� ��%���� ���%�� ����� �� � ��� ������ � ��� �� �� '�:D<':������ #��� �� ��� ���� .������ � ������ � ��� �� ������������ ������� ������� ��������� ��� ��� �� ��� ������

��� � +�> �� ��� ��8������� � &�������*��� '() �� � ������ �������� *� 8�� ���� � ����� �6� � >;.? ���� A,>9. ���B ����� � �� � , ����� *� ������ ����� �� �� � ������� ���� ����� � ����= + ��+; �� ��� +;; �� 7����� ��� ���� � �%�� � -� >;, �����D����� ����

.9; � '��0( + ����������� ����

t0

tproc

tproctprop Frametf time

B

A

tproptack

%�&'�$ ���7 !� �� ������� �� &�������*��� '()

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 20: 5.2 ARQ PROTOCOLS | |

�� �� ������� � ������� � ���� >+;; ��� >+�;;; ��� ��� >+;�;;; �� ��� ���� �� � ������� ��%� � � ������� �������� �������������� � ������ ��� ���� ��������� �� *� ������ ��� �� �� � ��� ����= -;�;;; �� �� ��������� �� ����� ����� >�+ 3�� �� � ��%������ �� ����� ���� ?+ 3���� ��%������ ���� ���� ��� .�? F�� �� � ��%������ ������� ���� #� ������ � �� ������� �� ����� ����� �� �� ���� ������ � ��8������� ����������� �� ������� ���� �� � +; �� ��� � ��� &�������*��� '() � ����������� � �� ���� ����������� ���� ������ �� ��� ��%�������� ��� �����8������� ����� � ��� � ��� ���� ����� ���� ��� ������ � 6��� ��� ��8������� ��� �� ������� �� %��% � ��%�� ����� �6�� ��� ���� ��� ��������� �� ��� � +�> � �� � � @?�;;; ����C+.?�.,, ���� ��� ��8������ �������� �� ��� >�+ 3�� ���� <������� �� ��� ������ � ��� &�������*��� ���� ���� ������ � ��� �� ������������ ������ � �%��� � ��� �������� �� ���� ����� ��

*� �� ������ ��� ������ � �������� ���� � ��� ��8������ � &�������*��� '()� �� � ����� ����� ���� �����% ��������� ��� ��������������� �� ���� ���������� � ��� ������ "�� � �� ��� ������ ������� � ����� �������� �� ����� *� �� ���� ���� � ����� ���������� ���� ����������� � ���� ����� ���������

��� � +�. �� ��� �������� ��8������� � &�������*���� F�7����<���� &� ������ (����� '()� (��� ���� &�������*��� '() ���� ���� �.����� � �������� �� ����� ����� ������% �� ��� ����� ��%����� I� ��� ��������� F�7����< '() ���� *&� > � � ���� �� ���� ���� A���� ������� ��� � B� ��� ������ ��8������ � F�7����< ��� �� ��� �� �������% ������������ �� ��� ������� �� &�������*��� ��� F�7����< '()= #�&�������*��� �� ���� ���� � .����� � �������� � ��� �� F�7����< �� �����*& � >�� � ����� � ���� �� �� �� %����� � <�� � ���� ���� � � ;� �����8������ � F�7����< '() � >� ���� � ����� � ��� ������� ��� � %�������� ��� ������ ��� �(� ����� ��� ������ �

��� ������� �� ��� � +�. �� F�7����< ��� &� ������ (����� '() ����� �������� ��� ���� � �� ��� �� ������������ ������ � ��� ������ � ��� �������� ��� ������� ��8������ >� ���� �� ��� ������ � ����� <��� ����������� ��� ������� ���� ���� ��� ����� �6� ���� ���� � ����� � ���� ���

+�. '() ���� .9>

��� ����� � ,>9.��������� � @?� �� � @? � A��B

-; ��� >�+ 3�� ?+ 3�� .�? F��

-�--� ;�9+ ;�-+ >�//0�;�. -�-90�;?����� � ����= -�-�- ;�/. +�>?0�;. >�,;0�;- -�-90�;+

-��-- ;�.> +�-90�;- >�,>0�;? -�-90�;@�1� ����� � +.?�.,,

-�--� ;�99 ;�9/ ;�+- .�>?0�;.����� � ����= -�-�- ;�99 ;�// >�;?0�;> .�>,0�;-

-��-- ;�.> ;�.@ >�>+0�;. .�>,0�;?

�5�$ ��) 0�8������ � &�������*��� '() �� ��� ������ � ����

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 21: 5.2 ARQ PROTOCOLS | |

������ ��� ��� � ����� ��%���� ��� ��������� #� &� ������ (����� '()��� ������� ������� ��� ��������% � �� � *& ����� �� ��� ���������� ����� ��� ��������� ��� �� F�7����< '() ��� ������� ������� ��� ��������%� �� � *& ����� �� ��� ����������� ��� �6� *& � ��� ����� �������� ������ ������ �������� �� ��� � +�. � ��� �� ��� � +�-� #� ��� -; ��� ������ >�+ 3�� ������ � �� ����� ������ � ����� �6�� #� ��� ?+ 3�������� ������ � ����� �6� ��� ������� �� %��% � �%�� ������ ���� ��@? :���� ����� ������ � > :���� ������ ����� �� ��� .�? F�� ������ � ��%� ����� �6� ��� �������� ���� �� @? :���� ������

��� � ����� � ������ ����� �6� ��� ���� ��� ������ ���� ���� ���������� #� � ����� ��� ���� ������ ���� �������� � ��� ���� ���� ������� ��� �� �� ����

� � >� �� ��� ���� �� � ������ >� �>� ���� >� �>� � �� � � � �� � � >

.9. � '��0( + ����������� ����

��� ����� � ,>9.� A��B

-; ��� >�+ 3�� ?+ 3�� .�? F��

-�--� . ? +/ .9-.

����� � ����= -�-�- . .; ++> .9.99

-��-- @ >,+ +?9+ .9.�9/>

�1� ����� � +.?�.,,-�--� . . - ?,

����� � ����= -�-�- . . >> ?@;

-��-- . + ,, ?+,;

�5�$ ��7 (������� ����� �6� �� ��������� ��������� � �� �� ��� ��� ����

��� ���.����� $�@�����# ��������

������!��

� �� � �;�������

�� �>� � �

>� �;�

>� ���

� .������ � �������

� �>� � ��;

!� ������������

������ � ���� �����

"�#���$

� �� � �;�������

�� �>� � �

>� �;�

>� �*& � >��

'����%� ����� ����=

�*& � >��

�������%�&���

� � �>� � � >��;�

� � <�� ������ � �� ���

��������� ������

����%� *&

�5�$ ��� &������ � ���������� ��� �

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 22: 5.2 ARQ PROTOCOLS | |

��� ��������% ������� �� ���� ��� ������ ��� � ����� ���� ����������� ����� �6�� #� ���� ���� ������ ��� � ���% ����������� � ������� ���=

� � � � ����� >�>; � � >�-�

' ������ � � ��� ��� ���� ����� *� �� ���� %���� ��� ��� �� ��� ����� �������� � ��� �� � ����� �� ��� ���� ���� ������ ���� �� ��� ����� ������� ������ � ��� ���� � ���� ��� ���� �� ��� ���� ���� ������ ���� �� ���� �� � ��� ����� ������ ���� �� ����� �� ����� � ��� ���� ������

#�%��� +�.? �� ��� �� ����� ���������� � ��� ����� '() ���� ����� ������� � ����� ��� ���� ���� ���� ���� ������ ��� �� ��� ����� ������� ��� ��� � � >;.? ���� ������ � >�+ 3�� ������ ��� � ��������������� ���� ���� �� + �� ����� F�7����< ��� &� ������ (����� '() ������� � �6� ?� �� ��� �� ��� ���� &�������*��� '() ����� ���������8������� ��%��� ���� �-+ ��%��� � � ��� �� �� � �� F�7����< '()������� ��8������� ������� � � &� ������ (����� '() �� � � ���� >;�@

��� ���������� � ��� ���������� � &�������*��� '() ���� � ������� ����� +� >;�+� &� ������ (����� '() ������� ��%� ��8������� ��� � %���������%� � � ��� � ���������� � � ����� ��%�� ���� >;�?� <�� ���� �� ������� ��� ������ ��� � �� � ��� ���� �� � ����� � >� �>� >;�?�,>9. � ;�+@� ���� �� � � ��� ����� ��� �� �����

#��� � �� ������ � ��� ������ � � �����% ��� ����� ��%��� ' ��� ����� ��%�� � ��������� ��� ������ � ��� �� ������������ ������ � �������� ������ ��������% ��� ����� ��%�� � ������� ��� ������ ��� � ������������� ����� ���� ����� �%%�� ���� �� ��� %���� ��� ���� ���� �� �������� �� �� � ����� ��%�� � ������6� ��� �������� ��8������� ��#�%��� +�.+ �� �� ��� ����%���� ��8������ �� &�������*���� F�7����<���� &� ������ (����� '() � � ������� � � � *� ������ ��� ��� ����� � �>;�? ��� ����� ��� ���� ��������� ��� ��� ��� � �� ��� ������ ����� �� '� � ������� ��� ����� �6� ��� ��4���� ���� ��� ������ ��� �� ���� �������� ����� �6� ��� � ��� �� #�%��� +�.+� #� &� ������ (����� '()��������% � ������ � ��� ����� ������� ��� ��8������� ����� �� �

+�. '() ���� .9-

η

1

0.8

0.6

0.4

0.2

0

1.E

−01

1.E

−02

5.E

−02

1.E

−03

5.E

−03

1.E

−04

p

5.E

−04

1.E

−05

5.E

−05

1.E

−06

5.E

−06

1.E

−07

5.E

−07

Selective RepeatGo-Back-N

Stop and Wait

%�&'�$ ���9 �������� ��8������ � '() ����

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 23: 5.2 ARQ PROTOCOLS | |

����� � �� � ���� ��� ������� ���� �>� �;�� � ���� ��������% �����8������� �������� �� �� �� ���� ��� ������ � � �� ��� ���%� � @? �>., ����� #� F�7����< '() ��� ������ �� �� � � �� ���� ��� ��������� ��8������ ��� � ��������% � �%���� ��� ������� �� ��8������ ��� ���������� ����� '%��� ��� ������ �� �� � � � �� ��� ���%� @? � >., �����&�������*��� '() � ��� ����� � ���� �6�� �� �� �� �� � � ������ ���� ������ � ��� �� ������������ ������� �������� �� ��� ������ �� �� �� � �� ��� �������� � >;.? �����

$3�����4�*�����0 %���� �C� �� $���� ����

������� ������ � ��� � �� � �� ���� � �� ����� ������ � ��� ������� � ������������ �� �%�� ��� ���� ���� �������� �� ��� ��� ��� ������� �� ��� ���� ������� ���������� ����� ����� ����� ��� ��� � �� #�%��� +�.+ �%%�� �����%��8���� ���������� ��� �� ������� �� ��4����% ��� ����� ��%�� � ��������� ���� ����� ��� 3<� >; ��������� ���� �� �� � ��� 8�� ���� ����� ��� ���� � �����%� � �������� � ��4����% ��� ����� �6� �������� ��� ������ ����%���� �� ���� �������� ��� �� � �� �� ����������� � 3�� ������ ���� ��������� ��� ����� �6� ��������� ������� ��� � ���� ������ ���� ��������� � ��� ������ ��������

�=$��>��" % $%%���$"�B % ��� ����

�� ��� ����� �� ������ ��� ��� � ���� ���� �������� �� ��� � +�.� � �� �� ������ �������� ��8������ �� &�������*��� '()� �� ���� � �� �� ��� ��������%� ��� ���� �������� � �� ���� � ������ ������ "�� �� �� ��� ������ ��������� �������� � �� ���� � ����� ������ �5 ���� �� � � ��������

.9? � '��0( + ����������� ����

η

0.932 64 128 256 512 1024 1536 2048

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

nf

Selective Repeat

Go-Back-N

Stop and Wait

62 32 1710

63

3 3

%�&'�$ ���� I������ ����� �6�

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 24: 5.2 ARQ PROTOCOLS | |

��� �������� �� ��� 8�� � � > �������� ��� �� ���� ��� ��� ��� �������� ����� ����� ���������

��� � � � �>� � ����> �� � � >� .� - � � �

0��� �������� ����� �������� �� ��������� � ������� ����� ����� ��� ��� �������� ����� ��� 8�� ������ �������� �� ������������ ���� �� �� �;� ��� �����%� ��� ���� � ������� � ����� � ��������

������� � �; �� ��>

�� � >�������� � �

� �; �� ��>

�� � >������>� � ����>

� �; ������

>� �

��� ��������% ������� ���� ��� ������ ��� ���� ���� �� %����� ��� ������� ����� ��� ��� ���� �������� ���� ��� ���������� � ��� ��� ��� ��������� �� ���� ���� ���� � �;� ����

����� ��;

>� �

��� ��� ��������� �������� ���� �� &�������*��� '() �

�� �� � ���������

� �>� � �� � ��

�;� �>� � ��;�

��� ��� ������� �������� ��8������ �

� �� � ���������

�� �>� � �

>� ���

>� ���

� .������ � �������

� �>� � ��;

�� ���� ���� ��� ������ � ���� �� ��� �������� ������ � � ������ ������������ �������� ���� ��� ��� ��8������ �� ��� ����� �>� � ��

������ ��� ���� F�7����< '() ����� ��� ����� �6� *& �� ����� ����� ���� ��� ������ ��� �� ���� ��� � ��� ����� ' ������ �� �� �� ��������� � �������� �������� � �� ���� � ����� ������ �� �� �� � �� ����� ��� �� #�%��� +�>?� � � > ���������� � %��� � *& ����� ���� ��� �� ��� ��% � ������ ����� ��������� ��������� ��� �����%���� ���� �������� � �� ���� ��� ����� �

+�. '() ���� .9+

| | | Textbook Table of Contentse-Text Main Menu

▲▲

Page 25: 5.2 ARQ PROTOCOLS | |

������� � � �>���

� ��>

�� � >���� � ��

� � �>���

� ��>

�� � >��>� � ����> �

� � �>���

>� �

� � � �>� ��� � >��

>� �

��� ��� ��������� �������� ���� �� ���� F�7����< '() �

�� �� � ���������

� �>� � �� � ��

� �>� ��� � >�� �� �>� � �

>� �;�

>� ��� � >��

��� ��� ������� �������� ��8������ �

� �� � ���������

�� �>� � �

>� ���

>� ��� � >��

#��� �� �� &� ������ (����� '() ���� �������� ���� ��� �� � � ������������� � ��� ����8� ������ ��������� ��� �����%� ���� �������� �������� � ����� �

������� � � �>�� ��>

�� � >��>� � ����> �

� � �>��

>� �

� � �>

>� �

��� ��� ��������� �������� ���� �� &� ������ (����� '() �

�� � �>� � � >��;�

� ��

��� ��� ������� �������� ��8������ �

� � �>� � � >����

� �

��7 <$� �=����" %'"��"

�� ����� +�. �� ��� � ����� �� ���� � '() ����%������ ���� � I���4������ ����� �� � ������ �� ��� � ������� � � ������� � ���%� ��� ������ ��� � ����������� ������ � �� ��� ����� �� �� �� ��� ������ ����� � ��� '() ���� ��� �� ��� � ������ ���� ��������� ��������� �� ������� ��� �� �� �� ��������� ������� ��� ������ $� ���� �

.9@ � '��0( + ����������� ����

| | | Textbook Table of Contentse-Text Main Menu

▲▲