Bug 2546

Summary: Add PrintRoutingChange and PrintRoutingChangeAll functions
Product: ns-3 Reporter: Robert Ammon <ammo6818>
Component: routingAssignee: ns-bugs <ns-bugs>
Status: PATCH PENDING ---    
Severity: enhancement CC: tomh, tommaso.pecorella
Priority: P5    
Version: ns-3-dev   
Hardware: PC   
OS: All   

Description Robert Ammon 2016-11-06 08:00:02 UTC
These API functions provide the ability to only print the routing table when it changes. They behave like PrintRoutingTableEvery and PrintRoutingTableAllEvery except if the routing table has not changed since the last time is was printed, no output is produced.  Currently these functions are only available for routing protocols that maintain state information in a routing table (AODV and DSDV).
Comment 1 Tommaso Pecorella 2016-11-06 09:50:36 UTC
Well, technically al the routing protocols are using a routing table, and it should be quite easy to notify a change through a callback.

I'm gonna wait to see the implementation for AODV and DSDV, perhaps we can figure out something generic.
Comment 2 Robert Ammon 2016-11-06 11:02:27 UTC
Changes uploaded as https://codereview.appspot.com/317900043/
Comment 3 Robert Ammon 2016-11-06 11:13:05 UTC
The implementation submitted uses the same implementation as PrintRoutingTable(All)Every which is repetitive schedule at the user specified frequency and then saves a copy of the routing table to compare during the next call.

I considered using callbacks but struggled getting that implementation to work. There are lots of us of that in NS-3 but could not find an example that was appropriate for this type of situation.

If you can provide a simple example when one calls sets up a bound callback that another class could use to execute on a state change that would be extremely helpful and then I could implement for the other routing protocols.
Comment 4 Robert Ammon 2016-11-11 01:06:09 UTC
Updated change set uploaded to remove periodic scheduling and generate output on routing changes.  Also implemented all models that actually implement PrintRoutingTable.
Comment 5 Tom Henderson 2017-06-03 15:50:07 UTC
Moving to patch pending (with unresolved comments in the code review issue)