
RFC draft
Network Working Group                                         A.Eromenko
Category: Proposed Standard                                December 2015



                   INTERNET CONTROL MESSAGE PROTOCOL v5
             (Internet Protocol "Five Fields", aka IPFF-ICMPv5)

                         PROTOCOL SPECIFICATION draft


Summary of Message Types

  128  Echo Request
  129  Echo Reply

Error messages:
    1  Destination Unreachable
    2  Packet Too Big
    3  Hops Exceeded
    4  Parameter Problem
    5  Redirect

Introduction

   The Internet Protocol (IP) is used for host-to-host packet
   service in a system of interconnected networks called the
   Internet.  The network connecting devices are called Routers.
   These routers communicate between themselves for control purposes
   via various routing protocols.  Occasionally a
   router or destination host will communicate with a source host, for
   example, to report an error in packet processing.  For such
   purposes this protocol, the Internet Control Message Protocol (ICMP),
   is used.  ICMP, uses the basic support of IP as if it were a higher
   level protocol, however, ICMP is actually an integral part of IP, and
   must be implemented by every IP module.

   ICMP messages are sent in several situations:  for example, when a
   packet cannot reach its destination, when the router does not have
   the buffering capacity to forward a packet, and when the router
   can direct the host to send traffic on a shorter route.

   The Internet Protocol is not designed to be absolutely reliable.  The
   purpose of these control messages is to provide feedback about
   problems in the communication environment, not to make IP reliable.
   There are still no guarantees that a packet will be delivered or a
   control message will be returned.  Some packets may still be
   undelivered without any report of their loss.  The higher level
   protocols that use IP must implement their own reliability procedures
   if reliable communication is required.

   The ICMP messages typically report errors in the processing of
   packets.  To avoid the infinite regress of messages about messages
   etc., no ICMP error messages are sent about ICMP error messages.


Message Formats

   ICMP messages are sent using the basic IP header.  The first octet of
   the data portion of the packet is a ICMP type field; the value of
   this field determines the format of the remaining data.  Any field
   labeled "unused" is reserved for later extensions and must be zero
   when sent, but receivers should not use these fields (except to
   include them in the checksum).  Unless otherwise noted under the
   individual format descriptions, the values of the internet header
   fields are as follows:

   Version

      5

   Type of Service

      0

   Payload Length

      Length of this ICMP header.

   Hops to Live

      Hops to live; as this field is decremented at each
      machine in which the packet is processed, the value in this
      field should be at least as great as the number of routers which
      this packet will traverse.

   Protocol

      ICMP = 1

   Header Checksum

      The 16 bit one's complement of the one's complement sum of all 16
      bit words in the header.  For computing the checksum, the checksum
      field should be zero.

   Source Address

      The address of the router or host that composes the ICMP message.
      Unless otherwise noted, this can be any of a router's addresses.

   Destination Address

      The address of the router or host to which the message should be
      sent.




Destination Unreachable Message

   Description

      If, according to the information in the router's routing tables,
      the network specified in the internet destination field of a
      packet is unreachable, e.g., the distance to the network is
      infinity, the router may send a destination unreachable message
      to the internet source host of the packet.  In addition, in some
      networks, the router may be able to determine if the internet
      destination host is unreachable.  Routers in these networks may
      send destination unreachable messages to the source host when the
      destination host is unreachable.

      If, in the destination host, the IP module cannot deliver the
      packet  because the indicated protocol module or process port is
      not active, the destination host may send a destination
      unreachable message to the source host.

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type                      |          Checksum             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Code      |                    unused                     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |      Internet Header + 64 bits of Original Data Packet        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   IP Fields:

   Destination Address

      The source network and address from the original packet's data.

   ICMP Fields:

   Type

      1

   Code

      0 = net unreachable;

      1 = host unreachable;

      2 = protocol unreachable;

      3 = port unreachable;
     
      4 = VRF table unreachable;

      Codes 0, 1 and 4 may be received from a router.  
      Codes 2 and 3 may be received from a host.

   Checksum

      The checksum is the 16-bit ones's complement of the one's
      complement sum of the ICMP message starting with the ICMP Type.
      For computing the checksum , the checksum field should be zero.
      This checksum may be replaced in the future.

   Internet Header + 64 bits of Data Packet

      The internet header plus the first 64 bits of the original
      packet's data.  This data is used by the host to match the
      message to the appropriate process.  If a higher level protocol
      uses port numbers, they are assumed to be in the first 64 data
      bits of the original packet's data.


