You are on page 1of 3

CS610-Computer Networks Lecture No.

36

Lecture Handout
Computer Networks
Lecture No. 36

PACKET LOSS AND RETRANSMISSION:


TCP achieves reliability by retransmission. An acknowledgement is used to verify
that data has arrived successfully. If acknowledgement does not arrive, the previous data
is retransmitted. This is shown in the figure below:

Figure 36.1

HOW LONG SHOULD TCP WAIT BEFORE RETRANSMITTING:

The time for acknowledgement to arrive depends on:


• Distance to destination
• Current traffic conditions
Multiple connections can be opened simultaneously. Traffic conditions change
rapidly.

ADAPTIVE RETRANSMISSION:

Setting a timer sounds so easy but the question is “ what time interval?”

______________________________________________________________________________________
Page 1of 3
© Copyright Virtual University of Pakistan
CS610-Computer Networks Lecture No.36

If the time interval is too large, you are spending time waiting for something that
is just not going to happen. If the time interval is too short, you will resend needlessly.
So keep estimate of round trip time on each connection, and use current estimate
to set transmission timer. This is known as ‘Adaptive Retransmission’. This is a key to
TCP’s success.

COMPARISON OF RETRANSMISSION TIMES:

The figure shows a comparison of retransmission times. The network having short
intervals has a short timeout and the network having large interval has large timeout.

Figure 36.2

BUFFER, FLOW CONTROL AND WINDOWS:

TCP uses window mechanism to control the flow of data. The amount of buffer
space available at any time is called the window and a notification that specifies the size
is called the window advertisement.
In the figure below a sequence of messages that illustrates TCP flow control when
the maximum segment size is 1000 octets. A sender can transmit enough data to fill the
currently advertised window.

______________________________________________________________________________________
Page 2of 3
© Copyright Virtual University of Pakistan
CS610-Computer Networks Lecture No.36

Figure 36.3

THREE WAY HANDSHAKE TO CLOSE A CONNECTION:

The figure below shows a three-way handshake to close a connection.


Acknowledgements sent in each direction are used to guarantee that all data has arrived
before the connection is terminated.

Figure 36.4

THREE-WAY HANDSHAKE TO BEGIN A CONNECTION:

Part of the 3-way handshake used to create a connection, requires each end to
generate a random 32-bit sequence number. If an application attempts to establish a new
TCP connection after a computer reboots, TCP chooses a new random number.

______________________________________________________________________________________
Page 3of 3
© Copyright Virtual University of Pakistan

You might also like