GomSpace/libcsp — Issue #28: Source Routing
Author: johandc
Created: 2012-01-13 10:29:29+00:00
State: open
Labels: Feature

Before venturing into the great worlds of routing protocols, the simple tool of source routing should be added to CSP. This ensures that as long as nodes are informed of their neighboring nodes, a packet can always be successfully routed with manual source routing. This could be used as an emergency tool in order to modify routing tables that are invalid manually.

The implementation is quite simple, and not something that would interfere with normal CSP traffic. I suggest that we add a CSP_FSRCRTE flag to the header and add an optional routing table at the end of the data, just as we add other fields at the end.

When transmitting: The routing table could consist of a 8-bit length field and a variable length array of 8-bit fields which specify the next hop address. Each intermediate node will find its own address in the table, and send the message to the next hop node. When the message arrives at the CSP end-node, there are a few options

When receiving: If a message arrived to the node by source routing, we can assume that the default route on the receiving node is no longer valid, or there may be some other reason not to use the default route. Therefore the receiving node should either remember the source route on a connection basis, and/or update it's routing table to the correct default route. Maybe there should be a "learn" flag on the source routed message, that would make all CSP-nodes update their routing table. In this case source routing could be used as a tool to update the routing tables in the network by simply sending a ping message to a specific node, using source routing and the "learn" flag.

For the first implementation i think that the connection handler should remember the incoming source route, and then reverse it for replies on the connection. Only one problem. Since all connection data is static, how do we get memory allocation for an arbitrary length source route?