A simple routing protocol that builds a tree of nodes for forwarding client
packets to a server and multicasting server packets to the clients.
Pathfinder is an extremely simple routing protocol, it does not require
unique addresses for nodes, its only job is to direct traffic to a single
root node. While, this is not particularly useful for large and complex
networks, it works well enough for protocols that are primarily
unidirectional towards the server, like health. In addition, it makes a
great example for user defined companion protocols.
Pathfinder functions like a spanning tree protocol, each node broadcasts a
ConfigurationCapsule that contains the number of hops to the root
node. When one of these capsules is received, the node compares the number
of hops against any previously seen capsules and makes a decision:
- If the number is less than any seen so far, this neighbor is assumed to
be the new "root neighbor". Any packets to be sent to the server will be
routed through this neighbor.
- If the number is greater than any seen so far, the neighbor is assumed
to be a sibling and it is removed from the "children" neighborhood. This
prevents extra copies of server broadcasts from being sent to the neighbor.
- If the number is negative one, the neighbor thinks we are their parent,
thus, they are added to the "children" neighborhood.
In addition to the normal class files, the protocol also carries the
protocol.properties file. This is a Java properties file that
carries some configuration data and describes the protocol to the webmin
interface. Properties that the protocol will pay attention to are as
follows:
- parameter.update-frequency - The amount of time to wait between sends
of the
ConfigurationCapsule
.
- parameter.root-timeout - The amount of time to wait before declaring
a root neighbor as unreachable. This timer is refreshed whenever a
ConfigurationCapsule
is received.
Note: If you would like to change these in the development
environment you need to edit the protocol.properties.in file
and rerun make.