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.