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"
64int main (
int argc,
char * argv[])
67 cmd.Parse (argc, argv);
77 phy.SetPcapDataLinkType (WifiPhyHelper::DLT_IEEE802_11_RADIO);
84 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager",
"FragmentationThreshold",
UintegerValue (2500));
88 mac.SetType (
"ns3::StaWifiMac",
97 mac.SetType (
"ns3::ApWifiMac",
106 mobility.SetPositionAllocator (
"ns3::GridPositionAllocator",
114 mobility.SetMobilityModel (
"ns3::RandomWalk2dMobilityModel",
118 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
128 address.SetBase (
"192.168.1.0",
"255.255.255.0");
131 staIf =
address.Assign (staDevice);
132 apIf =
address.Assign (apDevice);
140 onOff.SetAttribute (
"OnTime",
StringValue (
"ns3::ConstantRandomVariable[Constant=0.01]"));
141 onOff.SetAttribute (
"OffTime",
StringValue (
"ns3::ConstantRandomVariable[Constant=8]"));
149 Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
151 Simulator::Stop (
Seconds (10.0));
153 phy.EnablePcap (
"test-blockack", ap->
GetId (), 0);
155 Simulator::Destroy ();
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.
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.
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.
@ 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.