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.
 

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().