📄 main.comm
字号:
#
# nodes: 2, max conn: 1, send rate: 0.0, seed: 0.0
#
#
# 1 connecting to 2 at time 143.36472653940541
#
set tcp_(0) [new Agent/TCP/Newreno]
$ns_ attach-agent $node_(0) $tcp_(0)
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node_(1) $sink_(0)
$ns_ connect $tcp_(0) $sink_(0)
$tcp_(0) set window_ 8
$tcp_(0) set packetSize_ 1460
# $tcp_(0) set tfile_ "out.tr"
$tcp_(0) set nodeid_ 0
$sink_(0) set nodeid_ 0
set ftp_(0) [$tcp_(0) attach-source FTP]
$ns_ at 0.0 "$ftp_(0) start"
set udp_(0) [new Agent/UDP]
$ns_ attach-agent $node_(2) $udp_(0)
set null_(0) [new Agent/Null]
$ns_ attach-agent $node_(0) $null_(0)
set cbr_(0) [new Application/Traffic/CBR]
$cbr_(0) set packetSize_ 1460
$cbr_(0) set interval_ 0.06
$cbr_(0) set random_ 1
$cbr_(0) set maxpkts_ 10000
$udp_(0) set packetSize_ 2000
$cbr_(0) attach-agent $udp_(0)
$ns_ connect $udp_(0) $null_(0)
$ns_ at 50 "$cbr_(0) start"
$ns_ at 250 "$cbr_(0) stop"
set udp_(1) [new Agent/UDP]
$ns_ attach-agent $node_(3) $udp_(1)
set null_(1) [new Agent/Null]
$ns_ attach-agent $node_(0) $null_(1)
set cbr_(1) [new Application/Traffic/CBR]
$cbr_(1) set packetSize_ 1460
$cbr_(1) set interval_ 0.065
$cbr_(1) set random_ 1
$cbr_(1) set maxpkts_ 10000
$udp_(1) set packetSize_ 2000
$cbr_(1) attach-agent $udp_(1)
$ns_ connect $udp_(1) $null_(1)
$ns_ at 100 "$cbr_(1) start"
$ns_ at 200 "$cbr_(1) stop"
set udp_(2) [new Agent/UDP]
$ns_ attach-agent $node_(4) $udp_(2)
set null_(2) [new Agent/Null]
$ns_ attach-agent $node_(0) $null_(2)
set cbr_(2) [new Application/Traffic/CBR]
$cbr_(2) set packetSize_ 1460
$cbr_(2) set interval_ 0.065
$cbr_(2) set random_ 1
$cbr_(2) set maxpkts_ 10000
$cbr_(2) attach-agent $udp_(2)
$ns_ connect $udp_(2) $null_(2)
$ns_ at 130 "$cbr_(2) start"
$ns_ at 170 "$cbr_(2) stop"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -