Clever Geek Handbook
📜 ⬆️ ⬇️

ICMP

ICMP ( Internet Control Message Protocol ) is a network protocol that is part of the TCP / IP protocol stack . Basically, ICMP is used to send error messages and other exceptional situations that occurred during data transfer, for example, the requested service is unavailable, or the host or router does not respond. Also, ICMP has some service functions.

ICMP
TitleInternet Control Message Protocol
Level ( OSI model )Network
FamilyTCP / IP
SpecificationRFC 792

Technical Details

ICMP was described in RFC 792 from 1981 by Jon Postel (with additions to RFC 950 ). ICMP is an Internet standard (part of the STD 5 standard along with IP ). Although formally the protocol uses IP (ICMP packets are encapsulated in IP packets), it is an integral part of IP and is required when implementing the TCP / IP stack . The current version of ICMP for IPv4 is called ICMPv4. In IPv6, there is a similar protocol, ICMPv6 .

An ICMP message is constructed from IP packets that generated an ICMP response. IP encapsulates the corresponding ICMP message with a new IP header (to send the ICMP message back to the sender) and forwards the received packets further.

For example, each machine (such as a router ) that forwards IP packets reduces the Time to live (TTL) of the IP header field by one; if the TTL reaches 0, an ICMP message about TTL exceeded is sent to the packet source.

ICMP is based on the IP protocol. Each ICMP message is encapsulated directly within the same IP packet, and thus, like UDP, and unlike TCP , ICMP is the so-called. “Unreliable” (not controlling delivery and its correctness). Unlike UDP, where the implementation of reliability is entrusted to application-level software, ICMP (due to the specifics of the application) usually does not need to implement reliable delivery. Its objectives are different from those of transport protocols, such as TCP and UDP: it is usually not used to transmit and receive data between end systems. ICMP is not used directly in network user applications (except for Ping and Traceroute tools ). The same Ping, for example, usually serves just to check the loss of IP packets on the route.

Using ICMP Messages

ICMP messages (type 12) are generated when errors are found in the header of the IP packet (with the exception of the ICMP packets themselves, so as not to lead to an infinitely growing stream of ICMP messages about ICMP messages).

ICMP messages (type 3) are generated by the router when there is no route to the destination.

The Ping utility, which is used to test the IP packet delivery capability, uses ICMP messages of type 8 (echo request) and 0 (echo reply).

The Traceroute utility, which displays the IP packet path, uses type 11 ICMP messages.

Type 5 ICMP messages are used by routers to update entries in the sender's routing table .

Type 4 ICMP messages are used by the receiver (or router) to control the sending speed of messages by the sender.

ICMP packet format

