A Discrete-Event Network Simulator
API
ns3::dsr::DsrErrorBuffer Class Reference

DSR error buffer. More...

#include "dsr-errorbuff.h"

+ Collaboration diagram for ns3::dsr::DsrErrorBuffer:

Public Member Functions

 DsrErrorBuffer ()
 Default constructor. More...
 
bool Dequeue (Ipv4Address dst, DsrErrorBuffEntry &entry)
 Return first found (the earliest) entry for given destination. More...
 
void DropPacketForErrLink (Ipv4Address source, Ipv4Address nextHop)
 Remove all packets with the error link. More...
 
bool Enqueue (DsrErrorBuffEntry &entry)
 Push entry in queue, if there is no entry with the same packet and destination address in queue. More...
 
bool Find (Ipv4Address dst)
 Finds whether a packet with destination dst exists in the queue. More...
 
std::vector< DsrErrorBuffEntry > & GetBuffer ()
 Get error buffer entry. More...
 
Time GetErrorBufferTimeout () const
 Get error buffer timeout. More...
 
uint32_t GetMaxQueueLen () const
 Get maximum queue length. More...
 
uint32_t GetSize ()
 Returns the number of entries in the queue. More...
 
void SetErrorBufferTimeout (Time t)
 Set error buffer timeout. More...
 
void SetMaxQueueLen (uint32_t len)
 Set maximum queue length. More...
 

Private Member Functions

void Drop (DsrErrorBuffEntry en, std::string reason)
 Notify that packet is dropped from queue by timeout. More...
 
void DropLink (DsrErrorBuffEntry en, std::string reason)
 Notify that packet is dropped from queue by link error. More...
 
void Purge ()
 Remove all expired entries. More...
 

Private Attributes

std::vector< DsrErrorBuffEntrym_errorBuffer
 The send buffer to cache unsent packet. More...
 
Time m_errorBufferTimeout
 The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds. More...
 
uint32_t m_maxLen
 The maximum number of packets that we allow a routing protocol to buffer. More...
 

Detailed Description

DSR error buffer.

Definition at line 215 of file dsr-errorbuff.h.

Constructor & Destructor Documentation

◆ DsrErrorBuffer()

ns3::dsr::DsrErrorBuffer::DsrErrorBuffer ( )
inline

Default constructor.

Definition at line 221 of file dsr-errorbuff.h.

Member Function Documentation

◆ Dequeue()

bool ns3::dsr::DsrErrorBuffer::Dequeue ( Ipv4Address  dst,
DsrErrorBuffEntry entry 
)

Return first found (the earliest) entry for given destination.

Parameters
[in]dstThe destination to look for
[out]entryThe entry
Returns
true if an entry is found

Definition at line 120 of file dsr-errorbuff.cc.

References ns3::dsr::DsrErrorBuffEntry::GetPacket(), ns3::Packet::GetSize(), m_errorBuffer, NS_LOG_DEBUG, and Purge().

Referenced by ns3::dsr::DsrRouting::SendPacketFromBuffer().

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

◆ Drop()

void ns3::dsr::DsrErrorBuffer::Drop ( DsrErrorBuffEntry  en,
std::string  reason 
)
private

Notify that packet is dropped from queue by timeout.

Parameters
enError Buffer Entry
reasonDrop reason.

Definition at line 192 of file dsr-errorbuff.cc.

References ns3::dsr::DsrErrorBuffEntry::GetDestination(), ns3::dsr::DsrErrorBuffEntry::GetPacket(), ns3::Packet::GetUid(), and NS_LOG_LOGIC.

Referenced by Enqueue(), and Purge().

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

◆ DropLink()

void ns3::dsr::DsrErrorBuffer::DropLink ( DsrErrorBuffEntry  en,
std::string  reason 
)
private

Notify that packet is dropped from queue by link error.

Parameters
enError Buffer Entry
reasonDrop reason.

Definition at line 200 of file dsr-errorbuff.cc.

References ns3::dsr::DsrErrorBuffEntry::GetNextHop(), ns3::dsr::DsrErrorBuffEntry::GetPacket(), ns3::dsr::DsrErrorBuffEntry::GetSource(), ns3::Packet::GetUid(), and NS_LOG_LOGIC.

Referenced by DropPacketForErrLink().

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

◆ DropPacketForErrLink()

void ns3::dsr::DsrErrorBuffer::DropPacketForErrLink ( Ipv4Address  source,
Ipv4Address  nextHop 
)

Remove all packets with the error link.

Parameters
sourceThe source
nextHopThe next hop

Definition at line 91 of file dsr-errorbuff.cc.

References DropLink(), openflow-switch::link, list, m_errorBuffer, NS_LOG_FUNCTION, and Purge().

