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