⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cbr-scenario.tcl

📁 对IEEE 802.11e里的分布式信道接入算法EDCA进行改进
💻 TCL
字号:
#
# A wireless lan scenario with cbr traffic over udp
# 
#

set num_nodes 3		;# number of mobilenodes in the scenario

proc create_scenario { } {
	global ns_ node_

	# Setup traffic flow between nodes
	# UDP connections between node 1 and 2

	set udp1 [new Agent/UDP]
	$udp1 set class_ 2
	$ns_ attach-agent $node_(1) $udp1

	set udp2 [new Agent/UDP]
	$udp2 set class_ 3
	$ns_ attach-agent $node_(2) $udp2

	$ns_ connect $udp1 $udp2

	set cbr1 [new Application/Traffic/CBR]
	$cbr1 attach-agent $udp1
	$cbr1 set packetSize_ 1000
	$cbr1 set interval_ 40ms
	$cbr1 set random_ 0

	set cbr2 [new Application/Traffic/CBR]
	$cbr2 attach-agent $udp2
	$cbr2 set packetSize_ 1000
	$cbr2 set interval_ 40ms
	$cbr2 set random_ 0

	$ns_ at 3.0 "$cbr1 start" 
	$ns_ at 9.0 "$cbr2 start" 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -