A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
bool Dequeue (Ipv4Address dst, DsrErrorBuffEntry &entry)
 Return first found (the earliest) entry for given destination.
 
void DropPacketForErrLink (Ipv4Address source, Ipv4Address nextHop)
 Remove all packets with the error link.
 
bool Enqueue (DsrErrorBuffEntry &entry)
 Push entry in queue, if there is no entry with the same packet and destination address in queue.
 
bool Find (Ipv4Address dst)
 Finds whether a packet with destination dst exists in the queue.
 
std::vector< DsrErrorBuffEntry > & GetBuffer ()
 Get error buffer entry.
 
Time GetErrorBufferTimeout () const
 Get error buffer timeout.
 
uint32_t GetMaxQueueLen () const
 Get maximum queue length.
 
uint32_t GetSize ()
 Returns the number of entries in the queue.
 
void SetErrorBufferTimeout (Time t)
 Set error buffer timeout.
 
void SetMaxQueueLen (uint32_t len)
 Set maximum queue length.
 

Private Member Functions

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

Private Attributes

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

Detailed Description

DSR error buffer.

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

Constructor & Destructor Documentation

◆ DsrErrorBuffer()

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

Default constructor.

Definition at line 210 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 109 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 181 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 189 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 80 of file dsr-errorbuff.cc.

References DropLink(), 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 45 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 129 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 288 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 270 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 252 of file dsr-errorbuff.h.

References m_maxLen.

◆ GetSize()

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

Returns the number of entries in the queue.

Returns
the number of entries in the queue.

Definition at line 38 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 161 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 279 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 261 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 295 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 315 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 312 of file dsr-errorbuff.h.

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


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