Skip to content

Message Delivery

Robert Kiel edited this page Nov 16, 2018 · 6 revisions

The protocol forwards not only the message itself and a sufficient payment for the relayer but also the resposibility to deliver the message along the path chosen by the creator of a packet. As there is by design no central server that takes care of the message transfer, the clients are connected through a peer-to-peer network to each other.

There is also no explicit role destinction within the network which means that nodes can act not as a sender but also as a relayer and a receiver. This leads to the requirement that each node must be able to send and receive messages from arbitrary other nodes in the network.

It turned out that sending and receiving messages from arbitrary nodes makes bypassing of NATs necessary. Whilst most of the nodes live behind NATs that allows them to open a port such that they can receive messages from other node, there is also a minority of nodes that live behind NATs that require some tricks to bypass it.

Nowadays, this can be solved by using techniques like WebRTC that automatically finds the right procedure to establish a connection between two clients.

In order to let nodes exchange their connection details and to find a setting that fits for both, WebRTC uses a signalling server to establish a connection. Since the objective of this project is to allow decentralized message delivery, the existence of such a central server contradicts the that objective.

For that reason, each node runs a signalling server itself and chooses a few other nodes where it registers itself to be able to receive connections from other nodes. The nodes use the Multiaddr address structure to bundle several addresses under which a node is available.

In order to connect to a previously unknown node, that node searches for the entry of that node in the DHT and iterates through the received list of addresses under which the node is available until both of them are able to establish a connection.

Clone this wiki locally