Date: Fri, 22nd Aug, 2003

ACN Lecture no:11

Scribe by: Rajesh Chepuri (Y3111036)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

TCP Round trip estimation:

TCP os an acknowledgement based protocol, and it needs to timout before it can retransmit. The variance in RTT is very huge, so we need to estimate it dynamically.

EWMA : Exponentially Weighted Moving Average

SRTT : Smoothed RTT

The formula for calulating SRTT is ..

SRTT = alpha * SRTT + (1 - alpha) * RTT_i

In this we have used the feedback of the previous SRTT value to caluculate the present SRTT. RTT_i is the present estimate of RTT. So here the change in SRTT is controlled by 'alpha'. The range of 'alpha' is.

0 < alpha < 1

If 'alpha' value is large then the value of SRTT is retaining much of its
previous value. It is resilient to spikes in RTT. If 'alpha' value is small
then the SRTT value will change more rapidly with the present RTT. Experiment
results shows that the RTT usually does not vary rapidly, spikes are short
lasting. The typical value of 'alpha' is choosen to be 7/8. Initially, RTO = beta * SRTT.

Then the question is What should be the value of beta?
If beta is smaller eg: 1 then there is a greater chance that the timeout will
occur before ack will be received. This is really not desired. It wastes bandwidth.
If the value of beta is larger then eg:5 then the delay in retransmitting
the lost packets is large. Then the sender need to wait longer times. Initially
people thought that beta = 2 is sufficient. But generally the value
of beta is not fixed, it must be varied according to the present network conditions.
The value of RTO is caluculated by following formula which includes variance
in RTT. RTO = SRTT + 4 * RTT_Var.

We can change RTO according the number of retrasmits of a given packet. We use exponential back off algorithm for his. In this first time when we send a packet if timeout occured, then the packet is sent again but we now double the RTO. In this way the RTO is keeps on incresing upto some value, after that we can declare that the host is unreacheable.

There is a problem in caluculating the RTT_i(the present RTT estimate) whenever retransmit occur. When the retrasmit is occured the same packet may be sent many times utill it reaches. The problem is taking which trasnmission into consideration in caluculating RTT_i.

The choices are ...

1. First Transmission.

2. Last Transmission.

3. Ignore RTT sample.

The problems in each case are discussed below.

1.

2.

First Timeout Ack of Ack of

Transmission Retransmission First Trans. Retransmission

Time Line -------------------|-----------------------------------|------------------|--------------------|----------------------------------------------------------------------------

\

We will take this

as the ack for the retrasmission

So after retrasmitting the paket if the ack for the initial trasmission comes then we decide that it is ack for retrasmission and we use this time for estimating RTT.

3.

This is really big problem, because what we really need is to change the RTT according the network conditions. But we are not doing it here.

Karn's Algorithm: It states that, if a retransmission occured then ignore the sample in caluculating the RTT, but maintain backed-off RTO until valid RTT sample comes.

We can also use timestamps to solve this problem. But it involves overhead and the present algorithms for header compression doesnot include timestamps.

(

When in a transmission if a packet is lost then the receiver send ack reqesting that lost packets. The sender will send packet if timeout for that packet occurs. But in fast retransmission, the sender will not wait for timeout, it will retransmit if there are consequetive acks for the request of packet is received. The sender will retransmit a packet after it receives three duplicate acks for request of that packet comes. This is called Fast retransmission because it is not waiting for timeout before retranmitting the lost packet.

ie, TCP detects packet loss by lookingfor packet reordering. Three out-of-order packets => Three dup-acks => Conclude packet loss.

The following algorithm is Fast Recovery.

ssthresh = CWND / 2 /* When the number of dup-acks =3 then the congession window must be halved. */

CWND = ssthresh + 3

CWND++ for each dup-ack received.

On receiving first "fresh" ack

CWND = ssthresh.

( terms:- ssthresh : slow start thresh hold., CWND : congestion window)

Congestion avoidance:

Now let us see how the congestion window behaves if retransmit occurs.

Let the size of congestion window is W, ie CWND = W, and the seqence number U is dropped. Let us assume that U is the starting of window. Therefore the packets in transit are [U,U+W). Now when the ack for the request of U arrives, the congestion window is pulled back to W/2. The size of congestion window is W, so in one RTT, W-1 dup-acks arrives.The number of new packets sent are W/2 - 1. Therefore the total number of packets sent are [U,U+W/2+W-1]. So now the new ack arrives asking for packet sequence U+W. So in total for W-1 acks the sender has sent only W/2 -1 new packets and for first W/2 dup-acks the sender does nothing. So the bottleneck clears.