src/internet/model/tcp-westwood.cc
changeset 11195 0c5e9bfa1b48
parent 11190 f0458968b67d
child 11259 ea2f6a3ed14e
equal deleted inserted replaced
11194:46b6e53e8dbc 11195:0c5e9bfa1b48
   305 
   305 
   306   // If erroneous timeout in closed/timed-wait state, just return
   306   // If erroneous timeout in closed/timed-wait state, just return
   307   if (m_state == CLOSED || m_state == TIME_WAIT)
   307   if (m_state == CLOSED || m_state == TIME_WAIT)
   308     return;
   308     return;
   309   // If all data are received, just return
   309   // If all data are received, just return
   310   if (m_txBuffer.HeadSequence () >= m_nextTxSequence)
   310   if (m_txBuffer->HeadSequence () >= m_nextTxSequence)
   311     return;
   311     return;
   312 
   312 
   313   // Upon an RTO, adjust cwnd and ssthresh based on the estimated BW
   313   // Upon an RTO, adjust cwnd and ssthresh based on the estimated BW
   314   m_ssThresh = std::max (static_cast<double> (2 * m_segmentSize), m_currentBW.Get () * static_cast<double> (m_minRtt.GetSeconds ()));
   314   m_ssThresh = std::max (static_cast<double> (2 * m_segmentSize), m_currentBW.Get () * static_cast<double> (m_minRtt.GetSeconds ()));
   315   m_cWnd = m_segmentSize;
   315   m_cWnd = m_segmentSize;
   316 
   316 
   317   // Restart from highest ACK
   317   // Restart from highest ACK
   318   m_nextTxSequence = m_txBuffer.HeadSequence ();
   318   m_nextTxSequence = m_txBuffer->HeadSequence ();
   319   NS_LOG_INFO ("RTO. Reset cwnd to " << m_cWnd <<
   319   NS_LOG_INFO ("RTO. Reset cwnd to " << m_cWnd <<
   320       ", ssthresh to " << m_ssThresh << ", restart from seqnum " << m_nextTxSequence);
   320       ", ssthresh to " << m_ssThresh << ", restart from seqnum " << m_nextTxSequence);
   321 
   321 
   322   // Retransmit the packet
   322   // Retransmit the packet
   323   DoRetransmit ();
   323   DoRetransmit ();