2

In my routing protocol, I want to update the routing table dynamically at a periodic interval, as of now, I am adding route entries to the routing table from my agent, by sending the RouteDiscoveryNtf message to the router agent, which is similar to using addroute closure in the shell.

I want to know, How I can delete the route entries. So that, I can update the routing table with new entries. As the, delroute, delroutesto,delroutes closures, which works in shell, cannot be used in an agent.

Also I want to know is my approach is right for updating the routing table dynamically or is there any other better way for doing this. Kindly help.

1 Answers1

1

The current version of UnetStack (1.4) does not define messages to delete routes, so there's no "correct" way to ask router to delete a route. Later versions might introduce messages for this. For now, you could do it in the same way as the delroute, delroutes and delroutesto shell functions do it, but bear in mind that you may need to update this in later versions of UnetStack.

The router agent exposes two unlisted parameters (removeRoute and removeRoutesTo) to allow deletion of routes. These may be removed in future versions once UnetStack defines messages for this purpose.

Code snippet showing how the 3 shell functions are implemented:

// remove route number n (0 based numbering)
void delroute(n) {
  router.removeRoute = n-1
}

// remote all routes in routing table
void delroutes() {
  router.removeRoute = -1
}

// remove all routes to node
void delroutesto(node) {
  router.removeRoutesTo = node
}

If you're implementing in Groovy, you can use pretty much the same code with router being the AgentID or the router agent. If you're implementing in Java, you'll have to send the appropriate ParameterReq to set these parameters.

Mandar Chitre
  • 2,110
  • 6
  • 14