请教一个NS脚本为什么没有生成流量,谢谢
12-10
trace 文件为空
# tcl
set ns [new Simulator]
set n1 [$ns node]
set n2 [$ns node]
set n0 [$ns node]
set n3 [$ns node]
# define link
$ns duplex-link $n0 $n1 100Mb 2ms DropTail
$ns duplex-link $n1 $n2 15Mb 10ms RED
$ns queue-limit $n2 $n1 250
$ns queue-limit $n1 $n2 250
$ns duplex-link $n3 $n2 100Mb 3ms DropTail
# set nodes' position
$ns duplex-link-op $n0 $n1 orient right
# set nodes' position
$ns duplex-link-op $n0 $n1 orient right
$ns duplex-link-op $n1 $n2 orient right
$ns duplex-link-op $n1 $n2 queuePos 0
$ns duplex-link-op $n2 $n1 queuePos 0
$ns duplex-link-op $n3 $n2 orient left
#set tcp source
#set tcp0 [$ns create-connection TCP/Reno $n0 TCPSink $n3 0]
#$tcp0 set window_ 15
#set ftp0 [$tcp0 attach-source FTP]
set udp0 [new Agent/UDP]
$ns attach-agent $n0 $udp0
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
$cbr0 attach-agent $udp0
set null0 [new Agent/Null]
$ns attach-agent $n3 $null0
$ns connect $udp0 $null0
#Tracing a link
set tracefd [open twoflow.tr w]
$ns trace-all $tracefd
set namfd [open twoflow.nam w]
$ns namtrace-all $namfd
$ns at 0.5 "$cbr0 start"
$ns at 1 "$cbr0 stop"
$ns at 1.5 "finish"
# Define 'finish' procedure
proc finish {} {
global ns tracefd namfd
$ns flush-trace
close $tracefd
close $namfd
exec nam twoflow.nam &
exit 0
}
$ns run
# tcl
set ns [new Simulator]
set n1 [$ns node]
set n2 [$ns node]
set n0 [$ns node]
set n3 [$ns node]
# define link
$ns duplex-link $n0 $n1 100Mb 2ms DropTail
$ns duplex-link $n1 $n2 15Mb 10ms RED
$ns queue-limit $n2 $n1 250
$ns queue-limit $n1 $n2 250
$ns duplex-link $n3 $n2 100Mb 3ms DropTail
# set nodes' position
$ns duplex-link-op $n0 $n1 orient right
# set nodes' position
$ns duplex-link-op $n0 $n1 orient right
$ns duplex-link-op $n1 $n2 orient right
$ns duplex-link-op $n1 $n2 queuePos 0
$ns duplex-link-op $n2 $n1 queuePos 0
$ns duplex-link-op $n3 $n2 orient left
#set tcp source
#set tcp0 [$ns create-connection TCP/Reno $n0 TCPSink $n3 0]
#$tcp0 set window_ 15
#set ftp0 [$tcp0 attach-source FTP]
set udp0 [new Agent/UDP]
$ns attach-agent $n0 $udp0
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
$cbr0 attach-agent $udp0
set null0 [new Agent/Null]
$ns attach-agent $n3 $null0
$ns connect $udp0 $null0
#Tracing a link
set tracefd [open twoflow.tr w]
$ns trace-all $tracefd
set namfd [open twoflow.nam w]
$ns namtrace-all $namfd
$ns at 0.5 "$cbr0 start"
$ns at 1 "$cbr0 stop"
$ns at 1.5 "finish"
# Define 'finish' procedure
proc finish {} {
global ns tracefd namfd
$ns flush-trace
close $tracefd
close $namfd
exec nam twoflow.nam &
exit 0
}
$ns run
没有node config?
node config 是默认的啊
相关文章:
- 请问为什么手机中的GPS要收流量费?(05-08)
- 联通的光纤猫pon终端的上网接入过程及流量性能如何 (05-08)
- 通信的流量计算(05-08)
- 如何对交换机某一端口的出站流量进行限制(05-08)
- 流量计费的时候IP包头的部分算在流量里吗?(05-08)
- 请介绍有关sensor networks的入门文章!(05-08)
射频专业培训教程推荐