(1)ASCII Tracing

还是以myfirst.cc为例子

可以在Simulator::Run()前面加上

AsciiTraceHelper ascii;
pointToPoint.EnableAsciiAll(ascii.CreateFileStream("myfirst.tr");

 编译完成后可以在 ns-3.25里面看到文件 myfirst.tr

通过cat命令可以看到

ns3的输入输出奥秘(三)  Tracing系统

我们之前是发送的一个分组大小是1024字节,这里更详细的之处了 包含了 20个字节的IP首部以及8个字节的UDP首部,实际上是发送了1052字节的分组。

 

(2)PCAP Tracing

这里只需用一句

pointToPoint.EnablePcapAll("myfirst.pcap");

 通过cat命令查看是一串乱码

ns3的输入输出奥秘(三)  Tracing系统

pcap主要是应用在让其他可视化工具查看的。  比如Wireshark。

  

相关文章:

  • 2022-01-10
  • 2022-12-23
  • 2021-04-12
  • 2021-09-18
  • 2021-11-02
  • 2021-06-15
  • 2021-08-13
  • 2021-09-03
猜你喜欢
  • 2021-07-23
  • 2022-02-11
  • 2021-04-20
  • 2021-06-17
相关资源
相似解决方案