20 #include "ns3/application.h"
21 #include "ns3/traced-callback.h"
22 #include "ns3/nstime.h"
23 #include "ns3/average.h"
24 #include "ns3/simulator.h"
67 void Write32 (uint8_t *buffer,
const uint32_t
data);
74 void Read32 (
const uint8_t *buffer, uint32_t &data);
virtual void StartApplication(void)
Application specific startup code.
void Write32(uint8_t *buffer, const uint32_t data)
Writes data to buffer in little-endian format.
keep track of time values and allow control of global simulation resolution
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
TracedCallback< Time > m_traceRtt
TracedCallback for RTT measured by ICMP ECHOs.
uint32_t GetApplicationId(void) const
Return the application ID in the node.
V4Ping()
create a pinger applications
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
void Read32(const uint8_t *buffer, uint32_t &data)
Writes data from a little-endian formatted buffer to data.
Time m_started
Start time to report total ping time.
static TypeId GetTypeId(void)
Get the type ID.
The base class for all ns3 applications.
void Receive(Ptr< Socket > socket)
Receive an ICMP Echo.
std::map< uint16_t, Time > m_sent
All sent but not answered packets. Map icmp seqno -> when sent.
bool m_verbose
produce ping-style output if true
uint16_t m_seq
ICMP ECHO sequence number.
EventId m_next
Next packet will be sent.
Ipv4 addresses are stored in host order in this class.
virtual void StopApplication(void)
Application specific shutdown code.
an identifier for simulation events.
void Send()
Send one Ping (ICMP ECHO) to the destination.
an application which sends one ICMP ECHO request, waits for a REPLYs and reports the calculated RTT...
Time m_interval
Wait interval seconds between sending each packet.
uint32_t m_recv
received packets counter
Ipv4Address m_remote
Remote address.
a unique identifier for an interface.
uint32_t m_size
Specifies the number of data bytes to be sent.
Average< double > m_avgRtt
Average rtt is ms.
Ptr< Socket > m_socket
The socket we send packets from.