Tweaking TCPs Timers Kieran Mansley Laboratory for Communication - - PowerPoint PPT Presentation

tweaking tcp s timers
SMART_READER_LITE
LIVE PREVIEW

Tweaking TCPs Timers Kieran Mansley Laboratory for Communication - - PowerPoint PPT Presentation

Tweaking TCPs Timers Kieran Mansley Laboratory for Communication Engineering Context Researching user-level TCP for my PhD. Focusing on how to implement it efficiently at user level, particularly in a server room. Timers are a


slide-1
SLIDE 1

Tweaking TCP’s Timers

Kieran Mansley Laboratory for Communication Engineering

slide-2
SLIDE 2

Context

  • Researching user-level TCP for my PhD.
  • Focusing on how to implement it efficiently

at user level, particularly in a server room.

  • Timers are a small but interesting part of

that.

slide-3
SLIDE 3

Historical Context

  • TCP was first specified in the early 1980s
  • OS support for time was poor and costly
  • Networks were slower, so time intervals longer.
  • Portability very important, all leads to...

TCP has weak requirements of the OS

slide-4
SLIDE 4

What are TCP Timers?

  • Not measuring time (usually).
  • Enable an action to be performed later.
  • Mostly used to deal with inactivity:
  • Timer set when activity is expected
  • Timer cancelled when activity occurs
  • If timer expires, recovery action is executed.
slide-5
SLIDE 5

Delayed Acknowledgments

  • TCP sends acks for reliability and flow

control.

  • Can either be a separate packet or

piggyback on a data packet.

  • Acks are delayed to encourage piggybacking.
  • Timer used to ensure delay is limited.
slide-6
SLIDE 6

Delayed Ack Illustration

slide-7
SLIDE 7

Timer Ticks Illustrated

slide-8
SLIDE 8

Timer Techniques

  • How to implement timers?
  • Trad. scheme based on 100ms clock ticks
  • Maintain flags in per-connection state.
  • Each tick, check list of connections for timers.
  • Modern scheme based on hashed

hierarchical timing wheel.

  • Ordered list of timers, use hardware clock to

trigger the check and schedule operation.

slide-9
SLIDE 9

Problems

  • Inaccurate delay of acks: from 0ms to 200ms
  • List of connections must be searched each

clock tick.

  • A busy connection will still regularly send

separate ack packets.

slide-10
SLIDE 10

Potential Solution (i)

  • Change profile of delay:
slide-11
SLIDE 11

Potential Solution (ii)

  • Use two timer buckets to achieve delay

limits:

Target Bucket A Target Bucket B Empty Bucket B Empty Bucket A x x+100 x+200 x+300 x+400 x x+100 x+200 x+300 x+400

Min Max

time (ms) time (ms)

slide-12
SLIDE 12

Potential Solution (iii)

  • Implementation of buckets:
  • Lazy switch avoids need for scheduling.
  • Timer execution when blocking op encountered.
  • Data thread used for active connections.
  • Time checking done using “rtdsc” counter.
slide-13
SLIDE 13

Potential Solution (iv)

  • Handle timers for active connections from

the data thread.

  • Removes need for locking, other than for

handing connections between threads.

  • No list searching, but...
  • Increased set/clear timer complexity.
slide-14
SLIDE 14

CPU Usage Tradeoff

0.0001 0.001 0.01 0.1 1 10 10 100 1000 10000 100000 CPU usage (%) Connection list size CPU to iterate list (%) measured inline 0.0000754x + 0.0001191 CPU to iterate list (%) measured with ’time’ 0.0000692x + 0.001060 CPU for bucket scheme (%)

slide-15
SLIDE 15

Summary

  • Timers at user level can benefit from a

different solution.

  • Change the way timers are implemented to:
  • Give guaranteed lower, reduced upper bound;
  • Avoid locking by checking timers in data thread.
  • Minor performance issue for current TCPs
  • May be more important in future.
slide-16
SLIDE 16

Questions/Comments?

Kieran Mansley kjm25@cam.ac.uk http://www-lce.eng.cam.ac.uk/~kjm25 Available as technical report CUED/F-INFENG/TR.487