A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::TcpRxBuffer Class Reference

class for the reordering buffer that keeps the data from lower layer, i.e. TcpL4Protocol, sent to the application More...

#include <tcp-rx-buffer.h>

+ Inheritance diagram for ns3::TcpRxBuffer:
+ Collaboration diagram for ns3::TcpRxBuffer:

Public Types

typedef std::map
< SequenceNumber32, Ptr
< Packet > >::iterator 
BufIterator

Public Member Functions

 TcpRxBuffer (uint32_t n=0)
virtual ~TcpRxBuffer ()
bool Add (Ptr< Packet > p, TcpHeader const &tcph)
uint32_t Available () const
Ptr< PacketExtract (uint32_t maxSize)
bool Finished (void)
void IncNextRxSequence (void)
uint32_t MaxBufferSize (void) const
SequenceNumber32 MaxRxSequence (void) const
SequenceNumber32 NextRxSequence (void) const
void SetFinSequence (const SequenceNumber32 &s)
void SetMaxBufferSize (uint32_t s)
void SetNextRxSequence (const SequenceNumber32 &s)
uint32_t Size (void) const
- Public Member Functions inherited from ns3::Object
 Object ()
virtual ~Object ()
void AggregateObject (Ptr< Object > other)
void Dispose (void)
AggregateIterator GetAggregateIterator (void) const
virtual TypeId GetInstanceTypeId (void) const
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 SimpleRefCount (const SimpleRefCount &o)
uint32_t GetReferenceCount (void) const
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::Object.

Public Attributes

uint32_t m_availBytes
std::map< SequenceNumber32,
Ptr< Packet > > 
m_data
SequenceNumber32 m_finSeq
bool m_gotFin
uint32_t m_maxBuffer
TracedValue< SequenceNumber32m_nextRxSeq
uint32_t m_size

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
virtual void DoDispose (void)
virtual void DoStart (void)
virtual void NotifyNewAggregate (void)

Detailed Description

class for the reordering buffer that keeps the data from lower layer, i.e. TcpL4Protocol, sent to the application

Definition at line 40 of file tcp-rx-buffer.h.

Member Typedef Documentation

typedef std::map<SequenceNumber32, Ptr<Packet> >::iterator ns3::TcpRxBuffer::BufIterator

Definition at line 76 of file tcp-rx-buffer.h.

Constructor & Destructor Documentation

ns3::TcpRxBuffer::TcpRxBuffer ( uint32_t  n = 0)

Definition at line 50 of file tcp-rx-buffer.cc.

ns3::TcpRxBuffer::~TcpRxBuffer ( )
virtual

Definition at line 55 of file tcp-rx-buffer.cc.

Member Function Documentation

bool ns3::TcpRxBuffer::Add ( Ptr< Packet p,
TcpHeader const &  tcph 
)

Insert a packet into the buffer and update the availBytes counter to reflect the number of bytes ready to send to the application. This function handles overlap by triming the head of the inputted packet and removing data from the buffer that overlaps the tail of the inputted packet

Returns
True when success, false otherwise.

Definition at line 137 of file tcp-rx-buffer.cc.

References ns3::Packet::CreateFragment(), ns3::TcpHeader::GetSequenceNumber(), ns3::Packet::GetSize(), m_availBytes, m_data, m_finSeq, m_gotFin, m_maxBuffer, m_nextRxSeq, m_size, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and visualizer.core::start().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::TcpRxBuffer::Available ( ) const

Definition at line 90 of file tcp-rx-buffer.cc.

References m_availBytes.

Referenced by ns3::TcpSocketBase::GetRxAvailable(), and ns3::TcpSocketBase::ReceivedData().

+ Here is the caller graph for this function:

Ptr< Packet > ns3::TcpRxBuffer::Extract ( uint32_t  maxSize)

Extract data from the head of the buffer as indicated by nextRxSeq. The extracted data is going to be forwarded to the application.

Definition at line 220 of file tcp-rx-buffer.cc.

References m_availBytes, m_data, m_nextRxSeq, m_size, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

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

+ Here is the caller graph for this function:

