Please implement a program to measure the time it takes to reach a host. The program sends an ICMP ECHO_REQUEST packet to a specific host, and waits for the host to return an ECHO_REPLY packet. The TTL (time-to-live) value of the packet determines the max number of router hops. If the request does not reach the host, the sender is noted back with one of the following errors.
TTL Expired in Transit
Destination Host Unreachable
Request Timed Out i.e. no reply
Unknown Host
It shows results like this:
xxxx% ping [login to view URL]
PING [login to view URL] ([login to view URL]): 56 data bytes
64 bytes from [login to view URL]: icmp_seq=0 ttl=55 time=34.250 ms
64 bytes from [login to view URL]: icmp_seq=1 ttl=55 time=10.299 ms
64 bytes from [login to view URL]: icmp_seq=2 ttl=55 time=31.466 ms
64 bytes from [login to view URL]: icmp_seq=3 ttl=55 time=11.790 ms
64 bytes from [login to view URL]: icmp_seq=4 ttl=55 time=13.563 ms
^C
--- [login to view URL] ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 10.299/20.274/34.250/10.364 ms
Hints: Open a Raw socket using SOCK_RAW with protocol as IPPROTO_ICMP. Remember to set the TTL value and set a timer at the sender side. When the input is a hostname, you need to do a DNS lookup.
Hi! I have done several tools for network analysis before (but mostly with TCP and UDP packets), so I can try to help you. Let's discuss details in chat!
We have fresh team with good knowledge and experience in web and mobile application development. we follow agile methodologies so that we can deliver the project on time. More we can talk in person.