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 (); |