Vous êtes sur la page 1sur 14

Retransmission Strategy

TCP doesnt like link control protocols had REJ or SREJ. It relies timer timeout to do the retransmission Two evens will retransmission
segment error or segment loss acknowledgment error or loss

Retransmission timer is a key design issue in TCP


if too small, there will be many unnecessary retransmissions if too large, will be sluggish in responding to a lost segment. The timer should be longer than the round trip delay

Two strategies for the retransmission timer value


fixed timer: inability to respond the network conditions adaptive timer

Adaptive Retransmission Timer


estimate the current round-trip delay by observing the pattern of delay for recent segments
1 K +1 RTT (i ) K + 1 i =1 K 1 = ARTT ( K ) + RTT (K + 1) K +1 K +1 RTT(i): the ith transmitted segment round-trip time ARTT(K): is the average round-time time for the first K segments each term is given equal weight => 1/(K+1) we like to give greater weight to more recent instances because they are more likely to reflect future behavior ARTT ( K + 1) =

SRTT ( K + 1) = SRTT ( K ) + (1 ) RTT ( K + 1)


SRTT(K): smoothed round-trip time estimate

SRTT ( K + 1) = SRTT ( K ) + (1 ) RTT ( K + 1) = (1 ) RTT ( K + 1) + (1 ) RTT ( K ) + 2 (1 ) RTT ( K 1) + ... + K (1 ) RTT (1) + ( K +1) RTT ( 0)

small value of
advantage: quickly reflect a rapid change in the observed quantity disadvantage: jerky changes in the average

