I write a possion traffic generator on ns3 and the code can be download at github[8]。The packet send interval between packets in a possion traffic follows exponential distribution[1].
i
n
t
e
r
v
a
l
=
8
∗
M
T
U
r
a
t
e
interval=\frac{8*MTU}{rate}
interval=rate8∗MTU with unit milliseconds. And
l
a
m
b
d
a
=
1
i
n
t
e
r
v
a
l
lambda=\frac{1}{interval}
lambda=interval1.
double e_random(double lambda){
double ret=0.0;
double u=0.0;
do{
u=(double)rand()/(double)RAND_MAX;;
}while(u<=0||u>1);
ret=(-1.0/lambda)*log(u);
return ret;
}
A point to channel is configured with bw (1Mbps). The sender is configured wirn sending rate (1Mbps) with packet MTU(1000byte). Hence, the interval between packets is 8 millisecond.
The traced round trip delay of each packet is given in the following:
The average delay tbetween two sent packets is 8.053 millisecond, which is close to the theory value 8 milliseconds.
关于pareto分布,收集了一点资料。ns2仿真器中有具体的实现。
inline double pareto(double scale, double shape) {
// When 1 < shape < 2, its mean is scale**shape, its
// variance is infinite.
return (scale * (1.0/pow(uniform(), 1.0/shape)));
}
[1]A Study of the Source Traffic Generator Using Poisson Distribution for ABR Service
[2]Creating and Testing a Poisson Process Traffic Generator for ns2, url, http://docplayer.net/29167433-Creating-and-testing-a-poisson-process-traffic-generator-for-ns2.html
[3] Poisson Traffic generator
[4] c version possion traffic generator
[5] ns2 pareto traffic generator
[6] On generating self-similar traffic using pseudo-Pareto distribution
[7] Source Traffic Modeling Using Pareto Traffic Generator
[8] possion traffic generator in ns3