|
2544 |
TcpSocketBase::BytesInFlight () const |
2544 |
TcpSocketBase::BytesInFlight () const |
2545 |
{ |
2545 |
{ |
2546 |
NS_LOG_FUNCTION (this); |
2546 |
NS_LOG_FUNCTION (this); |
2547 |
return m_highTxMark.Get () - m_txBuffer->HeadSequence (); |
2547 |
uint32_t flightSize = m_nextTxSequence.Get () - m_txBuffer->HeadSequence (); |
|
|
2548 |
uint32_t duplicatesSize = m_dupAckCount * m_tcb->m_segmentSize; |
2549 |
return duplicatesSize > flightSize ? 0 : flightSize - duplicatesSize; |
2548 |
} |
2550 |
} |
2549 |
|
2551 |
|
2550 |
uint32_t |
2552 |
uint32_t |
|
2869 |
* are not able to retransmit anything because of local congestion. |
2871 |
* are not able to retransmit anything because of local congestion. |
2870 |
*/ |
2872 |
*/ |
2871 |
|
2873 |
|
2872 |
m_nextTxSequence = m_txBuffer->HeadSequence (); // Restart from highest Ack |
|
|
2873 |
m_dupAckCount = 0; |
2874 |
|
2875 |
if (m_tcb->m_congState != TcpSocketState::CA_LOSS) |
2874 |
if (m_tcb->m_congState != TcpSocketState::CA_LOSS) |
2876 |
{ |
2875 |
{ |
2877 |
m_tcb->m_congState = TcpSocketState::CA_LOSS; |
2876 |
m_tcb->m_congState = TcpSocketState::CA_LOSS; |
|
2879 |
m_tcb->m_cWnd = m_tcb->m_segmentSize; |
2878 |
m_tcb->m_cWnd = m_tcb->m_segmentSize; |
2880 |
} |
2879 |
} |
2881 |
|
2880 |
|
|
|
2881 |
m_nextTxSequence = m_txBuffer->HeadSequence (); // Restart from highest Ack |
2882 |
m_dupAckCount = 0; |
2883 |
|
2882 |
NS_LOG_DEBUG ("RTO. Reset cwnd to " << m_tcb->m_cWnd << ", ssthresh to " << |
2884 |
NS_LOG_DEBUG ("RTO. Reset cwnd to " << m_tcb->m_cWnd << ", ssthresh to " << |
2883 |
m_tcb->m_ssThresh << ", restart from seqnum " << m_nextTxSequence); |
2885 |
m_tcb->m_ssThresh << ", restart from seqnum " << m_nextTxSequence); |
2884 |
DoRetransmit (); // Retransmit the packet |
2886 |
DoRetransmit (); // Retransmit the packet |