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

📄 ex3-traffic

📁 对ns2软件进行UMTS扩展
💻
字号:
#create links between wired and BS nodes$ns_ duplex-link $W(0) $W(1) 5Mb 3ms DropTail$ns_ duplex-link $W(1) $W(2) 5Mb 4ms DropTail$ns_ duplex-link $W(2) $BS(0) 5Mb 2ms DropTail$ns_ duplex-link $W(0) $BS(1) 5Mb 2ms DropTail$ns_ duplex-link $W(2) $BS(2) 5Mb 2ms DropTail$ns_ duplex-link $W(0) $W(3) 5Mb 1ms DropTail$ns_ duplex-link $W(1) $W(3) 5Mb 1ms DropTail$ns_ duplex-link $W(3) $W(4) 5Mb 2ms DropTail$ns_ duplex-link-op $W(0) $W(1) orient right$ns_ duplex-link-op $W(1) $W(2) orient right$ns_ duplex-link-op $W(2) $BS(0) orient right$ns_ duplex-link-op $W(0) $BS(1) orient up$ns_ duplex-link-op $W(2) $BS(2) orient right$ns_ duplex-link-op $W(0) $W(3) orient right-up$ns_ duplex-link-op $W(1) $W(3) orient right-down$ns_ duplex-link-op $W(3) $W(4) orient up##################################################################### setup UDP connectionsset udp1 [new Agent/UDP]$udp1 set fid_ 2222set lm [new Agent/LossMonitor]$ns_ attach-agent $node_(0) $udp1$ns_ attach-agent $node_(1) $lm$ns_ connect $udp1 $lm# Mandatory$node_(0) 2222 speech rate_ $opt(rate)set cbr1 [new Application/Traffic/CBR]$cbr1 set rate_ $opt(rate)$cbr1 attach-agent $udp1$ns_ color 2222 blue$ns_ at $opt(start) "$cbr1 start"#$ns_ at 1.5 "$ns_ detach-agent $node_(0) $udp1"###################################################################### setup UDP connectionsset udp2 [new Agent/UDP]$udp2 set fid_ 3333set lm2 [new Agent/LossMonitor]$ns_ attach-agent $W(4) $udp2$ns_ attach-agent $node_(1) $lm2$ns_ connect $udp2 $lm2# Mandatory$W(4) 3333 http rate_ $opt(rate2)set cbr2 [new Application/Traffic/CBR]$cbr2 set rate_ $opt(rate2)$cbr2 attach-agent $udp2$ns_ color 3333 red$ns_ at $opt(start) "$cbr2 start"$ns_ at 1.7 "$ns_ detach-agent $W(4) $udp2"###################################################################### setup UDP connectionsset udp3 [new Agent/UDP]$udp3 set fid_ 4444set lm3 [new Agent/LossMonitor]$ns_ attach-agent $node_(6) $udp3$ns_ attach-agent $W(2) $lm3$ns_ connect $udp3 $lm3# Mandatory$node_(6) 4444 mail rate_ $opt(rate3)set cbr3 [new Application/Traffic/CBR]$cbr3 set rate_ $opt(rate3)$cbr3 attach-agent $udp3$ns_ color 4444 purple$ns_ at [expr $opt(start)+0.05]  "$cbr3 start"#$ns_ at 1.4 "$ns_ detach-agent $node_(1) $udp3"###################################################################### setup UDP connectionsset udp4 [new Agent/UDP]$udp4 set fid_ 5555set lm4 [new Agent/LossMonitor]$ns_ attach-agent $node_(4) $udp4$ns_ attach-agent $node_(8) $lm4$ns_ connect $udp4 $lm4# Mandatory$node_(4) 5555 speech rate_ $opt(rate4)set cbr4 [new Application/Traffic/CBR]$cbr4 set rate_ $opt(rate4)$cbr4 attach-agent $udp4$ns_ color 5555 SteelBlue$ns_ at [expr $opt(start)+0.85]  "$cbr4 start"#$ns_ at 1.4 "$ns_ detach-agent $node_(1) $udp3"###################################################################### setup UDP connectionsset udp5 [new Agent/UDP]$udp5 set fid_ 6666set lm5 [new Agent/LossMonitor]$ns_ attach-agent $node_(7) $udp5$ns_ attach-agent $node_(9) $lm5$ns_ connect $udp5 $lm5# Mandatory$node_(7) 6666 video rate_ $opt(rate5)set cbr5 [new Application/Traffic/CBR]$cbr5 set rate_ $opt(rate5)$cbr5 attach-agent $udp5$ns_ color 6666 gold$ns_ at [expr $opt(start)+0.35]  "$cbr5 start"#$ns_ at 1.4 "$ns_ detach-agent $node_(1) $udp3"####################################################################

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -