A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-multicast.cc File Reference
#include "ns3/boolean.h"
#include "ns3/command-line.h"
#include "ns3/config.h"
#include "ns3/data-rate.h"
#include "ns3/double.h"
#include "ns3/enum.h"
#include "ns3/error-model.h"
#include "ns3/inet-socket-address.h"
#include "ns3/internet-stack-helper.h"
#include "ns3/ipv4-address-helper.h"
#include "ns3/ipv4-l3-protocol.h"
#include "ns3/ipv4-list-routing-helper.h"
#include "ns3/ipv4-static-routing-helper.h"
#include "ns3/ipv4-static-routing.h"
#include "ns3/log.h"
#include "ns3/mobility-helper.h"
#include "ns3/mobility-model.h"
#include "ns3/names.h"
#include "ns3/node.h"
#include "ns3/on-off-helper.h"
#include "ns3/packet-sink-helper.h"
#include "ns3/packet-sink.h"
#include "ns3/simulator.h"
#include "ns3/socket.h"
#include "ns3/ssid.h"
#include "ns3/string.h"
#include "ns3/test.h"
#include "ns3/trace-helper.h"
#include "ns3/udp-socket-factory.h"
#include "ns3/udp-socket.h"
#include "ns3/uinteger.h"
#include "ns3/wifi-mac.h"
#include "ns3/wifi-net-device.h"
#include "ns3/wifi-psdu.h"
#include "ns3/yans-wifi-channel.h"
#include "ns3/yans-wifi-helper.h"
#include <limits>
#include <sstream>
#include <string>
+ Include dependency graph for wifi-multicast.cc:

Go to the source code of this file.

Functions

uint32_t ContextToNodeId (const std::string &context)
 Parse context strings of the form "/NodeList/x/DeviceList/x/..." to extract the NodeId integer.
 
void RxCallback (std::string context, Ptr< const Packet > p, double snr, WifiMode mode, WifiPreamble preamble)
 Callback when a frame is successfully received.
 
void SocketRxPacket (std::string context, Ptr< const Packet > p, const Address &from)
 
void SocketTxPacket (std::string context, Ptr< const Packet > p)
 Socket sent packet.
 
void TxCallback (Ptr< ListErrorModel > rxErrorModel, Ptr< RandomVariableStream > ranVar, double errorRate, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback when a frame is transmitted.
 

Variables

Time g_firstTx
 Time at which first TX packet is generated.
 
Time g_lastRx
 Time at which last RX packet is received.
 
Time g_lastTx
 Time at which last TX packet is generated.
 
uint64_t g_txBytes
 Number of generated bytes.
 

Detailed Description

Usage

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

Program Options

--logging
turn on example log components [false]
--verbose
turn on all wifi log components [false]
--pcap
turn on pcap file output [false]
--nStations
number of non-AP stations [1]
--simulationTime
Simulation time [+10s]
--payloadSize
The application payload size in bytes [1000]
--maxPackets
The maximum number of packets to be generated by the application (0 for no limit) [10]
--dataRate
The application data rate [10000000bps]
--rtsThreshold
RTS threshold [65535]
--rateManager
The rate adaptation manager to use (Constant, Ideal, MinstrelHt) [Constant]
--mcs
The MCS to use if Constant rate adaptation manager is used [11]
--targetAddress
multicast target address [239.192.100.1]
--accessCategory
select the multicast traffic access category (AC_BE, AC_BK, AC_VI, AC_VO) [AC_BE]
--gcrRetransmissionPolicy
GCR retransmission policy for groupcast frames (NoAckNoRetry, GcrUr, GcrBlockAck) [NoAckNoRetry]
--nRetriesGcrUr
number of retries per groupcast frame when GCR-UR retransmission policy is used [7]
--gcrProtection
protection to use for GCR (Rts-Cts or Cts-To-Self) [Rts-Cts]
--multicastFrameErrorRate
artificial error rate for multicast frame [0]
--maxAmpduLength
maximum length in bytes of an A-MPDU [0]
--minExpectedPackets
if set, simulation fails if the lowest amount of received packets is below this value (in Mbit/s) [0]
--maxExpectedPackets
if set, simulation fails if the highest amount of received packets is above this value (in Mbit/s) [0]
--minExpectedThroughput
if set, simulation fails if the throughput is below this value [0]
--maxExpectedThroughput
if set, simulation fails if the throughput is above this value [0]

Definition in file wifi-multicast.cc.

Function Documentation

◆ ContextToNodeId()

uint32_t ContextToNodeId ( const std::string & context)

Parse context strings of the form "/NodeList/x/DeviceList/x/..." to extract the NodeId integer.

Parameters
contextThe context to parse.
Returns
the NodeId

Definition at line 113 of file wifi-multicast.cc.

Referenced by RxCallback().

+ Here is the caller graph for this function:

◆ RxCallback()

void RxCallback ( std::string context,
Ptr< const Packet > p,
double snr,
WifiMode mode,
WifiPreamble preamble )

Callback when a frame is successfully received.

Parameters
contextthe context
pthe packet
snrthe SNR (in linear scale)
modethe mode used to transmit the packet
preamblethe preamble

Definition at line 196 of file wifi-multicast.cc.

References ContextToNodeId(), ns3::WifiMacHeader::GetAddr1(), ns3::Mac48Address::IsBroadcast(), ns3::Mac48Address::IsGroup(), ns3::WifiMacHeader::IsQosData(), NS_LOG_INFO, and ns3::WifiMacHeader::Print().

+ Here is the call graph for this function:

◆ SocketRxPacket()

void SocketRxPacket ( std::string context,
Ptr< const Packet > p,
const Address & from )
Parameters
contextThe context.
pThe packet.
fromsender address.

Definition at line 144 of file wifi-multicast.cc.

References g_lastRx, and ns3::Simulator::Now().

+ Here is the call graph for this function:

◆ SocketTxPacket()

void SocketTxPacket ( std::string context,
Ptr< const Packet > p )

Socket sent packet.

Parameters
contextThe context.
pThe packet.

Definition at line 127 of file wifi-multicast.cc.

References g_firstTx, g_lastTx, g_txBytes, and ns3::Simulator::Now().

+ Here is the call graph for this function:

◆ TxCallback()

void TxCallback ( Ptr< ListErrorModel > rxErrorModel,
Ptr< RandomVariableStream > ranVar,
double errorRate,
std::string context,
WifiConstPsduMap psduMap,
WifiTxVector txVector,
double txPowerW )

Callback when a frame is transmitted.

Parameters
rxErrorModelthe post reception error model on the receiver
ranVarthe random variable to determine whether the packet shall be corrupted
errorRatethe configured corruption error rate for multicast frames
contextthe context
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe tx power in Watts

Definition at line 160 of file wifi-multicast.cc.

References NS_LOG_INFO.

Variable Documentation

◆ g_firstTx

Time g_firstTx

Time at which first TX packet is generated.

Definition at line 102 of file wifi-multicast.cc.

Referenced by SocketTxPacket().

◆ g_lastRx

Time g_lastRx

Time at which last RX packet is received.

Definition at line 104 of file wifi-multicast.cc.

Referenced by SocketRxPacket().

◆ g_lastTx

Time g_lastTx

Time at which last TX packet is generated.

Definition at line 103 of file wifi-multicast.cc.

Referenced by SocketTxPacket().

◆ g_txBytes

uint64_t g_txBytes

Number of generated bytes.

Definition at line 101 of file wifi-multicast.cc.

Referenced by SocketTxPacket().