NS3实例分析third.cc_Building a Wireless Network Topology

转自:http://blog.sina.com.cn/s/blog_7ec2ab360102wxh3.html


这节我们将利用一个无线网络来进一步扩展关于NS3网络设备和信道的知识。其中,我们将看到WifiHelper,其作用类似于PointToPointHelper和CsmaHelper。

在example/tutorial下的third.cc脚本是second.cc的升级版,我们在third.cc中添加了Wifi网络。

 

 

一.third.cc代码

#include "ns3/core-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/wifi-module.h"
#include "ns3/mobility-module.h"
#include "ns3/csma-module.h"
#include "ns3/internet-module.h"

// Default Network Topology
// 网络拓扑结构
// Number of wifi or csma nodes can be increased up to 250
//                                           |
//                              Rank 0 |  Rank 1
// ----------------------------|----------------------------
//   Wifi 10.1.3.0
//                       AP
//  *     *      *      *
//  |      |       |      |      10.1.1.0
// n5   n6   n7   n0 ------------------n1   n2   n3   n4
//                              point-to-point   |      |      |       |
//                                                        ===========
//         

你可能感兴趣的:(ns3)