Академический Документы
Профессиональный Документы
Культура Документы
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
DataTransportServicesareprovidedtotheapplication
DataTransportServicesareprovidedtotheapplication
process.Themainservicesare:
process.Themainservicesare:
Transport-layer Protocols:
Network-layer Protocols:
They make frames move into links, repeaters, hubs, switches, and
routes in a way from source host to destination host.
Transport-layer Protocols:
Network-layer Protocols:
They make frames move into links, repeaters, hubs, switches, and
routes in a way from source host to destination host.
processes = students,
hosts = universities,
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
receiving side:
reassembles segments into
messages messages, passes to
application layer
receiving side:
reassembles segments into
messages messages, passes to
application layer
reliable, in-order
delivery (TCP)
congestion control,
flow control,
connection setup.
unreliable, unordered
delivery (UDP)
no-frills extension of
best-effort IP.
delay guarantees,
bandwidth guarantees.
reliable, in-order
delivery (TCP)
congestion control,
flow control,
connection setup.
unreliable, unordered
delivery (UDP)
no-frills extension of
best-effort IP.
delay guarantees,
bandwidth guarantees.
Logicalendtoend Logicalendtoend
transport transport
Internet Transport-Layer Protocols
Internet Transport-Layer Protocols
network
datalink
physical
network
datalink
physical
application
transport
network
datalink
physical
application
transport
network
datalink
physical
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-12 12
Chapter 3 Outline
Chapter 3 Outline
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
Dest. IP address
It means:
Socket =
(dest IP address , dest port number)
source IP address
dest IP address
source IP address
dest IP address
w
a
y
h
a
n
d
s
h
a
k
e
Clientprocess Clientprocess
Serverprocess Serverprocess
ClientIPAddress
&
PortNumber
ServerIPAddress
&
PortNumber2
ServerIPAddress
&
PortNumber1
bytes
Server
(runningonIP
address:C)
Client
(runningonIPaddress:A)
ClientIPAddress
&
PortNumber
+
4tupleidentifier
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-22 22
client
IP:A
server
IP:C
Connection-Oriented Demultiplexing2
Connection-Oriented Demultiplexing2
P1
SP:2549 SP:2549
DP:1324 DP:1324
CtoA
P2
SP:1324 SP:1324
DP:80 DP:80
AtoC
connectionsocket(A,C,1324,2549)
clientsockets(C,A,2549,1324)
SP:1324 SP:1324
DP:2549 DP:2549
A Ato toC C A Ato toC C
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-23 23
Connection-Oriented Demultiplexing3
Connection-Oriented Demultiplexing3
Client
IP:B
P1
client
IP:A
P1
P3
P5
server
IP:C
SP:9157 SP:9157
DP:2053 DP:2053
P6
AtoC
SP:5775 SP:5775
DP:2053 DP:2053
BtoC
SP:1807 SP:1807
DP:2053 DP:2053
AtoC
P4
P2
ServerhostmaysupportmanysimultaneousTCPsockets,witheachsocketattachedtoaprocess.
Eachsocketisidentifiedbyitsown4tuple.
All4fieldsareusedtodirect(demultiplex)thesegmenttotheappropriatesocket.
ServerhostmaysupportmanysimultaneousTCPsockets,witheachsocketattachedtoaprocess.
Eachsocketisidentifiedbyitsown4tuple.
All4fieldsareusedtodirect(demultiplex)thesegmenttotheappropriatesocket.
IncontrastwithUDP,twoarrivingTCPsegmentswithdifferentsourceIPaddressor
sourceportnumberwillbedirectedtotwodifferentsockets.
IncontrastwithUDP,twoarrivingTCPsegmentswithdifferentsourceIPaddressor
sourceportnumberwillbedirectedtotwodifferentsockets.
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-24 24
Connection-Oriented Demultiplexing4
Connection-Oriented Demultiplexing4
Client
IP:B
P1
client
IP:A
P1
P3
P4
server
IP:C
SP:9157 SP:9157
DP:2053 DP:2053
AtoC
SP:5775 SP:5775
DP:2053 DP:2053
BtoC
SP:1807 SP:1807
DP:2053 DP:2053
AtoC
P2
ThreadedServer
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-25 25
Chapter 3 outline
Chapter 3 outline
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
Lost,
connectionless:
no handshaking between
UDP sender, receiver.
no connection
establishment (which can
add delay).
loss tolerant
rate sensitive
DNS
SNMP
application-specific
error recovery!
sourceport#
destport#
32bits
Application
Application
data
data
(message)
(message)
UDPsegmentformat
length checksum
Length,in
bytesofUDP
segment,
including
header
UDP Header
UDP Header
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-28 28
Sender:
compute checksum of
received segment
NO - error detected
compute checksum of
received segment
NO - error detected
Note
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.4 Principles of
reliable data transfer
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
error detection.
error detection.
sender ACKs/NAKs
receivers ACK/NAK? What
if sender ACK/NAK lost?
sender ACKs/NAKs
receivers ACK/NAK? What
if sender ACK/NAK lost?
Timer drawbacks?
New assumption:
underlying channel can
also lose packets (data
or ACKs)
Timer drawbacks?
Approach: sender waits
reasonable amount of
time for ACK
retransmits if no ACK
received in this time
retransmission will be
duplicate, but use of seq.
#s already handles this
retransmits if no ACK
received in this time
retransmission will be
duplicate, but use of seq.
#s already handles this
U
sender
: utilization fraction of time sender busy sending
U
sender
=
0.008ms
15ms+15ms+0.008
ms
=0.00027
L/R
RTT+L/R
=
Performance of Stop & Wait (rdt3.0)
Performance of Stop & Wait (rdt3.0)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-52 52
first packet bit transmitted, t = 0
sender receiver
RTT
last packet bit transmitted, t = L / R
first packet bit arrives
last packet bit arrives, send ACK
ACK arrives, send next
packet, t = RTT + L / R
U
sender
=
0.008
30.008
=
0.00027
L/R
RTT+L/R
=
rdt3.0: stop-and-wait operation
rdt3.0: stop-and-wait operation
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-53 53
Pipelining: sender allows multiple, in-flight, yet-to-
be-acknowledged pkts
ACK(n):ACKsallpktsupto,includingseq#n
timerforeachinflightpkt
timeout(n):retransmitpktnandallhigherseq#pktsinwindow
already
ACKd
sent, not
yet ACKd
usable,
not yet sent
not usable
67891
0
1
1
1
2
1
3
1
4
5 4 3 2 1 1
5
1
6
1
7
1
8
1
9
2
0
2
1
2
2
2
3
2
4
2
5
2
6
2
7
2
8
2
9
3
0
window size
N
A
C
K
6
send_base
nextseqnum
cumulativeACK
Go-Back-N
Go-Back-N
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-56 56
Wait
start_timer
udt_send(sndpkt[base])
udt_send(sndpkt[base+1])
udt_send(sndpkt[nextseqnum-1])
timeout
rdt_send(data)
if (nextseqnum < base+N) {
sndpkt[nextseqnum] =
make_pkt(nextseqnum,data,chksum)
udt_send(sndpkt[nextseqnum])
if (nextseqnum == base+N) start_timer
nextseqnum++
}
else
refuse_data(data)
base = getacknum(rcvpkt)+1
If (base == nextseqnum)
stop_timer
else
start_timer
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
base=1
nextseqnum=1
rdt_rcv(rcvpkt)
&& corrupt(rcvpkt)
base
nextseqnum
base+N
wait
start
1 1
2 2
Ifatimeoutoccurs,thesenderresends Ifatimeoutoccurs,thesenderresendsall allpacketsthat packetsthat
havebeenpreviouslysentbutthathavenotyetbeen havebeenpreviouslysentbutthathavenotyetbeen
acknowledged. acknowledged.
IfanACKisreceivedbutthere IfanACKisreceivedbutthere
arestilladditionaltransmitted arestilladditionaltransmitted
butyettobeacknowledged butyettobeacknowledged
packets,thetimerisrestarted packets,thetimerisrestarted
Timercanbethoughtofasa Timercanbethoughtofasa
timerfortheoldest timerfortheoldest
transmittedbutnotyet transmittedbutnotyet
acknowledgedpacket. acknowledgedpacket.
GBN: Sender extended FSM
GBN: Sender extended FSM
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-57 57
ACK-only: always send ACK for correctly-received pkt
with highest in-order seq #
out-of-order pkt:
sender window
N consecutive seq #s
sendACK(n)
outoforder:buffer
inorder:deliver(alsodeliver
buffered,inorderpkts),
advancewindowtonextnot
yetreceivedpkt
pktnin[rcvbaseN,rcvbase1]
ACK(n)
otherwise:
ignore
receiver
Selective repeat
Selective repeat
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-62 62
Selective repeat in action
Selective repeat in action
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-63 63
Example:
seq #s: 0, 1, 2, 3
window size=3
receiver sees no
difference in two
scenarios!
incorrectly passes
duplicate data as new
in (a)
Q: what relationship
between seq # size and
window size?
Selective repeat: dilemma
Selective repeat: dilemma
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-64 64
Chapter 3 outline
Chapter 3 outline
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-
oriented transport:
TCP
segment structure
flow control
connection management
connection-oriented:
flow controlled:
point-to-point:
Reliable:
guaranteed arrival
no error
in order delivery
no message boundaries
pipelined:
Cumulative ACKs,
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
byte stream
number of first
byte in segments
data
ACKs:
cumulative ACK
Q: how receiver handles
out-of-order segments
S
e
q
=
7
9
, A
c
k
=
4
3
, d
a
ta
=
C
S
e
q
=
4
3
, A
c
k
=
8
0
User
types
C
hostACKs
receipt
ofechoed
C
hostACKs
receiptof
C,echoes
backC
time
simpletelnetscenario
simpletelnetscenario
TCP seq#s and Ack#s
TCP seq#s and Ack#s
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-72 72
Q: how to set TCP
timeout value?
unnecessary
retransmissions
unnecessary
retransmissions
ignore retransmissions
ignore retransmissions
Chebyshevs Theorem:
In TCP:
RetransmotionTimeOut =AverageRTT+
4*DevRTT
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-74 74
Request for Comments: 2988, Nov 2000
Request for Comments: 2988, Nov 2000
RTO 3 secs.
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
Pipelined segments
Cumulative acks
Pipelined segments
Cumulative acks
Retransmissions are
triggered by:
timeout events
duplicate acks
Initially consider
simplified TCP sender:
Retransmissions are
triggered by:
timeout events
duplicate acks
Initially consider
simplified TCP sender:
seq # is byte-stream
number of first data
byte in segment
expiration interval:
RTO
[TimeOutInterval]
data rcvd from app:
seq # is byte-stream
number of first data
byte in segment
expiration interval:
RTO
[TimeOutInterval]
timeout:
retransmit segment
that caused timeout
restart timer
Ack rcvd:
If acknowledges
previously unacked
segments
retransmit segment
that caused timeout
restart timer
Ack rcvd:
If acknowledges
previously unacked
segments
R
T
O
)
S
e
q
=
5
0
0
1
T<500ms
A
C
K
=
4
0
0
1
SendBase=4001
Win2
W
i
n
2
TCP retransmission (Normal ACK)*
TCP retransmission (Normal ACK)*
SendBase=1
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-84 84
S
e
q
=
1
, 1
0
0
0
b
y
te
s
d
a
ta
A
C
K
=
2
0
0
0
HostB
time
HostA
S
e
q
=
1
0
0
1
S
e
q
=
2
0
0
1
S
e
q
=
3
0
0
1
T<500ms
T<500ms
Win1
S
e
q
=
1
(
R
T
O
)
T<500ms
A
C
K
=
4
0
0
1
SendBase=1
Win1
W
i
n
2
S
e
q
=
1
S
e
q
=
1
0
0
1
S
e
q
=
2
0
0
1
S
e
q
=
1
(
R
T
O
) SendBase=4001
W
i
n
3
SendBase=1
TCP retransmission (Lost ACK)*
TCP retransmission (Lost ACK)*
Win3
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-85 85
S
e
q
=
1
, 1
0
0
0
b
y
te
s
d
a
ta
A
C
K
=
2
0
0
1
W
i
n
2
HostB
HostA
S
e
q
=
1
0
0
1
S
e
q
=
2
0
0
1
S
e
q
=
3
0
0
1
T<500ms
T<500ms
Win1
S
e
q
=
1
(
R
T
O
)
T<500ms
A
C
K
=
4
0
0
1
SendBase=1
Win3
S
e
q
=
1
S
e
q
=
1
0
0
1
S
e
q
=
4
0
0
1
S
e
q
=
5
0
0
1
SendBase=4001
W
i
n
3
Win1
time
TCP retransmission (Premature ACK)*
TCP retransmission (Premature ACK)*
T<500ms
A
C
K
=
4
0
0
1
SendBase=1
Win3
S
e
q
=
1
S
e
q
=
1
0
0
1
S
e
q
=
4
0
0
1
S
e
q
=
5
0
0
1
Win1
T<500ms
Win3
S
e
q
=
1
S
e
q
=
4
0
0
1
Win1
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-86 86
Senderkeeps
transmission
basedon
Win&SendBase
T<500ms
Ack=5001
Ack=3001
2Acks=8001
Seq=3001
Seq=4001
Win
Alldatauptoseq=3001
areACKed.
Time
Seq=8001isexpected
Seq=9001
2Acks=8001
Acks=9001
Receivedsegmentstartsat
lowerendofthegap.
ImmediatesendACK,
gapisdetected
gapisdetected
Seq=12001
HostA
HostB
Alldatauptoseq=5001
areACKed.
Seq=2001
Win
TCP ACK Generation (Illustrated)*
TCP ACK Generation (Illustrated)*
Seq=8001
Seq=8001
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-87 87
Duplicate ACKs
Duplicate ACKs
If segment is lost,
there will likely be many
duplicate ACKs.
If sender receives 3
ACKs for the same
data, it supposes that
segment after ACKed
data was lost:
(
R
T
O
)
Resendsegment
before
timerexpires.
time
Fast Retransmit (Illustrated)
Fast Retransmit (Illustrated)
3
A
C
K
s
=
1
0
0
1
A
C
K
s
=
1
0
0
1
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-90 90
event: ACK received, with ACK field value of y
if (y > SendBase) {
SendBase = y
if (there are currently not-yet-acknowledged segments)
start timer
}
else {
increment count of dup ACKs received for y
if (count of ACKs received for y is 3) {
resend segment with sequence number y
}
aduplicateACKfor
alreadyACKedsegment
fastretransmit
Fast retransmit algorithm:
Fast retransmit algorithm:
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-91 91
Chapter 3 outline
Chapter 3 outline
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
speed-matching
service: matching the
send rate to the
receiving apps drain
rate.
guarantees receive
buffer doesnt overflow
RcvWindow = RcvBuffer - [LastByteRcvd
LastByteRead]
TCP Flow Control: how it works
TCP Flow Control: how it works
TCP
data
inbuffer
spare
buffer
datafromIP
R
c
v
W
i
n
d
o
w
datatoappproc.
R
c
v
B
u
f
f
e
r
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-94 94
Chapter 3 outline
Chapter 3 outline
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
seq. #s
no data
Step 2: server host receives
SYN, replies with SYNACK
segment
w
a
i
t
3
0
,
6
0
o
r
1
2
0
s
e
c
.
F
I
N
=
1
m
e
a
n
s
:
n
o
m
o
r
e
d
a
t
a
f
r
o
m
s
e
n
d
e
r
F
IN
=
1
time
TCP Connection Management (cont.)
TCP Connection Management (cont.)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-98 98
Final ACK loss
Final ACK loss
w
a
i
t
3
0
,
6
0
o
r
1
2
0
s
e
c
.
F
IN
=
1
time
F
IN
=
1
A
C
K
=
1
A
C
K
=
1
Thetimeisimplementationdependent.
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-99 99
Step 2: server receives FIN, replies
with ACK. Closes connection, sends FIN.
Step 3: client receives FIN, replies with ACK.
c
l
o
s
e
)
(
A
c
t
i
v
e
c
l
o
s
e
)
(start)
(backtostart)
Timeout/-
EVENT/ACTION EVENT/ACTION EVENT/ACTION EVENT/ACTION
Open/-
Normalpathforaclient Normalpathforaclient
Normalpathforaserver Normalpathforaserver
Unusualevent Unusualevent
(Step1ofthe3wayhandshake)
RST/-
SYN/SYN + ACK
(Step2ofthe3wayhandshake)
(Step3ofthe3wayhandshake)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-102 102
CLOSED
LISTEN
SYN_RCVD
ESTABLISHED
CLOSING
TIME_WAIT
SYN_SENT
FIN_WAIT_1
CLOSE_WAIT
LAST_ACK
FIN_WAIT_2
a
c
t
i
v
e
o
p
e
n
,
c
r
e
a
t
e
T
C
B
s
e
n
d
S
Y
N
passive open,
create TCB
s
e
n
d
S
Y
N
r
e
c
e
i
v
e
S
Y
N
,
s
e
n
d
S
Y
N
,
A
C
K
r
e
c
e
i
v
e
R
S
T
r
e
c
e
i
v
e
A
C
K receive SYN, ACK,
send ACK applic.
close,
send
FIN
a
p
p
l
i
c
.
c
l
o
s
e
,
s
e
n
d
F
I
N
r
e
c
e
i
v
e
F
I
N
,
s
e
n
d
A
C
K
receive FIN
send ACK
r
e
c
e
i
v
e
F
I
N
,
A
C
K
s
e
n
d
A
C
K
receive
ACK
receive FIN
send ACK
receive
ACK
applic. close
send FIN
receive
ACK
applic. close
or timeout,
delete TCB
2MSL timeout
delete TCB
receive SYN,
send ACK
applic.
close
TCP State
diagram
Thereareseveralthingsthatmustbe
rememberedaboutaconnection.To
storethisinformationweimaginethat
thereisadatastructurecalleda
TransmissionControlBlock(TCB).
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-103 103
Chapter 3 outline
Chapter 3 outline
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
3.6 Principles of
congestion control
Congestion: too many sources sending too much data too fast
for network to handle and competing for bottleneck
bandwidth
Right of cliff:
Congestion collapse
Offered
Load
T
h
r
o
u
g
h
p
u
t
knee cliff
congestion
collapse
packet
loss
Congestion Control vs. Congestion Avoidance
Congestion Control vs. Congestion Avoidance
Congestion Control vs. Congestion Avoidance
Congestion Control vs. Congestion Avoidance
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-107 107
Congestion Collapse
Congestion Collapse
Undelivered packets
Fragments
Control traffic
ApplicationsinAandBsendingintoconnectionatan
averagerateof
in
bytes/sec.
Original"data:sentintothesocketonlyonce.
Simpletransportprotocol:noerrorrecovery
(retransmission),flowcontrol,orcongestioncontrol.
Causes/Costs of Congestion: scenario 1
Causes/Costs of Congestion: scenario 1
unlimitedshared
outputlinkbuffers
HostA
in
:originaldata
rate[B/s]
HostB
out
Sharedlink
R[B/s]
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-109 109
Causes/Costs of Congestion: scenario 1(cont)
Causes/Costs of Congestion: scenario 1(cont)
(a)Perconnectionthroughput.
[Byte/s]
[Byte/s]
o
u
t
(
t
h
r
o
u
g
h
p
u
t
)
in
(offeredload)
R/2
R/2
(b)Perconnectiondelay.
[Byte/s]
[Byte/s]
D
e
l
a
y
(
m
s
)
in
(offeredload)
R/2
out
=
in
out
=R/2
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-110 110
in
[Bytes/sec] = rate at which the application sends
original data into the socket.
in
[Bytes/sec] = offered load to the network
(containing original data or retransmitted data).
Scenario 2: (cont)
Scenario 2: (cont)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-112 112
[Byte/s]
[Byte/s]
in
(offeredload)
R/2
o
u
t
(
t
h
r
o
u
g
h
p
u
t
)
R/2
R/3
R/4
Example:At
in
=R/2>
out
=R/3
in
=R/2=0.333RBytes/sec(onaverage)originaldata+
0.167RBytes/sec(onaverage)retransmitteddata.
Costofacongestednetwork:thesendermustperformretransmissionsin
ordertocompensatefordropped(lost)packetsduetobufferoverflow.
Scenario 2: Scenario 2: retransmission due to lost packet retransmission due to lost packet ( (perfect retransmission) perfect retransmission)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-113 113
retransmissionduetodelayed(notlost)packet.Each
packetisassumedtobeforwarded(onaverage)twiceby
therouter.
Scenario 2:
Scenario 2:
retransmission due to delayed (not lost) packet
retransmission due to delayed (not lost) packet
o
u
t
(
t
h
r
o
u
g
h
p
u
t
)
in
(offeredload)
R/2
R/2
R/3
R/4
[Byte/s]
[Byte/s]
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-114 114
A-C:R1,R2;
C-A:R3,R4;
D-B:R3,R2;
B-D:R1,R4
..
finitesharedoutputlink
buffers
HostA
in
: original data
HostD
out
'
in
: original data, plus
retransmitted data
R4
R1
R2
R3
HostB
HostC
Causes/Costs of Congestion: scenario 3
Causes/Costs of Congestion: scenario 3
Suppose:
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-116 116
Extremely small
in
: buffer overflows are rare, and
out
=
in
Larger
in
: , the overflows are still rare. Thus, an
increase in
in
results in an increase in
out
.
Causes/Costs of Congestion: scenario 3(Cont)
Causes/Costs of Congestion: scenario 3(Cont)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-117 117
Causes/Costs of Congestion: scenario 3(Cont)
Causes/Costs of Congestion: scenario 3(Cont)
Extremely large
in
(and hence
in
): A-C traffic arriving to
R2 is at most R.
If
in
is extremely large for all connections, then the arrival
rate of B-D traffic at R2 can be much larger than that of the
A-C traffic.
Whenpacketdropped(inR2),anyupstream(R1)transmission
capacityusedforthatpacketwaswasted!
Astheofferedloadapproachesinfinity,thethroughputgoesto
zero.
Whenpacketdropped(inR2),anyupstream(R1)transmission
capacityusedforthatpacketwaswasted!
Astheofferedloadapproachesinfinity,thethroughputgoesto
zero.
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-118 118
[Byte/s]
[Byte/s]
o
u
t
(
t
h
r
o
u
g
h
p
u
t
)
in
(offeredload)
R/2
R/2
Scenario 3 (cont)
Scenario 3 (cont)
ACandBDtrafficcompeteatrouterR2forthebuffer,AC
trafficthatsuccessfullygetsthroughR2becomessmallerand
smallerastheofferedloadfromBDgetslargerandlarger.
Host A
out
Host B
R1
R2
R4
Host C
Host D
CongestiveCollapse:althoughthe
networklinksarebeingheavily
utilized,verylittleusefulworkis
beingdone.
CongestiveCollapse:althoughthe
networklinksarebeingheavily
utilized,verylittleusefulworkis
beingdone.
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-119 119
end-to-end congestion
control:
no explicit feedback
from network
congestion inferred
from end-system
observed loss, delay
no explicit feedback
from network
congestion inferred
from end-system
observed loss, delay
P
a
c
k
e
t
d
e
l
a
y
offeredload
Typicalbehaviorofqueueing
systems:
Power
Load
Asimplemetricofhowwellthe
networkisperforming:
Load
Power
Delay
optimal
load
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-122 122
Congestion Avoidance
Congestion Avoidance
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
TCP Tahoe
TCP Reno
TCP SACK
TCP Vegas
TransactionTCP
(T/TCP)
rfc1644
TransactionTCP
(T/TCP)
rfc1644
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-126 126
T/TCP
T/TCP
then ACK+FIN
Limitations
CongWin is dynamic,
function of perceived
network congestion
manifestations:
lost packets
(buffer overflow at
routers)
CongWin is dynamic,
function of perceived
network congestion
manifestations:
lost packets
(buffer overflow at
routers)
slow start
AIMD
conservative after
timeout events
How does sender
perceive congestion?
slow start
AIMD
conservative after
timeout events
TCP Congestion Control
TCP Congestion Control
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-128 128
0
2
4
6
8
10
12
14
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Number of Transmission
C
o
n
g
e
s
t
i
o
n
W
i
n
d
o
w
S
i
z
e
[
M
S
S
]
TCP Reno (RFC 2581)
threshold
TCP Tahoe
threshold
Congestion Window Size:
New CongWin =1
New threshold=12/2
New CongWin =1
New threshold=12/2
New CongWin=12/2
New CongWin =1
New threshold=12/2
New CongWin =1
New threshold=12/2
New CongWin=12/2
a
v
o
i
d
a
n
c
e
C
o
n
g
e
s
t
i
o
n
a
v
o
i
d
a
n
c
e
TCP Congestion Control and Slow Start
TCP Congestion Control and Slow Start
3ACKs 3ACKs
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-129 129
Slow Start
Slow Start
halved
Timeouts
Exponentialslowstart
t
Rate
Whyisitcalledslowstart?BecauseTCPoriginallyhad
nocongestioncontrolmechanism.Thesourcewouldjust
startbysendingawholewindowsworthofdata.
Slowstartinoperationuntil
itreacheshalfofprevious
cwnd.
Nick McKeown
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-130 130
cwnd
W
W+1
RTT
TCP Congestion Control - 2
TCP Congestion Control - 2
limitationofnetwork
optimal(average)
windowsize
Example:
MSS = 500B(4000b)
RTT = 200 msec
Additiveincrease,resultingin
increaseofCongWinby1MSS
everyRTT
Lossevent
detectedby
tripleduplicate
ACK
SSorCA Threshold=CongWin/2,
CongWin=Threshold,
SetstatetoCongestionAvoidance
Fastrecovery,implementing
multiplicativedecrease.
CongWinwillnotdropbelow1
MSS.
Timeout SSorCA Threshold=CongWin/2,
CongWin=1MSS,
SetstatetoSlowStart
Enterslowstart
DuplicateACK SSorCA IncrementduplicateACKcountfor
segmentbeingacked
CongWinandThresholdnot
changed
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-141 141
TCP throughput
TCP throughput
For:
1Gbps throughput,
RTT=100ms and
MSS=1500 Byte
e = 2.1410
-8
Timeout.
Losses in burst,
Small window.
Oscillations.
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-144 144
Performance Evaluation of Vegas
Performance Evaluation of Vegas
Reno Vegas1,3 Vegas2,4
Throughput(Kb/s) 53.00 72.50 75.30
ThroughputRatio 1.00 1.37 1.42
Retransmission(KB) 47.80 24.50 29.30
RetransmissionRatio 1.00 0.51 0.61
CoarseTimeouts 3.30 0.80 0.90
1MByteTransferOvertheInternet
1024KB 512KB 128KB
Reno Vegas Reno Vegas Reno Vegas
Throughput(KB/s) 53.00 72.50 52.00 72.00 31.10 53.10
ThroughputRatio 1.00 1.37 1.00 1.38 1.00 1.71
Retransmission(KB) 47.80 24.50 27.90 10.50 22.90 4.00
RetransmissionRatio 1.00 0.51 1.00 0.38 1.00 0.17
CoarseTimeouts 3.30 0.80 1.70 0.20 1.10 0.20
EffectofTransferSizeOvertheInternet
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-145 145
New Retransmission Mechanism: Vegas
New Retransmission Mechanism: Vegas
R
T
T
O
n
e
R
T
T
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-146 146
Chapter 3 outline
Chapter 3 outline
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
3.6Principlesofcongestion
control
3.7TCPcongestioncontrol
3.8MultimediaStream&
TCP
3.9TCPfairness
3.10TCPmodeling
3.11httpmodeling
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-147 147
Multimedia Stream & TCP
Multimedia Stream & TCP
Should also be able to hold its own, i.e. grab its fair share, or
it will never become popular.
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-149 149
TCP Friendly Rate Control (TFRC)
TCP Friendly Rate Control (TFRC)
TCP
TCP
nonTCP
nonTCP
Internet
Internet
) 32 1 (
8
3
3
3
2
2
) ( e e
be
RTO
be
RTT
MSS
B
+ +
Byte/sec Byte/sec
NonTCPapplicationsmimicAIMDbehavior,possiblywithlonger
timescales
TheysendwithrateB(TCPthroughputequationTCPReno):
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
3.6Principlesofcongestion
control
3.7TCPcongestioncontrol
3.8MultimediaStream&TCP
3.9TCPfairness
3.10TCPmodeling
3.11httpmodeling
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-153 153
TCP Fairness
TCP Fairness
t
h
r
o
u
g
h
p
u
t
congestionavoidance:additiveincrease
loss:decreasewindowbyfactorof2
congestionavoidance:additiveincrease
loss:decreasewindowbyfactorof2
F
u
l
l
b
a
n
d
w
i
d
t
h
u
t
i
l
i
z
a
t
i
o
n
l
i
n
e
A
Why is TCP fair?
Why is TCP fair?
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-155 155
Fairness and UDP
pump audio/video at
constant rate, tolerate
packet loss
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
3.6Principlesofcongestion
control
3.7TCPcongestioncontrol
3.8MultimediaStream&TCP
3.9TCPfairness
3.10TCPmodeling
3.11httpmodeling
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-157 157
Q: How long does it take to
receive an object from a
Web server after sending
a request?
Ignoring congestion, delay is
influenced by:
slow start
Q: How long does it take to
receive an object from a
Web server after sending
a request?
Ignoring congestion, delay is
influenced by:
slow start
Notation, assumptions:
+ + +
} 1 , { min
K Q
P
TCP Delay Modeling: Slow Start
TCP Delay Modeling: Slow Start
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-161 161
Example:
O/S=15
segments
K=4windows
Q=2
P=min{K1,Q}=
2
ServeridlesP=2
times
Delaycomponents:
2RTTfor
connectionestaband
request
O/Rtotransmit
object
timeserveridles
duetoslowstart
Serveridles:
P=min{K1,Q}
times
1
2
3
4
15
RTT-S/R
Server idle 1
Server idle 2
k=1
k=2
k=3
k=4
RTT
initiate TCP
connection
request
object
first window
= S/R
second window
= 2S/R
third window
= 4S/R
fourth window
= 8S/R
complete
transmission
object
delivered
time at
client
time at
server
TCP Delay Modeling: Slow Start (cont)
TCP Delay Modeling: Slow Start (cont)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-162 162
R
S
R
S
RTT P RTT
R
O
R
S
RTT
R
S
RTT
R
O
idleTime RTT
R
O
delay
P
k
P
k
P
p
p
) 1 2 ( ] [ 2
] 2 [ 2
2
1
1
1
+ + +
+ + +
+ +
+
RTT
R
S Thetimefromwhenserverbeginstotransmitthe1
st
segment
untilthetimewhentheserverreceivesanacknowledgmentthesegment.
2
1
R
S k
=totaltransmissiontimefork
th
window
[x]
+
=max(x,0)
2
1
R
S
RTT
R
S
k
1
]
1
+
+
=idletimeafterk
th
window
TCP Delay Modeling: Slow Start (cont)
TCP Delay Modeling: Slow Start (cont)
Serverstartstosendk
th
window
+
RTT
R
S
Serverreceives1
st
ack
1
st
segmentissend
R
S
m
st
segmentissend
2
1
R
S k
k
th
windowincludingmsegments k
th
windowincludingmsegments
m=2
k
1
m=2
k
1
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-163 163
RecallK=numberofwindowsthatcoverobject
HowKiscalculated?
1
1
1
+
+
+ + +
+ + +
) 1 ( log
)} 1 ( log : { min
} 1 2 : { min
} / 2 2 2 : { min
} 2 2 2 : { min
2
2
1 1 0
1 1 0
S
O
S
O
k k
S
O
k
S O k
O S S S k K
k
k
k
,
_
'
,
_
'
'
R
S
RTT
R
S
RTT
k k
R
S
RTT
k
R
S
RTT
R
S
k Q
k
k
Serverstartstosendk
st
window
+
RTT
R
S
Serverreceives1
st
ack
1
st
segmentissend
R
S
m
st
segmentissend
2
1
R
S k
2
1
R
S
RTT
R
S k
1
]
1
+
+
=idletimeafterk
th
window
TCP Delay Modeling: Slow Start (cont)
TCP Delay Modeling: Slow Start (cont)
k
th
windowincludingmsegments k
th
windowincludingmsegments
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-165 165
28kbps 28.6sec 1 28.8sec 28.9sec
100kbps 8sec 2 8.2sec 8.4sec
1Mbps 800msec 5 1sec 1.5sec
10Mbps 80msec 7 0.28sec 0.98sec
RO/RPFixedWindowSlowStart
Assumptions: S=536B
RTT=100msec
O=100kB
K=8
Examples(1)
Examples(1)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-166 166
28kbps 1.43sec 1 1.63sec 1.73sec
100kbps 0.4sec 2 0.6sec 0.76sec
1Mbps 40ms 3 0.24sec 0.52sec
10Mbps 4ms 3 0.2sec 0.5sec
RO/RPFixedWindowSlowStart
Assumptions: S=536B
RTT=100msec
O=5kB
K=4
Examples(2)
Examples(2)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-167 167
28kbps 1.43sec 3 3.4sec 5.8sec
100kbps 0.4sec 3 2.4sec 5.2sec
1Mbps 40ms 3 2.0sec 5.0sec
10Mbps 4ms 3 2.0sec 5.0sec
RO/RPFixedWindowSlowStart
Assumptions: S=536B
RTT=1000msec
O=5kB
K=4
Examples(3)
Examples(3)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-168 168
0
5
10
15
20
25
30
F1 S1 F2 S2 F3 S3
sec
0
1
2
3
4
5
F1 S1 F2 S2 F3 S3
sec
28kbps
100kbps
1Mbps
10Mbps
S=536B
RTT=
100msec
O=100kB
K=8 K=8
1 1
S=536B
RTT=100msec
O=5kB
K=4 K=4
2 2
S=536B
RTT=1000msec
O=5kB
K=4 K=4
3 3
F: Fixed Window S: Slow Start F: Fixed Window S: Slow Start
Delay: Examples(1,2,3)
Delay: Examples(1,2,3)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-169 169
TCP Send Rate (Throughput)1
TCP Send Rate (Throughput)1
where W
max
is the maximum window allowed by receiver and sender
(typically 8KB, 16KB, or 32KB),
where W
max
is the maximum window allowed by receiver and sender
(typically 8KB, 16KB, or 32KB),
[segments/sec]
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-172 172
Approximations
Approximations
+
+ +
+ +
1
22 . 1
)
1
(
2
3 1
) (
: 0.05 e For
) 32 1 (
8
3
3
3
2
1
) (
: W large and 0.148 e For
)
) 32 1 (
8
3
3 , 1 min
3
2
1
, min( ) (
2
max
2
max
) (
b
e RTT e
o
be RTT
e B
e e
be
RTO
be
RTT
e B
e e
be
RTO
be
RTT
RTT
W
e B
Thenotationf=o(g)meansthat(g>0and)(f/g)>0.Thenotationo(g)
indicatesthatthetermisofsmallerorderofmagnitudethang.
Thenotationf=o(g)meansthat(g>0and)(f/g)>0.Thenotationo(g)
indicatesthatthetermisofsmallerorderofmagnitudethang.
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-173 173
Total Time To Transfer
Total Time To Transfer
In which
+
) (e B MSS Throughput R
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-174 174
Comparison of network throughput and TCP
Comparison of network throughput and TCP
throughput (send rate)
throughput (send rate)
10000
1000
100
10
1
0.01
0.001 0.1 1
LossRate
s
e
g
m
e
n
t
s
/
1
0
0
S
e
c
s
NetworkThroughput
TCPThroughput(SendRate)
RTT=0.470
RTO=3.2,W
max
=12
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-175 175
Chapter 3 outline
Chapter 3 outline
3. Introduction
3.1 Transport-layer
services
3.3 Connectionless
transport: UDP
3.5 Connection-oriented
transport: TCP
segment structure
flow control
connection management
3.6Principlesofcongestion
control
3.7TCPcongestioncontrol
3.8MultimediaStream&TCP
3.9TCPfairness
3.10TCPmodeling
3.11httpmodeling
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-176 176
Non-persistent HTTP issues:
default in HTTP/1.1
subsequent HTTP
requests/responses between
same client/server are sent
over connection.
Persistent with pipelining:
default in HTTP/1.1
subsequent HTTP
requests/responses between
same client/server are sent
over connection.
HTTP Modeling
HTTP Modeling
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-177 177
Non-persistent HTTP:
.
HTTP Modeling
HTTP Modeling
) (
) 1 ( 2 ) 1 (
e B MSS
O
M RTT M delay
+ + +
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-178 178
.
HTTP Modeling-Persistent
HTTP Modeling-Persistent
) (
) 1 ( 3
e B MSS
O
M RTT delay
+ +
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-179 179
.
HTTP Modeling-Nonpersistent
HTTP Modeling-Nonpersistent
) (
) 1 ( 2 ) 1 (
e B MSS
O
M RTT
X
M
delay
+ + +
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-180 180
Summary
Summary
+ + +
) (
) 1 ( 3
e B MSS
O
M RTT delay
+ +
) (
) 1 ( 2 ) 1 (
e B MSS
O
M RTT
X
M
delay
+ + +
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-181 181
RTT=100msec,O=5Kbytes,M=10andX=5,
FixedcongestionWindow.
Forlowbandwidth,connection&responsetimedominatedby
transmissiontime.
Persistentconnectionsonlygiveminorimprovementoverparallel
connections.
0
2
4
6
8
10
12
14
16
18
20
28
Kbps
100
Kbps
1
Mbps
10
Mbps
non-persistent
Persistent-
pipeline
parallel non-
persistent
Example-HTTP Response time (in seconds)
Example-HTTP Response time (in seconds)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-182 182
ForlargerRTT,responsetimedominatedbyTCPestablishment&
slowstartdelays.
Persistentconnectionsnowgiveimportantimprovement:
particularlyinhighdelaybandwidthnetworks.
RTT=1000sec,O=5Kbytes,M=10andX=5,
FixedcongestionWindow.
0
10
20
30
40
50
60
70
28
Kbps
100
Kbps
1
Mbps
10
Mbps
non-persistent
Persistent-
pipeline
parallel non-
persistent
HTTP Response time (in seconds)
HTTP Response time (in seconds)
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-183 183
multiplexing,
demultiplexing
flow control
congestion control
instantiation and
implementation in the
Internet
UDP
TCP
Next:
Wireless links, which often have high bit error rates, can
reek havoc when carrying TCP traffic. This page points to
the numerous research papers that have tried to address
the problems.
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-188 188
TCP REFERENCES:
[Ahn 1995] J. S. Ahn, P. B. Danzig, Z. Liu, and Y. Yan, "Experience with TCP
Vegas: Emulation and Experiment", Proceedings of ACM SIGCOMM '95
(Boston, MA, Aug. 1995), pp. 185-195.
http://www.acm.org/sigcomm/sigcomm95/papers/ahn.html
Computer Networking 3edition .
1-7-19-20-21-34-36-39
jamali@iust.ac.ir
. , Subject: HW3 Student ID Number
2 .
power point .
Computer Networking 3edition .
1-7-19-20-21-34-36-39
jamali@iust.ac.ir
. , Subject: HW3 Student ID Number
2 .
power point .
Home Work3
Home Work3
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-198 198
Control System Model [CJ89]
Control System Model [CJ89]
x
i
>X
goal
y
D.ChiuandR.Jain,Analysisoftheincreaseanddecreasealgorithmsforcongestion
avoidanceincomputernetworks,ComputerNetworksandISDNSystems,Volume
17, Issue1 (June1989),Pages:114.
DMChiuAndRJain,"AnalysisofIncreaseandDecreaseAlgorithms,PartIIIofCongestion
AvoidanceinComputerNetworkswithaConnectionlessNetworkLayer",DECTechnical
Report509,August1987.
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-199 199
Possible Choices
Possible Choices
a
I
=0, b
I
>1, a
D
<0, b
D
=1
a
I
>0, b
I
=1, a
D
<0, b
D
=1
a
I
=0, b
I
>1, a
D
=0, 0<b
D
<1
a
I
>0, b
I
=1, a
D
=0, 0<b
D
<1
Which one?
'
+
+
+
decrease t x b a
increase t x b a
t x
i D D
i I I
i
) (
) (
) 1 (
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-200 200
Multiplicative Increase,
Multiplicative Increase,
Additive Decrease
Additive Decrease
User 1: x
1
U
s
e
r
2
:
x
2
fairness
line
efficiency
line
(x
1h
,x
2h
)
(x
1h
+a
D
,x
2h
+a
D
)
(b
I
(x
1h
+a
D
),
b
I
(x
2h
+a
D
))
Fixed point
at
Fixed point
is unstable!
I
D I
h h
b
a b
x x
1
2 1
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-201 201
Additive Increase,
Additive Increase,
Additive Decrease
Additive Decrease
User 1: x
1
U
s
e
r
2
:
x
2
fairness
line
efficiency
line
(x
1h
,x
2h
)
(x
1h
+a
D
,x
2h
+a
D
)
(x
1h
+a
D
+a
I
),
x
2h
+a
D
+a
I
))
Reaches
stable
cycle, but
does not
converge to
fairness
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-202 202
Multiplicative Increase,
Multiplicative Increase,
Multiplicative Decrease
Multiplicative Decrease
User 1: x
1
U
s
e
r
2
:
x
2
fairness
line
efficiency
line
(x
1h
,x
2h
)
(b
d
x
1h
,b
d
x
2h
)
(b
I
b
D
x
1h
,
b
I
b
D
x
2h
)
Converges
to stable
cycle, but
is not fair
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-203 203
(b
D
x
1h
+a
I
,
b
D
x
2h
+a
I
)
Additive Increase,
Additive Increase,
Multiplicative Decrease
Multiplicative Decrease
User 1: x
1
U
s
e
r
2
:
x
2
fairness
line
efficiency
line
(x
1h
,x
2h
)
(b
D
x
1h
,b
D
x
2h
)
Converges
to stable
and fair
cycle
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-204 204
Modeling
Modeling
Set cwnd =1
The congestion
window size
grows very
rapidly
Assume that
ssthresh = 8
c w n d = 1
c w n d = 2
c w n d = 4
c w n d = 8
c w n d = 9
c w n d = 1 0
0
2
4
6
8
10
12
14
t
=
0
t
=
2
t
=
4
t
=
6
Roundtrip times
C
w
n
d
(
i
n
s
e
g
m
e
n
t
s
)
ssthresh
3- 3-211 211
Putting Everything Together:
Putting Everything Together:
TCP Pseudocode
TCP Pseudocode
Initially:
cwnd = 1;
ssthresh = infinite;
New ack received:
if (cwnd < ssthresh)
/* Slow Start*/
cwnd = cwnd + 1;
else
/* Congestion Avoidance */
cwnd = cwnd + 1/cwnd;
Timeout:
/* Multiplicative decrease */
ssthresh = cwnd/2;
cwnd = 1;
while (next < unack + win)
transmit next packet;
where win = min(cwnd,
flow_win);
unack next
win
seq #
3- 3-212 212
The big picture
The big picture
Time
cwnd
Timeout
Slow Start
Congestion
Avoidance
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-213 213
Fast Retransmit
Fast Retransmit
Resend a segment
after 3 duplicate
ACKs
ACK 2
segment 1
cwnd = 1
cwnd = 2 segment 2
segment 3
ACK 4
cwnd = 4
segment 4
segment 5
segment 6
segment 7
ACK 3
3 duplicate
ACKs
ACK 4
ACK 4
ACK 4
Jamali@iust.ac.ir Jamali@iust.ac.ir ITransport Layer ITransport Layer
3- 3-214 214
Fast Recovery
Fast Recovery
NO! Ack-compression
NO!
Fairness:
High speeds:
Short flows:
TCP-friendly or TCP-compatible