UDP 突发流应用¶
组件
- 主应用模块:
udp-burst-application.cc/h
- 调度管理:
udp-burst-scheduler.cc/h
- 数据包头:
id-seq-header.cc/h
- 辅助类:
udp-burst-helper.cc/h
不用说了吧,显然还是两种部署方式!
部署应用¶
部署模式对比
特性 | 调度器模式 | 手动模式 |
---|---|---|
配置效率 | 批量任务自动调度 | 逐节点手动配置 |
管理复杂度 | 低(中央调度) | 高(分布式管理) |
典型场景 | 多突发流测试 | 特定流量模式调试 |
使用调度器¶
- 配置文件设置 (
config_ns3.properties
):Text Only 1 2 3
enable_udp_burst_scheduler=true udp_burst_schedule_filename="udp_burst_schedule.csv" udp_burst_enable_logging_for_udp_burst_ids=set(0,1)
- 调度文件格式 (
udp_burst_schedule.csv
):Text Only 1 2 3
burst_id,from_node,to_node,rate_mbps,start_ns,duration_ns,params,metadata 0,1,2,50,0,5e9,, 1,2,1,50,0,5e9,,
- 代码集成:
C++ 1 2 3 4 5
#include "ns3/udp-burst-scheduler.h" // 头文件 UdpBurstScheduler scheduler(basicSimulation, topology); // 调度器 scheduler.WriteResults(); // 仿真后输出结果
手动安装¶
C++ | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
状态监控接口¶
仿真结束后,你可以获取每个节点的 UDP burst 发送和接收状态:
C++ | |
---|---|
1 2 3 4 |
|
日志文件解析¶
文件名 | 内容结构 |
---|---|
udp_bursts_outgoing.csv |
burst_id,from,to,rate_mbps,start_ns,duration_ns,sent_packets,sent_bytes |
udp_bursts_incoming.csv |
burst_id,from,to,rate_mbps,start_ns,duration_ns,recv_packets,recv_bytes |
Tip
数据包使用ID序列头部进行跟踪,调度器模式默认启用1026端口通信,结果文件存放于logs_ns3
目录。