?? test-ptp-1.tcl
字號:
# simple stop-ane-wait protocolset ns [new Simulator]set n0 [$ns node]set n1 [$ns node]$ns at 0.0 "$n0 label Sender"$ns at 0.0 "$n1 label Receiver"set nf [open test-ptp-1.nam w]$ns namtrace-all $nf$ns duplex-link $n0 $n1 0.2Mb 200ms DropTail$ns duplex-link-op $n0 $n1 orient rightset tcp [new Agent/TCP]$tcp set maxcwnd_ 1$ns attach-agent $n0 $tcpset sink [new Agent/TCPSink]$ns attach-agent $n1 $sink$ns connect $tcp $sinkset ftp [new Application/FTP]$ftp attach-agent $tcp### set operations$ns at 0.01 "$ftp start"$ns at 2.6 "$ftp stop"$ns at 2.6 "finish"### take snapshotsforeach i "0.0 0.3 0.6 0.9 1.2 1.3 1.4 \ 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5" {$ns at $i "$ns snapshot"}### take snapshot operations$ns at 1.25 "$ns re-rewind-nam"$ns at 2.2 "$ns rewind-nam"$ns at 2.55 "$ns terminate-nam"### add annotations$ns at 0.0 "$ns trace-annotate \"Simple Stop-and-Wait protocol\""$ns at 0.01 "$ns trace-annotate \"FTP starts at 0.1\""$ns at 2.49 "$ns trace-annotate \"FTP stops\""proc finish {} { global ns nf $ns flush-trace close $nf exit 0}$ns run
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -