Docsity

Internet Protocol Stack and Congestion Control - Lecture Slides | EECS 489, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
Internet Protocol Stack!
application: supporting network applications!
•!HTTP, SMTP, FTP, etc.!
transport: endhost-endhost data transfer!
•!TCP, UDP!
network: routing of datagrams from source
to destination!
•!IP, routing protocols!
link: data transfer between neighboring
network elements!
•!Ethernet, WiFi!
physical: bits ā€œon the wireā€!
application
transport
network
link
physical
Congestion Control!
What gives rise to congestion?!
When offered load is greater than system capacity,"
too much data for the network (as opposed to receiver) to handle!
Causes and Implications of Congestion!
•!caused by packets arriving faster than a router
can forward them!
•!routers queue packets that they cannot serve
immediately!
•!if queue overflows, packets are dropped!
•!queued packets experience delay!
Why is congestion bad?!
10Mbps
10Mbps
10Mbps
Consequences of Congestion!
If queueing delay > RTO, sender retransmits packets, adding to
congestion!
Dropped packets also lead to more retransmissions!
If unchecked, could result in congestion collapse!
When packet dropped, any ā€œupstreamā€ transmission capacity used
for that packet was wasted!
What prevention?!
Constraints:!
•!decentralized control!
•!unlike routing, no local "
reaction at routers (beyond buffering and dropping)!
•!long feedback time!
•!dynamic network condition: connections come and go!
pf3
pf4
pf5
pf8

Partial preview of the text

Download Internet Protocol Stack and Congestion Control - Lecture Slides | EECS 489 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Internet Protocol Stack!

application: supporting network applications!

•! HTTP, SMTP, FTP, etc.!

transport: endhost-endhost data transfer!

•! TCP, UDP!

network: routing of datagrams from source

to destination!

•! IP, routing protocols!

link: data transfer between neighboring

network elements!

•! Ethernet, WiFi!

physical: bits ā€œon the wireā€!

application

transport

network

link

physical

Congestion Control!

What gives rise to congestion?!

When offered load is greater than system capacity,"

too much data for the network (as opposed to receiver) to handle!

Causes and Implications of Congestion!

•! caused by packets arriving faster than a router

can forward them!

•! routers queue packets that they cannot serve

immediately!

•! if queue overflows, packets are dropped!

•! queued packets experience delay!

Why is congestion bad?!

10Mbps

10Mbps

10Mbps

Consequences of Congestion!

If queueing delay > RTO, sender retransmits packets, adding to

congestion!

Dropped packets also lead to more retransmissions!

If unchecked, could result in congestion collapse!

When packet dropped, any ā€œupstreamā€ transmission capacity used

for that packet was wasted!

What prevention?!

Constraints:!

•! decentralized control!

•! unlike routing, no local "

reaction at routers (beyond buffering and dropping)!

•! long feedback time!

•! dynamic network condition: connections come and go!

Congestion Control!

How can senders prevent/avoid congestion?!

Jain et al.!

Congestion Control!

How do senders know what the"

system capacity is?!

Load vs. throughput:!

•! congestion avoidance: operate system at ā€œkneeā€!

•! congestion control: operate system near ā€œcliffā€!

How do senders discover system capacity"

and control congestion?!

Jain et al.!

Discovering System Capacity!

How do senders know where the ā€œkneeā€ is and"

how do they know when the system has"

ā€œgone off the cliffā€?!

What TCP and other congestion control"

schemes do:!

•! probe for point right before cliff (ā€œpipe sizeā€)!

•! slow down transmission on detecting cliff (congestion)!

•! fast probing initially, "

up to a threshold (ā€œslow startā€)!

•! slower probing after threshold "

is reached (ā€œlinear increaseā€)!

Why not send a large amount "

of data and then slow down?!

TCP

Tahoe!

congestion window (

cwnd

)

packet!

dropped!

TCP Slow-start!

Host A!

one segment

!

RTT

!

Host B!

time!

two segments

!

four segments

!

Jacobson and Karels!

When connection begins, increase

rate exponentially until first loss

event:!

•! double cwnd every RTT"

(every ACK received)!

! initial rate is slow but ramps up

exponentially fast!

TCP Slow Start Example

Stevens!

Decreasing cwnd

How to detect congestion?!

Interpret packet loss as congestion signal!

When is packet considered lost?!

•! RTO timer goes off!

•! receipt of 3 duplicate ACKs!

Fast Retransmit

Motivation: waiting for RTO is too long!

TCP Tahoe does fast retransmit:!

•! with cumulative ACK, receipt of packets following a lost

packet cause duplicate ACKs to be returned!

•! interpret 3 duplicate ACKs as an implicit NAK!

•! retransmit upon receiving 3 dupACKs, i.e., on receipt of the

th

ACK with the same seq#, retransmit segment!

•! why 3, instead of 2 or 4, dupACKs?!

With fast retransmit, TCP can retransmit after 1 RTT

instead of waiting for RTO!

Fast Retransmit Example

Hoe!

3 dupACKs! retransmit on!

4th dupACK!

ACKed seq#!

rwnd!

sent segments!

time (secs)!

TCP Congestion Recovery

Once congestion is detected,!

•! by how much do we decrease cwnd?!

