correcting for clock drift in uTP and LEDBAT Arvid Norberg, - - PowerPoint PPT Presentation

correcting for clock drift in utp and ledbat
SMART_READER_LITE
LIVE PREVIEW

correcting for clock drift in uTP and LEDBAT Arvid Norberg, - - PowerPoint PPT Presentation

correcting for clock drift in uTP and LEDBAT Arvid Norberg, arvid@bittorrent.com Bram Cohen, bram@bittorrent.com A B x = now() x diff = now() - x f f i d base_delay = min(base_delay, diff) delay = diff - base_delay cwnd += (target -


slide-1
SLIDE 1

correcting for clock drift in uTP and LEDBAT

Arvid Norberg, arvid@bittorrent.com Bram Cohen, bram@bittorrent.com

slide-2
SLIDE 2

A B x = now() diff = now() - x x d i f f base_delay = min(base_delay, diff) delay = diff - base_delay cwnd += (target - delay)· gain

slide-3
SLIDE 3
  • using a base delay of the lowest ever

received diff assumes that at least one packet will get through with no buffering delay

  • only ever adjusting base_delay downwards

assumes no clock drift

slide-4
SLIDE 4
slide-5
SLIDE 5
  • One solution to clock drift is to update

base_delay periodically with the lowest seen diff in the last period

  • What should the interval be?
  • If it’s too short, we’ll set the base delay to

a sample that isn’t the true lowest value, and our measurements are unreliable

  • If it’s too long, we’ll allow a significant

drift before adjusting, and our measurements are unreliable

slide-6
SLIDE 6

delay_base update interval too short delays are artificially kept too low for certain periods

slide-7
SLIDE 7

base_delay update interval too long 15 ms drift in 8 minutes

slide-8
SLIDE 8
  • Tests show that the update interval cannot

be less than around 10 minutes on our DSL line

  • Other tests on a LAN show a significant

drift over 10 minutes

  • There is no good magic number for the

base_delay update interval

slide-9
SLIDE 9
  • However, if the clock drift is in your favor,

it’s not a problem

  • Since the drift causes the delay

measurements to appear smaller, the base_delay is updated with the drift

slide-10
SLIDE 10
slide-11
SLIDE 11
  • We can take advantage of this fact by

keeping track of the other end’s delay as well as our own

  • Whenever the other end’s base_delay is

adjusted downwards, we know it’s adjusting for drift and we can adjust our own base_delay the same amount upwards

slide-12
SLIDE 12

A B x = now() y = now() diff = y - x x d i f f , y base_delay = min(base_delay, diff) delay = diff - base_delay their_diff = now() - y if (their_diff < their_base_delay) { base_delay += their_base_delay - their_diff their_base_delay = their_diff }

slide-13
SLIDE 13
slide-14
SLIDE 14

Delay measurement

  • distribution. No drift

correction target delay = 100 ms

slide-15
SLIDE 15

Delay measurement

  • distribution. With drift

correction target delay = 100 ms