home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 700s / rfc792.txt < prev    next >
Text File  |  1992-10-14  |  29KB  |  1,219 lines

  1.  
  2.  
  3. Network Working Group                                          J. Postel
  4. Request for Comments:  792                                           ISI
  5.                                                           September 1981
  6. Updates:  RFCs 777, 760
  7. Updates:  IENs 109, 128
  8.  
  9.                    INTERNET CONTROL MESSAGE PROTOCOL
  10.  
  11.                          DARPA INTERNET PROGRAM
  12.                          PROTOCOL SPECIFICATION
  13.  
  14.  
  15.  
  16. Introduction
  17.  
  18.    The Internet Protocol (IP) [1] is used for host-to-host datagram
  19.    service in a system of interconnected networks called the
  20.    Catenet [2].  The network connecting devices are called Gateways.
  21.    These gateways communicate between themselves for control purposes
  22.    via a Gateway to Gateway Protocol (GGP) [3,4].  Occasionally a
  23.    gateway or destination host will communicate with a source host, for
  24.    example, to report an error in datagram processing.  For such
  25.    purposes this protocol, the Internet Control Message Protocol (ICMP),
  26.    is used.  ICMP, uses the basic support of IP as if it were a higher
  27.    level protocol, however, ICMP is actually an integral part of IP, and
  28.    must be implemented by every IP module.
  29.  
  30.    ICMP messages are sent in several situations:  for example, when a
  31.    datagram cannot reach its destination, when the gateway does not have
  32.    the buffering capacity to forward a datagram, and when the gateway
  33.    can direct the host to send traffic on a shorter route.
  34.  
  35.    The Internet Protocol is not designed to be absolutely reliable.  The
  36.    purpose of these control messages is to provide feedback about
  37.    problems in the communication environment, not to make IP reliable.
  38.    There are still no guarantees that a datagram will be delivered or a
  39.    control message will be returned.  Some datagrams may still be
  40.    undelivered without any report of their loss.  The higher level
  41.    protocols that use IP must implement their own reliability procedures
  42.    if reliable communication is required.
  43.  
  44.    The ICMP messages typically report errors in the processing of
  45.    datagrams.  To avoid the infinite regress of messages about messages
  46.    etc., no ICMP messages are sent about ICMP messages.  Also ICMP
  47.    messages are only sent about errors in handling fragment zero of
  48.    fragemented datagrams.  (Fragment zero has the fragment offeset equal
  49.    zero).
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.                                                                 [Page 1]
  58.  
  59.  
  60.                                                           September 1981
  61. RFC 792
  62.  
  63.  
  64.  
  65. Message Formats
  66.  
  67.    ICMP messages are sent using the basic IP header.  The first octet of
  68.    the data portion of the datagram is a ICMP type field; the value of
  69.    this field determines the format of the remaining data.  Any field
  70.    labeled "unused" is reserved for later extensions and must be zero
  71.    when sent, but receivers should not use these fields (except to
  72.    include them in the checksum).  Unless otherwise noted under the
  73.    individual format descriptions, the values of the internet header
  74.    fields are as follows:
  75.  
  76.    Version
  77.  
  78.       4
  79.  
  80.    IHL
  81.  
  82.       Internet header length in 32-bit words.
  83.  
  84.    Type of Service
  85.  
  86.       0
  87.  
  88.    Total Length
  89.  
  90.       Length of internet header and data in octets.
  91.  
  92.    Identification, Flags, Fragment Offset
  93.  
  94.       Used in fragmentation, see [1].
  95.  
  96.    Time to Live
  97.  
  98.       Time to live in seconds; as this field is decremented at each
  99.       machine in which the datagram is processed, the value in this
  100.       field should be at least as great as the number of gateways which
  101.       this datagram will traverse.
  102.  
  103.    Protocol
  104.  
  105.       ICMP = 1
  106.  
  107.    Header Checksum
  108.  
  109.       The 16 bit one's complement of the one's complement sum of all 16
  110.       bit words in the header.  For computing the checksum, the checksum
  111.       field should be zero.  This checksum may be replaced in the
  112.       future.
  113.  
  114.  
  115. [Page 2]                                                                
  116.  
  117.  
  118. September 1981                                                          
  119. RFC 792
  120.  
  121.  
  122.  
  123.    Source Address
  124.  
  125.       The address of the gateway or host that composes the ICMP message.
  126.       Unless otherwise noted, this can be any of a gateway's addresses.
  127.  
  128.    Destination Address
  129.  
  130.       The address of the gateway or host to which the message should be
  131.       sent.
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.                                                                 [Page 3]
  174.  
  175.  
  176.                                                           September 1981
  177. RFC 792
  178.  
  179.  
  180.  
  181. Destination Unreachable Message
  182.  
  183.     0                   1                   2                   3
  184.     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
  185.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  186.    |     Type      |     Code      |          Checksum             |
  187.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  188.    |                             unused                            |
  189.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  190.    |      Internet Header + 64 bits of Original Data Datagram      |
  191.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  192.  
  193.    IP Fields:
  194.  
  195.    Destination Address
  196.  
  197.       The source network and address from the original datagram's data.
  198.  
  199.    ICMP Fields:
  200.  
  201.    Type
  202.  
  203.       3
  204.  
  205.    Code
  206.  
  207.       0 = net unreachable;
  208.  
  209.       1 = host unreachable;
  210.  
  211.       2 = protocol unreachable;
  212.  
  213.       3 = port unreachable;
  214.  
  215.       4 = fragmentation needed and DF set;
  216.  
  217.       5 = source route failed.
  218.  
  219.    Checksum
  220.  
  221.       The checksum is the 16-bit ones's complement of the one's
  222.       complement sum of the ICMP message starting with the ICMP Type.
  223.       For computing the checksum , the checksum field should be zero.
  224.       This checksum may be replaced in the future.
  225.  
  226.    Internet Header + 64 bits of Data Datagram
  227.  
  228.       The internet header plus the first 64 bits of the original
  229.  
  230.  
  231. [Page 4]                                                                
  232.  
  233.  
  234. September 1981                                                          
  235. RFC 792
  236.  
  237.  
  238.  
  239.       datagram's data.  This data is used by the host to match the
  240.       message to the appropriate process.  If a higher level protocol
  241.       uses port numbers, they are assumed to be in the first 64 data
  242.       bits of the original datagram's data.
  243.  
  244.    Description
  245.  
  246.       If, according to the information in the gateway's routing tables,
  247.       the network specified in the internet destination field of a
  248.       datagram is unreachable, e.g., the distance to the network is
  249.       infinity, the gateway may send a destination unreachable message
  250.       to the internet source host of the datagram.  In addition, in some
  251.       networks, the gateway may be able to determine if the internet
  252.       destination host is unreachable.  Gateways in these networks may
  253.       send destination unreachable messages to the source host when the
  254.       destination host is unreachable.
  255.  
  256.       If, in the destination host, the IP module cannot deliver the
  257.       datagram  because the indicated protocol module or process port is
  258.       not active, the destination host may send a destination
  259.       unreachable message to the source host.
  260.  
  261.       Another case is when a datagram must be fragmented to be forwarded
  262.       by a gateway yet the Don't Fragment flag is on.  In this case the
  263.       gateway must discard the datagram and may return a destination
  264.       unreachable message.
  265.  
  266.       Codes 0, 1, 4, and 5 may be received from a gateway.  Codes 2 and
  267.       3 may be received from a host.
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.                                                                 [Page 5]
  290.  
  291.  
  292.                                                           September 1981
  293. RFC 792
  294.  
  295.  
  296.  
  297. Time Exceeded Message
  298.  
  299.     0                   1                   2                   3
  300.     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
  301.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  302.    |     Type      |     Code      |          Checksum             |
  303.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  304.    |                             unused                            |
  305.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  306.    |      Internet Header + 64 bits of Original Data Datagram      |
  307.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  308.  
  309.    IP Fields:
  310.  
  311.    Destination Address
  312.  
  313.       The source network and address from the original datagram's data.
  314.  
  315.    ICMP Fields:
  316.  
  317.    Type
  318.  
  319.       11
  320.  
  321.    Code
  322.  
  323.       0 = time to live exceeded in transit;
  324.  
  325.       1 = fragment reassembly time exceeded.
  326.  
  327.    Checksum
  328.  
  329.       The checksum is the 16-bit ones's complement of the one's
  330.       complement sum of the ICMP message starting with the ICMP Type.
  331.       For computing the checksum , the checksum field should be zero.
  332.       This checksum may be replaced in the future.
  333.  
  334.    Internet Header + 64 bits of Data Datagram
  335.  
  336.       The internet header plus the first 64 bits of the original
  337.       datagram's data.  This data is used by the host to match the
  338.       message to the appropriate process.  If a higher level protocol
  339.       uses port numbers, they are assumed to be in the first 64 data
  340.       bits of the original datagram's data.
  341.  
  342.    Description
  343.  
  344.       If the gateway processing a datagram finds the time to live field
  345.  
  346.  
  347. [Page 6]                                                                
  348.  
  349.  
  350. September 1981                                                          
  351. RFC 792
  352.  
  353.  
  354.  
  355.       is zero it must discard the datagram.  The gateway may also notify
  356.       the source host via the time exceeded message.
  357.  
  358.       If a host reassembling a fragmented datagram cannot complete the
  359.       reassembly due to missing fragments within its time limit it
  360.       discards the datagram, and it may send a time exceeded message.
  361.  
  362.       If fragment zero is not available then no time exceeded need be
  363.       sent at all.
  364.  
  365.       Code 0 may be received from a gateway.  Code 1 may be received
  366.       from a host.
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.                                                                 [Page 7]
  406.  
  407.  
  408.                                                           September 1981
  409. RFC 792
  410.  
  411.  
  412.  
  413. Parameter Problem Message
  414.  
  415.     0                   1                   2                   3
  416.     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
  417.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  418.    |     Type      |     Code      |          Checksum             |
  419.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  420.    |    Pointer    |                   unused                      |
  421.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  422.    |      Internet Header + 64 bits of Original Data Datagram      |
  423.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  424.  
  425.    IP Fields:
  426.  
  427.    Destination Address
  428.  
  429.       The source network and address from the original datagram's data.
  430.  
  431.    ICMP Fields:
  432.  
  433.    Type
  434.  
  435.       12
  436.  
  437.    Code
  438.  
  439.       0 = pointer indicates the error.
  440.  
  441.    Checksum
  442.  
  443.       The checksum is the 16-bit ones's complement of the one's
  444.       complement sum of the ICMP message starting with the ICMP Type.
  445.       For computing the checksum , the checksum field should be zero.
  446.       This checksum may be replaced in the future.
  447.  
  448.    Pointer
  449.  
  450.       If code = 0, identifies the octet where an error was detected.
  451.  
  452.    Internet Header + 64 bits of Data Datagram
  453.  
  454.       The internet header plus the first 64 bits of the original
  455.       datagram's data.  This data is used by the host to match the
  456.       message to the appropriate process.  If a higher level protocol
  457.       uses port numbers, they are assumed to be in the first 64 data
  458.       bits of the original datagram's data.
  459.  
  460.  
  461.  
  462.  
  463. [Page 8]                                                                
  464.  
  465.  
  466. September 1981                                                          
  467. RFC 792
  468.  
  469.  
  470.  
  471.    Description
  472.  
  473.       If the gateway or host processing a datagram finds a problem with
  474.       the header parameters such that it cannot complete processing the
  475.       datagram it must discard the datagram.  One potential source of
  476.       such a problem is with incorrect arguments in an option.  The
  477.       gateway or host may also notify the source host via the parameter
  478.       problem message.  This message is only sent if the error caused
  479.       the datagram to be discarded.
  480.  
  481.       The pointer identifies the octet of the original datagram's header
  482.       where the error was detected (it may be in the middle of an
  483.       option).  For example, 1 indicates something is wrong with the
  484.       Type of Service, and (if there are options present) 20 indicates
  485.       something is wrong with the type code of the first option.
  486.  
  487.       Code 0 may be received from a gateway or a host.
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.                                                                 [Page 9]
  522.  
  523.  
  524.                                                           September 1981
  525. RFC 792
  526.  
  527.  
  528.  
  529. Source Quench Message
  530.  
  531.     0                   1                   2                   3
  532.     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
  533.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  534.    |     Type      |     Code      |          Checksum             |
  535.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  536.    |                             unused                            |
  537.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  538.    |      Internet Header + 64 bits of Original Data Datagram      |
  539.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  540.  
  541.    IP Fields:
  542.  
  543.    Destination Address
  544.  
  545.       The source network and address of the original datagram's data.
  546.  
  547.    ICMP Fields:
  548.  
  549.    Type
  550.  
  551.       4
  552.  
  553.    Code
  554.  
  555.       0
  556.  
  557.    Checksum
  558.  
  559.       The checksum is the 16-bit ones's complement of the one's
  560.       complement sum of the ICMP message starting with the ICMP Type.
  561.       For computing the checksum , the checksum field should be zero.
  562.       This checksum may be replaced in the future.
  563.  
  564.    Internet Header + 64 bits of Data Datagram
  565.  
  566.       The internet header plus the first 64 bits of the original
  567.       datagram's data.  This data is used by the host to match the
  568.       message to the appropriate process.  If a higher level protocol
  569.       uses port numbers, they are assumed to be in the first 64 data
  570.       bits of the original datagram's data.
  571.  
  572.    Description
  573.  
  574.       A gateway may discard internet datagrams if it does not have the
  575.       buffer space needed to queue the datagrams for output to the next
  576.       network on the route to the destination network.  If a gateway
  577.  
  578.  
  579. [Page 10]                                                               
  580.  
  581.  
  582. September 1981                                                          
  583. RFC 792
  584.  
  585.  
  586.  
  587.       discards a datagram, it may send a source quench message to the
  588.       internet source host of the datagram.  A destination host may also
  589.       send a source quench message if datagrams arrive too fast to be
  590.       processed.  The source quench message is a request to the host to
  591.       cut back the rate at which it is sending traffic to the internet
  592.       destination.  The gateway may send a source quench message for
  593.       every message that it discards.  On receipt of a source quench
  594.       message, the source host should cut back the rate at which it is
  595.       sending traffic to the specified destination until it no longer
  596.       receives source quench messages from the gateway.  The source host
  597.       can then gradually increase the rate at which it sends traffic to
  598.       the destination until it again receives source quench messages.
  599.  
  600.       The gateway or host may send the source quench message when it
  601.       approaches its capacity limit rather than waiting until the
  602.       capacity is exceeded.  This means that the data datagram which
  603.       triggered the source quench message may be delivered.
  604.  
  605.       Code 0 may be received from a gateway or a host.
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.                                                                [Page 11]
  638.  
  639.  
  640.                                                           September 1981
  641. RFC 792
  642.  
  643.  
  644.  
  645. Redirect Message
  646.  
  647.     0                   1                   2                   3
  648.     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
  649.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  650.    |     Type      |     Code      |          Checksum             |
  651.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  652.    |                 Gateway Internet Address                      |
  653.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  654.    |      Internet Header + 64 bits of Original Data Datagram      |
  655.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  656.  
  657.    IP Fields:
  658.  
  659.    Destination Address
  660.  
  661.       The source network and address of the original datagram's data.
  662.  
  663.    ICMP Fields:
  664.  
  665.    Type
  666.  
  667.       5
  668.  
  669.    Code
  670.  
  671.       0 = Redirect datagrams for the Network.
  672.  
  673.       1 = Redirect datagrams for the Host.
  674.  
  675.       2 = Redirect datagrams for the Type of Service and Network.
  676.  
  677.       3 = Redirect datagrams for the Type of Service and Host.
  678.  
  679.    Checksum
  680.  
  681.       The checksum is the 16-bit ones's complement of the one's
  682.       complement sum of the ICMP message starting with the ICMP Type.
  683.       For computing the checksum , the checksum field should be zero.
  684.       This checksum may be replaced in the future.
  685.  
  686.    Gateway Internet Address
  687.  
  688.       Address of the gateway to which traffic for the network specified
  689.       in the internet destination network field of the original
  690.       datagram's data should be sent.
  691.  
  692.  
  693.  
  694.  
  695. [Page 12]                                                               
  696.  
  697.  
  698. September 1981                                                          
  699. RFC 792
  700.  
  701.  
  702.  
  703.    Internet Header + 64 bits of Data Datagram
  704.  
  705.       The internet header plus the first 64 bits of the original
  706.       datagram's data.  This data is used by the host to match the
  707.       message to the appropriate process.  If a higher level protocol
  708.       uses port numbers, they are assumed to be in the first 64 data
  709.       bits of the original datagram's data.
  710.  
  711.    Description
  712.  
  713.       The gateway sends a redirect message to a host in the following
  714.       situation.  A gateway, G1, receives an internet datagram from a
  715.       host on a network to which the gateway is attached.  The gateway,
  716.       G1, checks its routing table and obtains the address of the next
  717.       gateway, G2, on the route to the datagram's internet destination
  718.       network, X.  If G2 and the host identified by the internet source
  719.       address of the datagram are on the same network, a redirect
  720.       message is sent to the host.  The redirect message advises the
  721.       host to send its traffic for network X directly to gateway G2 as
  722.       this is a shorter path to the destination.  The gateway forwards
  723.       the original datagram's data to its internet destination.
  724.  
  725.       For datagrams with the IP source route options and the gateway
  726.       address in the destination address field, a redirect message is
  727.       not sent even if there is a better route to the ultimate
  728.       destination than the next address in the source route.
  729.  
  730.       Codes 0, 1, 2, and 3 may be received from a gateway.
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.                                                                [Page 13]
  754.  
  755.  
  756.                                                           September 1981
  757. RFC 792
  758.  
  759.  
  760.  
  761. Echo or Echo Reply Message
  762.  
  763.     0                   1                   2                   3
  764.     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
  765.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  766.    |     Type      |     Code      |          Checksum             |
  767.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  768.    |           Identifier          |        Sequence Number        |
  769.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  770.    |     Data ...
  771.    +-+-+-+-+-
  772.  
  773.    IP Fields:
  774.  
  775.    Addresses
  776.  
  777.       The address of the source in an echo message will be the
  778.       destination of the echo reply message.  To form an echo reply
  779.       message, the source and destination addresses are simply reversed,
  780.       the type code changed to 0, and the checksum recomputed.
  781.  
  782.    IP Fields:
  783.  
  784.    Type
  785.  
  786.       8 for echo message;
  787.  
  788.       0 for echo reply message.
  789.  
  790.    Code
  791.  
  792.       0
  793.  
  794.    Checksum
  795.  
  796.       The checksum is the 16-bit ones's complement of the one's
  797.       complement sum of the ICMP message starting with the ICMP Type.
  798.       For computing the checksum , the checksum field should be zero.
  799.       If the total length is odd, the received data is padded with one
  800.       octet of zeros for computing the checksum.  This checksum may be
  801.       replaced in the future.
  802.  
  803.    Identifier
  804.  
  805.       If code = 0, an identifier to aid in matching echos and replies,
  806.       may be zero.
  807.  
  808.    Sequence Number
  809.  
  810.  
  811. [Page 14]                                                               
  812.  
  813.  
  814. September 1981                                                          
  815. RFC 792
  816.  
  817.  
  818.  
  819.       If code = 0, a sequence number to aid in matching echos and
  820.       replies, may be zero.
  821.  
  822.    Description
  823.  
  824.       The data received in the echo message must be returned in the echo
  825.       reply message.
  826.  
  827.       The identifier and sequence number may be used by the echo sender
  828.       to aid in matching the replies with the echo requests.  For
  829.       example, the identifier might be used like a port in TCP or UDP to
  830.       identify a session, and the sequence number might be incremented
  831.       on each echo request sent.  The echoer returns these same values
  832.       in the echo reply.
  833.  
  834.       Code 0 may be received from a gateway or a host.
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.                                                                [Page 15]
  870.  
  871.  
  872.                                                           September 1981
  873. RFC 792
  874.  
  875.  
  876.  
  877. Timestamp or Timestamp Reply Message
  878.  
  879.     0                   1                   2                   3
  880.     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
  881.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  882.    |     Type      |      Code     |          Checksum             |
  883.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  884.    |           Identifier          |        Sequence Number        |
  885.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  886.    |     Originate Timestamp                                       |
  887.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  888.    |     Receive Timestamp                                         |
  889.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  890.    |     Transmit Timestamp                                        |
  891.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  892.  
  893.    IP Fields:
  894.  
  895.    Addresses
  896.  
  897.       The address of the source in a timestamp message will be the
  898.       destination of the timestamp reply message.  To form a timestamp
  899.       reply message, the source and destination addresses are simply
  900.       reversed, the type code changed to 14, and the checksum
  901.       recomputed.
  902.  
  903.    IP Fields:
  904.  
  905.    Type
  906.  
  907.       13 for timestamp message;
  908.  
  909.       14 for timestamp reply message.
  910.  
  911.    Code
  912.  
  913.       0
  914.  
  915.    Checksum
  916.  
  917.       The checksum is the 16-bit ones's complement of the one's
  918.       complement sum of the ICMP message starting with the ICMP Type.
  919.       For computing the checksum , the checksum field should be zero.
  920.       This checksum may be replaced in the future.
  921.  
  922.    Identifier
  923.  
  924.  
  925.  
  926.  
  927. [Page 16]                                                               
  928.  
  929.  
  930. September 1981                                                          
  931. RFC 792
  932.  
  933.  
  934.  
  935.       If code = 0, an identifier to aid in matching timestamp and
  936.       replies, may be zero.
  937.  
  938.    Sequence Number
  939.  
  940.       If code = 0, a sequence number to aid in matching timestamp and
  941.       replies, may be zero.
  942.  
  943.    Description
  944.  
  945.       The data received (a timestamp) in the message is returned in the
  946.       reply together with an additional timestamp.  The timestamp is 32
  947.       bits of milliseconds since midnight UT.  One use of these
  948.       timestamps is described by Mills [5].
  949.  
  950.       The Originate Timestamp is the time the sender last touched the
  951.       message before sending it, the Receive Timestamp is the time the
  952.       echoer first touched it on receipt, and the Transmit Timestamp is
  953.       the time the echoer last touched the message on sending it.
  954.  
  955.       If the time is not available in miliseconds or cannot be provided
  956.       with respect to midnight UT then any time can be inserted in a
  957.       timestamp provided the high order bit of the timestamp is also set
  958.       to indicate this non-standard value.
  959.  
  960.       The identifier and sequence number may be used by the echo sender
  961.       to aid in matching the replies with the requests.  For example,
  962.       the identifier might be used like a port in TCP or UDP to identify
  963.       a session, and the sequence number might be incremented on each
  964.       request sent.  The destination returns these same values in the
  965.       reply.
  966.  
  967.       Code 0 may be received from a gateway or a host.
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.                                                                [Page 17]
  986.  
  987.  
  988.                                                           September 1981
  989. RFC 792
  990.  
  991.  
  992.  
  993. Information Request or Information Reply Message
  994.  
  995.     0                   1                   2                   3
  996.     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
  997.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  998.    |     Type      |      Code     |          Checksum             |
  999.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1000.    |           Identifier          |        Sequence Number        |
  1001.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1002.  
  1003.    IP Fields:
  1004.  
  1005.    Addresses
  1006.  
  1007.       The address of the source in a information request message will be
  1008.       the destination of the information reply message.  To form a
  1009.       information reply message, the source and destination addresses
  1010.       are simply reversed, the type code changed to 16, and the checksum
  1011.       recomputed.
  1012.  
  1013.    IP Fields:
  1014.  
  1015.    Type
  1016.  
  1017.       15 for information request message;
  1018.  
  1019.       16 for information reply message.
  1020.  
  1021.    Code
  1022.  
  1023.       0
  1024.  
  1025.    Checksum
  1026.  
  1027.       The checksum is the 16-bit ones's complement of the one's
  1028.       complement sum of the ICMP message starting with the ICMP Type.
  1029.       For computing the checksum , the checksum field should be zero.
  1030.       This checksum may be replaced in the future.
  1031.  
  1032.    Identifier
  1033.  
  1034.       If code = 0, an identifier to aid in matching request and replies,
  1035.       may be zero.
  1036.  
  1037.    Sequence Number
  1038.  
  1039.       If code = 0, a sequence number to aid in matching request and
  1040.       replies, may be zero.
  1041.  
  1042.  
  1043. [Page 18]                                                               
  1044.  
  1045.  
  1046. September 1981                                                          
  1047. RFC 792
  1048.  
  1049.  
  1050.  
  1051.    Description
  1052.  
  1053.       This message may be sent with the source network in the IP header
  1054.       source and destination address fields zero (which means "this"
  1055.       network).  The replying IP module should send the reply with the
  1056.       addresses fully specified.  This message is a way for a host to
  1057.       find out the number of the network it is on.
  1058.  
  1059.       The identifier and sequence number may be used by the echo sender
  1060.       to aid in matching the replies with the requests.  For example,
  1061.       the identifier might be used like a port in TCP or UDP to identify
  1062.       a session, and the sequence number might be incremented on each
  1063.       request sent.  The destination returns these same values in the
  1064.       reply.
  1065.  
  1066.       Code 0 may be received from a gateway or a host.
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.                                                                [Page 19]
  1102.  
  1103.  
  1104.                                                           September 1981
  1105. RFC 792
  1106.  
  1107.  
  1108.  
  1109. Summary of Message Types
  1110.  
  1111.     0  Echo Reply
  1112.  
  1113.     3  Destination Unreachable
  1114.  
  1115.     4  Source Quench
  1116.  
  1117.     5  Redirect
  1118.  
  1119.     8  Echo
  1120.  
  1121.    11  Time Exceeded
  1122.  
  1123.    12  Parameter Problem
  1124.  
  1125.    13  Timestamp
  1126.  
  1127.    14  Timestamp Reply
  1128.  
  1129.    15  Information Request
  1130.  
  1131.    16  Information Reply
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159. [Page 20]                                                               
  1160.  
  1161.  
  1162. September 1981                                                          
  1163. RFC 792
  1164.  
  1165.  
  1166.  
  1167. References
  1168.  
  1169.    [1]  Postel, J. (ed.), "Internet Protocol - DARPA Internet Program
  1170.          Protocol Specification," RFC 791, USC/Information Sciences
  1171.          Institute, September 1981.
  1172.  
  1173.    [2]   Cerf, V., "The Catenet Model for Internetworking," IEN 48,
  1174.          Information Processing Techniques Office, Defense Advanced
  1175.          Research Projects Agency, July 1978.
  1176.  
  1177.    [3]   Strazisar, V., "Gateway Routing:  An Implementation
  1178.          Specification", IEN 30, Bolt Beranek and Newman, April 1979.
  1179.  
  1180.    [4]   Strazisar, V., "How to Build a Gateway", IEN 109, Bolt Beranek
  1181.          and Newman, August 1979.
  1182.  
  1183.    [5]   Mills, D., "DCNET Internet Clock Service," RFC 778, COMSAT
  1184.          Laboratories, April 1981.
  1185.  
  1186.    
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.                                                                [Page 21]
  1218.  
  1219.