Zero Docs
Comment on page

Peer Routing & Discovery

Peer Routing & Discovery/
zOS comes equipped with libp2p's standard content routing and addressing libraries. Routing is necessary in order to know exactly where to send Messages in the network. In order to successfully route data from one Node to another, both a Node zId and Address (such as an IP) are required.
In the common event where a Node knows another Node's zId but not it's Address, it can begin the process of Node Discovery. Node Discovery enables a Node to leverage Address information known by the other Nodes in which they are already connected to. As more Nodes are contacted, more is learned about the Addresses of other Nodes, eventually resulting in a match. This builds a more comprehensive view of the Zero Grid, both enabling Message traversal to happen faster for subsequent connections, and to store/provide valuable routing data to other Nodes in what mimics a mesh-network.
Peer routing currently uses a Kademlia implementation of a distributed hash table (DHT). This processed lookups where each search step results in a closer Node to the Node in question, until it is found. Prior to building knowledge of any Nodes within the network, the zId and Address of one or more Nodes is needed to bootstrap the process of Network Discovery. This can be achieved by three methods:
  • Bootstrap: A bulk list of pre-defined Node addresses that can be used to initiate data propagation.
  • Invite: A single invitation to connect to a specific address.
  • Local Network: A search for valid addresses and ports on a local area IP range.
Last modified 2yr ago