Commit graph

319 commits

Author SHA1 Message Date
thorkill
557adb0695 Merged new env 2017-04-11 16:09:03 +02:00
Pacien TRAN-GIRARD
7a54fe5e88
Add fd_device 2017-03-01 21:34:37 +01:00
Guus Sliepen
e59bfd024f Remove the description of the LocalDiscoveryAddress option from the manual.
This option is no longer implemented.
2017-02-19 00:03:39 +01:00
Guus Sliepen
4a45a65fe2 Remove the description of the LocalDiscoveryAddress option from the manual.
This option is no longer implemented.
2017-02-14 20:51:43 +01:00
thorkill
04cac1f462 Typo in tinc.conf 2016-05-25 22:48:03 +02:00
thorkill
e60657765c Extended man page for tinc.conf to include SLPD
References: 43ed440176
2016-05-23 22:54:54 +02:00
thorkill
4be26caf4e Merge remote-tracking branch 'guus/1.1' into thkr-foor2Vup 2016-05-08 15:58:29 +02:00
Guus Sliepen
6805b15731 Move documentation of invitations to the manual. 2016-04-23 16:28:12 +02:00
Guus Sliepen
b2200f2166 Document how invitation files work.
This should eventually be merged in to tinc.texi.
2016-04-16 22:06:47 +02:00
Guus Sliepen
d704a89ecc Add version_git.h and sample-config.tar.gz to CLEANFILES. 2016-04-15 11:00:14 +02:00
Guus Sliepen
9527622abc Enable silent builds by default.
Cleaner build messages make it easier to spot compiler warnings and errors.
Use make V=1 to get the verbose output back.

# Conflicts:
#	configure.ac
#	doc/Makefile.am
2016-04-11 15:07:23 +02:00
Guus Sliepen
413faffca3 Update links in the documentation.
# Conflicts:
#	doc/tinc.conf.5.in
#	doc/tinc.texi
#	src/avl_tree.c
#	src/avl_tree.h
2016-04-11 14:58:27 +02:00
Guus Sliepen
5cbc12b3d4 Explicitly mention that LibreSSL can be used as well.
# Conflicts:
#	doc/tinc.texi
#	m4/openssl.m4
2016-04-11 14:55:23 +02:00
Guus Sliepen
d7f6737cfc Update support for BSD tun/tap devices, add support for OS X utun interfaces. 2016-04-11 14:49:51 +02:00
Guus Sliepen
e3f80e9167 Small fixes for the documentation.
# Conflicts:
#	doc/tinc.texi
2016-02-28 16:36:15 +01:00
Guus Sliepen
72cfd4f047 Clarify that scripts are called synchronously.
# Conflicts:
#	doc/tinc.conf.5.in
#	doc/tinc.texi
2016-02-28 16:35:21 +01:00
Guus Sliepen
d8ca00fe40 Add the ability to sign and verify files. 2016-01-27 00:09:29 +01:00
thorkill
2ec9f1124d Merged with guus/1.1 2015-11-24 17:01:11 +01:00
Etienne Dechamps
513bffe1fe Add UPnP support to tincd.
This commit makes tincd capable of discovering UPnP-IGD devices on the
local network, and add mappings (port redirects) for its TCP and/or UDP
port.

The goal is to improve reliability and performance of tinc with nodes
sitting behind home routers that support UPnP, by making it less reliant
on UDP Hole Punching, which is prone to failure when "hostile" NATs are
involved.

