从Linux学到NS2:(四)时延约束与队列溢出概率的关系

本文通过NS2仿真探讨无限队长排队系统中,时延约束如何影响队列溢出概率。使用Tcl脚本进行仿真,通过分析out.tr和curq.q文件,结合awk脚本处理数据,揭示两者之间的关系。Xlabel表示时延,Ylabel表示溢出概率,方法一是根据队长变化统计溢出概率。
摘要由CSDN通过智能技术生成

        根据之前几篇所学,可以通过NS2来仿真分析一个无限队长的排队系统中,聚合流服务的时延约束与队列溢出概率的关系。

1. Tcl代码:

# n0[poi]- 
#         |-r1-n2
# n1[onf]-
set ns [new Simulator]
#打开trace文件
set nd [open out.tr w]
$ns trace-all $nd
set namtracefd [open poisson.nam w]
$ns namtrace-all $namtracefd
#设置路由器(在ns2中,路由器就是节点)
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set r1 [$ns node]
$ns duplex-link $n0 $r1 10Mb 1ms DropTail
$ns duplex-link $n1 $r1 10Mb 1ms DropTail
$ns duplex-link $r1 $n2 1Mb 1ms RED

$ns duplex-link-op $n0 $r1 orient right-down
$ns duplex-link-op $n1 $r1 orient right-up
$ns duplex-link-op $r1 $n2 orient right
#相当于定义了一个方法
proc attach-expoo-traffic { node sink size burst idle rate } {
	#Get an instance of the simulator
	set ns [Simulator instance]

	#Create a UDP agent and attach it to the node
	set source [new Agent/UDP]
	$ns attach-agent $node $source

	#Create an Expoo traffic agent and set its configuration 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值