How tinc route traffic when two subnets are identical?
Guus Sliepen
guus at tinc-vpn.org
Thu May 4 18:04:19 CEST 2017
On Thu, May 04, 2017 at 03:45:52PM +0800, Bright Zhao wrote:
> Two remote tinc nodes(A, B) advertised the same route to the Tinc domain, and the local tinc node(C) has two ConnectTo to point to those two remote nodes, and I found, and let’s assume connection from C to A is better than C to B (better latency from ping) :
> 1. when two remote nodes are up, the traffic always send through A
> 2. when A is down, traffic send through B
> 3. when A recovered, traffic send back to A
> 4. when B is down, traffic will go through A
> 5. when B is recovered, traffic not switch to B, instead, still goes on A.
>
> So I would like to know, the underlying mechanism for equal path of Subnet is what? Tinc will test the latency, or something else to make the decision?
It is currently unspecified what tinc will do when you have two nodes
with exactly the same Subnet. The only guarantee currently is that
traffic goes to one of the nodes that is online.
The implementation currently has the effect that, from the set of nodes
that is online, tinc will choose the one that has the lowest Name (when
sorted alphabetically). So if both A and B are up, A will always be
preferred, because "A" sorts before "B". However, please do not rely on
this. In the future, this might change to route towards the closest
node.
In general, tinc tries its best to ensure that traffic reaches *a*
destination node, but it does not spend much effort in finding out what
the *best* node is if there are multiple possibilities, and similarly
when routing traffic to a given node, it tries its best to find *a*
working path to it, but not necessarily the *best* path (although it
does favor direct connections, which are *usually* optimal).
--
Met vriendelijke groet / with kind regards,
Guus Sliepen <guus at tinc-vpn.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20170504/536478c0/attachment.sig>
More information about the tinc
mailing list