|
Bugzilla – Full Text Bug Listing |
| Summary: | Function named UpdateBeta is wrong in tcp-htcp.cc file | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Mingyu Park <darkpmg> |
| Component: | tcp | Assignee: | natale.patriciello |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | amir.arc, ns-bugs, tomh |
| Priority: | P3 | ||
| Version: | ns-3.26 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | Corrected patch | ||
Created attachment 2776 [details]
Corrected patch
Hi,
Your patch still present a problem of overflow because of the fact that uint32 - uint32 is always > 0 (as you said, there could be overflow).
The corrected behavior (IMHO) is reported in this patch. Please check.
The patch looks correct. Thank you Committed in 12670:0c9178f1709d, thanks |
First of all, m_throughput's type is uint32. And, if m_lastThroughput is greater than m_throughput, the result of '((m_throughput - m_lastThroughput) / m_lastThroughput)' should be negative value like following algorithm. if (((m_throughput - m_lastThroughput) / m_lastThroughput) > m_throughputRatio) { m_beta = m_defaultBackoff; } else { m_beta = m_minRtt.GetDouble () / m_maxRtt.GetDouble (); } But! since m_throughput's type is uint32, overflow is occurred. So, m_beta's value will be mostly m_defaultBackoff. Finally we suggest change algorithm like that if((m_throughput - m_lastThroughput) > 0) { if (((m_throughput - m_lastThroughput) / m_lastThroughput) > m_throughputRatio) { m_beta = m_defaultBackoff; } } else { m_beta = m_minRtt.GetDouble () / m_maxRtt.GetDouble (); }