WiFi adhoc experiment class. More...
Public Member Functions | |
| Experiment () | |
| Experiment (std::string name) | |
| Constructor. | |
| Gnuplot2dDataset | Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, const WifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel) |
| Run an experiment. | |
Private Member Functions | |
| void | AdvancePosition (Ptr< Node > node) |
| Move a node by 1m on the x axis, stops at 210m. | |
| 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< Socket > | SetupPacketReceive (Ptr< Node > node) |
| Setup the receiving socket. | |
Private Attributes | |
| uint32_t | m_bytesTotal |
| The number of received bytes. | |
| Gnuplot2dDataset | m_output |
| The output dataset. | |
WiFi adhoc experiment class.
It handles the creation and run of an experiment.
Definition at line 43 of file wifi-adhoc.cc.
| anonymous_namespace{wifi-adhoc.cc}::Experiment::Experiment | ( | ) |
Definition at line 100 of file wifi-adhoc.cc.
| anonymous_namespace{wifi-adhoc.cc}::Experiment::Experiment | ( | std::string | name | ) |
Constructor.
| name | The name of the experiment. |
Definition at line 104 of file wifi-adhoc.cc.
References ns3::Gnuplot2dDataset::LINES, and m_output.
Move a node by 1m on the x axis, stops at 210m.
| node | The node. |
Definition at line 125 of file wifi-adhoc.cc.
References AdvancePosition(), GetPosition(), m_bytesTotal, m_output, ns3::Simulator::Schedule(), ns3::Seconds(), and SetPosition().
Referenced by AdvancePosition(), and Run().
Get the position of a node.
| node | The node. |
Definition at line 118 of file wifi-adhoc.cc.
Referenced by AdvancePosition().
Receive a packet.
| socket | The receiving socket. |
Definition at line 141 of file wifi-adhoc.cc.
References m_bytesTotal.
Referenced by SetupPacketReceive().
| Gnuplot2dDataset anonymous_namespace{wifi-adhoc.cc}::Experiment::Run | ( | const WifiHelper & | wifi, |
| const YansWifiPhyHelper & | wifiPhy, | ||
| const WifiMacHelper & | wifiMac, | ||
| const YansWifiChannelHelper & | wifiChannel ) |
Run an experiment.
| wifi | //!< The WifiHelper class. |
| wifiPhy | //!< The YansWifiPhyHelper class. |
| wifiMac | //!< The WifiMacHelper class. |
| wifiChannel | //!< The YansWifiChannelHelper class. |
Definition at line 161 of file wifi-adhoc.cc.
References AdvancePosition(), ns3::NodeContainer::Create(), ns3::YansWifiChannelHelper::Create(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::NodeContainer::Get(), ns3::PacketSocketHelper::Install(), m_bytesTotal, m_output, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), SetupPacketReceive(), ns3::ApplicationContainer::Start(), and ns3::ApplicationContainer::Stop().
|
private |
Set the position of a node.
| node | The node. |
| position | The position of the node. |
Definition at line 111 of file wifi-adhoc.cc.
Referenced by AdvancePosition().
|
private |
Setup the receiving socket.
| node | The receiving node. |
Definition at line 151 of file wifi-adhoc.cc.
References ns3::Socket::CreateSocket(), ns3::TypeId::LookupByName(), ns3::MakeCallback(), ReceivePacket(), and sink.
Referenced by Run().
|
private |
The number of received bytes.
Definition at line 96 of file wifi-adhoc.cc.
Referenced by AdvancePosition(), ReceivePacket(), and Run().
|
private |
The output dataset.
Definition at line 97 of file wifi-adhoc.cc.
Referenced by Experiment(), AdvancePosition(), and Run().