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);
uint32_t GetApplicationId(void) const
Return the application ID in the node.
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.
Simulation virtual time values and global simulation resolution.
Forward calls to a chain of Callback.
TracedCallback< Time > m_traceRtt
TracedCallback for RTT measured by ICMP ECHOs.
V4Ping()
create a pinger applications
virtual void DoDispose(void)
Destructor implementation.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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.