A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
dynamic-queue-limits.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016 Universita' degli Studi di Napoli Federico II
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Authors: Pasquale Imputato <p.imputato@gmail.com>
18
* Stefano Avallone <stefano.avallone@unina.it>
19
*
20
* This code is a port of the dynamic queue limits library implemented
21
* in the Linux kernel by
22
* Author: Tom Herbert <therbert@google.com>
23
*/
24
25
#ifndef DYNAMIC_QUEUE_LIMITS_H
26
#define DYNAMIC_QUEUE_LIMITS_H
27
28
#include "
queue-limits.h
"
29
30
#include "ns3/nstime.h"
31
#include "ns3/traced-value.h"
32
33
#include <limits.h>
34
35
namespace
ns3
36
{
37
65
class
DynamicQueueLimits
:
public
QueueLimits
66
{
67
public
:
72
static
TypeId
GetTypeId
();
73
74
DynamicQueueLimits
();
75
~DynamicQueueLimits
()
override
;
76
77
void
Reset
()
override
;
78
void
Completed
(uint32_t count)
override
;
79
int32_t
Available
()
const override
;
80
void
Queued
(uint32_t count)
override
;
81
82
private
:
90
int32_t
Posdiff
(int32_t a, int32_t b);
91
92
// Fields accessed in enqueue path
93
uint32_t
m_numQueued
{0};
94
uint32_t
m_adjLimit
{0};
95
uint32_t
m_lastObjCnt
{0};
96
97
// Fields accessed only by completion path
98
TracedValue<uint32_t>
m_limit
;
99
uint32_t
m_numCompleted
{0};
100
101
uint32_t
m_prevOvlimit
{0};
102
uint32_t
m_prevNumQueued
{0};
103
uint32_t
m_prevLastObjCnt
{0};
104
105
uint32_t
m_lowestSlack
{
std::numeric_limits<uint32_t>::max
()};
106
Time
m_slackStartTime
{
Seconds
(0)};
107
108
// Configuration
109
uint32_t
m_maxLimit
;
110
uint32_t
m_minLimit
;
111
Time
m_slackHoldTime
;
112
};
113
114
}
// namespace ns3
115
116
#endif
/* DYNAMIC_QUEUE_LIMITS_H */
max
#define max(a, b)
Definition:
80211b.c:42
ns3::DynamicQueueLimits
DynamicQueueLimits would be used in conjunction with a producer/consumer type queue (possibly a netde...
Definition:
dynamic-queue-limits.h:66
ns3::DynamicQueueLimits::m_adjLimit
uint32_t m_adjLimit
limit + num_completed
Definition:
dynamic-queue-limits.h:94
ns3::DynamicQueueLimits::~DynamicQueueLimits
~DynamicQueueLimits() override
Definition:
dynamic-queue-limits.cc:80
ns3::DynamicQueueLimits::DynamicQueueLimits
DynamicQueueLimits()
Definition:
dynamic-queue-limits.cc:74
ns3::DynamicQueueLimits::Reset
void Reset() override
Reset queue limits state.
Definition:
dynamic-queue-limits.cc:86
ns3::DynamicQueueLimits::m_numCompleted
uint32_t m_numCompleted
Total ever completed.
Definition:
dynamic-queue-limits.h:99
ns3::DynamicQueueLimits::m_slackStartTime
Time m_slackStartTime
Time slacks seen.
Definition:
dynamic-queue-limits.h:106
ns3::DynamicQueueLimits::m_numQueued
uint32_t m_numQueued
Total ever queued.
Definition:
dynamic-queue-limits.h:93
ns3::DynamicQueueLimits::m_prevOvlimit
uint32_t m_prevOvlimit
Previous over limit.
Definition:
dynamic-queue-limits.h:101
ns3::DynamicQueueLimits::m_minLimit
uint32_t m_minLimit
Minimum limit.
Definition:
dynamic-queue-limits.h:110
ns3::DynamicQueueLimits::m_slackHoldTime
Time m_slackHoldTime
Time to measure slack.
Definition:
dynamic-queue-limits.h:111
ns3::DynamicQueueLimits::m_prevNumQueued
uint32_t m_prevNumQueued
Previous queue total.
Definition:
dynamic-queue-limits.h:102
ns3::DynamicQueueLimits::m_lastObjCnt
uint32_t m_lastObjCnt
Count at last queuing.
Definition:
dynamic-queue-limits.h:95
ns3::DynamicQueueLimits::m_prevLastObjCnt
uint32_t m_prevLastObjCnt
Previous queuing cnt.
Definition:
dynamic-queue-limits.h:103
ns3::DynamicQueueLimits::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
dynamic-queue-limits.cc:45
ns3::DynamicQueueLimits::Completed
void Completed(uint32_t count) override
Record number of completed bytes and recalculate the limit.
Definition:
dynamic-queue-limits.cc:102
ns3::DynamicQueueLimits::Posdiff
int32_t Posdiff(int32_t a, int32_t b)
Calculates the difference between the two operators and returns the number if positive,...
Definition:
dynamic-queue-limits.cc:228
ns3::DynamicQueueLimits::m_lowestSlack
uint32_t m_lowestSlack
Lowest slack found.
Definition:
dynamic-queue-limits.h:105
ns3::DynamicQueueLimits::Available
int32_t Available() const override
Available is called from NotifyTransmittedBytes to calculate the number of bytes that can be passed a...
Definition:
dynamic-queue-limits.cc:211
ns3::DynamicQueueLimits::m_limit
TracedValue< uint32_t > m_limit
Current limit.
Definition:
dynamic-queue-limits.h:98
ns3::DynamicQueueLimits::Queued
void Queued(uint32_t count) override
Record the number of bytes queued.
Definition:
dynamic-queue-limits.cc:218
ns3::DynamicQueueLimits::m_maxLimit
uint32_t m_maxLimit
Max limit.
Definition:
dynamic-queue-limits.h:109
ns3::QueueLimits
Abstract base class for NetDevice queue length controller.
Definition:
queue-limits.h:44
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::TracedValue< uint32_t >
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition:
nstime.h:1326
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
queue-limits.h
src
network
utils
dynamic-queue-limits.h
Generated on Sun Mar 3 2024 17:11:06 for ns-3 by
1.9.1