Exercise: Sending ICMP Messages With Ping & Traceroute

In this lesson, we'll look at real live ICMP packets with ping and traceroute!

Ping

When a client sends ICMP echo messages (ping), it sets a certain value in the TTL field and starts a timer. An echo server software running on the destination returns an ICMP echo reply message. Since the TTL value is decremented at each hop, the ping client can know the number of hops traversed by the packets. Also, when it receives the echo reply, it stops the timer and calculates the round trip time. There is a maximum value for the round trip time and when it’s exceeded, the echo message is declared lost. ping is also often used by network operators to verify that a given IP address is reachable.

Sample usage of ping is shown below.

Get hands-on with 1200+ tech skills courses.