Packet Too Big Message

   Description

   A Packet Too Big MUST be sent by a router in response to a packet
   that it cannot forward because the packet is larger than the MTU of
   the outgoing link.  The information in this message is used as part
   of the Path MTU Discovery process [PMTU].

   Originating a Packet Too Big Message makes an exception to one of the
   rules as to when to originate an ICMPv5 error message.  Unlike other
   messages, it is sent in response to a packet received with an IPv5
   multicast destination address, or unicast address.

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type                      |          Checksum             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                             MTU                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |      Internet Header + 64 bits of Original Data Packet        |
   +                                                               +
   |                                                               |

   IPv5 Fields:

   Destination Address

                  Copied from the Source Address field of the invoking
                  packet.

   ICMPv5 Fields:

   Type           2

   MTU            The Maximum Transmission Unit of the next-hop link.

   Upper Layer Notification

   An incoming Packet Too Big message MUST be passed to the upper-layer
   process if the relevant process can be identified (see Section 2.4,
   (d)).



Hops Exceeded Message

   Description

      If the router processing a packet finds the hops to live field
      is zero it should discard the packet.  The router may also notify
      the source host via the hops exceeded message.

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type                      |          Checksum             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |      Internet Header + 64 bits of Original Data Packet        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   IP Fields:

   Destination Address

      The source network and address from the original packet's data.

   ICMP Fields:

   Type

      3

   Checksum

      The checksum is the 16-bit ones's complement of the one's
      complement sum of the ICMP message starting with the ICMP Type.
      For computing the checksum , the checksum field should be zero.
      This checksum may be replaced in the future.

   Internet Header + 64 bits of Data Packet

      The internet header plus the first 64 bits of the original
      packet's data.  This data is used by the host to match the
      message to the appropriate process.  If a higher level protocol
      uses port numbers, they are assumed to be in the first 64 data
      bits of the original packet's data.



Parameter Problem Message

   Description

      If the router or host processing a packet finds a problem with
      the header parameters such that it cannot complete processing the
      packet it must discard the packet.  One potential source of
      such a problem is with incorrect arguments in an option.  The
      router or host may also notify the source host via the parameter
      problem message.  This message is only sent if the error caused
      the packet to be discarded.

      The pointer identifies the octet of the original packet's header
      where the error was detected (it may be in the middle of an
      option).  For example, 1 indicates something is wrong with the
      Type of Service, and (if there are options present) 20 indicates
      something is wrong with the type code of the first option.


    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type                      |          Checksum             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Code      |    Pointer    |           unused              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |      Internet Header + 64 bits of Original Data Packet        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   IP Fields:

   Destination Address

      The source network and address from the original packet's data.

   ICMP Fields:

   Type

      4

   Code

      0 = pointer indicates the error.

      Code 0 may be received from a router or a host.

   Checksum

      The checksum is the 16-bit ones's complement of the one's
      complement sum of the ICMP message starting with the ICMP Type.
      For computing the checksum , the checksum field should be zero.
      This checksum may be replaced in the future.

   Pointer

      If code = 0, identifies the octet where an error was detected.

   Internet Header + 64 bits of Data Packet

      The internet header plus the first 64 bits of the original
      packet's data.  This data is used by the host to match the
      message to the appropriate process.  If a higher level protocol
      uses port numbers, they are assumed to be in the first 64 data
      bits of the original packet's data.



