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

TCP-UDP

Chapter 3 of the document focuses on the transport layer of computer networking, detailing its services, protocols, and principles, including multiplexing, demultiplexing, and reliable data transfer. It discusses two primary transport protocols: UDP, which is connectionless and provides no guarantees, and TCP, which is connection-oriented and ensures reliable data delivery. The chapter also outlines the mechanisms for error detection and flow control in reliable data transfer protocols.

Uploaded by

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

TCP-UDP

Chapter 3 of the document focuses on the transport layer of computer networking, detailing its services, protocols, and principles, including multiplexing, demultiplexing, and reliable data transfer. It discusses two primary transport protocols: UDP, which is connectionless and provides no guarantees, and TCP, which is connection-oriented and ensures reliable data delivery. The chapter also outlines the mechanisms for error detection and flow control in reliable data transfer protocols.

Uploaded by

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

Chapter 3

Transport Layer

A note on the use of these ppt slides:


We’re making these slides freely available to all (faculty, students, readers).
They’re in PowerPoint form so you 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 Computer Networking: A Top
following:
● If you use these slides (e.g., in a class) in substantially unaltered form, that
Down Approach
you mention their source (after all, we’d like people to use our book!) 5th edition.
● If you post any slides in substantially unaltered form on a www site, that
you note that they are adapted from (or perhaps identical to) our slides, and
Jim Kurose, Keith Ross
note our copyright of this material. Addison-Wesley, April 2009.
Thanks and enjoy! JFK/KWR

All material copyright 1996-2009


J.F Kurose and K.W. Ross, All Rights Reserved Transport Layer 3-0
Chapter 3: Transport Layer
Our goals:
r understand principles r learn about transport layer
behind transport layer protocols in the Internet:
services: m UDP: connectionless transport
m multiplexing/demultiplex m TCP: connection-oriented
ing transport
m reliable data transfer m TCP congestion control
m flow control
m congestion control

Transport Layer 3-0


Chapter 3 outline
r 3.1 Transport-layer r 3.5 Connection-oriented
services transport: TCP
r 3.2 Multiplexing and m segment structure
m reliable data transfer
demultiplexing m flow control
r 3.3 Connectionless m connection management
transport: UDP r 3.6 Principles of congestion
r 3.4 Principles of reliable control
data transfer r 3.7 TCP congestion control

Transport Layer 3-0


Transport services and protocols
application
transport
r provide logical communication network
data link
between app processes running on physical logical end-end
different hosts transport
r transport protocols run in end
systems
m send side: breaks app
messages into segments,
passes to network layer
m rcv side: reassembles application
segments into messages, transport
network
passes to app layer data link
physical
r more than one transport protocol
available to apps
m Internet: TCP and UDP

Transport Layer 3-0


Transport vs. network layer
r network layer: logical Household analogy:
communication between 12 kids sending letters to 12
hosts kids
r transport layer: logical r processes = kids
communication between r app messages = letters in
processes envelopes
m relies on, enhances,
network layer services
r hosts = houses
r transport protocol = Ann
and Bill
r network-layer protocol =
postal service

Transport Layer 3-0


Internet transport-layer protocols
r reliable, in-order delivery application
transport
network
(TCP) data link
physical network
m congestion control logical end-end
data link
network
m flow control physical transport
data link
physical
m connection setup
r unreliable, unordered network
data link
delivery: UDP physical network
data link
m no-frills extension of “best- physical
network
effort” IP data link application
physical network transport
r services not available: data link
physical
network
data link
m delay guarantees physical

m bandwidth guarantees

Transport Layer 3-0


Chapter 3 outline
r 3.1 Transport-layer r 3.5 Connection-oriented
services transport: TCP
r 3.2 Multiplexing and m segment structure
m reliable data transfer
demultiplexing m flow control
r 3.3 Connectionless m connection management
transport: UDP r 3.6 Principles of congestion
r 3.4 Principles of reliable control
data transfer r 3.7 TCP congestion control

Transport Layer 3-0


Multiplexing/demultiplexing
Demultiplexing at rcv host: Multiplexing at send host:
gathering data from multiple
delivering received segments sockets, enveloping data with
to correct socket header (later used for
demultiplexing)
= socket = process

application P3 P1
P1 application P2 P4 application

transport transport transport

network network network

link link link

physical physical physical

host 1 host 2 host 3

Transport Layer 3-0


