A Discrete-Event Network Simulator
API
ns3::TcpTxItem Class Reference

Item that encloses the application packet and some flags for it. More...

#include "tcp-tx-item.h"

+ Collaboration diagram for ns3::TcpTxItem:

Classes

struct  RateInformation
 Various rate-related information, can be accessed by TcpRateOps. More...
 

Public Member Functions

const TimeGetLastSent () const
 Get a reference to the time the packet was sent for the last time. More...
 
Ptr< const PacketGetPacket () const
 Get the Packet underlying this item. More...
 
Ptr< PacketGetPacketCopy () const
 Get a copy of the Packet underlying this item. More...
 
RateInformationGetRateInformation ()
 Get (to modify) the Rate Information of this item. More...
 
uint32_t GetSeqSize () const
 Get the size in the sequence number space. More...
 
bool IsRetrans () const
 Is the item retransmitted? More...
 
bool IsSacked () const
 Is the item sacked? More...
 
void Print (std::ostream &os, Time::Unit unit=Time::S) const
 Print the time. More...
 

Public Attributes

bool m_retrans {false}
 Indicates if the segment is retransmitted. More...
 

Private Attributes

Time m_lastSent
 Timestamp of the time at which the segment has been sent last time. More...
 
bool m_lost {false}
 Indicates if the segment has been lost (RTO) More...
 
Ptr< Packetm_packet {nullptr}
 Application packet (can be null) More...
 
RateInformation m_rateInfo
 Rate information of the item. More...
 
bool m_sacked {false}
 Indicates if the segment has been SACKed. More...
 
SequenceNumber32 m_startSeq {0}
 Sequence number of the item (if transmitted) More...
 

Friends

class TcpTxBuffer
 

Detailed Description

Item that encloses the application packet and some flags for it.

Definition at line 32 of file tcp-tx-item.h.

Member Function Documentation

◆ GetLastSent()

const Time & ns3::TcpTxItem::GetLastSent ( ) const

Get a reference to the time the packet was sent for the last time.

Returns
a reference to the last sent time

Definition at line 91 of file tcp-tx-item.cc.

References m_lastSent.

Referenced by ns3::TcpRateLinux::SkbDelivered().

+ Here is the caller graph for this function:

◆ GetPacket()

Ptr< const Packet > ns3::TcpTxItem::GetPacket ( ) const

Get the Packet underlying this item.

Returns
a pointer to a const Packet

Definition at line 85 of file tcp-tx-item.cc.

References m_packet.

◆ GetPacketCopy()

Ptr< Packet > ns3::TcpTxItem::GetPacketCopy ( ) const

Get a copy of the Packet underlying this item.

Returns
a copy of the Packet

Definition at line 79 of file tcp-tx-item.cc.

References ns3::Packet::Copy(), and m_packet.

Referenced by ns3::TcpTxBuffer::DiscardUpTo(), and ns3::TcpSocketBase::SendDataPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRateInformation()

TcpTxItem::RateInformation & ns3::TcpTxItem::GetRateInformation ( )

Get (to modify) the Rate Information of this item.

Returns
A reference to the rate information.

Definition at line 97 of file tcp-tx-item.cc.

References m_rateInfo.

Referenced by TcpRateLinuxBasicTest::SendSkb(), TcpRateLinuxBasicTest::SkbDelivered(), ns3::TcpRateLinux::SkbDelivered(), and ns3::TcpRateLinux::SkbSent().

+ Here is the caller graph for this function:

◆ GetSeqSize()

uint32_t ns3::TcpTxItem::GetSeqSize ( ) const

Get the size in the sequence number space.

Returns
1 if the packet size is 0 or there's no packet, otherwise the size of the packet

Definition at line 61 of file tcp-tx-item.cc.

References ns3::Packet::GetSize(), and m_packet.

Referenced by Print(), TcpRateLinuxBasicTest::SendSkb(), TcpRateLinuxBasicTest::SkbDelivered(), and ns3::TcpRateLinux::SkbDelivered().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsRetrans()

bool ns3::TcpTxItem::IsRetrans ( ) const

Is the item retransmitted?

Returns
true if the item have been retransmitted

Definition at line 73 of file tcp-tx-item.cc.

References m_retrans.

Referenced by ns3::TcpSocketBase::SendDataPacket().

+ Here is the caller graph for this function:

◆ IsSacked()

bool ns3::TcpTxItem::IsSacked ( ) const

Is the item sacked?

Returns
true if the item is sacked, false otherwise

Definition at line 67 of file tcp-tx-item.cc.

References m_sacked.

◆ Print()

void ns3::TcpTxItem::Print ( std::ostream &  os,
Time::Unit  unit = Time::S 
) const

Print the time.

Parameters
osostream
unitTime::Unit

Definition at line 24 of file tcp-tx-item.cc.

References ns3::Time::As(), GetSeqSize(), m_lastSent, m_lost, m_retrans, m_sacked, and m_startSeq.

Referenced by ns3::operator<<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ TcpTxBuffer

friend class TcpTxBuffer
friend

Definition at line 109 of file tcp-tx-item.h.

Member Data Documentation

◆ m_lastSent

Time ns3::TcpTxItem::m_lastSent
private
Initial value:
{
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
Definition: nstime.h:297

Timestamp of the time at which the segment has been sent last time.

Definition at line 114 of file tcp-tx-item.h.

Referenced by ns3::TcpTxBuffer::CopyFromSequence(), GetLastSent(), ns3::TcpTxBuffer::MergeItems(), Print(), and ns3::TcpTxBuffer::SplitItems().

◆ m_lost

◆ m_packet

◆ m_rateInfo

RateInformation ns3::TcpTxItem::m_rateInfo
private

Rate information of the item.

Definition at line 118 of file tcp-tx-item.h.

Referenced by GetRateInformation().

◆ m_retrans

◆ m_sacked

◆ m_startSeq


The documentation for this class was generated from the following files: