22 #ifndef V4TRACEROUTE_H
23 #define V4TRACEROUTE_H
25 #include "ns3/application.h"
26 #include "ns3/traced-callback.h"
27 #include "ns3/nstime.h"
28 #include "ns3/average.h"
29 #include "ns3/simulator.h"
30 #include "ns3/output-stream-wrapper.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.
a unique identifier for an interface.
Traceroute application sends one ICMP ECHO request with TTL=1, and after receiving an ICMP TIME EXCEE...
Ipv4Address m_remote
Remote address.
void HandleWaitReplyTimeout()
Triggers an action if an ICMP TIME EXCEED have not being received in the time defined by StartWaitRep...
virtual void StopApplication(void)
Application specific shutdown code.
uint32_t GetApplicationId(void) const
Return the application ID in the node.
EventId m_next
Next packet will be sent.
std::ostringstream m_routeIpv4
The Ipv4 address of the latest hop found.
Ptr< OutputStreamWrapper > m_printStream
Stream of the traceroute used for the output file.
uint32_t m_probeCount
The Current probe value.
static TypeId GetTypeId(void)
Get the type ID.
uint16_t m_seq
ICMP ECHO sequence number.
virtual void DoDispose(void)
Destructor implementation.
uint16_t m_ttl
The current TTL value.
std::map< uint16_t, Time > m_sent
All sent but not answered packets. Map icmp seqno -> when sent.
Ptr< Socket > m_socket
The socket we send packets from.
uint32_t m_maxTtl
The maximium Ttl (Max number of hops to trace)
Time m_interval
Wait interval seconds between sending each packet.
void Print(Ptr< OutputStreamWrapper > stream)
Prints the application traced routes into a given OutputStream.
std::ostringstream m_osRoute
Stream of characters used for printing a single route.
virtual void StartApplication(void)
Application specific startup code.
Time m_started
Start time to report total ping time.
EventId m_waitIcmpReplyTimer
The timer used to wait for the probes ICMP replies.
uint32_t m_size
Specifies the number of data bytes to be sent.
uint16_t m_maxProbes
The maximum number of probe packets per hop.
Time m_waitIcmpReplyTimeout
The wait time until the response is considered lost.
void Receive(Ptr< Socket > socket)
Receive an ICMP Echo.
void StartWaitReplyTimer()
Starts a timer after sending an ICMP ECHO.
bool m_verbose
produce traceroute style output if true
void Send()
Send one (ICMP ECHO) to the destination.
Every class exported by the ns3 library is enclosed in the ns3 namespace.