How demultiplexing works
r host receives IP datagrams
m each datagram has source IP 32 bits
address, destination IP address
m each datagram carries 1 source port # dest port #
transport-layer segment
m each segment has source, other header fields
destination port number
r host uses IP addresses & port
numbers to direct segment to
appropriate socket application
data
(message)

TCP/UDP segment format

Transport Layer 3-0


Connectionless demultiplexing
r Create sockets with port r When host receives UDP
segment:
numbers:
m checks destination port
DatagramSocket mySocket1 = new
number in segment
DatagramSocket(12534);
m directs UDP segment to socket
DatagramSocket mySocket2 = new
DatagramSocket(12535); with that port number

r UDP socket identified by two- r IP datagrams with different


tuple: source IP addresses and/or
source port numbers directed
(dest IP address, dest port number)
to same socket

Transport Layer 3-0


Connectionless demux (cont)
DatagramSocket serverSocket = new DatagramSocket(6428);

P2 P1
P1
P3

SP: 6428 SP: 6428


DP: 9157 DP: 5775

SP: 9157 SP: 5775


client DP: 6428 server DP: 6428 Client
IP: A IP: C IP:B

SP provides “return address”

Transport Layer 3-0


Connection-oriented demux
r TCP socket identified by 4- r Server host may support
tuple: many simultaneous TCP
m source IP address sockets:
m source port number m each socket identified by its
m dest IP address own 4-tuple
m dest port number
r Web servers have different
r recv host uses all four sockets for each connecting
values to direct segment to
client
appropriate socket m non-persistent HTTP will have
different socket for each
request

Transport Layer 3-0


Connection-oriented demux (cont)

P1 P4 P5 P6 P2 P1P3

SP: 5775
DP: 80
S-IP: B
D-IP:C

SP: 9157 SP: 9157


client DP: 80 server DP: 80 Client
IP: A S-IP: A
IP: C S-IP: B IP:B
D-IP:C D-IP:C

Transport Layer 3-0


Connection-oriented demux:
Threaded Web Server

P1 P4 P2 P1P3

SP: 5775
DP: 80
S-IP: B
D-IP:C

SP: 9157 SP: 9157


client DP: 80 server DP: 80 Client
IP: A S-IP: A IP: C S-IP: B IP:B
D-IP:C D-IP:C

Transport Layer 3-0


Chapter 3 outline
r 3.1 Transport-layer r 3.5 Connection-oriented
services transport: TCP
r 3.2 Multiplexing and m segment structure
m reliable data transfer
demultiplexing m flow control
r 3.3 Connectionless m connection management
transport: UDP r 3.6 Principles of congestion
r 3.4 Principles of reliable control
data transfer r 3.7 TCP congestion control

Transport Layer 3-0


UDP: User Datagram Protocol [RFC 768]
r “no frills,” “bare bones”
Internet transport protocol Why is there a UDP?
r “best effort” service, UDP r no connection establishment
segments may be: (which can add delay)
m lost
r simple: no connection state at
m delivered out of order to
sender, receiver
app
r small segment header
r connectionless:
m no handshaking between r no congestion control: UDP can
UDP sender, receiver blast away as fast as desired
m each UDP segment handled
independently of others

Transport Layer 3-0


UDP: more
r often used for streaming
multimedia apps 32 bits
m loss tolerant source port # dest port #
Length, in
m rate sensitive bytes of UDP length checksum
r other UDP uses segment,
m DNS including
m SNMP header
r reliable transfer over UDP: add
reliability at application layer Application
m application-specific error data
recovery! (message)

UDP segment format

Transport Layer 3-0


UDP checksum
Goal: detect “errors” (e.g., flipped bits) in transmitted segment

Sender: Receiver:
r treat segment contents as r compute checksum of received
sequence of 16-bit integers segment
r checksum: addition (1’s r check if computed checksum
complement sum) of segment equals checksum field value:
contents m NO - error detected
r sender puts checksum value m YES - no error detected. But
into UDP checksum field maybe errors nonetheless?
More later ….

Transport Layer 3-0


Internet Checksum Example
r Note
m When adding numbers, a carryout from the most
significant bit needs to be added to the result
r 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
Transport Layer 3-0
Chapter 3 outline
r 3.1 Transport-layer r 3.5 Connection-oriented
services transport: TCP
r 3.2 Multiplexing and m segment structure
m reliable data transfer
demultiplexing m flow control
r 3.3 Connectionless m connection management
transport: UDP r 3.6 Principles of congestion
r 3.4 Principles of reliable control
data transfer r 3.7 TCP congestion control

Transport Layer 3-0