Octet (byte)0one23fourfive67eight9teneleven12131415sixteen1718nineteen20212223242526272829ththirty31
[0-3]Type ofCodeCheck sum
...Data (format depends on the values ​​of the "Code" and "Type" fields)
ICMP Packet Types
Type ofStatusCodeMessageData (length, bit)
00Echo reply
ID (16)Sequence Number (16)
Data (variable)
12not usedReserved
3Destination unreachable
Not used (32)
IP Header, Start of Source Datagram (64)
0Network unreachable
oneNode Unreachable
2Protocol unreachable
3Port unreachable
fourFragmentation is needed, but its prohibition flag (DF) is set
fiveInvalid route from source
6Destination network unknown
7Destination node unknown
eightSource node isolated
9The network is administratively banned
tenNode administratively denied
elevenNetwork unavailable for ToS
12Node unavailable for ToS
13Communications are administratively prohibited
14Violation of node preference order
15Actively clipping preference order
fouroutdated0Source containment (source shutdown during queue overflow)
fiveRedirection
Router Address (32)
IP Header, Start of Source Datagram (64)
0Forwarding packets to the network
oneForwarding packets to a host
2Redirection for each type of service (ToS)
3Forwarding a packet to a node for each type of service
6outdated0Alternate host address
7not usedReserved
eight0Echo request
ID (16)Sequence Number (16)
Data (variable)
90Router Announcement
Number of Addresses (8)Item Size (8)Validity (16)
Address [1] (32)
Preference [1] (32)
...
Address [N] (32)
Preference [N] (32)
ten0Router Request
Not used (32)
elevenDatagram expired
Not used (32)
IP Header, Start of Source Datagram (64)
0Package Life Time (TTL) expired during shipping
onePackage expired while assembling fragments
12Invalid parameter (problem with datagram parameters: error in IP-header or missing option)
0Pointer indicates an error
Pointer (8)Not used (24)
IP Header, Start of Source Datagram (64)
oneMissing required option
Not used (32)
IP Header, Start of Source Datagram (64)
2Incorrect length
130Timestamp Request
ID (16)Sequence Number (16)
Start Time (32)
Reception Time (32)
Dispatch Time (32)
140Timestamped Answer
15outdated0Information request
ID (16)Sequence Number (16)
sixteenoutdated0Informational answer
17outdated0Address mask request
ID (16)Sequence Number (16)
Mask (32)
18outdated0Response to an address mask request
nineteenreservedReserved (for security)
20-29reservedReserved (for error tolerance experiments)
thirtyoutdatedRoute trace
ID (16)Not used (16)
The number of hopes of the outgoing packet (16)The number of hopes of the return package (16)
Link Speed ​​(32)
MTU Communication Lines (32)
0Outgoing packet sent successfully
oneNo path for outgoing packet found, packet destroyed
31outdatedDatagram conversion error
Pointer (32)
IP header and transport protocol of the source datagram
0Unknown or unspecified error
oneUnable to convert option
2Unknown Required Option
3Unsupported Required Option
fourUnsupported Transport Protocol
fiveExceeded full length
6IP Header Length Exceeded
7The transport protocol number is greater than 255
eightOut of range port number
9Transport protocol header length exceeded
tenCross the 32-bit boundary and set the ACK bit
elevenUnknown required transport protocol option
32outdatedMobile site redirection
33outdatedIPv6 Where-Are-You
34outdatedIPv6 I-Am-Here (I'm here)
35outdatedRedirect request for mobile site
36outdatedRespond to a redirect request for a mobile site
37outdatedDomain Name Request
38outdatedResponse to a domain name request
39outdatedSKIP algorithm discovery ICMP message
40Photuris
0Reserved
oneUnknown Security Settings Index
2Security settings are correct, but authentication failed
3Security settings are correct, but decryption failed
fourAuthentication Required
fiveAuthorization required
41experimental
42-252Reserved
253-254experimentalReserved for RFC 3692 experiments
255reservedReserved

ICMP packet generation rules

  1. When an ICMP packet is lost, a new one is never generated.
  2. ICMP packets are never generated in response to IP packets with a broadcast or multicast address, so as not to cause congestion in the network (the so-called "broadcast storm").
  3. If a fragmented IP packet is damaged, the ICMP message is sent immediately after receiving the first damaged fragment, since the sender will still transmit the entire IP packet.

See also

  • ICMP tunnel

Notes

  1. ↑ ICMP

Links

  • RFC 792 (ICMPv4)
  • RFC 950 Address Mask
  • RFC 1122 (additional types of ICMP messages for existing codes)
  • RFC 1393 Traceroute
  • RFC 1256 Router Advertisement Solicitation
  • RFC 1475 Conversion Failed
  • RFC 1812 (additional types of ICMP messages for existing codes)
  • RFC 4443 (ICMPv6)
  • RFC 2463 (ICMPv6)
  • RFC 1885 (ICMPv6)
  • RFC 4884 Message Extension and Backward Compatibility
  • Imposing a False Route to a Host Using ICMP
  • ICMP attacks 01 to 05 document
Source - https://ru.wikipedia.org/w/index.php?title=ICMP&oldid=102078880


More articles:

  • Uglovsky, Mikhail Nikolaevich
  • The Iron Triangle (Vietnam)
  • North China
  • Zakirov, Farrukh Karimovich
  • Bolbelism one-horned
  • Stade de Jong, Xenia
  • Robbery
  • Franco Federico
  • Unarmed Nemerthins
  • Seaside (station)

All articles

Clever Geek | 2019