A possion taffic generator for ns3

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010643777/article/details/88015113

  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].
i n t e r v a l = 8 M T U 1000 r a t e interval=\frac{8*MTU*1000}{rate} with unit milliseconds. And l a m b d a = 1 i n t e r v a l lambda=\frac{1}{interval}

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

猜你喜欢

转载自blog.csdn.net/u010643777/article/details/88015113