A Discrete-Event Network Simulator
API
ns3::aodv::RequestQueue Class Reference

AODV route request queue. More...

#include "aodv-rqueue.h"

+ Collaboration diagram for ns3::aodv::RequestQueue:

Public Member Functions

 RequestQueue (uint32_t maxLen, Time routeToQueueTimeout)
 constructor More...
 
bool Dequeue (Ipv4Address dst, QueueEntry &entry)
 Return first found (the earliest) entry for given destination. More...
 
void DropPacketWithDst (Ipv4Address dst)
 Remove all packets with destination IP address dst. More...
 
bool Enqueue (QueueEntry &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...
 
uint32_t GetMaxQueueLen () const
 Get maximum queue length. More...
 
Time GetQueueTimeout () const
 Get queue timeout. More...
 
uint32_t GetSize ()
 
void SetMaxQueueLen (uint32_t len)
 Set maximum queue length. More...
 
void SetQueueTimeout (Time t)
 Set queue timeout. More...
 

Private Member Functions

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

Static Private Member Functions

static bool IsEqual (QueueEntry en, const Ipv4Address dst)
 Determine if queue matches a destination address. More...
 

Private Attributes

uint32_t m_maxLen
 The maximum number of packets that we allow a routing protocol to buffer. More...
 
std::vector< QueueEntrym_queue
 The queue. More...
 
Time m_queueTimeout
 The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds. More...
 

Detailed Description

AODV route request queue.

Since AODV is an on demand routing we queue requests while looking for route.

Definition at line 180 of file aodv-rqueue.h.

Constructor & Destructor Documentation

◆ RequestQueue()

ns3::aodv::RequestQueue::RequestQueue ( uint32_t  maxLen,
Time  routeToQueueTimeout 
)
inline

constructor

Parameters
maxLenthe maximum length
routeToQueueTimeoutthe route to queue timeout

Definition at line 189 of file aodv-rqueue.h.

Member Function Documentation

◆ Dequeue()

bool ns3::aodv::RequestQueue::Dequeue ( Ipv4Address  dst,
QueueEntry entry 
)

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

Parameters
dstthe destination IP address
entrythe queue entry
Returns
true if the entry is dequeued

Definition at line 89 of file aodv-rqueue.cc.

References m_queue, and Purge().

Referenced by ns3::aodv::AodvRqueueTest::DoRun(), and ns3::aodv::RoutingProtocol::SendPacketFromQueue().

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

◆ Drop()

void ns3::aodv::RequestQueue::Drop ( QueueEntry  en,
std::string  reason 
)
private

Notify that packet is dropped from queue by timeout.

Parameters
enthe queue entry to drop
reasonthe reason to drop the entry

Definition at line 153 of file aodv-rqueue.cc.

References ns3::Socket::ERROR_NOROUTETOHOST, ns3::Ipv4Header::GetDestination(), ns3::aodv::QueueEntry::GetErrorCallback(), ns3::aodv::QueueEntry::GetIpv4Header(), ns3::aodv::QueueEntry::GetPacket(), ns3::Packet::GetUid(), and NS_LOG_LOGIC().

Referenced by DropPacketWithDst(), Enqueue(), and Purge().

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

◆ DropPacketWithDst()

void ns3::aodv::RequestQueue::DropPacketWithDst ( Ipv4Address  dst)

Remove all packets with destination IP address dst.

Parameters
dstthe destination IP address

Definition at line 72 of file aodv-rqueue.cc.

References Drop(), IsEqual(), m_queue, NS_LOG_FUNCTION, and Purge().

Referenced by ns3::aodv::AodvRqueueTest::DoRun(), and ns3::aodv::RoutingProtocol::RouteRequestTimerExpire().

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

◆ Enqueue()

bool ns3::aodv::RequestQueue::Enqueue ( QueueEntry entry)

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

Parameters
entrythe queue entry
Returns
true if the entry is queued

Definition at line 48 of file aodv-rqueue.cc.

References Drop(), ns3::Ipv4Header::GetDestination(), ns3::aodv::QueueEntry::GetIpv4Header(), ns3::aodv::QueueEntry::GetPacket(), ns3::Packet::GetUid(), m_maxLen, m_queue, m_queueTimeout, Purge(), and ns3::aodv::QueueEntry::SetExpireTime().

Referenced by ns3::aodv::AodvRqueueTest::CheckSizeLimit(), ns3::aodv::RoutingProtocol::DeferredRouteOutput(), and ns3::aodv::AodvRqueueTest::DoRun().

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

◆ Find()

bool ns3::aodv::RequestQueue::Find ( Ipv4Address  dst)

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

Parameters
dstthe destination IP address
Returns
true if an entry with the IP address is found

Definition at line 105 of file aodv-rqueue.cc.

References m_queue.

Referenced by ns3::aodv::AodvRqueueTest::DoRun().

+ Here is the caller graph for this function:

◆ GetMaxQueueLen()

uint32_t ns3::aodv::RequestQueue::GetMaxQueueLen ( ) const
inline

Get maximum queue length.

Returns
the maximum queue length

Definition at line 230 of file aodv-rqueue.h.

References m_maxLen.

Referenced by ns3::aodv::AodvRqueueTest::CheckSizeLimit(), and ns3::aodv::AodvRqueueTest::DoRun().

+ Here is the caller graph for this function:

◆ GetQueueTimeout()

Time ns3::aodv::RequestQueue::GetQueueTimeout ( ) const
inline

Get queue timeout.

Returns
the queue timeout

Definition at line 246 of file aodv-rqueue.h.

References m_queueTimeout.

Referenced by ns3::aodv::AodvRqueueTest::DoRun().

+ Here is the caller graph for this function:

◆ GetSize()

uint32_t ns3::aodv::RequestQueue::GetSize ( )
Returns
the number of entries

Definition at line 41 of file aodv-rqueue.cc.

References m_queue, and Purge().

Referenced by ns3::aodv::AodvRqueueTest::CheckSizeLimit(), ns3::aodv::AodvRqueueTest::CheckTimeout(), and ns3::aodv::AodvRqueueTest::DoRun().

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

◆ IsEqual()

static bool ns3::aodv::RequestQueue::IsEqual ( QueueEntry  en,
const Ipv4Address  dst 
)
inlinestaticprivate

Determine if queue matches a destination address.

Parameters
enThe queue entry
dstThe destination IPv4 address
Returns
true if the queue entry matches the destination address

Definition at line 280 of file aodv-rqueue.h.

References ns3::Ipv4Header::GetDestination(), and ns3::aodv::QueueEntry::GetIpv4Header().

Referenced by DropPacketWithDst().

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

◆ Purge()

void ns3::aodv::RequestQueue::Purge ( )
private

Remove all expired entries.

Definition at line 137 of file aodv-rqueue.cc.

References Drop(), and m_queue.

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

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

◆ SetMaxQueueLen()

void ns3::aodv::RequestQueue::SetMaxQueueLen ( uint32_t  len)
inline

Set maximum queue length.

Parameters
lenThe maximum queue length

Definition at line 238 of file aodv-rqueue.h.

References m_maxLen.

Referenced by ns3::aodv::AodvRqueueTest::DoRun(), and ns3::aodv::RoutingProtocol::SetMaxQueueLen().

+ Here is the caller graph for this function:

◆ SetQueueTimeout()

void ns3::aodv::RequestQueue::SetQueueTimeout ( Time  t)
inline

Set queue timeout.

Parameters
tThe queue timeout

Definition at line 254 of file aodv-rqueue.h.

References m_queueTimeout.

Referenced by ns3::aodv::AodvRqueueTest::DoRun(), and ns3::aodv::RoutingProtocol::SetMaxQueueTime().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_maxLen

uint32_t ns3::aodv::RequestQueue::m_maxLen
private

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

Definition at line 271 of file aodv-rqueue.h.

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

◆ m_queue

std::vector<QueueEntry> ns3::aodv::RequestQueue::m_queue
private

The queue.

Definition at line 261 of file aodv-rqueue.h.

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

◆ m_queueTimeout

Time ns3::aodv::RequestQueue::m_queueTimeout
private

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

Definition at line 273 of file aodv-rqueue.h.

Referenced by Enqueue(), GetQueueTimeout(), and SetQueueTimeout().


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