A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment Class Reference

WiFi clear channel cmu experiment class. More...

Collaboration diagram for anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment:

Public Member Functions

 Experiment ()
 Experiment (std::string name)
 Constructor.
uint32_t Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
 Run an experiment.

Private Member Functions

void GenerateTraffic (Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval)
 Generate the traffic.
Vector GetPosition (Ptr< Node > node)
 Get the position of a node.
void ReceivePacket (Ptr< Socket > socket)
 Receive a packet.
void SetPosition (Ptr< Node > node, Vector position)
 Set the position of a node.
Ptr< SocketSetupPacketReceive (Ptr< Node > node)
 Setup the receiving socket.

Private Attributes

Gnuplot2dDataset m_output
 Output dataset.
uint32_t m_pktsTotal
 Total number of received packets.

Detailed Description

WiFi clear channel cmu experiment class.

It handles the creation and run of an experiment.

Definition at line 41 of file wifi-clear-channel-cmu.cc.

Constructor & Destructor Documentation

◆ Experiment() [1/2]

anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment::Experiment ( )

Definition at line 100 of file wifi-clear-channel-cmu.cc.

◆ Experiment() [2/2]

anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment::Experiment ( std::string name)

Constructor.

Parameters
nameThe name of the experiment.

Definition at line 104 of file wifi-clear-channel-cmu.cc.

References ns3::Gnuplot2dDataset::LINES, and m_output.

Member Function Documentation

◆ GenerateTraffic()

void anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment::GenerateTraffic ( Ptr< Socket > socket,
uint32_t pktSize,
uint32_t pktCount,
Time pktInterval )
private

Generate the traffic.

Parameters
socketThe sending socket.
pktSizeThe packet size.
pktCountThe number of packets to send.
pktIntervalThe time between packets.

Definition at line 146 of file wifi-clear-channel-cmu.cc.

References ns3::Create(), GenerateTraffic(), and ns3::Simulator::Schedule().

Referenced by GenerateTraffic(), and Run().

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

◆ GetPosition()

Vector anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment::GetPosition ( Ptr< Node > node)
private

Get the position of a node.

Parameters
nodeThe node.
Returns
the position of the node.

Definition at line 118 of file wifi-clear-channel-cmu.cc.

◆ ReceivePacket()

void anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment::ReceivePacket ( Ptr< Socket > socket)
private

Receive a packet.

Parameters
socketThe receiving socket.

Definition at line 125 of file wifi-clear-channel-cmu.cc.

References m_pktsTotal.

Referenced by SetupPacketReceive().

Here is the caller graph for this function:

◆ Run()

uint32_t anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment::Run ( const WifiHelper & wifi,
const YansWifiPhyHelper & wifiPhy,
const WifiMacHelper & wifiMac,
const YansWifiChannelHelper & wifiChannel )

Run an experiment.

Parameters
wifi//!< The WifiHelper class.
wifiPhy//!< The YansWifiPhyHelper class.
wifiMac//!< The WifiMacHelper class.
wifiChannel//!< The YansWifiChannelHelper class.
Returns
the number of received packets.

Definition at line 169 of file wifi-clear-channel-cmu.cc.

References ns3::NodeContainer::Create(), ns3::YansWifiChannelHelper::Create(), ns3::CreateObject(), ns3::Socket::CreateSocket(), ns3::Simulator::Destroy(), GenerateTraffic(), ns3::NodeContainer::Get(), ns3::TypeId::LookupByName(), m_pktsTotal, NS_LOG_INFO, packetSize, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), and SetupPacketReceive().

Here is the call graph for this function:

◆ SetPosition()

void anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment::SetPosition ( Ptr< Node > node,
Vector position )
private

Set the position of a node.

Parameters
nodeThe node.
positionThe position of the node.

Definition at line 111 of file wifi-clear-channel-cmu.cc.

◆ SetupPacketReceive()

Ptr< Socket > anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment::SetupPacketReceive ( Ptr< Node > node)
private

Setup the receiving socket.

Parameters
nodeThe receiving node.
Returns
the socket.

Definition at line 135 of file wifi-clear-channel-cmu.cc.

References ns3::Socket::CreateSocket(), ns3::Ipv4Address::GetAny(), ns3::TypeId::LookupByName(), ns3::MakeCallback(), ReceivePacket(), and sink.

Referenced by Run().

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

Member Data Documentation

◆ m_output

Gnuplot2dDataset anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment::m_output
private

Output dataset.

Definition at line 97 of file wifi-clear-channel-cmu.cc.

Referenced by Experiment().

◆ m_pktsTotal

uint32_t anonymous_namespace{wifi-clear-channel-cmu.cc}::Experiment::m_pktsTotal
private

Total number of received packets.

Definition at line 96 of file wifi-clear-channel-cmu.cc.

Referenced by ReceivePacket(), and Run().


The documentation for this class was generated from the following file: