32#include "ns3/boolean.h"
33#include "ns3/command-line.h"
34#include "ns3/double.h"
35#include "ns3/internet-stack-helper.h"
36#include "ns3/ipv4-address-helper.h"
37#include "ns3/ipv4-global-routing-helper.h"
39#include "ns3/mobility-helper.h"
40#include "ns3/mobility-model.h"
41#include "ns3/on-off-helper.h"
42#include "ns3/rectangle.h"
44#include "ns3/string.h"
45#include "ns3/uinteger.h"
46#include "ns3/yans-wifi-channel.h"
47#include "ns3/yans-wifi-helper.h"
54main(
int argc,
char* argv[])
57 cmd.Parse(argc, argv);
74 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager",
75 "FragmentationThreshold",
80 mac.SetType(
"ns3::StaWifiMac",
86 "BE_BlockAckThreshold",
89 "BE_BlockAckInactivityTimeout",
93 mac.SetType(
"ns3::ApWifiMac",
98 "BE_BlockAckThreshold",
105 mobility.SetPositionAllocator(
"ns3::GridPositionAllocator",
119 mobility.SetMobilityModel(
"ns3::RandomWalk2dMobilityModel",
124 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
134 address.SetBase(
"192.168.1.0",
"255.255.255.0");
137 staIf =
address.Assign(staDevice);
138 apIf =
address.Assign(apDevice);
147 onOff.SetAttribute(
"OnTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=0.01]"));
148 onOff.SetAttribute(
"OffTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=8]"));
160 phy.EnablePcap(
"test-blockack", ap->GetId(), 0);
a polymophic address class
holds a vector of ns3::Application pointers.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
Parse command-line arguments.
Class for representing data rates.
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.
static void PopulateRoutingTables()
Build a routing database and initialize the routing tables of the nodes in the simulation.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
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.
Hold an unsigned integer type.
helps to create WifiNetDevice objects
create MAC layers for a ns3::WifiNetDevice.
@ DLT_IEEE802_11_RADIO
Include Radiotap link layer information.
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 > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
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_DEBUG
LOG_DEBUG and above.
@ LOG_LEVEL_INFO
LOG_INFO and above.