A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-manager-example.cc File Reference
#include "ns3/boolean.h"
#include "ns3/command-line.h"
#include "ns3/config.h"
#include "ns3/double.h"
#include "ns3/enum.h"
#include "ns3/gnuplot.h"
#include "ns3/he-configuration.h"
#include "ns3/ht-configuration.h"
#include "ns3/log.h"
#include "ns3/mobility-helper.h"
#include "ns3/packet-socket-client.h"
#include "ns3/packet-socket-helper.h"
#include "ns3/packet-socket-server.h"
#include "ns3/propagation-delay-model.h"
#include "ns3/propagation-loss-model.h"
#include "ns3/rng-seed-manager.h"
#include "ns3/ssid.h"
#include "ns3/tuple.h"
#include "ns3/uinteger.h"
#include "ns3/wifi-net-device.h"
#include "ns3/yans-wifi-helper.h"
+ Include dependency graph for wifi-manager-example.cc:

Go to the source code of this file.

Classes

struct  StandardInfo
 StandardInfo structure. More...
 
struct  Step
 Step structure. More...
 

Functions

void ChangeSignalAndReportRate (Ptr< FixedRssLossModel > rssModel, Step step, double rss, Gnuplot2dDataset &rateDataset, Gnuplot2dDataset &actualDataset)
 Change the signal model and report the rate.
 
void PacketRx (Ptr< const Packet > pkt, const Address &addr)
 Packet received.
 
void RateChange (uint64_t oldVal, uint64_t newVal)
 Rate changed.
 

Variables

double g_intervalBytes = 0
 Bytes received in an interval.
 
uint64_t g_intervalRate = 0
 Rate in an interval.
 
const double NOISE_DBM_Hz = -174.0
 Default value for noise.
 
double noiseDbm = NOISE_DBM_Hz
 Value for noise.
 

Detailed Description

Usage

$ ./ns3 run "wifi-manager-example [Program Options]"

Program Options

--maxSsrc
The maximum number of retransmission attempts for a RTS packet [7]
--maxSlrc
The maximum number of retransmission attempts for a Data packet [7]
--rtsThreshold
RTS threshold [999999]
--maxAmpduSize
Max A-MPDU size [65535]
--stepSize
Power between steps (dBm) [1]
--stepTime
Time on each step (seconds) [1]
--broadcast
Send broadcast instead of unicast [false]
--serverChannelWidth
Set channel width of the server (valid only for 802.11n or ac) [0]
--clientChannelWidth
Set channel width of the client (valid only for 802.11n or ac) [0]
--serverNss
Set nss of the server (valid only for 802.11n or ac) [1]
--clientNss
Set nss of the client (valid only for 802.11n or ac) [1]
--serverShortGuardInterval
Set short guard interval of the server (802.11n/ac/ax) in nanoseconds [800]
--clientShortGuardInterval
Set short guard interval of the client (802.11n/ac/ax) in nanoseconds [800]
--standard
Set standard (802.11a, 802.11b, 802.11g, 802.11p-10MHz, 802.11p-5MHz, 802.11n-5GHz, 802.11n-2.4GHz, 802.11ac, 802.11ax-6GHz, 802.11ax-5GHz, 802.11ax-2.4GHz) [802.11a]
--wifiManager
Set wifi rate manager (Aarf, Aarfcd, Amrr, Arf, Cara, Ideal, Minstrel, MinstrelHt, Onoe, Rraa, ThompsonSampling) [Ideal]
--infrastructure
Use infrastructure instead of adhoc [false]

Definition in file wifi-manager-example.cc.

Function Documentation

◆ ChangeSignalAndReportRate()

void ChangeSignalAndReportRate ( Ptr< FixedRssLossModel rssModel,
Step  step,
double  rss,
Gnuplot2dDataset rateDataset,
Gnuplot2dDataset actualDataset 
)

Change the signal model and report the rate.

Parameters
rssModelThe new RSS model.
stepThe step tp use.
rssThe RSS.
rateDatasetThe rate dataset.
actualDatasetThe actual dataset.

Definition at line 177 of file wifi-manager-example.cc.

References ns3::Gnuplot2dDataset::Add(), ChangeSignalAndReportRate(), g_intervalBytes, g_intervalRate, noiseDbm, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Time::S, ns3::Simulator::Schedule(), ns3::Seconds(), Step::stepSize, and Step::stepTime.

Referenced by ChangeSignalAndReportRate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PacketRx()

void PacketRx ( Ptr< const Packet pkt,
const Address addr 
)

Packet received.

Parameters
pktThe packet.
addrThe sender address.

Definition at line 89 of file wifi-manager-example.cc.

References g_intervalBytes.

◆ RateChange()

void RateChange ( uint64_t  oldVal,
uint64_t  newVal 
)

Rate changed.

Parameters
oldValOld value.
newValNew value.

Definition at line 101 of file wifi-manager-example.cc.

References g_intervalRate, and NS_LOG_DEBUG.

Variable Documentation

◆ g_intervalBytes

double g_intervalBytes = 0

Bytes received in an interval.

Definition at line 79 of file wifi-manager-example.cc.

Referenced by ChangeSignalAndReportRate(), and PacketRx().

◆ g_intervalRate

uint64_t g_intervalRate = 0

Rate in an interval.

Definition at line 80 of file wifi-manager-example.cc.

Referenced by ChangeSignalAndReportRate(), and RateChange().

◆ NOISE_DBM_Hz

const double NOISE_DBM_Hz = -174.0

Default value for noise.

Definition at line 76 of file wifi-manager-example.cc.

◆ noiseDbm

double noiseDbm = NOISE_DBM_Hz

Value for noise.

Definition at line 77 of file wifi-manager-example.cc.

Referenced by ChangeSignalAndReportRate().