A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-spectrum-per-example.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 MIRKO BANCHI
3 * Copyright (c) 2015 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 * Authors: Mirko Banchi <mk.banchi@gmail.com>
19 * Sebastien Deronne <sebastien.deronne@gmail.com>
20 * Tom Henderson <tomhend@u.washington.edu>
21 *
22 * Adapted from wifi-ht-network.cc example
23 */
24
25#include "ns3/boolean.h"
26#include "ns3/command-line.h"
27#include "ns3/config.h"
28#include "ns3/double.h"
29#include "ns3/internet-stack-helper.h"
30#include "ns3/ipv4-address-helper.h"
31#include "ns3/ipv4-global-routing-helper.h"
32#include "ns3/log.h"
33#include "ns3/mobility-helper.h"
34#include "ns3/multi-model-spectrum-channel.h"
35#include "ns3/on-off-helper.h"
36#include "ns3/packet-sink-helper.h"
37#include "ns3/packet-sink.h"
38#include "ns3/propagation-loss-model.h"
39#include "ns3/spectrum-wifi-helper.h"
40#include "ns3/ssid.h"
41#include "ns3/string.h"
42#include "ns3/udp-client-server-helper.h"
43#include "ns3/udp-server.h"
44#include "ns3/uinteger.h"
45#include "ns3/yans-wifi-channel.h"
46#include "ns3/yans-wifi-helper.h"
47
48#include <iomanip>
49
50// This is a simple example of an IEEE 802.11n Wi-Fi network.
51//
52// The main use case is to enable and test SpectrumWifiPhy vs YansWifiPhy
53// for packet error ratio
54//
55// Network topology:
56//
57// Wi-Fi 192.168.1.0
58//
59// STA AP
60// * <-- distance --> *
61// | |
62// n1 n2
63//
64// Users may vary the following command-line arguments in addition to the
65// attributes, global values, and default values typically available:
66//
67// --simulationTime: Simulation time in seconds [10]
68// --udp: UDP if set to 1, TCP otherwise [true]
69// --distance: meters separation between nodes [50]
70// --index: restrict index to single value between 0 and 31 [256]
71// --wifiType: select ns3::SpectrumWifiPhy or ns3::YansWifiPhy [ns3::SpectrumWifiPhy]
72// --errorModelType: select ns3::NistErrorRateModel or ns3::YansErrorRateModel
73// [ns3::NistErrorRateModel]
74// --enablePcap: enable pcap output [false]
75//
76// By default, the program will step through 32 index values, corresponding
77// to the following MCS, channel width, and guard interval combinations:
78// index 0-7: MCS 0-7, long guard interval, 20 MHz channel
79// index 8-15: MCS 0-7, short guard interval, 20 MHz channel
80// index 16-23: MCS 0-7, long guard interval, 40 MHz channel
81// index 24-31: MCS 0-7, short guard interval, 40 MHz channel
82// and send UDP for 10 seconds using each MCS, using the SpectrumWifiPhy and the
83// NistErrorRateModel, at a distance of 50 meters. The program outputs
84// results such as:
85//
86// wifiType: ns3::SpectrumWifiPhy distance: 50m; time: 10; TxPower: 1 dBm (1.3 mW)
87// index MCS Rate (Mb/s) Tput (Mb/s) Received Signal (dBm) Noise (dBm) SNR (dB)
88// 0 0 6.50 5.77 7414 -79.71 -93.97 14.25
89// 1 1 13.00 11.58 14892 -79.71 -93.97 14.25
90// 2 2 19.50 17.39 22358 -79.71 -93.97 14.25
91// 3 3 26.00 22.96 29521 -79.71 -93.97 14.25
92// ...
93//
94
95using namespace ns3;
96
97// Global variables for use in callbacks.
98double g_signalDbmAvg; //!< Average signal power [dBm]
99double g_noiseDbmAvg; //!< Average noise power [dBm]
100uint32_t g_samples; //!< Number of samples
101
102/**
103 * Monitor sniffer Rx trace
104 *
105 * \param packet The sensed packet.
106 * \param channelFreqMhz The channel frequency [MHz].
107 * \param txVector The Tx vector.
108 * \param aMpdu The aMPDU.
109 * \param signalNoise The signal and noise dBm.
110 * \param staId The STA ID.
111 */
112void
114 uint16_t channelFreqMhz,
115 WifiTxVector txVector,
116 MpduInfo aMpdu,
117 SignalNoiseDbm signalNoise,
118 uint16_t staId)
119
120{
121 g_samples++;
122 g_signalDbmAvg += ((signalNoise.signal - g_signalDbmAvg) / g_samples);
123 g_noiseDbmAvg += ((signalNoise.noise - g_noiseDbmAvg) / g_samples);
124}
125
126NS_LOG_COMPONENT_DEFINE("WifiSpectrumPerExample");
127
128int
129main(int argc, char* argv[])
130{
131 bool udp = true;
132 double distance = 50;
133 double simulationTime = 10; // seconds
134 uint16_t index = 256;
135 std::string wifiType = "ns3::SpectrumWifiPhy";
136 std::string errorModelType = "ns3::NistErrorRateModel";
137 bool enablePcap = false;
138 const uint32_t tcpPacketSize = 1448;
139
140 CommandLine cmd(__FILE__);
141 cmd.AddValue("simulationTime", "Simulation time in seconds", simulationTime);
142 cmd.AddValue("udp", "UDP if set to 1, TCP otherwise", udp);
143 cmd.AddValue("distance", "meters separation between nodes", distance);
144 cmd.AddValue("index", "restrict index to single value between 0 and 31", index);
145 cmd.AddValue("wifiType", "select ns3::SpectrumWifiPhy or ns3::YansWifiPhy", wifiType);
146 cmd.AddValue("errorModelType",
147 "select ns3::NistErrorRateModel or ns3::YansErrorRateModel",
148 errorModelType);
149 cmd.AddValue("enablePcap", "enable pcap output", enablePcap);
150 cmd.Parse(argc, argv);
151
152 uint16_t startIndex = 0;
153 uint16_t stopIndex = 31;
154 if (index < 32)
155 {
156 startIndex = index;
157 stopIndex = index;
158 }
159
160 std::cout << "wifiType: " << wifiType << " distance: " << distance
161 << "m; time: " << simulationTime << "; TxPower: 1 dBm (1.3 mW)" << std::endl;
162 std::cout << std::setw(5) << "index" << std::setw(6) << "MCS" << std::setw(13) << "Rate (Mb/s)"
163 << std::setw(12) << "Tput (Mb/s)" << std::setw(10) << "Received " << std::setw(12)
164 << "Signal (dBm)" << std::setw(12) << "Noise (dBm)" << std::setw(9) << "SNR (dB)"
165 << std::endl;
166 for (uint16_t i = startIndex; i <= stopIndex; i++)
167 {
168 uint32_t payloadSize;
169 if (udp)
170 {
171 payloadSize = 972; // 1000 bytes IPv4
172 }
173 else
174 {
175 payloadSize = 1448; // 1500 bytes IPv6
176 Config::SetDefault("ns3::TcpSocket::SegmentSize", UintegerValue(payloadSize));
177 }
178
179 NodeContainer wifiStaNode;
180 wifiStaNode.Create(1);
182 wifiApNode.Create(1);
183
185 SpectrumWifiPhyHelper spectrumPhy;
186 if (wifiType == "ns3::YansWifiPhy")
187 {
189 channel.AddPropagationLoss("ns3::FriisPropagationLossModel",
190 "Frequency",
191 DoubleValue(5.180e9));
192 channel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");
193 phy.SetChannel(channel.Create());
194 phy.Set("TxPowerStart", DoubleValue(1)); // dBm (1.26 mW)
195 phy.Set("TxPowerEnd", DoubleValue(1));
196 }
197 else if (wifiType == "ns3::SpectrumWifiPhy")
198 {
199 Ptr<MultiModelSpectrumChannel> spectrumChannel =
200 CreateObject<MultiModelSpectrumChannel>();
201 Ptr<FriisPropagationLossModel> lossModel = CreateObject<FriisPropagationLossModel>();
202 lossModel->SetFrequency(5.180e9);
203 spectrumChannel->AddPropagationLossModel(lossModel);
204
206 CreateObject<ConstantSpeedPropagationDelayModel>();
207 spectrumChannel->SetPropagationDelayModel(delayModel);
208
209 spectrumPhy.SetChannel(spectrumChannel);
210 spectrumPhy.SetErrorRateModel(errorModelType);
211 spectrumPhy.Set("TxPowerStart", DoubleValue(1)); // dBm (1.26 mW)
212 spectrumPhy.Set("TxPowerEnd", DoubleValue(1));
213 }
214 else
215 {
216 NS_FATAL_ERROR("Unsupported WiFi type " << wifiType);
217 }
218
220 wifi.SetStandard(WIFI_STANDARD_80211n);
222
223 Ssid ssid = Ssid("ns380211n");
224
225 double datarate = 0;
227 if (i == 0)
228 {
229 DataRate = StringValue("HtMcs0");
230 datarate = 6.5;
231 }
232 else if (i == 1)
233 {
234 DataRate = StringValue("HtMcs1");
235 datarate = 13;
236 }
237 else if (i == 2)
238 {
239 DataRate = StringValue("HtMcs2");
240 datarate = 19.5;
241 }
242 else if (i == 3)
243 {
244 DataRate = StringValue("HtMcs3");
245 datarate = 26;
246 }
247 else if (i == 4)
248 {
249 DataRate = StringValue("HtMcs4");
250 datarate = 39;
251 }
252 else if (i == 5)
253 {
254 DataRate = StringValue("HtMcs5");
255 datarate = 52;
256 }
257 else if (i == 6)
258 {
259 DataRate = StringValue("HtMcs6");
260 datarate = 58.5;
261 }
262 else if (i == 7)
263 {
264 DataRate = StringValue("HtMcs7");
265 datarate = 65;
266 }
267 else if (i == 8)
268 {
269 DataRate = StringValue("HtMcs0");
270 datarate = 7.2;
271 }
272 else if (i == 9)
273 {
274 DataRate = StringValue("HtMcs1");
275 datarate = 14.4;
276 }
277 else if (i == 10)
278 {
279 DataRate = StringValue("HtMcs2");
280 datarate = 21.7;
281 }
282 else if (i == 11)
283 {
284 DataRate = StringValue("HtMcs3");
285 datarate = 28.9;
286 }
287 else if (i == 12)
288 {
289 DataRate = StringValue("HtMcs4");
290 datarate = 43.3;
291 }
292 else if (i == 13)
293 {
294 DataRate = StringValue("HtMcs5");
295 datarate = 57.8;
296 }
297 else if (i == 14)
298 {
299 DataRate = StringValue("HtMcs6");
300 datarate = 65;
301 }
302 else if (i == 15)
303 {
304 DataRate = StringValue("HtMcs7");
305 datarate = 72.2;
306 }
307 else if (i == 16)
308 {
309 DataRate = StringValue("HtMcs0");
310 datarate = 13.5;
311 }
312 else if (i == 17)
313 {
314 DataRate = StringValue("HtMcs1");
315 datarate = 27;
316 }
317 else if (i == 18)
318 {
319 DataRate = StringValue("HtMcs2");
320 datarate = 40.5;
321 }
322 else if (i == 19)
323 {
324 DataRate = StringValue("HtMcs3");
325 datarate = 54;
326 }
327 else if (i == 20)
328 {
329 DataRate = StringValue("HtMcs4");
330 datarate = 81;
331 }
332 else if (i == 21)
333 {
334 DataRate = StringValue("HtMcs5");
335 datarate = 108;
336 }
337 else if (i == 22)
338 {
339 DataRate = StringValue("HtMcs6");
340 datarate = 121.5;
341 }
342 else if (i == 23)
343 {
344 DataRate = StringValue("HtMcs7");
345 datarate = 135;
346 }
347 else if (i == 24)
348 {
349 DataRate = StringValue("HtMcs0");
350 datarate = 15;
351 }
352 else if (i == 25)
353 {
354 DataRate = StringValue("HtMcs1");
355 datarate = 30;
356 }
357 else if (i == 26)
358 {
359 DataRate = StringValue("HtMcs2");
360 datarate = 45;
361 }
362 else if (i == 27)
363 {
364 DataRate = StringValue("HtMcs3");
365 datarate = 60;
366 }
367 else if (i == 28)
368 {
369 DataRate = StringValue("HtMcs4");
370 datarate = 90;
371 }
372 else if (i == 29)
373 {
374 DataRate = StringValue("HtMcs5");
375 datarate = 120;
376 }
377 else if (i == 30)
378 {
379 DataRate = StringValue("HtMcs6");
380 datarate = 135;
381 }
382 else
383 {
384 DataRate = StringValue("HtMcs7");
385 datarate = 150;
386 }
387
388 wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager",
389 "DataMode",
390 DataRate,
391 "ControlMode",
392 DataRate);
393
394 NetDeviceContainer staDevice;
395 NetDeviceContainer apDevice;
396
397 if (wifiType == "ns3::YansWifiPhy")
398 {
399 mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
400 phy.Set("ChannelSettings",
401 StringValue(std::string("{0, ") + (i <= 15 ? "20" : "40") + ", BAND_5GHZ, 0}"));
402 staDevice = wifi.Install(phy, mac, wifiStaNode);
403 mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid));
404 apDevice = wifi.Install(phy, mac, wifiApNode);
405 }
406 else if (wifiType == "ns3::SpectrumWifiPhy")
407 {
408 mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
409 phy.Set("ChannelSettings",
410 StringValue(std::string("{0, ") + (i <= 15 ? "20" : "40") + ", BAND_5GHZ, 0}"));
411 staDevice = wifi.Install(spectrumPhy, mac, wifiStaNode);
412 mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid));
413 apDevice = wifi.Install(spectrumPhy, mac, wifiApNode);
414 }
415
416 if (i <= 7)
417 {
418 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
419 "ShortGuardIntervalSupported",
420 BooleanValue(false));
421 }
422 else if (i > 7 && i <= 15)
423 {
424 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
425 "ShortGuardIntervalSupported",
426 BooleanValue(true));
427 }
428 else if (i > 15 && i <= 23)
429 {
430 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
431 "ShortGuardIntervalSupported",
432 BooleanValue(false));
433 }
434 else
435 {
436 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
437 "ShortGuardIntervalSupported",
438 BooleanValue(true));
439 }
440
441 // mobility.
443 Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator>();
444
445 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
446 positionAlloc->Add(Vector(distance, 0.0, 0.0));
447 mobility.SetPositionAllocator(positionAlloc);
448
449 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
450
451 mobility.Install(wifiApNode);
452 mobility.Install(wifiStaNode);
453
454 /* Internet stack*/
456 stack.Install(wifiApNode);
457 stack.Install(wifiStaNode);
458
460 address.SetBase("192.168.1.0", "255.255.255.0");
461 Ipv4InterfaceContainer staNodeInterface;
462 Ipv4InterfaceContainer apNodeInterface;
463
464 staNodeInterface = address.Assign(staDevice);
465 apNodeInterface = address.Assign(apDevice);
466
467 /* Setting applications */
468 ApplicationContainer serverApp;
469 if (udp)
470 {
471 // UDP flow
472 uint16_t port = 9;
474 serverApp = server.Install(wifiStaNode.Get(0));
475 serverApp.Start(Seconds(0.0));
476 serverApp.Stop(Seconds(simulationTime + 1));
477 const auto packetInterval = payloadSize * 8.0 / (datarate * 1e6);
478
479 UdpClientHelper client(staNodeInterface.GetAddress(0), port);
480 client.SetAttribute("MaxPackets", UintegerValue(4294967295U));
481 client.SetAttribute("Interval", TimeValue(Seconds(packetInterval)));
482 client.SetAttribute("PacketSize", UintegerValue(payloadSize));
483 ApplicationContainer clientApp = client.Install(wifiApNode.Get(0));
484 clientApp.Start(Seconds(1.0));
485 clientApp.Stop(Seconds(simulationTime + 1));
486 }
487 else
488 {
489 // TCP flow
490 uint16_t port = 50000;
492 PacketSinkHelper packetSinkHelper("ns3::TcpSocketFactory", localAddress);
493 serverApp = packetSinkHelper.Install(wifiStaNode.Get(0));
494 serverApp.Start(Seconds(0.0));
495 serverApp.Stop(Seconds(simulationTime + 1));
496
497 OnOffHelper onoff("ns3::TcpSocketFactory", Ipv4Address::GetAny());
498 onoff.SetAttribute("OnTime", StringValue("ns3::ConstantRandomVariable[Constant=1]"));
499 onoff.SetAttribute("OffTime", StringValue("ns3::ConstantRandomVariable[Constant=0]"));
500 onoff.SetAttribute("PacketSize", UintegerValue(payloadSize));
501 onoff.SetAttribute("DataRate", DataRateValue(datarate * 1e6));
503 onoff.SetAttribute("Remote", remoteAddress);
504 ApplicationContainer clientApp = onoff.Install(wifiApNode.Get(0));
505 clientApp.Start(Seconds(1.0));
506 clientApp.Stop(Seconds(simulationTime + 1));
507 }
508
509 Config::ConnectWithoutContext("/NodeList/0/DeviceList/*/Phy/MonitorSnifferRx",
511
512 if (enablePcap)
513 {
514 phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO);
515 std::stringstream ss;
516 ss << "wifi-spectrum-per-example-" << i;
517 phy.EnablePcap(ss.str(), apDevice);
518 }
519 g_signalDbmAvg = 0;
520 g_noiseDbmAvg = 0;
521 g_samples = 0;
522
523 Simulator::Stop(Seconds(simulationTime + 1));
525
526 double throughput = 0;
527 uint64_t totalPacketsThrough = 0;
528 if (udp)
529 {
530 // UDP
531 totalPacketsThrough = DynamicCast<UdpServer>(serverApp.Get(0))->GetReceived();
532 throughput =
533 totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0); // Mbit/s
534 }
535 else
536 {
537 // TCP
538 uint64_t totalBytesRx = DynamicCast<PacketSink>(serverApp.Get(0))->GetTotalRx();
539 totalPacketsThrough = totalBytesRx / tcpPacketSize;
540 throughput = totalBytesRx * 8 / (simulationTime * 1000000.0); // Mbit/s
541 }
542 std::cout << std::setw(5) << i << std::setw(6) << (i % 8) << std::setprecision(2)
543 << std::fixed << std::setw(10) << datarate << std::setw(12) << throughput
544 << std::setw(8) << totalPacketsThrough;
545 if (totalPacketsThrough > 0)
546 {
547 std::cout << std::setw(12) << g_signalDbmAvg << std::setw(12) << g_noiseDbmAvg
548 << std::setw(12) << (g_signalDbmAvg - g_noiseDbmAvg) << std::endl;
549 }
550 else
551 {
552 std::cout << std::setw(12) << "N/A" << std::setw(12) << "N/A" << std::setw(12) << "N/A"
553 << std::endl;
554 }
556 }
557 return 0;
558}
a polymophic address class
Definition: address.h:101
AttributeValue implementation for Address.
Definition: address.h:286
holds a vector of ns3::Application pointers.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
AttributeValue implementation for Boolean.
Definition: boolean.h:37
Parse command-line arguments.
Definition: command-line.h:232
Class for representing data rates.
Definition: data-rate.h:89
AttributeValue implementation for DataRate.
Definition: data-rate.h:296
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:42
an Inet address class
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
static Ipv4Address GetAny()
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
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.
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
Definition: on-off-helper.h:37
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:142
static void Run()
Run the simulation.
Definition: simulator.cc:178
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:186
Make it easy to create and manage PHY objects for the spectrum model.
void SetChannel(const Ptr< SpectrumChannel > channel)
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
AttributeValue implementation for Ssid.
Definition: ssid.h:96
Hold variables of type string.
Definition: string.h:56
AttributeValue implementation for Time.
Definition: nstime.h:1406
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Create a server application which waits for input UDP packets and uses the information carried into t...
Hold an unsigned integer type.
Definition: uinteger.h:45
helps to create WifiNetDevice objects
Definition: wifi-helper.h:324
create MAC layers for a ns3::WifiNetDevice.
void Set(std::string name, const AttributeValue &v)
Definition: wifi-helper.cc:163
void SetErrorRateModel(std::string type, Args &&... args)
Helper function used to set the error rate model.
Definition: wifi-helper.h:551
@ DLT_IEEE802_11_RADIO
Include Radiotap link layer information.
Definition: wifi-helper.h:178
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
manage and create wifi channel objects for the YANS model.
Make it easy to create and manage PHY objects for the YANS model.
uint16_t port
Definition: dsdv-manet.cc:44
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:894
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
Definition: config.cc:954
void Set(std::string path, const AttributeValue &value)
Definition: config.cc:880
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1319
@ WIFI_STANDARD_80211n
ns address
Definition: first.py:47
ns stack
Definition: first.py:44
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:706
ns cmd
Definition: second.py:40
ns wifi
Definition: third.py:95
ns ssid
Definition: third.py:93
ns mac
Definition: third.py:92
ns wifiApNode
Definition: third.py:86
ns channel
Definition: third.py:88
ns mobility
Definition: third.py:105
ns phy
Definition: third.py:89
MpduInfo structure.
Definition: phy-entity.h:62
SignalNoiseDbm structure.
Definition: phy-entity.h:55
double noise
noise power in dBm
Definition: phy-entity.h:57
double signal
signal strength in dBm
Definition: phy-entity.h:56
std::ofstream throughput
double g_signalDbmAvg
Average signal power [dBm].
double g_noiseDbmAvg
Average noise power [dBm].
uint32_t g_samples
Number of samples.
void MonitorSniffRx(Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise, uint16_t staId)
Monitor sniffer Rx trace.