Redirect Message

   Description

      The router sends a redirect message to a host in the following
      situation.  A router, R1, receives an internet packet from a
      host on a network to which the router is attached.  The router,
      R1, checks its routing table and obtains the address of the next
      router, R2, on the route to the packet's internet destination
      network, X.  If R2 and the host identified by the source
      address of the packet are on the same network, a redirect
      message is sent to the host.  The redirect message advises the
      host to send its traffic for network X directly to router R2 as
      this is a shorter path to the destination.  The router forwards
      the original packet's data to its internet destination.

      For packets with the IP source route options and the router
      address in the destination address field, a redirect message is
      not sent even if there is a better route to the ultimate
      destination than the next address in the source route.

      NOTE: Hops-to-live (HTL) for such packets must be set to 1.
      Routers should not forward this.


    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type                      |          Checksum             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Code      |  unused   |                                   |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+                                   +
   |                    Router Internet Address                    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Reserved                  |                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
   |                    Router Hardware Address                    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |      Internet Header + 64 bits of Original Data Packet        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   IP Fields:

   Destination Address

      The source network and address of the original packet's data.

   ICMP Fields:

   Type

      5

   Code

      0 = Redirect packets for the Network.

      1 = Redirect packets for the Host.

      2 = Redirect packets for the Type of Service and Network.

      3 = Redirect packets for the Type of Service and Host.

      Codes 0, 1, 2, and 3 may be received from a router.

   Checksum

      The checksum is the 16-bit ones's complement of the one's
      complement sum of the ICMP message starting with the ICMP Type.
      For computing the checksum , the checksum field should be zero.
      This checksum may be replaced in the future.

   Router Internet Address

      Address of the router to which traffic for the network specified
      in the internet destination network field of the original
      packet's data should be sent.

   Router Hardware Address

      A MAC address of the target router, to save LARP request.
      This assumes IEEE 802.3 Ethernet or 802.11 Wi-Fi Data-Link
      Layer. For other link types, this field may be set to zero,
      and a separate address resolution required.

   Internet Header + 64 bits of Data Packet

      The internet header plus the first 64 bits of the original
      packet's data.  This data is used by the host to match the
      message to the appropriate process.  If a higher level protocol
      uses port numbers, they are assumed to be in the first 64 data
      bits of the original packet's data.





Echo or Echo Reply Message

   Description

      The data received in the echo message must be returned in the echo
      reply message. Commonly used via "ping" command to test connectivity.

      The identifier and sequence number may be used by the echo sender
      to aid in matching the replies with the echo requests.  For
      example, the identifier might be used like a port in TCP or UDP to
      identify a session, and the sequence number might be incremented
      on each echo request sent.  The echoer returns these same values
      in the echo reply.

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type                      |          Checksum             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                          Identifier                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        Sequence Number                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Data ...
   +-+-+-+-+-

   IP Fields:

   Addresses

      The address of the source in an echo message will be the
      destination of the echo reply message.  To form an echo reply
      message, the source and destination addresses are simply reversed,
      and the checksum recomputed.

   ICMP Fields:

   Type

    128 for echo message;

    129 for echo reply message.

   Checksum

      The checksum is the 16-bit ones's complement of the one's
      complement sum of the ICMP message starting with the ICMP Type.
      For computing the checksum , the checksum field should be zero.
      If the total length is odd, the received data is padded with one
      octet of zeros for computing the checksum.

   Identifier

      An identifier to aid in matching echos and replies,
      may be zero.

   Sequence Number

      A sequence number to aid in matching echos and
      replies, may be zero.

   Historical note: Identifier and Sequence Number fields were extended
      in IPv5, mainly to help with NAT traversal.

References

   ...
   
Authors' Contacts

   Alexey Eromneko
   Israel

   Skype: Fenix_NBK_
   EMail: al4321@gmail.com

   Based on the hard work of people from DARPA, whom developed ICMP 
   RFC-792 and TCP/IP.
