Commit graph

2449 commits

Author SHA1 Message Date
Guus Sliepen
9c878bf56f Remove direct inclusion of OpenSSL headers in net_packet.c and tincd.c. 2013-01-31 16:12:56 +01:00
Guus Sliepen
42b222ecb6 Detect increases in PMTU.
Tinc never restarts PMTU discovery unless a node becomes unreachable. However,
it can be that the PMTU was very low during the initial discovery, but has
increased later. To detect this, tinc now tries to send an extra packet every
PingInterval, with a size slightly higher than the currently known PMTU. If
this packet is succesfully received back, we partially restart PMTU discovery
to find out the new maximum.

Conflicts:
	src/net_packet.c
2013-01-31 16:10:58 +01:00
Guus Sliepen
87416bcd8b Get microsecond time resolution on Windows. 2013-01-21 16:12:18 +01:00
Guus Sliepen
8aadbd4b37 Fix a typo. 2013-01-21 13:59:52 +01:00
Guus Sliepen
3a039ece25 Fix datagram SPTPS.
Commit dd07c9fc1f broke the reception of datagram
SPTPS packets, by undoing the conversion of the sequence number to host byte
order before comparison. This caused error messages like "Packet is 16777215
seqs in the future, dropped (1)".
2013-01-21 13:47:46 +01:00
Guus Sliepen
cc3c69c892 Releasing 1.1pre5. 2013-01-20 21:03:22 +01:00
Guus Sliepen
76dbcf8989 Fix tincctl init when /etc/tinc does not yet exist. 2013-01-20 21:02:58 +01:00
Guus Sliepen
aa46596991 Remove possible definition of timersub(), which is also in dropin.h. 2013-01-20 20:19:08 +01:00
Guus Sliepen
1be7dc759a Make sure PriorityInheritance also works in switch mode.
Conflicts:
	src/route.c
2013-01-20 15:20:52 +01:00
Guus Sliepen
94587264bd Allow connections via UNIX sockets.
This is mainly useful for control connections. The client must still present
the control cookie from the PID file.
2013-01-17 18:12:55 +01:00
Guus Sliepen
2c14123062 Fix compilation of UML and VDE device support. 2013-01-17 16:39:41 +01:00
Guus Sliepen
f5bb64b36a Move make_names() and related variables to its own source file. 2013-01-17 16:39:02 +01:00
Guus Sliepen
a9eba276a4 Handle SIGINT gracefully. 2013-01-17 14:14:17 +01:00
Guus Sliepen
1ddd6111a4 Fix the minimum spanning tree algorithm.
Tinc uses Kruskal's algorithm to calculate a MST. However, this was broken in
commit 6e80da3370. Revert back to the working
algorithm from tinc 1.0.

Thanks to Cheng LI for spotting the problem.
2013-01-17 11:21:18 +01:00
Guus Sliepen
61275547cd Estimate RTT, bandwidth and packet loss between nodes.
Without adding any extra traffic, we can measure round trip times, estimate the
bandwidth and packet loss between nodes. The RTT and bandwidth can be measured
by timing the MTU probe packets. The RTT is the difference between the time a
burst of MTU probes was sent and when the first reply is received. The
bandwidth can be estimated by multiplying the size of the probe packets by the
time between succesive received probe replies of the same burst. The packet
loss can be estimated for incoming traffic by comparing how many packets have
actually been received to the increase in the sequence numbers.

The estimates are not perfect. Especially bandwidth is difficult to measure,
the only accurate way is to continuously send as much data as possible, but
that is obviously not desirable. The packet loss rate is also almost always
a few percent when sending a lot of data over the VPN via TCP, since TCP
*needs* packet loss to work properly.
2013-01-16 16:31:56 +01:00
Guus Sliepen
eef25266cb Count the number of correctly received UDP packets.
Keep track of the number of correct, non-replayed UDP packets that have been
received, regardless of their content. This can be compared to the sequence
number to determine the real packet loss.
2013-01-15 13:33:16 +01:00
Guus Sliepen
b50a92d0c3 Add the tincctl exchange and exchange-all commands.
These are identical to an export/export-all followed by an import, and make
it simpler to exchange host config files with other nodes.
2013-01-15 13:31:51 +01:00
Guus Sliepen
dd07c9fc1f Check HMAC before sequence number. 2013-01-14 13:08:35 +01:00
Guus Sliepen
83a94ab08f Always complain if too many arguments are given for tincctl commands. 2013-01-14 13:02:39 +01:00
Guus Sliepen
50e1790101 Better error messages when using -L, -R or -U on platforms that do not support it. 2013-01-14 13:01:47 +01:00
Guus Sliepen
cad86108f3 Don't complain about garbage if we skipped importing a host file. 2013-01-14 12:59:17 +01:00
Guus Sliepen
c90c431bc9 Mention that the -L, -R and -U options are not supported on all platforms. 2013-01-14 12:58:24 +01:00
Guus Sliepen
5b88f5ba74 Note that tincctl import is only meant to work with data from tincctl export. 2013-01-14 12:57:33 +01:00
Guus Sliepen
bb228e2f05 Note that node Names are case sensitive. 2013-01-14 12:56:54 +01:00
Guus Sliepen
2c7ecdcd0c Fix a typo. 2013-01-14 12:56:14 +01:00
Guus Sliepen
17a0b3a890 Fix support for tunemu on iOS devices.
The actual code was fine but the #ifdefs tested for the wrong preprocessor
variable.

