22. Routing and route maintenance
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
messages. The ROUTING service provider subscribes to these messages and updates its routing tables.
The ROUTING service provider also typically listens for
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.
Agents providing the ROUTING service support the following messages:
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
(with route information) or a
(if no route available). When multiple routes are requested, the response is a series of
messages, followed by an
message to indicate end of the list. If no routes available, a
message is sent back instead of the
22.3. Route maintenance service
Agents offering the ROUTE_MAINTENANCE service generate
messages to allow ROUTING service providers to maintain routing tables.
Agents providing the ROUTE_MAINTENANCE service support the following messages:
FAILURE— start route discovery to a specified node
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
class (agent name
) provides the ROUTING service in the standard stack. Apart from supporting the
commands, this agent exposes two parameters:
enabled, every route must be explicitly added to the routing table (even when the node is accessible over a single hop). By enabling
, 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. [org.arl.unet.DatagramParam] MTU = 3145581 RTU = 1447 [org.arl.unet.net.RouterParam] auto1hop = true defaultLink = uwlink
class (agent name
) provides the ROUTE_MAINTENANCE service in the standard stack. This agent has no configurable parameters.
, we explored several examples of how to set up networks with static and dynamic routes. To find out more about routing, type
in the shell:
> help router router - access to routing service Examples: 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 Parameters: - 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 Commands: - 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
followed by any of the commands above to get more information on the usage of that command.
|<<< [Single-hop links]||[Transport service] >>>|