Network Plug-in

The network plug-in implements the protocol stack for the peer-to-peer network.

While the TCP plug-in takes over the transport task, the network plug-in has to do some more things:

  • Discovering existing and deleted connections and make them available to the system for messaging
  • Detect the emergence and disappearance of LINKS and NODES and inform the router about it
  • Get configuration from other NODES so that messages can be formatted accordingly
  • Pack messages that are sent to other NODES into packages.
  • Unpack packages coming from other NODES and which are destined for this NODE
  • Forward packets coming from other NODES and destined for third NODES
  • Creating and sending broadcasts
  • Forward broadcasts to the system and other NODES
  • Check incoming messages using the GateKeeper and send them back if necessary

Routing messages contain a sender and a receiver address. They are moving from NODE to NODE via open TCP connections (LINKS). A router service ensures that a message is always passed to the correct next NODE. This ensures that messages are routed through the mesh network as quickly as possible. For this to work, the router service of one NODE must be informed about the other NODES and LINKS. If a NODE is added, all NODES are informed via a P2P mechanism, as well as about the loss of a LINK.

This allows each NODE to determine the next waypoint for a message using the Djikstra algorithm. The "cost" of a connection between two adjacent NODES can be specified via the configuration. Messages will thus always take the fastest route through the mesh network.

A side effect is that the system can at any time make a statement about which NODE is available and which is not. Heartbeats are used to quickly detect TCP connection terminations, and the remaining NODES that can be reached are informed.


The Packing

Before a message is sent between two NODES, it must be "packed". There are different types of packing:

  • Transfer of the message to a byte array by streaming ("M")
  • Compressing the byte array using the ZIP algorithm ("Z")
  • Symmetrical encryption of the byte array with AES ("A")

Which pack types are used is determined by a so-called "Package Builder Sequence". The complete sequence would be "MZA". The sequence can be configured as follows:

  • If the envelope of the message has a sequence, it is used.
  • If a sequence is defined for a certain distance between two hosts (e. g. between "A" and "D"), it is used.
  • If a sequence has been determined for a NODE, it is used for outgoing messages.
  • A sequence "M" (stream only) is used.

It is therefore possible to specify exactly for each message and route whether messages are to be compressed or encrypted. After all, every preparation of the packages costs time.

The symmetrical AES encryption is not to be confused with the use of SSL/TLS for a link between two adjacent NODES. Instead, it applies to the internal encryption of a message between sender and receiver NODE, e. g. between "A" and "D" in the image. For this purpose, session keys are exchanged using an RSA procedure prior to the first message "A--D".

For a more detailed explanation, please refer to the documentation.



Messages have a setting option for prioritization in the envelope. Prioritization only applies if messages are transported between NODES. The system always takes the message with the highest priority from the number of messages that are still outstanding for transport. In doing so, messages with higher priority overtake those with lower priority.

The system always transports responses with the highest priority.


The GateKeeper is a plug-in that checks incoming messages to see if they are welcome. Messages received in the network plug-in are passed to the gatekeeper for checking. If the GateKeeper rejects the message, it is returned to the sender. See gatekeeper for details.