tcp: Try to take more data from the app before sending
This commit is contained in:
@@ -1522,6 +1522,7 @@ a std::map of interface IDs and TTLs for the route.
|
||||
|
||||
<h2>Changed behavior:</h2>
|
||||
<ul>
|
||||
<li> If the data inside the TCP buffer is less than the available window, TCP tries to ask for more data to the application, in the hope of filling the usable transmission window. In some cases, this change allows sending bigger packets than the previous versions, optimizing the transmission.</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -2806,8 +2806,16 @@ TcpSocketBase::SendPendingData (bool withAck)
|
||||
// It's time to transmit, but before do silly window and Nagle's check
|
||||
uint32_t availableData = m_txBuffer->SizeFromSequence (next);
|
||||
|
||||
// If there's less app data than the full window, ask the app for more
|
||||
// data before trying to send
|
||||
if (availableData < availableWindow)
|
||||
{
|
||||
NotifySend (GetTxAvailable ());
|
||||
}
|
||||
|
||||
// Stop sending if we need to wait for a larger Tx window (prevent silly window syndrome)
|
||||
if (availableWindow < m_tcb->m_segmentSize && availableData > availableWindow)
|
||||
// but continue if we don't have data
|
||||
if (availableWindow < m_tcb->m_segmentSize && availableData > availableWindow)
|
||||
{
|
||||
NS_LOG_LOGIC ("Preventing Silly Window Syndrome. Wait to send.");
|
||||
break; // No more
|
||||
|
||||
Reference in New Issue
Block a user