A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
qkd-kms-queue-logic.h
Go to the documentation of this file.
1
/*
2
* Copyright(c) 2022 DOTFEESA www.tk.etf.unsa.ba
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*
7
*
8
* Author: Miralem Mehic <miralem.mehic@ieee.org>
9
* Emir Dervisevic <emir.dervisevic@etf.unsa.ba>
10
*/
11
12
#ifndef QKD_KMS_QUEUE_LOGIC_H
13
#define QKD_KMS_QUEUE_LOGIC_H
14
15
#include <queue>
16
#include "ns3/packet.h"
17
#include "ns3/object.h"
18
#include "
http.h
"
19
#include "ns3/socket.h"
20
#include "
json.h
"
21
22
namespace
ns3
{
23
24
25
/**
26
* @ingroup traffic-control
27
*
28
* Linux pfifo_fast is the default priority queue enabled on Linux
29
* systems. Packets are enqueued in three FIFO droptail queues according
30
* to three priority bands based on the packet priority.
31
*
32
* The system behaves similar to three ns3::DropTail queues operating
33
* together, in which packets from higher priority bands are always
34
* dequeued before a packet from a lower priority band is dequeued.
35
*
36
* The queue disc capacity, i.e., the maximum number of packets that can
37
* be enqueued in the queue disc, is set through the limit attribute, which
38
* plays the same role as txqueuelen in Linux. If no internal queue is
39
* provided, three DropTail queues having each a capacity equal to limit are
40
* created by default. User is allowed to provide queues, but they must be
41
* three, operate in packet mode and each have a capacity not less
42
* than limit.
43
*
44
* @note Additional waiting queues are installed between the L3
45
* and ISO/OSI layer to avoid conflicts in decision making
46
* which could lead to inaccurate routing. Experimental testing and usage!
47
*/
48
class
QKDKMSQueueLogic
:
public
Object
{
49
public
:
50
51
struct
QKDKMSQueueEntry
52
{
53
std::string
ksid
;
54
Ptr<Socket>
socket
;
55
HTTPMessage
httpMessage
;
56
Ptr<Packet>
packet
;
57
};
58
59
/**
60
* @brief Get the type ID.
61
* @return the object TypeId
62
*/
63
static
TypeId
GetTypeId
();
64
/**
65
* @brief QKDKMSQueueLogic constructor
66
*
67
* Creates a queue with a depth of 1000 packets per band by default
68
*/
69
QKDKMSQueueLogic
();
70
71
~QKDKMSQueueLogic
()
override
;
72
73
bool
Enqueue
(
QKDKMSQueueEntry
item
);
74
QKDKMSQueueLogic::QKDKMSQueueEntry
Dequeue
();
75
76
private
:
77
78
/// Traced callback: fired when a packet is enqueued
79
TracedCallback<const HTTPMessage >
m_traceEnqueue
;
80
/// Traced callback: fired when a packet is dequeued
81
TracedCallback<const HTTPMessage >
m_traceDequeue
;
82
/// Traced callback: fired when a packet is dropped
83
TracedCallback<const HTTPMessage >
m_traceDroped
;
84
85
TracedValue<uint32_t>
m_nPackets
;
//!< Number of packets in the queue
86
87
uint32_t
m_maxSize
;
88
89
uint32_t
m_numberOfQueues
;
90
91
std::vector<std::vector<QKDKMSQueueEntry> >
m_queues
;
92
93
};
94
95
}
// namespace ns3
96
97
#endif
/* QKD_KMS_QUEUE_LOGIC_H */
ns3::HTTPMessage
The basic class to represent both HTTP requests and responses.
Definition
http.h:77
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:66
ns3::QKDKMSQueueLogic
Linux pfifo_fast is the default priority queue enabled on Linux systems.
Definition
qkd-kms-queue-logic.h:48
ns3::QKDKMSQueueLogic::QKDKMSQueueLogic
QKDKMSQueueLogic()
QKDKMSQueueLogic constructor.
Definition
qkd-kms-queue-logic.cc:53
ns3::QKDKMSQueueLogic::m_traceDequeue
TracedCallback< const HTTPMessage > m_traceDequeue
Traced callback: fired when a packet is dequeued.
Definition
qkd-kms-queue-logic.h:81
ns3::QKDKMSQueueLogic::m_nPackets
TracedValue< uint32_t > m_nPackets
Number of packets in the queue.
Definition
qkd-kms-queue-logic.h:85
ns3::QKDKMSQueueLogic::~QKDKMSQueueLogic
~QKDKMSQueueLogic() override
Definition
qkd-kms-queue-logic.cc:63
ns3::QKDKMSQueueLogic::m_traceDroped
TracedCallback< const HTTPMessage > m_traceDroped
Traced callback: fired when a packet is dropped.
Definition
qkd-kms-queue-logic.h:83
ns3::QKDKMSQueueLogic::Enqueue
bool Enqueue(QKDKMSQueueEntry item)
Definition
qkd-kms-queue-logic.cc:69
ns3::QKDKMSQueueLogic::m_maxSize
uint32_t m_maxSize
Definition
qkd-kms-queue-logic.h:87
ns3::QKDKMSQueueLogic::Dequeue
QKDKMSQueueLogic::QKDKMSQueueEntry Dequeue()
Definition
qkd-kms-queue-logic.cc:112
ns3::QKDKMSQueueLogic::m_queues
std::vector< std::vector< QKDKMSQueueEntry > > m_queues
Definition
qkd-kms-queue-logic.h:91
ns3::QKDKMSQueueLogic::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
qkd-kms-queue-logic.cc:24
ns3::QKDKMSQueueLogic::m_numberOfQueues
uint32_t m_numberOfQueues
Definition
qkd-kms-queue-logic.h:89
ns3::QKDKMSQueueLogic::m_traceEnqueue
TracedCallback< const HTTPMessage > m_traceEnqueue
Traced callback: fired when a packet is enqueued.
Definition
qkd-kms-queue-logic.h:79
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition
traced-callback.h:43
ns3::TracedValue
Trace classes with value semantics.
Definition
traced-value.h:105
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
uint32_t
ns3::Create
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition
ptr.h:436
http.h
json.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::QKDKMSQueueLogic::QKDKMSQueueEntry
Definition
qkd-kms-queue-logic.h:52
ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::ksid
std::string ksid
Definition
qkd-kms-queue-logic.h:53
ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::socket
Ptr< Socket > socket
Definition
qkd-kms-queue-logic.h:54
ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::packet
Ptr< Packet > packet
Definition
qkd-kms-queue-logic.h:56
ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::httpMessage
HTTPMessage httpMessage
Definition
qkd-kms-queue-logic.h:55
src
applications
model
qkd-kms-queue-logic.h
Generated on Mon Dec 15 2025 15:21:49 for ns-3 by
1.9.8