bool ns3::TcpRxBuffer::Finished ( void  )
TypeId ns3::TcpRxBuffer::GetTypeId ( void  )
static

This method returns the TypeId associated to ns3::Object.

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::Object.

Definition at line 31 of file tcp-rx-buffer.cc.

References m_nextRxSeq, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

void ns3::TcpRxBuffer::IncNextRxSequence ( void  )

Definition at line 96 of file tcp-rx-buffer.cc.

References m_nextRxSeq, m_size, NS_ASSERT, and NS_LOG_FUNCTION.

uint32_t ns3::TcpRxBuffer::MaxBufferSize ( void  ) const

Definition at line 72 of file tcp-rx-buffer.cc.

References m_maxBuffer.

Referenced by ns3::TcpSocketBase::AdvertisedWindowSize(), and ns3::TcpSocketBase::GetRcvBufSize().

+ Here is the caller graph for this function:

SequenceNumber32 ns3::TcpRxBuffer::MaxRxSequence ( void  ) const

Definition at line 107 of file tcp-rx-buffer.cc.

References m_data, m_finSeq, m_gotFin, m_maxBuffer, and m_nextRxSeq.

Referenced by ns3::TcpSocketBase::DoForwardUp(), ns3::TcpSocketBase::OutOfRange(), and ns3::TcpSocketBase::PeerClose().

+ Here is the caller graph for this function:

void ns3::TcpRxBuffer::SetFinSequence ( const SequenceNumber32 s)

Definition at line 121 of file tcp-rx-buffer.cc.

References m_finSeq, m_gotFin, m_nextRxSeq, and NS_LOG_FUNCTION.

Referenced by ns3::TcpSocketBase::PeerClose(), and ns3::TcpSocketBase::ProcessWait().

+ Here is the caller graph for this function:

void ns3::TcpRxBuffer::SetMaxBufferSize ( uint32_t  s)

Definition at line 78 of file tcp-rx-buffer.cc.

References m_maxBuffer.

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

+ Here is the caller graph for this function:

void ns3::TcpRxBuffer::SetNextRxSequence ( const SequenceNumber32 s)

Definition at line 66 of file tcp-rx-buffer.cc.

References m_nextRxSeq.

Referenced by ns3::TcpSocketBase::CompleteFork(), ns3::TcpSocketBase::ProcessSynRcvd(), and ns3::TcpSocketBase::ProcessSynSent().

+ Here is the caller graph for this function:

uint32_t ns3::TcpRxBuffer::Size ( void  ) const

Definition at line 84 of file tcp-rx-buffer.cc.

References m_size.

Referenced by ns3::TcpSocketBase::AdvertisedWindowSize(), ns3::TcpSocketBase::Close(), ns3::TcpSocketBase::ReceivedData(), and ns3::TcpSocketBase::Recv().

+ Here is the caller graph for this function:

Member Data Documentation

uint32_t ns3::TcpRxBuffer::m_availBytes

Definition at line 82 of file tcp-rx-buffer.h.

Referenced by Add(), Available(), and Extract().

std::map<SequenceNumber32, Ptr<Packet> > ns3::TcpRxBuffer::m_data

Definition at line 83 of file tcp-rx-buffer.h.

Referenced by Add(), Extract(), and MaxRxSequence().

SequenceNumber32 ns3::TcpRxBuffer::m_finSeq

Definition at line 78 of file tcp-rx-buffer.h.

Referenced by Add(), Finished(), MaxRxSequence(), and SetFinSequence().

bool ns3::TcpRxBuffer::m_gotFin

Definition at line 79 of file tcp-rx-buffer.h.

Referenced by Add(), Finished(), MaxRxSequence(), and SetFinSequence().

uint32_t ns3::TcpRxBuffer::m_maxBuffer

Definition at line 81 of file tcp-rx-buffer.h.

Referenced by Add(), MaxBufferSize(), MaxRxSequence(), and SetMaxBufferSize().

uint32_t ns3::TcpRxBuffer::m_size

Definition at line 80 of file tcp-rx-buffer.h.

Referenced by Add(), Extract(), IncNextRxSequence(), and Size().


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