Add Segment Routing feature

The underlay topology of ZeroTier is simple: Do best to create a p2p connection, if not, using the best quality upstreamer as relay.

But the underlay is the unstable Internet. To provide a more reliable and low latency communication tunnel, I suggest add a Segment Routing like mechenism:

  1. Use a node (maybe controller) to collect all node direct path information (at least the latency), then we got a full topology of all node with weight
  2. periodcally compute the shorted path(like a address1->address2->address3 link list, use SP for short) for every p2p, and push the SP vector back to every node
  3. before sending packet, check the SP vector to find the path, if there is a SP, put the SP in the packet, and send it to the first address
  4. when the node received the remote packet, check whether the packet has SP, if had. just send to the next address, and remove the address from the SP

If this mechanism is accepted, I’d like to do this work, and make a proposal first. There’s a problem I don’t have good solution: The packet format is so fixed, I don’t get where to put the SP in, I also need some help for this.

zt instance on linux with bridging enabled. create a batman-adv instance and add zt instance to it.

if you have member nodes that are at appropriate ‘hub’ locations with better connectivity they’ll act as failovers.

batman-adv will handle link quality and p2p vs relay selection for you. Further, it will allow other ‘standard’ nodes that have great connectivity to relay instead of just datacenter nodes.


You can also use ospf/bgp+bfd for this. zerotier doesn’t really care what you run on top so if there’s something else that does the job, it’ll work. OLSR, batman-adv, babel, OSPF, eBGP, whatever.