68#include "ns3/core-module.h"
69#include "ns3/mobility-module.h"
70#include "ns3/network-module.h"
71#include "ns3/tap-bridge-module.h"
72#include "ns3/wifi-module.h"
82main(
int argc,
char* argv[])
85 cmd.Parse(argc, argv);
92 GlobalValue::Bind(
"SimulatorImplementationType",
StringValue(
"ns3::RealtimeSimulatorImpl"));
93 GlobalValue::Bind(
"ChecksumEnabled",
BooleanValue(
true));
108 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
116 wifiMac.
SetType(
"ns3::AdhocWifiMac");
136 positionAlloc->Add(
Vector(0.0, 0.0, 0.0));
137 positionAlloc->Add(
Vector(5.0, 0.0, 0.0));
138 mobility.SetPositionAllocator(positionAlloc);
139 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
165 Simulator::Stop(
Seconds(600.));
167 Simulator::Destroy();
AttributeValue implementation for Boolean.
Parse command-line arguments.
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Smart pointer class similar to boost::intrusive_ptr.
Hold variables of type string.
build TapBridge to allow ns-3 simulations to interact with Linux tap devices and processes on the Lin...
Ptr< NetDevice > Install(Ptr< Node > node, Ptr< NetDevice > nd)
This method installs a TapBridge on the specified Node and forms the bridge with the NetDevice specif...
void SetAttribute(std::string n1, const AttributeValue &v1)
Set an attribute in the underlying TapBridge net device when these devices are automatically created.
Vector3D Vector
Vector alias typedef for compatibility with mobility models.
helps to create WifiNetDevice objects
create MAC layers for a ns3::WifiNetDevice.
void SetType(std::string type, Args &&... args)
manage and create wifi channel objects for the YANS model.
Ptr< YansWifiChannel > Create() const
Make it easy to create and manage PHY objects for the YANS model.
void SetChannel(Ptr< YansWifiChannel > channel)
#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.