A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::WimaxMacQueue Class Reference

Class implementing the device packet queue. More...

#include "wimax-mac-queue.h"

+ Inheritance diagram for ns3::WimaxMacQueue:
+ Collaboration diagram for ns3::WimaxMacQueue:

Classes

struct  QueueElement
 QueueElement structure. More...
 

Public Member Functions

 WimaxMacQueue ()
 
 WimaxMacQueue (uint32_t maxSize)
 Constructor.
 
 ~WimaxMacQueue () override
 
bool CheckForFragmentation (MacHeaderType::HeaderType packetType)
 Check for fragmentation of the first packet of the specified type.
 
Ptr< PacketDequeue (MacHeaderType::HeaderType packetType)
 Dequeue a packet of type packetType from the queue.
 
Ptr< PacketDequeue (MacHeaderType::HeaderType packetType, uint32_t availableByte)
 Dequeue a fragment of size availableByte from the queue.
 
bool Enqueue (Ptr< Packet > packet, const MacHeaderType &hdrType, const GenericMacHeader &hdr)
 Enqueue a packet.
 
uint32_t GetFirstPacketHdrSize (MacHeaderType::HeaderType packetType)
 Get first packet header size of the specified type.
 
uint32_t GetFirstPacketPayloadSize (MacHeaderType::HeaderType packetType)
 Get first packet payload size of the specified type.
 
uint32_t GetFirstPacketRequiredByte (MacHeaderType::HeaderType packetType)
 Get required number of bytes to hold first packet of packetType.
 
uint32_t GetMaxSize () const
 
uint32_t GetNBytes () const
 Get number of bytes in queue.
 
const WimaxMacQueue::PacketQueueGetPacketQueue () const
 Get packet queue function.
 
uint32_t GetQueueLengthWithMACOverhead ()
 Get queue length considering also the MAC overhead.
 
uint32_t GetSize () const
 Get size of queue.
 
bool IsEmpty () const
 Check if queue is empty.
 
bool IsEmpty (MacHeaderType::HeaderType packetType) const
 Exclusively for SS.
 
Ptr< PacketPeek (GenericMacHeader &hdr) const
 Exclusively for BS.
 
Ptr< PacketPeek (GenericMacHeader &hdr, Time &timeStamp) const
 Exclusively for BS.
 
Ptr< PacketPeek (MacHeaderType::HeaderType packetType) const
 Two versions for SS without Generic MAC Header parameter, as SS's scheduler does not require to know the CID in Generic MAC Header.
 
Ptr< PacketPeek (MacHeaderType::HeaderType packetType, Time &timeStamp) const
 Two versions for SS without Generic MAC Header parameter, as SS's scheduler does not require to know the CID in Generic MAC Header.
 
void SetFragmentation (MacHeaderType::HeaderType packetType)
 Set fragmentation function.
 
void SetFragmentNumber (MacHeaderType::HeaderType packetType)
 Set fragment number for first packet of type packetType.
 
void SetFragmentOffset (MacHeaderType::HeaderType packetType, uint32_t offset)
 Set fragment offset for first packet of type packetType.
 
void SetMaxSize (uint32_t maxSize)
 set the maximum queue size
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Private Types

typedef std::deque< QueueElementPacketQueue
 PacketQueue typedef.
 

Private Member Functions

WimaxMacQueue::QueueElement Front (MacHeaderType::HeaderType packetType) const
 In the case of non-UGS service flows at the SS side the queue will store both data packets and bandwidth request packets.
 
void Pop (MacHeaderType::HeaderType packetType)
 Pop function.
 

Private Attributes

uint32_t m_bytes
 bytes
 
uint32_t m_maxSize
 maximum size
 
uint32_t m_nrDataPackets
 number data packets
 
uint32_t m_nrRequestPackets
 number request packets
 
PacketQueue m_queue
 the queue
 
TracedCallback< Ptr< const Packet > > m_traceDequeue
 dequeue trace callback
 
TracedCallback< Ptr< const Packet > > m_traceDrop
 drop trace callback
 
TracedCallback< Ptr< const Packet > > m_traceEnqueue
 enqueue trace callback
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Detailed Description

Class implementing the device packet queue.

Definition at line 29 of file wimax-mac-queue.h.

Member Typedef Documentation

◆ PacketQueue

typedef std::deque<QueueElement> ns3::WimaxMacQueue::PacketQueue
private

PacketQueue typedef.

Definition at line 247 of file wimax-mac-queue.h.

Constructor & Destructor Documentation

◆ WimaxMacQueue() [1/2]

ns3::WimaxMacQueue::WimaxMacQueue ( )

Definition at line 95 of file wimax-mac-queue.cc.

◆ WimaxMacQueue() [2/2]

ns3::WimaxMacQueue::WimaxMacQueue ( uint32_t maxSize)

Constructor.

Parameters
maxSizemaximum size of queue

Definition at line 103 of file wimax-mac-queue.cc.

◆ ~WimaxMacQueue()

ns3::WimaxMacQueue::~WimaxMacQueue ( )
override

Definition at line 111 of file wimax-mac-queue.cc.

Member Function Documentation

◆ CheckForFragmentation()

bool ns3::WimaxMacQueue::CheckForFragmentation ( MacHeaderType::HeaderType packetType)

Check for fragmentation of the first packet of the specified type.

Parameters
packetTypethe packet type
Returns
true if fragmented

Definition at line 486 of file wimax-mac-queue.cc.

References ns3::MacHeaderType::GetType(), ns3::WimaxMacQueue::QueueElement::m_fragmentation, ns3::WimaxMacQueue::QueueElement::m_hdrType, m_queue, and NS_LOG_INFO.

Referenced by GetFirstPacketHdrSize(), GetFirstPacketPayloadSize(), and GetQueueLengthWithMACOverhead().

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

◆ Dequeue() [1/2]

◆ Dequeue() [2/2]

Ptr< Packet > ns3::WimaxMacQueue::Dequeue ( MacHeaderType::HeaderType packetType,
uint32_t availableByte )

◆ Enqueue()

bool ns3::WimaxMacQueue::Enqueue ( Ptr< Packet > packet,
const MacHeaderType & hdrType,
const GenericMacHeader & hdr )

Enqueue a packet.

Parameters
packetthe packet to enqueue
hdrTypethe mac header type of the packet
hdrthe header of the packet
Returns
true if successful

Definition at line 128 of file wimax-mac-queue.cc.

References ns3::WimaxMacQueue::QueueElement::GetSize(), ns3::MacHeaderType::GetType(), ns3::MacHeaderType::HEADER_TYPE_GENERIC, m_bytes, m_maxSize, m_nrDataPackets, m_nrRequestPackets, m_queue, m_traceDrop, m_traceEnqueue, and ns3::Simulator::Now().

+ Here is the call graph for this function:

◆ Front()

WimaxMacQueue::QueueElement ns3::WimaxMacQueue::Front ( MacHeaderType::HeaderType packetType) const
private

In the case of non-UGS service flows at the SS side the queue will store both data packets and bandwidth request packets.

The two are distinguished by their headers. The below two functions are for this purpose exclusively. The Front function returns the first packet of a specific packet type from the queue (which may not necessarily be at the front of the queue), and the Pop function pops that elements.

Parameters
packetTypethe type of the packet
Returns
the first packet in the queue of the specified type

Definition at line 426 of file wimax-mac-queue.cc.

References ns3::MacHeaderType::GetType(), ns3::WimaxMacQueue::QueueElement::m_hdrType, and m_queue.

Referenced by Dequeue(), Dequeue(), Peek(), and Peek().

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

◆ GetFirstPacketHdrSize()

uint32_t ns3::WimaxMacQueue::GetFirstPacketHdrSize ( MacHeaderType::HeaderType packetType)

Get first packet header size of the specified type.

Parameters
packetTypethe packet type
Returns
the first packet header size

Definition at line 509 of file wimax-mac-queue.cc.

References CheckForFragmentation(), ns3::GenericMacHeader::GetSerializedSize(), ns3::MacHeaderType::GetSerializedSize(), ns3::MacHeaderType::GetType(), ns3::MacHeaderType::HEADER_TYPE_GENERIC, ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_hdrType, m_queue, and NS_LOG_INFO.

Referenced by GetFirstPacketRequiredByte().

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

◆ GetFirstPacketPayloadSize()

uint32_t ns3::WimaxMacQueue::GetFirstPacketPayloadSize ( MacHeaderType::HeaderType packetType)

Get first packet payload size of the specified type.

Parameters
packetTypethe packet type
Returns
the first packet payload size

Definition at line 545 of file wimax-mac-queue.cc.

References CheckForFragmentation(), ns3::Packet::GetSize(), ns3::MacHeaderType::GetType(), ns3::WimaxMacQueue::QueueElement::m_fragmentOffset, ns3::WimaxMacQueue::QueueElement::m_hdrType, ns3::WimaxMacQueue::QueueElement::m_packet, m_queue, and NS_LOG_INFO.

Referenced by GetFirstPacketRequiredByte().

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

◆ GetFirstPacketRequiredByte()

uint32_t ns3::WimaxMacQueue::GetFirstPacketRequiredByte ( MacHeaderType::HeaderType packetType)

Get required number of bytes to hold first packet of packetType.

