tcp: Update DCTCP to avoid use of ReduceCwnd

This commit is contained in:
Tom Henderson
2020-11-25 14:20:21 -08:00
parent 12b82f2c5d
commit a37e7fb06e
2 changed files with 12 additions and 3 deletions

View File

@@ -112,12 +112,19 @@ TcpDctcp::Init (Ptr<TcpSocketState> tcb)
tcb->m_ectCodePoint = m_useEct0 ? TcpSocketState::Ect0 : TcpSocketState::Ect1;
}
// Step 9, Section 3.3 of RFC 8257. GetSsThresh() is called upon
// entering the CWR state, and then later, when CWR is exited,
// cwnd is set to ssthresh (this value). bytesInFlight is ignored.
uint32_t
TcpDctcp::GetSsThresh (Ptr<const TcpSocketState> tcb, uint32_t bytesInFlight)
{
NS_LOG_FUNCTION (this << tcb << bytesInFlight);
return static_cast<uint32_t> ((1 - m_alpha / 2.0) * tcb->m_cWnd);
}
void
TcpDctcp::ReduceCwnd (Ptr<TcpSocketState> tcb)
{
NS_LOG_FUNCTION (this << tcb);
uint32_t val = static_cast<uint32_t> ((1 - m_alpha / 2.0) * tcb->m_cWnd);
tcb->m_cWnd = std::max (val, 2 * tcb->m_segmentSize);
}
void

View File

@@ -72,6 +72,8 @@ public:
virtual void Init (Ptr<TcpSocketState> tcb);
// Documented in base class
virtual uint32_t GetSsThresh (Ptr<const TcpSocketState> tcb,
uint32_t bytesInFlight);
virtual Ptr<TcpCongestionOps> Fork ();
virtual void ReduceCwnd (Ptr<TcpSocketState> tcb);
virtual void PktsAcked (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked,