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/uinteger.h"
44#include "ns3/yans-wifi-channel.h"
45#include "ns3/yans-wifi-helper.h"
46
47#include <iomanip>
48
49// This is a simple example of an IEEE 802.11n Wi-Fi network.
50//
51// The main use case is to enable and test SpectrumWifiPhy vs YansWifiPhy
52// for packet error ratio
53//
54// Network topology:
55//
56// Wi-Fi 192.168.1.0
57//
58// STA AP
59// * <-- distance --> *
60// | |
61// n1 n2
62//
63// Users may vary the following command-line arguments in addition to the
64// attributes, global values, and default values typically available:
65//
66// --simulationTime: Simulation time in seconds [10]
67// --udp: UDP if set to 1, TCP otherwise [true]
68// --distance: meters separation between nodes [50]
69// --index: restrict index to single value between 0 and 31 [256]
70// --wifiType: select ns3::SpectrumWifiPhy or ns3::YansWifiPhy [ns3::SpectrumWifiPhy]
71// --errorModelType: select ns3::NistErrorRateModel or ns3::YansErrorRateModel
72// [ns3::NistErrorRateModel]
73// --enablePcap: enable pcap output [false]
74//
75// By default, the program will step through 32 index values, corresponding
76// to the following MCS, channel width, and guard interval combinations:
77// index 0-7: MCS 0-7, long guard interval, 20 MHz channel
78// index 8-15: MCS 0-7, short guard interval, 20 MHz channel
79// index 16-23: MCS 0-7, long guard interval, 40 MHz channel
80// index 24-31: MCS 0-7, short guard interval, 40 MHz channel
81// and send UDP for 10 seconds using each MCS, using the SpectrumWifiPhy and the
82// NistErrorRateModel, at a distance of 50 meters. The program outputs
83// results such as:
84//
85// wifiType: ns3::SpectrumWifiPhy distance: 50m; time: 10; TxPower: 1 dBm (1.3 mW)
86// index MCS Rate (Mb/s) Tput (Mb/s) Received Signal (dBm) Noise (dBm) SNR (dB)
87// 0 0 6.50 5.77 7414 -79.71 -93.97 14.25
88// 1 1 13.00 11.58 14892 -79.71 -93.97 14.25
89// 2 2 19.50 17.39 22358 -79.71 -93.97 14.25
90// 3 3 26.00 22.96 29521 -79.71 -93.97 14.25
91// ...
92//
93
94using namespace ns3;
95
96// Global variables for use in callbacks.
100
111void
113 uint16_t channelFreqMhz,
114 WifiTxVector txVector,
115 MpduInfo aMpdu,
116 SignalNoiseDbm signalNoise,
117 uint16_t staId)
118
119{
120 g_samples++;
121 g_signalDbmAvg += ((signalNoise.signal - g_signalDbmAvg) / g_samples);
122 g_noiseDbmAvg += ((signalNoise.noise - g_noiseDbmAvg) / g_samples);
123}
124
125NS_LOG_COMPONENT_DEFINE("WifiSpectrumPerExample");
126
127int
128main(int argc, char* argv[])
129{
130 bool udp = true;
131 double distance = 50;
132 double simulationTime = 10; // seconds
133 uint16_t index = 256;
134 std::string wifiType = "ns3::SpectrumWifiPhy";
135 std::string errorModelType = "ns3::NistErrorRateModel";
136 bool enablePcap = false;
137 const uint32_t tcpPacketSize = 1448;
138
139 CommandLine cmd(__FILE__);
140 cmd.AddValue("simulationTime", "Simulation time in seconds", simulationTime);
141 cmd.AddValue("udp", "UDP if set to 1, TCP otherwise", udp);
142 cmd.AddValue("distance", "meters separation between nodes", distance);
143 cmd.AddValue("index", "restrict index to single value between 0 and 31", index);
144 cmd.AddValue("wifiType", "select ns3::SpectrumWifiPhy or ns3::YansWifiPhy", wifiType);
145 cmd.AddValue("errorModelType",
146 "select ns3::NistErrorRateModel or ns3::YansErrorRateModel",
147 errorModelType);
148 cmd.AddValue("enablePcap", "enable pcap output", enablePcap);
149 cmd.Parse(argc, argv);
150
151 uint16_t startIndex = 0;
152 uint16_t stopIndex = 31;
153 if (index < 32)
154 {
155 startIndex = index;
156 stopIndex = index;
157 }
158
159 std::cout << "wifiType: " << wifiType << " distance: " << distance
160 << "m; time: " << simulationTime << "; TxPower: 1 dBm (1.3 mW)" << std::endl;
161 std::cout << std::setw(5) << "index" << std::setw(6) << "MCS" << std::setw(13) << "Rate (Mb/s)"
162 << std::setw(12) << "Tput (Mb/s)" << std::setw(10) << "Received " << std::setw(12)
163 << "Signal (dBm)" << std::setw(12) << "Noise (dBm)" << std::setw(9) << "SNR (dB)"
164 << std::endl;
165 for (uint16_t i = startIndex; i <= stopIndex; i++)
166 {
167 uint32_t payloadSize;
168 if (udp)
169 {
170 payloadSize = 972; // 1000 bytes IPv4
171 }
172 else
173 {
174 payloadSize = 1448; // 1500 bytes IPv6
175 Config::SetDefault("ns3::TcpSocket::SegmentSize", UintegerValue(payloadSize));
176 }
177
178 NodeContainer wifiStaNode;
179 wifiStaNode.Create(1);
181 wifiApNode.Create(1);
182
184 SpectrumWifiPhyHelper spectrumPhy;
185 if (wifiType == "ns3::YansWifiPhy")
186 {
188 channel.AddPropagationLoss("ns3::FriisPropagationLossModel",
189 "Frequency",
190 DoubleValue(5.180e9));
191 channel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");
192 phy.SetChannel(channel.Create());
193 phy.Set("TxPowerStart", DoubleValue(1)); // dBm (1.26 mW)
194 phy.Set("TxPowerEnd", DoubleValue(1));
195 }
196 else if (wifiType == "ns3::SpectrumWifiPhy")
197 {
198 Ptr<MultiModelSpectrumChannel> spectrumChannel =
199 CreateObject<MultiModelSpectrumChannel>();
200 Ptr<FriisPropagationLossModel> lossModel = CreateObject<FriisPropagationLossModel>();
201 lossModel->SetFrequency(5.180e9);
202 spectrumChannel->AddPropagationLossModel(lossModel);
203
205 CreateObject<ConstantSpeedPropagationDelayModel>();
206 spectrumChannel->SetPropagationDelayModel(delayModel);
207
208 spectrumPhy.SetChannel(spectrumChannel);
209 spectrumPhy.SetErrorRateModel(errorModelType);
210 spectrumPhy.Set("TxPowerStart", DoubleValue(1)); // dBm (1.26 mW)
211 spectrumPhy.Set("TxPowerEnd", DoubleValue(1));
212 }
213 else
214 {
215 NS_FATAL_ERROR("Unsupported WiFi type " << wifiType);
216 }
217
219 wifi.SetStandard(WIFI_STANDARD_80211n);
221
222 Ssid ssid = Ssid("ns380211n");
223
224 double datarate = 0;
226 if (i == 0)
227 {
228 DataRate = StringValue("HtMcs0");
229 datarate = 6.5;
230 }
231 else if (i == 1)
232 {
233 DataRate = StringValue("HtMcs1");
234 datarate = 13;
235 }
236 else if (i == 2)
237 {
238 DataRate = StringValue("HtMcs2");
239 datarate = 19.5;
240 }
241 else if (i == 3)
242 {
243 DataRate = StringValue("HtMcs3");
244 datarate = 26;
245 }
246 else if (i == 4)
247 {
248 DataRate = StringValue("HtMcs4");
249 datarate = 39;
250 }
251 else if (i == 5)
252 {
253 DataRate = StringValue("HtMcs5");
254 datarate = 52;
255 }
256 else if (i == 6)
257 {
258 DataRate = StringValue("HtMcs6");
259 datarate = 58.5;
260 }
261 else if (i == 7)
262 {
263 DataRate = StringValue("HtMcs7");
264 datarate = 65;
265 }
266 else if (i == 8)
267 {
268 DataRate = StringValue("HtMcs0");
269 datarate = 7.2;
270 }
271 else if (i == 9)
272 {
273 DataRate = StringValue("HtMcs1");
274 datarate = 14.4;
275 }
276 else if (i == 10)
277 {
278 DataRate = StringValue("HtMcs2");
279 datarate = 21.7;
280 }
281 else if (i == 11)
282 {
283 DataRate = StringValue("HtMcs3");
284 datarate = 28.9;
285 }
286 else if (i == 12)
287 {
288 DataRate = StringValue("HtMcs4");
289 datarate = 43.3;
290 }
291 else if (i == 13)
292 {
293 DataRate = StringValue("HtMcs5");
294 datarate = 57.8;
295 }
296 else if (i == 14)
297 {
298 DataRate = StringValue("HtMcs6");
299 datarate = 65;
300 }
301 else if (i == 15)
302 {
303 DataRate = StringValue("HtMcs7");
304 datarate = 72.2;
305 }
306 else if (i == 16)
307 {
308 DataRate = StringValue("HtMcs0");
309 datarate = 13.5;
310 }
311 else if (i == 17)
312 {
313 DataRate = StringValue("HtMcs1");
314 datarate = 27;
315 }
316 else if (i == 18)
317 {
318 DataRate = StringValue("HtMcs2");
319 datarate = 40.5;
320 }
321 else if (i == 19)
322 {
323 DataRate = StringValue("HtMcs3");
324 datarate = 54;
325 }
326 else if (i == 20)
327 {
328 DataRate = StringValue("HtMcs4");
329 datarate = 81;
330 }
331 else if (i == 21)
332 {
333 DataRate = StringValue("HtMcs5");
334 datarate = 108;
335 }
336 else if (i == 22)
337 {
338 DataRate = StringValue("HtMcs6");
339 datarate = 121.5;
340 }
341 else if (i == 23)
342 {
343 DataRate = StringValue("HtMcs7");
344 datarate = 135;
345 }
346 else if (i == 24)
347 {
348 DataRate = StringValue("HtMcs0");
349 datarate = 15;
350 }
351 else if (i == 25)
352 {
353 DataRate = StringValue("HtMcs1");
354 datarate = 30;
355 }
356 else if (i == 26)
357 {
358 DataRate = StringValue("HtMcs2");
359 datarate = 45;
360 }
361 else if (i == 27)
362 {
363 DataRate = StringValue("HtMcs3");
364 datarate = 60;
365 }
366 else if (i == 28)
367 {
368 DataRate = StringValue("HtMcs4");
369 datarate = 90;
370 }
371 else if (i == 29)
372 {
373 DataRate = StringValue("HtMcs5");
374 datarate = 120;
375 }
376 else if (i == 30)
377 {
378 DataRate = StringValue("HtMcs6");
379 datarate = 135;
380 }
381 else
382 {
383 DataRate = StringValue("HtMcs7");
384 datarate = 150;
385 }
386
387 wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager",
388 "DataMode",
389 DataRate,
390 "ControlMode",
391 DataRate);
392
393 NetDeviceContainer staDevice;
394 NetDeviceContainer apDevice;
395
396 if (wifiType == "ns3::YansWifiPhy")
397 {
398 mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
399 phy.Set("ChannelSettings",
400 StringValue(std::string("{0, ") + (i <= 15 ? "20" : "40") + ", BAND_5GHZ, 0}"));
401 staDevice = wifi.Install(phy, mac, wifiStaNode);
402 mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid));
403 apDevice = wifi.Install(phy, mac, wifiApNode);
404 }
405 else if (wifiType == "ns3::SpectrumWifiPhy")
406 {
407 mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
408 phy.Set("ChannelSettings",
409 StringValue(std::string("{0, ") + (i <= 15 ? "20" : "40") + ", BAND_5GHZ, 0}"));
410 staDevice = wifi.Install(spectrumPhy, mac, wifiStaNode);
411 mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid));
412 apDevice = wifi.Install(spectrumPhy, mac, wifiApNode);
413 }
414
415 if (i <= 7)
416 {
417 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
418 "ShortGuardIntervalSupported",
419 BooleanValue(false));
420 }
421 else if (i > 7 && i <= 15)
422 {
423 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
424 "ShortGuardIntervalSupported",
425 BooleanValue(true));
426 }
427 else if (i > 15 && i <= 23)
428 {
429 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
430 "ShortGuardIntervalSupported",
431 BooleanValue(false));
432 }
433 else
434 {
435 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
436 "ShortGuardIntervalSupported",
437 BooleanValue(true));
438 }
439
440 // mobility.
442 Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator>();
443
444 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
445 positionAlloc->Add(Vector(distance, 0.0, 0.0));
446 mobility.SetPositionAllocator(positionAlloc);
447
448 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
449
450 mobility.Install(wifiApNode);
451 mobility.Install(wifiStaNode);
452
453 /* Internet stack*/
455 stack.Install(wifiApNode);
456 stack.Install(wifiStaNode);
457
459 address.SetBase("192.168.1.0", "255.255.255.0");
460 Ipv4InterfaceContainer staNodeInterface;
461 Ipv4InterfaceContainer apNodeInterface;
462
463 staNodeInterface = address.Assign(staDevice);
464 apNodeInterface = address.Assign(apDevice);
465
466 /* Setting applications */
467 ApplicationContainer serverApp;
468 if (udp)
469 {
470 // UDP flow
471 uint16_t port = 9;
473 serverApp = server.Install(wifiStaNode.Get(0));
474 serverApp.Start(Seconds(0.0));
475 serverApp.Stop(Seconds(simulationTime + 1));
476
477 UdpClientHelper client(staNodeInterface.GetAddress(0), port);
478 client.SetAttribute("MaxPackets", UintegerValue(4294967295U));
479 client.SetAttribute("Interval", TimeValue(Time("0.0001"))); // packets/s
480 client.SetAttribute("PacketSize", UintegerValue(payloadSize));
481 ApplicationContainer clientApp = client.Install(wifiApNode.Get(0));
482 clientApp.Start(Seconds(1.0));
483 clientApp.Stop(Seconds(simulationTime + 1));
484 }
485 else
486 {
487 // TCP flow
488 uint16_t port = 50000;
490 PacketSinkHelper packetSinkHelper("ns3::TcpSocketFactory", localAddress);
491 serverApp = packetSinkHelper.Install(wifiStaNode.Get(0));
492 serverApp.Start(Seconds(0.0));
493 serverApp.Stop(Seconds(simulationTime + 1));
494
495 OnOffHelper onoff("ns3::TcpSocketFactory", Ipv4Address::GetAny());
496 onoff.SetAttribute("OnTime", StringValue("ns3::ConstantRandomVariable[Constant=1]"));
497 onoff.SetAttribute("OffTime", StringValue("ns3::ConstantRandomVariable[Constant=0]"));
498 onoff.SetAttribute("PacketSize", UintegerValue(payloadSize));
499 onoff.SetAttribute("DataRate", DataRateValue(1000000000)); // bit/s
501 onoff.SetAttribute("Remote", remoteAddress);
502 ApplicationContainer clientApp = onoff.Install(wifiApNode.Get(0));
503 clientApp.Start(Seconds(1.0));
504 clientApp.Stop(Seconds(simulationTime + 1));
505 }
506
507 Config::ConnectWithoutContext("/NodeList/0/DeviceList/*/Phy/MonitorSnifferRx",
509
510 if (enablePcap)
511 {
512 phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO);
513 std::stringstream ss;
514 ss << "wifi-spectrum-per-example-" << i;
515 phy.EnablePcap(ss.str(), apDevice);
516 }
517 g_signalDbmAvg = 0;
518 g_noiseDbmAvg = 0;
519 g_samples = 0;
520
521 Simulator::Stop(Seconds(simulationTime + 1));
523
524 double throughput = 0;
525 uint64_t totalPacketsThrough = 0;
526 if (udp)
527 {
528 // UDP
529 totalPacketsThrough = DynamicCast<UdpServer>(serverApp.Get(0))->GetReceived();
530 throughput =
531 totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0); // Mbit/s
532 }
533 else
534 {
535 // TCP
536 uint64_t totalBytesRx = DynamicCast<PacketSink>(serverApp.Get(0))->GetTotalRx();
537 totalPacketsThrough = totalBytesRx / tcpPacketSize;
538 throughput = totalBytesRx * 8 / (simulationTime * 1000000.0); // Mbit/s
539 }
540 std::cout << std::setw(5) << i << std::setw(6) << (i % 8) << std::setprecision(2)
541 << std::fixed << std::setw(10) << datarate << std::setw(12) << throughput
542 << std::setw(8) << totalPacketsThrough;
543 if (totalPacketsThrough > 0)
544 {
545 std::cout << std::setw(12) << g_signalDbmAvg << std::setw(12) << g_noiseDbmAvg
546 << std::setw(12) << (g_signalDbmAvg - g_noiseDbmAvg) << std::endl;
547 }
548 else
549 {
550 std::cout << std::setw(12) << "N/A" << std::setw(12) << "N/A" << std::setw(12) << "N/A"
551 << std::endl;
552 }
554 }
555 return 0;
556}
a polymophic address class
Definition: address.h:100
AttributeValue implementation for Address.
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.
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:44
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:78
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:140
static void Run()
Run the simulation.
Definition: simulator.cc:176
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:184
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.
Hold variables of type string.
Definition: string.h:56
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
AttributeValue implementation for Time.
Definition: nstime.h:1423
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:550
@ 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:891
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
Definition: config.cc:951
void Set(std::string path, const AttributeValue &value)
Definition: config.cc:877
#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:1336
@ WIFI_STANDARD_80211n
ns address
Definition: first.py:40
ns stack
Definition: first.py:37
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:702
ns cmd
Definition: second.py:33
ns wifi
Definition: third.py:88
ns ssid
Definition: third.py:86
ns mac
Definition: third.py:85
ns wifiApNode
Definition: third.py:79
ns channel
Definition: third.py:81
ns mobility
Definition: third.py:96
ns phy
Definition: third.py:82
MpduInfo structure.
Definition: phy-entity.h:63
SignalNoiseDbm structure.
Definition: phy-entity.h:56
double noise
noise power in dBm
Definition: phy-entity.h:58
double signal
signal strength in dBm
Definition: phy-entity.h:57
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.