From 8ee3d4fec0c80505ae9bd6ada239ed2b35210f09 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 12 Nov 2020 12:13:51 -0800 Subject: [PATCH] tcp: Enable byte counting window growth for CUBIC slow start --- src/internet/model/tcp-cubic.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/internet/model/tcp-cubic.cc b/src/internet/model/tcp-cubic.cc index e98af4c1f..b78435b37 100644 --- a/src/internet/model/tcp-cubic.cc +++ b/src/internet/model/tcp-cubic.cc @@ -172,8 +172,16 @@ TcpCubic::IncreaseWindow (Ptr tcb, uint32_t segmentsAcked) HystartReset (tcb); } - tcb->m_cWnd += tcb->m_segmentSize; - segmentsAcked -= 1; + // In Linux, the QUICKACK socket option enables the receiver to send + // immediate acks initially (during slow start) and then transition + // to delayed acks. ns-3 does not implement QUICKACK, and if ack + // counting instead of byte counting is used during slow start window + // growth, when TcpSocket::DelAckCount==2, then the slow start will + // not reach as large of an initial window as in Linux. Therefore, + // we can approximate the effect of QUICKACK by making this slow + // start phase perform Appropriate Byte Counting (RFC 3465) + tcb->m_cWnd += segmentsAcked * tcb->m_segmentSize; + segmentsAcked = 0; NS_LOG_INFO ("In SlowStart, updated to cwnd " << tcb->m_cWnd << " ssthresh " << tcb->m_ssThresh);