A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::UdpEchoClientHelper Class Reference

Create an application which sends a UDP packet and waits for an echo of this packet. More...

#include <udp-echo-helper.h>

+ Collaboration diagram for ns3::UdpEchoClientHelper:

Public Member Functions

 UdpEchoClientHelper (Address ip, uint16_t port)
 Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with echos. More...
 
 UdpEchoClientHelper (Ipv4Address ip, uint16_t port)
 Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with echos. More...
 
 UdpEchoClientHelper (Ipv6Address ip, uint16_t port)
 Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with echos. More...
 
ApplicationContainer Install (Ptr< Node > node) const
 Create a udp echo client application on the specified node. More...
 
ApplicationContainer Install (std::string nodeName) const
 Create a udp echo client application on the specified node. More...
 
ApplicationContainer Install (NodeContainer c) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 Record an attribute to be set in each Application after it is is created. More...
 
void SetFill (Ptr< Application > app, std::string fill)
 Given a pointer to a UdpEchoClient application, set the data fill of the packet (what is sent as data to the server) to the contents of the fill string (including the trailing zero terminator). More...
 
void SetFill (Ptr< Application > app, uint8_t fill, uint32_t dataLength)
 Given a pointer to a UdpEchoClient application, set the data fill of the packet (what is sent as data to the server) to the contents of the fill byte. More...
 
void SetFill (Ptr< Application > app, uint8_t *fill, uint32_t fillLength, uint32_t dataLength)
 Given a pointer to a UdpEchoClient application, set the data fill of the packet (what is sent as data to the server) to the contents of the fill buffer, repeated as many times as is required. More...
 

Private Member Functions

Ptr< ApplicationInstallPriv (Ptr< Node > node) const
 Install an ns3::UdpEchoClient on the node configured with all the attributes set with SetAttribute. More...
 

Private Attributes

ObjectFactory m_factory
 Object factory. More...
 

Detailed Description

Create an application which sends a UDP packet and waits for an echo of this packet.

Definition at line 106 of file udp-echo-helper.h.

Constructor & Destructor Documentation

ns3::UdpEchoClientHelper::UdpEchoClientHelper ( Address  ip,
uint16_t  port 
)

Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with echos.

Parameters
ipThe IP address of the remote udp echo server
portThe port number of the remote udp echo server

Definition at line 76 of file udp-echo-helper.cc.

