0% found this document useful (0 votes)
51 views

ECS503 Transport Layer: Reliable Transfer, TCP and Conges On Control

This document discusses reliable data transfer protocols (RDT) at the transport layer. It begins by introducing RDT 1.0 which provides reliable transfer over a reliable channel with no errors or packet loss. It then describes RDT 2.0 which adds mechanisms to handle bit errors and packet loss on an unreliable channel, including error detection, acknowledgments (ACKs), and negative acknowledgments (NAKs). The document goes on to present finite state machine specifications for the sender and receiver sides of RDT 2.0 and discusses how it handles both normal operation and error scenarios. It also addresses flaws in RDT 2.0 and presents improved protocols RDT 2.1 and RDT 2.2.

Uploaded by

Nikil Menon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

ECS503 Transport Layer: Reliable Transfer, TCP and Conges On Control

This document discusses reliable data transfer protocols (RDT) at the transport layer. It begins by introducing RDT 1.0 which provides reliable transfer over a reliable channel with no errors or packet loss. It then describes RDT 2.0 which adds mechanisms to handle bit errors and packet loss on an unreliable channel, including error detection, acknowledgments (ACKs), and negative acknowledgments (NAKs). The document goes on to present finite state machine specifications for the sender and receiver sides of RDT 2.0 and discusses how it handles both normal operation and error scenarios. It also addresses flaws in RDT 2.0 and presents improved protocols RDT 2.1 and RDT 2.2.

Uploaded by

Nikil Menon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 89

1

School of Electronic Engineering and Computer Science


LCSS03
1ransport |ayer:
ke||ab|e transfer,
1C and congesnon contro|
rof. SLeve uhllg
steveQeecs.qmu|.ac.uk
Cmce: Lng202
ur. lellx Cuadrado
fe||xQeecs.qmu|.ac.uk
Cmce: L207
2
School of Electronic Engineering and Computer Science
S||des
Computer
Networking: A Top
Down Approach
6
th
edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012
ulsclalmer:
Some of Lhe slldes' conLenL ls
borrowed dlrecLly from Lhose
provlded by Lhe auLhors of Lhe
LexLbook. 1hey are avallable from

hup://www-neL.cs.umass.edu/
kurose-ross-ppL-6e
3
School of Electronic Engineering and Computer Science
1he 1ransport |ayer
ke||ab|e transfer
lpellned proLocols
1C
Congesuon conLrol
4
School of Electronic Engineering and Computer Science
r|nc|p|es of re||ab|e data
transfer
lmporLanL ln appllcauon, LransporL, llnk layers
Lop-10 llsL of lmporLanL neLworklng Loplcs!

CharacLerlsucs of unrellable channel wlll deLermlne
complexlLy of rellable daLa Lransfer proLocol (rdL)
5
School of Electronic Engineering and Computer Science
CharacLerlsucs of unrellable channel wlll deLermlne
complexlLy of rellable daLa Lransfer proLocol (rdL)
lmporLanL ln appllcauon, LransporL, llnk layers
Lop-10 llsL of lmporLanL neLworklng Loplcs!

r|nc|p|es of re||ab|e data
transfer
6
School of Electronic Engineering and Computer Science
CharacLerlsucs of unrellable channel wlll deLermlne
complexlLy of rellable daLa Lransfer proLocol (rdL)
lmporLanL ln appllcauon, LransporL, llnk layers
Lop-10 llsL of lmporLanL neLworklng Loplcs!

