A Discrete-Event Network Simulator
API
three-gpp-http-variables.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions
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  * Author: Budiarto Herman <budiarto.herman@magister.fi>
19  *
20  */
21 
22 #ifndef THREE_GPP_HTTP_VARIABLES_H
23 #define THREE_GPP_HTTP_VARIABLES_H
24 
25 #include <ns3/object.h>
26 #include <ns3/nstime.h>
27 #include <ns3/random-variable-stream.h>
28 
29 
30 namespace ns3 {
31 
32 
71 {
72 public:
75 
80  static TypeId GetTypeId ();
81 
92  uint32_t GetMtuSize ();
93 
104  uint32_t GetRequestSize ();
105 
117 
129  uint32_t GetMainObjectSize ();
130 
142 
155  uint32_t GetEmbeddedObjectSize ();
156 
169  uint32_t GetNumOfEmbeddedObjects ();
170 
182  Time GetReadingTime ();
183 
196  Time GetParsingTime ();
197 
211  int64_t AssignStreams (int64_t stream);
212 
213  // SETTER METHODS
214 
218  void SetRequestSize (uint32_t constant);
222  void SetMainObjectGenerationDelay (Time constant);
227  void SetMainObjectSizeMean (uint32_t mean);
231  void SetMainObjectSizeStdDev (uint32_t stdDev);
235  void SetEmbeddedObjectGenerationDelay (Time constant);
240  void SetEmbeddedObjectSizeMean (uint32_t mean);
244  void SetEmbeddedObjectSizeStdDev (uint32_t stdDev);
249  void SetNumOfEmbeddedObjectsMax (uint32_t max);
254  void SetNumOfEmbeddedObjectsShape (double shape);
259  void SetNumOfEmbeddedObjectsScale (uint32_t scale);
263  void SetReadingTimeMean (Time mean);
267  void SetParsingTimeMean (Time mean);
268 
269 private:
274  void UpdateMainObjectMuAndSigma (void);
279  void UpdateEmbeddedObjectMuAndSigma (void);
280 
281  void DoInitialize (void); // overridden from base class
282 
309  uint32_t m_lowMtu;
311  uint32_t m_highMtu;
345 
346 }; // end of `class ThreeGppHttpVariables`
347 
348 
349 } // end of `namespace ns3`
350 
351 #endif /* THREE_GPP_HTTP_VARIABLES_H */
352 
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::ThreeGppHttpVariables::DoInitialize
void DoInitialize(void)
Initialize() implementation.
Definition: three-gpp-http-variables.cc:343
ns3::ThreeGppHttpVariables::m_embeddedObjectGenerationDelayRng
Ptr< ConstantRandomVariable > m_embeddedObjectGenerationDelayRng
Random variable for determining the delay needed to generate an embedded object (in seconds).
Definition: three-gpp-http-variables.h:318
ns3::ThreeGppHttpVariables::m_highMtuProbability
double m_highMtuProbability
High MTU size probability.
Definition: three-gpp-http-variables.h:313
ns3::ThreeGppHttpVariables::m_parsingTimeRng
Ptr< ExponentialRandomVariable > m_parsingTimeRng
Random variable for determining the length of parsing time (in seconds).
Definition: three-gpp-http-variables.h:344
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ThreeGppHttpVariables::m_requestSizeRng
Ptr< ConstantRandomVariable > m_requestSizeRng
Random variable for determining request size (in bytes).
Definition: three-gpp-http-variables.h:290
ns3::ThreeGppHttpVariables::m_embeddedObjectSizeMax
uint32_t m_embeddedObjectSizeMax
Upper bound parameter for m_embeddedObjectSizeRng.
Definition: three-gpp-http-variables.h:330
ns3::ThreeGppHttpVariables::GetReadingTime
Time GetReadingTime()
Draws a random length of time which is spent by a hypothetical human user (HTTP client) to read a web...
Definition: three-gpp-http-variables.cc:311
ns3::ThreeGppHttpVariables::m_mainObjectSizeMin
uint32_t m_mainObjectSizeMin
Lower bound parameter for m_mainObjectSizeRng;.
Definition: three-gpp-http-variables.h:305
ns3::ThreeGppHttpVariables::SetEmbeddedObjectGenerationDelay
void SetEmbeddedObjectGenerationDelay(Time constant)
Definition: three-gpp-http-variables.cc:426
ns3::ThreeGppHttpVariables::GetMainObjectGenerationDelay
Time GetMainObjectGenerationDelay()
Returns the constant length of time needed by an HTTP server to generate a main object.
Definition: three-gpp-http-variables.cc:210
ns3::ThreeGppHttpVariables::m_numOfEmbeddedObjectsScale
uint32_t m_numOfEmbeddedObjectsScale
Scale parameter for m_numOfEmbeddedObjectsRng.
Definition: three-gpp-http-variables.h:336
ns3::ThreeGppHttpVariables::SetParsingTimeMean
void SetParsingTimeMean(Time mean)
Definition: three-gpp-http-variables.cc:499
ns3::ThreeGppHttpVariables::SetNumOfEmbeddedObjectsScale
void SetNumOfEmbeddedObjectsScale(uint32_t scale)
Definition: three-gpp-http-variables.cc:481
ns3::ThreeGppHttpVariables::m_lowMtu
uint32_t m_lowMtu
Lower MTU size.
Definition: three-gpp-http-variables.h:309
ns3::ThreeGppHttpVariables::m_readingTimeRng
Ptr< ExponentialRandomVariable > m_readingTimeRng
Random variable for determining the length of reading time (in seconds).
Definition: three-gpp-http-variables.h:340
ns3::ThreeGppHttpVariables::m_mainObjectSizeRng
Ptr< LogNormalRandomVariable > m_mainObjectSizeRng
Random variable for determining main object size (in bytes).
Definition: three-gpp-http-variables.h:299
ns3::ThreeGppHttpVariables::SetMainObjectSizeMean
void SetMainObjectSizeMean(uint32_t mean)
Definition: three-gpp-http-variables.cc:399
ns3::ThreeGppHttpVariables::UpdateEmbeddedObjectMuAndSigma
void UpdateEmbeddedObjectMuAndSigma(void)
Upon and after object initialization, update random variable Mu and Sigma based on changes to attribu...
Definition: three-gpp-http-variables.cc:385
ns3::ThreeGppHttpVariables::SetEmbeddedObjectSizeMean
void SetEmbeddedObjectSizeMean(uint32_t mean)
Definition: three-gpp-http-variables.cc:435
ns3::ThreeGppHttpVariables::ThreeGppHttpVariables
ThreeGppHttpVariables()
Create a new instance with default configuration of random distributions.
Definition: three-gpp-http-variables.cc:38
ns3::ThreeGppHttpVariables::UpdateMainObjectMuAndSigma
void UpdateMainObjectMuAndSigma(void)
Upon and after object initialization, update random variable Mu and Sigma based on changes to attribu...
Definition: three-gpp-http-variables.cc:371
ns3::ThreeGppHttpVariables::SetNumOfEmbeddedObjectsShape
void SetNumOfEmbeddedObjectsShape(double shape)
Definition: three-gpp-http-variables.cc:471
ns3::Ptr< UniformRandomVariable >
ns3::ThreeGppHttpVariables::GetRequestSize
uint32_t GetRequestSize()
Returns the constant HTTP request size in bytes.
Definition: three-gpp-http-variables.cc:203
ns3::ThreeGppHttpVariables::SetEmbeddedObjectSizeStdDev
void SetEmbeddedObjectSizeStdDev(uint32_t stdDev)
Definition: three-gpp-http-variables.cc:449
ns3::ThreeGppHttpVariables::m_embeddedObjectSizeRng
Ptr< LogNormalRandomVariable > m_embeddedObjectSizeRng
Random variable for determining embedded object size (in bytes).
Definition: three-gpp-http-variables.h:322
ns3::ThreeGppHttpVariables::m_highMtu
uint32_t m_highMtu
Higher MTU size.
Definition: three-gpp-http-variables.h:311
ns3::ThreeGppHttpVariables::SetMainObjectSizeStdDev
void SetMainObjectSizeStdDev(uint32_t stdDev)
Definition: three-gpp-http-variables.cc:413
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
ns3::ThreeGppHttpVariables::GetTypeId
static TypeId GetTypeId()
Returns the object TypeId.
Definition: three-gpp-http-variables.cc:55
ns3::ThreeGppHttpVariables::m_embeddedObjectSizeMin
uint32_t m_embeddedObjectSizeMin
Lower bound parameter for m_embeddedObjectSizeRng.
Definition: three-gpp-http-variables.h:328
ns3::ThreeGppHttpVariables::m_mainObjectSizeMax
uint32_t m_mainObjectSizeMax
Upper bound parameter for m_mainObjectSizeRng;.
Definition: three-gpp-http-variables.h:307
ns3::ThreeGppHttpVariables::GetParsingTime
Time GetParsingTime()
Draws a random length of time which simulate the small delay caused by HTTP client looking for any em...
Definition: three-gpp-http-variables.cc:318
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::ThreeGppHttpVariables::m_mainObjectGenerationDelayRng
Ptr< ConstantRandomVariable > m_mainObjectGenerationDelayRng
Random variable for determining the delay needed to generate a main object (in seconds).
Definition: three-gpp-http-variables.h:295
ns3::ThreeGppHttpVariables::m_mainObjectSizeStdDev
uint32_t m_mainObjectSizeStdDev
Standard deviation parameter for m_mainObjectSizeRng;.
Definition: three-gpp-http-variables.h:303
ns3::ThreeGppHttpVariables::GetEmbeddedObjectGenerationDelay
Time GetEmbeddedObjectGenerationDelay()
Returns the constant length of time needed by an HTTP server to generate an embedded object.
Definition: three-gpp-http-variables.cc:244
ns3::ThreeGppHttpVariables::SetRequestSize
void SetRequestSize(uint32_t constant)
Definition: three-gpp-http-variables.cc:354
ns3::ThreeGppHttpVariables
Container of various random variables to assist in generating web browsing traffic pattern.
Definition: three-gpp-http-variables.h:71
ns3::ThreeGppHttpVariables::SetNumOfEmbeddedObjectsMax
void SetNumOfEmbeddedObjectsMax(uint32_t max)
Definition: three-gpp-http-variables.cc:462
ns3::ThreeGppHttpVariables::m_numOfEmbeddedObjectsRng
Ptr< ParetoRandomVariable > m_numOfEmbeddedObjectsRng
Random variable for determining the number of embedded objects.
Definition: three-gpp-http-variables.h:334
ns3::ThreeGppHttpVariables::GetMainObjectSize
uint32_t GetMainObjectSize()
Draws a random main object size (in bytes) to be sent by an HTTP server.
Definition: three-gpp-http-variables.cc:217
ns3::ThreeGppHttpVariables::m_embeddedObjectSizeStdDev
uint32_t m_embeddedObjectSizeStdDev
Standard deviation parameter for m_embeddedObjectSizeRng.
Definition: three-gpp-http-variables.h:326
ns3::ThreeGppHttpVariables::m_embeddedObjectSizeMean
uint32_t m_embeddedObjectSizeMean
Mean parameter for m_embeddedObjectSizeRng.
Definition: three-gpp-http-variables.h:324
ns3::ThreeGppHttpVariables::GetMtuSize
uint32_t GetMtuSize()
Draws a random value of maximum transmission unit (MTU) size in bytes.
Definition: three-gpp-http-variables.cc:186
ns3::max
double max(double x, double y)
Definition: cobalt-queue-disc.cc:137
ns3::ThreeGppHttpVariables::SetReadingTimeMean
void SetReadingTimeMean(Time mean)
Definition: three-gpp-http-variables.cc:491
ns3::ThreeGppHttpVariables::SetMainObjectGenerationDelay
void SetMainObjectGenerationDelay(Time constant)
Definition: three-gpp-http-variables.cc:363
ns3::ThreeGppHttpVariables::m_mainObjectSizeMean
uint32_t m_mainObjectSizeMean
Mean parameter for m_mainObjectSizeRng;.
Definition: three-gpp-http-variables.h:301
ns3::ThreeGppHttpVariables::GetNumOfEmbeddedObjects
uint32_t GetNumOfEmbeddedObjects()
Draws a random integer indicating the number of embedded objects in a main object.
Definition: three-gpp-http-variables.cc:278
ns3::ThreeGppHttpVariables::GetEmbeddedObjectSize
uint32_t GetEmbeddedObjectSize()
Draws a random embedded object size (in bytes) to be sent by an HTTP server.
Definition: three-gpp-http-variables.cc:251
ns3::ThreeGppHttpVariables::AssignStreams
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: three-gpp-http-variables.cc:325
ns3::ThreeGppHttpVariables::m_mtuSizeRng
Ptr< UniformRandomVariable > m_mtuSizeRng
Random variable for determining MTU size (in bytes).
Definition: three-gpp-http-variables.h:286