Principles of Reliable data transfer
r important in app., transport, link layers
r top-10 list of important networking topics!

r characteristics of unreliable channel will determine complexity of


reliable data transfer protocol (rdt)
Transport Layer 3-0
Principles of Reliable data transfer
r important in app., transport, link layers
r top-10 list of important networking topics!

r characteristics of unreliable channel will determine complexity of


reliable data transfer protocol (rdt)
Transport Layer 3-0
Principles of Reliable data transfer
r important in app., transport, link layers
r top-10 list of important networking topics!

r characteristics of unreliable channel will determine complexity of


reliable data transfer protocol (rdt)
Transport Layer 3-0
Reliable data transfer: getting started
rdt_send(): called from above, deliver_data(): called by
(e.g., by app.). Passed data to rdt to deliver data to upper
deliver to receiver upper layer

send receive
side side

udt_send(): called by rdt, rdt_rcv(): called when packet


to transfer packet over arrives on rcv-side of channel
unreliable channel to receiver

Transport Layer 3-0


Rdt1.0: reliable transfer over a reliable channel
r underlying channel perfectly reliable
m no bit errors
m no loss of packets
r separate FSMs for sender, receiver:
m sender sends data into underlying channel
m receiver read data from underlying channel

Wait for rdt_send(data) Wait for rdt_rcv(packet)


call from call from extract (packet,data)
above packet = make_pkt(data) below deliver_data(data)
udt_send(packet)

sender receiver

Transport Layer 3-0


Rdt2.0: channel with bit errors
r underlying channel may flip bits in packet
m checksum to detect bit errors
r the question: how to recover from errors:
m acknowledgements (ACKs): receiver explicitly tells sender that pkt
received OK
m negative acknowledgements (NAKs): receiver explicitly tells sender
that pkt had errors
m sender retransmits pkt on receipt of NAK
r new mechanisms in rdt2.0 (beyond rdt1.0):
m error detection
m receiver feedback: control msgs (ACK,NAK) rcvr->sender

Transport Layer 3-0


rdt2.0 has a fatal flaw!
What happens if ACK/NAK Handling duplicates:
corrupted? r sender retransmits current pkt if
r sender doesn’t know what ACK/NAK garbled
happened at receiver! r sender adds sequence number to
r can’t just retransmit: possible each pkt
duplicate r receiver discards (doesn’t
deliver up) duplicate pkt

stop and wait


Sender sends one packet,
then waits for receiver
response

Transport Layer 3-0


rdt2.1: discussion
Sender: Receiver:
r seq # added to pkt r must check if received
r two seq. #’s (0,1) will packet is duplicate
suffice. Why? m state indicates whether 0 or
1 is expected pkt seq #
r must check if received
r note: receiver can not
ACK/NAK corrupted
know if its last ACK/NAK
r twice as many states received OK at sender
m state must “remember”
whether “current” pkt has 0
or 1 seq. #

Transport Layer 3-0


rdt2.2: a NAK-free protocol
r same functionality as rdt2.1, using ACKs only
r instead of NAK, receiver sends ACK for last pkt received OK
m receiver must explicitly include seq # of pkt being ACKed
r duplicate ACK at sender results in same action as NAK:
retransmit current pkt

Transport Layer 3-0


rdt3.0: channels with errors and loss

New assumption: underlying Approach: sender waits


channel can also lose “reasonable” amount of time
packets (data or ACKs) for ACK
m checksum, seq. #, ACKs, r retransmits if no ACK received in
retransmissions will be of this time
help, but not enough r if pkt (or ACK) just delayed (not
lost):
m retransmission will be
duplicate, but use of seq. #’s
already handles this
m receiver must specify seq # of
pkt being ACKed
r requires countdown timer

Transport Layer 3-0


rdt3.0 in action

Transport Layer 3-0


rdt3.0 in action

Transport Layer 3-0


Performance of rdt3.0

r rdt3.0 works, but performance stinks


r ex: 1 Gbps link, 15 ms prop. delay, 8000 bit packet:

L 8000bits
d trans = = 9
= 8 microseconds
R 10 bps
m U sender: utilization – fraction of time sender busy sending

U L/R .008
= = = 0.00027
sender 30.008
RTT + L / R m i c r o s ec
m
o n d s link
1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps
m network protocol limits use of physical resources!

Transport Layer 3-0


rdt3.0: stop-and-wait operation
sender receiver
first packet bit transmitted, t = 0
last packet bit transmitted, t = L / R

first packet bit arrives


RTT last packet bit arrives, send
ACK