The way this is implemented is by leveraging the libminiupnpc library,
which we have just added a new dependency on. We use pthread to run the
UPnP client code in a dedicated thread; we can't use the tinc event loop
because libminiupnpc doesn't have a non-blocking API.
2015-11-21 16:17:59 +00:00
Dato Simó
7ed34ab7a0 Fix typo in tinc.texi. 2015-06-26 20:11:31 +02:00
Dato Simó
7f020cf456 Fix typo in tinc.texi. 2015-06-16 20:53:16 -03:00
thorkill
9bf36c8666 Merge branch '1.1' of github.com:gsliepen/tinc into thkr-1.1-ponyhof 2015-05-26 12:57:15 +02:00
Guus Sliepen
537a936671 Update copyright notices. 2015-05-21 11:09:01 +02:00
thorkill
26c7ff7fdd fixed conflict in src/sptps.c 2015-05-20 14:34:10 +02:00
Guus Sliepen
58e8f598f3 Allow dumping a list of outstanding invitations.
This dumps the name of the invitation file, as well as the name of the
node that is being invited. This can make it easier to find the
invitation file belonging to a given node.
2015-05-20 00:12:01 +02:00
thorkill
35af740537 Merge branch '1.1' of github.com:gsliepen/tinc into thkr-1.1-ponyhof 2015-05-12 17:28:29 +02:00
Etienne Dechamps
13f9bc1ff1 Add support for out-of-tree ("VPATH") builds.
This fixes some issues with the build system when building out of tree.

With this commit, it is now possible to do the following:

    $ cd /tmp/build
    $ /path/to/tinc/configure
    $ make
2015-05-09 16:41:48 +01:00
thorkill
0fc873a161 Merge branch '1.1' into thkr-1.1-ponyhof 2015-04-16 10:44:01 +02:00
Guus Sliepen
95921696a4 Always call res_init() before getaddrinfo().
Unfortunately, glibc assumes that /etc/resolv.conf is a static file that
never changes. Even on servers, /etc/resolv.conf might be a dynamically
generated file, and we never know when it changes. So just call
res_init() every time, so glibc uses up-to-date nameserver information.

Conflicts:
	src/have.h
	src/net.c
	src/net_setup.c
2015-04-12 15:42:48 +02:00
thorkill
0cd387fd90 This commit implements average RTT estimation based on PING-PONG between active TCP connections.
Average RTT can be used to update edge weight and propagate it to the network.
tinc dump edges has been also extended to give the current RTT.
New edge weight will change only if the config has EdgeUpdateInterval set to other value than 0.

- Ignore local configuration for editors
- Extended manpage with informations about EdgeUpdateInterval
- Added clone_edge and fixed potential segfault when b->from not defined
- Compute avg_rtt based on the time values we got back in PONG
- Add avg_rtt on dump edge
- Send current time on PING and return it on PONG
- Changed last_ping_time to struct timeval
- Extended edge_t with avg_rtt
2015-04-11 15:27:28 +02:00
Etienne Dechamps
7027bba541 Increase the ReplayWindow default from 16 to 32.
As a rule, it seems reasonable to make sure that tinc operates correctly
on at least 1G links, since these are pretty common. However, I have
observed replay window issues when operating at speeds of 600 Mbit/s and
above, especially when the receiving end is a Windows system (not sure
why). This commit increases the default so that this won't occur on
fresh setups.
2015-03-15 18:04:58 +00:00
Etienne Dechamps
94f49a163a Set the default for UDPRcvBuf and UDPSndBuf to 1M.
It may not be obvious, but due to the way tinc operates (single-threaded
control loop with no intermediate packet buffer), UDP send and receive
buffers can have a massive impact on performance. It is therefore of
paramount importance that the buffers be large enough to prevent packet
drops that could occur while tinc is processing a packet.

Leaving that value to the OS default could be reasonable if we weren't
relying on it so much. Instead, this makes performance somewhat
unpredictable.

In practice, the worst case scenario occurs on Windows, where Microsoft
had the brillant idea of making the buffers 8K in size by default, no
matter what the link speed is. Considering that 8K flies past in a
matter of microseconds on >1G links, this is extremely inappropriate. On
these systems, changing the buffer size to 1M results in *obscene*
raw throughput improvements; I have observed a 10X jump from 40 Mbit/s
to 400 Mbit/s on my system.

