A Discrete-Event Network Simulator
API
ns3::dsdv::PacketQueue Class Reference

DSDV Packet queue. More...

#include "dsdv-packet-queue.h"

+ Collaboration diagram for ns3::dsdv::PacketQueue:

Public Member Functions

 PacketQueue ()
 Default c-tor. 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 GetCountForPacketsWithDst (Ipv4Address dst)
 Get count of packets with destination dst in the queue. More...
 
uint32_t GetMaxPacketsPerDst () const
 
uint32_t GetMaxQueueLen () const
 
Time GetQueueTimeout () const
 
uint32_t GetSize ()
 Number of entries. More...
 
void SetMaxPacketsPerDst (uint32_t len)
 
void SetMaxQueueLen (uint32_t len)
 
void SetQueueTimeout (Time t)
 

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)
 

Private Attributes

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

Detailed Description

DSDV Packet queue.

When a route is not available, the packets are queued. Every node can buffer up to 5 packets per destination. We have implemented a "drop front on full" queue where the first queued packet will be dropped to accommodate newer packets.

Definition at line 133 of file dsdv-packet-queue.h.

Constructor & Destructor Documentation

ns3::dsdv::PacketQueue::PacketQueue ( )
inline

Default c-tor.

Definition at line 137 of file dsdv-packet-queue.h.

Member Function Documentation

bool ns3::dsdv::PacketQueue::Dequeue ( Ipv4Address  dst,
QueueEntry entry 
)

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

Definition at line 101 of file dsdv-packet-queue.cc.

References m_queue, NS_LOG_FUNCTION, and Purge().

Referenced by ns3::dsdv::RoutingProtocol::SendPacketFromQueue().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsdv::PacketQueue::Drop ( QueueEntry  en,
std::string  reason 
)
private

Notify that packet is dropped from queue by timeout.

Definition at line 176 of file dsdv-packet-queue.cc.

References ns3::Ipv4Header::GetDestination(), ns3::dsdv::QueueEntry::GetIpv4Header(), ns3::dsdv::QueueEntry::GetPacket(), ns3::Packet::GetUid(), and NS_LOG_LOGIC.

Referenced by DropPacketWithDst(), and Purge().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsdv::PacketQueue::DropPacketWithDst ( Ipv4Address  dst)

Remove all packets with destination IP address dst.

Definition at line 84 of file dsdv-packet-queue.cc.

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

+ Here is the call graph for this function:

bool ns3::dsdv::PacketQueue::Enqueue ( QueueEntry entry)

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

For Brock Paper comparision

Definition at line 51 of file dsdv-packet-queue.cc.

References GetCountForPacketsWithDst(), ns3::Ipv4Header::GetDestination(), ns3::dsdv::QueueEntry::GetIpv4Header(), ns3::dsdv::QueueEntry::GetPacket(), ns3::Packet::GetUid(), m_maxLen, m_maxLenPerDst, m_queue, m_queueTimeout, NS_LOG_DEBUG, NS_LOG_FUNCTION, Purge(), and ns3::dsdv::QueueEntry::SetExpireTime().

Referenced by ns3::dsdv::RoutingProtocol::DeferredRouteOutput().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsdv::PacketQueue::Find ( Ipv4Address  dst)

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

Definition at line 118 of file dsdv-packet-queue.cc.

References m_queue, and NS_LOG_DEBUG.

Referenced by ns3::dsdv::RoutingProtocol::LookForQueuedPackets(), and ns3::dsdv::RoutingProtocol::SendPacketFromQueue().

+ Here is the caller graph for this function:

uint32_t ns3::dsdv::PacketQueue::GetCountForPacketsWithDst ( Ipv4Address  dst)

Get count of packets with destination dst in the queue.

Definition at line 133 of file dsdv-packet-queue.cc.

References m_queue.

Referenced by Enqueue().

+ Here is the caller graph for this function:

uint32_t ns3::dsdv::PacketQueue::GetMaxPacketsPerDst ( ) const
inline

Definition at line 163 of file dsdv-packet-queue.h.

References m_maxLenPerDst.

uint32_t ns3::dsdv::PacketQueue::GetMaxQueueLen ( ) const
inline

Definition at line 155 of file dsdv-packet-queue.h.

References m_maxLen.

Time ns3::dsdv::PacketQueue::GetQueueTimeout ( ) const
inline

Definition at line 171 of file dsdv-packet-queue.h.

References m_queueTimeout.

uint32_t ns3::dsdv::PacketQueue::GetSize ( void  )

Number of entries.

Definition at line 44 of file dsdv-packet-queue.cc.

References m_queue, and Purge().

Referenced by ns3::dsdv::RoutingProtocol::SendPacketFromQueue().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool ns3::dsdv::PacketQueue::IsEqual ( QueueEntry  en,
const Ipv4Address  dst 
)
inlinestaticprivate

Definition at line 192 of file dsdv-packet-queue.h.

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

Referenced by DropPacketWithDst().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsdv::PacketQueue::Purge ( )
private

Remove all expired entries.

Definition at line 158 of file dsdv-packet-queue.cc.

References Drop(), m_queue, and NS_LOG_DEBUG.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsdv::PacketQueue::SetMaxPacketsPerDst ( uint32_t  len)
inline

Definition at line 167 of file dsdv-packet-queue.h.

References m_maxLenPerDst.

Referenced by ns3::dsdv::RoutingProtocol::Start().

+ Here is the caller graph for this function:

void ns3::dsdv::PacketQueue::SetMaxQueueLen ( uint32_t  len)
inline

Definition at line 159 of file dsdv-packet-queue.h.

References m_maxLen.

Referenced by ns3::dsdv::RoutingProtocol::Start().

+ Here is the caller graph for this function:

void ns3::dsdv::PacketQueue::SetQueueTimeout ( Time  t)
inline

Definition at line 175 of file dsdv-packet-queue.h.

References m_queueTimeout.

Referenced by ns3::dsdv::RoutingProtocol::Start().

+ Here is the caller graph for this function:

Member Data Documentation

uint32_t ns3::dsdv::PacketQueue::m_maxLen
private

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

Definition at line 187 of file dsdv-packet-queue.h.

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

uint32_t ns3::dsdv::PacketQueue::m_maxLenPerDst
private

The maximum number of packets that we allow per destination to buffer.

Definition at line 189 of file dsdv-packet-queue.h.

Referenced by Enqueue(), GetMaxPacketsPerDst(), and SetMaxPacketsPerDst().

std::vector<QueueEntry> ns3::dsdv::PacketQueue::m_queue
private
Time ns3::dsdv::PacketQueue::m_queueTimeout
private

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

Definition at line 191 of file dsdv-packet-queue.h.

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


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