home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit 2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Texts / Rfc / RFC792.TXT < prev    next >
Encoding:
Text File  |  1999-11-04  |  28.5 KB  |  1,241 lines

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