A Discrete-Event Network Simulator
API
power-adaptation-distance.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Universidad de la República - Uruguay
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Matias Richart <mrichart@fing.edu.uy>
19  */
20 
88 #include "ns3/gnuplot.h"
89 #include "ns3/command-line.h"
90 #include "ns3/config.h"
91 #include "ns3/uinteger.h"
92 #include "ns3/double.h"
93 #include "ns3/log.h"
94 #include "ns3/yans-wifi-helper.h"
95 #include "ns3/ssid.h"
96 #include "ns3/mobility-helper.h"
97 #include "ns3/internet-stack-helper.h"
98 #include "ns3/ipv4-address-helper.h"
99 #include "ns3/packet-sink-helper.h"
100 #include "ns3/on-off-helper.h"
101 #include "ns3/yans-wifi-channel.h"
102 #include "ns3/wifi-net-device.h"
103 #include "ns3/wifi-mac.h"
104 #include "ns3/wifi-mac-header.h"
105 #include "ns3/mobility-model.h"
106 
107 using namespace ns3;
108 using namespace std;
109 
110 NS_LOG_COMPONENT_DEFINE ("PowerAdaptationDistance");
111 
112 //packet size generated at the AP
113 static const uint32_t packetSize = 1420;
114 
116 {
117 public:
119 
120  void PhyCallback (std::string path, Ptr<const Packet> packet);
121  void RxCallback (std::string path, Ptr<const Packet> packet, const Address &from);
122  void PowerCallback (std::string path, double oldPower, double newPower, Mac48Address dest);
123  void RateCallback (std::string path, DataRate oldRate, DataRate newRate, Mac48Address dest);
124  void SetPosition (Ptr<Node> node, Vector position);
125  void AdvancePosition (Ptr<Node> node, int stepsSize, int stepsTime);
126  Vector GetPosition (Ptr<Node> node);
127 
128  Gnuplot2dDataset GetDatafile ();
129  Gnuplot2dDataset GetPowerDatafile ();
130 
131 
132 private:
133  typedef std::vector<std::pair<Time, DataRate> > TxTime;
134  void SetupPhy (Ptr<WifiPhy> phy);
135  Time GetCalcTxTime (DataRate rate);
136 
137  std::map<Mac48Address, double> currentPower;
138  std::map<Mac48Address, DataRate> currentRate;
139  uint32_t m_bytesTotal;
140  double totalEnergy;
141  double totalTime;
146 };
147 
149 {
150  Ptr<NetDevice> device = aps.Get (0);
151  Ptr<WifiNetDevice> wifiDevice = DynamicCast<WifiNetDevice> (device);
152  Ptr<WifiPhy> phy = wifiDevice->GetPhy ();
153  myPhy = phy;
154  SetupPhy (phy);
155  DataRate dataRate = DataRate (phy->GetMode (0).GetDataRate (phy->GetChannelWidth ()));
156  double power = phy->GetTxPowerEnd ();
157  for (uint32_t j = 0; j < stas.GetN (); j++)
158  {
159  Ptr<NetDevice> staDevice = stas.Get (j);
160  Ptr<WifiNetDevice> wifiStaDevice = DynamicCast<WifiNetDevice> (staDevice);
161  Mac48Address addr = wifiStaDevice->GetMac ()->GetAddress ();
162  currentPower[addr] = power;
163  currentRate[addr] = dataRate;
164  }
165  currentRate[Mac48Address ("ff:ff:ff:ff:ff:ff")] = dataRate;
166  totalEnergy = 0;
167  totalTime = 0;
168  m_bytesTotal = 0;
169  m_output.SetTitle ("Throughput Mbits/s");
170  m_output_power.SetTitle ("Average Transmit Power");
171 }
172 
173 void
175 {
176  uint32_t nModes = phy->GetNModes ();
177  for (uint32_t i = 0; i < nModes; i++)
178  {
179  WifiMode mode = phy->GetMode (i);
180  WifiTxVector txVector;
181  txVector.SetMode (mode);
183  txVector.SetChannelWidth (phy->GetChannelWidth ());
184  DataRate dataRate = DataRate (mode.GetDataRate (phy->GetChannelWidth ()));
185  Time time = phy->CalculateTxDuration (packetSize, txVector, phy->GetFrequency ());
186  NS_LOG_DEBUG (i << " " << time.GetSeconds () << " " << dataRate);
187  timeTable.push_back (std::make_pair (time, dataRate));
188  }
189 }
190 
191 Time
193 {
194  for (TxTime::const_iterator i = timeTable.begin (); i != timeTable.end (); i++)
195  {
196  if (rate == i->second)
197  {
198  return i->first;
199  }
200  }
201  NS_ASSERT (false);
202  return Seconds (0);
203 }
204 
205 void
207 {
208  WifiMacHeader head;
209  packet->PeekHeader (head);
210  Mac48Address dest = head.GetAddr1 ();
211 
212  if (head.GetType () == WIFI_MAC_DATA)
213  {
214  totalEnergy += pow (10.0, currentPower[dest] / 10.0) * GetCalcTxTime (currentRate[dest]).GetSeconds ();
215  totalTime += GetCalcTxTime (currentRate[dest]).GetSeconds ();
216  }
217 }
218 
219 void
220 NodeStatistics::PowerCallback (std::string path, double oldPower, double newPower, Mac48Address dest)
221 {
222  currentPower[dest] = newPower;
223 }
224 
225 void
226 NodeStatistics::RateCallback (std::string path, DataRate oldRate, DataRate newRate, Mac48Address dest)
227 {
228  currentRate[dest] = newRate;
229 }
230 
231 void
232 NodeStatistics::RxCallback (std::string path, Ptr<const Packet> packet, const Address &from)
233 {
234  m_bytesTotal += packet->GetSize ();
235 }
236 
237 void
238 NodeStatistics::SetPosition (Ptr<Node> node, Vector position)
239 {
241  mobility->SetPosition (position);
242 }
243 
244 Vector
246 {
248  return mobility->GetPosition ();
249 }
250 
251 void
252 NodeStatistics::AdvancePosition (Ptr<Node> node, int stepsSize, int stepsTime)
253 {
254  Vector pos = GetPosition (node);
255  double mbs = ((m_bytesTotal * 8.0) / (1000000 * stepsTime));
256  m_bytesTotal = 0;
257  double atp = totalEnergy / stepsTime;
258  totalEnergy = 0;
259  totalTime = 0;
260  m_output_power.Add (pos.x, atp);
261  m_output.Add (pos.x, mbs);
262  pos.x += stepsSize;
263  SetPosition (node, pos);
264  NS_LOG_INFO ("At time " << Simulator::Now ().GetSeconds () << " sec; setting new position to " << pos);
265  Simulator::Schedule (Seconds (stepsTime), &NodeStatistics::AdvancePosition, this, node, stepsSize, stepsTime);
266 }
267 
270 {
271  return m_output;
272 }
273 
276 {
277  return m_output_power;
278 }
279 
280 void PowerCallback (std::string path, double oldPower, double newPower, Mac48Address dest)
281 {
282  NS_LOG_INFO ((Simulator::Now ()).GetSeconds () << " " << dest << " Old power=" << oldPower << " New power=" << newPower);
283 }
284 
285 void RateCallback (std::string path, DataRate oldRate, DataRate newRate, Mac48Address dest)
286 {
287  NS_LOG_INFO ((Simulator::Now ()).GetSeconds () << " " << dest << " Old rate=" << oldRate << " New rate=" << newRate);
288 }
289 
290 int main (int argc, char *argv[])
291 {
292  double maxPower = 17;
293  double minPower = 0;
294  uint32_t powerLevels = 18;
295 
296  uint32_t rtsThreshold = 2346;
297  std::string manager = "ns3::ParfWifiManager";
298  std::string outputFileName = "parf";
299  int ap1_x = 0;
300  int ap1_y = 0;
301  int sta1_x = 5;
302  int sta1_y = 0;
303  uint32_t steps = 200;
304  uint32_t stepsSize = 1;
305  uint32_t stepsTime = 1;
306 
308  cmd.AddValue ("manager", "PRC Manager", manager);
309  cmd.AddValue ("rtsThreshold", "RTS threshold", rtsThreshold);
310  cmd.AddValue ("outputFileName", "Output filename", outputFileName);
311  cmd.AddValue ("steps", "How many different distances to try", steps);
312  cmd.AddValue ("stepsTime", "Time on each step", stepsTime);
313  cmd.AddValue ("stepsSize", "Distance between steps", stepsSize);
314  cmd.AddValue ("maxPower", "Maximum available transmission level (dbm).", maxPower);
315  cmd.AddValue ("minPower", "Minimum available transmission level (dbm).", minPower);
316  cmd.AddValue ("powerLevels", "Number of transmission power levels available between "
317  "TxPowerStart and TxPowerEnd included.", powerLevels);
318  cmd.AddValue ("AP1_x", "Position of AP1 in x coordinate", ap1_x);
319  cmd.AddValue ("AP1_y", "Position of AP1 in y coordinate", ap1_y);
320  cmd.AddValue ("STA1_x", "Position of STA1 in x coordinate", sta1_x);
321  cmd.AddValue ("STA1_y", "Position of STA1 in y coordinate", sta1_y);
322  cmd.Parse (argc, argv);
323 
324  if (steps == 0)
325  {
326  std::cout << "Exiting without running simulation; steps value of 0" << std::endl;
327  }
328 
329  uint32_t simuTime = (steps + 1) * stepsTime;
330 
331  //Define the APs
332  NodeContainer wifiApNodes;
333  wifiApNodes.Create (1);
334 
335  //Define the STAs
337  wifiStaNodes.Create (1);
338 
340  wifi.SetStandard (WIFI_PHY_STANDARD_80211a);
341  WifiMacHelper wifiMac;
344 
345  wifiPhy.SetChannel (wifiChannel.Create ());
346 
347  NetDeviceContainer wifiApDevices;
348  NetDeviceContainer wifiStaDevices;
349  NetDeviceContainer wifiDevices;
350 
351  //Configure the STA node
352  wifi.SetRemoteStationManager ("ns3::MinstrelWifiManager", "RtsCtsThreshold", UintegerValue (rtsThreshold));
353  wifiPhy.Set ("TxPowerStart", DoubleValue (maxPower));
354  wifiPhy.Set ("TxPowerEnd", DoubleValue (maxPower));
355 
356  Ssid ssid = Ssid ("AP");
357  wifiMac.SetType ("ns3::StaWifiMac",
358  "Ssid", SsidValue (ssid));
359  wifiStaDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiStaNodes.Get (0)));
360 
361  //Configure the AP node
362  wifi.SetRemoteStationManager (manager, "DefaultTxPowerLevel", UintegerValue (powerLevels - 1), "RtsCtsThreshold", UintegerValue (rtsThreshold));
363  wifiPhy.Set ("TxPowerStart", DoubleValue (minPower));
364  wifiPhy.Set ("TxPowerEnd", DoubleValue (maxPower));
365  wifiPhy.Set ("TxPowerLevels", UintegerValue (powerLevels));
366 
367  ssid = Ssid ("AP");
368  wifiMac.SetType ("ns3::ApWifiMac",
369  "Ssid", SsidValue (ssid));
370  wifiApDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiApNodes.Get (0)));
371 
372  wifiDevices.Add (wifiStaDevices);
373  wifiDevices.Add (wifiApDevices);
374 
375  //Configure the mobility.
377  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
378  //Initial position of AP and STA
379  positionAlloc->Add (Vector (ap1_x, ap1_y, 0.0));
380  NS_LOG_INFO ("Setting initial AP position to " << Vector (ap1_x, ap1_y, 0.0));
381  positionAlloc->Add (Vector (sta1_x, sta1_y, 0.0));
382  NS_LOG_INFO ("Setting initial STA position to " << Vector (sta1_x, sta1_y, 0.0));
383  mobility.SetPositionAllocator (positionAlloc);
384  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
385  mobility.Install (wifiApNodes.Get (0));
386  mobility.Install (wifiStaNodes.Get (0));
387 
388  //Statistics counter
389  NodeStatistics statistics = NodeStatistics (wifiApDevices, wifiStaDevices);
390 
391  //Move the STA by stepsSize meters every stepsTime seconds
392  Simulator::Schedule (Seconds (0.5 + stepsTime), &NodeStatistics::AdvancePosition, &statistics, wifiStaNodes.Get (0), stepsSize, stepsTime);
393 
394  //Configure the IP stack
396  stack.Install (wifiApNodes);
397  stack.Install (wifiStaNodes);
399  address.SetBase ("10.1.1.0", "255.255.255.0");
400  Ipv4InterfaceContainer i = address.Assign (wifiDevices);
401  Ipv4Address sinkAddress = i.GetAddress (0);
402  uint16_t port = 9;
403 
404  //Configure the CBR generator
405  PacketSinkHelper sink ("ns3::UdpSocketFactory", InetSocketAddress (sinkAddress, port));
406  ApplicationContainer apps_sink = sink.Install (wifiStaNodes.Get (0));
407 
408  OnOffHelper onoff ("ns3::UdpSocketFactory", InetSocketAddress (sinkAddress, port));
409  onoff.SetConstantRate (DataRate ("54Mb/s"), packetSize);
410  onoff.SetAttribute ("StartTime", TimeValue (Seconds (0.5)));
411  onoff.SetAttribute ("StopTime", TimeValue (Seconds (simuTime)));
412  ApplicationContainer apps_source = onoff.Install (wifiApNodes.Get (0));
413 
414  apps_sink.Start (Seconds (0.5));
415  apps_sink.Stop (Seconds (simuTime));
416 
417  //------------------------------------------------------------
418  //-- Setup stats and data collection
419  //--------------------------------------------
420 
421  //Register packet receptions to calculate throughput
422  Config::Connect ("/NodeList/1/ApplicationList/*/$ns3::PacketSink/Rx",
423  MakeCallback (&NodeStatistics::RxCallback, &statistics));
424 
425  //Register power and rate changes to calculate the Average Transmit Power
426  Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/PowerChange",
428  Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/RateChange",
430 
431  Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxBegin",
432  MakeCallback (&NodeStatistics::PhyCallback, &statistics));
433 
434  //Callbacks to print every change of power and rate
435  Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/PowerChange",
437  Config::Connect ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$" + manager + "/RateChange",
439 
440  Simulator::Stop (Seconds (simuTime));
441  Simulator::Run ();
442 
443  std::ofstream outfile (("throughput-" + outputFileName + ".plt").c_str ());
444  Gnuplot gnuplot = Gnuplot (("throughput-" + outputFileName + ".eps").c_str (), "Throughput");
445  gnuplot.SetTerminal ("post eps color enhanced");
446  gnuplot.SetLegend ("Time (seconds)", "Throughput (Mb/s)");
447  gnuplot.SetTitle ("Throughput (AP to STA) vs time");
448  gnuplot.AddDataset (statistics.GetDatafile ());
449  gnuplot.GenerateOutput (outfile);
450 
451  if (manager.compare ("ns3::ParfWifiManager") == 0
452  || manager.compare ("ns3::AparfWifiManager") == 0
453  || manager.compare ("ns3::RrpaaWifiManager") == 0)
454  {
455  std::ofstream outfile2 (("power-" + outputFileName + ".plt").c_str ());
456  gnuplot = Gnuplot (("power-" + outputFileName + ".eps").c_str (), "Average Transmit Power");
457  gnuplot.SetTerminal ("post eps color enhanced");
458  gnuplot.SetLegend ("Time (seconds)", "Power (mW)");
459  gnuplot.SetTitle ("Average transmit power (AP to STA) vs time");
460  gnuplot.AddDataset (statistics.GetPowerDatafile ());
461  gnuplot.GenerateOutput (outfile2);
462  }
463 
465 
466  return 0;
467 }
Ptr< PacketSink > sink
Definition: wifi-tcp.cc:56
void Set(std::string name, const AttributeValue &v)
Definition: wifi-helper.cc:134
holds a vector of ns3::Application pointers.
void SetupPhy(Ptr< WifiPhy > phy)
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
an Inet address class
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetPosition(Ptr< Node > node, Vector position)
static void AdvancePosition(Ptr< Node > node)
Definition: wifi-ap.cc:103
Class to represent a 2D points plot.
Definition: gnuplot.h:117
holds a vector of std::pair of Ptr<Ipv4> and interface index.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:831
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 Vector GetPosition(Ptr< Node > node)
Definition: multirate.cc:341
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:355
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
static void Run(void)
Run the simulation.
Definition: simulator.cc:226
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
aggregate IP/TCP/UDP functionality to existing Nodes.
void RateCallback(std::string path, DataRate oldRate, DataRate newRate, Mac48Address dest)
void AddDataset(const GnuplotDataset &dataset)
Definition: gnuplot.cc:756
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:278
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
cmd
Definition: second.py:35
WifiMacType GetType(void) const
Return the type (enum WifiMacType)
static YansWifiPhyHelper Default(void)
Create a phy helper in a default working state.
STL namespace.
helps to create WifiNetDevice objects
Definition: wifi-helper.h:230
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
Definition: on-off-helper.h:42
stack
Definition: first.py:34
Gnuplot2dDataset GetPowerDatafile()
void AdvancePosition(Ptr< Node > node, int stepsSize, int stepsTime)
static void SetPosition(Ptr< Node > node, Vector position)
Definition: wifi-ap.cc:89
uint16_t port
Definition: dsdv-manet.cc:45
a polymophic address class
Definition: address.h:90
Ptr< YansWifiChannel > Create(void) const
Gnuplot2dDataset GetDatafile()
mobility
Definition: third.py:101
phy
Definition: third.py:86
void RxCallback(std::string path, Ptr< const Packet > packet, const Address &from)
Class for representing data rates.
Definition: data-rate.h:88
Keep track of the current position and velocity of an object.
void SetChannel(Ptr< YansWifiChannel > channel)
Time GetCalcTxTime(DataRate rate)
void PowerCallback(std::string path, double oldPower, double newPower, Mac48Address dest)
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1381
a simple class to generate gnuplot-ready plotting commands from a set of datasets.
Definition: gnuplot.h:371
AttributeValue implementation for Time.
Definition: nstime.h:1076
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
void SetTitle(const std::string &title)
Definition: gnuplot.cc:730
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Hold an unsigned integer type.
Definition: uinteger.h:44
ssid
Definition: third.py:93
holds a vector of ns3::NetDevice pointers
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Definition: packet.cc:290
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1489
void GenerateOutput(std::ostream &os)
Writes gnuplot commands and data values to a single output stream.
Definition: gnuplot.cc:762
void PowerCallback(std::string path, double oldPower, double newPower, Mac48Address dest)
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.
Definition: command-line.h:213
void Connect(std::string path, const CallbackBase &cb)
Definition: config.cc:843
void SetLegend(const std::string &xLegend, const std::string &yLegend)
Definition: gnuplot.cc:736
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:190
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:459
Ptr< WifiPhy > GetPhy(void) const
OFDM PHY for the 5 GHz band (Clause 17)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
address
Definition: first.py:37
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
std::map< Mac48Address, double > currentPower
Gnuplot2dDataset m_output_power
std::vector< std::pair< Time, DataRate > > TxTime
an EUI-48 address
Definition: mac48-address.h:43
manage and create wifi channel objects for the yans model.
create MAC layers for a ns3::WifiNetDevice.
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:249
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:35
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void PhyCallback(std::string path, Ptr< const Packet > packet)
virtual void SetType(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue())
std::map< Mac48Address, DataRate > currentRate
wifi
Definition: third.py:89
Helper class used to assign positions and mobility models to nodes.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
Ptr< WifiMac > GetMac(void) const
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:234
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:270
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1014
uint32_t GetN(void) const
Get the number of Ptr<NetDevice> stored in this container.
AttributeValue implementation for Ssid.
Definition: ssid.h:110
void Add(Vector v)
Add a position to the list of positions.
NodeStatistics(NetDeviceContainer aps, NetDeviceContainer stas)
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
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 const uint32_t packetSize
wifiStaNodes
Definition: third.py:81
void SetTerminal(const std::string &terminal)
Definition: gnuplot.cc:724
This class can be used to hold variables of floating point type such as &#39;double&#39; or &#39;float&#39;...
Definition: double.h:41
Vector GetPosition(Ptr< Node > node)
void RateCallback(std::string path, DataRate oldRate, DataRate newRate, Mac48Address dest)
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:156
Implements the IEEE 802.11 MAC header.