TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2...

25
TCP Congestion Control 컴컴컴컴컴컴 컴컴컴컴 컴컴컴 컴 컴컴

description

TCP congestion control3 Introduction Explosive growth in Internet –internet gateways drop 10% of the incoming packets base idea –achieving network stability by forcing the trasport connection to obey a ‘packet conservation’ principle Conservation of packets –A new packet isn’t put into the network until an old packet leaves

Transcript of TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2...

Page 1: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP Congestion Control

컴퓨터공학과 인공지능 연구실서 영우

Page 2: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 2

Contents

• 1. Introduction• 2. Slow-start• 3. Congestion avoidance• 4. Fast retransmit• 5. Fast recovery

Page 3: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 3

Introduction

• Explosive growth in Internet– internet gateways drop 10% of the incoming packets

• base idea– achieving network stability by forcing the trasport conn

ection to obey a ‘packet conservation’ principle• Conservation of packets

– A new packet isn’t put into the network until an old packet leaves

Page 4: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 4

Cont’d

• Conservation of packets – 1. Round-trip-time variance estimation– 2. Exponential retransmit timer backoff– 3. Slow-start– 4. more aggressive receiver ack policy– 5. Dynamic window sizing on congestion

Page 5: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 5

Cont’d• Ways for packet conservation to fail:

– The connection doesn’t get to equilibrium– A sender injects a new packet before an old packet has

exited– The equilibrium can’t be reached because of resource

limits along the path

Page 6: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 6

Slow-start• Definition

– Whenever starting traffic on a new connection or increasing traffic after a period of congestion, start the congestion window at the size of a single segment and increase the congestion window by one segment each time an acknowledgement arrives[Douglas E. Comer, 1995]

– It operates by observing that the rate at which new packets should be injected into the network is the rate at which the acknowledgments are returned by the other end.

Page 7: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 7

Slow-start(1)• Self clocking

– the sender uses acks as a ‘clock’ to strobe new packets into the network– automatically adjust to bandwidth and delay variations and have a wide

dynamic range• slow-start

– to gradually increase the amount of data in-transit• cwnd, add a congestion window to the per-connection state• When starting or restarting after a loss, set cwnd to one packet(typically 536 or 51

2)• On each ack for new data, increase cwnd by one packet• When sending, send the minimum of the receiver’s advertised window and cwnd.

Page 8: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 8

Figure 1: Window Flow Control ‘Self-clocking’

Figure 2: The Chronology of Slow-start

packetsin size window: RTT, : where,

log

WR

WRt

Page 9: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 9

Figure 3: Startup behavior of TCP without slow-start

Figure 4: Startup behavior of TCP with slow-start

Page 10: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 10

Round-trip timing• Good RTT estimator

– the core of the retransmit timer; is the single most important feature of any protocol implementation that expects to survive heavy load.

factor ancedelay vari : ut value,sion timeoretransmis : where, ,

constantgain filter :packet data ackedrecently most thefromt measuremen RTT a :