Parameters
packetTypethe packet type
Returns
the sum of the first packet header and payload (of specified type)

Definition at line 574 of file wimax-mac-queue.cc.

References GetFirstPacketHdrSize(), GetFirstPacketPayloadSize(), and NS_LOG_INFO.

+ Here is the call graph for this function:

◆ GetMaxSize()

uint32_t ns3::WimaxMacQueue::GetMaxSize ( ) const
Returns
the maximum queue size

Definition at line 122 of file wimax-mac-queue.cc.

References m_maxSize.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetNBytes()

uint32_t ns3::WimaxMacQueue::GetNBytes ( ) const

Get number of bytes in queue.

Returns
the number of bytes

Definition at line 406 of file wimax-mac-queue.cc.

References m_bytes.

Referenced by GetQueueLengthWithMACOverhead().

+ Here is the caller graph for this function:

◆ GetPacketQueue()

const WimaxMacQueue::PacketQueue & ns3::WimaxMacQueue::GetPacketQueue ( ) const

Get packet queue function.

Returns
the packet queue

Definition at line 480 of file wimax-mac-queue.cc.

References m_queue.

◆ GetQueueLengthWithMACOverhead()

uint32_t ns3::WimaxMacQueue::GetQueueLengthWithMACOverhead ( )

Get queue length considering also the MAC overhead.

Returns
queue length

Definition at line 412 of file wimax-mac-queue.cc.

References CheckForFragmentation(), GetNBytes(), GetSize(), ns3::MacHeaderType::HEADER_TYPE_GENERIC, and queueSize.

+ Here is the call graph for this function:

◆ GetSize()

uint32_t ns3::WimaxMacQueue::GetSize ( ) const

Get size of queue.

Returns
the size

Definition at line 400 of file wimax-mac-queue.cc.

References m_queue.

Referenced by GetQueueLengthWithMACOverhead().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::WimaxMacQueue::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 69 of file wimax-mac-queue.cc.

