Bug 1133 - DSDV: Possible bug in settling time calc
DSDV: Possible bug in settling time calc
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: dsdv
ns-3-dev
All All
: P5 normal
Assigned To: Hemanth Narra
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-07 14:34 UTC by Tommaso Pecorella
Modified: 2011-05-09 18:13 UTC (History)
1 user (show)

See Also:


Attachments
patch to resolve issue with weighted settling time in dsdv (927 bytes, patch)
2011-05-09 13:15 UTC, Hemanth Narra
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommaso Pecorella 2011-05-07 14:34:57 UTC
in RoutingProtocol::GetSettlingTime (Ipv4Address address) the weightedTime is calculated as:

weightedTime = Time ((m_weightedFactor * mainrt.GetSettlingTime () + 1.0 - m_weightedFactor)
                                * mainrt.GetLifeTime ());

To be honest this calc seems all but right to me. According to DSDV documentation (I'm not a full expert on that tho), the weightedTime should be updated according to a EWMA smooth function, as is:

WTnew = k WTold + (1-k) NewSample. Thus the "right" calc should be:


weightedTime = Time ((m_weightedFactor * mainrt.GetSettlingTime ()) +
                                (1.0 - m_weightedFactor) *  mainrt.GetLifeTime ());

I found it because the previous expression goes to infinity, raising a multiplication overflow on some machines.

Check it and in case update please.

T.
Comment 1 Hemanth Narra 2011-05-09 12:48:33 UTC
Hi Tommaso,

This code must have changed during the re-organization. The initial code present there was;
          weightedTime = (Scalar (m_weightedFactor) * mainrt.GetSettlingTime ()) + (Scalar (1.0 - m_weightedFactor) * mainrt.GetLifeTime ());

And the correct version is present in ns-3.10 as well. Will make sure the bug is corrected in ns3-dev.

Thanks for pointing this out.

Hemanth
Comment 2 Hemanth Narra 2011-05-09 13:15:03 UTC
Created attachment 1107 [details]
patch to resolve issue with weighted settling time in dsdv

Please find the attached patch that fixes this issue. Caused with modifications to the Time class.
Comment 3 Tommaso Pecorella 2011-05-09 16:05:46 UTC
+1
Comment 4 Tommaso Pecorella 2011-05-09 18:13:52 UTC
changeset 7144	9c60c34c6527