A possion traffic generator for ns3

  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=rate8MTU 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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值