In this commit, we stop trusting the OS to get this right and we use a
fixed 1M value instead, which should be enough for <=1G links.
2015-03-15 18:04:55 +00:00
Etienne Dechamps
76a9be5bce Throttle the rate of MTU_INFO messages.
This makes sure MTU_INFO messages are only sent at the maximum rate of
5 per second (by default). As usual with these "probe" mechanisms, the
rate of these messages cannot be higher than the rate of data packets
themselves, since they are sent from the RX path.
2015-03-14 13:39:05 +00:00
Etienne Dechamps
467397f25d Throttle the rate of UDP_INFO messages.
This makes sure UDP_INFO messages are only sent at the maximum rate of
5 per second (by default). As usual with these "probe" mechanisms, the
rate of these messages cannot be higher than the rate of data packets
themselves, since they are sent from the RX path.
2015-03-14 13:39:05 +00:00
Guus Sliepen
04fc19112d Merge remote-tracking branch 'seehuhn/1.1' into 1.1 2015-03-14 11:45:55 +00:00
Jochen Voss
19d16e40cc Add a new --syslog option for tincd.
This commit adds a new command line option for tincd which allows to
use tincd in non-detached mode with log messages still going to
syslog.  The motivation for this change is to ease use of tincd
in Docker containers.
2015-03-13 11:05:22 +00:00
Guus Sliepen
833a8a048b Document that --force should precede commands. 2015-02-16 08:26:49 +01:00
Guus Sliepen
4b2ddded2c Make "tinc add" idempotent.
When calling "tinc add" multiple times with the same variable and value,
make sure only one unique line is added to the configuration file.
2015-02-09 15:23:59 +01:00
Guus Sliepen
268e3ffca7 Add the "fsck" command to the CLI.
This will report possible problems in the configuration files, and in
some cases offers to fix them.

The code is far from perfect yet. It expects keys to be in their default
locations, it doesn't check for Public/PrivateKey[File] statemetns yet.
It also does not correctly handle Ed25519 public keys yet.
2015-01-15 23:06:38 +01:00
Etienne Dechamps
07108117ce Use a different UDP discovery interval if the tunnel is established.
This introduces a new configuration option,
UDPDiscoveryKeepaliveInterval, which is used as the UDP discovery
interval once the UDP tunnel is established. The pre-existing option,
UDPDiscoveryInterval, is therefore only used before UDP connectivity
is established.

The defaults are set so that tinc sends UDP pings more aggressively
if the tunnel is not established yet. This is appropriate since the
size of probes in that scenario is very small (16 bytes).
2015-01-03 10:12:36 +00:00
Etienne Dechamps
88026f2771 Move responsibility for local discovery to UDP discovery.
Since UDP discovery is the place where UDP feasibility is checked, it
makes sense to test for local connectivity as well. This was previously
done as part of PMTU discovery.
2015-01-01 17:40:15 +00:00
Etienne Dechamps
7939ee1283 Add UDP discovery mechanism.
This adds a new mechanism by which tinc can determine if a node is
reachable via UDP. The new mechanism is currently redundant with the
PMTU discovery mechanism - that will be fixed in a future commit.

Conceptually, the UDP discovery mechanism works similarly to PMTU
discovery: it sends UDP probes (of minmtu size, to make sure the tunnel
is fully usable), and assumes UDP is usable if it gets replies. It
assumes UDP is broken if too much time has passed since the last reply.

The big difference with the current PMTU discovery mechanism, however,
is that UDP discovery probes are only triggered as part of the
packet TX path (through try_tx()). This is quite interesting, because
it means tinc will never send UDP pings more often than normal packets,
and most importantly, it will automatically stop sending pings as soon
as packets stop flowing, thereby nicely reducing network chatter.