r|nc|p|es of re||ab|e data
transfer
7
School of Electronic Engineering and Computer Science
ke||ab|e data transfer: gemng
started
send
slde
recelve
slde
rdt_send(): called from above, (e.g., by
app.). assed daLa Lo
dellver Lo recelver upper layer
udt_send(): called by rdL,
Lo Lransfer packeL over
unrellable channel Lo recelver
rdt_rcv(): called when packeL arrlves on
rcv-slde of channel
de||ver_data(): called by rdt Lo
dellver daLa Lo upper
8
School of Electronic Engineering and Computer Science
We wlll:
lncremenLally develop sender, recelver sldes of
rellable daLa Lransfer proLocol (rdL)
Conslder only unldlrecuonal daLa Lransfer
buL conLrol lnfo wlll ow on boLh dlrecuons!
use nlLe sLaLe machlnes (lSM) Lo speclfy sender,
recelver
sLaLe
1
sLaLe
2
evenL causlng sLaLe Lransluon
acuons Laken on sLaLe Lransluon
sLaLe: when ln Lhls sLaLe
nexL sLaLe unlquely
deLermlned by nexL
evenL
evenL
acuons
ke||ab|e data transfer: gemng
started
9
School of Electronic Engineering and Computer Science
rdt1.0: re||ab|e transfer over a
re||ab|e channe|
underlylng channel perfecLly rellable
no blL errors
no loss of packeLs
SeparaLe lSMs for sender, recelver:
sender sends daLa lnLo underlylng channel
recelver reads daLa from underlylng channel
WalL for
call from
above packeL = make_pkL(daLa)
udL_send(packeL)
rdL_send(daLa)
exLracL (packeL,daLa)
dellver_daLa(daLa)
WalL for
call from
below
rdL_rcv(packeL)
sender recelver
10
School of Electronic Engineering and Computer Science
underlylng channel may lp blLs ln packeL
checksum Lo deLecL blL errors
1be quesuon: how Lo recover from errors:
ockoowleJqemeots (Acks). recelver expllclLly Lells sender
LhaL pkL recelved Ck
oeqouve ockoowleJqemeots (NAks). recelver expllclLly
Lells sender LhaL pkL had errors
sender reLransmlLs pkL on recelpL of nAk
new mechanlsms ln rdt2.0 (beyond rdt1.0):
error deLecuon
recelver feedback: conLrol msgs (ACk,nAk) rcvr->sender
rdt2.0: channe| w|th b|t errors
now Jo bomoos tecovet ftom ettots
Jotloq coovetsouoo?
11
School of Electronic Engineering and Computer Science
underlylng channel may lp blLs ln packeL
checksum Lo deLecL blL errors
1be quesuon: how Lo recover from errors:
- ockoowleJqemeots (Acks). recelver expllclLly Lells
sender LhaL packeL recelved Ck
- oeqouve ockoowleJqemeots (NAks). recelver expllclLly
Lells sender LhaL packeL had errors
- sender reLransmlLs packeL on recelpL of nAk
new mechanlsms ln rdt2.0 (beyond rdt1.0):
- error deLecuon
- feedback: conLrol messages (ACk,nAk) from recelver Lo
sender
rdt2.0: channe| w|th b|t errors
12
School of Electronic Engineering and Computer Science
rdt2.0: ISM spec|hcanon
WalL for
call from
above
sndpkL = make_pkL(daLa, checksum)
udL_send(sndpkL)
exLracL(rcvpkL,daLa)
dellver_daLa(daLa)
udL_send(ACk)
rdL_rcv(rcvpkL) &&
noLcorrupL(rcvpkL)
rdL_rcv(rcvpkL) && lsACk(rcvpkL)
udL_send(sndpkL)
rdL_rcv(rcvpkL) &&
lsnAk(rcvpkL)
udL_send(nAk)
rdL_rcv(rcvpkL) &&
corrupL(rcvpkL)
WalL for
ACk or
nAk
WalL for
call from
below
sender
recelver
rdL_send(daLa)
!
13
School of Electronic Engineering and Computer Science
rdt2.0: operanon w|th no
errors
WalL for
call from
above
snkpkL = make_pkL(daLa, checksum)
udL_send(sndpkL)
exLracL(rcvpkL,daLa)
dellver_daLa(daLa)
udL_send(ACk)
rdL_rcv(rcvpkL) &&
noLcorrupL(rcvpkL)
rdL_rcv(rcvpkL) && lsACk(rcvpkL)
udL_send(sndpkL)
rdL_rcv(rcvpkL) &&
lsnAk(rcvpkL)
udL_send(nAk)
rdL_rcv(rcvpkL) &&
corrupL(rcvpkL)
WalL for
ACk or
nAk
WalL for
call from
below
rdL_send(daLa)
!
14
School of Electronic Engineering and Computer Science
rdt2.0: error scenar|o
Wait for
call from
above
sndpkt = make_pkt(data, checksum)
udt_send(sndpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
rdt_rcv(rcvpkt) && isACK(rcvpkt)
udt_send(sndpkt)
rdt_rcv(rcvpkt) &&
isNAK(rcvpkt)
udt_send(NAK)
rdt_rcv(rcvpkt) &&
corrupt(rcvpkt)
Wait for
ACK or
NAK
Wait for
call from
below
rdt_send(data)
!
15
School of Electronic Engineering and Computer Science
rdt2.0 has a fata| aw!
WhaL happens lf ACk/
nAk corrupLed?
Sender doesnL know
whaL happened aL
recelver!
Can'L [usL reLransmlL:
posslble dupllcaLe



Pandllng dupllcaLes:
Sender reLransmlLs currenL
pkL lf ACk/nAk corrupLed
Sender adds sepoeoce
oombet Lo each pkL
8ecelver dlscards (doesn'L
dellver up) dupllcaLe pkL
sLop and walL
Sender sends one packeL,
Lhen walLs for recelver
response
16
School of Electronic Engineering and Computer Science
rdt2.1: sender, hand|es
garb|ed ACk]NAks
WalL for
call 0 from
above
sndpkL = make_pkL(0, daLa, checksum)
udL_send(sndpkL)
rdL_send(daLa)
WalL for
ACk or nAk
0
udL_send(sndpkL)
rdL_rcv(rcvpkL) &&
( corrupL(rcvpkL) ||
lsnAk(rcvpkL) )
sndpkL = make_pkL(1, daLa, checksum)
udL_send(sndpkL)
rdL_send(daLa)
rdL_rcv(rcvpkL)
&& noLcorrupL(rcvpkL)
&& lsACk(rcvpkL)
udL_send(sndpkL)
rdL_rcv(rcvpkL) &&
( corrupL(rcvpkL) ||
lsnAk(rcvpkL) )
rdL_rcv(rcvpkL)
&& noLcorrupL(rcvpkL)
&& lsACk(rcvpkL)
WalL for
call 1 from
above
WalL for
ACk or nAk
1
!
!
17
School of Electronic Engineering and Computer Science
WalL for
0 from
below
sndpkL = make_pkL(nAk, chksum)
udL_send(sndpkL)
rdL_rcv(rcvpkL) &&
noL corrupL(rcvpkL) &&
has_seq0(rcvpkL)

