Create an application which sends a UDP packet and waits for an echo of this packet. More...
#include "udp-echo-helper.h"
Public Member Functions | |
UdpEchoClientHelper (Address addr) | |
Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with echos. | |
UdpEchoClientHelper (Address ip, uint16_t port) | |
Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with echos. | |
ApplicationContainer | Install (NodeContainer c) const |
ApplicationContainer | Install (Ptr< Node > node) const |
Create a udp echo client application on the specified node. | |
ApplicationContainer | Install (std::string nodeName) const |
Create a udp echo client application on the specified node. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Record an attribute to be set in each Application after it is is created. | |
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). | |
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. | |
Private Member Functions | |
Ptr< Application > | InstallPriv (Ptr< Node > node) const |
Install an ns3::UdpEchoClient on the node configured with all the attributes set with SetAttribute. | |
Private Attributes | |
ObjectFactory | m_factory |
Object factory. | |
Create an application which sends a UDP packet and waits for an echo of this packet.
Definition at line 107 of file udp-echo-helper.h.
ns3::UdpEchoClientHelper::UdpEchoClientHelper | ( | 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).
ip | The IP address of the remote udp echo server |
port | The port number of the remote udp echo server |
Definition at line 75 of file udp-echo-helper.cc.
References ns3::UdpEchoClient::GetTypeId(), m_factory, port, SetAttribute(), and ns3::ObjectFactory::SetTypeId().
ns3::UdpEchoClientHelper::UdpEchoClientHelper | ( | 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).
addr | The address of the remote udp echo server |
Definition at line 82 of file udp-echo-helper.cc.
References ns3::UdpEchoClient::GetTypeId(), m_factory, SetAttribute(), and ns3::ObjectFactory::SetTypeId().
ApplicationContainer ns3::UdpEchoClientHelper::Install | ( | NodeContainer | c | ) | const |
c | the nodes |
Create one udp echo client application on each of the input nodes
Definition at line 129 of file udp-echo-helper.cc.
References ns3::ApplicationContainer::Add(), ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and InstallPriv().
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>.
node | The Ptr<Node> on which to create the UdpEchoClientApplication. |
Definition at line 116 of file udp-echo-helper.cc.
References InstallPriv().
Referenced by LteIpv6RoutingTestCase::DoRun(), and experiment().
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.
nodeName | The name of the node on which to create the UdpEchoClientApplication |
Definition at line 122 of file udp-echo-helper.cc.
References InstallPriv().
|
private |
Install an ns3::UdpEchoClient on the node configured with all the attributes set with SetAttribute.
node | The node on which an UdpEchoClient will be installed. |
Definition at line 141 of file udp-echo-helper.cc.
References ns3::ObjectFactory::Create(), and m_factory.
Referenced by Install().
void ns3::UdpEchoClientHelper::SetAttribute | ( | std::string | name, |
const AttributeValue & | value | ||
) |
Record an attribute to be set in each Application after it is is created.
name | the name of the attribute to set |
value | the value of the attribute to set |
Definition at line 89 of file udp-echo-helper.cc.
References m_factory, and ns3::ObjectFactory::Set().
Referenced by UdpEchoClientHelper(), LteIpv6RoutingTestCase::DoRun(), and experiment().
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).
app | Smart pointer to the application (real type must be UdpEchoClient). |
fill | The string to use as the actual echo data bytes. |
Definition at line 95 of file udp-echo-helper.cc.
References SetFill().
Referenced by SetFill().
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
app | Smart pointer to the application (real type must be UdpEchoClient). |
fill | The fill pattern to use when constructing packets. |
fillLength | The number of bytes in the provided fill pattern. |
dataLength | The desired length of the final echo data. |
Definition at line 107 of file udp-echo-helper.cc.
References SetFill().
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.
app | Smart pointer to the application (real type must be UdpEchoClient). |
fill | The byte to be repeated in constructing the packet data.. |
dataLength | The desired length of the resulting echo packet data. |
Definition at line 101 of file udp-echo-helper.cc.
References SetFill().
|
private |
Object factory.
Definition at line 228 of file udp-echo-helper.h.
Referenced by UdpEchoClientHelper(), InstallPriv(), and SetAttribute().