View | Details | Raw Unified | Return to bug 2263
Collapse All | Expand All

(-)a/RELEASE_NOTES (+1 lines)
 Lines 25-30   New user-visible features Link Here 
25
Bugs fixed
25
Bugs fixed
26
----------
26
----------
27
- Bug 2007 - uan: Remove deprecation on SetRxThresholdDb
27
- Bug 2007 - uan: Remove deprecation on SetRxThresholdDb
28
- Bug 2263 - Support processing of multiple TCP options
28
- Bug 2450 - LogDistancePropagationLossModel is not continuous
29
- Bug 2450 - LogDistancePropagationLossModel is not continuous
29
- Bug 2477 - DCF manager assert
30
- Bug 2477 - DCF manager assert
30
- Bug 2492 - uan: Make use of RxGain attribute in UanPhyGen class
31
- Bug 2492 - uan: Make use of RxGain attribute in UanPhyGen class
(-)a/src/internet/model/tcp-socket-base.cc (-6 / +25 lines)
 Lines 1233-1239   TcpSocketBase::DoForwardUp (Ptr<Packet> packet, const Address &fromAddress, Link Here 
1233
       */
1233
       */
1234
      m_rWnd = tcpHeader.GetWindowSize ();
1234
      m_rWnd = tcpHeader.GetWindowSize ();
1235
1235
1236
      if (tcpHeader.HasOption (TcpOption::WINSCALE) && m_winScalingEnabled)
1236
      if (tcpHeader.HasOption (TcpOption::WINSCALE)
1237
          && IsTcpOptionEnabled (TcpOption::WINSCALE))
1237
        {
1238
        {
1238
          ProcessOptionWScale (tcpHeader.GetOption (TcpOption::WINSCALE));
1239
          ProcessOptionWScale (tcpHeader.GetOption (TcpOption::WINSCALE));
1239
        }
1240
        }
 Lines 1243-1249   TcpSocketBase::DoForwardUp (Ptr<Packet> packet, const Address &fromAddress, Link Here 
1243
        }
1244
        }
1244
1245
1245
      // When receiving a <SYN> or <SYN-ACK> we should adapt TS to the other end
1246
      // When receiving a <SYN> or <SYN-ACK> we should adapt TS to the other end
1246
      if (tcpHeader.HasOption (TcpOption::TS) && m_timestampEnabled)
1247
      if (tcpHeader.HasOption (TcpOption::TS) && IsTcpOptionEnabled (TcpOption::TS))
