【发布时间】:2017-06-05 16:16:31
【问题描述】:
我正在尝试使用 NS-3 模拟器在随机航点模型和其他一些模型之间进行一些测试。在模拟过程中,我发现当需要运行模拟时,我们需要使用一个名为
的类来启动模型移动助手
下面的代码是我正在使用的代码的一部分。在初始化过程中,有一些节点需要预先创建,比如
p2p节点
csmaNodes
那么这些节点是什么意思,在什么情况下需要用到它们呢?他们是否指定了某些特定的移动模型?如果有,请提供一些细节,非常感谢!
NodeContainer p2pNodes;
p2pNodes.Create (3);
PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
NetDeviceContainer p2pDevices;
p2pDevices = pointToPoint.Install (p2pNodes);
NodeContainer csmaNodes;
csmaNodes.Add (p2pNodes.Get (1));
csmaNodes.Create (nCsma);
CsmaHelper csma;
csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560)));
NetDeviceContainer csmaDevices;
csmaDevices = csma.Install (csmaNodes);
【问题讨论】:
标签: initialization nodes ns-3