A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::dsdv::PacketQueue Class Reference

DSDV Packet queue. More...

#include <dsdv-packet-queue.h>

Public Member Functions

 PacketQueue ()
 Default c-tor.
 
bool Dequeue (Ipv4Address dst, QueueEntry &entry)
 Return first found (the earliest) entry for given destination.
 
void DropPacketWithDst (Ipv4Address dst)
 Remove all packets with destination IP address dst.
 
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.
 
uint32_t GetCountForPacketsWithDst (Ipv4Address dst)
 Get count of packets with destination dst in the queue.
 
uint32_t GetSize ()
 Number of entries.
 
Fields
uint32_t GetMaxQueueLen () const
 
void SetMaxQueueLen (uint32_t len)
 
uint32_t GetMaxPacketsPerDst () const
 
void SetMaxPacketsPerDst (uint32_t len)
 
Time GetQueueTimeout () const
 
void SetQueueTimeout (Time t)
 

Private Member Functions

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

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.
 
uint32_t m_maxLenPerDst
 The maximum number of packets that we allow per destination to buffer.
 
std::vector< QueueEntrym_queue
 
Time m_queueTimeout
 The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
 

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.

Member Function Documentation

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 50 of file dsdv-packet-queue.cc.

References GetCountForPacketsWithDst(), ns3::Ipv4Header::GetDestination(), ns3::Packet::GetUid(), m_maxLen, m_maxLenPerDst, m_queueTimeout, NS_LOG_DEBUG, NS_LOG_FUNCTION, and Purge().

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


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