rdL_rcv(rcvpkL) && noLcorrupL(rcvpkL)
&& has_seq1(rcvpkL)
exLracL(rcvpkL,daLa)
dellver_daLa(daLa)
sndpkL = make_pkL(ACk, chksum)
udL_send(sndpkL)
WalL for
1 from
below
rdL_rcv(rcvpkL) && noLcorrupL(rcvpkL)
&& has_seq0(rcvpkL)
exLracL(rcvpkL,daLa)
dellver_daLa(daLa)
sndpkL = make_pkL(ACk, chksum)
udL_send(sndpkL)
rdL_rcv(rcvpkL) && (corrupL(rcvpkL)
sndpkL = make_pkL(ACk, chksum)
udL_send(sndpkL)
rdL_rcv(rcvpkL) &&
noL corrupL(rcvpkL) &&
has_seq1(rcvpkL)

rdL_rcv(rcvpkL) && (corrupL(rcvpkL)
sndpkL = make_pkL(ACk, chksum)
udL_send(sndpkL)
sndpkL = make_pkL(nAk, chksum)
udL_send(sndpkL)
rdt2.1: rece|ver, hand|es
garb|ed ACk]NAks
18
School of Electronic Engineering and Computer Science
rdt2.1: d|scuss|on
Sender:
Seq # added Lo pkL
1wo seq. #s (0,1) wlll
sumce. Why?
MusL check lf recelved
ACk/nAk corrupLed
1wlce as many sLaLes
sLaLe musL remember
wheLher expecLed pkL
should have seq # of 0 or 1

8ecelver:
MusL check lf recelved
packeL ls dupllcaLe
sLaLe lndlcaLes wheLher 0
or 1 ls expecLed pkL seq #
noLe: recelver can oot
know lf lLs lasL ACk/
nAk recelved Ck aL
sender
19
School of Electronic Engineering and Computer Science
rdt2.2: a NAk-free protoco|
Same funcuonallLy as rdL2.1, uslng ACks only
lnsLead of nAk, recelver sends ACk for lasL pkL
recelved Ck
recelver musL expllcltly lnclude seq # of pkL belng ACked
uupllcaLe ACk aL sender resulLs ln same acuon as
nAk: tettoosmlt cotteot pkt
20
School of Electronic Engineering and Computer Science
rdt2.2: sender, rece|ver
fragments
WalL for call
0 from
above
sndpkL = make_pkL(0, daLa, checksum)
udL_send(sndpkL)
rdL_send(daLa)
udt_send(sndpkt)
rdL_rcv(rcvpkL) &&
( corrupL(rcvpkL) ||
|sACk(rcvpkt,1) )
rdL_rcv(rcvpkL)
&& noLcorrupL(rcvpkL)
&& |sACk(rcvpkt,0)
WalL for
ACk
0
sender lSM
fragmenL
rdL_rcv(rcvpkL) && noLcorrupL(rcvpkL)
&& has_seq1(rcvpkL)
exLracL(rcvpkL,daLa)
dellver_daLa(daLa)
sndpkt = make_pkt(ACk1, chksum)
udL_send(sndpkL)
WalL for
0 from
below
rdL_rcv(rcvpkL) &&
(corrupL(rcvpkL) ||
has_seq1(rcvpkt))
udt_send(sndpkt)
recelver lSM
fragmenL
!
21
School of Electronic Engineering and Computer Science
rdt3.0: channe|s w|th errors
!"# |oss
new assumpuon:
underlylng channel can
also loose packeLs
(daLa, ACks)
checksum, seq. #, ACks,
reLransmlsslons wlll be of
help . buL noL enough
Approach:
Sender walLs reasonable
amounL of ume for ACk
reLransmlLs lf no ACk recelved
ln Lhls ume
lf pkL (or ACk) [usL delayed (noL
losL):
- reLransmlsslon wlll be
dupllcaLe, buL seq. #s
already handles Lhls
- recelver musL speclfy seq #
of pkL belng ACked
8equlres counLdown umer
22
School of Electronic Engineering and Computer Science
rdt3.0 sender
sndpkL = make_pkL(0, daLa, checksum)
udL_send(sndpkL)
sLarL_umer
rdL_send(daLa)
WalL
for
ACk0
rdL_rcv(rcvpkL) &&
( corrupL(rcvpkL) ||
lsACk(rcvpkL,1) )
WalL for
call 1 from
above
sndpkL = make_pkL(1, daLa, checksum)
udL_send(sndpkL)
sLarL_umer
rdL_send(daLa)
rdL_rcv(rcvpkL)
&& noLcorrupL(rcvpkL)
&& lsACk(rcvpkL,0)
rdL_rcv(rcvpkL) &&
( corrupL(rcvpkL) ||
lsACk(rcvpkL,0) )
rdL_rcv(rcvpkL)
&& noLcorrupL(rcvpkL)
&& lsACk(rcvpkL,1)
sLop_umer
sLop_umer
udL_send(sndpkL)
sLarL_umer
umeouL
udL_send(sndpkL)
sLarL_umer
umeouL
rdL_rcv(rcvpkL)
WalL for
call 0 from
above
WalL
for
ACk1
!
rdL_rcv(rcvpkL)
!
!
!
23
School of Electronic Engineering and Computer Science
seoJet tecelvet
rcv pkL1
rcv pkL0
send ack0
send ack1
send ack0
rcv ack0
send pkL0
send pkL1
rcv ack1
send pkL0
rcv pkL0
pkL0
pkL0
pkL1
ack1
ack0
ack0
(a) no loss
seoJet tecelvet
rcv pkL1
rcv pkL0
send ack0
send ack1
send ack0
rcv ack0
send pkL0
send pkL1
rcv ack1
send pkL0
rcv pkL0
pkL0
pkL0
ack1
ack0
ack0
(b) packeL loss
pkL1
k
loss
pkL1
umeoot
resend pkL1
rdt3.0 |n acnon
24
School of Electronic Engineering and Computer Science
rdt3.0 in action
rcv pkL1
send ack1
(deLecL dupllcaLe)
pkL1
seoJet tecelvet
rcv pkL1
rcv pkL0
send ack0
send ack1
send ack0
rcv ack0
send pkL0
send pkL1
rcv ack1
send pkL0
rcv pkL0
pkL0
pkL0
ack1
ack0
ack0
(c) ACk loss
ack1
k
loss
pkL1
umeoot
resend pkL1
rcv pkL1
send ack1
(detect duplicate)
pkL1
seoJet tecelvet
rcv pkL1
send ack0
rcv ack0
send pkL1
send pkL0
rcv pkL0
pkL0
ack0
(d) premaLure umeouL/ delayed ACk
pkL1
umeoot
resend pkL1
ack1
send ack1
send pkt0
rcv ack1
pkt0
ack1
ack0
send pkt0
rcv ack1
pkt0
rcv pkt0
send ack0
ack0
rcv pkt0
send ack0
(detect duplicate)
25
School of Electronic Engineering and Computer Science
erformance of rdt3.0
rdL3.0 ls correcL, buL performance ls poor
e.g.: 1 Cbps llnk, 13 ms prop. delay, 8000 blL packeL:

- u
sender
: oullzouoo - fracuon of ume sender busy sendlng

U
sender
=
.008
30.008
= 0.00027
L / R
RTT + L / R
=
- lf 811=30 msec, 1k8 pkL every 30 msec: 33k8/sec
LhroughpuL over 1 Cbps llnk
neLwork proLocol llmlLs use of physlcal resources!
u
ttoos
=
l
k

8000 blts
10
9
blts/sec
= =
8 mlctosecs
26
School of Electronic Engineering and Computer Science
rdt3.0: stop-and-wa|t
operanon
rsL packeL blL Lransmlued, L = 0
sender recelver
811
lasL packeL blL Lransmlued, L = L / 8
rsL packeL blL arrlves
lasL packeL blL arrlves, send ACk
ACk arrlves, send nexL
packeL, L = 811 + L / 8

U
sender
=
.008
30.008
= 0.00027
L / R
RTT + L / R
=
27
School of Electronic Engineering and Computer Science
1he 1ransport Layer
8ellable Lransfer
|pe||ned protoco|s
1C
Congesuon conLrol
28
School of Electronic Engineering and Computer Science
|pe||ned protoco|s
lpellnlng: sender allows muluple, ln-lghL,
yeL-Lo-be-acknowledged pkLs
range of sequence numbers musL be lncreased
buerlng aL sender and/or recelver
1wo generlc forms of plpellned proLocols: qo-8ock-
N, selecuve tepeot
29
School of Electronic Engineering and Computer Science
|pe||n|ng: |ncreased
un||zanon
rsL packeL blL Lransmlued, L = 0
sender recelver
811
lasL blL Lransmlued, L = L / 8
rsL packeL blL arrlves
lasL packeL blL arrlves, send ACk
ACk arrlves, send nexL
packeL, L = 811 + L / 8
lasL blL of 2
nd
packeL arrlves, send ACk
lasL blL of 3
rd
packeL arrlves, send ACk
3-packeL plpellnlng lncreases
uullzauon by a facLor of 3!

U
sender
=
.0024
30.008
= 0.00081
3L / R
RTT + L / R
=
30
School of Electronic Engineering and Computer Science
|pe||ned protoco|s: overv|ew
Co-back-n:
Sender can have up Lo
n unacked packeLs ln
plpellne
8ecelver only sends
comolouve ock
uoesn'L ack packeL lf Lhere
ls a gap
Sender has umer for
oldesL unacked packeL
when umer explres,
reLransmlL oll unacked
packeLs
Selecuve 8epeaL:
Sender can have up Lo n
unacked packeLs ln
plpellne
rcvr sends loJlvlJool ock
for each packeL
Sender malnLalns umer
for each unacked packeL
when umer explres,
reLransmlL only LhaL
unacked packeL

31
School of Electronic Engineering and Computer Science
1ransporL Layer 3-31
Go-8ack-N: sender
k-blL seq # ln pkL header
wlndow of up Lo n, consecuuve unack-ed packeLs allowed


ACk(n): ACks all pkLs up Lo, lncludlng seq # n - comolouve
Ack
- may recelve dupllcaLe ACks (see recelver)
1lmer for oldesL ln-lghL pkL
1lmeoot(o). reLransmlL packeL n and all hlgher seq # pkLs ln
wlndow
32
School of Electronic Engineering and Computer Science
G8N: sender extended ISM
WalL
sLarL_umer
udL_send(sndpkL[base])
udL_send(sndpkL[base+1])
.
udL_send(sndpkL[nexLseqnum-1])

umeouL

rdL_send(daLa)
lf (nexLseqnum < base+n) [
sndpkL[nexLseqnum] = make_pkL(nexLseqnum,daLa,chksum)
udL_send(sndpkL[nexLseqnum])
lf (base == nexLseqnum)
sLarL_umer
nexLseqnum++
}
else
refuse_daLa(daLa)
base = geLacknum(rcvpkL)+1
lf (base == nexLseqnum)
sLop_umer
else
sLarL_umer
rdL_rcv(rcvpkL) &&
noLcorrupL(rcvpkL)

base=1
nexLseqnum=1

rdL_rcv(rcvpkL)
&& corrupL(rcvpkL)

L
33
School of Electronic Engineering and Computer Science
ACk-only: always send ACk for correcLly-recelved
pkL wlLh hlghesL lo-otJet seq #
may generaLe dupllcaLe ACks
need only remember expectedseqnum
CuL-of-order pkL:
dlscard (don'L buer): oo tecelvet bo[etloq!
re-ACk pkL wlLh hlghesL ln-order seq #
WalL
udL_send(sndpkL)
defaulL

rdL_rcv(rcvpkL)
&& noLcorrupL(rcvpkL)
&& hasseqnum(rcvpkL,expecLedseqnum)
exLracL(rcvpkL,daLa)
dellver_daLa(daLa)
sndpkL = make_pkL(expecLedseqnum,ACk,chksum)
udL_send(sndpkL)
expecLedseqnum++
expecLedseqnum=1
sndpkL =
make_pkL(expecLedseqnum,ACk,chksum)


!
G8N: rece|ver extended ISM
34
School of Electronic Engineering and Computer Science
G8N |n acnon
send pkL0
send pkL1
send pkL2
send pkL3
(walL)
seoJet
tecelvet
recelve pkL0, send ack0
recelve pkL1, send ack1

recelve pkL3, dlscard,
(re)send ack1
rcv ack0, send pkL4
rcv ack1, send pkL3

pkt 2 umeoot
send pkL2
send pkL3
send pkL4
send pkL3
k loss
recelve pkL4, dlscard,
(re)send ack1
recelve pkL3, dlscard,
(re)send ack1
rcv pkL2, dellver, send ack2
rcv pkL3, dellver, send ack3
rcv pkL4, dellver, send ack4
rcv pkL3, dellver, send ack3
lgnore dupllcaLe ACk
0 1 2 3 4 3 6 7 8
seoJet wloJow (N=4)
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
35
School of Electronic Engineering and Computer Science
Se|ecnve repeat
8ecelver loJlvlJoolly acknowledges all correcLly
recelved pkLs
buers pkLs, as needed, for evenLual ln-order dellvery
Lo upper layer
Sender only resends pkLs for whlch ACk noL
recelved
sender umer for each unACked pkL
Sender wlndow
N consecuuve seq #s
llmlLs seq #s of senL, unACked pkLs
36
School of Electronic Engineering and Computer Science
Se|ecnve repeat: sender,
rece|ver w|ndows
37
School of Electronic Engineering and Computer Science
Transport Layer 3-37
Se|ecnve repeat
Data from above:
if next available seq # in
window, send pkt
Timeout(n):
resend pkt n, restart timer
ACK(n) in [sendbase,sendbase+N]:
mark pkt n as received
if n smallest unACKed pkt,
advance window base to next
unACKed seq #

sender
kL n ln [rcvbase, rcvbase+n-1]
! send ACk(n)
! ouL-of-order: buer
! ln-order: dellver (also dellver
buered, ln-order pkLs),
advance wlndow Lo nexL
noL-yeL-recelved pkL
pkL n ln [rcvbase-n,rcvbase-1]
! ACk(n)
oLherwlse:
! lgnore
recelver
38
School of Electronic Engineering and Computer Science
Se|ecnve repeat |n acnon
send pkL0
send pkL1
send pkL2
send pkL3
(walL)
seoJet
tecelvet
recelve pkL0, send ack0
recelve pkL1, send ack1

recelve pkL3, buer,
send ack3
rcv ack0, send pkL4
rcv ack1, send pkL3

pkt 2 umeoot
send pkL2
k loss
recelve pkL4, buer,
send ack4
recelve pkL3, buer,
send ack3
rcv pkL2, dellver pkL2,
pkL3, pkL4, pkL3, send ack2
record ack3 arrlved
0 1 2 3 4 3 6 7 8
seoJet wloJow (N=4)
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
0 1 2 3 4 3 6 7 8
record ack4 arrlved
record ack4 arrlved
O. wbot boppeos wbeo ock2 ottlves?
39
School of Electronic Engineering and Computer Science
Selective repeat:
dilemma
Example:
seq #s: 0, 1, 2, 3
window size=3
recelver wlndow
(aer recelpL)
sender wlndow
(aer recelpL)
0 1 2 3 0 1 2
0 1 2 3 0 1 2
0 1 2 3 0 1 2
pkL0
pkL1
pkL2
0 1 2 3 0 1 2
pkL0
umeouL
reLransmlL pkL0
0 1 2 3 0 1 2
0 1 2 3 0 1 2
0 1 2 3 0 1 2 k
k
k
wlll occept pocket
wltb sep oombet 0
(b) oops!
0 1 2 3 0 1 2
0 1 2 3 0 1 2
0 1 2 3 0 1 2
pkL0
pkL1
pkL2
0 1 2 3 0 1 2
pkL0
0 1 2 3 0 1 2
0 1 2 3 0 1 2
0 1 2 3 0 1 2
k
wlll occept pocket
wltb sep oombet 0
0 1 2 3 0 1 2
pkL3
(a) no problem
tecelvet coot see seoJet slJe.
tecelvet bebovlot lJeoucol lo botb coses!
sometbloqs (vety) wtooq!
- receiver sees no
difference in two
scenarios!
- duplicate data
accepted as new in
(b)

Q: what relationship
between seq # size
and window size to
avoid problem in (b)?
40
School of Electronic Engineering and Computer Science
1he 1ransport |ayer
8ellable Lransfer
lpellned proLocols
1C
Congesuon conLrol
41
School of Electronic Engineering and Computer Science
1C: Cverv|ew
kICs: 793,1122,1323, 2018, 2S81
Full duplex data:
bi-directional data flow in
same connection
MSS: maximum segment
size
Connection-oriented:
handshaking (exchange of
control msgs) inits
sender, receiver state
before data exchange
Flow controlled:
sender will not
overwhelm receiver
Point-to-point:
one sender, one receiver
Reliable, in-order byte
steam:
no message boundaries
Pipelined:
TCP congestion and flow
control set window size

42
School of Electronic Engineering and Computer Science
1C segment structure
source porL # desL porL #
32 blLs
appllcauon
daLa
(varlable lengLh)
sequence number
acknowledgemenL number
recelve wlndow
urg daLa polnLer
checksum
l S 8 A u
head
len
noL
used
opuons (varlable lengLh)
u8C: urgenL daLa
(generally noL used)
ACk: ACk #
valld
SP: push daLa now
(generally noL used)
8S1, S?n, lln:
connecuon esLab
(seLup, Leardown
commands)
# byLes
rcvr wllllng
Lo accepL
counung
by byLes
of daLa
(noL segmenLs!)
lnLerneL
checksum
(as ln uu)
43
School of Electronic Engineering and Computer Science
1C seq. numbers, ACks
Sequence numbers:
byLe sLream number of
rsL byLe ln segmenLs
daLa
AcknowledgemenLs:
seq # of nexL byLe
expecLed from oLher slde
cumulauve ACk
C: how recelver handles
ouL-of-order segmenLs
A: 1C spec doesn'L say, -
up Lo lmplemenLor
source porL # desL porL #
sequence number
acknowledgemenL number
checksum
rwnd
urg polnLer
lncomlng segmenL Lo sender
A
senL
ACked
senL, noL-
yeL ACked
(ln-lghL)
usable
buL noL
yeL senL
noL
usable
wlndow slze
N
seoJet sepoeoce oombet spoce
source porL # desL porL #
sequence number
acknowledgemenL number
checksum
rwnd
urg polnLer
ouLgolng segmenL from sender
44
School of Electronic Engineering and Computer Science
1C seq. numbers, ACks
user
Lypes
C
hosL ACks
recelpL
of echoed
C
hosL ACks
recelpL of
C, echoes
back C
slmple LelneL scenarlo
PosL 8 PosL A
Seq=42, ACk=79, daLa = C
Seq=79, ACk=43, daLa = C
Seq=43, ACk=80
45
School of Electronic Engineering and Computer Science
1C round tr|p nme, nmeout
C: Pow Lo seL 1C
umeouL value?
Longer Lhan 811
buL 811 varles
1oo sbott.
premaLure umeouL,
unnecessary
reLransmlsslons
1oo looq. slow
reacuon Lo segmenL
loss
C: how Lo esumaLe
811?
Samp|ek11: measured ume
from segmenL Lransmlsslon
unul ACk recelpL
lgnore reLransmlsslons
Samp|ek11 wlll vary, wanL
esumaLed 811 smooLher
average several teceot
measuremenLs, noL [usL
currenL Samp|ek11
46
School of Electronic Engineering and Computer Science
RTT: gaia.cs.umass.edu to fantasia.eurecom.fr
100
150
200
250
300
350
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106
time (seconnds)
R
T
T

(
m
i
l
l
i
s
e
c
o
n
d
s
)
SampleRTT Estimated RTT
Lsnmatedk11 = (1- #)*Lsnmatedk11 + #*Samp|ek11
- exponenual welghLed movlng average
- lnuence of pasL sample decreases exponenually
fasL
- Lyplcal value: # = 0.123
1C round tr|p nme, nmeout
8
1
1

(
m
l
l
l
l
s
e
c
o
n
d
s
)

811: gala.cs.umass.edu Lo fanLasla.eurecom.fr
sample811
LsumaLed811
ume (seconds)
47
School of Electronic Engineering and Computer Science
1lmeouL lnLerval: Lsnmatedk11 plus safeLy margln
large varlauon ln Lsnmatedk11 -> larger safeLy margln
LsumaLe Sample811 devlauon from LsumaLed811:
Devk11 = (1-$)*Devk11 + $*|Samp|ek11-Lsnmatedk11|
1C round tr|p nme, nmeout
(typ|ca||y, $ = 0.2S)
1|meoutInterva| = Lsnmatedk11 + 4*Devk11
esumaLed 811
safeLy margln
48
School of Electronic Engineering and Computer Science
Transport Layer 3-48
1C re||ab|e data transfer
1C creaLes rdL servlce
on Lop of ls
unrellable servlce
plpellned segmenLs
cumulauve acks
slngle reLransmlsslon umer
8eLransmlsslons
Lrlggered by:
umeouL evenLs
dupllcaLe acks


LeL's lnlually conslder
slmplled 1C sender:
lgnore dupllcaLe acks
lgnore ow conLrol,
congesuon conLrol
49
School of Electronic Engineering and Computer Science
1C sender events
Data rcvd from app:
Create segment with seq #
Seq # is byte-stream
number of first data byte
in segment
Start timer if not already
running
think of timer as for oldest
unacked segment
expiration interval:
TimeOutInterval
Timeout:
retransmit segment that
caused timeout
restart timer
Ack rcvd:
if ack acknowledges
previously unacked
segments
update what is known to be
ACKed
start timer if there are still
unacked segments

50
School of Electronic Engineering and Computer Science
1C sender (s|mp||hed)
walL
for
evenL
nexLSeqnum = lnlualSeqnum
Send8ase = lnlualSeqnum
!
creaLe segmenL, seq. #: nexLSeqnum
pass segmenL Lo l (l.e., send)
nexLSeqnum = nexLSeqnum + lengLh(daLa)
lf (umer currenLly noL runnlng)
sLarL umer

daLa recelved from appllcauon above
reLransmlL noL-yeL-acked segmenL
wlLh smallesL seq. #
sLarL umer
umeouL
lf (y > Send8ase) [
Send8ase = y
/* Send8ase-1: lasL cumulauvely ACked byLe */
lf (Lhere are currenLly noL-yeL-acked segmenLs)
sLarL umer
else sLop umer
}
ACk recelved, wlLh ACk eld value y
51
School of Electronic Engineering and Computer Science
1C: retransm|ss|on scenar|os
losL ACk scenarlo
PosL 8
PosL A
Seq=92, 8 byLes of daLa
ACk=100
Seq=92, 8 byLes of daLa
k
u
m
e
o
u
L

ACk=100
premaLure umeouL
PosL 8
PosL A
Seq=92, 8 byLes of daLa
ACk=100
Seq=92, 8
byLes of daLa
u
m
e
o
u
L

ACk=120
Seq=100, 20 byLes of daLa
ACk=120
Send8ase=100
Send8ase=120
Send8ase=120
Send8ase=92
52
School of Electronic Engineering and Computer Science
1C: retransm|ss|on scenar|os
k
cumulauve ACk
PosL 8
PosL A
Seq=92, 8 byLes of daLa
ACk=100
Seq=120, 13 byLes of daLa
u
m
e
o
u
L

Seq=100, 20 byLes of daLa
ACk=120
53
School of Electronic Engineering and Computer Science
1C ACk generanon
[kIC 1122, kIC 2S81]
veot ot tecelvet

Arrlval of ln-order segmenL wlLh
expecLed seq #. All daLa up Lo
expecLed seq # already ACked

Arrlval of ln-order segmenL wlLh
expecLed seq #. Cne oLher
segmenL has ACk pendlng

Arrlval of ouL-of-order segmenL
hlgher-Lhan-expecL seq. # .
Cap deLecLed

Arrlval of segmenL LhaL
parually or compleLely lls gap

1cl tecelvet ocuoo

uelayed ACk. WalL up Lo 300ms
for nexL segmenL. lf no nexL segmenL,
send ACk

lmmedlaLely send slngle cumulauve
ACk, ACklng boLh ln-order segmenLs


lmmedlaLely send Jopllcote Ack,
lndlcaung seq. # of nexL expecLed byLe


lmmedlaLe send ACk, provlded LhaL
segmenL sLarLs aL lower end of gap

54
School of Electronic Engineering and Computer Science
TCP fast retransmit
Time-out period
often relatively long:
long delay before
resending lost packet
Detect lost segments
via duplicate ACKs.
sender often sends many
segments back-to-back
if segment is lost, there
will likely be many
duplicate ACKs.


if sender receives 3
ACKs for same data
(triple duplicate ACKs),
resend unacked
segment with smallest
seq #
- likely that unacked
segment lost, so dont
wait for timeout
TCP fast retransmit
(triple duplicate ACKs),
55
School of Electronic Engineering and Computer Science
x
fasL reLransmlL aer sender
recelpL of Lrlple dupllcaLe ACk
PosL 8
PosL A
Seq=92, 8 byLes of daLa
ACk=100
u
m
e
o
u
L

ACk=100
ACk=100
ACk=100
1C fast retransm|t
Seq=100, 20 byLes of daLa
Seq=100, 20 byLes of daLa
56
School of Electronic Engineering and Computer Science
1C ow contro|
appllcauon
process
1C sockeL
recelver buers
1C
code
l
code
appllcauon
CS
recelver proLocol sLack
appllcauon may
remove daLa from
1C sockeL buers ..
. slower Lhan 1C
recelver ls dellverlng
(sender ls sendlng)
from sender
recelver conLrols sender, so
sender won'L overow recelver's
buer by Lransmlmng Loo much,
Loo fasL
fow coottol
57
School of Electronic Engineering and Computer Science
1C ow contro|
buered daLa
free buer space
rwnd
kcv8uer
1cl seqmeot poylooJs
to oppllcouoo ptocess
8ecelver adveruses free
buer space by lncludlng
rwnd value ln 1C header of
recelver-Lo-sender
segmenLs
kcv8uer slze seL vla sockeL
opuons (Lyplcal defaulL ls
4096 byLes)
many operaung sysLems
auLoad[usL kcv8uer
Sender llmlLs amounL of
unacked (ln-lghL) daLa Lo
recelver's rwnd value
CuaranLees recelve buer
wlll noL overow
tecelvet-slJe bo[etloq
58
School of Electronic Engineering and Computer Science
Connecnon Management
8efore exchanglng daLa, sender/recelver handshake:
agree Lo esLabllsh connecuon (each knowlng Lhe oLher wllllng Lo
esLabllsh connecuon)
agree on connecuon parameLers
connecuon sLaLe: LS1A8
connecuon varlables:
seq # cllenL-Lo-server
server-Lo-cllenL
rcv8uer slze
aL server,cllenL

appllcauon
neLwork
connecuon sLaLe: LS1A8
connecuon arlables:
seq # cllenL-Lo-server
server-Lo-cllenL
rcv8uer slze
aL server,cllenL

appllcauon
neLwork
Socket c||entSocket =
newSocket("hostname","port number"),
Socket connecnonSocket =
we|comeSocket.accept(),
59
School of Electronic Engineering and Computer Science
O. wlll 2-way handshake
always work ln
neLwork?
arlable delays
8eLransmlued messages
(e.g. req_conn(x)) due Lo
message loss
Message reorderlng
Can'L see oLher slde
2-way handshake:
LeLs Lalk
Ck
LS1A8
LS1A8
choose x

req_conn(x)
LS1A8
LS1A8
acc_conn(x)
Agree|ng to estab||sh a
connecnon
60
School of Electronic Engineering and Computer Science
Agree|ng to estab||sh a
connecnon
2-way handshake fallure scenarlos:
reLransmlL
req_conn(x)

LS1A8
req_conn(x)
half open connecuon!
(no cllenL!)
cllenL
LermlnaLes
server
forgeLs x
connecuon
x compleLes
reLransmlL
req_conn(x)

LS1A8
req_conn(x)
daLa(x+1)
reLransmlL
daLa(x+1)

accepL
daLa(x+1)
choose x

req_conn(x)
LS1A8
LS1A8
acc_conn(x)
cllenL
LermlnaLes
LS1A8
choose x

req_conn(x)
LS1A8
acc_conn(x)
daLa(x+1)
accepL
daLa(x+1)
connecuon
x compleLes
server
forgeLs x
61
School of Electronic Engineering and Computer Science
1C 3-way handshake
S?nblL=1, Seq=x
choose lnlL seq num, x
send 1C S?n msg
LS1A8
S?nblL=1, Seq=y
ACkblL=1, ACknum=x+1
choose lnlL seq num, y
send 1C S?nACk
msg, acklng S?n
ACkblL=1, ACknum=y+1
recelved S?nACk(x)
lndlcaLes server ls llve,
send ACk for S?nACk,
Lhls segmenL may conLaln
cllenL-Lo-server daLa
recelved ACk(y)
lndlcaLes cllenL ls llve
S?nSLn1
LS1A8
S?n 8Cu
clleot stote

LlS1Ln
setvet stote

LlS1Ln
62
School of Electronic Engineering and Computer Science
1C 3-way handshake: ISM
closed
!
llsLen
S?n
rcvd
S?n
senL
LS1A8
Socket c||entSocket =
newSocket("hostname","port number"),
S?n(seq=x)
Socket connecnonSocket =
we|comeSocket.accept(),
S?n(x)
S?nACk(seq=y,ACknum=x+1)
creaLe new sockeL for
communlcauon back Lo cllenL

S?nACk(seq=y,ACknum=x+1)


ACk(ACknum=y+1)

ACk(ACknum=y+1)

!
63
School of Electronic Engineering and Computer Science
Transport Layer 3-63
1C: c|os|ng a connecnon
Client, server each close their side of
connection
send TCP segment with FIN bit = 1
Respond to received FIN with ACK
on receiving FIN, ACK can be combined with own FIN
Simultaneous FIN exchanges can be handled
64
School of Electronic Engineering and Computer Science
lln_WAl1_2
CLCSL_WAl1
llnblL=1, seq=y
ACkblL=1, ACknum=y+1
ACkblL=1, ACknum=x+1
walL for server
close
can sull
send daLa
can no longer
send daLa
LAS1_ACk
CLCSLu
1lMLu_WAl1
umed walL
for 2*max
segmenL llfeume
CLCSLu
1C: c|os|ng a connecnon
lln_WAl1_1
llnblL=1, seq=x
can no longer
send buL can
recelve daLa
cllenLSockeL.close()
clleot stote

setvet stote

LS1A8
LS1A8
65
School of Electronic Engineering and Computer Science
1he 1ransport |ayer
8ellable Lransfer
lpellned proLocols
1C
Congesnon contro|
66
School of Electronic Engineering and Computer Science
cooqesuoo:
lnformally: Loo many sources sendlng Loo much
daLa Loo fasL for oetwotk Lo handle
ulerenL from ow conLrol!
ManlfesLauons:
losL packeLs (buer overow aL rouLers)
long delays (queulng ln rouLer buers)
A Lop-10 problem!

r|nc|p|es of congesnon
contro|
67
School of Electronic Engineering and Computer Science
Causes]costs of congesnon:
scenar|o 1
Lwo senders, Lwo recelvers
one rouLer, lnnlLe buers
ouLpuL llnk capaclLy: 8
no reLransmlsslon

maxlmum per-connecuon
LhroughpuL: 8/2
unlimited shared
output link buffers
Host A
orlglnal daLa: %
in


Host B
LhroughpuL: %
out

R/2
R/2
%
o
u
t

%
in
R/2
d
e
l
a
y

%
in
large delays as arrival rate,
%
in
, approaches capacity
68
School of Electronic Engineering and Computer Science
one rouLer, folte buers
sender reLransmlsslon of umed-ouL packeL
appllcauon-layer lnpuL = appllcauon-layer ouLpuL: %
in
= %
out
LransporL-layer lnpuL lncludes tettoosmlssloos : %
in
%
in




nlLe shared ouLpuL
llnk buers
PosL A
%
in
: original data
PosL 8
%
out

%'
in
: original data, plus
retransmitted data

Causes]costs of congesnon:
scenar|o 2
69
School of Electronic Engineering and Computer Science
ldeallzauon: perfecL
knowledge
sender sends only when
rouLer buers avallable


finite shared output
link buffers
%
in
: original data
%
out

%'
in
: original data, plus
retransmitted data
copy
free buffer space!
R/2
R/2
%
o
u
t

%
in
Causes]costs of congesnon:
scenar|o 2
Host B
A
70
School of Electronic Engineering and Computer Science
%
in
: original data
%
out

%'
in
: original data, plus
retransmitted data
copy
no buffer space!
lJeollzouoo. koowo
loss packeLs can be
losL, dropped aL rouLer
due Lo full buers
sender only resends lf
packeL koowo Lo be losL



Causes]costs of congesnon:
scenar|o 2
A
Host B
71
School of Electronic Engineering and Computer Science
%
in
: original data
%
out

%'
in
: original data, plus
retransmitted data
free buffer space!
Causes]costs of congesnon:
scenar|o 2
lJeollzouoo. koowo
loss packeLs can be
losL, dropped aL rouLer
due Lo full buers
sender only resends lf
packeL koowo Lo be losL



R/2
R/2
%
in
%
o
u
t

When sendlng aL 8/2,
some packeLs are
reLransmlsslons buL
asympLouc goodpuL ls
sull 8/2 (why?)
A
Host B
72
School of Electronic Engineering and Computer Science
A
%
in

%
out

%'
in

copy
free buffer space!
timeout
R/2
R/2
%
in
%
o
u
t

When sending at R/
2, some packets are
retransmissions
including duplicated
that are delivered!
Host B
keollsuc. Jopllcotes
ackeLs can be losL, dropped aL
rouLer due Lo full buers
Sender umes ouL premaLurely,
sendlng two coples, boLh of
whlch are dellvered
Causes]costs of congesnon:
scenar|o 2
73
School of Electronic Engineering and Computer Science
R/2
%
o
u
t

When sending at R/
2, some packets are
retransmissions
including duplicated
that are delivered!
CosLs of congesuon:
more work (reLransmlsslons) for glven goodpuL
unneeded reLransmlsslons: llnk carrles muluple coples of pkL
- decreaslng goodpuL
R/2
%
in
Causes]costs of congesnon:
scenar|o 2
Realistic: duplicates
packets can be lost, dropped
at router due to full buffers
sender times out prematurely,
sending two copies, both of
which are delivered
74
School of Electronic Engineering and Computer Science
Four senders
Multihop paths
Timeout/retransmit

