Docsity

Reducing Latency in TCP-Based Media Streams, Slides of Computer Science

Partial preview of the text

Download Reducing Latency in TCP-Based Media Streams and more Slides Computer Science in PDF only on Docsity!

Supporting Low

Latency TCP-Based Media Streams

Introduction (1 of 3)

• Traditionally, TCP thought to ineffective for

streaming media

  • Congestion control – probing can cause delay

or drops

  • Retransmissions – can cause delays

• Recent approaches overcome these by

client-side buffering

  • Trade off latency to reduce variance in latency

caused by TCP

• Using TCP for streaming beneficial

  • Avoid congestion collapse
  • Much work on improving TCP so will improve

streaming

Introduction (3 of 3)

  • Examine TCP protocol latency at:
    • Sender side, receiver side, network
    • Over a range of conditions
  • Surprisingly, a lot of latency at send buffer
    • Can reduce by simple buffer mods
    • Do not need to change TCP at all
    • Can reduce to under 200 msec
      • Good enough for interactive
  • Assume polling (non-blocking write())
  • Note, still can be latency ā€œspikesā€ above 200 ms
    • Caused by retransmission
    • Explore use of ECN (packets marked during congestion)

Outline

• Introduction (done)

• TCP Send Buffer (next)

• Experiments

• Results

• Related Work

• Conclusions

Adapting Send Buffer Size

  • Could statically limit Send Buffer size
    • But would never let CWND grow larger than this
      • Limiting throughput
    • Reject since still want high throughput
  • Try Send Buffer as big as CWND
    • Since when larger, Send Buffer only adds latency since TCP (CWND) cannot send more anyway
  • However, can impact throughput
    • When ACK, only send data when app writes (OS timing issues)
      • Exacerbated when multiple packets ACK’ed
    • When CWND grows
  • So, try different adaptive Send Buffer options

Send Buffer Modifications

  • Linux 2.4 mods, new SO_TCP_MIN_BUF
    • Limit send buffer to A *CWND + min( B , CWND)
      • A , B are integers and A is 1+ and B is 0+
    • By default, A =1 and B =0 (unless app changes)
    • If send buffer full, app blocks, woken up when free
    • Call this MIN_BUF(A,B)
  • For MIN_BUF(1,0), when application writes TCP can immediately send (CWND must be as large) - TCP adds to buffering delay - However, when congestion (CWND halves), buffering delay for previously written pkts

TCP SACK

  • With TCP Selective Acknowledgment (SACK) acknowledged packets no longer contiguous - Add sacked_out term to Send Buffer where sacked_out equals number of selectively ACK’ed packets - Thus, Send Buffer at least CWND+ sacked_out
  • Without modification, TCP SACK cannot send for a MIN_BUF(1,0) flow - Assume rate is application limited - Will frequently halve data window

Application Model

• Assume uses non-blocking read() / write()

  • Needs to be aware of timing for data

• Assume Application Level Framing where data

size fits network size

  • Reduces latency from fragmentation/coalescing

• TCP determines MSS during startup, but can

change mid-flight

  • Application queries MSS before each write
  • Alternative would be error on write() call

Experimental Scenarios

  • Consider latency when sudden increase in congestion - Competing long-lived, flash Web crowd, UDP CBR
  • Consider throughput for MIN_BUF vs TCP
  • Measures of performance
    • Protocol latency (% packets within threshold)
      • Thresholds of 200ms (interactive), 500ms (VCR-like)
    • Average packet latency
    • Normalized (to TCP) throughput
  • Also look at how ECN affects protocol latency

Experimental Setup

  • Two receivers to get cross traffic
  • TCP dump to get further analysis
  • Router runs NIST Net (emulator) for added latency and loss - RTTs of 25, 50 and 100 ms - Bandwidth to 12 Mbps and 30 Mbps (MLC: using only queue length?) - For ECN, use DRED (variant of RED)
  • Protocol latency by timestamp
    • Hosts synchronized by NTP

Cross Traffic for Protocol Latency

  • Start TCP streaming flow t=0 to R
  • At t=5, 15 long-lived (elephant) TCP flows started
    • 7 to R1 and 8 to R
  • At t=20, 40 short-lived (mice) flows
    • Transfer 20 KByte object and repeat
    • Takes about 30% of bandwidth
  • At t=40, unresponsive CBR takes 10%
  • At t=60, elephants stopped
  • At t=75, others stopped

(See profile next slide)

Cross Traffic for Protocol Latency

30 Mbps 100 ms RTT (Others similar)

Protocol Latency

MIN_BUF(1,0) least MIN_BUF(2,0) most MIN_BUF(1,3) close to MIN_BUF(1,0) Spikes caused by retransmissions (more later)

Protocol Latency

Vertical lines at 200, 500 RTT LeftRight Bwidth TopBottom 8 Runs at each