⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc713.txt

📁 著名的RFC文档,其中有一些文档是已经翻译成中文的的.
💻 TXT
📖 第 1 页 / 共 3 页
字号:
items.In all cases, a data object begins with a single byte,which will be termed the TYPE-BYTE, a field of whichcontains the type code of the object.  The following bytes,if any, are interpreted according to the type involved.VI.1 -- Presentation ConventationsIn discussing formats of bytes, the followingconventions will be employed.  The individual bits of a bytewill be referenced by using capital letters from A to H,where A signifies the highest order bit, and H the lowest.The entire eight bit value, for example, could be referredto as ABCDEFGH.  Similarly, subfields of the byte will beidentified by such sequences.  The CDEF field specifies themiddle four bits of a byte.In referring to values of fields, binary format will beused, and small letters near the end of the alphabet will beused to identify particular bits for discussion.  Forexample, we might say that the BCD field of a byte containsa specifier for some type, and define its value to beBCD=11z.  In discussions of the specifier usage, we couldrefer to the cases where z=l and where z=0, as shorthandnotation to identify BCD=111 and BCD=110, respectively.V1.2 -- Type-Byte Bit AssignmentTo assist in understanding the assignment of thevarious type-byte values, the table and graph below areincluded, showing representations of the eight bits.                               -8-OXXXXXXX -- CHAR7 (CHARacter, 7 bit)10XXXXXX -- SINTEGER (Small INTEGER)l10XXXXX -- NON-ATOM (NON-ATOMic objects)11100XXX -- LINTEGER (Large INTEGER)11101XXX -- reserved11110XXX -- SBITSTR (Short BIT STReam)111110XX -- XTRA (eXTRA single-byte objects)1111110X -- BOOL (BOOLean)11111110 -- EMPTY (EMPTY data item)11111111 -- PADDING (unused byte)In each case, the bits identified by X's are used tocontain information specific to the type involved.  Theseare explained when each type is defined.An equivalent tree representation follows, for thosewho prefer it.start with high order bit | | | 0-----0-----0-----0-----0-----0-----0-----0-----X |     |     |     |     |     |     |     |   PADDING0|    0|    0|    0|    0|    0|    0|    0| |     |     |     |     |     |     |     | X     |     X     |     X     |     X     XCHAR7  | NON-ATOM  |    BITS   |   BOOL   EMPTY (7)   |   (5)     |    (3)    |   (1)       |        0| |           |   SINTEGER        |          XTRA      (6)          |           (2)               LINTEGER                  (3)        Type-Byte Bit Assignment SchemeThis picture is interpreted by entering at the top, andtaking the appropriate branch at each node to correspond tothe next bit of the type-byte, as it is scanned from left toright.  When a type is assigned, the branch terminates withan "X' and the name of the type of the object, with thenumber of remaining bits in parentheses.  The individualobject definitions specify how these bits are used for thatparticular type.V1.3 -- Atomic ObjectsAtomic objects are identified by specific patterns in atype-byte.  Receiving servers must be capable of recognizing                               -9-and handling all atomic types, since the size of the objectis not explicitly present in a uniform fashion.================================| Atomic Object: B-CHAR7       |================================The b-CHAR7 (CHARacter 7 bit) object is introduced tohandle transmission of characters, in 7-bit ASCII format.Since the vast majority of message-related data involvessuch objects, they are designed to be very efficient intransmission.  Other formats, such as eight bit values, canbe introduced as non-atomic objects.  The format of a b-CHAR7follows:A=0 identifying the b-CHAR7 data typeBCDEFGH=tuvwxyz containing the charactercodeThe tuvwxyz objects contain the ASCII code of thecharacter.  For example, transmission of a "space' (ASCIIcode 32, 40 octal) would be accomplished by the followingbyte.00100000ABCDEFGHA=0 to identify this byte as a b-CHAR7.  The remainingbits contain the 7 bit code, octal 40, for space.A b-CHAR7 standing alone is presented as a p-CHAR.Such occurrences will probably be rare if they are used atall.  The most common use of b-CHAR7's is as elements ofb-USTRUCs used to transmit p-STRINGS, as explained later.=============================| Atomic Object: B-SINTEGER |=============================The b-SINTEGER (Small INTEGER) object is used totransmit very small positive integers, of values up to 64.It always translates to an p-INT, and any p-INT between 0and 63 may be encoded as a b-SINTEGER for transmission.  Theformat of an b-SINTEGER follows.AB=10 identifying the object as a b-SINTEGERCDEFGH=uvwxyz containing the actual numberFor example, to transmit the integer 10 (12 octal), thefollowing byte would be transmitted:10001010ABCDEFGH                               -10-AB=10 to specify a b-SINTEGER.  The remaining six bitscontain the number 10 expressed in binary.=============================| Atomic Object: B-SINTEGER |=============================The b-SINTEGER (Large INTEGER) object is used totransmit p-INTs to any precision up to 64 bits.  It isalways translated as a p-INT.  Sending servers are permittedto choose either b-SINTEGER or b-SINTEGER format fortransmission of numbers, as appropriate.  When possible,b-SINTEGERs can be used for better channel efficiency.  Theformat of a b-SINTEGER follows:ABCDE=11100 specifying that this is a b-SINTEGER.FGH=xyz containing a count of number of bytes to follow.The xyz bits are interpreted as a number of bytes tofollow which contain the actual binary code of the theinteger in 2's complement format.  Since a zero-byte integeris disallowed, the pattern xyz=000 is interpreted as 1000,specifying that 8 bytes follow.  The number is transmittedwith high-order bits first.  This format permitstransmission of integers as large as 64 bits in magnitude.For example, if the number 4096 (10000 octal) is to betransmitted, the following sequence of bytes would be sent:11100010 00010000 00000000ABCDEFGH ---actual data---ABCDE=11100, identifying this as a b-LINTEGER, E=0,specifying a positive number, and FGH=010, specifying that 2bytes follow, containing the actual binary number.============================| Atomic Object: B-SBITSTR |============================The b-SBITSTR (Short BIT STReam) object is used totransmit a p-BITS of length 63 or less.  For longer bitstreams, the non-atomic object b-LBITSTR may be used.  Theformat of a b-SBITSTR follows.ABCDE=11110 specifying the type as b-SBITSTRFGH=xyz specifying the number of bytesfollowing.                               -11-The xyz value specifies the number of additional bytesto be read to obtain the bit stream values.  As in the caseof b-SINTEGER, the value xyz=000 is interpreted as 1000,specifying that 8 bytes follow.To avoid requiring specification of exactly the numberof bits contained, the following convention is used.  Thefirst data byte is scanned from left to right until thefirst 1 bit is encountered.  The bit stream is defined tobegin with the immediately following bit, and run throughthe last bit of the last byte read.  In other words, the bitstream is 'right-adjusted' in the collected bytes, with itsleft end delimited by the first "on' bit.For example, to send the bit stream *001010011* (9bits), the following bytes are transmitted.11110010 00000010 01010011ABCDEhij klmnopqr stuvwxyzThe hij=010 value specifies that two bytes follow.  Theq bit, which is the first 1 bit encountered, identifies thestart of the bit stream as being the r bit.  The rstuvwxyzbits are the bit stream being handled.=========================| Atomic Object: b-BOOL |=========================The b-BOOL (BOOLean) object is used to transmitp-BOOLs.  The format of b-BOOL objects follows.ABCDEFG=1111110 specifying the type asb-BOOLH=z specifying the valueThe two possible translations of a b-BOOL are *FALSE*and *TRUE*.11111100 represents *FALSE*11111101 represents *TRUE*ABCDEFGzif z=0, the value is FALSE, otherwise TRUE.========================================| Atomic Object: B-EMPTY |========================================The b-EMPTY object type is used to transmit a 'null'object, i.e. an *EMPTY*.  The format of an b-EMPTY follows.ABCDEFGH=11111110 specifying *EMPTY*                                -12-=========================| Atomic Object: B-XTRA |=========================The b-XTRA objects are used to carry the four possiblep-XTRA items, i.e., *XTRA0*, *XTRA1*, *XTRA2*, and *XTRA3*.These four items correspond to the binary coding of theremaining two bits after the b-XTRA type code bits.  Theformat of a b-XTRA follows.ABCDEF=111110 to specify the type b-XTRAGH=yz to identify the particular p-XTRA itemcarriedThe GH bits of the byte are decoded to produce aparticular p-XTRA item, as follows.GH=00 -- *XTRA0*GH=01 -- *XTRA1*GH=10 -- *XTRA2*GH=11 -- *XTRA3*The b-XTRA object is included to provide the use ofseveral single-byte data items to higher levels.  Theseitems may be assigned by individual applications to improvethe efficiency of transmission of several very frequent dataitems.  For example, the message services protocols will usethese items to convey positive and negative acknowledgments,two very common items in every interaction.========================================| Atomic Object: B-PADDING========================================This object is anomalous, since it represents really nodata at all.  Whenever it is encountered in a byte stream ina position where a type-byte is expected, it is completelyignored, and the succeeding byte examined instead.  Itspurpose is to serve as a filler in byte streams, providingservers with an aid in handling internal problems related totheir specific word lengths, etc.  The encoders may freelyuse this object to serve as padding when necessary.All b-PADDING data objects exist only within an encodedbyte stream.  They never cause any data item whatsoever tobe presented externally to the coder module.  The format of ab-PADDING follows.ABCDEFGH=11111111Note that this does not imply that all such 'null'bytes in a stream are to be ignored, since they could beencountered as a byte within some other type, such asb-LINTEGER.  Only bytes of this format which, by theirposition in the stream, appear as a 'type' byte are to beignored.                                -13-VI.4 -- Non-Atomic ObjectsNon-atomic objects are are always transmitted precededby both a single type byte and some small number of sizebyte(s).  The type byte identifies that the data objectconcerned is of a non-atomic type, as well as uniquelyspecifying the particular type involved.  All non-atomicobjects have type byte values of the following form.ABC=110 specifying that the object isnon-atomicDEFGH=vwxyz specifying the particular typeof objectThe vwxyz value is used to specify one of 31 possiblenon-atomic types.  The value vwxyz=00000 is reserved for usein future expansion.In all non-atomic data objects, the byte(s) followingthe type-byte specify the number of bytes to follow whichcontain the data object.  In all cases, if the number ofbytes specified are processed, the next byte to be seenshould be another type-byte, the beginning of the nextobject in the stream.The number of bytes containing the object sizeinformation is variable.  These bytes will be termed theSIZE-BYTES.  The first byte encountered has the followingformat.A=s specifying the manner in which the sizeinformation is encodedBCDEFGH=tuvwxyz specifying the size, ornumber of bytes containing the sizeThe tuvwxyz values supply a positive binary number.  Ifthe s value is a one, the tuvwxyz value specifies the numberof bytes to follow which should be read and concatenated asa binary number, which will then specify the size of theobject.  These bytes will appear with high order bits first.Thus, if s=1, up to 128 bytes may follow, containing thecount of the succeeding data bytes, which should certainlybe sufficient.Since many non-atomic objects will be fairly short, thes=0 condition is used to indicate that the 7 bits containedin tuvwxyz specify the actual data byte count.  This permitsobjects of sizes up to 128 bytes to be specified using onesize-information byte.  The case tuvwxyz=0000000 isinterpreted as specifying 128 bytes.For example, a data object of some non-atomic typewhich requires 100 (144 octal) bytes to be transmitted wouldbe sent as follows.                                -14-110XXXXX -- identifying a specificnon-atomic object01100100 -- specifying that 100 bytes follow..data -- the 100 data bytes..Note that the size count does not include thesize-specifier byte(s) themselves, but does include allsucceeding bytes in the stream used to encode the object.A data object requiring 20000 (47040 octal) bytes wouldappear in the stream as follows.110XXXXX -- identifying a specificnon-atomic object10000010 -- specifying that the next 2 bytescontain the stream length01001110 -- first byte of number 2000000100000 -- second byte..data -- 20,000 bytes..Interpretation of the contents of the 20000 bytes inthe stream can be performed by a module which knows thespecific format of the non-atomic type specified by DEFGH inthe type-byte.The remainder of this section defines an initial set ofnon-atomic types, the format of their encoding, and thesemantics of their interpretation.

⌨️ 快捷键说明

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