estimate RTT average the: where,

)1(

RTORRTO

MR

MRR

Page 11: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 11

Round-trip timing (1)• Problem

– it can’t keep up with wide fluctuations in the RTT, causing unnecessary retransmissions.

– Calculating the RTO based on both the mean and variance provides much better response to wide fluctuations in the RTT

deviationmean smoothed the: RTT, smoothed the: where,

)|(| ; ;4

DA

DErrhDDgErrAAAMErrDARTO

Page 12: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 12

Congestion avoidance• Definition

– Upon loss of a segment, reduce the congestion window by half(down to minimum of at least one segment). For those segments that remain in the allowed window, backoff the retransmission timer exponentially[Douglas E. Comer, 1995]

• Assumption– packet loss caused by damage is very small (much less than

1%), therefore the loss of a packet signals congestion somewhere in the network between the source and destination

Page 13: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 13

Congestion avoidance(1)• [Jain, R., Ramakrishan, K., and Chiu, D.-M., 1987]

– The network must be able to signal the transport endpoints that congestion is occurring

– The endpoints must have a policy that decreases utilization if this signal is received and increases utilization if the signal isn’t received.

Page 14: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 14

Congestion avoidance(2)

)1(

:congestionOn pipesize the: window theof size the:),(

intervalat load the: ,: congestion noOn

1

1

max

max1

ddWWLNL

WWWuuWW

iLNL

ii

ii

ii

ii

• DEC/ISO scheme

Page 15: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 15

Congestion avoidance(3)

• Congestion avoidance– On any time out, set cwnd to half the current window si

ze (multiplicative decrease)– On each ack for new data, increase cwnd by 1/cwnd (ad

ditive increase)– When sending, send the minimum of the receiver’s adv

ertised window and cwnd

Page 16: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 16

Figure 8:Multiple, simultaneous TCPs with no congestion avoidance

Figure 9:Multiple, simultaneous TCPs with congestion avoidance

Page 17: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 17

Operations of combined algorithm• Congestion window and slow-start threshold size

– 1. cwnd = one segment size (512, 536), ssthresh = 65535

– 2. TCP output routine never sends more than the min. of cwnd and the receiver’s advertised window

– 3. When congestion occurs, one-half of the current window size, but at is saved in ssthresh

– 4. When new data is acknowledge by the other end, increase cwnd, but the way it increase depends on whether TCP is performing slow start or congestion avoidance

Page 18: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 18

Cont’d

– If cwnd is less than or equal to ssthresh, we’re doing slow start; otherwise we’re doing congestion avoidance

– Additive increase: • Congestion avoidance dictates that cwnd be incremented by 1/

cwnd each time an ACK is received. • to increase cwnd by at most one segment each RTT(regardless

how many ACKs are received in that RTT), whereas slow start will increment cwnd by the number of ACKs received in a RTT.

Page 19: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 19

Visualization of slow start and congestion avoidance

02468

101214161820

0 1 2 3 4 5 6 7RTT

cwnd

(seg

ment

s)

Page 20: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 20

Fast Retransmit• duplicate ACK

– should not be delayed.– to let the other end know that a segment was received out

of order, and to tell it what sequence number is expected.– check the number of duplicate ACKs to be received.

• one or two: reordering of the segments• three or more: lost segments

– performs a retransmission of what appears to be the missing segment, without waiting for a retransmission timer to expire

Page 21: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 21

Fast Recovery

• Definition– After fast retransmit sends what appears to be the

missing segment, congestion avoidance, but not slow start is performed.

– Reason for fast recovery• there is still data flowing between the two ends, and TCP does

not want to reduce the flow abruptly by going into slow start

Page 22: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 22

Operations of combined algorithm

• Steps– 1. When the third duplicate ACK is received, set ssthre

sh to one-half the current cwnd. Retransmit the missing segment. Set cwnd to ssthresh plus 3 times the segment size.

– 2. Each time another duplicate ACK arrives, increment cwnd by the segment size and transmit a packet

Page 23: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 23

Cont’d

– 3. When the next ACK arrives that acknowledges new data, set cwnd to ssthresh. This should be the ACK of the retransmission from step 1. Additionally, this ACK should acknowledge all the intermediate segments sent between the lost packet and the receipt of the first duplicate ACK.

Page 24: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 24

Action VariableSegment#Send Receive Comment Cwnd Ssthresh

initialize 256 65535SYN

timeout 256 512SYN Retransmit

SYN, ACKACK

1 1:257(256)

2 ACK 257 Slow start 512 5123 257:513

(256)4 513:769

(256)5 ACK 513 Slow start 768 5126 769:1025

(256)7 1025:1281

(256)8 ACK 769 Cong.avoid 885 5129 1281:1537

(256)10 ACK 1025 Cong.avoid 991 51211 1537:1793

(256)12 ACK 1281 Cong.avoid 1089 512

8segsize

cwndsegsizesegsizecwndcwnd

Page 25: TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.

TCP congestion control 25

Action VariableSegment#Send Receive Comment Cwnd Ssthresh

58 ACK 6657 ACK ofnew data

2426 512

59 8705:8961(256)

60 ACK 6657 Du.ACK #1 2426 51261 ACK 6657 Du.ACK #2 2426 51262 ACK 6657 Du. ACK#3 1792 102463 6657:6913

(256)Retransmit

64 ACK 6657 Du.ACK #4 2048 102465 ACK 6657 Du.ACK #5 2304 102466 ACK 6657 Du.ACK #6 2560 102467 8961:9217

(256)68 ACK 6657 Du.ACK #7 2816 102469 9217:9473

(256)70 ACK 6657 Du.ACK #8 3072 102471 9473:9729

(256)72 ACK 8961 ACK of

new data1280 1024