Internet Control Message Protocol (ICMP) is the protocol responsible for detecting network error conditions and reporting on them. ICMP reports on:
Dropped packets (when packets are arriving too fast to be processed)
Connectivity failure (when a destination host can't be reached)
Redirection (which tells a sending host to use another router)
Chapter 6, Troubleshooting TCP/IP, contains more information on the operating system commands that use ICMP for error detection.