Introduction to Network — #13 ICMP
Cisco Networking Academy, Hands-on Course!
13.0 — Introduction
13.0.1 — Why should I take this module?
13.0.2 — What will I learn in this module?
Module Title: ICMP
Module Objective: Use various tools to test network connectivity.
13.1 — ICMP Messages
13.1.1 — ICMPv4 and ICMPv6 Messages
ICMP is available for both IPv4 and IPv6. ICMPv4 is the messaging protocol for IPv4. ICMPv6 provides these same services for IPv6 but includes additional functionality.
The types of ICMP messages, and the reasons why they are sent, are extensive.
- Host reachability
- Destination or Service Unreachable
- Time exceeded
13.1.2 — Host Reachability
An ICMP Echo Message can be used to test the reachability of a host on an IP network. The local host sends an ICMP Echo Request to a host.
13.1.3 — Destination or Service Unreachable
When a host or gateway receives a packet that it cannot deliver, it can use an ICMP Destination Unreachable message to notify the source that the destination or service is unreachable.
Some of the Destination Unreachable codes for ICMPv4 are as follows:
- 0 — Net unreachable
- 1 — Host unreachable
- 2 — Protocol unreachable
- 3 — Port unreachable
Some of the Destination Unreachable codes for ICMPv6 are as follows:
- 0 — No route to destination
- 1 — Communication with the destination is administratively prohibited (e.g., firewall)
- 2 — Beyond scope of the source address
- 3 — Address unreachable
- 4 — Port unreachable
13.1.4 — Time Exceed/Hop Limit
An ICMPv4 Time Exceeded message is used by a router to indicate that a packet cannot be forwarded because the Time to Live (TTL) field of the packet was decremented to 0.
ICMPv6 also sends a Time Exceeded message if the router cannot forward an IPv6 packet because the packet has expired.
Instead of the IPv4 TTL field, ICMPv6 uses the IPv6 Hop Limit field to determine if the packet has expired.
13.1.5 — ICMPv6 Messages
The informational and error messages found in ICMPv6 are very similar to the control and error messages implemented by ICMPv4.
ICMPv6 includes four new protocols as part of the Neighbor Discovery Protocol (ND or NDP).
Messaging between an IPv6 router and an IPv6 device, including dynamic address allocation are as follows:
- Router Solicitation (RS) message
- Router Advertisement (RA) message
Messaging between IPv6 devices, including duplicate address detection and address resolution are as follows:
- Neighbor Solicitation (NS) message
- Neighbor Advertisement (NA) message
Router Advertisement (RA)
RA messages are sent by IPv6-enabled routers every 200 seconds to provide addressing information to IPv6-enabled hosts.
Router Solicitation (RS)
An IPv6-enabled router will also send out an RA message in response to an RS message.
Neighbor Solicitation (NS)
To check the uniqueness of an address, the device will send an NS message with its own IPv6 address as the targeted IPv6 address
If another device on the network has this address, it will respond with an NA message. This NA message will notify the sending device that the address is in use.
Neighbor Advertisement (NA)
To determine the MAC address for the destination, the device will send an NS message to the solicited node address.
The device that has the targeted IPv6 address will respond with an NA message containing its Ethernet MAC address.
13.2 — Ping and Traceroute Test
13.2.1 — Ping — Test Connectivity
To test connectivity to another host on a network, an echo request is sent to the host address using the ping command. Ping provides feedback on the time between when the request was sent and when the reply was received.
Ping has a timeout value for the reply.
It is common for the first ping to timeout if address resolution (ARP or ND) needs to be performed before sending the ICMP Echo Request.
The ping utility provides a summary that includes the success rate and average round-trip time to the destination.
Type of connectivity tests performed with ping include the following:
- Pinging the local loopback
- Pinging the default gateway
- Pinging the remote host
13.2.2 — Ping Loopback
To perform this test, ping the local loopback address of 127.0.0.1 for IPv4 (::1 for IPv6).
A response from 127.0.0.1 for IPv4, or ::1 for IPv6, indicates that IP is properly installed on the host.
This simply tests IP down through the network layer of IP. An error message indicates that TCP/IP is not operational on the host.
13.2.3 — Ping the Default Gateway
A successful ping to the default gateway indicates that the host and the router interface serving as the default gateway are both operational on the local network.
13.2.4 — Ping a Remote Host
A successful ping across the internetwork confirms communication on the local network, the operation of the router serving as the default gateway, and the operation of all other routers that might be in the path between the local network and the network of the remote host.
Many network administrators limit or prohibit the entry of ICMP messages into the corporate network; therefore, the lack of a ping response could be due to security restrictions.
13.2.5 — Traceroute — Test the Path
Traceroute (tracert) is a utility that generates a list of hops that were successfully reached along the path. This list can provide important verification and troubleshooting information.
Round Trip Time (RTT)
The round-trip time is the time a packet takes to reach the remote host and for the response from the host to return. An asterisk (*) is used to indicate a lost or unreplied packet.
IPv4 TTL and IPv6 Hop Limit
Traceroute makes use of a function of the TTL field in IPv4 and the Hop Limit field in IPv6 in the Layer 3 headers, along with the ICMP Time Exceeded message.
References: