ns-3脚本初识——WIFI无线网络:third脚本

ps:本文所有文件和目录的默认根目录均为ns-3.29/。

正如在构建点到点拓扑时看到的点到点拓扑和CSMA拓扑助手对象一样,将在本节中看到等效的WiFi拓扑助手。

在examples/tutorial目录中提供了一个示例脚本。此脚本建立在second.cc脚本的基础上,并添加Wi-Fi网络。

该脚本默认拓扑结构如下:

   Wifi 10.1.3.0AP*    *    *    *|    |    |    |    10.1.1.0n5   n6   n7   n0 -------------- n1   n2   n3   n4point-to-point  |    |    |    |================LAN 10.1.2.0

n0和n1实现点到点通信(与first.cc中相似),n1~n4是个CSMA有线局域网(与second.cc中相似)。如图左侧所示,我们创建了许多无线STA(station)节点来填充新的10.1.3.0网络,向点到点链接左侧的节点n0添加一个新的网络设备,该点为无线接入点AP。

1.代码规范

2.头文件

#include "ns3/core-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/mobility-module.h"              //移动模块
#include "ns3/csma-module.h"                  //CSMA模块
#include "ns3/internet-module.h"
#include "ns3/yans-wifi-helper.h"             //Wi-Fi模块
#include "ns3/ssid.h"                         //SSID模块

SSID是Service Set Identifier的缩写,意思是:服务集标识。SSID技术可以将一个无线局域网分为几个需要不同身份验证的子网络,每一个子网络都需要独立的身份验证,只有通过身份验证的用户才可以进入相应的子网络,防止未被授权的用户进入本网络。

3.命名空间

using namespace ns3;

4.日志

NS_LOG_COMPONENT_DEFINE ("ThirdScriptExample");

5.主函数声明

int
main (int argc, char *argv[])
{
…
}

6.主函数准备工作

主程序和second.cc一样,通过添加一些命令行参数来启用或禁用日志记录组件以及更改创建的设备数量来启动。

  //定义bool变量,用于决定是否开启2个UdpApplication的Logging日志组件,默认true开启bool verbose = true;uint32_t nCsma = 3;//变量,用于定义csma网络中额外有多少个node,此处为3uint32_t nWifi = 3;//变量,用于定义wifi网络中有多少个station node,此处为3bool tracing = false;//若要开启跟踪文件,则需改为trueCommandLine cmd;//命令行cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma);//“nCsma”参数控制着脚本中CSMA网络中额外节点的数量,其对应的C++同名变量是非整型数nCsmacmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi);//同样地,“nWifi”参数控制着脚本中WIFI网络中STA节点的数量cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);//“verbose”参数设置是否开启loggingcmd.AddValue ("tracing", "Enable pcap tracing", tracing);cmd.Parse (argc,argv);

18的底层限制是由于网格位置分配器的配置,如果提供的节点超过18个,网格布局将超过边界框。

  if (nWifi > 18){std::cout << "nWifi should be 18 or less; otherwise grid layout exceeds the bounding box" << std::endl;return 1;}if (verbose){LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO);LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO);}

7.创建网络拓扑

1)P2P链路

  //创建使用P2P链路的两个节点NodeContainer p2pNodes;p2pNodes.Create (2);PointToPointHelper pointToPoint;//PPP信道助手类//配置PPP信道属性pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));//传输速率属性 pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));//传播迟延属性//安装P2P网卡到P2P网络节点NetDeviceContainer p2pDevices;//创建网络设备p2pDevices = pointToPoint.Install (p2pNodes);//连接节点与信道

2)csma网络

  //创建csma网络节点NodeContainer csmaNodes;csmaNodes.Add (p2pNodes.Get (1));//将P2P的节点1加到CSMA网络中csmaNodes.Create (nCsma);//再创建额外的3个节点CsmaHelper csma;//CSMA信道助手类//设置CSMA传输速率和传播延迟csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560)));//安装CSMA网卡到CSMA网络节点NetDeviceContainer csmaDevices;csmaDevices = csma.Install (csmaNodes);

3)wifi网络

  //创建WIFI网络节点NodeContainer wifiStaNodes;wifiStaNodes.Create (nWifi);//创建3个STA节点NodeContainer wifiApNode = p2pNodes.Get (0);//用点到点链接的最左端节点作为AP

设置Channel和WifiPhy。
用到两个助手类YansWifiChannelHelper和YansWifiPhyHelper。

  //默认传播迟延模型:ConstantSpeedPropagationDelayModel//默认损耗模型:LogDistancePropagationLossModelYansWifiChannelHelper channel = YansWifiChannelHelper::Default ();//默认无码率模型:NistErrorRateModelYansWifiPhyHelper phy = YansWifiPhyHelper::Default ();phy.SetChannel (channel.Create ());//使用默认的PHY层配置和信道模型

PHY(Port Physical Layer),中文可称之为端口物理层,是一个对OSI模型物理层的共同简称。

设置WifiMac并在节点中安装NetDevice。
用到两个助手类WifiHelper和WifiMacHelper。

  WifiHelper wifi;//SetRemoteStationManager方法告诉助手类使用哪种速率控制算法,此处为AARF算法wifi.SetRemoteStationManager ("ns3::AarfWifiManager");WifiMacHelper mac;//创建IEEE 802.11服务集标识符(SSID)对象,用来设置MAC层的“SSID”属性值Ssid ssid = Ssid ("ns-3-ssid");mac.SetType ("ns3::StaWifiMac",//移动节点"Ssid", SsidValue (ssid),"ActiveProbing", BooleanValue (false));//助手类创建的MAC将不会发送探测请求//安装移动节点NetDeviceContainer staDevices;staDevices = wifi.Install (phy, mac, wifiStaNodes);mac.SetType ("ns3::ApWifiMac",//AP节点"Ssid", SsidValue (ssid));//安装AP节点NetDeviceContainer apDevices;apDevices = wifi.Install (phy, mac, wifiApNode);

设置移动模型
我们希望STA节点是移动的,在一个边界框内漫游,并且希望使AP节点保持静止。
ns-3使用笛卡尔坐标系标识节点位置,助手类是MobilityHelper。

  MobilityHelper mobility;//为移动节点设置移动模型//移动节点模型设置分为两部分:初始位置分布,后续移动轨迹模型//初始位置分布器:GridPositionAllocator//按照设置好的行列参数把节点等间距放在一个二维笛卡尔坐标系中mobility.SetPositionAllocator ("ns3::GridPositionAllocator",//起始坐标(0,0)"MinX", DoubleValue (0.0),"MinY", DoubleValue (0.0),"DeltaX", DoubleValue (5.0),//X轴节点间距:5m"DeltaY", DoubleValue (10.0),//Y轴节点间距:10m"GridWidth", UintegerValue (3),//每行最大节点数"LayoutType", StringValue ("RowFirst"));//移动轨迹模型:RandomWalk2dMobilityModel//节点在一个指定大小的长方形区域内按照随机速度(默认取值范围是[2,4]m/s)和方向移动mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel","Bounds", RectangleValue (Rectangle (-50, 50, -50, 50)));mobility.Install (wifiStaNodes);//为AP节点设置移动模型//使用固定位置移动模型ConstantPositionMobilityModel,这个模型的AP节点二维坐标为(0,0)mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");mobility.Install (wifiApNode);

下图为该脚本中AP节点和移动及节点初始位置分布以及节点移动区域的示意图:

8.安装TCP/IP协议族

  //安装TCP/IP协议栈InternetStackHelper stack;stack.Install (csmaNodes);stack.Install (wifiApNode);stack.Install (wifiStaNodes);Ipv4AddressHelper address;//为网络设备分配IP地址//安排P2P网段的地址address.SetBase ("10.1.1.0", "255.255.255.0");Ipv4InterfaceContainer p2pInterfaces;p2pInterfaces = address.Assign (p2pDevices);//安排CSMA网段的地址address.SetBase ("10.1.2.0", "255.255.255.0");Ipv4InterfaceContainer csmaInterfaces;csmaInterfaces = address.Assign (csmaDevices);//安排WIFI网段的地址address.SetBase ("10.1.3.0", "255.255.255.0");address.Assign (staDevices);address.Assign (apDevices);

9.安装应用层

  UdpEchoServerHelper echoServer (9);//服务端设置端口号//在最右端的节点n4中安装服务端程序ApplicationContainer serverApps = echoServer.Install (csmaNodes.Get (nCsma));serverApps.Start (Seconds (1.0));serverApps.Stop (Seconds (10.0));//配置客户端程序属性UdpEchoClientHelper echoClient (csmaInterfaces.GetAddress (nCsma), 9);echoClient.SetAttribute ("MaxPackets", UintegerValue (1));echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.0)));echoClient.SetAttribute ("PacketSize", UintegerValue (1024));//在最后创建的STA节点n7中安装客户端程序ApplicationContainer clientApps = echoClient.Install (wifiStaNodes.Get (nWifi - 1));clientApps.Start (Seconds (2.0));clientApps.Stop (Seconds (10.0));

10.设置路由

 Ipv4GlobalRoutingHelper::PopulateRoutingTables ();

11.使模拟器停止

刚刚创建的模拟永远不会“自然”停止。这是因为要求无线接入点生成beacons。它将永远生成beacons,导致模拟器事件会无限期出现,所以我须告诉模拟器停止,即使它可能已经安排了beacons生成事件。

下面的代码行告诉模拟器停止,否则会进入无限循环。

  Simulator::Stop (Seconds (10.0));

12.数据追踪

  if (tracing == true){pointToPoint.EnablePcapAll ("third");phy.EnablePcap ("third", apDevices.Get (0));csma.EnablePcap ("third", csmaDevices.Get (0), true);}

13.启动与结束

  Simulator::Run ();Simulator::Destroy ();return 0;

14.上机实践

在ns-3.29(或其他的版本)目录下运行second模拟脚本(需要在编译时启动enable-examples选项,不然就将脚本放到scratch目录下)。

./waf --run third

编译结果如下:

可以看出,UDP回显客户端发送1024byte数据分组给地址为10.1.2.4的服务器,此时客户端在地址为10.1.3.3的无线网络处。当UDP回显服务器收到数据分组后,会发送相同的字节给回显客户端。

如果回到根目录ns-3.29/,将会发现4个跟踪文件,如下图所示:

可以查看这四个跟踪文件:

tcpdump -nn -tt -r third-0-1.pcap

会看到链路类型是IEEE802.11(IEEE 802.11是现今无线局域网通用的标准),信息显示类此次跟踪的IP回显请求和回复数据分组,如下:

reading from file third-0-1.pcap, link-type IEEE802_11 (802.11)
0.032090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
0.120391 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
0.120407 Acknowledgment RA:00:00:00:00:00:08
0.120539 Assoc Response AID(1) :: Successful
0.120683 Acknowledgment RA:00:00:00:00:00:0a
0.120858 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
0.120874 Acknowledgment RA:00:00:00:00:00:07
0.120988 Assoc Response AID(2) :: Successful
0.121132 Acknowledgment RA:00:00:00:00:00:0a
0.121316 Assoc Request (ns-3-ssid) [6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0 Mbit]
0.121332 Acknowledgment RA:00:00:00:00:00:09
0.121437 Assoc Response AID(3) :: Successful
0.121581 Acknowledgment RA:00:00:00:00:00:0a
0.134490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
0.236890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
0.339290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
0.441690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
0.544090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
0.646490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
0.748890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
0.851290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
0.953690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
1.056090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
1.158490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
1.260890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
1.363290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
1.465690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
1.568090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
1.670490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
1.772890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
1.875290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
1.977690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
2.006112 ARP, Request who-has 10.1.3.4 (ff:ff:ff:ff:ff:ff) tell 10.1.3.3, length 32
2.006128 Acknowledgment RA:00:00:00:00:00:09
2.006233 ARP, Request who-has 10.1.3.4 (ff:ff:ff:ff:ff:ff) tell 10.1.3.3, length 32
2.006433 ARP, Reply 10.1.3.4 is-at 00:00:00:00:00:0a, length 32
2.006605 Acknowledgment RA:00:00:00:00:00:0a
2.008151 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP, length 1024
2.008167 Acknowledgment RA:00:00:00:00:00:09
2.031758 ARP, Request who-has 10.1.3.3 (ff:ff:ff:ff:ff:ff) tell 10.1.3.4, length 32
2.032017 ARP, Reply 10.1.3.3 is-at 00:00:00:00:00:09, length 32
2.032033 Acknowledgment RA:00:00:00:00:00:09
2.032165 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP, length 1024
2.033701 Acknowledgment RA:00:00:00:00:00:0a
2.080090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
2.182490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
2.284890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
2.387290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
2.489690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
2.592090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
2.694490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
2.796890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
2.899290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
3.001690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
3.104090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
3.206490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
3.308890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
3.411290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
3.513690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
3.616090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
3.718490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
3.820890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
3.923290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
4.025690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
4.128090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
4.230490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
4.332890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
4.435290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
4.537690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
4.640090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
4.742490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
4.844890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
4.947290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
5.049690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
5.152090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
5.254490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
5.356890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
5.459290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
5.561690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
5.664090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
5.766490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
5.868890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
5.971290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
6.073690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
6.176090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
6.278490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
6.380890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
6.483290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
6.585690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
6.688090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
6.790490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
6.892890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
6.995290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
7.097690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
7.200090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
7.302490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
7.404890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
7.507290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
7.609690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
7.712090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
7.814490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
7.916890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
8.019290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
8.121690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
8.224090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
8.326490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
8.428890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
8.531290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
8.633690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
8.736090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
8.838490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
8.940890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
9.043290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
9.145690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
9.248090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
9.350490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
9.452890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
9.555290 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
9.657690 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
9.760090 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
9.862490 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS
9.964890 Beacon (ns-3-ssid) [6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 Mbit] ESS

其他几个跟踪文件查看方法相同,不再赘述。

输出可视化界面的代码如下:

./waf --run third --vis

ns-3脚本初识——WIFI无线网络:third脚本相关推荐

  1. win10电脑wifi显示无法连接服务器,Win10怎么连Wifi?解决Win10无法连接wifi无线网络的方法图文详解...

    随着Wifi无线网络的流行,如今很多电脑用户也很少通过本地连接上网,而是摆脱线材束缚,连接Wifi无线网络上网.近日,新升级了windows 10系统的小伙伴们都想知道Win10怎么连Wifi无线网络 ...

  2. 苹果7无线网怎么连接电脑连接服务器,iPhone7怎么连接Wifi无线网络?苹果iPhone7 wifi和网络流量自动切换吗?...

    iPhone7与7 Plus运行的都是iOS 10系统,体验非常出色,那么iPhone7怎么连Wifi?iPhone7无线网络怎么连接?iPhone7 wifi和网络流量自动切换吗?下面脚本之家的小编 ...

  3. 电脑ping不通 plsql能连上_台式电脑不能上网手机却能连上wifi无线网络的解决方法...

    今天台式电脑有线网络不能上网,路由器上的三个灯也是亮着,并且手机可以连得上WiFi无线网络可以正常上网,路由器也重启了也没有办法解决问题,在台式电脑上查看了本地连接也是正常的,设备管理中的网卡驱动也是 ...

  4. linux安装comfast网卡驱动,电脑如何通过usb共享手机网络 Linux安装wifi 无线网络 811AC usb网卡驱动...

    电脑如何通过usb共享手机网络 该方法是通过USB线将手机和电脑连接的方式来共享网络,所以不管是笔记本电脑还是台式机,不管电脑有无线网卡,都可以使用该方法. 准备工作:首先用数据线把手机连接到电脑上, ...

  5. wifi 信道_Win10电脑找不到自家Wifi无线网络解决方法 可能是无线信道问题

    近期有用户称自己使用笔记本电脑连接WiFi无线网络,却发现无法找到自家的WiFi网络,关键邻居家的无线网络都搜索到了,这个说明无线网卡以及驱动肯定没有任何问题,这种问题可能就是无线信道的问题了,下面装 ...

  6. [转]如何使用BackTrack破解WIFI无线网络的WEP密钥

    aireplay-ng -1 0 -a (bssid) -h 00:11:22:33:44:55 -e (essid) (interface) 你可能已经知道如果你想要加锁自己的WIFI无线网络,你最 ...

  7. 计算机休眠唤醒后 网络受限,Win7系统待机/休眠被唤醒后笔记本WIFI无线网络无法连接解决方法...

    有的时候,我们会暂时离开电脑,希望回来的时候又可以快速使用电脑,所以我们经常会使用待机.休眠功能,当我们将系统待机时,不仅可以快速的恢复到之前电脑的工作状态,还可以省电.但是我们使用笔记本的时候,发现 ...

  8. 京沪高铁全程提供WiFi无线网络技术揭密

    据新华网和新京报的消息,京沪高铁正式运营后将会在全程车厢里提供WiFi无线宽带服务,京沪高铁全线长达一千多公里,虽然我们暂时还不知道这项服务的收费标准是多少,但并不妨碍我们向各位网友介绍这种高速铁路上 ...

  9. WiFi无线网络参数 802.11a/b/g/n 详解

    转载自:WiFi无线网络参数 802.11a/b/g/n 详解 如转载侵犯您的版权,请联系:2378264731@qq.com 802.11a/b/g/n,其实指的是无线网络协议,细分为802.11a ...

最新文章

  1. 守住你的网站:防御DDoS***指南
  2. 7.STM32中对DMA_Config()函数的理解(自定义)测试DMA传输数据时CPU还可继续工作其他的事
  3. mybatis清除一级缓存的几种方法
  4. 查询已安装rpm包信息
  5. c语言进程调度报告,进程调度(C语言实现).doc
  6. SQL中的函数 •Aggregate 函数 •Scalar 函数
  7. cjson 使用时遇到的问题找不到库
  8. java的字符串池_翻译-Java字符串池
  9. 【Linux】很实用的 Linux 高级命令,老码农一定要懂
  10. 华为云计算HCNA--存储虚拟化
  11. Android Multimedia框架总结(二十六)利用FFmpeg进行解码直播流
  12. Linux修改服务器密码
  13. IIS配置ipa下载设置
  14. PCIE数据采集软件使用
  15. 计算机如何连接iphone,iphone怎么连接到电脑的方法详解【图文】
  16. linux装回win10系统无法开机,Win10/Linux双系统删除之后出现grub无法开机修复方法...
  17. QPainter 画扇形
  18. 关于在工作中遇到的问题及解决方案
  19. video视频多个循环播放
  20. 使用HVScrollListView 超简单的实现类似股票列表的滑动

热门文章

  1. z-buffer算法
  2. MySQL语句和命令大全
  3. 1到100的偶数之和是多少_求1到100之间所有偶数之和
  4. linux 权限 c,Linux下获取root权限的c程序
  5. python求平均值,python 怎么求平均值
  6. 安装Pytorch后torch.cuda.is_available()返回False问题解决
  7. ps彩色照片变黑白照片
  8. java易宝在线支付及PaymentUtil.java下载
  9. 解决有道云笔记中Markdown语法中代码块字体太小的问题
  10. 智慧城市同城小程序V4_1.0.86后端+双前端