Project%203%20Flow%20and%20congestion%20control - PowerPoint PPT Presentation

About This Presentation
Title:

Project%203%20Flow%20and%20congestion%20control

Description:

Project 3 Flow and congestion ... wait Don t transmit a new packet until you get an ACK Limited ... Inject some losses to test loss behavior Write time ... – PowerPoint PPT presentation

Number of Views:106
Avg rating:3.0/5.0
Slides: 21
Provided by: SCS102
Learn more at: http://www.cs.cmu.edu
Category:

less

Transcript and Presenter's Notes

Title: Project%203%20Flow%20and%20congestion%20control


1
Project 3Flow and congestion control
  • 15-441 Spring 2010
  • Recitation 10

2
Context Project 3
  • Bit torrent-like file transfer app
  • Use UDP to understand the challenges in transport
    protocol design and implementation
  • Checkpoints
  • 1 Generate WHOHAS queries and IHAVE replies
    (due today!)
  • 2 Download a chunk using stop and wait
  • 3 Add flow control
  • 4 Add congestion control

3
Why do we need flow control
  • Stop and wait
  • Dont transmit a new packet until you get an ACK
  • Limited performance
  • 1 packet per RTT

Pkt 0
Pkt 1
4
Sliding window - idea
  • Enough in-flight packets to hide the RTT
  • Have a buffer of packets on each side
  • Advance window when sender and receiver agree
    packets at the beginning have been received
  • Common case
  • Receiver send cumulative ACK, slide window
  • Sender slide window, send next packet

5
Sliding window - visualization
Receiver
Sender
Max acceptable
Next expected
Max ACK received
Next seqnum




Receiver window
Sender window
Sent Acked
Sent Not Acked
Received Acked
Acceptable Packet
OK to Send
Not Usable
Not Usable
6
Sliding window reliability
  • Lost packet (with cumulative ACKs)
  • When detecting a missing packet, the receiver
    sends an ACK with the sequence number of the last
    correctly ordered packet
  • If the sender timeouts while waiting for an ACK,
    it will retransmit
  • Accommodating out of order packets
  • The sender waits for 3 duplicate ACKs before
    retransmitting

7
Sliding window implementation
  • Sender keeps 3 pointers
  • LastPacketAcked, LastPacketSent,
    LastPacketAvailable
  • Ensure invariants
  • LastPacketAcked lt LastPacketSent
  • LastPacketSent lt LastPacketAvailable
  • LastPacketAvailable-LastPacketAcked lt WindowSize
  • Simplify by ignoring receiver issues he can
    always process whatever he gets

8
Sliding window testing
  • Use assert statements to ensure invariants
  • Inject some losses to test loss behavior
  • Write time-stamped packet sequence numbers and
    ACKs to a file and plot them

9
Sliding window testing fast retrans
Retransmission
X
Duplicate Acks
Sequence No
Time
10
Congestion control
  • Adapt to the network conditions by changing your
    window size
  • Losses assumed to be due to congestion, so
    throttle back the sender when you see one
  • Implement
  • Slow start
  • Congestion Avoidance
  • Fast retransmit

11
Slow start
  • Start with window of size 1 (SW1) and define the
    slow start threshold to be 64 (ssthresh64)
  • Now, upon
  • ACK received SW
  • Loss detected ssthresh max(SW/2,2), SW1
  • SW ssthresh move into congestion avoidance

12
Congestion avoidance
  • Upon ACK received
  • SW(1/SW) (increases by 1 every RTT)
  • Upon loss detected
  • ssthresh max(SW/2,2), SW1
  • Revert back to slow start
  • Detecting losses
  • Retransmission timeout
  • 3 duplicate ACKs received (fast retransmit)

13
Estimating RTT Karns algorithm
  • Estimated RTT (ERRT), based on the observed RTT
    (ORTT)
  • ERTT (i1) a ERTT(i) ( 1-a ) ORTT (i)
  • a typically 0.875
  • Retransmit timer set to 2 ERTT, increase
    backoff on retransmission
  • Ignore any ORTTs from packets with
    retransmissions prevents situations where you
    are stuck with a erroneously low RTT
    (http//www.opalsoft.net/qos/TCP-10.htm)

14
Congestion avoidance - testing
  • Plot the window size as a function of time for a
    given flow

Congestion Window
Cut Congestion Window and Rate
Time
Grabbing back Bandwidth
Packet loss retransmit
15
Congestion avoidance - testing
  • Write time-stamped sequence nos. and ACKS

Window size increases by 1 every RTT.
Sequence No
Time
16
Fast recovery (optional)
  • When a loss is detected, dont go back to slow
    start, leverage the outstanding packets
  • Wait to receive SW/2 ACKs
  • Set SW max(SW/2,2) and resume congestion
    avoidance

17
Fast recovery (optional)
Sent for each dupack after W/2 dupacks arrive
Sequence No
X
Time
18
Selective ACKs (optional)
  • Instead of having the sequence no. of the packet
    you last received in order
  • send a bitmask of all received packets
  • Enables faster retransmissions

19
Without selective ACKs
X
X
X
Now what? - timeout
X
Sequence No
Time
20
With selective ACKs (optional)
Now what? send retransmissions as soon as
detected
X
X
X
X
Sequence No
Time
Write a Comment
User Comments (0)
About PowerShow.com