ns2 有线UDP模拟
来源:互联网 发布:69直播软件 编辑:程序博客网 时间:2024/04/28 21:34
set ns [new Simulator]
set tracefile [open out.tr w]
$ns trace-all $tracefile
set nf [open out.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns tracefile nf
$ns flush-trace
close $nf
close $tracefile
exec nam out.nam &
exit 0
}
set n0 [$ns node]
set n1 [$ns node]
$ns duplex-link $n0 $n1 0.01Mb 1ms DropTail
set udp0 [new Agent/UDP]
set udp1 [new Agent/Null]
$ns attach-agent $n0 $udp0
$ns attach-agent $n1 $udp1
$ns connect $udp0 $udp1
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
$cbr0 attach-agent $udp0
$ns at 0.0 "$cbr0 start"
$ns at 5.0 "$cbr0 stop"
$ns at 6.0 "finish"
$ns run
set tracefile [open out.tr w]
$ns trace-all $tracefile
set nf [open out.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns tracefile nf
$ns flush-trace
close $nf
close $tracefile
exec nam out.nam &
exit 0
}
set n0 [$ns node]
set n1 [$ns node]
$ns duplex-link $n0 $n1 0.01Mb 1ms DropTail
set udp0 [new Agent/UDP]
set udp1 [new Agent/Null]
$ns attach-agent $n0 $udp0
$ns attach-agent $n1 $udp1
$ns connect $udp0 $udp1
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
$cbr0 attach-agent $udp0
$ns at 0.0 "$cbr0 start"
$ns at 5.0 "$cbr0 stop"
$ns at 6.0 "finish"
$ns run
0 0
- ns2 有线UDP模拟
- NS2的UDP模拟
- NS2模拟相关知识
- 简单有线网络模型模拟
- NS2中有线网络trace文件分析脚本(awk)
- ns2无线模拟相关网站
- 利用NS2进行无线网络模拟
- NS2网络模拟(1)-延迟
- NS2网络模拟(2)-丢包率
- ns2无线模拟相关网站
- ns2 无线模拟经典例子
- NS2网络模拟(1)-延迟
- NS2网络模拟(2)-丢包率
- NS2中无线网络模拟之一
- 有线和无线结合的模型模拟
- QT UDP 多网卡 禁用/启用有线网卡
- NS2无线模拟课程学习笔记
- NS2模拟脚本大致编写流程
- 关于swift与objective-c混合使用
- 如何修改UIButton的字体大小和颜色
- 6.ListView的自定义adapter和监听滚动事件
- 雅虎14条性能优化(经典)
- pure virtual function call
- ns2 有线UDP模拟
- SpringBoard 无法启动应用程序(错误:4)
- gitServer in ubuntu
- 09extjs笔记
- Android PendingIntent的相关问题
- java 自定义枚举
- 文本符号化:Fslex
- VS乱码解决方法
- java 注解