Of course, there are small drawbacks in some edge cases: for example,
if a node only sends one packet every minute to another node, these
packets will only be sent over TCP, because the interval between packets
is too long for tinc to maintain the UDP tunnel. I consider this a
feature, not a bug: I believe it is appropriate to use TCP in scenarios
where traffic is negligible, so that we don't pollute the network with
pings just to maintain a UDP tunnel that's seeing negligible usage.
2015-01-01 17:40:15 +00:00
Guus Sliepen
db465434e2 Add BroadcastSubnet and DeviceStandby options to the manual and completion. 2014-12-27 09:20:46 +01:00
Etienne Dechamps
7bf61575fe Add documentation about using system-assigned ports.
There are two caveats to be aware of which are documented in this
commit:

 - Because the system will likely assign different ports when binding
   several times to different address families, it is recommended to
   only use a single address family, otherwise other nodes will only
   get one port among the several that were assigned, possibly breaking
   communication.

 - AutoConnect won't work in this scenario, because it relies on the UDP
   port being the same as the TCP port, which is not the case when using
   system-assigned ports.
2014-07-12 22:13:43 +02:00
Baptiste Jonglez
2f4075f7da Fix typos in the manual page 2014-07-08 14:22:40 +02:00
Etienne Dechamps
116f2ed27a Make IPv4 multicast space 224.0.0.0/4 broadcast by default.
We already do this for IPv6 multicast space (ff00::/8), so why not
extend it to IPv4.
2014-06-29 16:48:57 +01:00
Etienne Dechamps
46a5aa0d67 Make broadcast addresses configurable.
This adds a new option, BroadcastSubnet, that allows the user to
declare broadcast subnets, i.e. subnets which are considered broadcast
addresses by the tinc routing layer. Previously only the global IPv4
and IPv6 broadcast addresses were supported by virtue of being
hardcoded.

This is useful when using tinc in router mode with Ethernet virtual
devices, as it can be used to provide broadcast support for a local
broadcast address (e.g. 10.42.255.255) instead of just the global
address (255.255.255.255).

This is implemented by removing hardcoded broadcast addresses and
introducing "broadcast subnets", which are subnets with a NULL owner.
By default, behavior is unchanged; this is accomplished by adding
the global broadcast addresses for Ethernet, IPv4 and IPv6 at start
time.
2014-06-29 16:48:57 +01:00
Etienne Dechamps
498f1b1d58 Enable LocalDiscovery by default.
Recent improvements to the local discovery mechanism makes it cheaper,
more network-friendly, and now it cannot make things worse (as opposed
to the old mechanism). Thus there is no reason not to enable it by
default.
2014-06-29 11:24:36 +01:00
Etienne Dechamps
4159108971 Remove broadcast-based local discovery mechanism.
The new local address based local discovery mechanism is technically
superior to the old broadcast-based one. In fact, the old algorithm
can technically make things worse by e.g. sending broadcasts over the
VPN itself and then selecting the VPN address as the node's UDP
address. This cannot happen with the new mechanism.

Note that this means old nodes that don't send their local addresses in
ADD_EDGE messages can't be discovered, because there is no address to
send discovery packets to. Old nodes can still discover new nodes by
sending them broadcasts, though.
2014-06-29 11:24:36 +01:00
Etienne Dechamps
e16ade874d Use edge local addresses for local discovery.
This introduces a new way of doing local discovery: when tinc has
local address information for the recipient node, it will send local
discovery packets directly to the local address of that node, instead
of using broadcast packets.

This new way of doing local discovery provides numerous advantages compared to
using broadcasts:

 - No broadcast packets "polluting" the local network;

 - Reliable even if the sending host has multiple network interfaces (in
   contrast, broadcasts will only be sent through one unpredictable
   interface)

 - Works even if the two hosts are not on the same broadcast domain. One
   example is a large LAN where the two hosts might be on different local
   subnets. In fact, thanks to UDP hole punching this might even work if
   there is a NAT sitting in the middle of the LAN between the two nodes!

 - Sometimes a node is reachable through its "normal" address, and via a
   local subnet as well. One might think the local subnet is the best route
   to the node in this case, but more often than not it's actually worse -
   one example is where the local segment is a third party VPN running in
   parallel, or ironically it can be the local segment formed by the tinc
   VPN itself! Because this new algorithm only checks the addresses for
   which an edge is already established, it is less likely to fall into
   these traps.
2014-06-29 11:23:32 +01:00