Comments (5)
Because tinc doesn't know how your network interfaces are configured. This is done on purpose: it simplifies the code, and it actually makes tinc much more flexible. The Subnet
statements indicate which subnets belong to which nodes. That information is exchanged between nodes, so that if one node receives a packet from its local tun/tap interface, it can look at the desination IP address, and find out which node owns the Subnet
that best matches that address, and then send the packet to it. Note also that you can have multiple Subnet
statements in a given host configuration file.
from tinc.
There might be some confusion here; "router mode" has nothing to do with the routing protocol that tinc uses internally to route packets between nodes. The same routing protocol is also used in switch and hub modes. What Mode
does is change the way how tinc decides the destination node based in the header of the packet received from the tun/tap device. In router mode, it uses a routing table, the same as you see when you type ip route show
or netstat -r
. You can see this routing table by giving the command tinc -n $NETNAME dump subnets
.
Tinc tries to send packets directly to the destination node. Only if that is not possible will it try to route it via intermediate nodes. The routing protocol used for that is a link-state routing protocol. From the link state it derives the shortest paths using Dijkstra's algorithm, and a minimum spanning tree using Kruskal's algorithm. The latter is used to handle broadcast packets.
from tinc.
Many thanks for the answer!
I have one more question (I hope it's not too stupid): If a routing protocol is used, why is it necessary to specify Subnet =
in the host configuration files?
from tinc.
Thanks for the further answer! I took another look at Tinc today and apparently had a misunderstanding. I thought each node had to manually configure the subnets from every other node it is connected to. However, you only have to configure the subnet for your own node.
from tinc.
Hi, I still have a question regarding the 'switch' mode:
The documentation states that Tinc can be bridged with other Ethernet segments, i.e. that Tinc can dynamically learn MAC addresses.
Does this not contradict the fact that these are specified via subnet
?
How does Tinc learn these MAC addresses dynamically? I guess whenever a node sends out an Ethernet frame from itself, it sends the source address in an ADD_SUBNET
message?!
Where are the first packets sent (if the destination is not known)? I guess a broadcast to all nodes?!
If there is MACExpire
: Is the MAC address deleted at each node individually on or does the node with the ADD_SUBNET message send a DEL_SUBNET
message when its MACExpire timer expires?
from tinc.
Related Issues (20)
- Got bad ID from <unknown> HOT 2
- Error joining to Linux node from Windows
- this page is broken. https://www.tinc-vpn.org/examples/ipv6-network/ HOT 1
- Relaying doesn't work when TCPOnly is enabled
- Performance improvements via TSO/GRO and UDP_SEGMENT HOT 4
- Please add time when you output the log. There are too many retry link logs but do not know the time. HOT 1
- Peer has an invalid key! on tinc join
- DNS failure and delays break connections HOT 1
- Is the project still being maintained? HOT 20
- [Bug] Adding a simple failing test case for sssp_bfs() HOT 3
- zip build HOT 3
- Invitation-generated tinc-up tries to set address/route before bringing up interface
- Handling 100+ groups? (+1 master) HOT 1
- server can not exchange the server‘s host HOT 1
- Peer tries to roll back protocol version to 17.0, Error while processing ID
- have the ability to compile with mbed-tls
- Question: Is there a limit/impact of huge amount of Subnet announcement?
- Compile with miniupnpc 2.2.8 fails
- systemd tinc.service gone after installing deb from Release section.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinc.