19#include "ns3/application.h"
20#include "ns3/average.h"
21#include "ns3/traced-callback.h"
The base class for all ns3 applications.
An identifier for simulation events.
Ipv4 addresses are stored in host order in this class.
Simulation virtual time values and global simulation resolution.
Forward calls to a chain of Callback.
a unique identifier for an interface.
an application which sends one ICMP ECHO request, waits for a REPLYs and reports the calculated RTT.
void Read32(const uint8_t *buffer, uint32_t &data)
Writes data from a little-endian formatted buffer to data.
Average< double > m_avgRtt
Average rtt is ms.
bool m_verbose
produce ping-style output if true
EventId m_next
Next packet will be sent.
uint32_t m_size
Specifies the number of data bytes to be sent.
void StartApplication() override
Application specific startup code.
Ptr< Socket > m_socket
The socket we send packets from.
uint32_t m_recv
received packets counter
void StopApplication() override
Application specific shutdown code.
void Send()
Send one Ping (ICMP ECHO) to the destination.
Ipv4Address m_remote
Remote address.
uint16_t m_seq
ICMP ECHO sequence number.
void Write32(uint8_t *buffer, const uint32_t data)
Writes data to buffer in little-endian format.
void Receive(Ptr< Socket > socket)
Receive an ICMP Echo.
static TypeId GetTypeId()
Get the type ID.
V4Ping()
create a pinger applications
void DoDispose() override
Destructor implementation.
TracedCallback< Time > m_traceRtt
TracedCallback for RTT measured by ICMP ECHOs.
uint32_t GetApplicationId() const
Return the application ID in the node.
std::map< uint16_t, Time > m_sent
All sent but not answered packets. Map icmp seqno -> when sent.
Time m_interval
Wait interval seconds between sending each packet.
Time m_started
Start time to report total ping time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.