Conflicts:
	src/bsd/device.c
	src/process.c
2012-12-18 16:34:37 +01:00
Guus Sliepen
c26581e29f Fix infinite loop in timeout handling on Windows. 2012-12-07 15:49:21 +01:00
Guus Sliepen
58026f72a1 Fix display of cumulative packet counters. 2012-12-06 16:59:35 +01:00
Guus Sliepen
b300f99dfb Clarify the description of IndirectData and Mode = router. 2012-12-06 16:55:28 +01:00
Guus Sliepen
5b7f42bca4 Releasing 1.1pre4. 2012-12-05 22:32:10 +01:00
Guus Sliepen
4c16094e94 Fix whitespace. 2012-12-05 21:42:43 +01:00
Guus Sliepen
4f8abf1b29 Scale packet counters similar to byte counters. 2012-12-05 21:40:49 +01:00
Guus Sliepen
d5f0ff5df8 Don't use nested functions.
This allows tinc to be compiled with Clang.
2012-12-05 21:33:01 +01:00
Guus Sliepen
eb80105ea8 Fix compiler warnings on OpenBSD. 2012-12-05 14:42:21 +01:00
Guus Sliepen
5e3607b616 Remove GraphDumpFile from the manual and manpages.
This option is not supported in tinc 1.1, "tincctl dump graph" can be used
instead.
2012-12-03 13:09:40 +01:00
Guus Sliepen
a717b9bcfb Add option to dump only a list of reachable nodes. 2012-12-03 13:08:03 +01:00
Guus Sliepen
75c619e372 More fixes for Windows.
In particular, Windows does support many of the timer* macros, except timeradd
and timersub.
2012-12-03 10:41:28 +01:00
Guus Sliepen
d53384c2de Fix compiler error on Windows. 2012-12-03 09:08:21 +01:00
Guus Sliepen
76816e119b Fix crash in timeout handling. 2012-12-03 09:07:23 +01:00
Guus Sliepen
d19b006065 Set a node's pointers to zero before trying to insert it into a tree. 2012-12-03 09:02:08 +01:00
Guus Sliepen
d2b19be1a0 Fix use of unitialised values in hash tables.
Not only was Valgrind unhappy about it, it could also result in cache misses.
2012-11-29 14:35:08 +01:00
Guus Sliepen
d9c70767aa Fix check for expired events.
This would trigger a infinite loop if a timeout expired and the next timeout
was not expired yet, but less than 1 second from being expired.
2012-11-29 14:32:12 +01:00
Guus Sliepen
8825cddd0d Allow multiple timeouts to expire at the exact same time. 2012-11-29 12:37:04 +01:00
Guus Sliepen
6bc5d626a8 Drop libevent and use our own event handling again.
There are several reasons for this:

- MacOS/X doesn't support polling the tap device using kqueue, requiring a
  workaround to fall back to select().
- On Windows only sockets are properly handled, therefore tinc uses a second
  thread that does a blocking ReadFile() on the TAP-Win32/64 device. However,
  this does not mix well with libevent.
- Libevent, event just the core, is quite large, and although it is easy to get
  and install on many platforms, it can be a burden.
- Libev is more lightweight and seems technically superior, but it doesn't
  abstract away all the platform differences (for example, async events are not
  supported on Windows).
2012-11-29 12:28:23 +01:00
Guus Sliepen
d30b9e1272 Ensure MTU probe replies are sent back the same way they came in.
Also sprinkle some comments over mtu_probe_h().
2012-11-19 14:20:50 +01:00
Guus Sliepen
3c1b704733 Improve UDP address selection.
We don't need to search the whole edge tree, we can use the node's own edge
tree since each edge has a pointer to its reverse. Also, we do need to make
sure we try the reflexive address often.
2012-11-19 13:50:17 +01:00
Guus Sliepen
f57129ce34 Try all known addresses of node during PMTU discovery, now also for SPTPS. 2012-11-17 22:48:06 +01:00
Guus Sliepen
30404650b2 Choose a suitable socket when updating a node's UDP address. 2012-11-17 22:14:52 +01:00
Guus Sliepen
8f9ee89522 Also don't use poll() on MacOS/X. 2012-11-15 11:24:18 +01:00
Guus Sliepen
8a77df9e28 Disable support for kqueue on MacOS/X.
Apparently MacOS/X doesn't support kqueue events on character devices.
2012-11-15 11:13:40 +01:00