A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
three-gpp-http-variables.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013 Magister Solutions
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Budiarto Herman <budiarto.herman@magister.fi>
7 *
8 */
9
10#ifndef THREE_GPP_HTTP_VARIABLES_H
11#define THREE_GPP_HTTP_VARIABLES_H
12
13#include <ns3/nstime.h>
14#include <ns3/object.h>
15#include <ns3/random-variable-stream.h>
16
17namespace ns3
18{
19
20/**
21 * @ingroup http
22 * Container of various random variables to assist in generating web browsing
23 * traffic pattern.
24 *
25 * The available random values to be retrieved are:
26 * - MTU size --- 536 bytes or 1460 bytes;
27 * - request size --- constant 350 bytes;
28 * - delay in generating a main object --- 0 second;
29 * - main object size --- truncated LogNormal distribution with a mean of
30 * 10710 bytes;
31 * @image html http-main-object-size.png
32 * - delay in generating an embedded object --- 0 second;
33 * - embedded object size (in bytes) --- truncated LogNormal distribution
34 * with a mean of 7758 bytes;
35 * @image html http-embedded-object-size.png
36 * - number of embedded object per web page --- truncated Pareto distribution
37 * with a mean of approximately 3.95 (after truncation);
38 * @image html http-num-of-embedded-objects.png
39 * - length of reading time (in seconds) --- unbounded exponential
40 * distribution with a mean of 30 seconds; and
41 * @image html http-reading-time.png
42 * - length of parsing time (in seconds) --- unbounded exponential
43 * distribution with a mean of 0.13 seconds.
44 * @image html http-parsing-time.png
45 *
46 * Most parameters of the random distributions are configurable via attributes
47 * and methods of this class. The default values are according to the following
48 * references:
49 * - 3GPP TR 25.892, "Feasibility Study for Orthogonal Frequency Division
50 * Multiplexing (OFDM) for UTRAN enhancement"
51 * - IEEE 802.16m, "Evaluation Methodology Document (EMD)",
52 * IEEE 802.16m-08/004r5, July 2008.
53 * - NGMN Alliance, "NGMN Radio Access Performance Evaluation Methodology",
54 * v1.0, January 2008.
55 * - 3GPP2-TSGC5, "HTTP, FTP and TCP models for 1xEV-DV simulations", 2001.
56 */
58{
59 public:
60 /// Create a new instance with default configuration of random distributions.
62
63 /**
64 * Returns the object TypeId.
65 * @return The object TypeId.
66 */
67 static TypeId GetTypeId();
68
69 /**
70 * Draws a random value of maximum transmission unit (MTU) size in bytes.
71 *
72 * The possible MTU sizes are 1460 bytes and 536 bytes with 76% and 24%
73 * chances, respectively. The selected value is typically used by the sockets
74 * of HTTP servers to send the response packets (both main objects and
75 * embedded objects) to the requesting HTTP clients.
76 *
77 * @return MTU size in bytes.
78 */
80
81 /**
82 * Returns the constant HTTP request size in bytes.
83 *
84 * By default, HTTP request size is 350 bytes, which can be modified by
85 * setting the `RequestSize` attribute or calling the SetRequestSize()
86 * method. This value applies to requests by HTTP client for main objects
87 * and embedded objects alike.
88 *
89 * @return Request size in bytes.
90 */
92
93 /**
94 * Returns the constant length of time needed by an HTTP server to generate
95 * a main object.
96 *
97 * By default, main objects are generated instantly, i.e., zero delay. This
98 * can be modified by setting the `MainObjectGenerationDelay` attribute or by
99 * calling the SetMainObjectGenerationDelay() method.
100 *
101 * @return The delay for generating a main object.
102 */
104
105 /**
106 * Draws a random main object size (in bytes) to be sent by an HTTP server.
107 *
108 * The size of main objects are determined by a truncated log-normal random
109 * distribution. The default distribution settings produces random integers
110 * with a mean of 10710 bytes and a standard deviation of 25032 bytes, and
111 * then truncated to fit between 100 bytes and 2 MB. These default settings
112 * can be modified via attributes or class methods.
113 *
114 * @return Main object size in bytes.
115 */
117
118 /**
119 * Returns the constant length of time needed by an HTTP server to generate
120 * an embedded object.
121 *
122 * By default, embedded objects are generated instantly, i.e., zero delay.
123 * This can be modified by setting the `EmbeddedObjectGenerationDelay`
124 * attribute or by calling the SetEmbeddedObjectGenerationDelay() method.
125 *
126 * @return The delay for generating an embedded object.
127 */
129
130 /**
131 * Draws a random embedded object size (in bytes) to be sent by an HTTP
132 * server.
133 *
134 * The size of embedded objects are determined by a truncated log-normal
135 * random distribution. The default distribution settings produces random
136 * integers with a mean of 7758 bytes and a standard deviation of 126168
137 * bytes, and then truncated to fit between 50 bytes and 2 MB. These default
138 * settings can be modified via attributes or class methods.
139 *
140 * @return Embedded object size in bytes.
141 */
143
144 /**
145 * Draws a random integer indicating the number of embedded objects in a
146 * main object.
147 *
148 * The number of embedded objects in a main object is typically discovered
149 * when the HTTP client is parsing the main object in question. This number
150 * is determined by a truncated Pareto distribution. The default distribution
151 * settings produces (after truncation) random integers within [0, 53)
152 * interval, with an actual mean of approximately 3.95.
153 *
154 * @return The number of embedded objects.
155 */
157
158 /**
159 * Draws a random length of time which is spent by a hypothetical human user
160 * (HTTP client) to read a web page before transitioning to another web page.
161 *
162 * Reading time is determined by an exponential distribution. The default
163 * distribution settings produces random values with a mean of 30 seconds
164 * without any maximum bound. The mean can be modified by setting the
165 * `ReadingTimeMean` attribute or by calling the SetReadingTimeMean() method.
166 *
167 * @return Time interval for reading a web page.
168 */
170
171 /**
172 * Draws a random length of time which simulate the small delay caused by
173 * HTTP client looking for any embedded objects within the received main
174 * object.
175 *
176 * Parsing time is determined by an exponential distribution. The default
177 * distribution settings produces random values with a mean of 130 ms without
178 * any maximum bound. The mean can be modified by setting the
179 * `ParsingTimeMean` attribute or by calling the SetParsingTimeMean() method.
180 *
181 * @return time interval for parsing a main object
182 */
184
185 /**
186 * Assign a fixed random variable stream number to the random variables used
187 * by this model.
188 *
189 * Different random variable stream number makes random number generators to
190 * produce different set of random values, thus possibly resulting to
191 * different simulation results. On the other hand, two identical simulations
192 * which use the same stream number should produce identical results (the
193 * repeatability property of ns-3 simulation).
194 *
195 * @param stream The first stream index to use.
196 * @return The number of stream indices assigned by this model.
197 */
198 int64_t AssignStreams(int64_t stream);
199
200 // SETTER METHODS
201
202 /**
203 * @param constant Request size in bytes.
204 */
205 void SetRequestSize(uint32_t constant);
206 /**
207 * @param constant The delay for generating a main object.
208 */
209 void SetMainObjectGenerationDelay(Time constant);
210 /**
211 * @param mean The mean of main object sizes in bytes. Must be greater than
212 * zero.
213 */
215 /**
216 * @param stdDev The standard deviation of main object sizes in bytes.
217 */
219 /**
220 * @param constant The delay for generating an embedded object.
221 */
223 /**
224 * @param mean The mean of embedded object sizes in bytes. Must be greater
225 * than zero.
226 */
228 /**
229 * @param stdDev The standard deviation of embedded object sizes in bytes.
230 */
232 /**
233 * @param max The upper bound parameter of the Pareto distribution for
234 * determining the number of embedded objects per web page.
235 */
237 /**
238 * @param shape The shape parameter of the Pareto distribution for
239 * determining the number of embedded objects per web page.
240 */
241 void SetNumOfEmbeddedObjectsShape(double shape);
242 /**
243 * @param scale The scale parameter of the Pareto distribution for
244 * determining the number of embedded objects per web page.
245 */
247 /**
248 * @param mean The mean length of time needed for reading a web page.
249 */
250 void SetReadingTimeMean(Time mean);
251 /**
252 * @param mean The mean length of time needed for parsing a main object.
253 */
254 void SetParsingTimeMean(Time mean);
255
256 private:
257 /**
258 * @brief Upon and after object initialization, update random variable
259 * Mu and Sigma based on changes to attribute values.
260 */
262 /**
263 * @brief Upon and after object initialization, update random variable
264 * Mu and Sigma based on changes to attribute values.
265 */
267
268 void DoInitialize() override; // overridden from base class
269
270 /**
271 * Random variable for determining MTU size (in bytes).
272 */
274 /**
275 * Random variable for determining request size (in bytes).
276 */
278 /**
279 * Random variable for determining the delay needed to generate a main object
280 * (in seconds).
281 */
283 /**
284 * Random variable for determining main object size (in bytes).
285 */
287 /// Mean parameter for #m_mainObjectSizeRng;
289 /// Standard deviation parameter for #m_mainObjectSizeRng;
291 /// Lower bound parameter for #m_mainObjectSizeRng;
293 /// Upper bound parameter for #m_mainObjectSizeRng;
295 /// Lower MTU size
297 /// Higher MTU size
299 /// High MTU size probability
301 /**
302 * Random variable for determining the delay needed to generate an embedded
303 * object (in seconds).
304 */
306 /**
307 * Random variable for determining embedded object size (in bytes).
308 */
310 /// Mean parameter for #m_embeddedObjectSizeRng.
312 /// Standard deviation parameter for #m_embeddedObjectSizeRng.
314 /// Lower bound parameter for #m_embeddedObjectSizeRng.
316 /// Upper bound parameter for #m_embeddedObjectSizeRng.
318 /**
319 * Random variable for determining the number of embedded objects.
320 */
322 /// Scale parameter for #m_numOfEmbeddedObjectsRng.
324 /**
325 * Random variable for determining the length of reading time (in seconds).
326 */
328 /**
329 * Random variable for determining the length of parsing time (in seconds).
330 */
332
333}; // end of `class ThreeGppHttpVariables`
334
335} // namespace ns3
336
337#endif /* THREE_GPP_HTTP_VARIABLES_H */
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Container of various random variables to assist in generating web browsing traffic pattern.
uint32_t m_mainObjectSizeMax
Upper bound parameter for m_mainObjectSizeRng;.
Ptr< ExponentialRandomVariable > m_parsingTimeRng
Random variable for determining the length of parsing time (in seconds).
uint32_t m_mainObjectSizeMin
Lower bound parameter for m_mainObjectSizeRng;.
Ptr< LogNormalRandomVariable > m_embeddedObjectSizeRng
Random variable for determining embedded object size (in bytes).
uint32_t m_numOfEmbeddedObjectsScale
Scale parameter for m_numOfEmbeddedObjectsRng.
void SetMainObjectGenerationDelay(Time constant)
static TypeId GetTypeId()
Returns the object TypeId.
Ptr< ConstantRandomVariable > m_requestSizeRng
Random variable for determining request size (in bytes).
void SetEmbeddedObjectGenerationDelay(Time constant)
uint32_t GetMtuSize()
Draws a random value of maximum transmission unit (MTU) size in bytes.
uint32_t m_mainObjectSizeMean
Mean parameter for m_mainObjectSizeRng;.
void DoInitialize() override
Initialize() implementation.
Time GetEmbeddedObjectGenerationDelay()
Returns the constant length of time needed by an HTTP server to generate an embedded object.
void UpdateMainObjectMuAndSigma()
Upon and after object initialization, update random variable Mu and Sigma based on changes to attribu...
void SetMainObjectSizeStdDev(uint32_t stdDev)
Ptr< LogNormalRandomVariable > m_mainObjectSizeRng
Random variable for determining main object size (in bytes).
uint32_t m_embeddedObjectSizeMax
Upper bound parameter for m_embeddedObjectSizeRng.
void SetNumOfEmbeddedObjectsScale(uint32_t scale)
Ptr< ExponentialRandomVariable > m_readingTimeRng
Random variable for determining the length of reading time (in seconds).
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Ptr< ConstantRandomVariable > m_mainObjectGenerationDelayRng
Random variable for determining the delay needed to generate a main object (in seconds).
Time GetReadingTime()
Draws a random length of time which is spent by a hypothetical human user (HTTP client) to read a web...
Time GetMainObjectGenerationDelay()
Returns the constant length of time needed by an HTTP server to generate a main object.
uint32_t GetRequestSize()
Returns the constant HTTP request size in bytes.
uint32_t GetMainObjectSize()
Draws a random main object size (in bytes) to be sent by an HTTP server.
uint32_t m_mainObjectSizeStdDev
Standard deviation parameter for m_mainObjectSizeRng;.
Ptr< ParetoRandomVariable > m_numOfEmbeddedObjectsRng
Random variable for determining the number of embedded objects.
void SetEmbeddedObjectSizeMean(uint32_t mean)
uint32_t GetEmbeddedObjectSize()
Draws a random embedded object size (in bytes) to be sent by an HTTP server.
void SetEmbeddedObjectSizeStdDev(uint32_t stdDev)
double m_highMtuProbability
High MTU size probability.
uint32_t m_embeddedObjectSizeMean
Mean parameter for m_embeddedObjectSizeRng.
uint32_t m_embeddedObjectSizeStdDev
Standard deviation parameter for m_embeddedObjectSizeRng.
void UpdateEmbeddedObjectMuAndSigma()
Upon and after object initialization, update random variable Mu and Sigma based on changes to attribu...
void SetNumOfEmbeddedObjectsShape(double shape)
uint32_t m_highMtu
Higher MTU size.
uint32_t GetNumOfEmbeddedObjects()
Draws a random integer indicating the number of embedded objects in a main object.
uint32_t m_embeddedObjectSizeMin
Lower bound parameter for m_embeddedObjectSizeRng.
Ptr< ConstantRandomVariable > m_embeddedObjectGenerationDelayRng
Random variable for determining the delay needed to generate an embedded object (in seconds).
void SetRequestSize(uint32_t constant)
ThreeGppHttpVariables()
Create a new instance with default configuration of random distributions.
Ptr< UniformRandomVariable > m_mtuSizeRng
Random variable for determining MTU size (in bytes).
Time GetParsingTime()
Draws a random length of time which simulate the small delay caused by HTTP client looking for any em...
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.