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.
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
=2= |