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

(-)a/src/internet/model/tcp-socket-base.cc (-11 / +5 lines)
 Lines 1419-1425    Link Here 
1419
            {
1419
            {
1420
              // RFC3042 Limited transmit: Send a new packet for each duplicated ACK before fast retransmit
1420
              // RFC3042 Limited transmit: Send a new packet for each duplicated ACK before fast retransmit
1421
              NS_LOG_INFO ("Limited transmit");
1421
              NS_LOG_INFO ("Limited transmit");
1422
              uint32_t sz = SendDataPacket (m_nextTxSequence, m_tcb->m_segmentSize, true);
1422
              uint32_t sz = SendDataPacket (m_nextTxSequence, m_tcb->m_segmentSize, true, false);
1423
              m_nextTxSequence += sz;
1423
              m_nextTxSequence += sz;
1424
            }
1424
            }
1425
1425
 Lines 1452-1458    Link Here 
1452
            {
1452
            {
1453
              // RFC3042 Limited transmit: Send a new packet for each duplicated ACK before fast retransmit
1453
              // RFC3042 Limited transmit: Send a new packet for each duplicated ACK before fast retransmit
1454
              NS_LOG_INFO ("Limited transmit");
1454
              NS_LOG_INFO ("Limited transmit");
1455
              uint32_t sz = SendDataPacket (m_nextTxSequence, m_tcb->m_segmentSize, true);
1455
              uint32_t sz = SendDataPacket (m_nextTxSequence, m_tcb->m_segmentSize, true, false);
1456
              m_nextTxSequence += sz;
1456
              m_nextTxSequence += sz;
1457
            }
1457
            }
1458
        }
1458
        }
 Lines 2328-2343    Link Here 
2328
/* Extract at most maxSize bytes from the TxBuffer at sequence seq, add the
2328
/* Extract at most maxSize bytes from the TxBuffer at sequence seq, add the
2329
    TCP header, and send to TcpL4Protocol */
2329
    TCP header, and send to TcpL4Protocol */
2330
uint32_t
2330
uint32_t
2331
TcpSocketBase::SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool withAck)
2331
TcpSocketBase::SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool withAck, bool isRetransmission)
2332
{
2332
{
2333
  NS_LOG_FUNCTION (this << seq << maxSize << withAck);
2333
  NS_LOG_FUNCTION (this << seq << maxSize << withAck);
2334
2334
2335
  bool isRetransmission = false;
2336
  if ( seq == m_txBuffer->HeadSequence () )
2337
    {
2338
      isRetransmission = true;
2339
    }
2340
2341
  Ptr<Packet> p = m_txBuffer->CopyFromSequence (maxSize, seq);
2335
  Ptr<Packet> p = m_txBuffer->CopyFromSequence (maxSize, seq);
2342
  uint32_t sz = p->GetSize (); // Size of packet
2336
  uint32_t sz = p->GetSize (); // Size of packet
2343
  uint8_t flags = withAck ? TcpHeader::ACK : 0;
2337
  uint8_t flags = withAck ? TcpHeader::ACK : 0;
 Lines 2533-2539    Link Here 
2533
                    " unAck: " << UnAckDataCount ());
2528
                    " unAck: " << UnAckDataCount ());
2534
2529
2535
      uint32_t s = std::min (w, m_tcb->m_segmentSize);  // Send no more than window
2530
      uint32_t s = std::min (w, m_tcb->m_segmentSize);  // Send no more than window
2536
      uint32_t sz = SendDataPacket (m_nextTxSequence, s, withAck);
2531
      uint32_t sz = SendDataPacket (m_nextTxSequence, s, withAck, false);
2537
      nPacketsSent++;                             // Count sent this loop
2532
      nPacketsSent++;                             // Count sent this loop
2538
      m_nextTxSequence += sz;                     // Advance next tx sequence
2533
      m_nextTxSequence += sz;                     // Advance next tx sequence
2539
    }
2534
    }
 Lines 2939-2945    Link Here 
2939
    }
2934
    }
2940
2935
2941
  // Retransmit a data packet: Call SendDataPacket
2936
  // Retransmit a data packet: Call SendDataPacket
2942
  uint32_t sz = SendDataPacket (m_txBuffer->HeadSequence (), m_tcb->m_segmentSize, true);
2937
  uint32_t sz = SendDataPacket (m_txBuffer->HeadSequence (), m_tcb->m_segmentSize, true, true);
2943
  // In case of RTO, advance m_nextTxSequence
2938
  // In case of RTO, advance m_nextTxSequence
2944
  m_nextTxSequence = std::max (m_nextTxSequence.Get (), m_txBuffer->HeadSequence () + sz);
2939
  m_nextTxSequence = std::max (m_nextTxSequence.Get (), m_txBuffer->HeadSequence () + sz);
2945
2940
(-)a/src/internet/model/tcp-socket-base.h (-1 / +2 lines)
 Lines 562-570    Link Here 
562
   * \param seq the sequence number
562
   * \param seq the sequence number
563
   * \param maxSize the maximum data block to be transmitted (in bytes)
563
   * \param maxSize the maximum data block to be transmitted (in bytes)
564
   * \param withAck forces an ACK to be sent
564
   * \param withAck forces an ACK to be sent
565
   * \param isRetransmission whether the segment is being retransmitted
565
   * \returns the number of bytes sent
566
   * \returns the number of bytes sent
566
   */
567
   */
567
  uint32_t SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool withAck);
568
  uint32_t SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool withAck, bool isRetransmission);
568
569
569
  /**
570
  /**
570
   * \brief Send a empty packet that carries a flag, e.g. ACK
571
   * \brief Send a empty packet that carries a flag, e.g. ACK

Return to bug 2302