A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes. More...
#include <on-off-helper.h>
Public Member Functions | |
OnOffHelper (std::string protocol, Address address) | |
int64_t | AssignStreams (NodeContainer c, int64_t stream) |
ApplicationContainer | Install (NodeContainer c) const |
ApplicationContainer | Install (Ptr< Node > node) const |
ApplicationContainer | Install (std::string nodeName) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
void | SetConstantRate (DataRate dataRate, uint32_t packetSize=512) |
Private Member Functions | |
Ptr< Application > | InstallPriv (Ptr< Node > node) const |
Private Attributes | |
ObjectFactory | m_factory |
std::string | m_protocol |
Address | m_remote |
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
Definition at line 41 of file on-off-helper.h.
ns3::OnOffHelper::OnOffHelper | ( | std::string | protocol, |
Address | address | ||
) |
Create an OnOffHelper to make it easier to work with OnOffApplications
protocol | the name of the protocol to use to send traffic by the applications. This string identifies the socket factory type used to create sockets for the applications. A typical value would be ns3::UdpSocketFactory. |
address | the address of the remote node to send traffic to. |
Definition at line 32 of file on-off-helper.cc.
References ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().
int64_t ns3::OnOffHelper::AssignStreams | ( | NodeContainer | c, |
int64_t | stream | ||
) |
Assign a fixed random variable stream number to the random variables used by this model. Return the number of streams (possibly zero) that have been assigned. The Install() method should have previously been called by the user.
stream | first stream index to use |
c | NodeContainer of the set of nodes for which the OnOffApplication should be modified to use a fixed stream |
Definition at line 80 of file on-off-helper.cc.
References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), ns3::Node::GetApplication(), and ns3::Node::GetNApplications().
ApplicationContainer ns3::OnOffHelper::Install | ( | NodeContainer | c | ) | const |
Install an ns3::OnOffApplication on each node of the input container configured with all the attributes set with SetAttribute.
c | NodeContainer of the set of nodes on which an OnOffApplication will be installed. |
Definition at line 59 of file on-off-helper.cc.
References ns3::ApplicationContainer::Add(), ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and InstallPriv().
Referenced by WifiMsduAggregatorThroughputTest::DoRun(), DynamicGlobalRoutingTestCase::DoRun(), CsmaBridgeTestCase::DoRun(), ns3::SpectrumIdealPhyTestCase::DoRun(), Ns3TcpInteroperabilityTestCase::DoRun(), CsmaBroadcastTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), and CsmaStarTestCase::DoRun().
ApplicationContainer ns3::OnOffHelper::Install | ( | Ptr< Node > | node | ) | const |
Install an ns3::OnOffApplication on the node configured with all the attributes set with SetAttribute.
node | The node on which an OnOffApplication will be installed. |
Definition at line 46 of file on-off-helper.cc.
References InstallPriv().
ApplicationContainer ns3::OnOffHelper::Install | ( | std::string | nodeName | ) | const |
Install an ns3::OnOffApplication on the node configured with all the attributes set with SetAttribute.
nodeName | The node on which an OnOffApplication will be installed. |
Definition at line 52 of file on-off-helper.cc.
References InstallPriv().
|
private |
Install an ns3::OnOffApplication on the node configured with all the attributes set with SetAttribute.
node | The node on which an OnOffApplication will be installed. |
Definition at line 71 of file on-off-helper.cc.
References ns3::Node::AddApplication(), and ns3::ObjectFactory::Create().
Referenced by Install().
void ns3::OnOffHelper::SetAttribute | ( | std::string | name, |
const AttributeValue & | value | ||
) |
Helper function used to set the underlying application attributes.
name | the name of the application attribute to set |
value | the value of the application attribute to set |
Definition at line 40 of file on-off-helper.cc.
References ns3::ObjectFactory::Set().
Referenced by WifiMsduAggregatorThroughputTest::DoRun(), DynamicGlobalRoutingTestCase::DoRun(), ns3::SpectrumIdealPhyTestCase::DoRun(), Ns3TcpInteroperabilityTestCase::DoRun(), ns3::BriteTopologyFunctionTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), and CsmaStarTestCase::DoRun().
void ns3::OnOffHelper::SetConstantRate | ( | DataRate | dataRate, |
uint32_t | packetSize = 512 |
||
) |
Helper function to set a constant rate source. Equivalent to setting the attributes OnTime to constant 1000 seconds, OffTime to constant 0 seconds, and the DataRate and PacketSize set accordingly
dataRate | DataRate object for the sending rate |
packetSize | size in bytes of the packet payloads generated |
Definition at line 100 of file on-off-helper.cc.
References ns3::ObjectFactory::Set().
Referenced by ns3::aodv::Bug772ChainTest::CreateDevices(), WifiMsduAggregatorThroughputTest::DoRun(), StaticRoutingSlash32TestCase::DoRun(), DynamicGlobalRoutingTestCase::DoRun(), CsmaBridgeTestCase::DoRun(), ns3::SpectrumIdealPhyTestCase::DoRun(), CsmaBroadcastTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), GlobalRoutingSlash32TestCase::DoRun(), CsmaOneSubnetTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), and CsmaStarTestCase::DoRun().