21 #ifndef SATELLITE_QUEUE_H_
22 #define SATELLITE_QUEUE_H_
24 #include <ns3/nstime.h>
25 #include <ns3/object.h>
26 #include <ns3/packet.h>
27 #include <ns3/traced-callback.h>
124 virtual bool IsEmpty(
void)
const;
131 virtual bool Enqueue(Ptr<Packet> p);
137 virtual Ptr<Packet>
Dequeue(
void);
150 virtual Ptr<const Packet>
Peek(
void)
const;
246 void Drop(Ptr<Packet> packet);
331 #ifndef SATELLITE_QUEUE_H_
332 #define SATELLITE_QUEUE_H_
334 #include <ns3/nstime.h>
335 #include <ns3/object.h>
336 #include <ns3/packet.h>
337 #include <ns3/traced-callback.h>
355 class SatQueue :
public Object
431 virtual bool IsEmpty(
void)
const;
438 virtual bool Enqueue(Ptr<Packet> p);
444 virtual Ptr<Packet>
Dequeue(
void);
457 virtual Ptr<const Packet>
Peek(
void)
const;
553 void Drop(Ptr<Packet> packet);
638 #ifndef SATELLITE_QUEUE_H_
639 #define SATELLITE_QUEUE_H_
641 #include <ns3/nstime.h>
642 #include <ns3/object.h>
643 #include <ns3/packet.h>
644 #include <ns3/traced-callback.h>
662 class SatQueue :
public Object
738 virtual bool IsEmpty(
void)
const;
745 virtual bool Enqueue(Ptr<Packet> p);
751 virtual Ptr<Packet>
Dequeue(
void);
764 virtual Ptr<const Packet>
Peek(
void)
const;
860 void Drop(Ptr<Packet> packet);
SatQueue implements a queue utilized in the satellite module.
uint32_t m_nTotalReceivedPackets
~SatQueue()
Destructor for SatQueue.
static TypeId GetTypeId(void)
Get the type ID.
virtual void DoDispose()
Dispose of this class instance.
virtual Ptr< const Packet > Peek(void) const
Get a copy of the item at the front of the queue without removing it.
virtual bool IsEmpty(void) const
Is the queue empty.
PacketContainer_t m_packets
Packet container.
void SetFlowId(uint32_t flowId)
Configured flow index for this queue.
void ResetShortTermStatistics()
Reset the short term statistics.
uint32_t m_nEnqueBytesSinceReset
EventCallbackContainer_t m_queueEventCallbacks
Container of callbacks for queue related events.
virtual void PushFront(Ptr< Packet > p)
PushFront pushes a fragmented packet back to the front of the packet container.
Callback< void, SatQueue::QueueEvent_t, uint8_t > QueueEventCallback
Callback to indicate queue related event.
uint32_t GetTotalReceivedBytes(void) const
Get total number of bytes received by this queue since the simulation began, or since ResetStatistics...
void Drop(Ptr< Packet > packet)
Drop a packet.
Callback< void, Ptr< Packet > > LogonCallback
logon msg sending callback
void DequeueAll(void)
Flush the queue.
std::deque< Ptr< Packet > > PacketContainer_t
uint32_t m_nTotalReceivedBytes
void AddLogonCallback(SatQueue::LogonCallback cb)
Add queue event callback.
virtual bool Enqueue(Ptr< Packet > p)
Enque pushes packet to the packet container (back)
LogonCallback m_logonCallback
Callback to send control messages.
TracedCallback< Ptr< const Packet > > m_traceDrop
uint8_t m_flowId
An unique id for each queue.
uint32_t GetNumSmallerPackets(uint32_t maxPacketSizeBytes) const
Method checks how many packets are smaller or equal in size than the maximum packets size threshold s...
uint32_t GetTotalDroppedBytes(void) const
Get total number of bytes dropped by this Queue since the simulation began, or since ResetStatistics ...
TracedCallback< Ptr< const Packet > > m_traceEnqueue
uint32_t GetNPackets(void) const
Get number of packets currently stored in the queue.
uint32_t m_nTotalDroppedPackets
uint32_t m_nTotalDroppedBytes
void SendEvent(SatQueue::QueueEvent_t event)
Send queue event to all registered callbacks.
virtual Ptr< Packet > Dequeue(void)
Deque takes packet from the packet container (front)
uint32_t m_nDequeBytesSinceReset
void ResetStatistics(void)
Resets the counts for dropped packets, dropped bytes, received packets, and received bytes.
void AddQueueEventCallback(SatQueue::QueueEventCallback cb)
Add queue event callback.
TracedCallback< Ptr< const Packet > > m_traceDequeue
std::vector< QueueEventCallback > EventCallbackContainer_t
uint32_t GetTotalReceivedPackets(void) const
Get total number of packets received by this Queue since the simulation began, or since ResetStatisti...
uint32_t GetTotalDroppedPackets(void) const
Get total number of bytes dropped by this Queue since the simulation began, or since ResetStatistics ...
uint32_t m_maxPackets
Maximum allowed packets within the packet container.
uint32_t GetNBytes(void) const
Get number of bytes currently stored in the queue.
SatQueue()
Default constructor.
QueueStats_t GetQueueStatistics(bool reset)
GetQueueStatistics returns a struct of KPIs.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
QueueStats_t definition for passing queue related statistics to any interested modules.
uint32_t m_volumeOutBytes
double m_outgoingRateKbps
double m_incomingRateKbps
uint32_t m_queueSizeBytes