diff --git a/src/internet/model/tcp-bbr.cc b/src/internet/model/tcp-bbr.cc index 10235d255..82502d9b7 100644 --- a/src/internet/model/tcp-bbr.cc +++ b/src/internet/model/tcp-bbr.cc @@ -220,6 +220,7 @@ TcpBbr::SetPacingRate(Ptr tcb, double gain) { NS_LOG_FUNCTION(this << tcb << gain); DataRate rate(gain * m_maxBwFilter.GetBest().GetBitRate()); + rate *= (1.f - m_pacingMargin); rate = std::min(rate, tcb->m_maxPacingRate); if (!m_hasSeenRtt && tcb->m_minRtt != Time::Max()) diff --git a/src/internet/model/tcp-bbr.h b/src/internet/model/tcp-bbr.h index 5c3270ec6..90b34a357 100644 --- a/src/internet/model/tcp-bbr.h +++ b/src/internet/model/tcp-bbr.h @@ -402,6 +402,8 @@ class TcpBbr : public TcpCongestionOps Time m_ackEpochTime{Seconds(0)}; //!< Starting of ACK sampling epoch time uint32_t m_ackEpochAcked{0}; //!< Bytes ACked in sampling epoch bool m_hasSeenRtt{false}; //!< Have we seen RTT sample yet? + double m_pacingMargin{0.01}; //!< BBR intentionally reduces the pacing rate by 1% to drain any + //!< standing queues. See `bbr_rate_bytes_per_sec` in Linux. }; } // namespace ns3