No connection between nodes on same LAN

Daniel Schall Daniel-Schall at web.de
Tue May 25 15:55:18 CEST 2010


Hey guys,

just wanted to let you know what I planned to implement in the near future:

To make nodes on the same LAN discover each other, we've got two options as
already mentioned (and discussed) before:

1) Sending broadcasts that other nodes pick up and thus notice, there is
another node on the same LAN.
Although this is straightforward to implement and a valid solution to tackle
my original issue, this approach raises another issue.
We would have to agree on a common broadcast port, which is not that easy
when thinking about multiple tinc-daemons on one machine.
Only one daemon would get the broadcast, since only one daemon can listen to
the port the broadcasts will be sent to.
Of course one could argue that each tinc-network specifies a different
broadcast port, but this would have to be a network-specific setting and in
tinc, there seems to be no room for this type of settings.
Therefore, I will stick with option 2:

2) Each node publishes its own private endpoints in the tinc meta-layer like
it publishes information about its edges (ADD_ENDPOINT, DEL_ENDPOINT).
Other Nodes will get this information and check, if they've got an endpoint
on the same network (IP / NETMASK combination).
If so, they will try to connect to the announced endpoint. On success, they
will drop the direct connection to the public endpoint of the host they just
connected to and will use the local endpoint instead for forwarding data
packets.
Otherwise, if the connection fails, they will retry again later, with
increasing intervals.
Changes in the endpoint availability will be sent to the meta-layer and each
node adapts its own connections by reading this information.
So if an endpoint looses it's connectivity, the public address of the node
will be used instead, like a local endpoint had never existed at all.
The meta-connection will not be affected by this approach, only the routing
for data-packets will be using the local endpoints.

For now, I was thinking about a few configuration switches for each host:

LocalAddressAnnounce [yes | no ]
	whether a host will announce its local endpoints or not

LocalAddressConnect [yes | no ]
	wheter a host will connect to local endpoints announced by others

LocalAddressPriority [yes | no ]
	if the local address should always be used to connect to or only if
connections to the public endpoint fail

LocalAddressCheckInterval [ seconds ]
	how often should local interfaces be checked for changes in
connectivity / endpoint address


The details of this approach are yet to work out and I am quite busy with
other stuff. But I hope to get it implemented in a few weeks from now on.
Any comments are welcome.


Best,

Daniel



More information about the tinc mailing list