Q: what happens as %
in
and %
in


increase ?
finite shared output
link buffers
Host A
%
out

Causes]costs of congesnon:
scenar|o 3
Host B
Host C
Host D
%
in
: original data
%'
in
: original data, plus
retransmitted data
A: as red %
in

increases, all arriving


blue pkts at upper queue are
dropped, blue throughput ! 0
75
School of Electronic Engineering and Computer Science
AnoLher cosL of congesuon:
when packeL dropped, any upsLream
Lransmlsslon capaclLy used for LhaL packeL was
wasLed!
Causes]costs of congesnon:
scenar|o 3
C/2
C/2
%
o
u
t

%
in

76
School of Electronic Engineering and Computer Science
Approaches towards
congesnon contro|
1wo broad approaches Lowards congesuon conLrol:
end-end congesuon
conLrol:
no expllclL feedback
from neLwork
congesuon lnferred
from end-sysLem
observed loss, delay
approach Laken by
1C
neLwork-asslsLed
congesuon conLrol:
rouLers provlde feedback
Lo end sysLems
- slngle blL lndlcaung
congesuon (SnA,
uLCblL, 1C/l LCn,
A1M)
- expllclL raLe for
sender Lo send aL
77
School of Electronic Engineering and Computer Science
Case study: A1M A8k
congesnon contro|
A88: avallable blL raLe:
elasuc servlce
lf sender's paLh
underloaded:
sender should use
avallable bandwldLh
lf sender's paLh
congesLed:
sender Lhrouled Lo
mlnlmum guaranLeed
raLe
8M (resource managemenL)
cells:
senL by sender, lnLerspersed
wlLh daLa cells
blLs ln 8M cell seL by swlLches
(oetwotk-osslsteJ)
Nl blt. no lncrease ln raLe
(mlld congesuon)
cl blt. congesuon lndlcauon
8M cells reLurned Lo sender
by recelver, wlLh blLs lnLacL


