|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
45 #include "ns3/core-module.h"
46 #include "ns3/network-module.h"
47 #include "ns3/applications-module.h"
48 #include "ns3/mobility-module.h"
49 #include "ns3/config-store-module.h"
50 #include "ns3/wimax-module.h"
51 #include "ns3/internet-module.h"
52 #include "ns3/global-route-manager.h"
53 #include "ns3/ipcs-classifier-record.h"
54 #include "ns3/service-flow.h"
61 int main (
int argc,
char *argv[])
65 int duration = 7, schedType = 0;
69 cmd.AddValue (
"scheduler",
"type of scheduler to use with the network devices", schedType);
70 cmd.AddValue (
"duration",
"duration of the simulation in seconds", duration);
71 cmd.AddValue (
"verbose",
"turn on all WimaxNetDevice log components",
verbose);
72 cmd.Parse (argc, argv);
100 ssDevs = wimax.
Install (ssNodes,
111 for (
int i = 0; i < 2; i++)
122 stack.Install (bsNodes);
123 stack.Install (ssNodes);
126 address.SetBase (
"10.1.1.0",
"255.255.255.0");
158 wimax.
EnablePcap (
"wimax-simple-ss0", ssNodes.
Get (0)->
GetId (), ss[0]->GetIfIndex ());
159 wimax.
EnablePcap (
"wimax-simple-ss1", ssNodes.
Get (1)->
GetId (), ss[1]->GetIfIndex ());
holds a vector of ns3::NetDevice pointers
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Parse command-line arguments.
@ LOG_LEVEL_INFO
LOG_INFO and above.
void EnablePcap(std::string prefix, Ptr< NetDevice > nd, bool promiscuous=false, bool explicitFilename=false)
Enable pcap output the indicated net device.
uint32_t GetId(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
Ipv4 addresses are stored in host order in this class.
void SetModulationType(WimaxPhy::ModulationType modulationType)
Set the most efficient modulation and coding scheme (MCS) supported by the device.
@ SCHED_TYPE_SIMPLE
A simple priority-based FCFS scheduler.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Create a server application which waits for input UDP packets and uses the information carried into t...
Smart pointer class similar to boost::intrusive_ptr.
virtual uint32_t GetIfIndex(void) const
Get interface index.
@ DEVICE_TYPE_BASE_STATION
Base station(BS) device.
@ DEVICE_TYPE_SUBSCRIBER_STATION
Subscriber station(SS) device.
NetDeviceContainer Install(NodeContainer c, NetDeviceType type, PhyType phyType, SchedulerType schedulerType)
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
helps to manage and create WimaxNetDevice objects
@ MODULATION_TYPE_QAM16_12
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
@ SCHED_TYPE_RTPS
A simple scheduler - rtPS based scheduler.
ServiceFlow CreateServiceFlow(ServiceFlow::Direction direction, ServiceFlow::SchedulingType schedulinType, IpcsClassifierRecord classifier)
Creates a transport service flow.
static void EnableLogComponents(void)
Helper to enable all WimaxNetDevice log components with one statement.
SubscriberStationNetDevice subclass of WimaxNetDevice.
static void Run(void)
Run the simulation.
void AddServiceFlow(ServiceFlow *sf)
adds a new service flow
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.
ApplicationContainer Install(NodeContainer c)
@ SCHED_TYPE_MBQOS
An migration-based uplink scheduler.
AttributeValue implementation for Time.
ApplicationContainer Install(NodeContainer c)
Create one UDP server application on each of the Nodes in the NodeContainer.
keep track of a set of node pointers.
a class to represent an Ipv4 address mask
SchedulerType
Scheduler Type Different implementations of uplink/downlink scheduler.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
This class implements service flows as described by the IEEE-802.16 standard.
Hold an unsigned integer type.
aggregate IP/TCP/UDP functionality to existing Nodes.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
IpcsClassifierRecord class.
void EnableAscii(std::string prefix, Ptr< NetDevice > nd, bool explicitFilename=false)
Enable ascii trace output on the indicated net device.