Commit Graph

886 Commits

Author SHA1 Message Date
f69454ec98 (1) Make ZT_ naming convention consistent (get rid of ZT1_), (2) Make local interface a full sockaddr_storage instead of an int identifier, which turns out to be better for multi-homing and other uses. 2015-09-24 16:21:36 -07:00
0e5aac6a11 Prefer IPv6 paths if available. 2015-09-23 16:16:36 -07:00
a3ed5277ef Make sure ZT_NO_TYPE_PUNNING also obeyed here. 2015-09-23 14:09:27 -07:00
2a527ea82e Fix for timer jitter problem. 2015-09-23 14:01:41 -07:00
367ffde00c Plumb through localInterfaceId to track local interfaces corresponding with remote addresses. 2015-09-23 13:49:56 -07:00
4464fa5d39 Eliminate another warning. 2015-09-23 10:29:05 -07:00
86996d4315 Eliminate compiler warning. 2015-09-23 10:27:53 -07:00
d656e87395 Send a random small payload for NAT keepalives, since zero byte packets seem to fail to keep associations alive behind some NATs. 2015-09-22 15:58:00 -07:00
3664966340 Generate local IPv6 addresses from network IDs and addresses. 2015-09-17 21:30:32 -07:00
c1a53a2653 ARP cache and responder agent code for use in netcon and iOS. 2015-09-11 11:45:04 -07:00
0d386f1c31 Add a bit of useful testing instrumentation to SqliteNetworkController. 2015-09-08 11:35:55 -07:00
85b90f122a Final std::map<> from Switch, and add some smallish default values for hash size. 2015-09-04 15:35:43 -07:00
3dba016a93 Almost done... very few std::map<>s remaining in any spot that matters. 2015-09-04 15:21:22 -07:00
db0369e9b8 Remove way-overkill multimap from Switch. 2015-09-04 14:56:39 -07:00
0ab3e49be9 Starting in on Switch... kill map in defrag queue, which will probably improve performance pretty decently under high load with lots of peers. 2015-09-04 14:44:22 -07:00
f116c4b9c0 ... and another ... 2015-09-04 14:24:31 -07:00
307e44f7c8 Two for one! (std::map removal) 2015-09-04 14:14:32 -07:00
d1341578d8 ... and another one! 2015-09-04 13:53:48 -07:00
7b8ce16057 Another std::map<> dies. 2015-09-04 13:42:19 -07:00
3a959a7763 Swap out std::map<> for Hashtable<> for main peer database in Topology. (ongoing std::map-ectomy) 2015-09-04 12:14:21 -07:00
cfd101c9b8 Add entries() to go with keys() for future use. 2015-09-04 11:50:12 -07:00
da9a720c3f Hash table bug fix, and add copy constructor and assignment operator for principle of least surprise. 2015-09-03 17:33:06 -07:00
b11ffc9635 Integrate Hashtable into Multicaster, where @mwarning found heaviest std::map() overhead. 2015-08-27 16:17:21 -07:00
3947807b1f A simple and fast Hashtable, tested but not yet integrated with anything. 2015-08-27 15:36:13 -07:00
5fcef91278 Ignore old root-topology if present -- fix for upgrading on Linux and possibly elsewhere. 2015-08-25 09:42:37 -07:00
facb009a1d Add security notice to auto-update info in -h output, and fix a missing paren. 2015-07-31 09:50:55 -07:00
8d09c37140 Remove a bit of redundant logic, and also announce MULTICAST_LIKEs to controllers (for future use). 2015-07-31 09:37:13 -07:00
f6ced547be Dead code removal. 2015-07-31 08:56:31 -07:00
eea8d58afa docs,cleanup 2015-07-28 12:39:03 -07:00
21e6850722 Cancel NAT-t attempts if peer is no longer "alive" 2015-07-28 12:18:59 -07:00
5986d83738 Kill more kittens. 2015-07-28 12:04:14 -07:00
4564dd95ff Revert... no luck with any of that. 2015-07-28 12:00:50 -07:00
d2bfdfa6e7 Play with NAT-t tweaks some more. 2015-07-28 11:57:18 -07:00
b69afa010e Disable type punning on ARM by ifdef. 2015-07-28 11:50:01 -07:00
708aac1ea7 Remove some left over debug code, and fix attempt to send to self if we are an active bridge. 2015-07-28 11:43:09 -07:00
17bfd4d55e Add TRACE for NAT-t debugging. 2015-07-28 11:32:34 -07:00
b31071463c Try another NAT traversal improvement. 2015-07-28 11:28:47 -07:00
dda376c9eb Nuke some abandoned code. 2015-07-28 11:16:43 -07:00
821f1f366e Fix to NAT escalation sequence. 2015-07-27 17:34:58 -07:00
e99eda4a4a Fix IP scoping bug, and disable remotely reported surface push... not helping. :( 2015-07-27 17:28:13 -07:00
fadb291962 Fix infinite loop typo. 2015-07-27 17:14:49 -07:00
f0003ea922 Push remote surface as reported by peers along with known interface direct paths to assist with (some) NAT traversal. (trying this, may back out if not effective) 2015-07-27 17:02:43 -07:00
e30ba3e138 Eliminate some aggressive port scanning NAT-t behavior that has proven ineffective. 2015-07-27 16:43:27 -07:00
7a15d8a7e3 Fix leaving of networks to actually call Network::destroy(). 2015-07-24 14:50:44 -07:00
d647a587a1 (1) Fix updating of network revision counter on member change.
(2) Go back to timestamp as certificate revision number. This is simpler
    and more robust than using the network revision number for this and
    forcing network revision fast-forward, which could cause some peers
    to fall off the horizon when you don't want them to.
2015-07-23 17:18:20 -07:00
b3516c599b Add a rate limiting circuit breaker to the network controller to prevent flooding attacks and race conditions. 2015-07-23 10:10:17 -07:00
3ba54c7e35 Eliminate some poorly thought out optimizations from the netconf/controller interaction,
and go ahead and bump version to 1.0.4.

For a while in 1.0.3 -dev I was trying to optimize out repeated network controller
requests by using a ratcheting mechanism. If the client received a network config
that was indeed different from the one it had, it would respond by instantlly
requesting it again.

Not sure what I was thinking. It's fundamentally unsafe to respond to a message
with another message of the same type -- it risks a race condition. In this case
that's exactly what could happen.

It just isn't worth the added complexity to avoid a tiny, tiny amount of network
overhead, so I've taken this whole path out.

A few extra bytes every two minutes isn't worth fretting about, but as I recall
the reason for this optimization was to save CPU on the controller. This can be
achieved by just caching responses in memory *there* and serving those same
responses back out if they haven't changed.

I think I developed that 'ratcheting' stuff before I went full time on this. It's
hard to develop stuff like this without hours of sustained focus.
2015-07-23 09:50:10 -07:00
8c18c60c00 sp. 2015-07-17 15:30:13 -07:00
88949a750f Workaround for uclibc missing map::operator==() 2015-07-13 11:39:55 -07:00
547b1c6157 Add additional TRACE output in pushDirectPaths. 2015-07-13 10:35:33 -07:00