Skip to content

Commit 6523c1a

Browse files
committed
tcp: (fixes #1351) Correct PRR RecoverFS to use FlightSize, not pipe
Assisted-by: Claude Fable 5
1 parent 649f02d commit 6523c1a

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/internet/model/tcp-prr-recovery.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,16 @@ TcpPrrRecovery::EnterRecovery(Ptr<TcpSocketState> tcb,
6161

6262
m_prrOut = 0;
6363
m_prrDelivered = 0;
64-
m_recoveryFlightSize = tcb->m_bytesInFlight; // RFC 6675 pipe before recovery
64+
// RFC 9937 Section 6.1 (and RFC 6937 line 296): RecoverFS is the FlightSize
65+
// (SND.NXT - SND.UNA) at the start of recovery, NOT the RFC 6675 pipe
66+
// (FlightSize - sacked - lost). unAckDataCount carries SND.NXT - SND.UNA.
67+
// Using the smaller pipe here inflates the proportional send count and makes
68+
// PRR overshoot ssThresh at recovery exit. RFC 9937 additionally refines
69+
// this base with SACK scoreboard terms (- sacked + newlySacked
70+
// + newlyCumAcked); that second-order correction is not applied here because
71+
// the recovery-ops interface does not expose the scoreboard. Omitting it is
72+
// safe: it can only make RecoverFS larger (more conservative), never smaller.
73+
m_recoveryFlightSize = unAckDataCount;
6574

6675
NS_LOG_INFO("Enter recovery: cWnd " << tcb->m_cWnd << " ssThresh " << tcb->m_ssThresh
6776
<< " recoveryFlightSize " << m_recoveryFlightSize

src/internet/model/tcp-prr-recovery.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ class TcpPrrRecovery : public TcpClassicRecovery
6868
private:
6969
uint32_t m_prrDelivered{0}; //!< total bytes delivered during recovery phase
7070
uint32_t m_prrOut{0}; //!< total bytes sent during recovery phase
71-
uint32_t m_recoveryFlightSize{0}; //!< value of bytesInFlight at the start of recovery phase
71+
uint32_t m_recoveryFlightSize{0}; //!< FlightSize (SND.NXT - SND.UNA) at the start of recovery
72+
//!< phase (RFC 9937 RecoverFS)
7273
};
7374
} // namespace ns3
7475

0 commit comments

Comments
 (0)