12#include "ns3/applications-module.h"
13#include "ns3/core-module.h"
14#include "ns3/csma-module.h"
15#include "ns3/internet-module.h"
16#include "ns3/mobility-module.h"
17#include "ns3/network-module.h"
18#include "ns3/nix-vector-routing-module.h"
19#include "ns3/point-to-point-module.h"
21#include "ns3/wifi-module.h"
77main(
int argc,
char* argv[])
80 bool enableNixLog =
false;
83 cmd.AddValue(
"useIPv6",
"Use IPv6 instead of IPv4", useIpv6);
84 cmd.AddValue(
"enableNixLog",
"Enable NixVectorRouting logging", enableNixLog);
85 cmd.Parse(argc, argv);
123 staDevices1 =
wifi.Install(phy, mac, wifiStaNodes1);
128 apDevices1 =
wifi.Install(phy, mac, wifiApNode1);
134 staDevices2 =
wifi.Install(phy, mac, wifiStaNodes2);
139 apDevices2 =
wifi.Install(phy, mac, wifiApNode2);
143 mobility.SetPositionAllocator(
"ns3::GridPositionAllocator",
157 mobility.SetMobilityModel(
"ns3::RandomWalk2dMobilityModel",
163 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
173 stack.SetRoutingHelper(nixRouting);
174 stack.Install(wifiApNode1);
175 stack.Install(wifiStaNodes1);
176 stack.Install(wifiApNode2);
177 stack.Install(wifiStaNodes2);
181 address.SetBase(
"10.1.1.0",
"255.255.255.0");
185 address.SetBase(
"10.1.2.0",
"255.255.255.0");
189 address.SetBase(
"10.1.3.0",
"255.255.255.0");
191 staDevicesInterfaces2 =
address.Assign(staDevices2);
194 udpServerAddress = staDevicesInterfaces2.
GetAddress(2);
199 wifiStaNodes1.
Get(2),
207 stack.SetRoutingHelper(nixRouting);
208 stack.Install(wifiApNode1);
209 stack.Install(wifiStaNodes1);
210 stack.Install(wifiApNode2);
211 stack.Install(wifiStaNodes2);
225 staDevicesInterfaces2 =
address.Assign(staDevices2);
228 udpServerAddress = staDevicesInterfaces2.
GetAddress(2, 1);
233 wifiStaNodes1.
Get(2),
a polymophic address class
holds a vector of ns3::Application pointers.
Parse command-line arguments.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Helper class to auto-assign global IPv6 unicast addresses.
Describes an IPv6 address.
Keep track of a set of IPv6 interfaces.
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.
Describes an IPv6 prefix.
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
Helper class that adds Nix-vector routing to nodes.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Build a set of PointToPointNetDevice objects.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
The IEEE 802.11 SSID Information Element.
Hold variables of type string.
Create an application which sends a UDP packet and waits for an echo of this packet.
Create a server application which waits for input UDP packets and sends them back to the original sen...
Hold an unsigned integer type.
helps to create WifiNetDevice objects
create MAC layers for a ns3::WifiNetDevice.
manage and create wifi channel objects for the YANS model.
static YansWifiChannelHelper Default()
Create a channel helper in a default working state.
Make it easy to create and manage PHY objects for the YANS model.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
@ LOG_LEVEL_LOGIC
LOG_LOGIC and above.
@ LOG_LEVEL_INFO
LOG_INFO and above.