Commit Graph
1218 Commits
Author SHA1 Message Date
Adam Harrison bae6865e33 Rename URL parameter 2015-03-18 11:45:04 +00:00
Adam Harrison bd7b232663 Replace hand parsing and validation of URLs with Gorilla mux 2015-03-18 10:10:13 +00:00
Matthias Radestock d5eb76f32e replace Peer.ForEachConnection with Peer.Connections
The former is prone to triggering deadlocks since the lock is held on
the peer during the iteration.
2015-03-17 16:24:19 +00:00
Matthias Radestock 08a08be370 cosmetic 2015-03-17 15:11:28 +00:00
Bryan Boreham 8f139bcb52 Merge pull request #461 from rade/454_send_all_gossip_to_new_peers_only
LGTM.  Fixes #454
2015-03-17 13:47:49 +00:00
Matthias Radestock dbc683f891 send all gossip to new peers only
Weave sends all gossip down new connections. We do this so that new
peers learn about all gossip'ed information quickly, thus enabling
them to process subsequent incremental updates. In particular, for
topology gossip it ensures that the remote peer learns about all other
peers. This ensures that the incremental update, which is sent as a
result of the new connection getting established and which may
reference a number of other peers, can be processed.

So the intent really is to send all gossip to new peers. But what we
actually do is send it down every new connection. Not every new
connection is from a new peer. In fact most connections aren't. Hence
the current approach is wasteful.

To fix this we need a conservative detection of new peers, i.e. it is
preferable to have false positives. This contrasts with existing logic
in the handshake code. The criteria we use is whether our peer has a
unicast route to the other peer. That is only the case when there is a
continuos chain of symmetric, established connections. The
establishment of these connections should have triggered the sending
of all gossip to the other peer. So we don't need to send it ourself.

Fixes #454.
2015-03-16 17:46:01 +00:00
Adam Harrison 8f8719c298 Correct typo in log message 2015-03-16 17:36:56 +00:00
Matthias Radestock a85d447f01 Merge branch 'dpw-441_slow_arp_fixes'
Fixes #441.
2015-03-16 15:33:41 +00:00
Matthias Radestock 2369b43c8d cosmetic: move new funs to 'right' place 2015-03-16 15:33:05 +00:00
Matthias Radestock c77a7032db Merge branch '441_slow_arp_fixes' of https://github.com/dpw/weave into dpw-441_slow_arp_fixes 2015-03-16 15:31:59 +00:00
David Wragg 4dcf77c210 Commentary 2015-03-16 15:12:44 +00:00
David Wragg 39011a5218 Don't clean up the container interface after moving it into the netns
The most likely cause of failure is the container going away, in which.
case we don't need to clean up.  And there are other points of possible
failure in the same category in attach(), so making sure we clean up the
container interface under all conditions is a  broader issue.
2015-03-16 15:12:44 +00:00
David Wragg e844753a21 Don't duplicate ARP cache configuration 2015-03-16 15:12:44 +00:00
David Wragg 78b0a57007 Send an unsolicited ARP response when a container attaches
Using arping, which is part of the iputils package and so seems to
be ubiquitous.
2015-03-16 15:12:44 +00:00
David Wragg 9b62bcb75d Don't need to use sed to get the IP address part of a CIDR 2015-03-16 15:12:44 +00:00
David Wragg 7a8a7010e2 Refactor for uniform handling of CIDRs
Not quite a pure refactoring because it adds a missing
'validate_cidr'.
2015-03-16 15:12:44 +00:00
David Wragg 11af544071 Configure ARP cache to react more quickly to MAC address changes
When an IP address was reused by a new container, other containers
could experience delays of many seconds the first time they tried to
talk to that new container before successful communication would
occur.  This delay came from three sources related to ARP cache
behaviour:

- The kernel would take a while to decide that an ARP mapping was
  stale due to lack of positive evidence (due to the
  base_reachable_time default of 30s)

- Even once an ARP mapping was considered stale, the kernel would wait
  a few seconds before sending an ARP request, in the hope that a
  higher layer (e.g. TCP) would confirm the ARP entry (due to the
  delay_first_probe default of 5s)

- When the kernel sent out an ARP request to update a stale entry,
  initial attempts would unicast the request to the old MAC address
  before resorting to broadcast (due to the ucast_solicit default of
  3)

This change reduces all these values, so that any delays
are a few seconds.

For most workloads, this should not greatly increase the amount
of ARP traffic, because communication via TCP is often sufficient
to confirm ARP entries.  And one unicast ARP request is still sent
just in case.

Unfortunately, there's a fixed-but-only-recently bug in the kernel
that means that changing base_reachable_time can take a while to take
effect:
<https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4bf6980dd0328530783fd657c776e3719b421d30>.
This means that a container will continue to use a long reachable_time
delay for the first few minutes of its life.
2015-03-16 15:12:27 +00:00
Michael Bridgen 3c1075459f Switch VirtualBox DNS proxying and host resolver off
While those helped with some issues, the proxying is substantially
broken and the smoke tests wouldn't pass.
2015-03-16 15:06:30 +00:00
rade d65d4776da Merge pull request #459 from tomwilkie/master
Typo in sites page for building weave
2015-03-16 15:03:07 +00:00
Tom Wilkie 475a90bcdd Typo in sites page for building weave 2015-03-16 14:45:51 +00:00
David Wragg e8ed9c707d Refactor 2015-03-16 10:46:24 +00:00
Michael Bridgen 9eeec2fa48 Restore use of DNS from Vagrant VMs
These incantations are said to fix DNS on Vagrant VMs running with a
private network.
2015-03-12 14:39:25 +00:00
Bryan Boreham cce6175a5c Merge pull request #453 from rade/452_only_broadcast_on_established
LGTM.  Fixes #452 - those messages go away entirely in my tests.
2015-03-12 11:27:34 +00:00
rade 0d5562a5b6 Merge pull request #451 from bboreham/448_reduce_conns
Avoid many pointless connection attempts

