Bug 2453 - Neighbors' lifetime is not updated when RouteOutput is called
Neighbors' lifetime is not updated when RouteOutput is called
Product: ns-3
Classification: Unclassified
Component: aodv
All All
: P5 major
Assigned To: ns-bugs
Depends on:
  Show dependency treegraph
Reported: 2016-07-14 11:54 EDT by Andrea Lupia
Modified: 2017-05-18 04:04 EDT (History)
3 users (show)

See Also:

Patch (820 bytes, patch)
2016-07-14 11:54 EDT, Andrea Lupia
Details | Diff
manet-routing-compare output without patch (4.44 KB, text/csv)
2016-07-14 11:55 EDT, Andrea Lupia
manet-routing-compare output with patch (4.45 KB, text/csv)
2016-07-14 11:55 EDT, Andrea Lupia
New patch (825 bytes, patch)
2016-07-21 06:37 EDT, Andrea Lupia
Details | Diff
Updated patch (515 bytes, patch)
2016-09-19 09:27 EDT, Andrea Lupia
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Lupia 2016-07-14 11:54:35 EDT
Created attachment 2494 [details]

When a packet is sent by an application, the method RouteOutput of the Class aodv::RoutingProtocol is called. The lifetime of the entry in the routing table is updated, while the lifetime in the class AodvNeighbors is not updated.
This causes a mismatch between these 2 classes. The problem occurs when WifiMac trace TxErrHeader calls the callback method Neighbors::ProcessTxError (), because the following Purge () call does not find the right entry in the neighbors vector m_nb, so the callback m_handleLinkFailure is not triggered, and the protocol continues to use the same route, also if it is broken.
The bug occurs in simulations that last long and with a high node mobility.
The attached patch will fix this bug.
To have a confirmation of the bug just execute the example manet-routing-compare.cc with and without patch. Received packets change from 2797 to 3020 (adding up the Packets received column).

Excuse me if I made any mistake submitting this bug, it's just the second time I do it :).
Comment 1 Andrea Lupia 2016-07-14 11:55:26 EDT
Created attachment 2495 [details]
manet-routing-compare output without patch
Comment 2 Andrea Lupia 2016-07-14 11:55:44 EDT
Created attachment 2496 [details]
manet-routing-compare output with patch
Comment 3 Andrea Lupia 2016-07-21 06:37:23 EDT
Created attachment 2502 [details]
New patch

I fixed a potential error when AODV is used with more than one interface.
Comment 4 Andrea Lupia 2016-09-19 09:27:00 EDT
Created attachment 2583 [details]
Updated patch

Patch updated to last ns-3-dev version. Moreover, I improved it removing the loop and using the interface from RoutingTableEntry rt to check if the address is a broadcast address.