Commit Graph
22 Commits
Author SHA1 Message Date
Matthias Radestock 3124ffede5 more forward/backward compatible protocol versioning
We now first exchange a very minimal header, consisting of just the
name of the protocol ("weave") and the min and max version (encoded as
a byte each) we support. This leaves all other details of the
protocol, including the contents of of the handshake, open.

Peers agree to communicate using the maximum mutually supported
version. We record this in the LocalConnection, though atm nothing is
making use of that information.

We set a shorter than normal deadline (10s instead of 60s) for the
header exchange, so we detect version mismatches, garbage, or
non-responsive remotes quickly.

We reset the protocol version to '1' since this is a fresh start; old
weaves will not be able to parse the header.

Closes #871.
2015-06-16 11:00:41 +01:00
David Wragg 5ce4b25f38 Merge rade/746_simplify_frag_test (PR #888): simplify fragmentation test
Closes #746.
2015-06-10 18:28:26 +01:00
Bryan Boreham e21f66db0a Use address.Range instead of (start,end) pairs 2015-06-10 17:24:36 +01:00
Bryan Boreham 2553850ed4 Initial implementation of multi-subnet IPAM 2015-06-10 17:21:16 +01:00
Matthias Radestock fbf2208e80 simplify fragmentation test
This is how fragmentation tests used to happen:

    A: conn.stackFrag = false
    A->B: StartFragmentationTest
    B->A: send large non-DF UDP packet
    A->B: FragmentationReceived
    B: conn.stackFrag = true

conn.stackFrag = true means "UDP packets sent to the other peer get
correctly fragmented and re-assembled".

Note how A clears its own stackFrag flag, but the test establishes
whether fragmentation works for B->A, and ends up setting stackFrag on
B. Not only is this weird, it also means that if A previously had
stackFrag=true, it will now start fragmenting packets until B
initiates a fragmentation test.

The new sequence is:

    A: conn.stackFrag = false
    A->B: send large non-DF UDP packet
    B->A: FragmentationReceived
    A: conn.stackFrag = true

Closes #746.
2015-06-10 07:41:37 +01:00
David Wragg 530a39350b Make gossip use channel names on the wire, not channel name hashes 2015-05-27 12:51:14 +01:00
Matthias Radestock dc96fc17a9 correct protocol version
let us not get ahead of ourselves
2015-05-16 01:09:53 +01:00
Bryan Boreham 3cd1a17c23 IP Allocation Management
Using the Ring CRDT and Weave gossip, provides an interface
for the weave script to allocate IP addresses in `weave run`,
`weave start` and `weave expose`.

See docs/ipam.md for implementation details, and site/features.md
for user-visible changes.
2015-05-14 17:44:06 +01:00
Matthias Radestock e223899982 remove nonce transmission from protocol 2015-04-30 14:47:16 +01:00
Matthias Radestock 40d127d9a4 make connection heartbeating independent of periodic gossip
This was a convenient but rather suspect coupling. In particular, it
will break if the period gossip logic changes s.t. it no longer sends
gossip on all connections every interval.
2015-04-09 11:44:13 +01:00
Matthias Radestock f80410bf59 switch to gossip broadcast for topology updates 2015-04-06 14:17:23 +01:00
Bryan Boreham 89fce7f98a Add an 'outbound' field on each connection,
and only attempt new connections to the remote side of outbound connections.
2015-03-11 11:56:47 +00:00
Adam Harrison 8f6a525bde Bump protocol version due to introduction of hostname field 2015-02-19 14:42:26 +00:00
Matthias Radestock f25696c245 prevent premature gc of peers from topology
Topology gossip can be received on a connection before that connection
has been marked as 'established'. If we do not include unestablished
connections in topology gossip, then parts of the topology can be
removed by gc, since they are deemed unreachable, which can cause
subsequent incremental topology gossips to be rejected due to them
containing references to peers that have been removed by the gc.

Including unestablished connections in topology gossip requires:

- removing the check for 'established' connections in the encoding of
  peers for topology gossip,
- adding the 'established' flag to the internal representation of
  remote connections,
- adding the 'established' flag to to encoding of connections in
  topology gossip,
- treating the *addition* of a connection as an update to the local
  peer.

The latter entails

- bumping the peer version on connection addition (as well as on
  marking 'established' as previously),
- bumping the peer version *unconditionally* on connection deletion
  (rather than only when the connection was 'established', as
  previously),
- moving the initial sending of complete topology on the connection,
  and the broadcasting of a topology update containing the two peers
  at the ends of the connection, from the connection 'established'
  logic to the connection addition logic,
- broadcasting just an topology update for the local peer when a
  connection gets marked as 'established',
- broadcasting a topology update for the local peer *unconditionally*
  when a connection is removed (rather than only doing this when the
  connection was 'established', as previously).
2015-02-01 16:52:39 +00:00
Bryan Boreham 5dc9b085a0 Replace previous topology communication with gossip-based mechanism 2015-01-27 12:45:40 +00:00
Bryan Boreham 18df01a4bf Basic gossip implementation 2015-01-27 12:45:40 +00:00
Matthias Radestock c6f5e7ec94 introduce ProtocolSender interface 2015-01-20 23:41:42 +00:00
Matthias Radestock 76e44afdea cosmetic 2015-01-20 23:36:02 +00:00
Matthias Radestock ac95d5ab29 rename and lift ProtocolMsg into API 2015-01-20 23:23:59 +00:00
Matthias Radestock 1181a0cb33 better APIs for sending protocol messages
no longer tagging requiring the caller to construct them
2015-01-20 22:31:16 +00:00
Matthias Radestock 644697977b refactor: make protocol message tags a separate type 2015-01-20 21:51:18 +00:00
Matthias Radestock a1ef2def2b refactor: extract pdu statics into separate file 2015-01-20 21:41:08 +00:00