I write a possion traffic generator on ns3 and the code can be download at (https://github.com/SoonyangZhang/possion-traffic)。The packet send interval between packets in a possion traffic follows exponential distribution[1].
with unit milliseconds. And
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.
看着最后的仿真结果,数据包与rtt的关系。
实际求出的数据包平均发送间隔是8.053 millisecond。可以说是很接近配置的参数了。
[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, url, https://sites.google.com/site/cclljj/downloads/download_poisson_generator