A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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"

+ Inheritance diagram for ns3::UdpEchoClientHelper:
+ Collaboration diagram for ns3::UdpEchoClientHelper:

Public Member Functions

 UdpEchoClientHelper (const Address &addr)
 Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with echos.
 
 UdpEchoClientHelper (const Address &ip, uint16_t port)
 Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with echos.
 
void SetFill (Ptr< Application > app, const 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).
 
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.
 
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.
 
- Public Member Functions inherited from ns3::ApplicationHelper
 ApplicationHelper (const std::string &typeId)
 Create an application of a given type ID.
 
 ApplicationHelper (TypeId typeId)
 Create an application of a given type ID.
 
int64_t AssignStreams (NodeContainer c, int64_t stream)
 Assigns a unique (monotonically increasing) stream number to all applications that match the configured type of this application helper instance.
 
ApplicationContainer Install (const std::string &nodeName)
 Install an application on the node configured with all the attributes set with SetAttribute.
 
ApplicationContainer Install (NodeContainer c)
 Install an application on each node of the input container configured with all the attributes set with SetAttribute.
 
ApplicationContainer Install (Ptr< Node > node)
 Install an application on the node configured with all the attributes set with SetAttribute.
 
void SetAttribute (const std::string &name, const AttributeValue &value)
 Helper function used to set the underlying application attributes.
 
void SetTypeId (const std::string &typeId)
 Allow the helper to be repurposed for another application type.
 
void SetTypeId (TypeId typeId)
 Allow the helper to be repurposed for another application type.
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::ApplicationHelper
static int64_t AssignStreamsToAllApps (NodeContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by all the applications.
 
- Protected Member Functions inherited from ns3::ApplicationHelper
virtual Ptr< ApplicationDoInstall (Ptr< Node > node)
 Install an application on the node configured with all the attributes set with SetAttribute.
 
- Protected Attributes inherited from ns3::ApplicationHelper
ObjectFactory m_factory
 Object factory.
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ UdpEchoClientHelper() [1/2]

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

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

Use this variant with addresses that do not include a port value (e.g., Ipv4Address and Ipv6Address).

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

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

References port, and ns3::ApplicationHelper::SetAttribute().

+ Here is the call graph for this function:

◆ UdpEchoClientHelper() [2/2]

ns3::UdpEchoClientHelper::UdpEchoClientHelper ( const Address & addr)

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

Use this variant with addresses that do include a port value (e.g., InetSocketAddress and Inet6SocketAddress).

Parameters
addrThe address of the remote udp echo server

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

References ns3::ApplicationHelper::SetAttribute().

+ Here is the call graph for this function:

Member Function Documentation

◆ SetFill() [1/3]

void ns3::UdpEchoClientHelper::SetFill ( Ptr< Application > app,
const 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 38 of file udp-echo-helper.cc.

References SetFill().

Referenced by SetFill(), SetFill(), and SetFill().

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

◆ SetFill() [2/3]

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 50 of file udp-echo-helper.cc.

References SetFill().

+ Here is the call graph for this function:

◆ SetFill() [3/3]

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 44 of file udp-echo-helper.cc.

References SetFill().

+ Here is the call graph for this function:

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