53 #include "ns3/core-module.h" 
   54 #include "ns3/network-module.h" 
   55 #include "ns3/applications-module.h" 
   56 #include "ns3/mobility-module.h" 
   57 #include "ns3/config-store-module.h" 
   58 #include "ns3/wimax-module.h" 
   59 #include "ns3/csma-module.h" 
   61 #include "ns3/global-route-manager.h" 
   62 #include "ns3/mobility-module.h" 
   63 #include "ns3/internet-module.h" 
   64 #include "ns3/vector.h" 
   71 #define MAXDIST 10 // km 
   73 int main (
int argc, 
char *argv[])
 
  101   int nbSS = 10, duration = 7, schedType = 0;
 
  105   cmd.
AddValue (
"nbSS", 
"number of subscriber station to create", nbSS);
 
  106   cmd.
AddValue (
"scheduler", 
"type of scheduler to use with the netdevices", schedType);
 
  107   cmd.
AddValue (
"duration", 
"duration of the simulation in seconds", duration);
 
  108   cmd.
AddValue (
"verbose", 
"turn on all WimaxNetDevice log components", verbose);
 
  109   cmd.
Parse (argc, argv);
 
  137   channel = CreateObject<SimpleOfdmWimaxChannel> ();
 
  139   ssDevs = wimax.
Install (ssNodes,
 
  150   BSPosition = CreateObject<ConstantPositionMobilityModel> ();
 
  160   for (
int i = 0; i < nbSS; i++)
 
  162       SSPosition[i] = CreateObject<RandomWaypointMobilityModel> ();
 
  163       SSPosAllocator[i] = CreateObject<RandomRectanglePositionAllocator> ();
 
  166       xVar->SetAttribute (
"Max", 
DoubleValue ((i / 40.0 + 1) * 2000));
 
  167       SSPosAllocator[i]->SetX (xVar);
 
  171       SSPosAllocator[i]->SetY (yVar);
 
  190   LAN_ASN_BS.
Add (bsNodes.
Get (0));
 
  192   LAN_ASN_BS.
Add (ASNGW_Node.
Get (0));
 
  201   BS_CSMADevs.
Add (LAN_ASN_BS_Devs.
Get (0));
 
  204   ASN_Devs1.
Add (LAN_ASN_BS_Devs.
Get (1));
 
  209   LAN_ASN_STREAMER.
Add (ASNGW_Node.
Get (0));
 
  210   LAN_ASN_STREAMER.
Add (Streamer_Node.
Get (0));
 
  220   ASN_Devs2.
Add (LAN_ASN_STREAMER_Devs.
Get (0));
 
  221   STREAMER_Devs.
Add (LAN_ASN_STREAMER_Devs.
Get (1));
 
  234   address.
SetBase (
"10.1.0.0", 
"255.255.255.0");
 
  236   BSinterfaces = address.
Assign (bsDevsOne);
 
  237   SSinterfaces = address.
Assign (ssDevs);
 
  239   address.
SetBase (
"11.1.1.0", 
"255.255.255.0");
 
  243   address.
SetBase (
"12.1.1.0", 
"255.255.255.0");
 
  256   multicast.
AddMulticastRoute (multicastRouter, multicastSource, multicastGroup, inputIf, ASN_Devs1);
 
  264   multicastRouter = bsNodes.
Get (0); 
 
  265   inputIf = BS_CSMADevs.
Get (0); 
 
  267   multicast.
AddMulticastRoute (multicastRouter, multicastSource, multicastGroup, inputIf, bsDevsOne);
 
  269   uint16_t multicast_port = 100;
 
  271   for (
int i = 0; i < nbSS; i++)
 
  274       serverApps[i] = udpServer[i].
Install (ssNodes.
Get (i));
 
  281   clientApps = udpClient.
Install (Streamer_Node.
Get (0));
 
  298                                                               MulticastClassifier);
 
  306   for (
int i = 0; i < nbSS; i++)
 
  310       SSPosAllocator[i] = 0;
 
