22. Routing and route maintenance

22.1. Overview

The ROUTING and ROUTE_MAINTENANCE services work closely to provide multi-hop communications. The ROUTING serice provider is responsible for maintaining a routing table, and for routing datagrams according to the table. The ROUTE_MAINTENANCE service provider, on the other hand, is responsible for discovering new routes and providing updated routing information to the ROUTING service provider.

If a network only requires static routes, the ROUTING service provider is sufficient to provide the functionality. In case of networks with dynamic route discovery, a ROUTE_MAINTENANCE service provider discovers routes (or route changes) and publishes RouteDiscoveryNtf messages. The ROUTING service provider subscribes to these messages and updates its routing tables.

The ROUTING service provider also typically listens for LinkStatusNtf messages from the LINK service agents. These messages allow it to keep track of link availability and link quality.

Both ROUTING and ROUTE_MAINTENANCE services are described below.

22.2. Routing service


Agents offering the ROUTING service provide multi-hop communication.

All agents supporting the ROUTING service must also support the DATAGRAM service ( Chapter 14 ).

It is recommended that agents offering the ROUTING service provide reliability, when requested. Agents that are able to provide reliability, do so by advertising the DATAGRAM service capability RELIABILITY.

22.2.1. Messages

Agents providing the ROUTING service support the following messages:

The GetRouteReq message may be used to request a single route ( all = false ), or a list of routes ( all = true ). When a single route is requested, the response is either a RouteRsp (with route information) or a REFUSE (if no route available). When multiple routes are requested, the response is a series of RouteRsp messages, followed by an AGREE message to indicate end of the list. If no routes available, a REFUSE message is sent back instead of the AGREE message.

While the above messages may be used programmatically to manipulate the routing table, typically users interact with the router via the shell commands described in Chapter 6 and Section 22.4 below.

22.3. Route maintenance service


Agents offering the ROUTE_MAINTENANCE service generate RouteDiscoveryNtf messages to allow ROUTING service providers to maintain routing tables.

22.3.1. Messages

Agents providing the ROUTE_MAINTENANCE service support the following messages:

  • RouteDiscoveryReq AGREE / REFUSE / FAILURE — start route discovery to a specified node

  • RouteTraceReq AGREE / REFUSE / FAILURE — trace current route to a specified node

  • RouteDiscoveryNtf — sent to the agent’s topic when a route is discovered

  • RouteTraceNtf — sent to requestor when a requested trace is successfully completed

22.4. Router and the route discovery protocol

The Router class (agent name router ) provides the ROUTING service in the standard stack. Apart from supporting the routes , addroute , delroute and delroutesto commands, this agent exposes two parameters:

  • auto1hop — automatically assume single-hop routes available, if no entry for destination node in routing table

  • defaultLink — default LINK service provider to use for datagram transmission, if unspecified while adding a route

Without auto1hop enabled, every route must be explicitly added to the routing table (even when the node is accessible over a single hop). By enabling auto1hop , we tell the router than any node that isn’t explicitly added to the routing table is assumed to be accessible over a single hop. This is the default setting:

> router
« Router »

Routes datagrams in the network, based on a routing table.

  MTU = 3145581
  RTU = 1447

  auto1hop = true
  defaultLink = uwlink

The RouteDiscoveryProtocol class (agent name rdp ) provides the ROUTE_MAINTENANCE service in the standard stack. This agent has no configurable parameters.

In Chapter 6 , we explored several examples of how to set up networks with static and dynamic routes. To find out more about routing, type help router in the shell:

> help router
router - access to routing service

  routes              // display routing table
  routes 2            // display routes to node 2
  addroute 27, 29     // add a route to node 27 via node 29
  delroute 'as7623'   // delete route with UUID as7623
  editroute 'as7623', metric: 5.0 // edit route to change metric
  delroutesto 27      // delete all routes to node 27
  delroutes           // delete all routes
  trace 27            // trace route to node 27
  ping 27             // check if node 27 is accessible


- router.MTU - maximum data transfer size
- router.RTU - recommended data transfer size
- router.auto1hop - automatically assume single hop routes
- router.defaultLink - default link to use


- routes - print routing table
- addroute - add a route to the routing table
- editroute - edit a route in the routing table
- delroute - delete a route from the routing table
- delroutesto - delete all routes to specified node from the routing table
- delroutes - delete all routes from the routing table

You can also type help followed by any of the commands above to get more information on the usage of that command.

<<< [Single-hop links] [Transport service] >>>