21 #ifndef TCP_RX_BUFFER_H 22 #define TCP_RX_BUFFER_H 25 #include "ns3/traced-value.h" 26 #include "ns3/trace-source-accessor.h" 27 #include "ns3/sequence-number.h" 29 #include "ns3/tcp-header.h" 30 #include "ns3/tcp-option-sack.h" 127 uint32_t
Size (
void)
const;
221 typedef std::map<SequenceNumber32, Ptr<Packet> >::iterator
BufIterator;
228 std::map<SequenceNumber32, Ptr<Packet> >
m_data;
uint32_t m_availBytes
Number of bytes available to read, i.e.
uint32_t m_maxBuffer
Upper bound of the number of data bytes in buffer (RCV.WND)
SequenceNumber32 NextRxSequence(void) const
Get Next Rx Sequence number.
bool Add(Ptr< Packet > p, TcpHeader const &tcph)
Insert a packet into the buffer and update the availBytes counter to reflect the number of bytes read...
TracedValue< SequenceNumber32 > m_nextRxSeq
Seqnum of the first missing byte in data (RCV.NXT)
bool GotFin() const
Says if a FIN bit has been received.
std::list< SackBlock > SackList
SACK list definition.
void SetFinSequence(const SequenceNumber32 &s)
Set the FIN Sequence number (i.e., the one closing the connection)
SequenceNumber32 MaxRxSequence(void) const
Get the lowest sequence number that this TcpRxBuffer cannot accept.
void ClearSackList(const SequenceNumber32 &seq)
Remove old blocks from the sack list.
uint32_t GetSackListSize() const
Get the size of Sack list.
void IncNextRxSequence(void)
Increment the Next Sequence number.
bool m_gotFin
Did I received FIN packet?
void UpdateSackList(const SequenceNumber32 &head, const SequenceNumber32 &tail)
Update the sack list, with the block seq starting at the beginning.
Rx reordering buffer for TCP.
void SetNextRxSequence(const SequenceNumber32 &s)
Set the Next Sequence number.
void SetMaxBufferSize(uint32_t s)
Set the Maximum buffer size.
uint32_t Size(void) const
Get the actual buffer occupancy.
TcpRxBuffer(uint32_t n=0)
Constructor.
SequenceNumber32 m_finSeq
Seqnum of the FIN packet.
Ptr< Packet > Extract(uint32_t maxSize)
Extract data from the head of the buffer as indicated by nextRxSeq.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::map< SequenceNumber32, Ptr< Packet > > m_data
Corresponding data (may be null)
uint32_t m_size
Number of total data bytes in the buffer, not necessarily contiguous.
TcpOptionSack::SackList m_sackList
Sack list (updated constantly)
static TypeId GetTypeId(void)
Get the type ID.
A base class which provides memory management and object aggregation.
a unique identifier for an interface.
uint32_t MaxBufferSize(void) const
Get the Maximum buffer size.
bool Finished(void)
Check if the buffer did receive all the data (and the connection is closed)
uint32_t Available() const
Get the actual number of bytes available to be read.
std::map< SequenceNumber32, Ptr< Packet > >::iterator BufIterator
container for data stored in the buffer
TcpOptionSack::SackList GetSackList() const
Get the sack list.