![Page 1: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/1.jpg)
ComputerNetworks:ArchitectureandProtocols
CS4450
Lecture23TCPandConges3onControl
Spring2018RachitAgarwal
![Page 2: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/2.jpg)
Recap:WHYsbehindTCPdesign
• Startedfromfirstprinciples
• Correctnessconditionforreliabletransport
• …tounderstandingwhyfeedbackfromreceiverisnecessary(sol-v1)
• …tounderstandingwhytimersmaybeneeded(sol-v2)
• …tounderstandingwhywindow-baseddesignmaybeneeded(sol-v3)
• …tounderstandingwhycumulativeACKsmaybeagoodidea
• VeryclosetomodernTCP
2
![Page 3: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/3.jpg)
Recap:Transportlayer
• Transportlayeroffera“pipe”abstractiontoapplications• Datagoesinoneendofthepipeandemergesfromother
• Pipesarebetweenprocesses,nothosts
• Twobasicpipeabstractions:• Unreliablepacketdelivery(UDP)
• Unreliable(applicationresponsibleforresending)• Messageslimitedtosinglepacket
• Reliablebytestreamdelivery
• Bytesinsertedintopipebysender• Theyemerge,inorderatreceiver(totheapp)
![Page 4: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/4.jpg)
Recap:TransmissionControlProtocol(TCP)
• Reliable,in-orderdelivery• Ensuresbytestream(eventually)arrivesintact
• Inthepresenceofcorruption,delays,reordering,loss
• Connectionoriented• Explicitset-upandtear-downofTCPsession
• Fullduplexstreamofbyteservice
• Sendsandreceivesstreamofbytes,notmessages
• Flowcontrol• Ensuresthesenderdoesnotoverwhelmthereceiver
• Congestioncontrol• Dynamicadaptationtonetworkpath’scapacity
![Page 5: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/5.jpg)
AnyQuestions?
![Page 6: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/6.jpg)
Fromdesigntoimplementation:majornotationchange
• Previouslywefocusedonpackets• Packetshadnumbers
• ACKsreferredtothosenumbers
• Windowsizesexpressedintermsof#ofpackets
• TCPfocusesonbytes,thus• Packetsidentifiedbythebytestheycarry• ACKsrefertothebytesreceived• Windowsizeexpressedintermsof#ofbytes
![Page 7: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/7.jpg)
BasicComponentsofTCP
• Segments,Sequencenumbers,ACKs
• TCPusesbytesequencenumberstoidentifypayloads
• ACKsreferredtosequencenumbers
• Windowsizesexpressedintermsof#ofbytes
• Retransmissions
• Can’tbecorrectwithoutretransmittinglost/corrupteddata
• TCPretransmitsbasedontimeoutsandduplicateACKs
• TimeoutsbasedonestimateofRTT
• FlowControl
• CongestionControl
![Page 8: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/8.jpg)
Segments,SequenceNumbersandACKs
![Page 9: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/9.jpg)
TCP“StreamofBytes”Service
Byte 0Byte 1Byte 2Byte 3
Byte 80
Byte 0Byte 1Byte 2Byte 3
Byte 80
Application @ Host A
Application @ Host B
![Page 10: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/10.jpg)
TCP“StreamofBytes”Service
Byte 0Byte 1Byte 2Byte 3
Byte 80
Byte 0Byte 1Byte 2Byte 3
Byte 80
Application @ Host A
Application @ Host B
TCP Data
TCP Data
Segment sent when 1) Segment full (Max Segment Size)2) Not full, but times out
![Page 11: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/11.jpg)
TCPSegment
• IPPacket• NobiggerthanMaximumTransmissionUnit(MTU)
• E.g.,upto1500byteswithEthernet
• TCPPacket• IPpacketwithaTCPheaderanddatainside• TCPheader>=20byteslong
• TCPSegment
• NomorethanMSS(MaximumSegmentSize)bytes
• E.g.,upto1460consecutivebytesfromthestream
• MSS=MTU-IPheader-TCPheader
IP HdrIP data (datagram)
TCP HdrTCP data (segment)
![Page 12: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/12.jpg)
SequenceNumbers
Host A
K bytes
Sequence number = 1st byte in segment
= ISN + k
Initial Sequence Number (ISN)
TCP DataTCP Hdr
Host B
TCP DataTCP Hdr
ACK Sequence number = next expected byte
= seqno + length(data)
![Page 13: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/13.jpg)
ACKingandSequenceNumbers
• Sendersendssegments(bytestream)
• DatastartswithInitialSequenceNumber(ISN):X
• PacketcontainsBbytes• X,X+1,X+2,…,X+B-1
• Uponreceiptofasegment,receiversendsanACK
• IfalldatapriortoXalreadyreceived:• ACKacknowledgesX+B(becausethatisnextexpectedbyte)
• IfhighestcontiguousbytereceivedissmallervalueY
• ACKacknowledgesY+1• EvenifthishasbeenACKedbefore
![Page 14: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/14.jpg)
TCPHeader
Source Port Destination Port
Sequence Number
Acknowledgement
HdrLen
Checksum
Options (variable)
Data
Urgent Pointer
0 Flags Advertised Window
Starting byte offset of data carried in
this segment
![Page 15: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/15.jpg)
TCPHeader
Source Port Destination Port
Sequence Number
Acknowledgement
HdrLen
Checksum
Options (variable)
Data
Urgent Pointer
0 Flags Advertised Window
Acknowledgement gives sequence
number just beyond highest
sequence number received in order
(“What byte is next”)
![Page 16: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/16.jpg)
TCPConnectionEstablishment
andInitialSequenceNumbers
![Page 17: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/17.jpg)
InitialSequenceNumber(ISN)
• Sequencenumberfortheveryfirstbyte
• E.g.,WhynotjustuseISN=0?
• Practicalissue• IPaddressesandport#suniquelyidentifyaconnection• Eventually,though,theseport#sdogetusedagain• …smallchanceanoldpacketisstillinflight
• TCPthereforerequireschangingISN• Setfrom32-bitclockthatticksevery4microseconds
• …onlywrapsaroundonceevery4.55hours
• Toestablishaconnection,hostsexchangeISNs• Howdoesthishelp?
![Page 18: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/18.jpg)
EstablishingaTCPConnection
• Three-wayhandshaketoestablishconnection• HostAsendsaSYN(open;“synchronizesequencenumbers”)tohostB
• HostBreturnsaSYNacknowledgement(SYNACK)
• HostsendsanACKtoacknowledgetheSYNACK
SYN
ACK
DataData
SYN + ACK
A B
Each host tells its ISN to the other host.
![Page 19: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/19.jpg)
TCPHeader
Source Port Destination Port
Sequence Number
Acknowledgement
HdrLen
Checksum
Options (variable)
Data
Urgent Pointer
0 Flags Advertised Window
Flags:SYNACKFINRSTPSHURG
See /usr/include/netinet/tcp.h on Unix Systems
![Page 20: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/20.jpg)
Step1:A’sInitialSYNPacket
A’s port B’s port
A’s Initial Sequence Number
(Irrelevant since ACK not set)
5 = 20B
Checksum
Options (variable)
Urgent Pointer
0 Flags Advertised Window
Flags:SYNACKFINRSTPSHURG
A tells B it wants to open a connection…
![Page 21: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/21.jpg)
Step2:B’sSYN-ACKPacket
B’s port A’s port
A’s Initial Sequence Number
ACK = A’s ISN plus 1
20B
Checksum
Options (variable)
Urgent Pointer
0 Flags Advertised Window
Flags:SYNACKFINRSTPSHURG
B tells A it accepts and is ready to hear the next byte…
… upon receiving this packet, A can start sending data
![Page 22: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/22.jpg)
Step3:A’sACKoftheSYN-ACK
A’s port B’s port
A’s Initial Sequence Number
ACK = B’s ISN plus 1
20B
Checksum
Options (variable)
Urgent Pointer
0 Flags Advertised Window
Flags:SYNACKFINRSTPSHURG
A tells B it’s likewise okay to start sending
… upon receiving this packet, B can start sending data
![Page 23: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/23.jpg)
TimingDiagram:3-WayHandshaking
SYN, SeqNum = x
ACK, ACK = y+1
SYN + ACK, SeqNum = y, Ack = x + 1
Active Open Passive OpenClient (initiator) Server
listen()
connect()
accept()
![Page 24: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/24.jpg)
AnyQuestions?
![Page 25: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/25.jpg)
TCPRetransmission
![Page 26: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/26.jpg)
TwoMechanismsforRetransmissions
• DuplicateACKs
• Timeouts
![Page 27: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/27.jpg)
LosswithCumulativeACKs
• Sendersendspacketswith100Bandseqnos• 100,200,300,400,500,600,700,800,900
• Assume5thpacket(seqno500)islost,butnoothers
• StreamofACKswillbe
• 200,300,400,500,500,500,500,500
![Page 28: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/28.jpg)
LosswithCumulativeACKs
• DuplicateACKsareasignofanisolatedloss• ThelackofACKprogressmeans500hasn’tbeendelivered
• StreamofACKsmeanssomepacketsarebeingdelivered
• Therefore,couldtriggerresenduponreceivingkduplicateACKs• TCPusesk=3
• Wewillrevisitthisincongestioncontrol
![Page 29: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/29.jpg)
TimeoutsandRetransmissions
• Reliabilityrequiresretransmittinglostdata
• Involvessettingtimersandretransmittingontimeouts
• TCPonlyhasasingletimer
• TCPresetstimerwhenevernewdataisACKed
• Retxpacketcontaining“nextbyte”whentimerexpires
• RTO(RetransmitTimeOut)isthebasictimeoutvalue
![Page 30: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/30.jpg)
RTT
SettingtheTimeoutValue(RTO)
1
1
Timeout
Timeout too long -> inefficient
RTT
1
1Timeout
Timeout too short -> duplicate packets
![Page 31: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/31.jpg)
SettingRTOvalue
• Manyideas
• Seebackupslidesforsomeexamples(notneededforexams)
• Implementationsoftenuseacoarser-grainedtimer
• 500msecistypical
• Incurringatimeoutisexpensive
• SowerelyonduplicateACKs
![Page 32: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/32.jpg)
TCPFlowControl
![Page 33: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/33.jpg)
FlowControl(SlidingWindow)
• AdvertisedWindow:W
• CansendWbytesbeyondthenextexpectedbyte
• ReceiverusesWtopreventsenderfromoverflowingbuffer
• Limitsnumberofbytessendercanhaveinflight
![Page 34: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/34.jpg)
TCPHeader
Source Port Destination Port
Sequence Number
Acknowledgement
HdrLen
Checksum
Options (variable)
Data
Urgent Pointer
0 Flags Advertised Window
![Page 35: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/35.jpg)
ImplementingSlidingWindow
• Sendermaintainsawindow
• DatathathasbeensentoutbutnotyetACK’ed
• Leftedgeofwindow:• Beginningofunacknowledgeddata• MoveswhendataisACKed
• Windowsize=maximumamountofdatainflight
• Receiversetsthisamount,basedonitsavailablebufferspace
• Ifithasnotyetsentdatauptotheapp,thismightbesmall
![Page 36: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/36.jpg)
AdvertisedWindowLimitsRate
• SendercansendnofasterthanW/RTTbytes/sec
• InoriginalTCP,thatwasthesoleprotocolmechanismcontrolling
sender’srate
• What’smissing?
• CongestioncontrolabouthowtoadjustWtoavoidnetworkcongestion
![Page 37: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/37.jpg)
AnyQuestions?
![Page 38: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/38.jpg)
TCPCongestionControl
![Page 39: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/39.jpg)
TCPcongestioncontrol:high-levelidea
• Endhostsadjustsendingrate
• Basedonimplicitfeedbackfromthenetwork
• Implicit:routerdropspacketsbecauseitsbufferoverflows,notbecauseit’stryingtosendmessage
• Hostsprobenetworktotestlevelofcongestion• Speedupwhennocongestion(i.e.,nopacketdrops)• Slowdownwhenwhencongestion(i.e.,packetdrops)
• Howtodothisefficiently?• ExtendTCP’sexistingwindow-basedprotocol…• Adaptthewindowsizebasedinresponsetocongestion
![Page 40: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/40.jpg)
AllTheseWindows…
• Flowcontrolwindow:AdvertisedWindow(RWND)
• Howmanybytescanbesentwithoutoverflowingreceiversbuffers
• Determinedbythereceiverandreportedtothesender
• CongestionWindow(CWND)
• Howmanybytescanbesentwithoutoverflowingrouters
• Computedbythesenderusingcongestioncontrolalgorithm
• Sender-sidewindow=minimum{CWND,RWND}
• AssumeforthislecturethatRWND>>CWND
![Page 41: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/41.jpg)
Note
• ThislecturewilltalkaboutCWNDinunitsofMSS
• RecallMSS:MaximumSegmentSize,theamountofpayloaddata
inaTCPpacket
• Thisisonlyforpedagogicalpurposes
• KeepinmindthatrealimplementationsmaintainCWNDinbytes
![Page 42: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/42.jpg)
BasicsofTCPCongestion
• CongestionWindow(CWND)
• Maximum#ofunacknowledgedbytestohaveinflight
• Rate~CWND/RTT
• Adaptingthecongestionwindow• Increaseuponlackofcongestion:optimisticexploration
• Decreaseupondetectingcongestion
• Buthowdoyoudetectcongestion?
![Page 43: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/43.jpg)
NotAllLossestheSame
• DuplicateACKs:isolatedloss• StillgettingACKs
• Timeout:possibledisaster
• NotenoughduplicateACKs• Musthavesufferedseverallosses
![Page 44: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/44.jpg)
HowtoAdjustCWND?
• Consequencesofover-sizedwindowmuchworsethanhavinganunder-sizedwindow
• Over-sizedwindow:packetsdroppedandretransmitted
• Under-sizedwindow:somewhatlowerthroughput
• Approach• Gentleincreasewhenun-congested(exploration)• Rapiddecreasewhencongested
![Page 45: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/45.jpg)
AdditiveIncrease,MultiplicativeDecrease(AIMD)
• Additiveincrease• Onsuccessoflastwindowofdata,increasebyoneMSS
• IfWpacketsinarowhavebeenACKed,increaseWbyone
• i.e.,+1/WperACK
• Multiplicativedecrease
• OnlossofpacketsbyDupACKs,dividecongestionwindowbyhalf• Specialcase:whentimeout,reducecongestionwindowtooneMSS
![Page 46: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/46.jpg)
AIMD
• ACK:CWND->CWND+1/CWND
• WhenCWNDismeasuredinMSS
• Note:afterafullwindow,CWNDincreaseby1MSS
• Thus,CWNDincreasesby1MSSperRTT
• 3rdDupACK:CWND->CWND/2
• Specialcaseoftimeout:CWND->1MSS
![Page 47: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/47.jpg)
LeadstotheTCPSawtooth
Loss
Halved
Window
t
![Page 48: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/48.jpg)
AnyQuestions?
![Page 49: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/49.jpg)
SlowStart
![Page 50: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/50.jpg)
AIMDStartsTooSlowlyWindow
tIt could take a long time to get started!
Need to start with a small CWND to avoid overloading the network
![Page 51: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/51.jpg)
BandwidthDiscoverywithSlowStart
• Goal:estimateavailablebandwidth
• Startslow(forsafety)• Butrampupquickly(forefficiency)
• Consider• RTT=100ms,MSS=1000bytes
• Windowsizetofill1MbpsofBW=12.5MSS
• Windowsizetofill1Gbps=12,500MSS
• WithjustAIMD,ittakesabout12500RTTstogettothis
windowsize!
• ~21mins
![Page 52: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/52.jpg)
“SlowStart”Phase
• Startwithasmallcongestionwindow
• Initially,CWNDis1MSS
• So,initialsendingrateisMSS/RTT
• Thatcouldbeprettywasteful• Mightbemuchlessthantheactualbandwidth
• Linearincreasetakesalongtimetoaccelerate
• Slow-startphase(actually“faststart”)• Senderstartsataslowrate(hencethename)
• …butincreasesexponentiallyuntilfirstloss
![Page 53: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/53.jpg)
SlowStartinAction
Src
Dst
1 2 3 4 8
Double CWND per round-trip time
Simple implementation: on each ACK, CWND += MSS
D A D AD A DA
DA
DA
DA
![Page 54: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/54.jpg)
SlowStartandtheTCPSawtoothWindow
tExponential “slow start”
Why is it called slow-start? Because TCP originally had no congestion control mechanism. The source would just start by sending a whole window’s worth of data.
![Page 55: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/55.jpg)
Slow-StartvsAIMD
• WhendoesasenderstopSlow-StartandstartAdditiveIncrease?
• Introducea“slowstartthreshold”(ssthresh)• Initializedtoalargevalue• Ontimeout,ssthresh=CWND/2
• WhenCWND>ssthresh,senderswitchesfromslow-starttoAIMD-style
increase
![Page 56: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/56.jpg)
Timeouts
![Page 57: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/57.jpg)
LossDetectedbyTimeout
• SenderstartsatimerthatrunsforRTOseconds
• RestarttimerwheneverACKfornewdataarrives
• Iftimerexpires
• SetSSHTHRESH<-CWND/2(“SlowStartThreshold”)
• SetCWND<-1(MSS)
• Retransmitfirstlostpacket
• ExecuteSlowStartuntilCWND>SSTHRESH
• AfterwhichswitchtoAdditiveIncrease
![Page 58: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/58.jpg)
SummaryofIncrease
• “Slowstart”:increaseCWNDby1(MSS)foreachACK
• Afactorof2perRTT
• Leaveslow-startregimewheneither:
• CWND>SSTHRESH
• Packetdropdetectedbydupacks
• EnterAIMDregime
• Increaseby1(MSS)foreachwindow’sworthofACKeddata
![Page 59: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/59.jpg)
SummaryofDecrease
• CutCWNDhalfonlossdetectedbydupacks
• Fastretransmittoavoidoverreacting
• CutCWNDallthewayto1(MSS)ontimeout
• SetssthreshtoCWND/2
• NeverdropCWNDbelow1(MSS)
• Ourcorrectnesscondition:alwaystrytomakeprogress
![Page 60: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/60.jpg)
TCPCongestionControlDetails
![Page 61: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/61.jpg)
Implementation
• Stateatsender• CWND(initializedtoasmallconstant)
• ssthresh(initializedtoalargeconstant)• dupACKcount• Timer,asbefore
• Eventsatsender• ACK(newdata)• dupACK(duplicateACKforolddata)• Timeout
• Whataboutreceiver?JustsendACKsuponarrival
![Page 62: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/62.jpg)
Event:ACK(newdata)
• Ifinslowstart• CWND+=1 CWND packets per RTT
Hence after one RTT with no drops:
CWND = 2 x CWND
![Page 63: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/63.jpg)
Event:ACK(newdata)
• IfCWND<=ssthresh
• CWND+=1
• Else• CWND=CWND+1/CWND
CWND packets per RTTHence after one RTT with
no drops:CWND = CWND + 1
Slow Start Phase
Congestion Avoidance Phase(additive increase)
![Page 64: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/64.jpg)
Event:Timeout
• OnTimeout
• ssthresh<-CWND/2
• CWND<-1
![Page 65: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/65.jpg)
Event:dupACK
• dupACKcount++
• IfdupACKcount=3/*fastretransmit*/
• ssthresh<-CWND/2
• CWND<-CWND/2
Remains in congestion avoidance after fast
retransmission
![Page 66: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/66.jpg)
TimeDiagramWindow
tSlow start in operation until it
reached half of previous CWND, i.e., SSThresh
Slow-start restart: Go back to CWND of 1 MSS, but take advantage of knowing the previous value of CWND.
Fast Retransmission Timeout SSThresh Set to here
![Page 67: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/67.jpg)
TCPFlavors
• TCPTahoe• CWND=1ontripledupACK
• TCPReno• CWND=1ontimeout
• CWND=CWND/2ontripledupACK
• TCP-newReno• TCP-Reno+improvedfastrecovery
• TCP-SACK• Incorporatesselectiveacknowledgements
Our default assumption
![Page 68: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/68.jpg)
Done!
Nextlecture:CriticalAnalysisofTCP
![Page 69: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/69.jpg)
TCPBackupslides
![Page 70: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/70.jpg)
CouldBaseRTOonRTTEstimation
• UseexponentialaveragingifRTTsamples
SampleRTT = AckRcvdTime - SendPktTimeEstimatedRTT = ⍺ x EstimatedRTT + (1-⍺) x SampledRTT
0 < ⍺ <= 1
EstimatedRTT
Time
SampleRTT
![Page 71: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/71.jpg)
ExponentialAveragingExample
EstimatedRTT = ⍺ x EstimatedRTT + (1-⍺) x SampledRTT (Assume RTT is constant => SampleRTT = RTT)
RTT
time0 1 2 3 4 5 6 7 8 9
EstimatedRTT (α = 0.8)
EstimatedRTT (α = 0.5)
![Page 72: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/72.jpg)
ExponentialAveraginginAction
Set Timeout Estimate (ETO) = 2 x EstimatedRTT
From Jacobson and Karels, SIGCOMM 1988
![Page 73: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/73.jpg)
Jacobson/KarelsAlgorithm
• Problem:needtobettercapturevariabilityinRTT
• Directlymeasuredeviation
• Deviation=|SampleRTT-EstimatedRTT|
• EstimatedDeviation:exponentialaverageofDeviation
• ETO=EstimatedRTT+4xEstimatedDeviation
![Page 74: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/74.jpg)
WithJacobson/Karels
![Page 75: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/75.jpg)
Problem:AmbiguousMeasurements
• HowdowedifferentiatebetweentherealACK,andACKoftheretransmittedpacket?
Sampled RTT
Original TransmissionSampled
RTT
Retransmission
Original Transmission
RetransmissionACK
ACK
![Page 76: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/76.jpg)
TCPTimers
• Twoimportantquantities
• RTO:valueyousettimertofortimeouts
• ETO:currentestimateofappropriate“raw”timeout
• Useexponentialaveragingtoestimate
• RTT• Deviation=|EstimatedRTT-SampleRTT|
• ETO=EstimatedRTT+4xEstimatedDeviation
![Page 77: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/77.jpg)
UseOnly“Clean”SamplesforETO
• OnlyupdateETOwhenyougetacleansample
• WherecleanmeansACKincludesnoretransmittedsegments
![Page 78: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/78.jpg)
Example
• Send100,200,300• 100meanspacketwhosefirstbyteis100,lastbyteis199
• ReceiveA200• A200meansbytesupto199rep’d,expecting200next
• Cleansample
• 200timesout,resend200,receiveA300
• Nocleansamples
• Send400,500,receiveA600• Cleansamples
![Page 79: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/79.jpg)
SettingRTO
• EverytimeRTOtimerexpires,setRTO<-2.RTO
• Uptomaximum>=60sec
• EverytimecleansamplearrivessetRTOtoETO
![Page 80: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/80.jpg)
Example
• FirstarrivingACKexpects100(adv.window=500)• InitializeETP;RTO=ETO• RestarttimerforRTOseconds(newdataACK’ed)
• RememberTCPonlyhasonetimer,nottimerperpacket
• Sendpackets100,200,300,400and500
• ArrivingACKexpects300(A300)• UpdateETO;RTO=ETO• RestarttimerforRTOseconds(newdataACKed)
• Sendpackets600,700
• ArrivingACKexpects300(A300)
![Page 81: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/81.jpg)
Example(cont’d)
• Timergoesoff
• RTO=2*RTO(backofftimer)
• RestarttimerforRTOseconds(ithadexpired)
• Resendpacket300
• ArrivingACKexpects800• Don’tupdateETO(ACKincludesaretransmission)
• RestarttimerforRTOseconds(newdataACKed)
• Sendpackets800,900,1000,1100,1200
![Page 82: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/82.jpg)
Example(cont’d)
• ArrivingACKexpects1000• UpdatesETO;RTO=ETO• RestarttimerforRTOseconds(newdataACKed)
• Sendpackets1300,1400
• …Connectioncontinues…
![Page 83: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/83.jpg)
Example
• ConsideraTCPconnectionwith:• CWND=10packets
• LastACKwasforpacket#101• i.e.,receiverexpectingnextpackettohaveseqno101
• 10packets[101,102,103,…,110]areinflight• Packet101isdropped• WhatACKsdotheygenerate?
• Andhowdoesthesenderrespond?
![Page 84: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/84.jpg)
Timeline
• ACK101(dueto102)CWND=10dupACK#1(noxmit)
• ACK101(dueto103)CWND=10dupACK#2(noxmit)
• ACK101(dueto104)CWND=10dupACK#3(noxmit)
• RETRANSMIT101ssthresh=5CWND=5
• ACK101(dueto105)CWND=5(noxmit)
• ACK101(dueto106)CWND=5(noxmit)
• ACK101(dueto107)CWND=5(noxmit)
• ACK101(dueto108)CWND=5(noxmit)
• ACK101(dueto109)CWND=5(noxmit)
• ACK101(dueto110)CWND=5(noxmit)
• ACK111(dueto101)<-onlynowcanwetransmitnewpackets
• PlusnopacketsinflightsonoACKsforanotherRTT
Note that you do not restart dupACKcounter
on same packet!
![Page 85: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/85.jpg)
Solution:FastRecovery
• Idea:Grantthesendertemporary“credit”foreachdupACKsoasto
keeppacketsinflight(eachACKduetoarrivingpkt)
• IfdupACKcount=3• ssthresh=CWND/2
• CWND=ssthresh+3
• Whileinfastrecovery
• CWND=CWND+1foreachadditionalduplicatepet
• ExitfastrecoveryafterreceivingnewACK• SetCWND=ssthresh(whichhadbeensettoCWND/2afterloss)
![Page 86: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/86.jpg)
Example
• ConsideraTCPconnectionwith:• CWND=10packets
• LastACKwasforpacket#101• i.e.,receiverexpectingnextpackettohaveseqno101
• 10packets[101,102,103,…,110]areinflight• Packet101isdropped
![Page 87: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/87.jpg)
Timeline
• ACK101(dueto102)CWND=10dupACK#1(noxmit)
• ACK101(dueto103)CWND=10dupACK#2(noxmit)
• ACK101(dueto104)CWND=10dupACK#3(noxmit)
• RETRANSMIT101ssthresh=5CWND=8(5+3)
• ACK101(dueto105)CWND=9(noxmit)
• ACK101(dueto106)CWND=10(noxmit)
• ACK101(dueto107)CWND=11(xmit111)
• ACK101(dueto108)CWND=12(xmit112)
• ACK101(dueto109)CWND=13(xmit113)
• ACK101(dueto110)CWND=14(xmit114)
• ACK111(dueto101)CWND=5(xmit115)<-exitingfastrecovery
• Packets111-114alreadyinflight(andnotsending115)• ACK112(dueto111)CWND=5+1/5<-backtocongestionavoidance
![Page 88: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/88.jpg)
TCP“Phases”
• Slow-start• Enterontimeout
• LeavewhenCWND>ssthresh(toCong.Avoid.)
• The>onlyapplieshere…
• CongestionAvoidance• Leavewhentimeout
• Fastrecovery• EnterwhendupACK=3• LeavewhenNewACKorTimeout
![Page 89: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/89.jpg)
TCPStateMachine
congestn. avoid.
fast recovery
slow start
Timeout
CWND > ssthresh
Timeout
Timeoutnew ACK
dupACK=3 dupACK=3
new ACK
dupACK
dupACK
new ACK
dupACK
![Page 90: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/90.jpg)
TCPStateMachine
congestn. avoid.
fast recovery
slow start
Timeout
CWND > ssthresh
Timeout
Timeoutnew ACK
dupACK=3 dupACK=3
new ACK
dupACK
dupACK
new ACK
dupACK
![Page 91: lecture23-congestion-control - Cornell University€¦ · TCP congestion control: high-level idea • End hosts adjust sending rate • Based on implicit feedback from the network](https://reader036.vdocuments.site/reader036/viewer/2022062604/5fc02176e8c1a956c8483e28/html5/thumbnails/91.jpg)
TCPStateMachine
congestn. avoid.
fast recovery
slow start
Timeout
CWND > ssthresh
Timeout
Timeoutnew ACK
dupACK=3 dupACK=3
new ACK
dupACK
dupACK
new ACK
dupACK