Network Traversal
A major consideration in establishing a consensus network is how each peer will communicate with each other. TCE is expected to be used in many small and short-lived sessions, so the network traversal must be simple and reliable.
A multi-step approach is taken to establish these peer-to-peer connections:
All peers connect to a coordinating service to exchange public keys and network information. This may be a centralized service like Unity Lobby Service or a decentralized service like Hedera’s consensus service (HCS) or a blockchain’s smart contract. This information is used to generate an address book for the session.
Peers attempt to connect to each other directly using the address book information.
If peers cannot connect directly, a NAT traversal service may be used to facilitate NAT hole-punching.
If NAT hole-punching is unsuccessful, then the fallback method is to use a relay service.
While using a relay service is not ideal because it violates the “fair access” property of TCE, it may be necessary for various use cases including peer-to-peer gaming. Messages can still be secured against tampering because of the cryptographic signatures involved, but message delivery may be delayed or omitted with a relay.