A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
service-flow-record.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008 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#ifndef SERVICE_FLOW_RECORD_H
21#define SERVICE_FLOW_RECORD_H
22
23#include "bs-net-device.h"
24#include "bs-uplink-scheduler.h"
25
26#include "ns3/nstime.h"
27#include "ns3/ptr.h"
28
29#include <stdint.h>
30
31namespace ns3
32{
33
34/**
35 * \ingroup wimax
36 * \brief this class implements a structure to manage some parameters and statistics related to a
37 * service flow
38 */
40{
41 public:
44
45 /**
46 * \brief Set the grant size (only for UGS service flows)
47 * \param grantSize the grant size to set
48 */
49 void SetGrantSize(uint32_t grantSize);
50 /**
51 * \return the grant size (only for ugs service flows)
52 */
53 uint32_t GetGrantSize() const;
54 /**
55 * \brief Set the grant time stamp. Used for data allocation for ugs flows, and unicast poll
56 * (bw request) for non-UGS flows
57 * \param grantTimeStamp the grant time stamp to set
58 */
59 void SetGrantTimeStamp(Time grantTimeStamp);
60 /**
61 * \return the grant time stamp. Used for data allocation for ugs flows, and unicast poll (bw
62 * request) for non-UGS flows
63 */
64 Time GetGrantTimeStamp() const;
65 /**
66 * \brief Set the DlTimeStamp.
67 * \param dlTimeStamp time when this service flow's traffic was last sent.
68 */
69 void SetDlTimeStamp(Time dlTimeStamp);
70 /**
71 * \return the DlTimeStamp: time when this service flow's traffic was last sent
72 */
73 Time GetDlTimeStamp() const;
74 /**
75 * \brief set the number of sent packets in this service flow
76 * \param pktsSent the number of sent packets
77 */
78 void SetPktsSent(uint32_t pktsSent);
79 /**
80 * \brief update the number of sent packets by adding pktsSent
81 * \param pktsSent the number of sent packets to add
82 */
83 void UpdatePktsSent(uint32_t pktsSent);
84 /**
85 * \return the number of sent packet in this service flow
86 */
87 uint32_t GetPktsSent() const;
88 /**
89 * \brief Set the number of received packets
90 * \param pktsRcvd The number of received packets
91 */
92 void SetPktsRcvd(uint32_t pktsRcvd);
93 /**
94 * \brief update the number of received packets by adding pktsRcvd
95 * \param pktsRcvd the number of received packets to add
96 */
97 void UpdatePktsRcvd(uint32_t pktsRcvd);
98 /**
99 * \return the number of received packet
100 */
101 uint32_t GetPktsRcvd() const;
102 /**
103 * \brief Set the number of sent bytes
104 * \param bytesSent the number of sent bytes
105 */
106 void SetBytesSent(uint32_t bytesSent);
107 /**
108 * \brief update the number of sent bytes by adding bytesSent
109 * \param bytesSent the number of bytes to add
110 */
111 void UpdateBytesSent(uint32_t bytesSent);
112 /**
113 * \return The number of sent bytes
114 */
115 uint32_t GetBytesSent() const;
116 /**
117 * \brief Set the number of received bytes
118 * \param bytesRcvd the number of received bytes
119 */
120 void SetBytesRcvd(uint32_t bytesRcvd);
121 /**
122 * \brief update the number of received bytes by adding bytesRcvd
123 * \param bytesRcvd the number of bytes to add
124 */
125 void UpdateBytesRcvd(uint32_t bytesRcvd);
126 /**
127 * \return The number of received bytes
128 */
129 uint32_t GetBytesRcvd() const;
130
131 /**
132 * \brief set the requested bandwidth
133 * \param requestedBandwidth the requested bandwidth
134 */
135 void SetRequestedBandwidth(uint32_t requestedBandwidth);
136 /**
137 * \brief update the requested bandwidth
138 * \param requestedBandwidth the requested bandwidth update
139 */
140 void UpdateRequestedBandwidth(uint32_t requestedBandwidth);
141 /**
142 * \return The requested bandwidth
143 */
145
146 /**
147 * \brief set the granted bandwidth
148 * \param grantedBandwidth the granted bandwidth
149 */
150 void SetGrantedBandwidth(uint32_t grantedBandwidth);
151 /**
152 * \brief update the granted bandwidth
153 * \param grantedBandwidth the granted bandwidth update
154 */
155 void UpdateGrantedBandwidth(uint32_t grantedBandwidth);
156 /**
157 * \return The granted bandwidth
158 */
160
161 /**
162 * \brief set the temporary granted bandwidth
163 * \param grantedBandwidthTemp the temporary granted bandwidth
164 */
165 void SetGrantedBandwidthTemp(uint32_t grantedBandwidthTemp);
166 /**
167 * \brief update the temporary granted bandwidth
168 * \param grantedBandwidthTemp the temporary granted bandwidth
169 */
170 void UpdateGrantedBandwidthTemp(uint32_t grantedBandwidthTemp);
171 /**
172 * \return The temporary granted bandwidth
173 */
175
176 /**
177 * \brief set BW since last expiry
178 * \param bwSinceLastExpiry bandwidth since last expiry
179 */
180 void SetBwSinceLastExpiry(uint32_t bwSinceLastExpiry);
181 /**
182 * \brief update BW since last expiry
183 * \param bwSinceLastExpiry bandwidth since last expiry
184 */
185 void UpdateBwSinceLastExpiry(uint32_t bwSinceLastExpiry);
186 /**
187 * \return The bandwidth since last expiry
188 */
190
191 /**
192 * \brief set last grant time
193 * \param grantTime grant time to set
194 */
195 void SetLastGrantTime(Time grantTime);
196 /**
197 * \return The last grant time
198 */
199 Time GetLastGrantTime() const;
200
201 /**
202 * \brief set backlogged
203 * \param backlogged number of backlogged
204 */
205 void SetBacklogged(uint32_t backlogged);
206 /**
207 * \brief increase backlogged
208 * \param backlogged the number of backlogged to update
209 */
210 void IncreaseBacklogged(uint32_t backlogged);
211 /**
212 * \return The number of backlogged
213 */
214 uint32_t GetBacklogged() const;
215
216 /**
217 * \brief set temporary back logged
218 * \param backloggedTemp the temporary backlogged value
219 */
220 void SetBackloggedTemp(uint32_t backloggedTemp);
221 /**
222 * \brief increase temporary back logged
223 * \param backloggedTemp the temporary backlogged value
224 */
225 void IncreaseBackloggedTemp(uint32_t backloggedTemp);
226 /**
227 * \return The value of temporary backlogged
228 */
230
231 private:
232 uint32_t m_grantSize; ///< only used for UGS flow
233 Time m_grantTimeStamp; ///< allocation (for data) for UGS flows and unicast poll (for bandwidth
234 ///< requests) for non-UGS flows
235 Time m_dlTimeStamp; ///< time when this service flow's traffic was last sent
236
237 // stats members
238 uint32_t m_pktsSent; ///< packets sent
239 uint32_t m_pktsRcvd; ///< packets received
240
241 uint32_t m_bytesSent; ///< bytes sent
242 uint32_t m_bytesRcvd; ///< bytes received
243
244 uint32_t m_requestedBandwidth; ///< requested bandwidth
245 uint32_t m_grantedBandwidth; ///< granted badnwidth
246 uint32_t m_grantedBandwidthTemp; ///< Temporary variable used to sort list. Necessary to keep
247 ///< original order
248
249 /** bandwidth granted since last expiry of minimum reserved traffic rate interval,
250 * only for nrtPS, to make sure minimum reserved traffic rate is maintained */
252 Time m_lastGrantTime; ///< last grant time
253 int32_t m_backlogged; ///< back logged
254 int32_t m_backloggedTemp; ///< back logged temp
255};
256
257} // namespace ns3
258
259#endif /* SERVICE_FLOW_RECORD_H */
this class implements a structure to manage some parameters and statistics related to a service flow
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
Every class exported by the ns3 library is enclosed in the ns3 namespace.