ACK arrives, send next


packet, t = RTT + L / R

U L/R .008
sender
= = = 0.00027
RTT + L / R 30.008 m i c r o s ec
onds

Transport Layer 3-0


Pipelined protocols
Pipelining: sender allows multiple, “in-flight”, yet-to-be-
acknowledged pkts
m range of sequence numbers must be increased
m buffering at sender and/or receiver

r Two generic forms of pipelined protocols: go-Back-N, selective


repeat
Transport Layer 3-0
Pipelining: increased utilization
sender receiver
first packet bit transmitted, t = 0
last bit transmitted, t = L / R

first packet bit arrives


RTT last packet bit arrives, send ACK
last bit of 2nd packet arrives, send ACK
last bit of 3rd packet arrives, send ACK
ACK arrives, send next
packet, t = RTT + L / R

Increase utilization
by a factor of 3!

U 3 *L/R .024
sender
= = = 0.0008
RTT + L / R 30.008 microsecon
ds
Transport Layer 3-0
Pipelining Protocols
Go-back-N: big picture: Selective Repeat: big pic
r Sender can have up to N r Sender can have up to N
unacked packets in unacked packets in
pipeline pipeline
r Rcvr only sends r Rcvr acks individual
cumulative acks packets
m Doesn’t ack packet if r Sender maintains timer for
there’s a gap
each unacked packet
r Sender has timer for oldest m When timer expires,
unacked packet retransmit only unack
m If timer expires, retransmit packet
all unacked packets

Transport Layer 3-0


Selective repeat: big picture
r Sender can have up to N unacked packets in
pipeline
r Rcvr acks individual packets
r Sender maintains timer for each unacked packet
m When timer expires, retransmit only unack packet

Transport Layer 3-0


GBN in
action

Transport Layer 3-0


Selective Repeat
r receiver individually acknowledges all correctly received
pkts
m buffers pkts, as needed, for eventual in-order delivery to upper
layer
r sender only resends pkts for which ACK not received
m sender timer for each unACKed pkt
r sender window
m N consecutive seq #’s
m again limits seq #s of sent, unACKed pkts

Transport Layer 3-0


Selective repeat in action

Transport Layer 3-0


Chapter 3 outline
r 3.1 Transport-layer r 3.5 Connection-oriented
services transport: TCP
r 3.2 Multiplexing and m segment structure
m reliable data transfer
demultiplexing m flow control
r 3.3 Connectionless m connection management
transport: UDP r 3.6 Principles of congestion
r 3.4 Principles of reliable control
data transfer r 3.7 TCP congestion control

Transport Layer 3-0


TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581

r point-to-point: r full duplex data:


m one sender, one receiver m bi-directional data flow in
r reliable, in-order byte same connection
m MSS: maximum segment
steam: size
m no “message boundaries”
r connection-oriented:
r pipelined: m handshaking (exchange of
m TCP congestion and flow control msgs) init’s sender,
control set window size receiver state before data
r send & receive buffers exchange
r flow controlled:
application application
m sender will not overwhelm
socket
door
writes data reads data
socket receiver
door
TCP TCP
send buffer receive buffer
segment

Transport Layer 3-0


TCP segment structure
32 bits
URG: urgent data counting
(generally not used) source port # dest port #
by bytes
sequence number of data
ACK: ACK #
valid acknowledgement number (not segments!)
head not
PSH: push data now len used
UA P R S F Receive window
(generally not used) # bytes
checksum Urg data pnter
rcvr willing
RST, SYN, FIN: Options (variable length) to accept
connection estab
(setup, teardown
commands) application
Internet data
checksum (variable length)
(as in UDP)

Transport Layer 3-0


TCP seq. #’s and ACKs
Seq. #’s:
Host A Host B
m byte stream “number”
of first byte in User
segment’s data types Seq=42, ACK=79, data =
‘C’ ‘C’
ACKs: host ACKs
m seq # of next byte receipt of
‘C’, echoes
expected from other Seq=79, ACK=43, data =
back ‘C’
side ‘C’
m cumulative ACK
host ACKs
Q: how receiver handles out- receipt
of-order segments of echoed Seq=43, ACK=80
m A: TCP spec doesn’t ‘C’
say, - up to
implementor
time
simple telnet scenario

Transport Layer 3-0


Chapter 3 outline
r 3.1 Transport-layer r 3.5 Connection-oriented
services transport: TCP
r 3.2 Multiplexing and m segment structure
m reliable data transfer
demultiplexing m flow control
r 3.3 Connectionless m connection management
transport: UDP r 3.6 Principles of congestion
r 3.4 Principles of reliable control
data transfer r 3.7 TCP congestion control