78
School of Electronic Engineering and Computer Science
Case study: A1M A8k
congesnon contro|
Lwo-byLe L8 (expllclL raLe) eld ln 8M cell
congesLed swlLch may lower L8 value ln cell
senders' send raLe Lhus max supporLable raLe on paLh
LlCl blL ln daLa cells: seL Lo 1 ln congesLed swlLch
lf daLa cell precedlng 8M cell has LlCl seL, recelver seLs Cl
blL ln reLurned 8M cell
8M cell daLa cell
79
School of Electronic Engineering and Computer Science
1C congesnon contro|: add|nve
|ncrease mu|np||canve decrease
Apptoocb. sender lncreases Lransmlsslon raLe (wlndow
slze), problng for usable bandwldLh, unul loss occurs
oJJluve locteose. lncrease cwnd by 1 MSS every
811 unul loss deLecLed
molupllcouve Jecteose: cuL cwnd ln half aer loss
c
w
n
d
:

1
C


s
e
n
d
e
r


c
o
n
g
e
s
u
o
n

w
l
n
d
o
w

s
l
z
e

AlMu saw LooLh
behavlor: problng
for bandwldLh
addluvely lncrease wlndow slze .
.. unul loss occurs (Lhen cuL wlndow ln half)
ume
80
School of Electronic Engineering and Computer Science
TCP Congestion Control:
details
sender llmlLs Lransmlsslon:


