如何在 NS3 中使用 Tcp 变体比较? [英] How to use Tcp Variants Comparison in NS3?

查看:26
本文介绍了如何在 NS3 中使用 Tcp 变体比较?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在一个班级项目中使用 ns-3 比较不同类型的 TCP.我是 ns-3 的新手.我不想实现新代码.简而言之,我有两个问题:

  1. 哪个 ns-3 示例最适合我的目的?Tcp-Variants-Comparison.cc?
  2. 我怎样才能看到输出.我运行了代码,但没有输出.

解决方案

您可以使用 .waf 运行您的示例.导航到您的 ns-3 目录(.waf 可执行文件所在的位置)并运行:

./waf --run tcp-variants-comparison

这将编译(如果需要)并使用默认参数运行示例.您可以使用 --command-template="%s

所以要完整回答您的问题,您可以使用此示例进行比较:

cmd.AddValue ("transport_prot", "要使用的传输协议:TcpTahoe, TcpReno, TcpNewReno, TcpWestwood, TcpWestwoodPlus ", transport_prot);

因此,使用不同的 transport_prot 参数运行此示例并比较您的跟踪.

I need to compare different type of TCP using ns-3 for a class project. I am new with ns-3. I don't want to implement a new code. Briefly, I have 2 questions:

  1. Which example of ns-3 is the best for my purpose? Tcp-Variants-Comparison.cc?
  2. How can I see the output. I ran the code, but there was no output.

解决方案

You can run your example using .waf. Navigate to your ns-3 directory (the place where .waf executable is located) and run:

./waf --run tcp-variants-comparison

This will compile (if needed) and run the example with default arguments. You can change arguments using --command-template="%s <args>". If you look inside the tcp-variants-comparison.cc you can see all available arguments, e.g.:

...
cmd.AddValue ("delay", "Access link delay", access_delay);
cmd.AddValue ("tracing", "Flag to enable/disable tracing", tracing);
cmd.AddValue ("tr_name", "Name of output trace file", tr_file_name);
cmd.AddValue ("cwnd_tr_name", "Name of output trace file", cwnd_tr_file_name);
...

So here is an example how you can store congestion window of default TcpWestwood protocol to cwndTrace file:

./waf --run tcp-variants-comparison --command-template="%s --tracing=1 --cwnd_tr_name=cwndTrace"

You can then use any tool you like to display the data. Here is how to plot it with gnuplot:

$ gnuplot
gnuplot> set terminal png size 640,480
gnuplot> set output "cwnd.png"
gnuplot> plot "cwndTrace" using 1:2 title 'Congestion Window' with linespoints
gnuplot> exit

You should also take a look at this NS-3 tutorial. This gives you a pretty good introduction to NS-3, so read it carefully.

So to answer your question completely, you can use this example for comparison of:

cmd.AddValue ("transport_prot", "Transport protocol to use: TcpTahoe, TcpReno, TcpNewReno, TcpWestwood, TcpWestwoodPlus ", transport_prot);

So run this example with different transport_prot arguments and compare your traces.

这篇关于如何在 NS3 中使用 Tcp 变体比较?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