holds a vector of ns3::Application pointers. 
Smart pointer class similar to boost::intrusive_ptr. 
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
An migration-based uplink scheduler. 
Subscriber station(SS) device. 
holds a vector of std::pair of Ptr and interface index. 
Hold variables of type string. 
Ptr< NetDevice > Get(uint32_t i) const 
Get the Ptr stored in this container at a given index. 
a class to represent an Ipv4 address mask 
SchedulerType
Scheduler Type Different implementations of uplink/downlink scheduler. 
void SetModulationType(WimaxPhy::ModulationType modulationType)
Set the most efficient modulation and coding scheme (MCS) supported by the device. 
static void Run(void)
Run the simulation. 
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name. 
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit. 
aggregate IP/TCP/UDP functionality to existing Nodes. 
NetDeviceContainer Install(Ptr< Node > node) const 
This method creates an ns3::CsmaChannel with the attributes configured by CsmaHelper::SetChannelAttri...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO. 
NetDeviceContainer Install(NodeContainer c, NetDeviceType type, PhyType phyType, SchedulerType schedulerType)
void SetDefaultMulticastRoute(Ptr< Node > n, Ptr< NetDevice > nd)
Add a default route to the static routing protocol to forward packets out a particular interface...
ApplicationContainer Install(NodeContainer c)
void AddMulticastRoute(Ptr< Node > n, Ipv4Address source, Ipv4Address group, Ptr< NetDevice > input, NetDeviceContainer output)
Add a multicast route to a node and net device using explicit Ptr and Ptr ...
Class for representing data rates. 
A simple scheduler - rtPS based scheduler. 
void Install(Ptr< Node > node) const 
"Layout" a single node according to the current position allocator type. 
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component. 
AttributeValue implementation for Time. 
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container. 
Create UdpTraceClient application which sends UDP packets based on a trace file of an MPEG4 stream...
Hold an unsigned integer type. 
holds a vector of ns3::NetDevice pointers 
Create a server application which waits for input UDP packets and uses the information carried into t...
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together. 
Parse command-line arguments. 
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy(). 
Ptr< BsServiceFlowManager > GetServiceFlowManager(void) const 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
keep track of a set of node pointers. 
Hold objects of type Ptr. 
void Install(std::string nodeName) const 
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
This class implements service flows as described by the IEEE-802.16 standard. 
void SetPosition(const Vector &position)
void SetPropagationModel(PropModel propModel)
sets the propagation model 
build a set of CsmaNetDevice objects 
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Helper class used to assign positions and mobility models to nodes. 
Ipv4 addresses are stored in host order in this class. 
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
void Add(NodeContainer other)
Append the contents of another NodeContainer to the end of this container. 
ApplicationContainer Install(NodeContainer c)
Create one UDP server application on each of the Nodes in the NodeContainer. 
Helper class that adds ns3::Ipv4StaticRouting objects. 
AttributeValue implementation for DataRate. 
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD. 
static void Stop(void)
Tell the Simulator the calling event should be the last one executed. 
Ptr< Node > Get(uint32_t i) const 
Get the Ptr stored in this container at a given index. 
Time Seconds(double value)
Construct a Time in the indicated unit. 
ServiceFlow CreateServiceFlow(ServiceFlow::Direction direction, ServiceFlow::SchedulingType schedulinType, IpcsClassifierRecord classifier)
Creates a transport service flow. 
helps to manage and create WimaxNetDevice objects 
void Parse(int argc, char *argv[])
Parse the program arguments. 
A helper class to make life easier while doing simple IPv4 address assignment in scripts. 
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer. 
static void EnableLogComponents(void)
Helper to enable all WimaxNetDevice log components with one statement. 
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)
Set a single attribute, raising fatal errors if unsuccessful. 
A simple priority-based FCFS scheduler. 
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.