chapter3 redes de computadoras
Post on 01-Jun-2018
229 Views
Preview:
TRANSCRIPT
-
8/9/2019 Chapter3 Redes de computadoras
1/108
Transport Layer3-1
Chapter 3
Transport Layer
Computer Networking:A Top Down Approach5thedition.Jim Kurose Keith !ossAddison"#es$ey Apri$%&&'.
A note on the use of these ppt slides:Were making these slides freely available to all (faculty, students, readers).
Theyre in o!eroint form so you can add, modify, and delete slides
(including this one) and slide content to suit your needs. They obviously
represent a lotof !ork on our part. "n return for use, !e only ask the
follo!ing:
"f you use these slides (e.g., in a class) in substantially unaltered form,that you mention their source (after all, !ed like people to use our book#)"f you post any slides in substantially unaltered form on a !!! site, that
you note that they are adapted from (or perhaps identical to) our slides, and
note our copyright of this material.
Thanks and en$oy# %&''W
All material copyright *++-/*/
%.& 'urose and '.W. oss, All ights eserved
-
8/9/2019 Chapter3 Redes de computadoras
2/108
Transport Layer3-2
Chapter 3: Transport Layer
(ur goa$s: understand princip$es
)ehind transport$ayer ser*ices:
mu$tip$e+ing,demu$tip$e+ing
re$ia)$e data trans-er -$ow contro$ congestion contro$
$earn a)out transport$ayer protoco$s in thenternet:
/D0: connection$esstransport
TC0: connection"orientedtransport
TC0 congestion contro$
-
8/9/2019 Chapter3 Redes de computadoras
3/108
Transport Layer3-3
Chapter 3 out$ine
3.1 Transport"$ayerser*ices
3.% 2u$tip$e+ing and
demu$tip$e+ing3.3 Connection$esstransport: /D0
3. 0rincip$es o- re$ia)$e
data trans-er
3.5 Connection"orientedtransport: TC0 segment structure re$ia)$e data trans-er -$ow contro$ connection management
3.4 0rincip$es o-congestion contro$
3. TC0 congestion contro$
-
8/9/2019 Chapter3 Redes de computadoras
4/108
Transport Layer3-4
Transport ser*ices and protoco$s
pro*ide$ogica$ communication)etween app processesrunning on di--erent hosts
transport protoco$s run in endsystems
send side: )reaks appmessages into segmentspasses to network $ayer
rc* side: reassem)$essegments into messages
passes to app $ayer more than one transport
protoco$ a*ai$a)$e to apps nternet: TC0 and /D0
app$icationtransport
networkdata $inkphysica$
app$icationtransportnetworkdata $ink
physica$
$ogica$end"end
transport
-
8/9/2019 Chapter3 Redes de computadoras
5/108
Transport Layer3-5
Transport *s. network $ayer
network $ayer:$ogica$communication)etween hosts
transport $ayer:$ogica$communication)etween processes re$ies on enhances
network $ayer ser*ices
6ouseho$d ana$ogy:
1% kids sending $etters to1% kids
processes 7 kids app messages 7 $etters
in en*e$opes hosts 7 houses
transport protoco$ 7 Annand 8i$$ who demu+ toin"house si)$ings
network"$ayer protoco$ 7posta$ ser*ice
-
8/9/2019 Chapter3 Redes de computadoras
6/108
Transport Layer3-6
nternet transport"$ayer protoco$s
re$ia)$e in"orderde$i*ery 9TC0 congestion contro$ -$ow contro$
connection setup unre$ia)$e unordered
de$i*ery: /D0 no"-ri$$s e+tension o-
;)est"e--ort< 0
ser*ices not a*ai$a)$e: de$ay guarantees )andwidth guarantees
app$icationtransportnetworkdata $inkphysica$
networkdata $inkphysica$
network
data $inkphysica$
networkdata $inkphysica$
networkdata $inkphysica$
networkdata $inkphysica$
networkdata $inkphysica$
app$icationtransport
networkdata $inkphysica$
$ogica$end
"endtransport
-
8/9/2019 Chapter3 Redes de computadoras
7/108Transport Layer3-7
Chapter 3 out$ine
3.1 Transport"$ayerser*ices
3.% 2u$tip$e+ing and
demu$tip$e+ing3.3 Connection$esstransport: /D0
3. 0rincip$es o- re$ia)$e
data trans-er
3.5 Connection"orientedtransport: TC0 segment structure re$ia)$e data trans-er -$ow contro$ connection management
3.4 0rincip$es o-congestion contro$
3. TC0 congestion contro$
-
8/9/2019 Chapter3 Redes de computadoras
8/108Transport Layer3-8
2u$tip$e+ing,demu$tip$e+ing
app$ication
transport
network$ink
physica$
01 app$ication
transport
network
$ink
physica$
app$ication
transport
network$ink
physica$
0%03 001
host 1 host % host 3
7 process7 socket
de$i*ering recei*ed segmentsto correct socket
Demu$tip$e+ing at rc* host: gathering data -rom mu$tip$esockets en*e$oping data withheader 9$ater used -ordemu$tip$e+ing
2u$tip$e+ing at send host:
-
8/9/2019 Chapter3 Redes de computadoras
9/108Transport Layer3-9
6ow demu$tip$e+ing works host recei*es 0 datagrams
each datagram has source 0address destination 0 address
each datagram carries 1 transport"$ayer segment
each segment has source destinationport num)er
host uses 0 addresses = portnum)ers to direct segment toappropriate socket
source port > dest port >
3% )its
app$icationdata
9message
other header -ie$ds
TC0,/D0 segment -ormat
-
8/9/2019 Chapter3 Redes de computadoras
10/108Transport Layer 3-
Connection$ess demu$tip$e+ing
reca$$:create sockets withhost"$oca$ port num)ers:
DatagramSocket mySocket1 = new
DatagramSocket(12534);
DatagramSocket mySocket2 = newDatagramSocket(12535);
reca$$:when creatingdatagram to send into /D0socket must speci-y
9dest 0 address dest port num)er
when host recei*es /D0segment: checks destination port
num)er in segment
directs /D0 segment tosocket with that portnum)er
0 datagrams withdi--erent source 0
addresses and,or sourceport num)ers directedto same socket
-
8/9/2019 Chapter3 Redes de computadoras
11/108Transport Layer 3-
Connection$ess demu+ 9cont
DatagramSocket serverSocket = new DatagramSocket(6428);
C$ient0:8
0%
c$ient0: A
010103
ser*er0: C
?0: 4%@
D0: '15
?0: '15
D0: 4%@
?0: 4%@
D0: 55
?0: 55
D0: 4%@
?0 pro*ides ;return address o- pkt )eing ACKed
dup$icate ACK at sender resu$ts in same action asNAK: retransmit current pkt
-
8/9/2019 Chapter3 Redes de computadoras
37/108
Transport Layer 3-
rdt%.%: sender recei*er -ragments
Wait for
call / from
above
sndpkt 0 make1pkt(/, data, checksum)udt1send(sndpkt)
rdt1send(data)
udt_send(sndpkt)
rdt1rcv(rcvpkt) 44
( corrupt(rcvpkt) 66
isACK(rcvpkt,1))
rdt1rcv(rcvpkt)
44 notcorrupt(rcvpkt)
44 isACK(rcvpkt,0)
Wait for
A3'
/
sender ?2-ragment
rdt1rcv(rcvpkt) 44 notcorrupt(rcvpkt)
44 has1se7*(rcvpkt)
e2tract(rcvpkt,data)
deliver1data(data)
sndpkt = make_pkt(ACK1, chksum)
udt1send(sndpkt)
Wait for
/ from
belo!
rdt1rcv(rcvpkt) 44
(corrupt(rcvpkt) 66
has_seq1(rcvpkt))
udt_send(sndpkt)
recei*er ?2
-ragment
-
8/9/2019 Chapter3 Redes de computadoras
38/108
Transport Layer 3-
rdt3.&: channe$s with errors and$oss
New assumption:under$ying channe$ cana$so $ose packets 9dataor ACKs checksum se. > ACKs
retransmissions wi$$ )eo- he$p )ut not enough
Approach:sender waits;reasona)$e< amount o-time -or ACK
retransmits i- no ACK
recei*ed in this time i- pkt 9or ACK Must de$ayed
9not $ost: retransmission wi$$ )e
dup$icate )ut use o- se.
>Gs a$ready hand$es this recei*er must speci-y se
> o- pkt )eing ACKed reuires countdown timer
-
8/9/2019 Chapter3 Redes de computadoras
39/108
Transport Layer 3-
rdt3.& sender
sndpkt 0 make1pkt(/, data, checksum)
udt1send(sndpkt)
start1timer
rdt1send(data)
Wait
for
A3'/
rdt1rcv(rcvpkt) 44
( corrupt(rcvpkt) 66
isA3'(rcvpkt,*) )
Wait for
call * from
above
sndpkt 0 make1pkt(*, data, checksum)
udt1send(sndpkt)
start1timer
rdt1send(data)
rdt1rcv(rcvpkt)44 notcorrupt(rcvpkt)
44 isA3'(rcvpkt,/)
rdt1rcv(rcvpkt) 44
( corrupt(rcvpkt) 66
isA3'(rcvpkt,/) )
rdt1rcv(rcvpkt)
44 notcorrupt(rcvpkt)44 isA3'(rcvpkt,*)
stop1timer
stop1timer
udt1send(sndpkt)
start1timer
timeout
udt1send(sndpkt)
start1timer
timeout
rdt1rcv(rcvpkt)
Wait for
call /from
above
Wait
for
A3'*
rdt1rcv(rcvpkt)
-
8/9/2019 Chapter3 Redes de computadoras
40/108
Transport Layer 3-
rdt3.& in action
-
8/9/2019 Chapter3 Redes de computadoras
41/108
Transport Layer 3-
rdt3.& in action
-
8/9/2019 Chapter3 Redes de computadoras
42/108
Transport Layer 3-
0er-ormance o- rdt3.&
rdt3.& works )ut per-ormance stinks e+: 1 )ps $ink 15 ms prop. de$ay @&&& )it packet:
/ sender: uti$iationO -raction o- time sender )usy sending
/sender
=.&&@
3&.&&@
= &.&&&%5L , !
!TT P L , !
=
i- !TT73& msec 1K8 pkt e*ery 3& msec " 33k8,sec thruput o*er 1 )ps $ink network protoco$ $imits use o- physica$ resourcesF
dsmicrosecon8bps10
bits8000
9
R
Ldtrans
-
8/9/2019 Chapter3 Redes de computadoras
43/108
Transport Layer 3-
rdt3.&: stop"and"wait operation
first packet bit transmitted, t 0 /sender receiver
TT
last packet bit transmitted, t 0 8
first packet bit arrives
last packet bit arrives, send A3'
A3' arrives, send ne2t
packet, t 0 TT 9 8
/sender
=.&&@
3&.&&@= &.&&&%5
L , !
!TT P L , !=
-
8/9/2019 Chapter3 Redes de computadoras
44/108
Transport Layer 3-
0ipe$ined protoco$s
pipe$ining:sender a$$ows mu$tip$e ;in"-$ight
-
8/9/2019 Chapter3 Redes de computadoras
45/108
Transport Layer 3-
0ipe$ining: increased uti$iation
first packet bit transmitted, t 0 /
sender receiver
TT
last bit transmitted, t 0 8
first packet bit arrives
last packet bit arrives, send A3'
A3' arrives, send ne2t
packet, t 0 TT 9 8
last bit of nd
packet arrives, send A3'last bit of rdpacket arrives, send A3'
/sender
=.&%
3&.&&@= &.&&&@
3 Q L , !
!TT P L , !=
ncrease uti$iation
)y a -actor o- 3F
-
8/9/2019 Chapter3 Redes de computadoras
46/108
Transport Layer 3-
0ipe$ined 0rotoco$s
o")ack"N: )ig picture: sender can ha*e up to
N unacked packets inpipe$ine
rc*r on$y sendscumu$ati*e acks doesnGt ack packet i-
thereGs a gap sender has timer -or
o$dest unacked packet i- timer e+pires
retransmit a$$ unackGedpackets
?e$ecti*e !epeat: )ig pic sender can ha*e up to
N unackGed packets inpipe$ine
rc*r sends indi*idua$ack-or each packet
sender maintains timer-or each unacked
packet when timer e+piresretransmit on$yunackGed packet
-
8/9/2019 Chapter3 Redes de computadoras
47/108
Transport Layer 3-
o"8ack"N
?ender: k")it se > in pkt header ;window< o- up to N consecuti*e unackGed pkts a$$owed
ACK9n: ACKs a$$ pkts up to inc$uding se > n " ;cumu$ati*e ACK< may recei*e dup$icate ACKs 9see recei*er
timer -or each in"-$ight pkt
timeout9n:retransmit pkt n and a$$ higher se > pkts in window
-
8/9/2019 Chapter3 Redes de computadoras
48/108
Transport Layer 3-
8N: sender e+tended ?2
Waitstart1timer
udt1send(sndpkt;base
-
8/9/2019 Chapter3 Redes de computadoras
49/108
Transport Layer 3-
8N: recei*er e+tended ?2
ACK"on$y: a$ways send ACK -or correct$y"recei*ed pktwith highest in"orderse > may generate dup$icate ACKs
need on$y remem)er expectedseqnum
out"o-"order pkt: discard 9donGt )u--er " no recei*er )u--eringF !e"ACK pkt with highest in"order se >
Wait
udt1send(sndpkt)
default
rdt1rcv(rcvpkt) 44 notcurrupt(rcvpkt)
44 hasse7num(rcvpkt,e2pectedse7num)
e2tract(rcvpkt,data)
deliver1data(data)
sndpkt 0 make1pkt(e2pectedse7num,A3',chksum)
udt1send(sndpkt)
e2pectedse7num99
e2pectedse7num0*
sndpkt 0
make1pkt(e2pectedse7num,A3',chksum)
-
8/9/2019 Chapter3 Redes de computadoras
50/108
Transport Layer 3-
8N inaction
-
8/9/2019 Chapter3 Redes de computadoras
51/108
Transport Layer 3-
?e$ecti*e !epeat
recei*er indi*idua$$yacknow$edges a$$ correct$yrecei*ed pkts )u--ers pkts as needed -or e*entua$ in"order de$i*ery
to upper $ayer
sender on$y resends pkts -or which ACK notrecei*ed sender timer -or each unACKed pkt
sender window
N consecuti*e se >Gs again $imits se >s o- sent unACKGed pkts
-
8/9/2019 Chapter3 Redes de computadoras
52/108
Transport Layer 3-
?e$ecti*e repeat: sender recei*er windows
-
8/9/2019 Chapter3 Redes de computadoras
53/108
Transport Layer 3-
?e$ecti*e repeat
data -rom a)o*e : i- ne+t a*ai$a)$e se > in
window send pkt
timeout9n: resend pkt n restart timerACK9n in Bsend)asesend)asePN: mark pkt n as recei*ed i- n sma$$est unACKed pkt
ad*ance window )ase tone+t unACKed se >
senderpkt n in Brc*)ase rc*)asePN"1 send ACK9n out"o-"order: )u--er in"order: de$i*er 9a$so
de$i*er )u--ered in"orderpkts ad*ance window tone+t not"yet"recei*ed pkt
pkt n in Brc*)ase"Nrc*)ase"1 ACK9n
otherwise: ignore
recei*er
-
8/9/2019 Chapter3 Redes de computadoras
54/108
Transport Layer 3-
?e$ecti*e repeat in action
? $ ti t
-
8/9/2019 Chapter3 Redes de computadoras
55/108
Transport Layer 3-
?e$ecti*e repeat:di$emma
I+amp$e: se >Gs: & 1 % 3 window sie73
recei*er sees nodi--erence in twoscenariosF
incorrect$y passesdup$icate data as new in9a
R:what re$ationship)etween se > sie andwindow sieE
-
8/9/2019 Chapter3 Redes de computadoras
56/108
Transport Layer 3-
Chapter 3 out$ine
3.1 Transport"$ayerser*ices
3.% 2u$tip$e+ing anddemu$tip$e+ing
3.3 Connection$esstransport: /D0
3. 0rincip$es o- re$ia)$edata trans-er
3.5 Connection"orientedtransport: TC0 segment structure re$ia)$e data trans-er
-$ow contro$ connection management
3.4 0rincip$es o-congestion contro$
3. TC0 congestion contro$
-
8/9/2019 Chapter3 Redes de computadoras
57/108
Transport Layer 3-
TC0: (*er*iew !Cs: '3 11%% 13%3 %&1@ %5@1
-u$$ dup$e+ data: )i"directiona$ data -$ow
in same connection 2??: ma+imum segment
sie connection"oriented:
handshaking 9e+changeo- contro$ msgs initssender recei*er state
)e-ore data e+change -$ow contro$$ed:
sender wi$$ noto*erwhe$m recei*er
point"to"point: one sender one recei*er
re$ia)$e in"order )ytesteam:
no ;message )oundaries< pipe$ined:
TC0 congestion and -$owcontro$ set window sie
send = recei*e )u--ers
s o c k e t
d o o r T 3
s e n d b u f f e r
T 3
r e c e i v e b u f f e r
s o c k e t
d o o r
s e g m e n t
a p p l i c a t i o n
! r i t e s d a t aa p p l i c a t i o n
r e a d s d a t a
TC0 t t t
-
8/9/2019 Chapter3 Redes de computadoras
58/108
Transport Layer 3-
TC0 segment structure
source port > dest port >
3% )its
app$icationdata9*aria)$e $ength
seuence num)er
acknow$edgement num)er
!ecei*e window
/rg data pnterchecksum
?!0A/head$en
notused
(ptions 9*aria)$e $ength
/!: urgent data9genera$$y not used
ACK: ACK >*a$id
0?6: push data now
9genera$$y not used
!?T ?HN N:connection esta)9setup teardown
commands
> )ytesrc*r wi$$ingto accept
counting)y )yteso- data9not segmentsF
nternetchecksum
9as in /D0
-
8/9/2019 Chapter3 Redes de computadoras
59/108
Transport Layer 3-
TC0 se. >Gs and ACKs?e. >Gs:
)yte stream ;num)er o- ne+t )yte
e+pected -rom otherside
cumu$ati*e ACK
R:how recei*er hand$esout"o-"order segments
A: TC0 spec doesnGtsay " up toimp$ementor
6ost A 6ost 8
e70B.,A3'0C+,data0D3
e70C+,A
3'0B:,data0
D3
e70B:,A3'0E/
/sertypes
SCG
host ACKsreceipt
o- echoed
SCG
host ACKsreceipt o-
SCG echoes)ack SCG
timesimp$e te$net scenario
-
8/9/2019 Chapter3 Redes de computadoras
60/108
Transport Layer 3-
TC0 !ound Trip Time and Timeout
R:how to set TC0timeout *a$ueE
$onger than !TT )ut !TT *aries
too short:premature timeout unnecessary
retransmissions
too $ong: s$owreaction to segment$oss
R:how to estimate !TTE SampleRTT:measured time -rom
segment transmission unti$ ACKreceipt ignore retransmissions
SampleRTTwi$$ *ary wantestimated !TT ;smoother< a*erage se*era$ recent
measurements not Mustcurrent SampleRTT
-
8/9/2019 Chapter3 Redes de computadoras
61/108
Transport Layer 3-
TC0 !ound Trip Time and Timeout
EstimatedRTT = (1- )EstimatedRTT ! SampleRTT
I+ponentia$ weighted mo*ing a*erage in-$uence o- past samp$e decreases e+ponentia$$y -ast typica$ *a$ue: =&.1%5
-
8/9/2019 Chapter3 Redes de computadoras
62/108
Transport Layer 3-
I+amp$e !TT estimation:
-
8/9/2019 Chapter3 Redes de computadoras
63/108
Transport Layer 3-
TC0 !ound Trip Time and Timeout
?etting the timeout EstimatedRTTp$us ;sa-ety margin< $arge *ariation in EstimatedRTT -"$arger sa-ety margin
-irst estimate o- how much ?amp$e!TT de*iates -rom Istimated!TT:
Time#ut$nterval = EstimatedRTT ! %&evRTT
&evRTT = (1-
)&evRTT !
'SampleRTT-EstimatedRTT'
(tpicall = 0.2*)
Then set timeout inter*a$:
-
8/9/2019 Chapter3 Redes de computadoras
64/108
Transport Layer 3-
Chapter 3 out$ine
3.1 Transport"$ayerser*ices
3.% 2u$tip$e+ing anddemu$tip$e+ing
3.3 Connection$esstransport: /D0
3. 0rincip$es o- re$ia)$edata trans-er
3.5 Connection"orientedtransport: TC0 segment structure re$ia)$e data trans-er
-$ow contro$ connection management
3.4 0rincip$es o-congestion contro$
3. TC0 congestion contro$
-
8/9/2019 Chapter3 Redes de computadoras
65/108
Transport Layer 3-
TC0 re$ia)$e data trans-er
TC0 creates rdtser*ice on top o- 0Gsunre$ia)$e ser*ice
pipe$ined segments cumu$ati*e acks TC0 uses sing$e
retransmission timer
retransmissions aretriggered )y: timeout e*ents dup$icate acks
initia$$y considersimp$i-ied TC0 sender: ignore dup$icate acks ignore -$ow contro$
congestion contro$
TC0 sender e*ents:
-
8/9/2019 Chapter3 Redes de computadoras
66/108
Transport Layer 3-
TC0 sender e*ents:data rc*d -rom app:
Create segment withse >
se > is )yte"streamnum)er o- -irst data
)yte in segment start timer i- not
a$ready running 9thinko- timer as -or o$destunacked segment
e+piration inter*a$:TimeOt!nterva"
timeout:
retransmit segmentthat caused timeout
restart timer
Ack rc*d: - acknow$edges
pre*ious$y unackedsegments update what is known to
)e acked start timer i- there are
outstanding segments
5e2te75um 0 "nitiale75um
endFase 0 "nitiale75um
-
8/9/2019 Chapter3 Redes de computadoras
67/108
Transport Layer 3-
TC0
sender9simp$i-ied
endFase 0 "nitiale75um
loop (forever) ?
s!itch(event)
event:data received from application abovecreate T3 segment !ith se7uence number 5e2te75um
if (timer currently not running)
start timer
pass segment to "
5e2te75um 0 5e2te75um 9 length(data)
event:timer timeout
retransmit not-yet-ackno!ledged segment !ith
smallest se7uence number
start timer
event:A3' received, !ith A3' field value of y
if (y G endFase) ?endFase 0 y
if (there are currently not-yet-ackno!ledged segments)
start timer
@
@ H end of loop forever H
Comment: ?end8ase"1: $astcumu$ati*e$yacked )yteI+amp$e:?end8ase"1 7 1U
y7 3 so the rc*rwants 3P U
y ?end8ase sothat new data isacked
TC0 t i i i
-
8/9/2019 Chapter3 Redes de computadoras
68/108
Transport Layer 3-
TC0: retransmission scenarios
6ost A
Ae70*//,./bytesdata
A3'
0*//
timepremature timeout
6ost 8
e70+.,Ebytesdata
A3'0*./
e70+.,Ebytesdata
?eA
7'%timeout
A3'
0*./
6ost A
e70+.,Ebytesdata
A3'0*/
/
$osstimeout
$ost ACK scenario
6ost 8
Ie70+.,Ebytesdata
A3'0*//
time
?eA7'%timeout
?end8ase7 1&&
?end8ase7 1%&
?end8ase7 1%&
?end8ase7 1&&
-
8/9/2019 Chapter3 Redes de computadoras
69/108
Transport Layer 3-
TC0 retransmission scenarios 9more
6ost A
e70+.,Ebytesdata
A3'0*/
/
$osstimeout
Cumu$ati*e ACK scenario
6ost 8
I
e70*//,./bytesdata
A3'0*.
/
time
?end8ase7 1%&
-
8/9/2019 Chapter3 Redes de computadoras
70/108
Transport Layer 3-
TC0 ACK generationB!C 11%% !C %5@1
Jvent at eceiver
Arrival of in-order segment !ith
e2pected se7 K. All data up to
e2pected se7 K already A3'ed
Arrival of in-order segment !ith
e2pected se7 K. Lne other
segment has A3' pending
Arrival of out-of-order segment
higher-than-e2pect se7. K .Map detected
Arrival of segment that
partially or completely fills gap
T3 eceiver action
Nelayed A3'. Wait up to O//ms
for ne2t segment. "f no ne2t segment,
send A3'
"mmediately send single cumulative
A3', A3'ing both in-order segments
"mmediately send duplicate ACK,
indicating se7. K of ne2t e2pected byte
"mmediate send A3', provided that
segment starts at lo!er end of gap
-
8/9/2019 Chapter3 Redes de computadoras
71/108
Transport Layer 3-
ast !etransmit
time"out period o-tenre$ati*e$y $ong: $ong de$ay )e-ore
resending $ost packet
detect $ost segments*ia dup$icate ACKs. sender o-ten sends
many segments )ack"to")ack
i- segment is $ost therewi$$ $ike$y )e manydup$icate ACKs.
i- sender recei*es 3ACKs -or the samedata it supposes thatsegment a-ter ACKed
data was $ost: -ast retransmit: resend
segment )e-ore timere+pires
6ost A 6ost 8
-
8/9/2019 Chapter3 Redes de computadoras
72/108
Transport Layer 3-
6ost A
timeout
6ost 8
time
I
resend.ndsegment
&igure .C esending a segment after triple duplicate A3'
$ h
-
8/9/2019 Chapter3 Redes de computadoras
73/108
Transport Layer 3-
event:A3' received, !ith A3' field value of y
if (y G endFase) ?
endFase 0 y
if (there are currently not-yet-ackno!ledged segments)
start timer
@else ?
increment count of dup A3's received for y
if (count of dup A3's received for y 0 ) ?
resend segment !ith se7uence number y
@
ast retransmit a$gorithm:
a dup$icate ACK -ora$ready ACKed segment
-ast retransmit
h $
-
8/9/2019 Chapter3 Redes de computadoras
74/108
Transport Layer 3-
Chapter 3 out$ine
3.1 Transport"$ayerser*ices
3.% 2u$tip$e+ing anddemu$tip$e+ing
3.3 Connection$esstransport: /D0
3. 0rincip$es o- re$ia)$edata trans-er
3.5 Connection"orientedtransport: TC0 segment structure re$ia)$e data trans-er
-$ow contro$ connection management
3.4 0rincip$es o-congestion contro$
3. TC0 congestion contro$
C0 $ C $
-
8/9/2019 Chapter3 Redes de computadoras
75/108
Transport Layer 3-
TC0 $ow Contro$
recei*e side o- TC0connection has arecei*e )u--er:
speed"matchingser*ice: matching thesend rate to therecei*ing appGs drain
rate app process may )es$ow at reading -rom)u--er
sender wonGt o*er-$owrecei*erGs )u--er )ytransmitting too
muchtoo -ast
-$ow contro$
TC0 $ $ h i k
-
8/9/2019 Chapter3 Redes de computadoras
76/108
Transport Layer 3-
TC0 $ow contro$: how it works
9suppose TC0 recei*erdiscards out"o-"ordersegments
spare room in )u--er= Rcv+ind#,
= Rcvuer-/astteRcvd -
astteRead
rc*r ad*ertises spareroom )y inc$uding *a$ueo- Rcv+ind#,insegments
sender $imits unACKeddata to Rcv+ind#, guarantees recei*e
)u--er doesnGt o*er-$ow
Ch 3 $i
-
8/9/2019 Chapter3 Redes de computadoras
77/108
Transport Layer 3-
Chapter 3 out$ine
3.1 Transport"$ayerser*ices
3.% 2u$tip$e+ing anddemu$tip$e+ing
3.3 Connection$esstransport: /D0
3. 0rincip$es o- re$ia)$edata trans-er
3.5 Connection"orientedtransport: TC0 segment structure re$ia)$e data trans-er
-$ow contro$ connection management
3.4 0rincip$es o-congestion contro$
3. TC0 congestion contro$
-
8/9/2019 Chapter3 Redes de computadoras
78/108
-
8/9/2019 Chapter3 Redes de computadoras
79/108
Transport Layer 3-
TC0 Connection 2anagement 9cont.
C$osing a connection:
c$ient c$oses socket:clientS#cet.cl#se()6
?tep 1:c$ientend systemsends TC0 N contro$segment to ser*er
?tep %:ser*er recei*es Nrep$ies with ACK. C$oses
connection sends N.
c$ient
&"5
ser*er
A3'
A3'
&"5
c$ose
c$ose
c$osedtimed
wait
-
8/9/2019 Chapter3 Redes de computadoras
80/108
Transport Layer 3-
TC0 Connection 2anagement 9cont.
?tep 3:c$ientrecei*es Nrep$ies with ACK.
Inters ;timed wait< " wi$$respond with ACK torecei*ed Ns
?tep :ser*er recei*es ACK.Connection c$osed.
Note:with sma$$ modi-icationcan hand$e simu$taneous Ns.
c$ient
&"5
ser*er
A3'
A3'
&"5
c$osing
c$osing
c$osedtimed
wait
c$osed
TC0 Connection 2anagement 9cont
-
8/9/2019 Chapter3 Redes de computadoras
81/108
Transport Layer 3-
TC0 Connection 2anagement 9cont
TC0 c$ient$i-ecyc$e
TC0 ser*er
$i-ecyc$e
Ch t 3 t$i
-
8/9/2019 Chapter3 Redes de computadoras
82/108
Transport Layer 3-
Chapter 3 out$ine
3.1 Transport"$ayerser*ices
3.% 2u$tip$e+ing anddemu$tip$e+ing
3.3 Connection$esstransport: /D0
3. 0rincip$es o- re$ia)$edata trans-er
3.5 Connection"orientedtransport: TC0 segment structure re$ia)$e data trans-er
-$ow contro$ connection management
3.40rincip$es o-congestion contro$
3. TC0 congestion contro$
0 i i $ - C ti C t $
-
8/9/2019 Chapter3 Redes de computadoras
83/108
Transport Layer 3-
0rincip$es o- Congestion Contro$
Congestion: in-orma$$y: ;too many sources sending too much
data too -ast -or networkto hand$e< di--erent -rom -$ow contro$F mani-estations:
$ost packets 9)u--er o*er-$ow at routers $ong de$ays 9ueueing in router )u--ers
a top"1& pro)$emF
C , - 1
-
8/9/2019 Chapter3 Redes de computadoras
84/108
Transport Layer 3-
Causes,costs o- congestion: scenario 1
two senders tworecei*ers one router
in-inite )u--ers
no retransmission
$arge de$ayswhen congested
ma+imumachie*a)$ethroughput
unlimited shared
output link buffers
Post Ain : original data
Post F
out
C , - i i %
-
8/9/2019 Chapter3 Redes de computadoras
85/108
Transport Layer 3-
Causes,costs o- congestion: scenario %
one router -inite)u--ers sender retransmission o- timed"out packet
app$ication"$ayer input 7 app$ication"$ayer output:in 0 out transport"$ayer input inc$udes retransmissions :in in
finite shared output
link buffers
Post A
in: original data
Post F
outQin:original data,plusretransmitted data
S
Congestion scenario %a: idea$ case
-
8/9/2019 Chapter3 Redes de computadoras
86/108
Transport Layer 3-
Congestion scenario %a: idea$ case
sender sendson$y when router)u--ers a*ai$a)$e
finite shared output
link buffers
Post A
in: original data
Post F
outQin:original data,plusretransmitted data
copy
in
out
free buffer space!
Congestion scenario %): known $oss
-
8/9/2019 Chapter3 Redes de computadoras
87/108
Transport Layer 3-
Post A
in: original data
Post F
outQin:original data,plusretransmitted data
copy
no buffer space!
packets may get dropped atrouter due to -u$$ )u--ers
sometimes $ost sender on$y resends i-
packet knownto )e $ost
9admitted$y idea$ied
Congestion scenario %): known$oss
Congestion scenario %): known $oss
-
8/9/2019 Chapter3 Redes de computadoras
88/108
Transport Layer 3-
Congestion scenario %) known$oss
Post A
in: original data
Post F
outQin:original data,plusretransmitted data
free buffer space!
packets may get dropped atrouter due to -u$$ )u--ers
sometimes not $ost sender on$y resends i-
packet knownto )e $ost
9admitted$y idea$ied
in
out
when sending at!,% some packetsare retransmissions)ut asymptoticgoodput is sti$$ !,%9whyE
Congestion scenario %c: dup$icates
-
8/9/2019 Chapter3 Redes de computadoras
89/108
Transport Layer 3-
packets may get dropped atrouter due to -u$$ )u--ers
sender times outpremature$y sending twocopies )oth o- which arede$i*ered
Post A
in
Post F
outQincopy
free buffer space!
Congestion scenario %c dup$icates
timeout
in
out
when sending at!,% some packetsare retransmissionsinc$uding dup$icatedthat are de$i*eredF
Congestion scenario %c: dup$icates
-
8/9/2019 Chapter3 Redes de computadoras
90/108
Transport Layer 3-
packets may get dropped atrouter due to -u$$ )u--ers
sender times outpremature$y sending twocopies )oth o- which arede$i*ered
Congestion scenario %c dup$icates
out
when sending at!,% some packetsare retransmissionsinc$uding dup$icatedthat are de$i*eredF
;costs< o- congestion: more work 9retrans -or gi*en ;goodput< unneeded retransmissions: $ink carries mu$tip$e copies o- pkt
decreasing goodput
in
C , t - ti i 3
-
8/9/2019 Chapter3 Redes de computadoras
91/108
Transport Layer 3-
Causes,costs o- congestion: scenario 3 -our senders mu$tihop paths timeout,retransmit
in
R:what happens asand increaseE
in
finite shared output
link buffers
Post Ain : original data
Post F
out
Qin : original data, plus
retransmitted data
C , t - ti i 3
-
8/9/2019 Chapter3 Redes de computadoras
92/108
Transport Layer 3-
Causes,costs o- congestion: scenario 3
another ;cost< o- congestion: when packet dropped any ;upstream transmission capacity used
-or that packet was wastedF
P
os
t
A
P
o
s
t
F
o
u
t
Approaches towards congestion contro$
-
8/9/2019 Chapter3 Redes de computadoras
93/108
Transport Layer 3-
Approaches towards congestion contro$
end"end congestioncontro$:
no e+p$icit -eed)ack -romnetwork
congestion in-erred -romend"system o)ser*ed $ossde$ay
approach taken )y TC0
network"assistedcongestion contro$:
routers pro*ide -eed)ack
to end systems sing$e )it indicating
congestion 9?NADIC)it TC0,0 ICNAT2
e+p$icit rate sendershou$d send at
Two )road approaches towards congestion contro$:
Case study: AT2 A8! congestion contro$
-
8/9/2019 Chapter3 Redes de computadoras
94/108
Transport Layer 3-
Case study: AT2 A8! congestion contro$
A8!: a*ai$a)$e )it rate: ;e$astic ser*ice< i- senderGs path
;under$oaded
-
8/9/2019 Chapter3 Redes de computadoras
95/108
Transport Layer 3-
Case study: AT2 A8! congestion contro$
two")yte I! 9e+p$icit rate -ie$d in !2 ce$$ congested switch may $ower I! *a$ue in ce$$
senderG send rate thus ma+imum supporta)$e rate on path IC )it in data ce$$s: set to 1 in congested switch
i- data ce$$ preceding !2 ce$$ has IC set sender sets C)it in returned !2 ce$$
Chapter 3 out$ine
-
8/9/2019 Chapter3 Redes de computadoras
96/108
Transport Layer 3-
Chapter 3 out$ine
3.1 Transport"$ayerser*ices
3.% 2u$tip$e+ing anddemu$tip$e+ing
3.3 Connection$esstransport: /D0
3. 0rincip$es o- re$ia)$edata trans-er
3.5 Connection"orientedtransport: TC0 segment structure re$ia)$e data trans-er
-$ow contro$ connection management
3.4 0rincip$es o-congestion contro$
3. TC0 congestion contro$
TC0 congestion contro$: additi*e increase
-
8/9/2019 Chapter3 Redes de computadoras
97/108
Transport Layer 3-
g mu$tip$icati*e decrease
E ' b y t e s
* , ' b y t e s
. B ' b y t e s
t im e
c o n g e s t i o n
! i n d o !
approach:increase transmission rate 9window sie pro)ing -or usa)$e
)andwidth unti$ $oss occurs additi*e increase:increase c,nd)y 1 2?? e*ery !TT unti$ $oss detected mu$tip$icati*e decrease:cut c,nd in ha$- a-ter $oss
time
cwn#:congestion!indo!
siRe
saw tooth)eha*ior: pro)ing
-or )andwidth
TC0 Congestion Contro$: detai$s
-
8/9/2019 Chapter3 Redes de computadoras
98/108
Transport Layer 3-
TC0 Congestion Contro$: detai$s
sender $imits transmission: astteSent-astte7ced
c,nd
rough$y
c,ndis dynamic -unction o-percei*ed network congestion
6ow does senderpercei*e congestionE
$oss e*ent 7 timeout or3 dup$icate acks
TC0 sender reducesrate 9c,nd a-ter $osse*ent
three mechanisms:
A2D s$ow start conser*ati*e a-ter
timeout e*ents
rate 7 cwnd
!TT8ytes,sec
TC0 ?$ow ?tart
-
8/9/2019 Chapter3 Redes de computadoras
99/108
Transport Layer 3-
TC0 ?$ow ?tart
when connection)egins increase ratee+ponentia$$y unti$-irst $oss e*ent:
initia$$y c,nd7 1 2?? dou)$e c,nde*ery !TT done )y incrementingc,nd-or e*ery ACKrecei*ed
summary:initia$ rate iss$ow )ut ramps upe+ponentia$$y -ast
6ost A
onesegment
!TT
6ost 8
time
t!osegments
foursegments
!e-inement: in-erring $oss
-
8/9/2019 Chapter3 Redes de computadoras
100/108
Transport Layer3-
!e-inement: in-erring $oss
a-ter 3 dup ACKs: c,ndis cut in ha$- window then grows $inear$y
)ut a-ter timeout e*ent: c,ndinstead set to 1 2??U
window then grows e+ponentia$$y to a thresho$d then grows $inear$y
3 dup ACKs indicates
network capa)$e o-de$i*ering some segmentstimeout indicates a;more a$arming
top related