?? ftp-scenario.tcl
字號:
#
# A wireless lan scenario with ftp traffic over tcp
#
#
# defaults
set num_nodes 3
set packet_size 256
proc create_scenario { } {
global ns_ node_
global num_nodes packet_size
# num_nodes should be odd
if {[expr $num_nodes % 2] == 0} {
puts "num_nodes should be odd"
exit
}
set num_ftp [expr ($num_nodes - 1) / 2]
for {set i 0} {$i < $num_ftp} {incr i} {
set n [expr (2 * $i) + 1]
set client $node_($n)
set server $node_([expr $n + 1])
set src [new Agent/TCP]
$src set class_ [expr 2 + $i]
$src set syn_ 1
$src set packetSize_ $packet_size
$ns_ attach-agent $client $src
set sink [new Agent/TCPSink/DelAck]
$ns_ attach-agent $server $sink
$ns_ connect $src $sink
set ftp [new Application/FTP]
$ftp attach-agent $src
$ns_ at [expr 3.0 + ($i * 0.1)] "$ftp start"
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -