43 #include "ns3/command-line.h"
44 #include "ns3/uinteger.h"
45 #include "ns3/boolean.h"
46 #include "ns3/double.h"
47 #include "ns3/string.h"
49 #include "ns3/yans-wifi-helper.h"
51 #include "ns3/mobility-helper.h"
52 #include "ns3/on-off-helper.h"
53 #include "ns3/yans-wifi-channel.h"
54 #include "ns3/mobility-model.h"
55 #include "ns3/rectangle.h"
56 #include "ns3/internet-stack-helper.h"
57 #include "ns3/ipv4-address-helper.h"
58 #include "ns3/ipv4-global-routing-helper.h"
64 int main (
int argc,
char * argv[])
67 cmd.Parse (argc, argv);
82 wifi.SetRemoteStationManager (
"ns3::AarfWifiManager",
"FragmentationThreshold",
UintegerValue (2500));
86 mac.SetType (
"ns3::StaWifiMac",
95 mac.SetType (
"ns3::ApWifiMac",
104 mobility.SetPositionAllocator (
"ns3::GridPositionAllocator",
112 mobility.SetMobilityModel (
"ns3::RandomWalk2dMobilityModel",
116 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
126 address.SetBase (
"192.168.1.0",
"255.255.255.0");
129 staIf =
address.Assign (staDevice);
130 apIf =
address.Assign (apDevice);
138 onOff.SetAttribute (
"OnTime",
StringValue (
"ns3::ConstantRandomVariable[Constant=0.01]"));
139 onOff.SetAttribute (
"OffTime",
StringValue (
"ns3::ConstantRandomVariable[Constant=8]"));
151 phy.EnablePcap (
"test-blockack", ap->
GetId (), 0);
a polymophic address class
holds a vector of ns3::Application pointers.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter.
void Stop(Time stop)
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.
static void PopulateRoutingTables(void)
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
uint32_t GetId(void) const
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
AttributeValue implementation for Rectangle.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
static void Run(void)
Run the simulation.
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.
static YansWifiChannelHelper Default(void)
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.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
@ LOG_LEVEL_DEBUG
LOG_DEBUG and above.
@ LOG_LEVEL_INFO
LOG_INFO and above.
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.