Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Internet Control Message Protocol (ICMP) is a network layer protocol that delivers flow control, error messages, routing, and other data between Internet hosts. ICMP is primarily used by application developers for a network ping, which is also known as Packet Internet Groper. A ping is the process of sending an echo message to an IP address and reading the reply to verify a connection between TCP/IP hosts.

ICMP is a maintenance protocol specified in RFC 792 and is normally considered to be part of the IP layer. ICMP messages are encapsulated within IP datagrams, so that they can be routed throughout an inter-network. ICMP is used by Windows Embedded CE to:

  • Build and maintain route tables.

  • Perform Router Discovery.

  • Assist in Path Maximum Transmission Unit (PMTU) discovery.

  • Diagnose problems (ping).

  • Adjust flow control to prevent link or router saturation.

Use the following Winsock API functions to write a ping application: IcmpCreateFile, IcmpSendEcho, and IcmpCloseHandle.

To send an ICMP request or determine if a host is available
  1. Call IcmpCreateFileto create a handle to issue requests.

  2. Call IcmpSendEchoto send an ICMP echo request.

    It returns any ICMP response from the intended host recipient, or returns an error if the network is inaccessible. A time-out value may be specified to limit the wait time in case the destination is inaccessible.

  3. Call IcmpCloseHandleto close the handle created by IcmpCreateFile.

For more information about the Winsock API, see Windows Sockets.

For information about ICMP and IPv6, see Internet Control Message Protocol for IPv6 (ICMPv6).

See Also