Referenced by ns3::dsr::DsrRouting::AddRoute(), and ns3::dsr::DsrRouting::AddRoute_Link().

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

◆ Enqueue()

bool ns3::dsr::DsrErrorBuffer::Enqueue ( DsrErrorBuffEntry entry)

Push entry in queue, if there is no entry with the same packet and destination address in queue.

Parameters
entryerror buffer entry
Returns
true if entry added
Todo:
check the source and destination over here

Definition at line 56 of file dsr-errorbuff.cc.

References Drop(), ns3::dsr::DsrErrorBuffEntry::GetDestination(), ns3::dsr::DsrErrorBuffEntry::GetNextHop(), ns3::dsr::DsrErrorBuffEntry::GetPacket(), ns3::dsr::DsrErrorBuffEntry::GetSource(), ns3::Packet::GetUid(), m_errorBuffer, m_errorBufferTimeout, m_maxLen, NS_LOG_INFO, Purge(), and ns3::dsr::DsrErrorBuffEntry::SetExpireTime().

Referenced by ns3::dsr::DsrRouting::SendUnreachError().

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

◆ Find()

bool ns3::dsr::DsrErrorBuffer::Find ( Ipv4Address  dst)

Finds whether a packet with destination dst exists in the queue.

Parameters
dstThe destination
Returns
true if a packet is found.

Definition at line 140 of file dsr-errorbuff.cc.

References m_errorBuffer, and NS_LOG_DEBUG.

Referenced by ns3::dsr::DsrRouting::SendPacketFromBuffer().

+ Here is the caller graph for this function:

◆ GetBuffer()

std::vector<DsrErrorBuffEntry>& ns3::dsr::DsrErrorBuffer::GetBuffer ( )
inline

Get error buffer entry.

Returns
the DSR error buffer

Definition at line 299 of file dsr-errorbuff.h.

References m_errorBuffer.

◆ GetErrorBufferTimeout()

Time ns3::dsr::DsrErrorBuffer::GetErrorBufferTimeout ( ) const
inline

Get error buffer timeout.

Returns
the error buffer timeout

Definition at line 281 of file dsr-errorbuff.h.

References m_errorBufferTimeout.

◆ GetMaxQueueLen()

uint32_t ns3::dsr::DsrErrorBuffer::GetMaxQueueLen ( ) const
inline

Get maximum queue length.

Returns
the maximum queue length

Definition at line 263 of file dsr-errorbuff.h.

References m_maxLen.

◆ GetSize()

uint32_t ns3::dsr::DsrErrorBuffer::GetSize ( void  )

Returns the number of entries in the queue.

Returns
the number of entries in the queue.

Definition at line 49 of file dsr-errorbuff.cc.

References m_errorBuffer, and Purge().

Referenced by ns3::dsr::DsrRouting::SendPacketFromBuffer().

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

◆ Purge()

void ns3::dsr::DsrErrorBuffer::Purge ( )
private

Remove all expired entries.

Definition at line 172 of file dsr-errorbuff.cc.

References Drop(), m_errorBuffer, and NS_LOG_DEBUG.

Referenced by Dequeue(), DropPacketForErrLink(), Enqueue(), and GetSize().

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

◆ SetErrorBufferTimeout()

void ns3::dsr::DsrErrorBuffer::SetErrorBufferTimeout ( Time  t)
inline

Set error buffer timeout.

Parameters
tthe error buffer timeout

Definition at line 290 of file dsr-errorbuff.h.

References m_errorBufferTimeout.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

◆ SetMaxQueueLen()

void ns3::dsr::DsrErrorBuffer::SetMaxQueueLen ( uint32_t  len)
inline

Set maximum queue length.

Parameters
lenthe maximum queue length

Definition at line 272 of file dsr-errorbuff.h.

References m_maxLen.

Referenced by ns3::dsr::DsrRouting::Start().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_errorBuffer

std::vector<DsrErrorBuffEntry> ns3::dsr::DsrErrorBuffer::m_errorBuffer
private

The send buffer to cache unsent packet.

Definition at line 306 of file dsr-errorbuff.h.

Referenced by Dequeue(), DropPacketForErrLink(), Enqueue(), Find(), GetBuffer(), GetSize(), and Purge().

◆ m_errorBufferTimeout

Time ns3::dsr::DsrErrorBuffer::m_errorBufferTimeout
private

The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.

Definition at line 326 of file dsr-errorbuff.h.

Referenced by Enqueue(), GetErrorBufferTimeout(), and SetErrorBufferTimeout().

◆ m_maxLen

uint32_t ns3::dsr::DsrErrorBuffer::m_maxLen
private

The maximum number of packets that we allow a routing protocol to buffer.

Definition at line 323 of file dsr-errorbuff.h.

Referenced by Enqueue(), GetMaxQueueLen(), and SetMaxQueueLen().


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