20 #include "ns3/application.h"
21 #include "ns3/traced-callback.h"
22 #include "ns3/average.h"
65 void Write32 (uint8_t *buffer,
const uint32_t
data);
72 void Read32 (
const uint8_t *buffer, uint32_t &
data);
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.
Ptr< Socket > m_socket
The socket we send packets from.
uint32_t m_recv
received packets counter
void Send()
Send one Ping (ICMP ECHO) to the destination.
Ipv4Address m_remote
Remote address.
uint16_t m_seq
ICMP ECHO sequence number.
uint32_t GetApplicationId(void) const
Return the application ID in the node.
void Write32(uint8_t *buffer, const uint32_t data)
Writes data to buffer in little-endian format.
virtual void DoDispose(void)
Destructor implementation.
void Receive(Ptr< Socket > socket)
Receive an ICMP Echo.
V4Ping()
create a pinger applications
TracedCallback< Time > m_traceRtt
TracedCallback for RTT measured by ICMP ECHOs.
virtual void StartApplication(void)
Application specific startup code.
std::map< uint16_t, Time > m_sent
All sent but not answered packets. Map icmp seqno -> when sent.
static TypeId GetTypeId(void)
Get the type ID.
Time m_interval
Wait interval seconds between sending each packet.
Time m_started
Start time to report total ping time.
virtual void StopApplication(void)
Application specific shutdown code.
Every class exported by the ns3 library is enclosed in the ns3 namespace.