Transport Layer 3-0


TCP reliable data transfer
r TCP creates rdt service on r Retransmissions are
top of IP’s unreliable triggered by:
service m timeout events
m duplicate acks
r Pipelined segments
r Initially consider
r Cumulative acks
simplified TCP sender:
r TCP uses single m ignore duplicate acks
retransmission timer m ignore flow control,
congestion control

Transport Layer 3-0


TCP sender events:
data rcvd from app: timeout:
r Create segment with seq # r retransmit segment that
r seq # is byte-stream caused timeout
number of first data byte r restart timer
in segment Ack rcvd:
r start timer if not already r If acknowledges
running (think of timer as previously unacked
for oldest unacked segments
segment) m update what is known to be
acked
r expiration interval:
m start timer if there are
TimeOutInterval outstanding segments

Transport Layer 3-0


TCP: retransmission scenarios
Host A Host B Host A Host B

Seq=92, 8 bytes Seq=92, 8 bytes


data S data
e Seq=100, 20 bytes
ti q data
ACK=10
m =
0
e X 9 ACK=10
0
ACK=120
o loss 2
u ti
t Seq=92, 8 bytes Sendbase m Seq=92, 8 bytes
data eS data
= 100
SendBase oe
= 120 uq
ACK=120
ACK=100 t
=
9
2
SendBase
SendBase ti
= 100
= 120 m
premature timeout
e
time time
o
lost ACK scenario u Transport Layer 3-0
t
TCP retransmission scenarios (more)
Host A Host B

Seq=92, 8 bytes
data
ti ACK=10
m 0
Seq=100, 20 bytes
e Xdata
o loss
u
t
SendBase ACK=120
= 120

time
Cumulative ACK scenario

Transport Layer 3-0


Chapter 3 outline
r 3.1 Transport-layer r 3.5 Connection-oriented
services transport: TCP
r 3.2 Multiplexing and m segment structure
m reliable data transfer
demultiplexing m flow control
r 3.3 Connectionless m connection management
transport: UDP r 3.6 Principles of congestion
r 3.4 Principles of reliable control
data transfer r 3.7 TCP congestion control

Transport Layer 3-0


TCP Flow Control
flow control
sender won’t overflow
r receive side of TCP receiver’s buffer by
connection has a receive transmitting too much,
buffer: too fast

r speed-matching service:
matching the send rate to
the receiving app’s drain
rate
r app process may be slow
at reading from buffer

Transport Layer 3-0


TCP Flow control: how it works
r Rcvr advertises spare room
by including value of
RcvWindow in segments
r Sender limits unACKed
data to RcvWindow
(Suppose TCP receiver discards m guarantees receive buffer
out-of-order segments) doesn’t overflow
r spare room in buffer
= RcvWindow
= RcvBuffer-[LastByteRcvd -
LastByteRead]

Transport Layer 3-0


Chapter 3 outline
r 3.1 Transport-layer r 3.5 Connection-oriented
services transport: TCP
r 3.2 Multiplexing and m segment structure
m reliable data transfer
demultiplexing m flow control
r 3.3 Connectionless m connection management
transport: UDP r 3.6 Principles of congestion
r 3.4 Principles of reliable control
data transfer r 3.7 TCP congestion control

Transport Layer 3-0


