capture-scenario.tcl

来自「NS-2.28的802.11e协议扩展源代码」· TCL 代码 · 共 36 行

TCL
36
字号
## A wireless lan scenario to study the capture effect### defaultsset num_nodes 7					;# number of mobilenodes in the scenarioset pktsize 512					;# pktsize for background trafficset endtime 120# Queue set limit_ 200proc create_scenario { } {	global ns_ node_ num_nodes	global pktsize	##########################################################	# Setup FTP flows	for {set i 1} {$i < $num_nodes} {incr i} {		set B		[new Application/FTP]		set B_src	[new Agent/TCP]		set B_sink	[new Agent/TCPSink/DelAck]		$B_src		set packetSize_ $pktsize		$B_src		set class_ [expr $i + 1]		$ns_ attach-agent $node_(0) $B_src		$ns_ attach-agent $node_($i) $B_sink		$ns_ connect $B_src $B_sink		$B attach-agent $B_src		puts "FTP B$i with pktsize $pktsize flows from Node0 to Node$i"		$ns_ at 3.0 "$B start"	}}

⌨️ 快捷键说明

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