29 #include "ns3/config.h" 30 #include "ns3/gnuplot.h" 31 #include "ns3/string.h" 32 #include "ns3/double.h" 33 #include "ns3/integer.h" 34 #include "ns3/uinteger.h" 35 #include "ns3/command-line.h" 36 #include "ns3/node-list.h" 37 #include "ns3/yans-wifi-helper.h" 39 #include "ns3/wifi-mac-header.h" 40 #include "ns3/queue-size.h" 41 #include "ns3/propagation-loss-model.h" 42 #include "ns3/propagation-delay-model.h" 43 #include "ns3/rng-seed-manager.h" 44 #include "ns3/mobility-helper.h" 45 #include "ns3/wifi-net-device.h" 46 #include "ns3/packet-socket-helper.h" 47 #include "ns3/packet-socket-client.h" 48 #include "ns3/packet-socket-server.h" 49 #include "ns3/application-container.h" 51 #define PI 3.1415926535 389 std::string sub = context.substr (10);
390 uint32_t pos = sub.find (
"/Device");
391 return atoi (sub.substr (0, pos).c_str ());
398 std::string sub = context.substr (10);
399 uint32_t pos = sub.find (
"/Device");
400 uint32_t nodeId = atoi (sub.substr (0, pos).c_str ());
403 for (uint32_t i = 0; i <
n->GetNDevices (); i++)
419 auto it = counter.find (addr);
420 if (it != counter.end ())
422 it->second += increment;
426 counter.insert (std::make_pair (addr, increment));
463 CwTrace (std::string context, uint32_t oldVal, uint32_t newVal)
556 NS_FATAL_ERROR (
"All devices should send with same power, so no packet switch during preamble detection should occur!");
693 uint32_t trialNumber, uint32_t networkSize,
double duration,
bool pcap,
bool infra);
702 uint32_t trialNumber, uint32_t networkSize,
double duration,
bool pcap,
bool infra)
707 wifiNodes.
Create (networkSize + 1);
711 wifiNodes.
Create (networkSize);
715 phy.SetErrorRateModel (
"ns3::NistErrorRateModel");
722 uint32_t nNodes = wifiNodes.
GetN ();
726 uint64_t beaconInterval = std::min<uint64_t> ((ceil ((duration * 1000000) / 1024) * 1024), (65535 * 1024));
727 mac.SetType (
"ns3::ApWifiMac",
732 mac.SetType (
"ns3::StaWifiMac",
735 for (uint32_t i = 1; i < nNodes; ++i)
742 mac.SetType (
"ns3::AdhocWifiMac");
750 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
752 positionAlloc->
Add (Vector (1.0, 1.0, 0.0));
755 double angle = (
static_cast<double> (360) / (nNodes - 1));
756 for (uint32_t i = 0; i < (nNodes - 1); ++i)
758 positionAlloc->
Add (Vector (1.0 + (0.001 * cos ((i * angle *
PI) / 180)), 1.0 + (0.001 * sin ((i * angle *
PI) / 180)), 0.0));
761 mobility.SetPositionAllocator (positionAlloc);
765 packetSocket.
Install (wifiNodes);
772 uint32_t i = infra ? 1 : 0;
773 for (; i < nNodes; ++i)
775 uint32_t j = infra ? 0 : (i + 1) % nNodes;
838 phy.EnablePcap (
"wifi_bianchi_pcap",
devices);
861 auto it = counter.find (addr);
862 if (it != counter.end ())
869 int main (
int argc,
char *argv[])
871 uint32_t nMinStas = 5;
872 uint32_t nMaxStas = 50;
873 uint32_t nStepSize = 5;
875 double duration = 100;
879 std::string workDir =
"./";
881 std::string standard (
"11a");
882 bool validate =
false;
883 uint32_t plotBianchiModel = 0x1;
884 double maxRelativeError = 0.015;
897 cmd.AddValue (
"verbose",
"Logging level (0: no log - 1: simulation script logs - 2: all logs)",
verbose);
898 cmd.AddValue (
"tracing",
"Generate trace files",
tracing);
899 cmd.AddValue (
"pktSize",
"The packet size in bytes",
pktSize);
900 cmd.AddValue (
"trials",
"The maximal number of runs per network size", trials);
901 cmd.AddValue (
"duration",
"Time duration for each trial in seconds", duration);
902 cmd.AddValue (
"pcap",
"Enable/disable PCAP tracing", pcap);
903 cmd.AddValue (
"infra",
"True to use infrastructure mode, false to use ring adhoc mode", infra);
904 cmd.AddValue (
"workDir",
"The working directory used to store generated files", workDir);
905 cmd.AddValue (
"phyRate",
"Set the constant PHY rate in Mbps used to transmit Data frames", phyRate);
906 cmd.AddValue (
"standard",
"Set the standard (11a, 11b, 11g, 11n, 11ac, 11ax)", standard);
907 cmd.AddValue (
"nMinStas",
"Minimum number of stations to start with", nMinStas);
908 cmd.AddValue (
"nMaxStas",
"Maximum number of stations to start with", nMaxStas);
909 cmd.AddValue (
"nStepSize",
"Number of stations to add at each step", nStepSize);
910 cmd.AddValue (
"validate",
"Enable/disable validation of the ns-3 simulations against the Bianchi model", validate);
911 cmd.AddValue (
"maxRelativeError",
"The maximum relative error tolerated between ns-3 results and the Bianchi model (used for regression, i.e. when the validate flag is set)", maxRelativeError);
912 cmd.Parse (argc, argv);
924 NS_FATAL_ERROR (
"Failed to open file wifi-bianchi-backoff-trace.out");
929 NS_FATAL_ERROR (
"Failed to open file wifi-bianchi-phy-tx-trace.out");
934 NS_FATAL_ERROR (
"Failed to open file wifi-bianchi-mac-tx-trace.out");
939 NS_FATAL_ERROR (
"Failed to open file wifi-bianchi-mac-rx-trace.out");
944 NS_FATAL_ERROR (
"Failed to open file wifi-bianchi-socket-send-trace.out");
957 std::stringstream ss;
958 ss <<
"wifi-"<< standard <<
"-p-" <<
pktSize << (infra ?
"-infrastructure" :
"-adhoc") <<
"-r-" << phyRate <<
"-min-" << nMinStas <<
"-max-" << nMaxStas <<
"-step-" << nStepSize <<
"-throughput.plt";
959 std::ofstream throughputPlot (ss.str ().c_str ());
961 ss <<
"wifi-" << standard <<
"-p-" <<
pktSize << (infra ?
"-infrastructure" :
"-adhoc") <<
"-r-" << phyRate <<
"-min-" << nMinStas <<
"-max-" << nMaxStas <<
"-step-" << nStepSize <<
"-throughput.eps";
965 std::stringstream phyRateStr;
966 if (standard ==
"11a")
969 if ((phyRate != 6) && (phyRate != 9) && (phyRate != 12) && (phyRate != 18) && (phyRate != 24) && (phyRate != 36) && (phyRate != 48) && (phyRate != 54))
971 NS_FATAL_ERROR (
"Selected PHY rate " << phyRate <<
" is not defined in " << standard);
973 phyRateStr <<
"OfdmRate" << phyRate <<
"Mbps";
975 else if (standard ==
"11b")
978 if ((phyRate != 1) && (phyRate != 2) && (phyRate != 5.5) && (phyRate != 11))
980 NS_FATAL_ERROR (
"Selected PHY rate " << phyRate <<
" is not defined in " << standard);
984 phyRateStr <<
"DsssRate5_5Mbps";
988 phyRateStr <<
"DsssRate" << phyRate <<
"Mbps";
991 else if (standard ==
"11g")
994 if ((phyRate != 6) && (phyRate != 9) && (phyRate != 12) && (phyRate != 18) && (phyRate != 24) && (phyRate != 36) && (phyRate != 48) && (phyRate != 54))
996 NS_FATAL_ERROR (
"Selected PHY rate " << phyRate <<
" is not defined in " << standard);
998 phyRateStr <<
"ErpOfdmRate" << phyRate <<
"Mbps";
1014 wifi.SetStandard (wifiStandard);
1015 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
"DataMode",
StringValue (phyRateStr.str()));
1026 double averageThroughput, throughputArray[trials];
1027 for (uint32_t
n = nMinStas;
n <= nMaxStas;
n += nStepSize)
1029 averageThroughput = 0;
1031 for (uint32_t runIndex = 0; runIndex < trials; runIndex++)
1047 std::cout <<
"Trial " << runIndex + 1 <<
" of " << trials <<
"; "<< phyRate <<
" Mbps for " <<
n <<
" nodes " << std::endl;
1050 cwTraceFile <<
"# Trial " << runIndex + 1 <<
" of " << trials <<
"; "<< phyRate <<
" Mbps for " <<
n <<
" nodes" << std::endl;
1051 backoffTraceFile <<
"# Trial " << runIndex + 1 <<
" of " << trials <<
"; "<< phyRate <<
" Mbps for " <<
n <<
" nodes" << std::endl;
1052 phyTxTraceFile <<
"# Trial " << runIndex + 1 <<
" of " << trials <<
"; " << phyRate <<
" Mbps for " <<
n <<
" nodes" << std::endl;
1053 macTxTraceFile <<
"# Trial " << runIndex + 1 <<
" of " << trials <<
"; " << phyRate <<
" Mbps for " <<
n <<
" nodes" << std::endl;
1054 macRxTraceFile <<
"# Trial " << runIndex + 1 <<
" of " << trials <<
"; " << phyRate <<
" Mbps for " <<
n <<
" nodes" << std::endl;
1055 socketSendTraceFile <<
"# Trial " << runIndex + 1 <<
" of " << trials <<
"; " << phyRate <<
" Mbps for " <<
n <<
" nodes" << std::endl;
1057 experiment.Run (
wifi, wifiPhy, wifiMac, wifiChannel, runIndex,
n, duration, pcap, infra);
1067 Time dataTransferDuration = last -
first;
1068 double nodeThroughput = (it->second * 8 /
static_cast<double> (dataTransferDuration.
GetMicroSeconds ()));
1069 throughput += nodeThroughput;
1079 uint64_t nodeRxEvents =
1080 nodePhyHeaderFailures + nodePsduFailures + nodePsduSuccess + nodeRxEventWhileDecodingPreamble +
1081 nodeRxEventWhileRxing + nodeRxEventWhileTxing + nodeRxEventAbortedByTx;
1082 std::cout <<
"Node " << it->first
1083 <<
": TX packets " << nodeTxPackets
1084 <<
"; RX packets " << nodeRxPackets
1085 <<
"; PHY header failures " << nodePhyHeaderFailures
1086 <<
"; PSDU failures " << nodePsduFailures
1087 <<
"; PSDU success " << nodePsduSuccess
1088 <<
"; RX events while decoding preamble " << nodeRxEventWhileDecodingPreamble
1089 <<
"; RX events while RXing " << nodeRxEventWhileRxing
1090 <<
"; RX events while TXing " << nodeRxEventWhileTxing
1091 <<
"; RX events aborted by TX " << nodeRxEventAbortedByTx
1092 <<
"; total RX events " << nodeRxEvents
1093 <<
"; total events " << nodeTxPackets + nodeRxEvents
1094 <<
"; time first RX " <<
first 1095 <<
"; time last RX " << last
1096 <<
"; dataTransferDuration " << dataTransferDuration
1097 <<
"; throughput " << nodeThroughput <<
" Mbps" << std::endl;
1099 std::cout <<
"Total throughput: " << throughput <<
" Mbps" << std::endl;
1100 averageThroughput += throughput;
1101 throughputArray[runIndex] = throughput;
1103 averageThroughput = averageThroughput / trials;
1105 bool rateFound =
false;
1106 double relativeErrorDifs = 0;
1107 double relativeErrorEifs = 0;
1108 auto itDifs =
bianchiResultsDifs.find (static_cast<unsigned int> (phyRate * 1000000));
1112 auto it = itDifs->second.find (
n);
1113 if (it != itDifs->second.end ())
1115 relativeErrorDifs = (std::abs (averageThroughput - it->second) / it->second);
1116 std::cout <<
"Relative error (DIFS): " << 100 * relativeErrorDifs <<
"%" << std::endl;
1120 NS_FATAL_ERROR (
"No Bianchi results (DIFS) calculated for that number of stations!");
1123 auto itEifs =
bianchiResultsEifs.find (static_cast<unsigned int> (phyRate * 1000000));
1127 auto it = itEifs->second.find (
n);
1128 if (it != itEifs->second.end ())
1130 relativeErrorEifs = (std::abs (averageThroughput - it->second) / it->second);
1131 std::cout <<
"Relative error (EIFS): " << 100 * relativeErrorEifs <<
"%" << std::endl;
1135 NS_FATAL_ERROR (
"No Bianchi results (EIFS) calculated for that number of stations!");
1138 if (!rateFound && validate)
1142 double relativeError =
std::min (relativeErrorDifs, relativeErrorEifs);
1143 if (validate && (relativeError > maxRelativeError))
1149 for (uint32_t i = 0; i < trials; ++i)
1151 stDev += pow (throughputArray[i] - averageThroughput, 2);
1153 stDev = sqrt (stDev / (trials - 1));
1154 dataset.
Add (
n, averageThroughput, stDev);
1158 auto itDifs =
bianchiResultsDifs.find (static_cast<unsigned int> (phyRate * 1000000));
1161 for (uint32_t i = nMinStas; i <= nMaxStas; i += nStepSize)
1164 auto it = itDifs->second.find (i);
1165 if (it != itDifs->second.end ())
1169 datasetBianchiDifs.
Add (i, value);
1174 for (uint32_t i = nMinStas; i <= nMaxStas; i += nStepSize)
1176 datasetBianchiDifs.
Add (i, 0.0);
1180 auto itEifs =
bianchiResultsEifs.find (static_cast<unsigned int> (phyRate * 1000000));
1183 for (uint32_t i = nMinStas; i <= nMaxStas; i += nStepSize)
1186 auto it = itEifs->second.find (i);
1187 if (it != itEifs->second.end ())
1191 datasetBianchiEifs.
Add (i, value);
1196 for (uint32_t i = nMinStas; i <= nMaxStas; i += nStepSize)
1198 datasetBianchiEifs.
Add (i, 0.0);
1202 datasetBianchiEifs.
SetTitle (
"Bianchi (EIFS - lower bound)");
1203 datasetBianchiDifs.
SetTitle (
"Bianchi (DIFS - upper bound)");
1204 gnuplot.AddDataset (dataset);
1205 gnuplot.SetTerminal (
"postscript eps color enh \"Times-BoldItalic\"");
1206 gnuplot.SetLegend (
"Number of competing stations",
"Throughput (Mbps)");
1208 ss <<
"Frame size " <<
pktSize <<
" bytes";
1209 gnuplot.SetTitle (ss.str ());
1211 ss <<
"set xrange [" << nMinStas <<
":" << nMaxStas <<
"]\n" 1212 <<
"set xtics " << nStepSize <<
"\n" 1213 <<
"set grid xtics ytics\n" 1215 <<
"set style line 1 linewidth 5\n" 1216 <<
"set style line 2 linewidth 5\n" 1217 <<
"set style line 3 linewidth 5\n" 1218 <<
"set style line 4 linewidth 5\n" 1219 <<
"set style line 5 linewidth 5\n" 1220 <<
"set style line 6 linewidth 5\n" 1221 <<
"set style line 7 linewidth 5\n" 1222 <<
"set style line 8 linewidth 5\n" 1223 <<
"set style increment user";
1224 gnuplot.SetExtra (ss.str ());
1225 if (plotBianchiModel & 0x01)
1227 datasetBianchiDifs.
SetTitle (
"Bianchi");
1228 gnuplot.AddDataset (datasetBianchiDifs);
1230 if (plotBianchiModel & 0x02)
1232 datasetBianchiEifs.
SetTitle (
"Bianchi");
1233 gnuplot.AddDataset (datasetBianchiEifs);
1235 if (plotBianchiModel == 0x03)
1237 datasetBianchiEifs.
SetTitle (
"Bianchi (EIFS - lower bound)");
1238 datasetBianchiDifs.
SetTitle (
"Bianchi (DIFS - upper bound)");
1240 gnuplot.GenerateOutput (throughputPlot);
1241 throughputPlot.close ();
void AddPropagationLoss(std::string name, 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())
Helper class for UAN CW MAC example.
holds a vector of ns3::Application pointers.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Simulation virtual time values and global simulation resolution.
void MacTxTrace(std::string context, Ptr< const Packet > p)
std::map< unsigned int, std::map< unsigned int, double > > bianchiResultsEifs
Class for representing queue sizes.
void SetLocal(PacketSocketAddress addr)
set the local address and protocol to be used
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void IncrementCounter(std::map< Mac48Address, uint64_t > &counter, Mac48Address addr, uint64_t increment=1)
Class to represent a 2D points plot.
std::map< Mac48Address, Time > timeFirstReceived
Map that stores the time at which the first packet was received per STA (and the packet is addressed ...
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void SetTitle(const std::string &title)
Change line title.
Hold variables of type string.
static Ptr< Node > GetNode(uint32_t n)
Make it easy to create and manage PHY objects for the YANS model.
std::map< unsigned int, std::map< unsigned int, double > > bianchiResultsDifs
std::map< Mac48Address, uint64_t > bytesReceived
Map that stores the total bytes received per STA (and addressed to that STA)
void DisassociationLog(std::string context, Mac48Address address)
std::ofstream macTxTraceFile
File that traces MAC transmissions over time.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
an address for a packet socket
static void Run(void)
Run the simulation.
Hold a signed integer type.
void PhyRxOkTrace(std::string context, Ptr< const Packet > p, double snr, WifiMode mode, WifiPreamble preamble)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
std::map< Mac48Address, Time > timeLastTransmitted
Map that stores the time at which the last packet was transmitted per STA.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Mac48Address ContextToMac(std::string context)
void AssociationLog(std::string context, Mac48Address address)
void PhyTxDoneTrace(std::string context, Ptr< const Packet > p)
void BackoffTrace(std::string context, uint32_t newVal)
helps to create WifiNetDevice objects
void TracePacketReception(std::string context, Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise, uint16_t staId)
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
uint32_t ContextToNodeId(std::string context)
Give ns3::PacketSocket powers to ns3::Node.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Address GetAddress(void) const
a polymophic address class
Ptr< YansWifiChannel > Create(void) const
std::map< Mac48Address, uint64_t > phyHeaderFailed
Map that stores the total number of unsuccessfully received PHY headers per STA.
void SetErrorBars(enum ErrorBars errorBars)
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
std::map< Mac48Address, uint64_t > rxEventWhileTxing
Map that stores the number of reception events per STA that occured while PHY was already transmittin...
std::map< Mac48Address, uint64_t > psduFailed
Map that stores the total number of unsuccessfully received PSDUS (for which the PHY header was succe...
void PhyRxDropTrace(std::string context, Ptr< const Packet > p, WifiPhyRxfailureReason reason)
std::map< Mac48Address, uint64_t > rxEventAbortedByTx
Map that stores the number of reception events aborted per STA because the PHY has started to transmi...
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
uint64_t GetCount(const std::map< Mac48Address, uint64_t > &counter, Mac48Address addr)
a simple class to generate gnuplot-ready plotting commands from a set of datasets.
std::ofstream socketSendTraceFile
File that traces packets transmitted by the application over time.
AttributeValue implementation for Time.
void MacRxTrace(std::string context, Ptr< const Packet > p)
Hold an unsigned integer type.
Use number of packets for queue size.
holds a vector of ns3::NetDevice pointers
std::map< Mac48Address, uint64_t > packetsReceived
Map that stores the total packets received per STA (and addressed to that STA)
void PhyTxTrace(std::string context, Ptr< const Packet > p, double txPowerW)
Hold together all Wifi-related objects.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
std::map< Mac48Address, uint64_t > packetsTransmitted
Map that stores the total packets transmitted per STA.
void Add(double x, double y)
void SocketSendTrace(std::string context, Ptr< const Packet > p, const Address &addr)
Parse command-line arguments.
void Connect(std::string path, const CallbackBase &cb)
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
static Mac48Address ConvertFrom(const Address &address)
uint32_t GetN(void) const
Get the number of Ptr<Node> stored in this container.
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
std::map< Mac48Address, uint64_t > psduSucceeded
Map that stores the total number of successfully received PSDUs per STA (including PSDUs not addresse...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetPhysicalAddress(const Address address)
Set the destination address.
WifiStandard
Identifies the allowed configurations that a Wifi device is configured to use.
keep track of a set of node pointers.
void CwTrace(std::string context, uint32_t oldVal, uint32_t newVal)
manage and create wifi channel objects for the YANS model.
std::ofstream macRxTraceFile
File that traces MAC receptions over time.
void PhyRxDoneTrace(std::string context, Ptr< const Packet > p)
create MAC layers for a ns3::WifiNetDevice.
void SetStyle(enum Style style)
static Time Now(void)
Return the current simulation virtual time.
void PhyRxTrace(std::string context, Ptr< const Packet > p, RxPowerWattPerChannelBand power)
void PhyRxPayloadTrace(std::string context, WifiTxVector txVector, Time psduDuration)
std::ofstream backoffTraceFile
File that traces backoff over time.
The IEEE 802.11 SSID Information Element.
std::ofstream cwTraceFile
File that traces CW over time.
Gnuplot2dDataset Run(const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
void PhyRxErrorTrace(std::string context, Ptr< const Packet > p, double snr)
Helper class used to assign positions and mobility models to nodes.
std::set< uint32_t > associated
Contains the IDs of the STAs that successfully associated to the access point (in infrastructure mode...
static void EnableLogComponents(void)
Helper to enable all WifiNetDevice log components with one statement.
void experiment(std::string queue_disc_type)
std::map< Mac48Address, uint64_t > rxEventWhileRxing
Map that stores the number of reception events per STA that occured while PHY was already receiving a...
void SetRemote(PacketSocketAddress addr)
set the remote address and protocol to be used
std::map< Mac48Address, Time > timeLastReceived
Map that stores the time at which the last packet was received per STA (and the packet is addressed t...
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
SignalNoiseDbm structure.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
AttributeValue implementation for Ssid.
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
void SetDefault(std::string name, const AttributeValue &value)
void SetProtocol(uint16_t protocol)
Set the protocol.
void Add(Vector v)
Add a position to the list of positions.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
std::ofstream phyTxTraceFile
File that traces PHY transmissions over time.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
std::map< Mac48Address, uint64_t > rxEventWhileDecodingPreamble
Map that stores the number of reception events per STA that occured while PHY was already decoding a ...
void SetPropagationDelay(std::string name, 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())
void DisablePreambleDetectionModel()
Disable the preamble detection model.
uint32_t pktSize
packet size used for the simulation (in bytes)
This class can be used to hold variables of floating point type such as 'double' or 'float'...
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Include Radiotap link layer information.
void SetStartTime(Time start)
Specify application start time.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
bool tracing
Flag to enable/disable generation of tracing files.
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
std::map< Mac48Address, Time > timeFirstTransmitted
Map that stores the time at which the first packet was transmitted per STA.