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);
holds a vector of ns3::Application pointers.
AttributeValue implementation for Boolean.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
static void PopulateRoutingTables(void)
Build a routing database and initialize the routing tables of the nodes in the simulation.
Hold variables of type string.
Make it easy to create and manage PHY objects for the yans model.
static YansWifiChannelHelper Default(void)
Create a channel helper in a default working state.
static void Run(void)
Run the simulation.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
aggregate IP/TCP/UDP functionality to existing Nodes.
static YansWifiPhyHelper Default(void)
Create a phy helper in a default working state.
helps to create WifiNetDevice objects
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
a polymophic address class
AttributeValue implementation for Rectangle.
Class for representing data rates.
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Hold an unsigned integer type.
holds a vector of ns3::NetDevice pointers
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
Parse command-line arguments.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Every class exported by the ns3 library is enclosed in the ns3 namespace.
manage and create wifi channel objects for the yans model.
create MAC layers for a ns3::WifiNetDevice.
The IEEE 802.11 SSID Information Element.
Helper class used to assign positions and mobility models to nodes.
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 DataRate.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Time Seconds(double value)
Construct a Time in the indicated unit.
AttributeValue implementation for Ssid.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.