📄 rfc753.txt
字号:
[Page 12] PostelMarch 1979 Internet Message Protocol 3. DETAILED SPECIFICATIONThe presentation of the information in this section is difficult sinceeverything depends on everything, and since this is a linear media ithas to come in some order. In this attempt, a very brief overview ofthe message structure is given, then a radical switch is made todefining the basic building blocks, and finally using the buildingblocks to reach the overall structure again.3.1. Overview of Message Structure In general a message is composed of three parts: the identification, the command, and the document. Each part is in turn composed of message objects. The identification part is composed of a transaction number assigned by the originating MPM, and the internet host number of that MPM. The command part is composed of an operation type, an operation code, an argument list, an error list, the destination mailbox, and a stamp. The stamp is a list of the MPMs that have handled this message. The document part is composed of a header and a body. The message delivery system does not depend on the contents of the document part, but this specification does make some recommendations for the document header. The following sections define the representation of a message as a structured object composed of other objects. Objects in turn are represented using a set of basic data elements.3.2. Data Elements The data elements defined here are similar to the data structure and encoding used in NSW [18]. Each of the diagrams which follow represent a sequence of octets. Field boundaries are denoted by the "!" character, octet boundaries by the "+" character. The diagrams are presented in left to right order. Each element begins with a one octet code.Postel [Page 13] March 1979Internet Message ProtocolSpecification Code Type Representation ---- ---- -------------- +------+ 0 No Operation ! 1 ! +------+ +------+------+------+------+------ 1 Padding ! 0 ! octet count ! Data ... +------+------+------+------+------ +------+------+ 2 Boolean ! 2 ! 1/0 ! +------+------+ +------+------+------+ 3 Index ! 3 ! Data ! +------+------+------+ +------+------+------+------+------+ 4 Integer ! 4 ! Data ! +------+------+------+------+------+ +------+------+------+------+------ 5 Bit String ! 5 ! bit count ! Data ... +------+------+------+------+------ +------+------+------+------+------ 6 Text String ! 6 ! octet count ! Data ... +------+------+------+------+------ +------+------+------+------+------+------+----- 7 List ! 7 ! octet count ! item count ! Data +------+------+------+------+------+------+----- +------+------+------+------+------ 8 Proplist ! 8 ! octet count ! Data ... +------+------+------+------+------[Page 14] PostelMarch 1979 Internet Message Protocol Specification Element code 0 (NOP) is an empty data element used for padding when it is necessary. It is ignored. Element code 1 (PAD) is used to transmit large amounts of data with a message for test or padding purposes. No action is taken with this data but the count of dummy octets must be correct to indicate the next element code. Element code 2 (BOOLEAN) is a boolean data element which has the value 1 for True and 0 for False. Element code 3 (INDEX) is a 16-bit unsigned integer datum. Element code 3 occupies only 3 octets. Element code 4 (INTEGER) is a signed 32-bit integer datum. This will always occupy five octets. Representation is two's complement. Element code 5 (BITSTR) is a bit string element for binary data. The bit string is padded on the right with zeros to fill out the last octet if the bit string does not end on an octet boundary. This data type must have the bit-count in the two octet count field instead of the number of octets. Element code 6 (TEXT) is used for the representation of text. Seven bit ASCII characters are used, right justified in the octet. The high order bit in the octet is zero. Element code 7 (LIST) can be used to create structures composed of other elements. The item-count contains the number of elements which follow. Any element may be used including List itself. The octet count specifies the number of octets in the whole list. A null or empty List, one with no elements, has an item-count of zero (0).Postel [Page 15] March 1979Internet Message ProtocolSpecification Element code 8 (PROPLIST) is the Property-List element. It has the following form: +------+------+------+------+------+ ! 8 ! octet ! pair ! ! ! count ! count! +------+------+------+------+------+ +------+------+------+---------+---------+ ! name ! value ! name ! value ! repeated ! count! count ! ...! ...! +------+------+------+---------+---------+ The Property-List structure consists of a set of unordered name/value pairs. The pairs are a one octet name count and a two octet value count followed by the name and value strings. The counts specify the length in octets of the name and value strings. Each string has a length in octets which agrees with its respective count. The count of octets until the next pair in the property list is 1 + 2 + name count + value count octets. The entire Property-List is of course equal in length to the octet count of the element itself. Immediately following the octet count for the entire element is a one octet pair count field which contains the total number of name/value pairs in the Proplist.3.3. Message Objects In the composition of messages we use a set of objects such as address, or date. These objects are encoded in the basic data elements. The message objects are built of data elements. While data elements are typed, message objects are not. This is because messages are structured to the extent that only one kind of message object may occur in any position of a message structure. The following is a list of some of the objects used in messages. The object descriptions are grouped by the section of the message in which they normally occur.[Page 16] PostelMarch 1979 Internet Message Protocol Specification Identification Internet Host Number (ihn) This identifies a host in the internetwork environment. When used as a part of tid, it identifies the originating host of a message. The ihn is a 32 bit number, the higher order 8 bits identify the network, and the lower order 24 bits identify the host on that network. INTEGER Transaction Identifier (tid) This is the transaction identifier associated with a particular command. It is a list of the transaction number and the internet host number of the originating host. LIST ( tn , ihn ) Transaction Number (tn) This is a number which is uniquely associated with this transaction by the originating host. It identifies the transaction. (A transaction is a message and acknowledgment, this is discussed in more detail in later sections.) A tn must be unique for the time which the message (a request or reply) containing it could be active in the network. INDEX Command Address This is very similar to Mailbox in that it also is the "address" of a user. However, Address is intended to contain the minimum information necessary for delivery, and no more. PROPLIST ( --- ) Answer A yes (true) or no (false) answer to a question. BOOLEANPostel [Page 17] March 1979Internet Message ProtocolSpecification Arguments This is the argument to many of the operations. It consists of a List of different data types. The List will have form and data relevant with the particular operation. LIST ( --- ) Command-Type Gives the type of a command (e.g., request, reply, alarm). INDEX Error-List The error list contains information concerning an error which has occured. It is a List comprised of the two objects error-class and error-string. LIST ( error class, error string ) Error-Class A code for the class of the error. INDEX Error-String A text string explaining the error. TEXT How-Delivered A comment on the delivery of a messages, for instance a message could be delivered, forwarded, or turned over to general delivery. LIST ( TEXT )[Page 18] PostelMarch 1979 Internet Message Protocol Specification Mailbox This is the "address" of a user of the internetwork mail system. Mailbox contains information such as net, host, location, and local user-id of the recipient of the message. Some information contained in Mailbox may not be necessary for delivery. As an example, when one sends a message to someone for the first time, he may include many items which are not necessary simply to insure delivery. However, once he gets a reply to this message, the reply could contain an Address (as opposed to Mailbox) which the user will use from then on. A mailbox is a PROPLIST. A mailbox might contain the following name-value pairs: name element description ---- ------- ----------- IA INTEGER internet address NET TEXT network name HOST TEXT host name USER TEXT user name CITY TEXT city COUNTRY TEXT country STATE TEXT state ZIP TEXT zip code PHONE TEXT phone number PROPLIST ( --- ) Operation This names the operation or procedure to be performed. TEXT Options REGULAR for normal delivery, FORWARD for message forwarding, GENDEL for general delivery, or other options which may be defined later. LIST ( TEXT, ... )Postel [Page 19] March 1979Internet Message ProtocolSpecification Reasons These could be mailbox does not exist, mailbox full, etc. LIST ( TEXT ) Stamp Each MPM that handles the message must add a unique identifier (ihn, see above) to the list. This will prevent messages from being sent back and forth through the internet mail system without eventually either being delivered or returned to the sender. LIST ( ihn, ihn, ... ) Trail When a message is sent through the internetwork environment, it acquires a list of MPMs that have handled the message in "Stamp". This list is then carried as "Trail" upon reply or acknowledgment of that message. More simply, requests and replies always have a "Stamp" and each MPM adds its ihn to this "Stamp." Replies, in addition, have a "Trail" which is the complete "Stamp" of the original message. LIST ( ihn, ihn, ... ) Type The command type, e.g., request or reply. INDEX Document In this section, we define some objects useful in message document
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -