|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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);
83 wifi.SetRemoteStationManager (
"ns3::AarfWifiManager",
"FragmentationThreshold",
UintegerValue (2500));
87 mac.SetType (
"ns3::StaWifiMac",
96 mac.SetType (
"ns3::ApWifiMac",
105 mobility.SetPositionAllocator (
"ns3::GridPositionAllocator",
113 mobility.SetMobilityModel (
"ns3::RandomWalk2dMobilityModel",
117 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
127 address.SetBase (
"192.168.1.0",
"255.255.255.0");
130 staIf =
address.Assign (staDevice);
131 apIf =
address.Assign (apDevice);
139 onOff.SetAttribute (
"OnTime",
StringValue (
"ns3::ConstantRandomVariable[Constant=0.01]"));
140 onOff.SetAttribute (
"OffTime",
StringValue (
"ns3::ConstantRandomVariable[Constant=8]"));
152 phy.EnablePcap (
"test-blockack", ap->
GetId (), 0);
holds a vector of ns3::NetDevice pointers
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
AttributeValue implementation for DataRate.
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.
Parse command-line arguments.
AttributeValue implementation for Boolean.
@ LOG_LEVEL_INFO
LOG_INFO and above.
uint32_t GetId(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
helps to create WifiNetDevice objects
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
AttributeValue implementation for Rectangle.
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
@ DLT_IEEE802_11_RADIO
Include Radiotap link layer information.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
AttributeValue implementation for Ssid.
The IEEE 802.11 SSID Information Element.
Class for representing data rates.
static void PopulateRoutingTables(void)
Build a routing database and initialize the routing tables of the nodes in the simulation.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
a polymophic address class
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
@ LOG_LEVEL_DEBUG
LOG_DEBUG and above.
static void Run(void)
Run the simulation.
Hold variables of type string.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter.
Time Seconds(double value)
Construct a Time in the indicated unit.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
holds a vector of ns3::Application pointers.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Hold an unsigned integer type.
manage and create wifi channel objects for the YANS model.
create MAC layers for a ns3::WifiNetDevice.
aggregate IP/TCP/UDP functionality to existing Nodes.
Helper class used to assign positions and mobility models to nodes.