•! how do we recover from congestion?!

•! which packet(s) do we retransmit?!

•! how do we increase cwnd again?!

First, reset ssthresh = cwnd/

TCP Tahoe:!

•! retransmit using Go-Back-N!

•! reset cwnd=1!

•! restart slow-start!

TCP

Tahoe!

congestion window (

cwnd

)

packet!

dropped!

TCP Reno and Fast Recovery

cwnd re-opening and retransmission of lost "

packets regulated by returning ACKs!

•! duplicate ACK doesn’t grow cwnd, so TCP must wait at least 1 RTT for

fast retransmitted packet to cause a non-duplicated ACK to be returned!

•! if RTT is large, Tahoe re-grows cwnd very slowly!

TCP Reno does fast recovery :!

•! current value of cwnd is the estimated system capacity!

•! after congestion is detected, want to continue "

transmitting at half the estimated capacity, how?!

•! each returning ACK signals that an outstanding "

packet has left the network!

•! don’t send any new packet until half of the "

expected number of ACKs have returned!

Fast Recovery

1.! on congestion, retransmit lost segment,

set sstresh = cwnd/

2.! remember highest seq# sent,

snd_high;"

and remember current cwnd, "

let’s call it pipe

3.! decrease cwnd by half!

4.! increment cwnd for every returning

dupACK, incl. the 3 used for fast

retransmit!

5.! send new packets (above snd_high)

only when "

cwnd > pipe

6.! exit fast-recovery when a non-dup ACK

is received!

7.! set cwnd = ssthresh + 1 and resume

linear increase!

cwnd: number of!

bytes unACKed!

Summary: TCP Congestion Control!

•! when cwnd is below ssthresh, sender in slow-start

phase, window grows exponentially!

•! when cwnd is above ssthresh, sender is in congestion-

avoidance phase, window grows linearly!

•! when a 3 dupACK occurs, ssthresh set to cwnd/2 and

cwnd set to new ssthresh

•! if more dupACKs return, do fast recovery!

•! else when RTO occurs, ssthresh set to cwnd/2 and

cwnd is set to 1 MSS!

Summary: "

Factors in TCP Performance

•! RTT estimate!

•! RTO computation!

•! sender’s sliding window (wnd)!

•! receiver’s window (rwnd)!

•! congestion window (cwnd)!

•! slow-start threshold

(sstresh)!

•! fast retransmit!

•! fast recovery!

Summary of TCP Variants

Original TCP:!

•! loss recovery depends on RTO!

TCP Tahoe:!

•! slow-start and linear increase!

•! 3 dupACKs as loss signal, but restart slow-start after fast retransmit!

TCP Reno:!

•! fast recovery, i.e., consume half returning dupACKs before transmitting one

new packet for each additional returning dupACKs!

•! on receiving a non-dupACK, resume linear-increase from half old cwnd value!

TCP New Reno:!

•! implements fast retransmit phase whereby a non-dupACK takes TCP out of fast

recovery only if the non-dupACK is! the sequence number sent out before

detection of loss (snd_high)!

•! a non-dupACK that is < snd_high is called a partial ACK!

TCP SACK

Selective ACK (SACK) gives sender a better idea of which

packets have been successfully delivered!

TCP does Selective Repeat instead of Go-Back-N!

Added 2 TCP options:!

1.! SACK Permitted (option 4): "

carried only by SYN packets!

2.! SACK Option (option 5): "

NAK for missing segments!

src port

dst port

seq

cumulative ack

hl rwin

checksum urgent

5 len

first

next

first

next

first

next

first

next

Usual TCP header

SACK Option

must be

most recently

received

fragment

TCP SACK Example

Pkts: 1 2 3 4 5 6 7 8 9 10 11 12 13

lost

last to arrive

SACK for 13:

5

11

14

7

9

After 5, 6 arrive,

SACK for 6:

9

11

14

cumulative

ack

sack

TCP SACK Advantages

Decouples when and how much to send (congestion

control) from which to send (loss recovery)!

TCP SACK not yet widely deployed!

Future use of SACK info:!

•! send new packet on first or second duplicate ACK!

•! tell sender when there will be no more returning ACK!

•! cancel previous decisions upon updated info!

•! construct a better count of outstanding segments!

Effect of Asymmetry on TCP

Example of asymmetric networks:!

•! cable modem: 10 Mbps down, 512 Kbps up!

•! ADSL: 8 Mbps down, 1 Mbps up!

•! etc.!

Fine for web surfing, but transfer can be slowed

down by bandwidth asymmetry. How?!

Slower bandwidth on reverse path stretches out

ACKs (ACK dilation), resulting in slower

throughput on the forward path!

Effect of Asymmetry on TCP

Maximum transmission speed determined by

ā€œnormalized bandwidth ratioā€:!

For example:!

•! 10 Mbps forward/100 Kbps reverse = bandwidth ratio of 100!

•! 1 KB data packet/40-byte ACK = data/ACK ratio of 25!

•! normalized bandwidth ratio = 100/25 = 4!

! if there are more than 1 ACK for every 4 packets, reverse

bottleneck link will be saturated before forward bottleneck

does!

forward bandwidth/datasize

reverse bandwidth/ACKsize