cwnd ls dynamlc, funcuon of
percelved neLwork
congesuon

1cl seoJloq tote.
tooqbly. send cwnd
byLes, walL 811 for
ACkS, Lhen send more
byLes
lasL byLe
ACked senL, noL-
yeL ACked
(ln-lghL)
lasL byLe
senL
cwnd
Last8yteSent-
Last8yteAcked
< cwnd
seoJet sepoeoce oombet spoce
raLe


cwnd
811
byLes/sec
81
School of Electronic Engineering and Computer Science
1C S|ow Start
When connecuon
beglns, lncrease raLe
exponenually unul rsL
loss evenL:
lnlually cwnd = 1 MSS
double cwnd every 811
done by lncremenung cwnd
for every ACk recelved
5ommoty. lnlual raLe ls
slow buL ramps up
exponenually fasL
PosL A
one segmenL
8
1
1

PosL 8
ume
Lwo segmenLs
four segmenLs
82
School of Electronic Engineering and Computer Science
1C: detecnng, reacnng to |oss
Loss lndlcaLed by umeouL:
cwnd seL Lo 1 MSS,
wlndow Lhen grows exponenually (as ln slow sLarL) Lo
Lhreshold, Lhen grows llnearly
Loss lndlcaLed by 3 dupllcaLe ACks: 1C 8LnC
dup ACks lndlcaLe neLwork capable of dellverlng some
segmenLs
cwnd ls cuL ln half wlndow Lhen grows llnearly
1C 1ahoe always seLs cwnd Lo 1 (umeouL or 3
dupllcaLe acks)

