Escolar Documentos
Profissional Documentos
Cultura Documentos
Transport Layer
A note on the use of these ppt slides:
Were making these slides freely available to all (faculty, students, readers).
Theyre in PowerPoint form so you see the animations; and can add, modify,
and delete slides (including this one) and slide content to suit your needs.
They obviously represent a lot of work on our part. In return for use, we only
ask the following:
If you use these slides (e.g., in a class) that you mention their source
(after all, wed like people to use our book!)
If you post any slides on a www site, that you note that they are adapted
from (or perhaps identical to) our slides, and note our copyright of this
material.
Thanks and enjoy! JFK/KWR
Computer
Networking: A
Top Down
Approach
6th edition
Jim Kurose, Keith
Ross
Addison-Wesley
March 2012
multiplexing, de-multiplexing
reliable data transfer
flow control
congestion control
t
or
sp
an
tr
d
en
den
l
ca
gi
lo
communication between
app processes running on
different hosts
applicatio
n
transport
network
data link
physical
applicatio
n
transport
network
data link
physical
network layer:
logical
communication
between hosts
transport layer:
logical
communication
between processes
relies on, enhances,
network layer
services
household analogy:
12 kids in Anns house
sending letters to 12
kids in Bills house:
hosts = houses
processes = kids
app messages =
letters in envelopes
transport protocol =
Ann and Bill who
demux to in-house
siblings
network-layer
protocol = postal
service
Transport Layer 3-4
Internet transport-layer
protocols
reliable, in-order
delivery (TCP)
t
or
sp
an
no-frills extension of
best-effort IP
network
data link
physical
tr
unreliable, unordered
delivery: UDP
network
data link
physical
d
en
den
network
data link
physical
l
ca
gi
lo
congestion control
flow control
connection setup
applicatio
n
transport
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
applicatio
n
transport
network
data link
physical
Multiplexing/demultiplexin
g
multiplexing at sender:
demultiplexing at receiver:
use header info to deliver
received segments to corre
socket
application
application
P1
P2
application
P3
transport
P4
transport
network
transport
network
link
network
link
physical
link
physical
socket
process
physical
host receives IP
datagrams
each datagram has source IP
address, destination IP address
each datagram carries one
transport-layer segment
each segment has source,
destination port number
32 bits
source port #
dest port #
application
data
(payload)
Connectionless
demultiplexing
IP datagrams with
same dest. port #, but
different source IP
addresses and/or
source port numbers
will be directed to
same socket at dest.
Transport Layer 3-8
Connectionless demux:
example
DatagramSocket mySocket2
= new DatagramSocket
(9157);
DatagramSocket serverSocket
= new DatagramSocket
(6428);
DatagramSocket
mySocket1 = new
DatagramSocket (5775);
application
application
application
P1
P3
P4
transport
transport
transport
network
network
link
network
link
physical
link
physical
physical
source port: 6428
dest port: 9157
source port: ?
dest port: ?
source port: ?
dest port: ?
Transport Layer 3-9
Connection-oriented
demux
TCP socket
identified by 4tuple:
source IP address
source port number
dest IP address
dest port number
demux: receiver
uses all four values
to direct segment
to appropriate
socket
Connection-oriented demux:
example
application
application
P4
P3
P5
application
P6
P3
P2
transport
transport
transport
network
network
link
network
link
physical
link
physical
host: IP
address
A
server:
IP
address
B
physical
host: IP
address
C
Connection-oriented demux:
example
threaded server
application
application
P3
application
P4
P3
P2
transport
transport
transport
network
network
link
network
link
physical
link
physical
host: IP
address
A
server:
IP
address
B
physical
host: IP
address
C
UDP use:
streaming
multimedia apps
(loss tolerant, rate
sensitive)
DNS
SNMP
reliable transfer
over UDP:
add reliability at
application layer
application-specific
error recovery!
Transport Layer 3-13
dest port #
length
checksum
length, in bytes of
UDP segment,
including header
application
data
(payload)
no connection
establishment (which
can add delay)
simple: no connection
state at sender, receiver
small header size
no congestion control:
UDP can blast away as
fast as desired
UDP checksum
Goal: detect errors (e.g., flipped bits) in
transmitted segment
sender:
receiver:
compute checksum of
received segment
check if computed
checksum equals checksum
field value:
NO - error detected
YES - no error detected.
But maybe errors
nonetheless? More later
.
Internet checksum:
example
example: add two 16-bit integers
1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
sum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0
checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
send
side
deliver_data(): called
by rdt to deliver data to
upper
receive
side
well:
incrementally develop sender, receiver
sides of reliable data transfer protocol (rdt)
consider only unidirectional data transfer
but control info will flow on both directions!
state
1
event
actions
state
2
rdt_send(data)
packet = make_pkt(data)
udt_send(packet)
sender
Wait for
call from
below
rdt_rcv(packet)
extract (packet,data)
deliver_data(data)
receiver
Transport Layer 3-22
receiver
Wait for
ACK or NAK
rdt_rcv(rcvpkt) &&
isNAK(rcvpkt)
rdt_rcv(rcvpkt) &&
corrupt(rcvpkt)
udt_send(sndpkt)
udt_send(NAK)
sender
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
Wait for
ACK or NAK
rdt_rcv(rcvpkt) &&
isNAK(rcvpkt)
rdt_rcv(rcvpkt) &&
corrupt(rcvpkt)
udt_send(sndpkt)
udt_send(NAK)
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
Wait for
ACK or NAK
rdt_rcv(rcvpkt) &&
isNAK(rcvpkt)
rdt_rcv(rcvpkt) &&
corrupt(rcvpkt)
udt_send(sndpkt)
udt_send(NAK)
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
handling duplicates:
udt_send(sndpkt)
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt)
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt)
udt_send(sndpkt)
rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) ||
isNAK(rcvpkt) )
Wait for
call 1 from
above
rdt_send(data)
sndpkt = make_pkt(1, data, checksum)
udt_send(sndpkt)
rdt_rcv(rcvpkt) &&
not corrupt(rcvpkt) &&
has_seq1(rcvpkt)
Wait for
0 from
below
Wait for
1 from
below
rdt_rcv(rcvpkt) &&
not corrupt(rcvpkt) &&
has_seq0(rcvpkt)
sndpkt = make_pkt(ACK, chksum)
udt_send(sndpkt)
rdt2.1: discussion
sender:
seq # added to pkt
two seq. #s (0,1)
will suffice. Why?
must check if
received ACK/NAK
corrupted
twice as many states
state must
remember whether
expected pkt should
have seq # of 0 or 1
receiver:
must check if
received packet is
duplicate
state indicates
whether 0 or 1 is
expected pkt seq
#
Because of Corrupt
Packet, send
Previous ACK
instead of NAK
rdt_send(data)
sender FSM
fragment
rdt_rcv(rcvpkt) &&
(corrupt(rcvpkt) ||
has_seq1(rcvpkt))
udt_send(sndpkt)
Wait for
0 from
below
rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) ||
isACK(rcvpkt,1) )
udt_send(sndpkt)
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt,0)
receiver FSM
fragment
extract(rcvpkt,data)
deliver_data(data)
sndpkt = make_pkt(ACK1, chksum)
udt_send(sndpkt)
retransmits if no ACK
received in this time
if pkt (or ACK) just
delayed (not lost):
retransmission will be
duplicate, but seq. #s
already handles this
receiver must specify
seq # of pkt being
ACKed
requires countdown timer
Transport Layer 3-34
rdt3.0
sender
rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) ||
isACK(rcvpkt,1) )
rdt_rcv(rcvpkt)
Wait for
ACK0
Wait for
call 0from
above
Time_OUT
timeout
udt_send(sndpkt)
start_timer
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt,1)
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt,0)
stop_timer
stop_timer
Wait for
ACK1
timeout
NON
Corrup
t&
ACK(0)
Wait for
call 1 from
above
udt_send(sndpkt)
start_timer
rdt_rcv(rcvpkt)
rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) ||
isACK(rcvpkt,0) )
rdt_send(data)
rdt3.0 in
action receiver
sender
send pkt0
rcv ack0
send pkt1
rcv ack1
send pkt0
pkt0
ack0
send pkt0
rcv pkt0
send ack0
pkt1
ack1
pkt0
ack0
rcv pkt1
send ack1
rcv pkt0
send ack0
(a) no loss
receiver
sender
rcv ack0
send pkt1
pkt0
ack0
rcv pkt0
send ack0
pkt1
loss
timeout
resend pkt1
rcv ack1
send pkt0
pkt1
ack1
rcv pkt1
send ack1
pkt0
ack0
rcv pkt0
send ack0
rdt3.0 in
sender
action
send pkt0
rcv ack0
send pkt1
pkt0
ack0
pkt1
ack1
receiver
rcv pkt0
send ack0
rcv pkt1
send ack1
loss
timeout
resend pkt1
rcv ack1
send pkt0
pkt1
ack1
pkt0
ack0
receiver
sender
rcv pkt1
(detect duplicate)
send ack1
rcv pkt0
send ack0
send pkt0
rcv ack0
send pkt1
pkt0
rcv pkt0
send ack0
ack0
pkt1
rcv pkt1
send ack1
ack1
timeout
pkt1
resend pkt1
rcv ack1
pkt0
send pkt0
ack1
rcv ack1
ack0
send pkt0
pkt0
ack0
rcv pkt1
(detect duplicate)
send ack1
rcv pkt0
send ack0
rcv pkt0
(detect duplicate)
send ack0
Performance of rdt3.0
8000 bits
L
= 8 microsecs
Dtrans = R = 9
10 bits/sec
U
sender
sender =
L/R
RTT + L / R
.008
30.008
= 0.00027
if RTT=30 msec, 1KB pkt every 30 msec: 33kB/sec thruput over 1 Gbps link
rdt3.0: stop-and-wait
operation
sender
receiver
RTT
sender =
L/R
RTT + L / R
.008
30.008
= 0.00027
Pipelined protocols
pipelining: sender allows multiple, inflight, yet-to-be-acknowledged pkts
range of sequence numbers must be
increased
buffering at sender and/or receiver
Pipelining: increased
utilization
sender
receiver
RTT
sender =
3L / R
RTT + L / R
.0024
30.008
= 0.00081
Pipelined protocols:
overview
Go-back-N:
sender can have up
to N unacked
packets in pipeline
receiver only sends
cumulative ack
Selective Repeat:
sender can have up to
N unacked packets in
pipeline
rcvr sends individual
ack for each packet
sender maintains
timer for each
unacked packet
when timer expires,
retransmit only that
unacked packet
Transport Layer 3-42
Go-Back-N: sender
base=1
nextseqnum=1
timeout
Wait
rdt_rcv(rcvpkt)
&& corrupt(rcvpkt)
start_timer
udt_send(sndpkt[base])
udt_send(sndpkt[base+1])
udt_send(sndpkt[nextseqnum-1])
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
NEXT
base = getacknum(rcvpkt)+1
If (base == nextseqnum)
stop_timer
else
start_timer
udt_send(sndpkt)
Wait
expectedseqnum=1
sndpkt =
make_pkt(expectedseqnum,ACK,chksum)
rdt_rcv(rcvpkt)
&& notcurrupt(rcvpkt)
&& hasseqnum(rcvpkt,expectedseqnum)
extract(rcvpkt,data)
deliver_data(data)
sndpkt = make_pkt(expectedseqnum,ACK,chksum)
udt_send(sndpkt)
expectedseqnum++
ACK-only: always send ACK for correctlyreceived pkt with highest in-order seq #
may generate duplicate ACKs
need only remember expectedseqnum
out-of-order pkt:
discard (dont buffer): no receiver buffering!
re-ACK pkt with highest in-order seq #
Transport Layer 3-45
GBN in action
sender window (N=4)
012345678
012345678
012345678
012345678
sender
send pkt0
send pkt1
send pkt2
send pkt3
(wait)
0 1 2 3 4 5 6 7 8 rcv
012345678
012345678
012345678
012345678
pkt 2 timeout
send pkt2
send pkt3
send pkt4
send pkt5
receiver
Xloss
rcv
rcv
rcv
rcv
pkt2,
pkt3,
pkt4,
pkt5,
deliver,
deliver,
deliver,
deliver,
send
send
send
send
ack
ack
ack
ack
Selective repeat
sender window
N consecutive seq #s
limits seq #s of sent, unACKed pkts
Selective repeat
sender
receiver
pkt n in
timeout(n):
resend pkt n, restart
timer
ACK(n) in
1]
[sendbase,sendbase+N]:
send ACK(n)
out-of-order: buffer
in-order: deliver (also
deliver buffered, inorder pkts), advance
window to next notyet-received pkt
pkt n in
1]
[rcvbase, rcvbase+N-
[rcvbase-N,rcvbase-
ACK(n)
otherwise:
ignore
Transport Layer 3-49
send pkt0
send pkt1
send pkt2
send pkt3
(wait)
Xloss
0 1 2 3 4 5 6 7 8 rcv
012345678
012345678
012345678
012345678
pkt 2 timeout
send pkt2
record ack4 arrived
record ack4 arrived
receiver window
(after receipt)
sender window
(after receipt)
Selective repeat:
dilemma
example:
seq #s: 0, 1, 2, 3
window size=3
receiver sees no difference in
two scenarios!
duplicate data accepted as
new in (b) .. BECAUSE Rx doesnt
know about LOST NAKs.
0123012
pkt0
0123012
pkt1
0123012
0123012
pkt2
0123012
0123012
pkt3
0123012
0123012
pkt0
(a) no problem
pkt0
0123012
pkt1
0123012
0123012
pkt2
0123012
X
X
timeout
retransmit pkt0X
0123012
0123012
(b) oops!
pkt0
Chapter 3 outline
3.1 transport-layer
services
3.2 multiplexing
and
demultiplexing
3.3 connectionless
transport: UDP
3.4 principles of
reliable data
transfer
3.5 connection-oriented
transport: TCP
segment structure
reliable data transfer
flow control
connection
management
3.6 principles of
congestion control
3.7 TCP congestion
control
Transport Layer 3-52
point-to-point:
reliable, in-order
byte steam:
no message
boundaries
connection-oriented:
handshaking
(exchange of control
msgs) inits sender,
receiver state before
data exchange
pipelined:
TCP congestion and
flow control set
window size
flow controlled:
sender will not
overwhelm receiver
Transport Layer 3-53
source port #
dest port #
sequence number
acknowledgement number
head not
UAP R S F
len used
checksum
receive window
Urg data pointer
counting
by bytes
of data
(not segments!)
# bytes
rcvr willing
to accept
application
data
(variable length)
sequence numbers:
byte stream number
of first byte in
segments data
acknowledgements:
seq # of next byte
expected from other
side
cumulative ACK
Q: how receiver handles
out-of-order segments
A: TCP spec doesnt
say, - up to
implementor
source port #
dest port #
sequence number
acknowledgement number
rwnd
checksum
urg pointer
window size
N
dest port #
sequence number
acknowledgement number
rwnd
A
checksum
urg pointer
Host A
User
types
C Seq=42, ACK=79, data = C
host ACKs
receipt
of echoed
C
host ACKs
receipt of
C, echoes
back C
Seq=43, ACK=80
Q: how to estimate
RTT?
too short:
premature timeout,
unnecessary
retransmissions
too long: slow
reaction to
segment loss
SampleRTT: measured
time from segment
transmission until ACK
receipt
ignore retransmissions
SampleRTT will vary,
want estimated RTT
smoother
average several recent
measurements, not
just current SampleRTT
RTT (milliseconds)
weighting
factor(0 <
1)
smoothing
factor;
determines
weight given to
previous
estimate
sampleRTT
EstimatedRTT
What if = 0,
1
time
RTT Variation: as an
(typically, = 0.25)
estimate of how much
SampleRTT typically
deviates from
EstimatedRTT:
TimeoutInterval = EstimatedRTT +
estimated RTT
4*DevRTT
safety margin
retransmissions
triggered by:
timeout events
duplicate acks
Transport Layer 3-60
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
TCP sender
(simplified)
data received from application above
NextSeqNum = InitialSeqNum
SendBase = InitialSeqNum
wait
for
event
timeout
retransmit not-yet-acked
segment
with
smallest seq. #
start timer
if (y > SendBase) {
SendBase = y
/* SendBase1: last cumulatively ACKed byte */
if (there are currently not-yet-acked segments)
start timer
else stop timer
}
TCP: retransmission
scenarios
Host B
Host A
Host B
Host A
SendBase=92
ACK=100
timeout
Seq=92, 8
bytes of data
SendBase=120
ACK=120
SendBase=120
premature timeout
Transport Layer 3-63
TCP: retransmission
scenarios
Host B
Host A
timeout
ACK=100
A cumulative acknowledgment
avoids retransmission of the first
segment
ACK=120
cumulative ACK
Transport Layer 3-64
2581]
event at receiver
TCP fast
retransmit
time-out period
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
(tripleduplicate
duplicate
(triple
ACKs),
ACKs), resend
unacked segment
with smallest seq #
likely that unacked
segment lost, so
dont wait for
timeout
TCP fast
retransmit
Host B
Host A
timeout
X
ACK=100
ACK=100
ACK=100
ACK=100
Seq=100, 20 bytes of data
application
process
application
TCP socket
receiver buffers
TCP
code
flow control
receiver controls sender,
so sender wont overflow
receivers buffer by
transmitting too much,
too fast
OS
IP
code
from sender
to application process
RcvBuffer
rwnd
buffered data
free buffer space
receiver-side buffering
Connection Management
before exchanging data, sender/receiver
handshake:
application
connection state:
ESTAB
connection variables:
seq # client-toserver
server-to-client
rcvBuffer size
network
at server,client
connection state:
ESTAB
connection Variables:
seq # client-toserver
server-to-client
rcvBuffer size
network
at server,client
Socket clientSocket =
newSocket("hostname","port
number");
Socket connectionSocket =
welcomeSocket.accept();
Transport Layer 3-70
Agreeing to establish a
connection
2-way handshake:
Lets talk
ESTAB
OK
ESTAB
choose x
ESTAB
variable delays
retransmitted messages
(e.g. req_conn(x)) due to
message loss
message reordering
cant see other side
req_conn(x)
acc_conn(x)
ESTAB
Agreeing to establish a
connection
choose x
retransmit
req_conn(x)
Before ESTAB
ESTAB
choose x
req_conn(x)
ESTAB
ESTAB
retransmit
req_conn(
x)
ESTAB
acc_conn(x)
req_conn(x)
client
terminat
es
req_conn(x)
connection
x completes
acc_conn(x)
data(x+1)
retransmit
data(x+1)
server
forgets x
ESTAB
client
terminat
es
accept
data(x+1
)
connection
x completes
server
req_conn(x) forgets x
data(x+1)
ESTAB
accept
data(x+1
)
Connection
Request
server state
LISTEN
LISTEN
choose init seq num, x
send TCP SYN msg
SYNSENT
Connection
Granted
SYNbit=1, Seq=x
SYNbit=1, Seq=y
ACKbit=1; ACKnum=x+1
received SYNACK(x)
ESTAB indicates server is live;
send ACK for SYNACK;
this segment may contain ACKbit=1, ACKnum=y+1
client-to-server data
ACK
received ACK(y)
indicates client is live
ESTAB
SYN(x)
SYNACK(seq=y,ACKnum=x+1)
create new socket for
communication back to client
listen
SYN(seq=x)
SYN
sent
SYN
rcvd
ACK(ACKnum=y+1)
Socket clientSocket =
newSocket("hostname","port
number");
ESTAB
SYNACK(seq=y,ACKnum=x+1)
ACK(ACKnum=y+1)
server state
ESTAB
ESTAB
clientSocket.close()
FIN_WAIT_1
can no longer
send but can
receive data
FINbit=1, seq=x
CLOSE_WAIT
ACKbit=1; ACKnum=x+1
FIN_WAIT_2
FINbit=1, seq=y
TIMED_WAIT
timed wait
for 2*max
segment lifetime
can still
send data
LAST_ACK
can no longer
send data
ACKbit=1; ACKnum=y+1
CLOSED
CLOSED
Transport Layer 3-76
Principles of congestion
control
congestion:
Causes/costs of congestion:
scenario 1
original data:
throughput:out
Host A
unlimited shared
output link buffers
Host B
R/2
delay
out
in
in
in
R/2
maximum per-connection
throughput: R/2
R/2
Causes/costs of congestion:
scenario
2
one router, finite buffers
out
retransmitted data
Host A
Host B
Causes/costs of congestion:
scenario 2
out
idealization: perfect
knowledge
sender sends only when
router buffers available
R/2
in
in : original data
copy
R/2
out
retransmitted data
A
Host B
Causes/costs of congestion:
scenario
2
Idealization: known
loss packets can be
in : original data
copy
out
retransmitted data
A
no buffer space!
Host B
Transport Layer 3-81
Causes/costs of congestion:
scenario
2
Idealization: known
out
R/2
in
in : original data
R/2
out
retransmitted data
A
Host B
Transport Layer 3-82
Causes/costs of congestion:
scenario
2
Realistic: duplicates
R/2
out
in
in
'in
copy
timeout
R/2
out
Host B
Transport Layer 3-83
Causes/costs of congestion:
scenario
2
Realistic: duplicates
R/2
out
in
R/2
costs of congestion:
Causes/costs of congestion:
scenario 3
four senders
multihop paths
timeout/retransmit
Host A
Q: what happens as in
and in increase ?
in : original data
out
Host B
Host D
Host C
Causes/costs of congestion:
scenario 3
out
C/2
in
C/2
end-end
congestion
control:
no explicit feedback
from network
congestion inferred
from end-system
observed loss,
delay
approach taken by
TCP
network-assisted
congestion
control:
routers provide
feedback to end
systems
single bit indicating
congestion (SNA,
DECbit, TCP/IP ECN,
ATM)
explicit rate for
sender to send at
Transport Layer 3-87
elastic service:
meaning rate can be
changed reacting to
traffic
if senders path
underloaded:
sender should use
available bandwidth
if senders path
congested:
sender throttled to
minimum
guaranteed rate
RM (resource management)
cells:
data cell
additive
increase multiplicative decrease
time
Transport Layer 3-90
last byte
ACKed
last byte
sent, not- sent
yet ACKed
(inflight)
~
~
RTT
bytes/sec
LastByteSent< cwnd
LastByteAcked
RTT
Host B
Host A
one segm
ent
two segm
ents
four segm
ents
time
or 3 duplicate acks)
Implementation:
variable ssthresh
on loss event, ssthresh
is set to 1/2 of cwnd just
before loss event
cwnd = 1 MSS
ssthresh = 64 KB
dupACKcount = 0
slow
start
timeout
ssthresh = cwnd/2
cwnd = 1 MSS
dupACKcount = 0
retransmit missing segment
dupACKcount == 3
ssthresh= cwnd/2
cwnd = ssthresh + 3
retransmit missing segment
New
ACK!
new ACK
cwnd = cwnd+MSS
dupACKcount = 0
transmit new segment(s), as allowed
cwnd > ssthresh
timeout
ssthresh = cwnd/2
cwnd = 1 MSS
dupACKcount = 0
retransmit missing segment
timeout
ssthresh = cwnd/2
cwnd = 1
dupACKcount = 0
retransmit missing segment
New
ACK!
new ACK
cwnd = cwnd + MSS (MSS/cwnd)
dupACKcount = 0
transmit new segment(s), as allowed
congestion
avoidance
duplicate ACK
dupACKcount++
New
ACK!
New ACK
cwnd = ssthresh
dupACKcount = 0
fast
recovery
dupACKcount == 3
ssthresh= cwnd/2
cwnd = ssthresh + 3
retransmit missing segment
duplicate ACK
cwnd = cwnd + MSS
transmit new segment(s), as allowed
TCP throughput
W: window size
occurs
(measured in bytes)
where loss
avg. window
3 W
size
(# in-flight
bytes) is W
bytes/sec
avg TCP
thruput
=
4 RTT
avg. thruput is 3/4W per
RTT
W
W/2
RTT
Throughput = (W/RTT)
Throughput = 10Gbps
RTT = 100msec
1 byte = 8 bits
RTT = Return Path
W = Throughput * 4/3* RTT
= 1333333.333
Then divided by 8 for size in
bits
W = 1333333.333/8 =
1666666.667
Then divided by 2 for
segments travelling one-way
only
TCP Fairness
fairness goal: if K TCP sessions share
same bottleneck link of bandwidth R,
each should have average rate of R/K
TCP connection 1
TCP connection 2
bottleneck
router
capacity R
Connection 1 throughput
R
Transport Layer 3-99
Fairness (more)
Fairness and UDP
multimedia apps
often do not use
TCP
do not want rate
throttled by
congestion control
Chapter 3: summary
next:
leaving the
network edge
(application,
transport layers)
into the network
core