References GetMaxSize(), m_traceDequeue, m_traceDrop, m_traceEnqueue, ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), SetMaxSize(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ IsEmpty() [1/2]

bool ns3::WimaxMacQueue::IsEmpty ( ) const

Check if queue is empty.

Returns
true if empty

Definition at line 459 of file wimax-mac-queue.cc.

References m_queue.

Referenced by Dequeue(), Dequeue(), Peek(), Peek(), Peek(), and Peek().

+ Here is the caller graph for this function:

◆ IsEmpty() [2/2]

bool ns3::WimaxMacQueue::IsEmpty ( MacHeaderType::HeaderType packetType) const

Exclusively for SS.

Returns
true if queue is empty of type packetType
Parameters
packetTypepacket type to check

Definition at line 465 of file wimax-mac-queue.cc.

References ns3::MacHeaderType::HEADER_TYPE_GENERIC, m_nrDataPackets, and m_nrRequestPackets.

◆ Peek() [1/4]

Ptr< Packet > ns3::WimaxMacQueue::Peek ( GenericMacHeader & hdr) const

Exclusively for BS.

Two versions of Peek function (with Generic MAC Header as parameter) only for BS, as BS's scheduler needs to know the CID in Generic MAC Header.

Parameters
hdrthe header of the packet
Returns
the first packet in the queue

Definition at line 320 of file wimax-mac-queue.cc.

References ns3::Packet::Copy(), IsEmpty(), ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_packet, and m_queue.

+ Here is the call graph for this function:

◆ Peek() [2/4]

Ptr< Packet > ns3::WimaxMacQueue::Peek ( GenericMacHeader & hdr,
Time & timeStamp ) const

Exclusively for BS.

Two versions of Peek function (with Generic MAC Header as parameter) only for BS, as BS's scheduler needs to know the CID in Generic MAC Header.

Parameters
hdrthe header of the packet
timeStampthe timestamp of the packet
Returns
the first packet in the queue

Definition at line 337 of file wimax-mac-queue.cc.

References ns3::Packet::Copy(), IsEmpty(), ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_packet, m_queue, and ns3::WimaxMacQueue::QueueElement::m_timeStamp.

+ Here is the call graph for this function:

◆ Peek() [3/4]

Ptr< Packet > ns3::WimaxMacQueue::Peek ( MacHeaderType::HeaderType packetType) const

Two versions for SS without Generic MAC Header parameter, as SS's scheduler does not require to know the CID in Generic MAC Header.

Parameters
packetTypethe type of the packet
Returns
the first packet in the queue

Definition at line 355 of file wimax-mac-queue.cc.

References ns3::Packet::Copy(), Front(), ns3::MacHeaderType::GetType(), ns3::MacHeaderType::HEADER_TYPE_GENERIC, IsEmpty(), ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_hdrType, and ns3::WimaxMacQueue::QueueElement::m_packet.

+ Here is the call graph for this function:

◆ Peek() [4/4]

Ptr< Packet > ns3::WimaxMacQueue::Peek ( MacHeaderType::HeaderType packetType,
Time & timeStamp ) const

Two versions for SS without Generic MAC Header parameter, as SS's scheduler does not require to know the CID in Generic MAC Header.

Parameters
packetTypethe type of the packet
timeStampthe timestamp of the packet
Returns
the first packet in the queue

Definition at line 377 of file wimax-mac-queue.cc.

References ns3::Packet::Copy(), Front(), ns3::MacHeaderType::GetType(), ns3::MacHeaderType::HEADER_TYPE_GENERIC, IsEmpty(), ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_hdrType, ns3::WimaxMacQueue::QueueElement::m_packet, and ns3::WimaxMacQueue::QueueElement::m_timeStamp.

+ Here is the call graph for this function:

◆ Pop()

void ns3::WimaxMacQueue::Pop ( MacHeaderType::HeaderType packetType)
private

Pop function.

Parameters
packetTypethe packet type

Definition at line 443 of file wimax-mac-queue.cc.

References ns3::MacHeaderType::GetType(), ns3::WimaxMacQueue::QueueElement::m_hdrType, and m_queue.

Referenced by Dequeue().

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

◆ SetFragmentation()

void ns3::WimaxMacQueue::SetFragmentation ( MacHeaderType::HeaderType packetType)

Set fragmentation function.

Set fragmentation state for first packet of type packetType

Parameters
packetTypepacketType to check

Definition at line 587 of file wimax-mac-queue.cc.

References m_queue.

Referenced by Dequeue().

+ Here is the caller graph for this function:

◆ SetFragmentNumber()

void ns3::WimaxMacQueue::SetFragmentNumber ( MacHeaderType::HeaderType packetType)

Set fragment number for first packet of type packetType.

Parameters
packetTypepacketType to check

Definition at line 600 of file wimax-mac-queue.cc.

References m_queue.

Referenced by Dequeue().

+ Here is the caller graph for this function:

◆ SetFragmentOffset()

void ns3::WimaxMacQueue::SetFragmentOffset ( MacHeaderType::HeaderType packetType,
uint32_t offset )

Set fragment offset for first packet of type packetType.

Parameters
packetTypepacketType to check
offsetoffset value to set

Definition at line 613 of file wimax-mac-queue.cc.

References m_queue.

Referenced by Dequeue().

+ Here is the caller graph for this function:

◆ SetMaxSize()

void ns3::WimaxMacQueue::SetMaxSize ( uint32_t maxSize)

set the maximum queue size

Parameters
maxSizethe max queue size

Definition at line 116 of file wimax-mac-queue.cc.

References m_maxSize.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_bytes

uint32_t ns3::WimaxMacQueue::m_bytes
private

bytes

Definition at line 250 of file wimax-mac-queue.h.

Referenced by Dequeue(), Dequeue(), Enqueue(), and GetNBytes().

◆ m_maxSize

uint32_t ns3::WimaxMacQueue::m_maxSize
private

maximum size

Definition at line 249 of file wimax-mac-queue.h.

Referenced by Enqueue(), GetMaxSize(), and SetMaxSize().

◆ m_nrDataPackets

uint32_t ns3::WimaxMacQueue::m_nrDataPackets
private

number data packets

Definition at line 251 of file wimax-mac-queue.h.

Referenced by Dequeue(), Enqueue(), and IsEmpty().

◆ m_nrRequestPackets

uint32_t ns3::WimaxMacQueue::m_nrRequestPackets
private

number request packets

Definition at line 252 of file wimax-mac-queue.h.

Referenced by Dequeue(), Enqueue(), and IsEmpty().

◆ m_queue

◆ m_traceDequeue

TracedCallback<Ptr<const Packet> > ns3::WimaxMacQueue::m_traceDequeue
private

dequeue trace callback

Definition at line 255 of file wimax-mac-queue.h.

Referenced by Dequeue(), Dequeue(), and GetTypeId().

◆ m_traceDrop

TracedCallback<Ptr<const Packet> > ns3::WimaxMacQueue::m_traceDrop
private

drop trace callback

Definition at line 256 of file wimax-mac-queue.h.

Referenced by Enqueue(), and GetTypeId().

◆ m_traceEnqueue

TracedCallback<Ptr<const Packet> > ns3::WimaxMacQueue::m_traceEnqueue
private

enqueue trace callback

Definition at line 254 of file wimax-mac-queue.h.

Referenced by Enqueue(), and GetTypeId().


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