Fixes #448.
2015-03-11 14:04:25 +00:00
Bryan Boreham 8e274328b6 Do try standard port on inbound connections 2015-03-11 14:01:43 +00:00
Bryan Boreham d87e13b999 Re-order Connection fields more consistently 2015-03-11 14:01:07 +00:00
Matthias Radestock 1ceb041bc5 exclude non-established connections from broadcast routing
We already excluded such connections from unicast routing.

Fixes #452.
2015-03-11 13:26:40 +00: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
Matthias Radestock 6f89ead9bd log all connection lifecycle events on local peer
There were situations, such as deleting another connection as result
of it losing a tie-break, where lifecycle events of connections on the
local peer weren't logged.

Fixing that entails moving the logging closer to (i.e. right after)
the state change action. This in turn requires promotion of logging to
the Connection interface instead of it LocalConnection. Which in turn
requires a change from 'log' to 'Log', for consistency with other
interface methods.

Fixes #449.
2015-03-10 14:42:18 +00:00
Matthias Radestock 123e8bbb28 reduce likelihood of IP clashes in tests & examples
by using the 10.2 range, which is not one used by docker and also is
less likely than 10.0 to be used by something else.

Fixes #402.
2015-03-09 20:51:26 +00:00
Matthias Radestock abb1c6c781 refactor(ish): push down some error handling in router 2015-03-06 14:51:39 +00:00
rade 0f7f49d3be Merge pull request #433 from dpw/419_broadcast_frametoobigerror
Do not inject ICMP "fragmentation needed" for broadcast packets.

It's a contravention of RFC1122 and also breaks weave routing due to producing packets with broadcast addresses as the source.

Fixes #419.
2015-03-06 14:37:10 +00:00
Michael Bridgen b38af84368 Merge pull request #435 from fintanr/434
Update README with CoreOS install instructions.
Closes #434.
2015-03-06 14:36:15 +00:00
David Wragg 2f7e0b5cad Simplify version printing 2015-03-06 11:15:24 +00:00
Fintan Ryan 911a3492b2 434 Update README with CoreOS install instructions 2015-03-06 10:01:14 +00:00
Michael Bridgen 6404ac30b9 Minor improvements to vagrant VMs
* disable the default Vagrant shared folder, which we don't need
 * install `bc` on the dev VM, since it's needed by the smoke tests
 * expose the dev VM docker on TCP, for convenience
2015-03-05 16:30:50 +00:00
Matthias Radestock a00f67cf06 use correct API for figuring out whether crypto is enabled 2015-03-05 15:51:54 +00:00
David Wragg 5b66daf1e4 Remove some layers of indirection around FrameTooBigError handling 2015-03-05 15:13:30 +00:00
David Wragg e543bff1ba Don't propagate errors from RelayBroadcast
If forwarding of a broadcast frame resulted in a FrameTooBigError, we
would generate an ICMP "fragmentation needed" packet that contravened
RFC1122 on two counts: First, we should not produce a ICMP error
message in response to a broadcast/multicast packet.  Secondly, we
should not produce an IP packet with a broadcast/multicast source IP
address.  (It also gave an ethernet frame with a broadcast source MAC,
which probably contravenes some IEEE spec.)

So when RelayBroadcast gets a FrameTooBigError, it should just drop
the packet.

Futhermore, if we fail to relay a broadcast on one connection, that's
not a good reason to give up entirely - we can proceed to attempt to
relay on the other next hop connections.  Errors other than
FrameTooBigError that propagated upwards were simply logged, so that
logging is moved down into RelayBroadcast.
2015-03-05 15:13:29 +00:00
David Wragg 619ebc20a8 Don't pass password around as a pointer to a slice
A slice can be nil, so there is no reason for extra indirection to
represent the lack of a password.
2015-03-05 14:19:54 +00:00
David Wragg cda6b8d582 Fix a few deviations from go fmt 2015-03-05 13:56:21 +00:00
Matthias Radestock 6c82f781cd trim some logging from tests 2015-03-02 17:02:10 +00:00
Matthias Radestock 6d69ac5532 refactor and tweak dns tests
- extract helper function
- use "lots and lots of MX records" instead of "lots of TXT records"
  for testing large response
- calculate on the fly the number of records we need to generate a
  large response
- don't hardcode "weave.works"
2015-03-02 16:56:10 +00:00
Michael Bridgen b76e97ac24 Merge branch 'pr394'
Closes #366, again.
2015-02-27 17:02:01 +00:00
Michael Bridgen 1d929263ac Default the localDomain argument from the CLI
Otherwise, the HTTP listener can be given an empty string, and refuse
to record any hosts.
2015-02-27 16:58:47 +00:00
Matthias Radestock 5327c41c82 Allow build to be interrupted.
This was missed in #387.
2015-02-27 16:45:24 +00:00
Bryan Boreham e22b470c3e Add the change from #395, which got lost
`-t` flag creates a tty for the command, so we can interrupt it with Control-C
2015-02-27 16:39:53 +00:00
Michael Bridgen 48ef098518 Merge branch 'pr394': Add localDomain option to weavedns
Improve the DNS server configuration mechanism. The new configuration
system includes the ability to specify a different domain name other
than ".weave.local".
2015-02-27 15:30:49 +00:00
Michael Bridgen 3137e4acdd Smoke test for custom localDomain 2015-02-27 15:29:59 +00:00
Michael Bridgen 35a8a390e7 Merge branch 'weave-366' of https://github.com/inercia/weave into pr394 2015-02-27 15:10:23 +00:00