1247
        {
1248
        {
1248
          ProcessOptionTimestamp (tcpHeader.GetOption (TcpOption::TS),
1249
          ProcessOptionTimestamp (tcpHeader.GetOption (TcpOption::TS),
1249
                                  tcpHeader.GetSequenceNumber ());
1250
                                  tcpHeader.GetSequenceNumber ());
 Lines 1266-1272   TcpSocketBase::DoForwardUp (Ptr<Packet> packet, const Address &fromAddress, Link Here 
1266
  else if (tcpHeader.GetFlags () & TcpHeader::ACK)
1267
  else if (tcpHeader.GetFlags () & TcpHeader::ACK)
1267
    {
1268
    {
1268
      NS_ASSERT (!(tcpHeader.GetFlags () & TcpHeader::SYN));
1269
      NS_ASSERT (!(tcpHeader.GetFlags () & TcpHeader::SYN));
1269
      if (m_timestampEnabled)
1270
      if (IsTcpOptionEnabled (TcpOption::TS))
1270
        {
1271
        {
1271
          if (!tcpHeader.HasOption (TcpOption::TS))
1272
          if (!tcpHeader.HasOption (TcpOption::TS))
1272
            {
1273
            {
 Lines 1439-1444   TcpSocketBase::ProcessEstablished (Ptr<Packet> packet, const TcpHeader& tcpHeade Link Here 
1439
    }
1440
    }
1440
}
1441
}
1441
1442
1443
bool
1444
TcpSocketBase::IsTcpOptionEnabled (uint8_t kind) const
1445
{
1446
  NS_LOG_FUNCTION (this << (int)kind);
1447
1448
  switch (kind)
1449
    {
1450
    case TcpOption::TS:
1451
      return m_timestampEnabled;
1452
    case TcpOption::WINSCALE:
1453
      return m_winScalingEnabled;
1454
    default:
1455
      break;
1456
    }
1457
  return false;
1458
}
1459
1442
void
1460
void
1443
TcpSocketBase::ReadOptions (const TcpHeader &tcpHeader)
1461
TcpSocketBase::ReadOptions (const TcpHeader &tcpHeader)
1444
{
1462
{
 Lines 2261-2267   TcpSocketBase::SendEmptyPacket (uint8_t flags) Link Here 
2261
  bool isAck = flags == TcpHeader::ACK;
2279
  bool isAck = flags == TcpHeader::ACK;
2262
  if (hasSyn)
2280
  if (hasSyn)
2263
    {
2281
    {
2264
      if (m_winScalingEnabled)
2282
      if (IsTcpOptionEnabled (TcpOption::WINSCALE))
2265
        { // The window scaling option is set only on SYN packets
2283
        { // The window scaling option is set only on SYN packets
2266
          AddOptionWScale (header);
2284
          AddOptionWScale (header);
2267
        }
2285
        }
 Lines 2856-2862   TcpSocketBase::EstimateRtt (const TcpHeader& tcpHeader) Link Here 
2856
      RttHistory& h = m_history.front ();
2874
      RttHistory& h = m_history.front ();
2857
      if (!h.retx && ackSeq >= (h.seq + SequenceNumber32 (h.count)))
2875
      if (!h.retx && ackSeq >= (h.seq + SequenceNumber32 (h.count)))
2858
        { // Ok to use this sample
2876
        { // Ok to use this sample
2859
          if (m_timestampEnabled && tcpHeader.HasOption (TcpOption::TS))
2877
          if (IsTcpOptionEnabled (TcpOption::TS)
2878
              && tcpHeader.HasOption (TcpOption::TS))
2860
            {
2879
            {
2861
              Ptr<const TcpOptionTS> ts;
2880
              Ptr<const TcpOptionTS> ts;
2862
              ts = DynamicCast<const TcpOptionTS> (tcpHeader.GetOption (TcpOption::TS));
2881
              ts = DynamicCast<const TcpOptionTS> (tcpHeader.GetOption (TcpOption::TS));
 Lines 3319-3325   TcpSocketBase::AddOptions (TcpHeader& header) Link Here 
3319
{
3338
{
3320
  NS_LOG_FUNCTION (this << header);
3339
  NS_LOG_FUNCTION (this << header);
3321
3340
3322
  if (m_timestampEnabled)
3341
  if (IsTcpOptionEnabled (TcpOption::TS))
3323
    {
3342
    {
3324
      AddOptionTimestamp (header);
3343
      AddOptionTimestamp (header);
3325
    }
3344
    }
(-)a/src/internet/model/tcp-socket-base.h (-1 / +8 lines)
 Lines 923-928   protected: Link Here 
923
  void ReadOptions (const TcpHeader &tcpHeader);
923
  void ReadOptions (const TcpHeader &tcpHeader);
924
924
925
  /**
925
  /**
926
   * \brief Return true if the specified option is enabled
927
   *
928
   * \param kind kind of TCP option
929
   * \return true if the option is enabled
930
   */
931
  bool IsTcpOptionEnabled (uint8_t kind) const;
932
933
  /**
926
   * \brief Read and parse the Window scale option
934
   * \brief Read and parse the Window scale option
927
   *
935
   *
928
   * Read the window scale option (encoded logarithmically) and save it.
936
   * Read the window scale option (encoded logarithmically) and save it.
929
- 

Return to bug 2263