Giter Site home page Giter Site logo

Comments (5)

gsliepen avatar gsliepen commented on August 20, 2024 1

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.

gsliepen avatar gsliepen commented on August 20, 2024

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.

marek22k avatar marek22k commented on August 20, 2024

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.

marek22k avatar marek22k commented on August 20, 2024

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.

marek22k avatar marek22k commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.