The retransmission timer should be greater than the estimated round-trip time
RTO (K+1) = SRTT (K+1) + RTO: retransmission time out value, the should proportional to SRTT RTO(K+1) = MIN(UBOUND, MAX(LBOUND, *SRTT(K+1))

Example values: between 0.8 and 0.9 between 1.3 and 2.0

TCP Implementation Policy Options


Send Policy (Sending TCP entity is free to transmit data)
sending with infrequency and large segment:
low overhead (protocol overhead and processing overhead)

sending with frequency and small segment


providing quick response

Deliver Policy (receiving TCP entity is free to deliver data to AP)


if deliveries are infrequent and large
high buffering delay

if deliveries are frequent and small


unnecessary number of operating-system interrupts

Accept Policy
in order : any segment that arrives out of order is discarded in window : accept all segments that are within the receive window

Retransmit Policy
First only: maintain one retransmission timer for the entire queue
if ACK is received, remove the appropriate segment and reset the timer if timer expires, retransmit the first segment of the queue and reset timer

Batch: maintain one retransmission timer for the entire queue


if ACK is received, remove the appropriate segment and reset the timer if timer expires, retransmit all segments in the queue and reset the timer

Individual: maintain one timer for each segment in the queue

Acknowledge Policy
Immediate: when data are accepted, immediately transmit an empty ACK segment Cumulative: piggyback acknowledgment, to avoid long delay, set a window timer, if timer expires, transmit an empty ACK segment
complicate the task of estimating round-trip delay by the sending TCP entity

TCP Congestion Control


Congestion will reduce availability and throughput and lengthened response times How to control the congestion
limit the total amount of data entering the internet to the amount that the internet can carry

TCP/IP-based network is difficult to do the congestion control


IP (network) is connectionless, much less for controlling congestion (ICMP Source Quench message) TCP provides only end-to-end flow control (sliding windows flow and error control mechanism), indirect to speculate network congestion (unreliable) no cooperative, distributed algorithm to bind together the various TCP entities.

TCP Flow and Congestion Control


Sliding-windows provides a way for the receiver to pace the sender The rate at a TCP can send data is determined by the rate of incoming ACK to previous segments The rate of ACK arrival is determined by the bottleneck in the round-trip path, and the bottleneck may be either the destination and the internet TCPs self-clocking behavior: TCP automatically senses the network bottleneck and regulates its flow.

the bottleneck is in the internet (Pb=Pr=Ar=Ab)

the bottleneck is in the destination

the receives ACKs may reflects the status of the internet (congestion control) or the status of the destination (flow control) , but TCP doesnt understand
if network congestion: TCP slower the send rate
physical congestion (link): reduce the amount of the data during T logical congestion (router): reduce the number of the packet dur ing T

if destination congestion: to revise the TCP send policy

The fluctuations in delays that are inherent in an IP-based internet present a challenge in designing flow policies for TCP sources
If TCP flows are too slow, then the internet is underutilized If one or a few TCP sources use excessive capacity, then other TCP flows will be crowded out If many TCP sources use excessive capacity, then segments will be lost in transit, forcing retransmission, or ACK will be excessively dela yed, triggering unnecessary retransmissions as sources time out
The retransmission can have a positive feedback effect (as more segments are retransmitted, congestion grows make the congestion problem even worse

Some TCP congestion control methods with TCP sliding windows mechanism is proposed

Retransmission Timer Management


The techniques for retransmission timer (TOR) have
RTT variance estimation Exponential RTO backoff Karn algorithm s

RTT variance Estimation (Jacobsons algorithm)


the adaptive round-trip timer does not cope well with the high variance round-trip time
RTO (K+1) = * SRTT (K+1), if =2 is used in a stable environment, with low variance of RTT, the RTO too high in an unstable environment, the RTO may too low to against unnecessary retransmissions

goal: estimate the variability in RTT values and use it to calculate the RTO
use mean deviation to avoid square and square too calculation (standard deviation) MDEV (K+1) = E[|X-E[X]|] apply the estimate MDEV to estimate the RTT deviation

AERR(K+1) = RTT(K+1) - ARTT(K), where AERR(K+1) is the deviation measured at time K+1 Then using simple average to estimate MDEV
ADEV ( K + 1) = 1 K =1 | AERR(i) | K + 1 i =1 K 1 = ADEV ( K ) + | AERR( K + 1) | K +1 K +1

Where ADEV(K): average deviation. Each term is multiplied by the same constant 1/(K+1), equal weight we would like to give greater weight to more recent instances because they are more likely to reflect future behavior SRTT(K+1) = (1-g)*SRTT(K) + g*RTT(K+1) SERR(K+1) = RTT(K+1) - SRTT(K) SDEV(K+1) = (1-h)*SDEV(K) + h*|SERR(K+1)| RTO(K+1) = SRTT(K+1) + f * SDEV(K+1)

Exponential RTO Backoff


Maintaining the same RTO value is ill advised If timeout may be mean network congestion => difficult to absorb the traffic into an internet => if wait a local RTO time and retransmit yet again => increase congestion and discard
TCP source increase its RTO when the same segment is retransmitted => call backoff process RTO[i+1] = q * RTO[i] most commonly used value of q is 2 => binary exponential backoff (like Ethernet CSMA/CD protocol)

Karns Algorithm
Goal : to derive accurate RTT ex: if one segment timeout and retransmission, then receive an ACK
the ACK is first transmission the ACK is the second transmission Feeding false RTT into Jacobsons algorithm => error SRTT (RTO). The error effect propagates forward a number of iterations

Karns algorithm
do not use measured RTT for a retrnsm. Segment to update SRTT and SDEV if retransmission occurs, calculate the backoff RTO use the backoff RTO value for succeeding segment until an ACK arrives for a segment that has not been retransmitted

Window Management
Sending Window Management technique
Slow start Dynamic window sizing on congestion Fast retransmit Fast recovery

TCP operation goals


To make an efficient use of the available bandwidth
TCP prefers to send data in MSS-size

Flow control: cant overrun its peers buffers


TCP send window s

Congestion control
If suddenly inject a large number of segments into the network, router buffer space could become exhausted (dropped datagrams)
Use congestion window to control network congestion slow start

Slow start
When a connection is first initialized, it has no the selfclock information for pacing to guide it
for the large window size, it is risky for the sender flood large segments (allowed by windows size), the flow may incur internet congestion awnd = MIN[credit,cwnd] awnd : allowed window, in segments cwnd : congestion window, in segments credit : the amount of unused credit granted in the most recent acknowledgement, in segment (send window) s new connection is opened, => initialized cwnd = 1 (allow send 1 segment) each time an ACK is received => cwnd = cwnd + 1 (grows exponentially) probe the internet to make sure that it is not sending too many until the cwnd reaches a slow start threshold (is controlled by the incoming ACKs, the network is stable), the slow start is over, and another algorithm, congestion avoidance, takes over

Effect of slow start

Dynamic Window Sizing on Congestion


Slow start enables the TCP sender to quickly determine a reasonable window size for the connection
Before or after cwnd reaches the size of the credit allocated by the receiver side, a segment is loss (timeout) means congestion is occurring The network may take a long time to clear the congestion thus the exponential growth of cwnd under slow start may be too aggressive use congestion avoidance algorithm

Congestion avoidance
if congestion, separate the cwnd growing into two sections. In the former section, the cwnd with exponential growth (slow start). In the last section, the window size increase slowly that let more time for internet to clear congestion When timeout, the algorithm is
set ssthresh (slow-start threshold) = cwnd/2 set cwnd = 1 and perform slow-start process until cwnd = ssthresh for cwnd >= ssthresh, increase cwnd by one for each round-trip time

Slow start followed by congestion avoidance


when CWND = 16 occurs timeout

Illustration of slow start and congestion avoidance


It takes 11 round-trip time to recover the cwnd (3+8)

Window Management
RTO is set grater than the estimated round-trip time SRTT
the RTO is estimated from past values of RTT. If delays in the network fluctuate => RTO may be smaller than the actual RTT if delays at the DA fluctuate, the estimated RTT becomes unreliable the DA may not ACK each segment but cumulatively ACK multiple segments => contribute to fluctuation in RTT

if segment lost, TCP slower to retransmit (large RTO, backoff)


DA using in-order accept policy => many segment may be lost DA using in-window accept policy, if retransmssion of the missing segment is delayed too long, B will have to begin discarding incoming segment

solve method : Fast retransmit and fast recovery

Fast Retransmission
If DA receives a segment out of order
immediately issue an ACK for the previous segment continue to repeat this ACK with each incoming segment until the missing segment arrive if the hole is plugged, send a cumulative ACK for all of the inorder segment

When SA receives a duplicate ACK


means: 1. Previous ACK delay=> timeout=> retransmit => ack, 2. Segment is loss, an early warning system to tell the source TCP that a segment has been lost and must be retransmitted . to make sure which case (1 or 2), Jacobson recommends that TCP wait until it receives three duplicate ACK (total is 4 ACKs) then retransmit the segment (in case 2

Fast retransmit process

Fast Recovery
Different with the slow start and dynamic windows sizing on congestion if SA received multiple duplicate ACK before timeout => mean that the network have good quality => avoid the initial exponential slow-start process
when the third duplicate ACK arrives (not yet timeout occur)
a set ssthresh = cwnd/2 retransmit the missing segment (fast retransmission) set cwnd = ssthresh + 3 (not set to 1) each time an additional duplicate ACK for the same segment arrives, increasecwnd by 1 and transmit a segment if possible (means additional segment thas has left the network and that triggered the duplicate ACK) when the next ACK arrives to ack new data => set cwnd = ssthresh

the example of the fast recovery


Window size

Last ack seq #

The source can transmit one additional segment for each duplicate ACK received. In this example, the source is unable to transmit any segment until cwnd regains its former value

Stable part, cwnd reaches to credit allocation

ssthresh+3

Linear congestion avoidance mode

Vous aimerez peut-être aussi