TCP Connection Management
Recall: TCP sender, receiver Three way handshake:
establish “connection” before
exchanging data segments Step 1: client host sends TCP SYN
r initialize TCP variables: segment to server
m seq. #s m specifies initial seq #
m buffers, flow control info m no data
(e.g. RcvWindow) Step 2: server host receives SYN,
r client: connection initiator replies with SYNACK segment
Socket clientSocket = new m server allocates buffers
Socket("hostname","port
m specifies server initial seq. #
number");
r server: contacted by client Step 3: client receives SYNACK,
Socket connectionSocket =
replies with ACK segment, which
welcomeSocket.accept(); may contain data

Transport Layer 3-0


TCP Connection Management (cont.)

Closing a connection: client server

client closes socket: close


FIN
clientSocket.close();

Step 1: client end system sends ACK


TCP FIN control segment to close
FIN
server

Step 2: server receives FIN, ti ACK


replies with ACK. Closes m
connection, sends FIN. e
d
closedw
ai
t
Transport Layer 3-0
TCP Connection Management (cont.)

Step 3: client receives FIN, client server


replies with ACK. closing
FIN
m Enters “timed wait” - will
respond with ACK to
received FINs ACK
closing
FIN
Step 4: server, receives ACK.
Connection closed.
ti ACK
Note: with small modification, m
can handle simultaneous FINs. e closed
d
closedw
ai
t
Transport Layer 3-0
Chapter 3 outline
r 3.1 Transport-layer r 3.5 Connection-oriented
services transport: TCP
r 3.2 Multiplexing and m segment structure
m reliable data transfer
demultiplexing m flow control
r 3.3 Connectionless m connection management
transport: UDP r 3.6 Principles of congestion
r 3.4 Principles of reliable control
data transfer r 3.7 TCP congestion control

Transport Layer 3-0


Principles of Congestion Control

Congestion:
r informally: “too many sources sending too much data too
fast for network to handle”
r different from flow control!
r manifestations:
m lost packets (buffer overflow at routers)
m long delays (queueing in router buffers)
r a top-10 problem!

Transport Layer 3-0


Causes/costs of congestion: scenario 1
Host A lout
lin : original data
r two senders, two
receivers
Host B unlimited shared
r one router, infinite output link buffers

buffers
r no retransmission

r large delays when


congested
r maximum
achievable
throughput
Transport Layer 3-0
Causes/costs of congestion: scenario 2

r one router, finite buffers


r sender retransmission of lost packet

Host A lin : original lout


data
l'in : original data, plus
retransmitted data

Host B finite shared output


link buffers

Transport Layer 3-0


Causes/costs of congestion: scenario 2
r always: l = l (goodput)
out
in
r “perfect” retransmission only when loss: l > l out
in
r retransmission of delayed (not lost) packet makes largerl (than perfect
in
case) for same l out
R/2 R/2 R/2

R/3
l l l
R/4
o o o
u u u
t t t

R/2 R/2 R/2


lin lin lin

a. b. c.
“costs” of congestion:
r more work (retrans) for given “goodput”
r unneeded retransmissions: link carries multiple copies of pkt
Transport Layer 3-0
Approaches towards congestion control
Two broad approaches towards congestion control:

End-end congestion control: Network-assisted congestion


r no explicit feedback from control:
network r routers provide feedback to end
r congestion inferred from end- systems
system observed loss, delay m single bit indicating
r approach taken by TCP congestion (SNA, DECbit,
TCP/IP ECN, ATM)
m explicit rate sender should
send at

Transport Layer 3-0


Chapter 3 outline
r 3.1 Transport-layer r 3.5 Connection-oriented
services transport: TCP
r 3.2 Multiplexing and m segment structure
m reliable data transfer
demultiplexing m flow control
r 3.3 Connectionless m connection management
transport: UDP r 3.6 Principles of congestion
r 3.4 Principles of reliable control
data transfer r 3.7 TCP congestion control

Transport Layer 3-0


TCP congestion control: additive increase,
multiplicative decrease
r Approach: increase transmission rate (window size), probing
for usable bandwidth, until loss occurs
m additive increase: increase CongWin by 1 MSS every
RTT until loss detected
m multiplicative decrease: cut CongWin in half after loss
congestion
window
c
24 Kbytes
o
Saw tooth n
g 16 Kbytes
behavior: probing e
for bandwidth s
ti 8 Kbytes

o
n tim
time
w e
i
Transport Layer 3-0
n
TCP Congestion Control: details
r sender limits transmission: How does sender perceive
LastByteSent-LastByteAcked congestion?
CongWin r loss event = timeout or 3
r Roughly, duplicate acks
rate =
CongWin r TCP sender reduces rate
Bytes/sec
RTT (CongWin) after loss
r CongWin is dynamic, function of event
perceived network congestion three mechanisms:
m AIMD
m slow start
m conservative after timeout
events

Transport Layer 3-0


TCP Slow Start
r When connection begins, r When connection begins,
CongWin = 1 MSS increase rate exponentially
m Example: MSS = 500 bytes & fast until first loss event
RTT = 200 msec
m initial rate = 20 kbps
r available bandwidth may be
>> MSS/RTT
m desirable to quickly ramp up
to respectable rate

Transport Layer 3-0


TCP Slow Start (more)
r When connection begins, Host A Host B
increase rate exponentially
one segment
until first loss event: R
T
m double CongWin every
T
RTT two
m done by incrementing segments

CongWin for every ACK


received four
r Summary: initial rate is segments

slow but ramps up


exponentially fast
time

Transport Layer 3-0

You might also like