Bug 1133

Summary: DSDV: Possible bug in settling time calc
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: dsdvAssignee: Hemanth Narra <hemanthnarra222>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: patch to resolve issue with weighted settling time in dsdv

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