Bug 2258 - Discarded segments update RTT as well as TCP options
Discarded segments update RTT as well as TCP options
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: tcp
pre-release
PC Linux
: P5 enhancement
Assigned To: natale.patriciello
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-12 06:23 UTC by natale.patriciello
Modified: 2016-01-22 08:58 UTC (History)
2 users (show)

See Also:


Attachments
Patch (1.75 KB, patch)
2016-01-12 06:23 UTC, natale.patriciello
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description natale.patriciello 2016-01-12 06:23:19 UTC
Created attachment 2226 [details]
Patch

In DoForwardUp, we have this code:

  m_rxTrace (packet, tcpHeader, this);

  ReadOptions (tcpHeader);

  if (tcpHeader.GetFlags () & TcpHeader::ACK)
    {
      EstimateRtt (tcpHeader);
    }

  // Discard fully out of range data packets
  if (packet->GetSize ()
      && OutOfRange (tcpHeader.GetSequenceNumber (), tcpHeader.GetSequenceNumber () + packet->GetSize ()))
    {
      NS_LOG_LOGIC ("At state " << TcpStateName[m_state] <<
                    " received packet of seq [" << tcpHeader.GetSequenceNumber () <<
                    ":" << tcpHeader.GetSequenceNumber () + packet->GetSize () <<
                    ") out of range [" << m_rxBuffer->NextRxSequence () << ":" <<
                    m_rxBuffer->MaxRxSequence () << ")");
      // Acknowledgement should be sent for all unacceptable packets (RFC793, p.69)
      if (m_state == ESTABLISHED && !(tcpHeader.GetFlags () & TcpHeader::RST))
        {
          SendEmptyPacket (TcpHeader::ACK);
        }
      return;
    }


clearly, a discarded segment should not be allowed to update both rtt and options.

Trivially patched to move up the discard part.

Waiting for comments before applying.
Comment 1 Tom Henderson 2016-01-12 10:02:47 UTC
I agree with the patch.
Comment 2 natale.patriciello 2016-01-22 08:58:10 UTC
Changeset 11827:26cef97eafa8