A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
minstrel-ht-wifi-manager-example.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2016 University of Washington
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: Tom Henderson <tomhend@u.washington.edu>
19  * Matías Richart <mrichart@fing.edu.uy>
20  */
21 
22 // Test the operation of IdealWifiManager as the SNR is varied, and create
23 // a gnuplot output file for plotting
24 //
25 // By default, the 802.11b standard is plotted. Several command line
26 // arguments can change the following options:
27 // --rtsThreshold: RTS threshold [65535]
28 // --BE_MaxAmpduSize: BE Mac A-MPDU size [65535]
29 // --stepSize: Power between steps (dBm) [1]
30 // --stepTime: Time on each step (seconds) [1]
31 // --broadcast: Send broadcast instead of unicast [0]
32 // --channelWidth: Set channel width (valid only for 802.11n or ac) [20]
33 // --standard: Set standard (802.11a, 802.11b, 802.11g, 802.11n-5GHz, 802.11ac, and others...) [802.11b]
34 
35 #include "ns3/core-module.h"
36 #include "ns3/network-module.h"
37 #include "ns3/wifi-module.h"
38 #include "ns3/stats-module.h"
39 #include "ns3/mobility-module.h"
40 #include "ns3/propagation-module.h"
41 
42 using namespace ns3;
43 
44 NS_LOG_COMPONENT_DEFINE ("MinstrelHtWifiManagerExample");
45 
46 // 20 MHz, 290K
47 const double NOISE_DBM_Hz = -174.0;
49 
50 double g_intervalBytes = 0;
51 uint64_t g_intervalRate = 0;
52 
53 void
55 {
56  NS_LOG_DEBUG ("Received size " << pkt->GetSize ());
57  g_intervalBytes += pkt->GetSize ();
58 }
59 
60 void
61 RateChange (uint64_t newVal, Mac48Address dest)
62 {
63  NS_LOG_DEBUG ("Change to " << newVal);
64  g_intervalRate = newVal;
65 }
66 
67 struct Step
68 {
69  double stepSize;
70  double stepTime;
71 };
72 
73 struct StandardInfo
74 {
76  {
77  m_name = "none";
78  }
79  StandardInfo (std::string name, enum WifiPhyStandard standard, uint32_t width, bool sgi, double snrLow, double snrHigh, double xMin, double xMax, double yMax)
80  : m_name (name),
81  m_standard (standard),
82  m_width (width),
83  m_sgi (sgi),
84  m_snrLow (snrLow),
85  m_snrHigh (snrHigh),
86  m_xMin (xMin),
87  m_xMax (xMax),
88  m_yMax (yMax)
89  {
90  }
91  std::string m_name;
92  enum WifiPhyStandard m_standard;
93  uint32_t m_width;
94  bool m_sgi;
95  double m_snrLow;
96  double m_snrHigh;
97  double m_xMin;
98  double m_xMax;
99  double m_yMax;
100 };
101 
102 void
103 ChangeSignalAndReportRate (Ptr<FixedRssLossModel> rssModel, struct Step step, double rss, Gnuplot2dDataset& rateDataset, Gnuplot2dDataset& actualDataset)
104 {
105  NS_LOG_FUNCTION (rssModel << step.stepSize << step.stepTime << rss);
106  double snr = rss - noiseDbm; //dB
107  rateDataset.Add (snr, g_intervalRate / 1000000.0);
108  // Calculate received rate since last interval
109  double currentRate = ((g_intervalBytes * 8) / step.stepTime) / 1e6; // Mb/s
110  actualDataset.Add (snr, currentRate);
111  rssModel->SetRss (rss - step.stepSize);
112  NS_LOG_INFO ("At time " << Simulator::Now ().As (Time::S) << "; observed rate " << currentRate << "; setting new power to " << rss - step.stepSize);
113  g_intervalBytes = 0;
114  Simulator::Schedule (Seconds (step.stepTime), &ChangeSignalAndReportRate, rssModel, step, (rss - step.stepSize), rateDataset, actualDataset);
115 }
116 
117 int main (int argc, char *argv[])
118 {
119  std::vector <StandardInfo> standards;
120  int steps;
121  uint32_t rtsThreshold = 65535;
122  uint32_t BE_MaxAmpduSize = 65535;
123  double stepSize = 1; // dBm
124  double stepTime = 1; // seconds
125  uint32_t packetSize = 1024; // bytes
126  int broadcast = 0;
127  int ap1_x = 0;
128  int ap1_y = 0;
129  int sta1_x = 5;
130  int sta1_y = 0;
131  uint16_t nss = 1;
132  bool shortGuardInterval = false;
133  uint32_t channelWidth = 20;
134  std::string standard ("802.11b");
135  StandardInfo selectedStandard;
136  std::string outfileName ("minstrel-ht-");
137 
139  cmd.AddValue ("rtsThreshold", "RTS threshold", rtsThreshold);
140  cmd.AddValue ("BE_MaxAmpduSize", "BE Max A-MPDU size", BE_MaxAmpduSize);
141  cmd.AddValue ("stepSize", "Power between steps (dBm)", stepSize);
142  cmd.AddValue ("stepTime", "Time on each step (seconds)", stepTime);
143  cmd.AddValue ("broadcast", "Send broadcast instead of unicast", broadcast);
144  cmd.AddValue ("channelWidth", "Set channel width (valid only for 802.11n or ac)", channelWidth);
145  cmd.AddValue ("shortGuard", "Set short guard interval (802.11n/ac)", shortGuardInterval);
146  cmd.AddValue ("nss", "Set nss (valid only for 802.11n or ac)", nss);
147  cmd.AddValue ("standard", "Set standard (02.11a, 802.11b, 802.11g, 802.11n-5GHz, 802.11n-2.4GHz, 802.11ac, 802.11-holland, 802.11-10MHz, 802.11-5MHz)", standard);
148  cmd.Parse (argc, argv);
149 
150  if (standard == "802.11b")
151  {
152  NS_ABORT_MSG_IF (channelWidth != 20 && channelWidth != 22, "Invalid channel width for standard " << standard);
153  NS_ABORT_MSG_IF (nss != 1, "Invalid nss for standard " << standard);
154  }
155  else if (standard == "802.11a" || standard == "802.11g")
156  {
157  NS_ABORT_MSG_IF (channelWidth != 20, "Invalid channel width for standard " << standard);
158  NS_ABORT_MSG_IF (nss != 1, "Invalid nss for standard " << standard);
159  }
160  else if (standard == "802.11n-5GHz" || standard == "802.11n-2.4GHz")
161  {
162  NS_ABORT_MSG_IF (channelWidth != 20 && channelWidth != 40, "Invalid channel width for standard " << standard);
163  NS_ABORT_MSG_IF (nss == 0 || nss > 4, "Invalid nss " << nss << " for standard " << standard);
164  }
165  else if (standard == "802.11ac")
166  {
167  NS_ABORT_MSG_IF (channelWidth != 20 && channelWidth != 40 && channelWidth != 80 && channelWidth != 160, "Invalid channel width for standard " << standard);
168  NS_ABORT_MSG_IF (nss == 0 || nss > 4, "Invalid nss " << nss << " for standard " << standard);
169  }
170 
171  outfileName.append (standard);
172  if (standard == "802.11n-5GHz" || standard == "802.11n-2.4GHz" || standard == "802.11ac")
173  {
174  std::ostringstream oss;
175  std::string gi;
176  if (shortGuardInterval)
177  {
178  gi = "SGI";
179  }
180  else
181  {
182  gi = "LGI";
183  }
184  oss << "-" << channelWidth << "MHz-" << gi << "-" <<nss << "SS";
185  outfileName += oss.str ();
186  }
187  std::string tmp = outfileName + ".plt";
188  std::ofstream outfile (tmp.c_str ());
189  tmp = outfileName + ".eps";
190  Gnuplot gnuplot = Gnuplot (tmp.c_str ());
191 
192  // The first number is channel width, second is minimum SNR, third is maximum
193  // SNR, fourth and fifth provide xrange axis limits, and sixth the yaxis
194  // maximum
195  standards.push_back (StandardInfo ("802.11a", WIFI_PHY_STANDARD_80211a, 20, false, 3, 27, 0, 30, 60));
196  standards.push_back (StandardInfo ("802.11b", WIFI_PHY_STANDARD_80211b, 22, false, -5, 11, -6, 15, 15));
197  standards.push_back (StandardInfo ("802.11g", WIFI_PHY_STANDARD_80211g, 20, false, -5, 27, -6, 30, 80));
198  standards.push_back (StandardInfo ("802.11n-5GHz", WIFI_PHY_STANDARD_80211n_5GHZ, channelWidth, shortGuardInterval, 5, 30, 0, 35, 80));
199  standards.push_back (StandardInfo ("802.11n-2.4GHz", WIFI_PHY_STANDARD_80211n_2_4GHZ, channelWidth, shortGuardInterval, 5, 30, 0, 35, 80));
200  standards.push_back (StandardInfo ("802.11ac", WIFI_PHY_STANDARD_80211ac, channelWidth, shortGuardInterval, 5, 30, 0, 35, 80));
201  standards.push_back (StandardInfo ("802.11-holland", WIFI_PHY_STANDARD_holland, 20, false, 3, 27, 0, 30, 60));
202  standards.push_back (StandardInfo ("802.11-10MHz", WIFI_PHY_STANDARD_80211_10MHZ, 10, false, 3, 27, 0, 30, 60));
203  standards.push_back (StandardInfo ("802.11-5MHz", WIFI_PHY_STANDARD_80211_5MHZ, 5, false, 3, 27, 0, 30, 60));
204 
205  for (std::vector<StandardInfo>::size_type i = 0; i != standards.size (); i++)
206  {
207  if (standard == standards[i].m_name)
208  {
209  selectedStandard = standards[i];
210  }
211  }
212  NS_ABORT_IF (selectedStandard.m_name == "none");
213  std::cout << "Testing " << selectedStandard.m_name << "..." << std::endl;
214  NS_ABORT_MSG_IF (selectedStandard.m_snrLow >= selectedStandard.m_snrHigh, "SNR values in wrong order");
215  steps = std::abs ((int) (selectedStandard.m_snrHigh - selectedStandard.m_snrLow ) / stepSize) + 1;
216  Ptr<Node> clientNode = CreateObject<Node> ();
217  Ptr<Node> serverNode = CreateObject<Node> ();
218 
220  wifi.SetStandard (selectedStandard.m_standard);
222  wifiPhy.Set ("RxGain", DoubleValue (0.0));
223  wifiPhy.Set ("RxNoiseFigure", DoubleValue (0.0));
224  wifiPhy.Set ("EnergyDetectionThreshold", DoubleValue (-110.0));
225  wifiPhy.Set ("CcaMode1Threshold", DoubleValue (-110.0));
226 
227  Ptr<YansWifiChannel> wifiChannel = CreateObject<YansWifiChannel> ();
228  Ptr<ConstantSpeedPropagationDelayModel> delayModel = CreateObject<ConstantSpeedPropagationDelayModel> ();
229  wifiChannel->SetPropagationDelayModel (delayModel);
230  Ptr<FixedRssLossModel> rssLossModel = CreateObject<FixedRssLossModel> ();
231  wifiChannel->SetPropagationLossModel (rssLossModel);
232  wifiPhy.SetChannel (wifiChannel);
233  wifiPhy.Set ("ShortGuardEnabled", BooleanValue (selectedStandard.m_sgi));
234 
235  wifi.SetRemoteStationManager ("ns3::MinstrelHtWifiManager", "RtsCtsThreshold", UintegerValue (rtsThreshold), "PrintStats", BooleanValue (true));
236 
237  // Use Adhoc so we don't get into association issues
238  NetDeviceContainer serverDevice;
239  NetDeviceContainer clientDevice;
240 
241  WifiMacHelper wifiMac;
242  wifiMac.SetType ("ns3::AdhocWifiMac",
243  "BE_MaxAmpduSize", UintegerValue (BE_MaxAmpduSize));
244  serverDevice = wifi.Install (wifiPhy, wifiMac, serverNode);
245  clientDevice = wifi.Install (wifiPhy, wifiMac, clientNode);
246 
247  Config::ConnectWithoutContext ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$ns3::MinstrelHtWifiManager/RateChange", MakeCallback (&RateChange));
248 
249  // Configure the mobility.
251  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
252  //Initial position of AP and STA
253  positionAlloc->Add (Vector (ap1_x, ap1_y, 0.0));
254  NS_LOG_INFO ("Setting initial AP position to " << Vector (ap1_x, ap1_y, 0.0));
255  positionAlloc->Add (Vector (sta1_x, sta1_y, 0.0));
256  NS_LOG_INFO ("Setting initial STA position to " << Vector (sta1_x, sta1_y, 0.0));
257  mobility.SetPositionAllocator (positionAlloc);
258  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
259  mobility.Install (clientNode);
260  mobility.Install (serverNode);
261 
262  Gnuplot2dDataset rateDataset (selectedStandard.m_name + std::string ("-rate selected"));
263  Gnuplot2dDataset actualDataset (selectedStandard.m_name + std::string ("-observed"));
264  struct Step step;
265  step.stepSize = stepSize;
266  step.stepTime = stepTime;
267 
268  // Set channel width
269  // Adjust noise for channel width
270  // Obtain pointer to the WifiPhy
271  Ptr<NetDevice> ndClient = clientDevice.Get (0);
272  Ptr<WifiNetDevice> wndClient = ndClient->GetObject<WifiNetDevice> ();
273  Ptr<WifiPhy> wifiPhyPtrClient = wndClient->GetPhy ();
274  wifiPhyPtrClient->SetChannelWidth (selectedStandard.m_width);
275  wifiPhyPtrClient->SetNumberOfTransmitAntennas (nss);
276  wifiPhyPtrClient->SetNumberOfReceiveAntennas (nss);
277  noiseDbm += 10 * log10 (selectedStandard.m_width * 1000000);
278  NS_LOG_DEBUG ("Channel width " << wifiPhyPtrClient->GetChannelWidth () << " noiseDbm " << noiseDbm);
279 
280  // Set channel width
281  // Adjust noise for channel width
282  // Obtain pointer to the WifiPhy
283  Ptr<NetDevice> ndServer = serverDevice.Get (0);
284  Ptr<WifiNetDevice> wndServer = ndServer->GetObject<WifiNetDevice> ();
285  Ptr<WifiPhy> wifiPhyPtrServer = wndServer->GetPhy ();
286  wifiPhyPtrServer->SetChannelWidth (selectedStandard.m_width);
287  wifiPhyPtrServer->SetNumberOfTransmitAntennas (nss);
288  wifiPhyPtrServer->SetNumberOfReceiveAntennas (nss);
289 
290  double rssCurrent = (selectedStandard.m_snrHigh + noiseDbm);
291  rssLossModel->SetRss (rssCurrent);
292  NS_LOG_INFO ("Setting initial Rss to " << rssCurrent);
293  //Move the STA by stepsSize meters every stepTime seconds
294  Simulator::Schedule (Seconds (0.5 + stepTime), &ChangeSignalAndReportRate, rssLossModel, step, rssCurrent, rateDataset, actualDataset);
295 
296  PacketSocketHelper packetSocketHelper;
297  packetSocketHelper.Install (serverNode);
298  packetSocketHelper.Install (clientNode);
299 
300  PacketSocketAddress socketAddr;
301  socketAddr.SetSingleDevice (serverDevice.Get (0)->GetIfIndex ());
302  if (broadcast)
303  {
304  socketAddr.SetPhysicalAddress (serverDevice.Get (0)->GetBroadcast ());
305  }
306  else
307  {
308  socketAddr.SetPhysicalAddress (serverDevice.Get (0)->GetAddress ());
309  }
310  // Arbitrary protocol type.
311  // Note: PacketSocket doesn't have any L4 multiplexing or demultiplexing
312  // The only mux/demux is based on the protocol field
313  socketAddr.SetProtocol (1);
314 
315  Ptr<PacketSocketClient> client = CreateObject<PacketSocketClient> ();
316  client->SetRemote (socketAddr);
317  client->SetStartTime (Seconds (0.5));
318  client->SetAttribute ("MaxPackets", UintegerValue (0));
319  client->SetAttribute ("PacketSize", UintegerValue (packetSize));
320  client->SetAttribute ("Interval", TimeValue (MicroSeconds (20)));
321  clientNode->AddApplication (client);
322 
323  Ptr<PacketSocketServer> server = CreateObject<PacketSocketServer> ();
324  server->SetLocal (socketAddr);
326  serverNode->AddApplication (server);
327 
328  Simulator::Stop (Seconds ((steps + 1) * stepTime));
329  Simulator::Run ();
331 
332  gnuplot.AddDataset (rateDataset);
333  gnuplot.AddDataset (actualDataset);
334 
335  std::ostringstream xMinStr, xMaxStr, yMaxStr;
336  std::string xRangeStr ("set xrange [");
337  xMinStr << selectedStandard.m_xMin;
338  xRangeStr.append (xMinStr.str ());
339  xRangeStr.append (":");
340  xMaxStr << selectedStandard.m_xMax;
341  xRangeStr.append (xMaxStr.str ());
342  xRangeStr.append ("]");
343  std::string yRangeStr ("set yrange [0:");
344  yMaxStr << selectedStandard.m_yMax;
345  yRangeStr.append (yMaxStr.str ());
346  yRangeStr.append ("]");
347 
348  std::ostringstream widthStrStr;
349  std::ostringstream nssStrStr;
350  std::string title ("Wi-Fi Minstrel ht rate control: ");
351  title.append (standard);
352  title.append (" channel width: ");
353  widthStrStr << selectedStandard.m_width;
354  title.append (widthStrStr.str ());
355  title.append (" MHz nss: ");
356  nssStrStr << nss;
357  title.append (nssStrStr.str ());
358  if (shortGuardInterval == true)
359  {
360  title.append (" shortGuard: true");
361  }
362 
363  gnuplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\"");
364  gnuplot.SetLegend ("SNR (dB)", "Rate (Mb/s)");
365  gnuplot.SetTitle (title);
366  gnuplot.SetExtra (xRangeStr);
367  gnuplot.AppendExtra (yRangeStr);
368  gnuplot.AppendExtra ("set key reverse left Left");
369  gnuplot.GenerateOutput (outfile);
370  outfile.close ();
371  return 0;
372 }
ERP-OFDM PHY (Clause 19, Section 19.5)
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
Definition: node.cc:157
void PacketRx(Ptr< const Packet > pkt, const Address &addr)
void AppendExtra(const std::string &extra)
Definition: gnuplot.cc:749
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
AttributeValue implementation for Boolean.
Definition: boolean.h:34
void SetLocal(PacketSocketAddress addr)
set the local address and protocol to be used
HT OFDM PHY for the 5 GHz band (clause 20)
Class to represent a 2D points plot.
Definition: gnuplot.h:113
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:455
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
Make it easy to create and manage PHY objects for the yans model.
void SetPropagationLossModel(Ptr< PropagationLossModel > loss)
an address for a packet socket
void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
static void Run(void)
Run the simulation.
Definition: simulator.cc:200
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:792
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
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:244
void Set(std::string name, const AttributeValue &v)
HT OFDM PHY for the 2.4 GHz band (clause 20)
static YansWifiPhyHelper Default(void)
Create a phy helper in a default working state.
helps to create WifiNetDevice objects
Definition: wifi-helper.h:76
StandardInfo(std::string name, enum WifiPhyStandard standard, uint32_t width, bool sgi, double snrLow, double snrHigh, double xMin, double xMax, double yMax)
Give ns3::PacketSocket powers to ns3::Node.
tuple cmd
Definition: second.py:35
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
a polymophic address class
Definition: address.h:90
void SetChannel(Ptr< YansWifiChannel > channel)
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
Ptr< WifiPhy > GetPhy(void) const
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
tuple mobility
Definition: third.py:101
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1221
a simple class to generate gnuplot-ready plotting commands from a set of datasets.
Definition: gnuplot.h:367
AttributeValue implementation for Time.
Definition: nstime.h:957
void SetTitle(const std::string &title)
Definition: gnuplot.cc:730
Hold an unsigned integer type.
Definition: uinteger.h:44
holds a vector of ns3::NetDevice pointers
Hold together all Wifi-related objects.
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 ConnectWithoutContext(std::string path, const CallbackBase &cb)
Definition: config.cc:824
void Add(double x, double y)
Definition: gnuplot.cc:359
Parse command-line arguments.
Definition: command-line.h:201
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:164
This is intended to be the configuration used in this paper: Gavin Holland, Nitin Vaidya and Paramvir...
enum WifiPhyStandard m_standard
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Definition: object-base.cc:299
OFDM PHY for the 5 GHz band (Clause 17)
void SetPhysicalAddress(const Address address)
Set the destination address.
VHT OFDM PHY (clause 22)
uint64_t g_intervalRate
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
void SetMobilityModel(std::string type, 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())
an EUI-48 address
Definition: mac48-address.h:43
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
create MAC layers for a ns3::WifiNetDevice.
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:223
void SetExtra(const std::string &extra)
Definition: gnuplot.cc:743
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())
Helper class used to assign positions and mobility models to nodes.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Definition: abort.h:77
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
void SetRemote(PacketSocketAddress addr)
set the remote address and protocol to be used
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
Definition: command-line.h:491
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:208
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:895
void ChangeSignalAndReportRate(Ptr< FixedRssLossModel > rssModel, struct Step step, double rss, Gnuplot2dDataset &rateDataset, Gnuplot2dDataset &actualDataset)
void SetProtocol(uint16_t protocol)
Set the protocol.
void Add(Vector v)
Add a position to the list of positions.
const double NOISE_DBM_Hz
void Parse(int argc, char *argv[])
Parse the program arguments.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:911
tuple wifi
Definition: third.py:89
static const uint32_t packetSize
second
Definition: nstime.h:114
virtual void SetChannelWidth(uint32_t channelwidth)=0
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
void SetTerminal(const std::string &terminal)
Definition: gnuplot.cc:724
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Definition: double.h:41
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:191
void SetStartTime(Time start)
Specify application start time.
Definition: application.cc:69
void RateChange(uint64_t newVal, Mac48Address dest)