83
School of Electronic Engineering and Computer Science
C: when should Lhe
exponenual
lncrease swlLch Lo
llnear?
A: when cwnd geLs
Lo 1/2 of lLs value
before umeouL.

lmplemenLauon:
varlable ssthresh
on loss evenL, ssthresh ls seL
Lo 1/2 of cwnd [usL before
loss evenL
1C: sw|tch|ng from s|ow start
to CA
84
School of Electronic Engineering and Computer Science
Summary: 1C Congesnon
Contro|
umeouL
ssLhresh = cwnd/2
cwnd = 1 MSS
dupACkcounL = 0
tettoosmlt mlssloq seqmeot
!
cwnd > ssLhresh
congesuon
avoldance

cwnd = cwnd + MSS (MSS/cwnd)
dupACkcounL = 0
ttoosmlt oew seqmeot(s), os olloweJ

new ACk
.
dupACkcounL++

dupllcaLe ACk


fasL
recovery

cwnd = cwnd + MSS
ttoosmlt oew seqmeot(s), os olloweJ

dupllcaLe ACk
ssLhresh= cwnd/2
cwnd = ssLhresh + 3
tettoosmlt mlssloq seqmeot

dupACkcounL == 3
umeouL
ssLhresh = cwnd/2
cwnd = 1
dupACkcounL = 0
tettoosmlt mlssloq seqmeot
ssLhresh= cwnd/2
cwnd = ssLhresh + 3
tettoosmlt mlssloq seqmeot

dupACkcounL == 3 cwnd = ssLhresh
dupACkcounL = 0


new ACk
slow
sLarL
umeouL
ssLhresh = cwnd/2
cwnd = 1 MSS
dupACkcounL = 0
tettoosmlt mlssloq seqmeot
cwnd = cwnd+MSS
dupACkcounL = 0
ttoosmlt oew seqmeot(s), os olloweJ

new ACk
dupACkcounL++

dupllcaLe ACk
!
cwnd = 1 MSS
ssLhresh = 64 k8
dupACkcounL = 0
%&'
()*+
%&'
()*+
%&'
()*+
85
School of Electronic Engineering and Computer Science
1C throughput
Avg. 1C LhroupuL as funcuon of wlndow slze, 811?
lgnore slow sLarL, assume always daLa Lo send
W: wlndow slze (measured ln byLes) where loss occurs
avg. wlndow slze (# ln-lghL byLes) ls W
avg. LhrupuL ls 3/4W per 811
W
W/2
avg 1C LhrupuL =
3
4
W
811
byLes/sec
86
School of Electronic Engineering and Computer Science
Transport Layer 3-86
1C Iutures: 1C over |ong,
fat p|pes
Lxample: 1300 byLe segmenLs, 100ms 811, wanL
10 Cbps LhroughpuL
requlres W = 83,333 ln-lghL segmenLs
LhroughpuL ln Lerms of segmenL loss probablllLy,
L [MaLhls 1997]:



Lo achleve 10 Cbps LhroughpuL, need a loss raLe of L =
210
-10
- o vety smoll loss tote!
new verslons of 1C for hlgh-speed


1C LhroughpuL =
1.22
.
MSS
811
L
87
School of Electronic Engineering and Computer Science
foltoess qool. lf k 1C sesslons share same
bouleneck llnk of bandwldLh 8, each should have
average raLe of 8/k
1C connecuon 1
bouleneck
rouLer
capaclLy 8
1C Ia|rness
1C connecuon 2
88
School of Electronic Engineering and Computer Science
Why |s 1C fa|r?
Lwo compeung sesslons:
addluve lncrease glves slope of 1, as LhroughouL lncreases
mulupllcauve decrease decreases LhroughpuL proporuonally
8
8
equal bandwldLh share
Connecuon 1 LhroughpuL
C
o
n
n
e
c
u
o
n

2

L
h
r
o
u
g
h
p
u
L

congesuon avoldance: addluve lncrease
loss: decrease wlndow by facLor of 2
congesuon avoldance: addluve lncrease
loss: decrease wlndow by facLor of 2
89
School of Electronic Engineering and Computer Science
Ia|rness (more)
loltoess ooJ uul
Mulumedla apps
oen do noL use 1C
do noL wanL raLe
Lhrouled by
congesuon conLrol
lnsLead use uu:
send audlo/vldeo aL
consLanL raLe, LoleraLe
packeL loss

loltoess, potollel 1cl
coooecuoos
Appllcauon can open
muluple parallel
connecuons beLween Lwo
hosLs
Web browsers do Lhls
e.g., llnk of raLe 8 wlLh 9
exlsung connecuons:
new app asks for 1 1C, geLs raLe 8/10
new app asks for 11 1Cs, geLs 8/2

You might also like