References ns3::UdpEchoClient::GetTypeId(), m_factory, SetAttribute(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

ns3::UdpEchoClientHelper::UdpEchoClientHelper ( Ipv4Address  ip,
uint16_t  port 
)

Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with echos.

Parameters
ipThe IPv4 address of the remote udp echo server
portThe port number of the remote udp echo server

Definition at line 83 of file udp-echo-helper.cc.

References ns3::UdpEchoClient::GetTypeId(), m_factory, SetAttribute(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

ns3::UdpEchoClientHelper::UdpEchoClientHelper ( Ipv6Address  ip,
uint16_t  port 
)

Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with echos.

Parameters
ipThe IPv6 address of the remote udp echo server
portThe port number of the remote udp echo server

Definition at line 90 of file udp-echo-helper.cc.

References ns3::UdpEchoClient::GetTypeId(), m_factory, SetAttribute(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

Member Function Documentation

ApplicationContainer ns3::UdpEchoClientHelper::Install ( Ptr< Node node) const

Create a udp echo client application on the specified node.

The Node is provided as a Ptr<Node>.

Parameters
nodeThe Ptr<Node> on which to create the UdpEchoClientApplication.
Returns
An ApplicationContainer that holds a Ptr<Application> to the application created

Definition at line 124 of file udp-echo-helper.cc.

References InstallPriv().

Referenced by experiment(), and main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ApplicationContainer ns3::UdpEchoClientHelper::Install ( std::string  nodeName) const

Create a udp echo client application on the specified node.

The Node is provided as a string name of a Node that has been previously associated using the Object Name Service.

Parameters
nodeNameThe name of the node on which to create the UdpEchoClientApplication
Returns
An ApplicationContainer that holds a Ptr<Application> to the application created

Definition at line 130 of file udp-echo-helper.cc.

References InstallPriv().

+ Here is the call graph for this function:

ApplicationContainer ns3::UdpEchoClientHelper::Install ( NodeContainer  c) const
Parameters
cthe nodes

Create one udp echo client application on each of the input nodes

Returns
the applications created, one application per input node.

Definition at line 137 of file udp-echo-helper.cc.

References ns3::ApplicationContainer::Add(), ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and InstallPriv().

+ Here is the call graph for this function:

Ptr< Application > ns3::UdpEchoClientHelper::InstallPriv ( Ptr< Node node) const
private

Install an ns3::UdpEchoClient on the node configured with all the attributes set with SetAttribute.

Parameters
nodeThe node on which an UdpEchoClient will be installed.
Returns
Ptr to the application installed.

Definition at line 149 of file udp-echo-helper.cc.

References ns3::Node::AddApplication(), ns3::ObjectFactory::Create(), and m_factory.

Referenced by Install().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::UdpEchoClientHelper::SetAttribute ( std::string  name,
const AttributeValue value 
)

Record an attribute to be set in each Application after it is is created.

Parameters
namethe name of the attribute to set
valuethe value of the attribute to set

Definition at line 98 of file udp-echo-helper.cc.

References m_factory, and ns3::ObjectFactory::Set().

Referenced by ns3::EpcS1uDlTestCase::DoRun(), ns3::LteEpcE2eDataTestCase::DoRun(), experiment(), HwmpDoRfRegressionTest::InstallApplications(), main(), and UdpEchoClientHelper().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::UdpEchoClientHelper::SetFill ( Ptr< Application app,
std::string  fill 
)

Given a pointer to a UdpEchoClient application, set the data fill of the packet (what is sent as data to the server) to the contents of the fill string (including the trailing zero terminator).

Warning
The size of resulting echo packets will be automatically adjusted to reflect the size of the fill string – this means that the PacketSize attribute may be changed as a result of this call.
Parameters
appSmart pointer to the application (real type must be UdpEchoClient).
fillThe string to use as the actual echo data bytes.

Definition at line 106 of file udp-echo-helper.cc.

Referenced by main(), and SetFill().

+ Here is the caller graph for this function:

void ns3::UdpEchoClientHelper::SetFill ( Ptr< Application app,
uint8_t  fill,
uint32_t  dataLength 
)

Given a pointer to a UdpEchoClient application, set the data fill of the packet (what is sent as data to the server) to the contents of the fill byte.

The fill byte will be used to initialize the contents of the data packet.

Warning
The size of resulting echo packets will be automatically adjusted to reflect the dataLength parameter – this means that the PacketSize attribute may be changed as a result of this call.
Parameters
appSmart pointer to the application (real type must be UdpEchoClient).
fillThe byte to be repeated in constructing the packet data..
dataLengthThe desired length of the resulting echo packet data.

Definition at line 112 of file udp-echo-helper.cc.

References SetFill().

+ Here is the call graph for this function:

void ns3::UdpEchoClientHelper::SetFill ( Ptr< Application app,
uint8_t *  fill,
uint32_t  fillLength,
uint32_t  dataLength 
)

Given a pointer to a UdpEchoClient application, set the data fill of the packet (what is sent as data to the server) to the contents of the fill buffer, repeated as many times as is required.

Initializing the fill to the contents of a single buffer is accomplished by providing a complete buffer with fillLength set to your desired dataLength

Warning
The size of resulting echo packets will be automatically adjusted to reflect the dataLength parameter – this means that the PacketSize attribute of the Application may be changed as a result of this call.
Parameters
appSmart pointer to the application (real type must be UdpEchoClient).
fillThe fill pattern to use when constructing packets.
fillLengthThe number of bytes in the provided fill pattern.
dataLengthThe desired length of the final echo data.

Definition at line 118 of file udp-echo-helper.cc.

References SetFill().

+ Here is the call graph for this function:

Member Data Documentation

ObjectFactory ns3::UdpEchoClientHelper::m_factory
private

Object factory.

Definition at line 234 of file udp-echo-helper.h.

Referenced by InstallPriv(), SetAttribute(), and UdpEchoClientHelper().


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