43#include "ns3/boolean.h"
44#include "ns3/command-line.h"
45#include "ns3/double.h"
46#include "ns3/internet-stack-helper.h"
47#include "ns3/ipv4-address-helper.h"
48#include "ns3/ipv4-global-routing-helper.h"
50#include "ns3/mobility-helper.h"
51#include "ns3/mobility-model.h"
52#include "ns3/on-off-helper.h"
53#include "ns3/rectangle.h"
55#include "ns3/string.h"
56#include "ns3/uinteger.h"
57#include "ns3/yans-wifi-channel.h"
58#include "ns3/yans-wifi-helper.h"
65main(
int argc,
char* argv[])
68 cmd.Parse(argc, argv);
78 phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO);
85 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager",
86 "FragmentationThreshold",
91 mac.SetType(
"ns3::StaWifiMac",
97 "BE_BlockAckThreshold",
100 "BE_BlockAckInactivityTimeout",
104 mac.SetType(
"ns3::ApWifiMac",
109 "BE_BlockAckThreshold",
116 mobility.SetPositionAllocator(
"ns3::GridPositionAllocator",
130 mobility.SetMobilityModel(
"ns3::RandomWalk2dMobilityModel",
135 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
145 address.SetBase(
"192.168.1.0",
"255.255.255.0");
148 staIf =
address.Assign(staDevice);
149 apIf =
address.Assign(apDevice);
158 onOff.SetAttribute(
"OnTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=0.01]"));
159 onOff.SetAttribute(
"OffTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=8]"));
167 Ipv4GlobalRoutingHelper::PopulateRoutingTables();
169 Simulator::Stop(
Seconds(10.0));
171 phy.EnablePcap(
"test-blockack", ap->
GetId(), 0);
173 Simulator::Destroy();
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.
AttributeValue implementation for Boolean.
Parse command-line arguments.
Class for representing data rates.
AttributeValue implementation for DataRate.
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 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.
AttributeValue implementation for Rectangle.
The IEEE 802.11 SSID Information Element.
AttributeValue implementation for Ssid.
Hold variables of type string.
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.
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.
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.