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

📄 test-ptp-1.tcl

📁 ns-2的文件包。多多下载
💻 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 + -