View | Details | Raw Unified | Return to bug 2587
Collapse All | Expand All

(-)a/src/internet/model/tcp-htcp.cc (-10 / +7 lines)
 Lines 160-180    Link Here 
160
void TcpHtcp::UpdateBeta (void)
160
void TcpHtcp::UpdateBeta (void)
161
{
161
{
162
  NS_LOG_FUNCTION (this);
162
  NS_LOG_FUNCTION (this);
163
  if (m_lastThroughput > 0)
163
164
  // Default value for m_beta
165
  m_beta = m_defaultBackoff;
166
167
  if (m_throughput > m_lastThroughput && m_lastThroughput > 0)
164
    {
168
    {
165
      if (((m_throughput - m_lastThroughput) / m_lastThroughput) > m_throughputRatio)
169
      uint32_t diff = m_throughput - m_lastThroughput;
166
        {
170
      if (diff / m_lastThroughput <= m_throughputRatio)
167
          m_beta = m_defaultBackoff;
168
        }
169
      else
170
        {
171
        {
171
          m_beta = m_minRtt.GetDouble () / m_maxRtt.GetDouble ();
172
          m_beta = m_minRtt.GetDouble () / m_maxRtt.GetDouble ();
172
        }
173
        }
173
    }
174
    }
174
  else
175
    {
176
      m_beta = m_defaultBackoff;
177
    }
178
  NS_LOG_DEBUG ("Updated m_beta: " << m_beta);
175
  NS_LOG_DEBUG ("Updated m_beta: " << m_beta);
179
}
176
}
180
177

Return to bug 2587