📄 rfc713.txt
字号:
Request for Comments: 713 Jack Haverty (JFH@MIT-DMS)NIC #34739 Apr 1976I. ABSTRACTA mechanism is defined for use by message servers intransferring data between hosts. The mechanism, called theMSDTP, is defined in terms of a model of the process as atranslation between two sets of items, the abstract entitiessuch as 'strings' and 'integers', and the formats used torepresent such data as a byte stream.A proposed organization of a general data transfermechanism is described, and the manner in which the MSDTPwould be used in that environment is presented. -1-II. REFERENCESBlack, Edward H., "The DMS Message Composer", MIT ProjectMAC, Programming Technology Division DocumentSYS.16.02.Burchfiel, Jerry D., Leavitt, Elsie M., Shapiro, Sonya andStrollo, Theodore R., compilers, "Tenex Users' Guide",Bolt Beranek and Newman, Cambridge, Mass., May 1971,revised January 1975, Descriptive sections on the TENEXsubsystems: MAlLER, p. 116-11; MAlLSTAT, p. 118-119;READMAIL, p. 137; and SNDMSG, p. 165-170.Haverty, Jack, "Communications System Overview", MIT ProjectMAC, Programming Technology Division DocumentSYS.16.00.Haverty, Jack, "Communications System Daemon Manual", MITProject MAC, Programming Technology Division DocumentSYS.16.01.ISI Information Automation Project, "Military MessageProcessing System Design," Internal ProjectDocumentation (Out of Print), Jan. 1975Message Services Committee, "Interim Report", Jan. 28, 1975Mooers, Charlotte D., "Mailsys Message System: Manual ForUsers", Bolt Beranek and Newman, Cambridge, Mass., June1975 (draft).Myer, Theodore H., "Notes On The BBN Mail System", BoltBeranek and Newman, November 8, 1974.Myer, Theodore H., and Henderson, D. Austin, "MessageTransmission Protocol", Network Working Group RFC 680,NIC 32116, April 30, 1975.Postel, Jon, "The PCPB8 Format", NSW Proposal, June 5, 1975Tugender, R., and D. R. Oestreicher, "Basic FunctionalCapabilities for a Military Message ProcessingService," ISI?RR-74-23., May 1975Vezza, Al, "Message Services Committee Minority Report",Jan. 1975 -2-III. OVERVIEWThis document describes a mechanism developed for useby message servers communicating over an eight-bitbyte-oriented network connection to move data structures andassociated data-typing information. It is presented here inthe hope that it may be of use to other projects which needto transfer data structures between dissimilar hosts.A set of abstract entities called PRIMITIVE ITEMS isenumerated. These are intended to include traditional datatypes of general utility, such as integers, strings, andarrays.A mechanism is defined for augmenting the set ofabstract data entities handled, to allow the introduction ofapplication-specific data, whose format and semantics areunderstood by the application programs involved, but whichcan be transmitted using common coding facilities. Anexample might be a data structure called a 'filespecification', or a 'date'. Abstract data entities definedusing this mechanism will be termed SEMANTIC ITEMS, sincethey are typically used to carry data having semanticcontent in the application involved.Semantic and primitive items are collectively referredto simply as ITEMS.The protocol next involves the definition of the formatof the byte stream used to convey items from machine tomachine. These encodings are described in terms of OBJECTS,which are the physical byte streams transmitted.To complete the protocol, the rules for translatingbetween objects and items are presented as each object isdefined.An item is transmitted by being translated into anobject which is transmitted over the connection as a streamof bytes to the receiver, and reconstructed there as anitem. The protocol mechanism may thus be viewed as a simpletranslator. It enumerates a set of abstract entities, theitems, which are known to programmers, a set of entities inbyte-stream format, the objects, and the translation rulesfor conversion between the sets. A site implementing theMSDTP would typically provide a facility to convert betweenobjects and the local representation of the various itemshandled. Applications using the MSDTP define theirinteractions using items, without regard to the actualformats in which such items are represented at variousmachines. This permits programs to handle higher-levelconcepts such as a character string, without concern for itsnumerous representational formats. Such detail is handledby the MSDTP. -3-Finally, a discussion of a general data transfermechanism for communication between programs is presented,and the manner in which the particular byte-orientedprotocol defined herein would be used in that environment isdiscussed.Terminology, as introduced, is defined and highlightedby capitalizing.IV. PRIMITIVE DATA ITEMSThe primitive data items include a variety oftraditional, well-understood types, such as integers andstrings. Primitive data items will be presented usingmnemonic names preceded by the character pair "p-", to serveas a reminder that the named object is primitive.These items may be represented in various computersystems in whatever fashion their programmers desire.IV.1 -- Set Of Primitive ItemsThe set of primitive items defined includes p-INT,p-STRING, p-STRUC, p-BITS, p-CHAR, p-BOOL, p-EMPTY, andp-XTRA.Since the protocol was developed primarily for use inmessage services, items such as p-FLOAT are not includedsince they were unnecessary. Additional items may be easilyadded as necessary.A p-INT performs the traditional role of representinginteger numbers. A p-BITS (BIT Stream) item represents abit stream. The two possible p-BOOL (BOOLean) items areused to represent the logical values of *TRUE* and *FALSE*.The single p-EMPTY item is used to, for example, indicatethat a given field of a message is empty. It is provided toact as a place-holder, representing 'no data', and appearsas *EMPTY*.The p-STRUC (STRUCture) item is used to group togethera collection of items as a single value, maintaining theordering of the elements, such as a p-STRUC of p-INTs.A p-CHAR is a single character. The most commonoccurrence of character data, however, will be as p-STRINGs.A p-STRING should be considered to be a synonym for ap-STRUC containing only p-CHARs. This concept is importantfor generality and consistency, especially when consideringdefinitions of permissible operations on structures, such asextracting subsequences of elements, etc. -4-Four p-XTRA items, which can be transmitted in a singlebyte, are made available for higher level protocols to usewhen a frequently used datum is handled which can berepresented just by its name. An example would be anacknowledgment between two servers. Using p-XTRAs torepresent such data permits them to be handled in a singlebyte. There are four possible p-XTRA items, termed *XTRA0*,*XTRA1*, *XTRA2*, and *XTRA3*. These may be assignedmeanings by user protocols as desired.IV.2 -- Printing ConventionsThe following printing conventions are introduced tofacilitate discussion of the primitive items.When a specific instance of a primitive data item ispresented, it will be shown in a traditional representationfor that kind of data. For example, p-INTs are shown assequences of digits, e.g. 100, p-STRINGs, as sequences ofcharacters enclosed in double-quote characters, for example"ABCDEF".As shown above, the two possible p-BOOL items are shownas *TRUE* or *FALSE*. The object p-EMPTY appears as*EMPTY*. A bit stream, i.e. p-BITS, appears as a stream of1s and 0s enclosed in asterisks, for example *100101001*. Ap-CHAR will be presented as the character enclosed in singlequote characters, e.g., 'A'.P-STRUCs are printed as the representations of theirelements, enclosed in parentheses, for example (1 2 3 4) or("XYZ" "ABC" 1 2) or ((1 2 3) "A" "B"). Note that becausep-STRINGs are simply a class of p-STRUCs assigned a specialname and printing format for brevity and convenience, theitems "ABC" and ('A' 'B' 'C') are identical, and the latterformat should not be used.To present a generic p-STRUC, as in specifying formatsof the contents of something, the items are presented as amnemonic name, optionally followed by a colon and thepermissible types of values for that datum. When one ofseveral items may appear as the value for some component,the permissible ones appear separated by vertical-barcharacters. For example, p-INT|p-STRING represents a singleitem, which may be either a p-INT or a p-STRING.To represent a succession of items, the Kleene starconvention is used. The specification p-INT[*] representsany number of p-INTs. Similarly, p-INT[3,5] represents from3 to 5 p-INTs, while p-INT[*,5] specifies up to 5 andp-iNT[5,*] specifies at least 5 p-INTs. -5-For example, a p-STRUC which is used to carry names andnumbers might be specified as follows.(name:p-STRING number:p-INT)In discussing items in general, when a specific datavalue is not intended, the name and types representation maybe used, e.g., offset:p-INT to discuss an 'offset' which hasa numeric value.V. SEMANTIC ITEM MECHANISMThe semantic item mechanism provides a means forprogram designers to use a variety of application-specificdata items.This mechanism is implemented using a special taggedstructure to carry the data type information as well as theactual components of the particular semantic item. Fordiscussion purposes. Such a special p-STRUC will be termed ap-EDT (Extended Data Type).When p-EDTs are transferred, their identity as a p-EDTis maintained. So that an applications program receives thecorresponding semantic item instead of a simple p-STRUC. Ap-EDT is identical to a p-STRUC in all other respects.V.1 -- Format of p-EDTsA prototypical p-EDT follows. It is printed as if itwere a normal p-STRUC. Since p-EDTs are converted tosemantic items for presentation to the user, a p-EDT willnever be used except in this protocol definition.(type:p-INT|p-STRING version:p-INT com1:anycom2:any ...)The first element, the 'type' is generally a p-INT, andis used to identify the particular type of semantic item.Types are assigned numeric codes in a controlled fashion.The type may alternatively be specified by a p-STRING, topermit development of new data types for possible laterassignment of codes. Each type has an equivalent p-STRINGname. These may be used interchangeably as 'type' elements,primarily to maintain upward compatibility.The second element of a p-EDT is always an p-INT, the'version', and specifies the exact format of the particulardatum. A semantic item may undergo several revisions of itsinternal structure. Which would be evident through assigningdifferent versions to each revision. -6-Successive components. The 'com' elements, if any.carry the actual data of the semantic item. As eachsemantic item is defined, conventions on permissible valuesand interpretation of these components are presented. Suchdefinitions may use any types of items to specify the formatof the semantic item. Use of lower level concepts, such asobjects, in these definitions is prohibited.Semantic items will be printed as the mnemonic for thetype involved, preceded by the character pair "s-", tosignify that the data item is handled by this mechanism.V.2 -- Printing ConventionsA semantic item is represented as if it were a p-STRUCcontaining only the components, if any, but preceded by thesemantic type name and a # character. The version number isassumed to be 1 if unspecified. For later versions, theversion number is attached to the type name, as in, forexample, FILE-2 to represent version 2 of the FILE datatype.For example, a semantic item called a 'filespecification' might be defined, containing two components,a host number and pathname. A specific instance of such anitem might appear as #FILE(69 "DIRECTORY.NAME-OF-FILE"),while a generic s-FILE might be presented as the following.#FILE(host:p-INT|p-STRING pathname:p-STRING)the item, which may be either a p-INT or p-STRING, and'pathname' is the second component, which must be ap-STRING. The full definition would present interpretationrules for these components.VI. ENCODING OBJECTSThis section presents the set of objects which are usedto represent items as byte streams for inter-servertransmission. Objects will be presented using mnemonictype-names preceded by the character pair "b-", indicatingtheir existence only as byte streams.All servers are required to be capable of decoding theentire set of objects. Servers are not required to transmitcertain objects which are available to improve channelefficiency. -7-The encodings are designed to facilitate programmingand efficiency of the receiving decoder. In all cases, thetype and length in bytes of objects is supplied as the firstinformation sent. This characteristic is important for easeof implementation. The type information permits a decoder tobe constructed in a modular fashion. The most importantadvantage of including size information is that the receiveralways knows how many bytes it must read to discover what todo next, and knows when each object terminates. Thisrequirement avoids many potential problems with timing andsynchronization of processes.Two varieties of objects are defined. The first willbe called ATOMIC, and includes objects used to efficientlyencode the most common data. The second variety is termedNON-ATOMIC, and is used to encode larger or less common
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -