Message Routing

Within the scope of DRC, routing is the act of getting a message from one node to another. More specifically, getting a message from the originating node to all of the recipients exactly once. Any multi-hop network topology requires some form of routing protocol to make this possible, and a mesh network requires a more intelligent routing protocol than a tree-based network.

Routing tables

The general principle of DRC routing is similar to most physical network topologies. Each node has a routing table which maps from a destination address to the link that should be used to reach that destination. Since each server-server message contains the destination address, routing a message not destined for the receiving node is as simple as looking up this destination in the routing table.

Example routing table
Destination Hop count Gateway
A 0 A
B 1 B
C 2 B
D 2 B
E 1 E
   A        B     C
   o--------o-----o
    \        \   /
     \        \ /
      o--------o
      E        D

The complex part of routing is not the use of the routing tables, but how to populate them in the first place. Routes can be split into two groups:

  • Direct — there is an actual connection between the two nodes. These are entries with a hop count of 1.
  • Multi-hop — there is a connection to the node somewhere, and the information is shared in some way so that nodes can learn where other nodes are. The routing table contains which node should be used as the “gateway” to get to some other node.

Populating the routing table with direct routes is trivial. However, fully-connected mesh networks do not scale well (see Network Topology) so not all routes can fall in this category. There are a few methods available for multi-hop routing, but I'll discuss the two that are probably most applicable.

Method 1: Learning

Every message travelling across the network has a source node identifier in its headers. This means that whenever a node, A, receives a message from another node, B, there exists a route back to the source node via node B. Even more importantly, because duplicate messages are ignored, the first and only time the message is processed it will have travelled the fastest route between the source node and node A.

Method 2: Sharing

Learning vs. Sharing

Conclusion

Other Stuff

Automatic Route Learning

Due to the ID of the entry node for a message being part of the message while it is relayed, the first time a node receives a particular message it can record:

  • The node that it came via (based on the connection it was received on
    • … and therefore the route to that node
    • This is implicitly the fastest route to that node, since it ignores all subsequent instances of the same message
  • The node a particular user is on (based on the sender component)

A combination of these factors can make a self-defining fast routing system for inter-user messages.

distributed_relay_chat/routing/root.txt · Last modified: 2009/05/03 13:22 by alan
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki