12#include <ns3/double.h>
14#include <ns3/uinteger.h>
44 TypeId(
"ns3::ThreeGppHttpVariables")
46 .AddConstructor<ThreeGppHttpVariables>()
49 .AddAttribute(
"RequestSize",
50 "The constant size of HTTP request packet (in bytes).",
56 .AddAttribute(
"MainObjectGenerationDelay",
57 "The constant time needed by HTTP server "
58 "to generate a main object as a response.",
64 .AddAttribute(
"MainObjectSizeMean",
65 "The mean of main object sizes (in bytes).",
69 .AddAttribute(
"MainObjectSizeStdDev",
70 "The standard deviation of main object sizes (in bytes).",
74 .AddAttribute(
"MainObjectSizeMin",
75 "The minimum value of main object sizes (in bytes).",
79 .AddAttribute(
"MainObjectSizeMax",
80 "The maximum value of main object sizes (in bytes).",
87 "EmbeddedObjectGenerationDelay",
88 "The constant time needed by HTTP server "
89 "to generate an embedded object as a response.",
95 .AddAttribute(
"EmbeddedObjectSizeMean",
96 "The mean of embedded object sizes (in bytes).",
100 .AddAttribute(
"EmbeddedObjectSizeStdDev",
101 "The standard deviation of embedded object sizes (in bytes).",
105 .AddAttribute(
"EmbeddedObjectSizeMin",
106 "The minimum value of embedded object sizes (in bytes).",
110 .AddAttribute(
"EmbeddedObjectSizeMax",
111 "The maximum value of embedded object sizes (in bytes).",
117 .AddAttribute(
"NumOfEmbeddedObjectsMax",
118 "The upper bound parameter of Pareto distribution for "
119 "the number of embedded objects per web page. The actual "
120 "maximum value is this value subtracted by the scale parameter.",
124 .AddAttribute(
"NumOfEmbeddedObjectsShape",
125 "The shape parameter of Pareto distribution for "
126 "the number of embedded objects per web page.",
131 "NumOfEmbeddedObjectsScale",
132 "The scale parameter of Pareto distribution for "
133 "the number of embedded objects per web page.",
139 .AddAttribute(
"ReadingTimeMean",
140 "The mean of reading time.",
146 .AddAttribute(
"ParsingTimeMean",
147 "The mean of parsing time.",
153 .AddAttribute(
"LowMtuSize",
154 "The lower MTU size.",
158 .AddAttribute(
"HighMtuSize",
159 "The higher MTU size.",
163 .AddAttribute(
"HighMtuProbability",
164 "The probability that higher MTU size is used.",
206 <<
" must be greater than"
207 <<
" the `MainObjectSizeMin` attribute.");
237 <<
" must be greater than"
238 <<
" the `EmbeddedObjectSizeMin` attribute.");
263 <<
" must be greater than"
264 <<
" the `NumOfEmbeddedObjectsScale` attribute.");
345 const double a = std::log(1.0 + (a1 / a2));
347 const double sigma = std::sqrt(a);
348 NS_LOG_DEBUG(
this <<
" Mu= " << mu <<
" Sigma= " << sigma <<
".");
359 const double a = std::log(1.0 + (a1 / a2));
361 const double sigma = std::sqrt(a);
362 NS_LOG_DEBUG(
this <<
" Mu= " << mu <<
" Sigma= " << sigma <<
".");
436 NS_ASSERT_MSG(std::fabs(shape - 1.0) > 0.000001,
"Shape parameter must not equal to 1.0.");
444 NS_ASSERT_MSG(scale > 0,
"Scale parameter must be greater than zero.");
This class can be used to hold variables of floating point type such as 'double' or 'float'.
A base class which provides memory management and object aggregation.
bool IsInitialized() const
Check if the object has been initialized.
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)
void SetParsingTimeMean(Time mean)
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.
void SetReadingTimeMean(Time mean)
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.
void SetMainObjectSizeMean(uint32_t mean)
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)
void SetNumOfEmbeddedObjectsMax(uint32_t max)
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...
uint32_t m_lowMtu
Lower MTU size.
Simulation virtual time values and global simulation resolution.
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
log2() macro definition; to deal with Bug 1467 .
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.