rfc2186.txt

来自「RFC 的详细文档!」· 文本 代码 · 共 508 行 · 第 1/2 页

TXT
508
字号






Network Working Group                                         D. Wessels
Request for Comments: 2186                                     K. Claffy
Category: Informational                  National Laboratory for Applied
                                                   Network Research/UCSD
                                                          September 1997

                Internet Cache Protocol (ICP), version 2

Status of this Memo

   This memo provides information for the Internet community.  This memo
   does not specify an Internet standard of any kind.  Distribution of
   this memo is unlimited.

Abstract

   This document describes version 2 of the Internet Cache Protocol
   (ICPv2) as currently implemented in two World-Wide Web proxy cache
   packages[3,5].  ICP is a lightweight message format used for
   communicating among Web caches.  ICP is used to exchange hints about
   the existence of URLs in neighbor caches.  Caches exchange ICP
   queries and replies to gather information to use in selecting the
   most appropriate location from which to retrieve an object.

   This document describes only the format and fields of ICP messages.
   A companion document (RFC2187) describes the application of ICP to
   Web caches.  Several independent caching implementations now use ICP,
   and we consider it important to codify the existing practical uses of
   ICP for those trying to implement, deploy, and extend its use for
   their own purposes.

1.  Introduction

   ICP is a message format used for communicating between Web caches.
   Although Web caches use HTTP[1] for the transfer of object data,
   caches benefit from a simpler, lighter communication protocol.  ICP
   is primarily used in a cache mesh to locate specific Web objects in
   neighboring caches.  One cache sends an ICP query to its neighbors.
   The neighbors send back ICP replies indicating a "HIT" or a "MISS."












Wessels & Claffy             Informational                      [Page 1]

RFC 2186                          ICP                     September 1997


   In current practice, ICP is implemented on top of UDP, but there is
   no requirement that it be limited to UDP.  We feel that ICP over UDP
   offers features important to Web caching applications.  An ICP
   query/reply exchange needs to occur quickly, typically within a
   second or two.  A cache cannot wait longer than that before beginning
   to retrieve an object.  Failure to receive a reply message most
   likely means the network path is either congested or broken.  In
   either case we would not want to select that neighbor.  As an
   indication of immediate network conditions between neighbor caches,
   ICP over a lightweight protocol such as UDP is better than one with
   the overhead of TCP.

   In addition to its use as an object location protocol, ICP messages
   can be used for cache selection.  Failure to receive a reply from a
   cache may indicate a network or system failure.  The ICP reply may
   include information that could assist selection of the most
   appropriate source from which to retrieve an object.

   ICP was initially developed by Peter Danzig, et. al.  at the
   University of Southern California as a central part of hierarchical
   caching in the Harvest research project[3].

ICP Message Format

   The ICP message format consists of a 20-octet fixed header plus a
   variable sized payload (see Figure 1).

   NOTE: All fields must be represented in network byte order.

   Opcode
      One of the opcodes defined below.

   Version
      The ICP protocol version number.  At the time of this writing,
      both versions two and three are in use.  This document describes
      only version two.  The version number field allows for future
      development of this protocol.














Wessels & Claffy             Informational                      [Page 2]

RFC 2186                          ICP                     September 1997


   Message Length

     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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Opcode    |    Version    |         Message Length        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                         Request Number                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                            Options                            |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                          Option Data                          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                       Sender Host Address                     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |                            Payload                            |
   /                                                               /
   /                                                               /
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     FIGURE 1: ICP message format.

      The total length (octets) of the ICP message.  ICP messages MUST
      not exceed 16,384 octets in length.

   Request Number
      An opaque identifier.  When responding to a query, this value must
      be copied into the reply message.

   Options
      A 32-bit field of option flags that allows extension of this
      version of the protocol in certain, limited ways.  See "ICP Option
      Flags" below.

   Option Data
      A four-octet field to support optional features.  The following
      ICP features make use of this field:

      The ICP_FLAG_SRC_RTT option uses the low 16-bits of Option Data to
      return RTT measurements.  The ICP_FLAG_SRC_RTT option is further
      described below.








Wessels & Claffy             Informational                      [Page 3]

RFC 2186                          ICP                     September 1997


   Sender Host Address
      The IPv4 address of the host sending the ICP message.  This field
      should probably not be trusted over what is  provided by getpeer-
      name(), accept(), and recvfrom().  There is some ambiguity over
      the original purpose of this field.  In practice it is not used.

   Payload
      The contents of the Payload field vary depending on the Opcode,
      but most often it contains a null-terminated URL string.

2.  ICP Opcodes

   The following table shows currently defined ICP opcodes:

   Value    Name
   -----    -----------------
       0    ICP_OP_INVALID
       1    ICP_OP_QUERY
       2    ICP_OP_HIT
       3    ICP_OP_MISS
       4    ICP_OP_ERR
     5-9    UNUSED
      10    ICP_OP_SECHO
      11    ICP_OP_DECHO
   12-20    UNUSED
      21    ICP_OP_MISS_NOFETCH
      22    ICP_OP_DENIED
      23    ICP_OP_HIT_OBJ

   ICP_OP_INVALID
      A place holder to detect zero-filled or malformed messages.  A
      cache must never intentionally send an ICP_OP_INVALID message.
      ICP_OP_ERR should be used instead.

   ICP_OP_QUERY
      A query message.  NOTE this opcode has a different payload format
      than most of the others.  First is the requester's IPv4 address,
      followed by a URL.  The Requester Host Address is not that of the
      cache generating the ICP message, but rather the address of the
      caches's client that originated the request.  The Requester Host
      Address is often zero filled.  An ICP message with an all-zero
      Requester Host Address address should be taken as one where the
      requester address is not specified; it does not indicate a valid
      IPv4 address.







Wessels & Claffy             Informational                      [Page 4]

RFC 2186                          ICP                     September 1997


      ICP_OP_QUERY payload format:

        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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                     Requester Host Address                    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                                                               |
      /                       Null-Terminated URL                     /
      /                                                               /
      |                                                               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      In response to an ICP_OP_QUERY, the recipient must return one of:
      ICP_OP_HIT, ICP_OP_MISS, ICP_OP_ERR, ICP_OP_MISS_NOFETCH,
      ICP_OP_DENIED, or ICP_OP_HIT_OBJ.

   ICP_OP_SECHO
      Similar to ICP_OP_QUERY, but for use in simulating a query to an
      origin server.  When ICP is used to select the closest neighbor,
      the origin server can be included in the algorithm by bouncing an
      ICP_OP_SECHO message off it's echo port.  The payload is simply
      the null-terminated URL.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?