11 Commits
Author SHA1 Message Date
David Wragg 9956d422f2 Introduce Overlay / sleeve
This introduces interfaces to represent the packet forwarding
mechanism, and brings all the scattered UDP-related code together into
a single implementation.

This is not a pure refactoring, although much of the code in sleeve.go
has been copied from pre-existing code, and the UDP protocol remains
the same in spirit.  The biggest change is the organization of the
forwarder goroutines (there is now one instead of two, and that
goroutine does a lot of auxiliary work as well as forwarding).
Performance testing between VMs on my laptop suggests that packet
throughput has not gone down, and may even have improved slightly.
2015-09-08 10:44:44 +01:00
Matthias Radestock fe5102580d fix connection retry delay calculation logic
The delay d(n) for the nth retry was
d(1) = rand(initial_interval)
d(n+1) = d(n) + rand(d(n))

There are two problem with this:

1) The entire sequence is dominated by the random value for d(1). If
this is a small value, lots of retries at short interval ensue. In
extremis, if d(1) is 0, indefinite immediate retries would ensue.

2) The delay is not a true exponential backoff; the upper bound only
increases exponentially *probabilistically*.

The new algorithm calculates

d(n) = random_value in range [i-i/2,i+i/2],
       where i = initial_interval * 1.5^(n-1).

Thus d(1) is at least initial_interval/2, and successive values are
independent of previous values, forming a true exponential sequence of
intervals bounds between which the retry delay is chosen randomly.

Due to the change in algorithm we reduce...

- the initial interval from 5s to 2s. Recall that previously d(1) was
  in the range [0,initial_interval=5s]. It is now [2-2/2=1s,2+2/2=3s].

- the max interval from 10 minutes to 6. Previously, once that was
  reached, it would stay exactly there. It is now randomly chosen in
  the range [6-6/2=3m,6+6/2=9min].

Thus previously delays would range from 0 to 10 minutes, now they
range from 1s to 9 minutes.

Fixes #412.
2015-06-03 11:29:55 +01:00
Alex Chan 2a1150b74e Minor spelling corrections in docs 2015-05-28 10:10:16 +01:00
Matthias Radestock f2d6b5fdb0 update docs 2015-01-15 14:58:24 +00:00
Matthias Radestock 2b2f47c031 refactor: rename PeerCache to Peers
It was never much of a cache, and that aspect of it is certainly not
its defining characteristic.
2014-12-24 19:23:43 +00:00
Matthias Radestock e8f836ad85 refactor: rename 'Topology' to 'Routes'
Since that is what it is. By contrast, when the docs talk about
topology they actually refer to the peer connectivity graph.
2014-12-24 19:12:01 +00:00
Matthias Radestock e850127ed4 git rid of heartbeater goroutine
...by moving the logic into the connection actor goroutine.

The heartbeater goroutine was doing a lot more than just heartbeating;
namely it also had tickers for triggering a ProtocolFetchAll and
initiating a fragmentation test. Furhermore, ensureHeartbeats also
spawned the forwarders.

So this was quite a mix of functionality, and, furthermore, most of it
related quite closely to the connection actor. So moving the
functionality into that simplifies the code.

In the process we also fix #294.
2014-12-23 22:01:03 +00:00
Neale Swinnerton a411cffe0a fix typo 2014-11-21 11:16:51 +00:00
Matthias Radestock 3fd3ff06b3 update arch docs around pmtu discovery 2014-09-03 15:22:50 +01:00
Matthias Radestock 6f30cf2daf 8 is better than 10
It's quite common for the real pmtu to be 8 less than what was
advertised.
2014-08-26 21:11:24 +01:00
Matthias Radestock e6feefa1fc initial commit 2014-08-18 17:55:26 +01:00