A Discrete-Event Network Simulator
QKDNetSim v2.0 (NS-3 v3.41) @ (+)
API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
service-flow-record.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007,2008, 2009 INRIA
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  * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18  */
19 
20 #include "service-flow-record.h"
21 
22 namespace ns3
23 {
24 
26  : m_grantSize(0),
27  m_grantTimeStamp(Seconds(0)),
28  m_dlTimeStamp(Seconds(0)),
29  m_pktsSent(0),
30  m_pktsRcvd(0),
31  m_bytesSent(0),
32  m_bytesRcvd(0),
33  m_requestedBandwidth(0),
34  m_grantedBandwidth(0),
35  m_bwSinceLastExpiry(0)
36 {
38  m_backlogged = 0;
39  m_backloggedTemp = 0;
41 }
42 
44 {
45 }
46 
47 void
49 {
50  m_grantSize = grantSize;
51 }
52 
53 uint32_t
55 {
56  return m_grantSize;
57 }
58 
59 void
61 {
62  m_grantTimeStamp = grantTimeStamp;
63 }
64 
65 Time
67 {
68  return m_grantTimeStamp;
69 }
70 
71 void
73 {
74  m_dlTimeStamp = dlTimeStamp;
75 }
76 
77 Time
79 {
80  return m_dlTimeStamp;
81 }
82 
83 void
85 {
86  m_pktsSent = pktsSent;
87 }
88 
89 void
91 {
92  m_pktsSent += pktsSent;
93 }
94 
95 uint32_t
97 {
98  return m_pktsSent;
99 }
100 
101 void
103 {
104  m_pktsRcvd = pktsRcvd;
105 }
106 
107 void
109 {
110  m_pktsRcvd += pktsRcvd;
111 }
112 
113 uint32_t
115 {
116  return m_pktsRcvd;
117 }
118 
119 void
121 {
122  m_bytesSent = bytesSent;
123 }
124 
125 void
127 {
128  m_bytesSent += bytesSent;
129 }
130 
131 uint32_t
133 {
134  return m_bytesSent;
135 }
136 
137 void
139 {
140  m_bytesRcvd = bytesRcvd;
141 }
142 
143 void
145 {
146  m_bytesRcvd += bytesRcvd;
147 }
148 
149 uint32_t
151 {
152  return m_bytesRcvd;
153 }
154 
155 void
156 ServiceFlowRecord::SetRequestedBandwidth(uint32_t requestedBandwidth)
157 {
158  m_requestedBandwidth = requestedBandwidth;
159 }
160 
161 void
163 {
164  m_requestedBandwidth += requestedBandwidth;
165 }
166 
167 uint32_t
169 {
170  return m_requestedBandwidth;
171 }
172 
173 void
174 ServiceFlowRecord::SetGrantedBandwidth(uint32_t grantedBandwidth)
175 {
176  m_grantedBandwidth = grantedBandwidth;
177 }
178 
179 void
181 {
182  m_grantedBandwidth += grantedBandwidth;
183 }
184 
185 uint32_t
187 {
188  return m_grantedBandwidth;
189 }
190 
191 void
192 ServiceFlowRecord::SetGrantedBandwidthTemp(uint32_t grantedBandwidthTemp)
193 {
194  m_grantedBandwidthTemp = grantedBandwidthTemp;
195 }
196 
197 void
198 ServiceFlowRecord::UpdateGrantedBandwidthTemp(uint32_t grantedBandwidthTemp)
199 {
200  m_grantedBandwidthTemp += grantedBandwidthTemp;
201 }
202 
203 uint32_t
205 {
206  return m_grantedBandwidthTemp;
207 }
208 
209 void
211 {
212  m_lastGrantTime = grantTime;
213 }
214 
215 Time
217 {
218  return m_lastGrantTime;
219 }
220 
221 void
223 {
224  m_backlogged = backlogged;
225 }
226 
227 void
229 {
230  m_backlogged += backlogged;
231 }
232 
233 uint32_t
235 {
236  return m_backlogged;
237 }
238 
239 void
240 ServiceFlowRecord::SetBackloggedTemp(uint32_t backloggedTemp)
241 {
242  m_backloggedTemp = backloggedTemp;
243 }
244 
245 void
247 {
248  m_backloggedTemp += backloggedTemp;
249 }
250 
251 uint32_t
253 {
254  return m_backloggedTemp;
255 }
256 
257 void
258 ServiceFlowRecord::SetBwSinceLastExpiry(uint32_t bwSinceLastExpiry)
259 {
260  m_bwSinceLastExpiry = bwSinceLastExpiry;
261 }
262 
263 void
265 {
266  m_bwSinceLastExpiry += bwSinceLastExpiry;
267 }
268 
269 uint32_t
271 {
272  return m_bwSinceLastExpiry;
273 }
274 
275 } // namespace ns3
uint32_t GetBacklogged() const
uint32_t GetPktsSent() const
void UpdateRequestedBandwidth(uint32_t requestedBandwidth)
update the requested bandwidth
void UpdateBytesRcvd(uint32_t bytesRcvd)
update the number of received bytes by adding bytesRcvd
void UpdatePktsSent(uint32_t pktsSent)
update the number of sent packets by adding pktsSent
int32_t m_backlogged
back logged
void SetPktsRcvd(uint32_t pktsRcvd)
Set the number of received packets.
void UpdateGrantedBandwidthTemp(uint32_t grantedBandwidthTemp)
update the temporary granted bandwidth
uint32_t GetRequestedBandwidth() const
void UpdateBytesSent(uint32_t bytesSent)
update the number of sent bytes by adding bytesSent
uint32_t m_pktsRcvd
packets received
void SetRequestedBandwidth(uint32_t requestedBandwidth)
set the requested bandwidth
uint32_t m_bytesRcvd
bytes received
void IncreaseBacklogged(uint32_t backlogged)
increase backlogged
void SetDlTimeStamp(Time dlTimeStamp)
Set the DlTimeStamp.
uint32_t GetBackloggedTemp() const
void SetBackloggedTemp(uint32_t backloggedTemp)
set temporary back logged
void SetPktsSent(uint32_t pktsSent)
set the number of sent packets in this service flow
uint32_t GetGrantedBandwidthTemp() const
Time m_lastGrantTime
last grant time
uint32_t m_grantedBandwidthTemp
Temporary variable used to sort list.
uint32_t m_pktsSent
packets sent
void SetGrantSize(uint32_t grantSize)
Set the grant size (only for UGS service flows)
uint32_t GetGrantedBandwidth() const
void SetGrantedBandwidthTemp(uint32_t grantedBandwidthTemp)
set the temporary granted bandwidth
uint32_t m_grantedBandwidth
granted badnwidth
void IncreaseBackloggedTemp(uint32_t backloggedTemp)
increase temporary back logged
void UpdatePktsRcvd(uint32_t pktsRcvd)
update the number of received packets by adding pktsRcvd
void SetBwSinceLastExpiry(uint32_t bwSinceLastExpiry)
set BW since last expiry
uint32_t m_requestedBandwidth
requested bandwidth
void UpdateGrantedBandwidth(uint32_t grantedBandwidth)
update the granted bandwidth
void SetBytesRcvd(uint32_t bytesRcvd)
Set the number of received bytes.
uint32_t m_bwSinceLastExpiry
bandwidth granted since last expiry of minimum reserved traffic rate interval, only for nrtPS,...
void UpdateBwSinceLastExpiry(uint32_t bwSinceLastExpiry)
update BW since last expiry
void SetBacklogged(uint32_t backlogged)
set backlogged
uint32_t m_bytesSent
bytes sent
void SetBytesSent(uint32_t bytesSent)
Set the number of sent bytes.
uint32_t GetBwSinceLastExpiry() const
Time m_dlTimeStamp
time when this service flow's traffic was last sent
void SetLastGrantTime(Time grantTime)
set last grant time
uint32_t GetGrantSize() const
void SetGrantTimeStamp(Time grantTimeStamp)
Set the grant time stamp.
void SetGrantedBandwidth(uint32_t grantedBandwidth)
set the granted bandwidth
int32_t m_backloggedTemp
back logged temp
Time m_grantTimeStamp
allocation (for data) for UGS flows and unicast poll (for bandwidth requests) for non-UGS flows
uint32_t m_grantSize
only used for UGS flow
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1326
Every class exported by the ns3 library is enclosed in the ns3 namespace.