📄 rfc708.txt
字号:
Network Working Group James E. WhiteRequest for Comments: 708 Augmentation Research Center Elements of a Distributed Programming System January 5, 1976 James E. White Augmentation Research Center Stanford Research Institute Menlo Park, California 94025 (415) 326-6200 X2960This paper suggests some extensions to the simple Procedure Call Protocoldescribed in a previous paper (27197). By expanding the procedure callmodel and standardizing other common forms of inter-process interaction,such extensions would provide the applications programmer with an evenmore powerful distributed programming system.The work reported here was supported by the Advanced Research ProjectsAgency of the Department of Defense, and by the Rome Air Development Center of the Air Force.This paper will be submitted to publication in the Journal of ComputerLanguages.Network Working Group James E. WhiteRequest for Comments: 708 Elements of a Distributed Programming System INTRODUCTIONIn a companion paper [i], the author proposes a simple protocol andsoftware framework that would facilitate the construction of distributedsystems within a resource-sharing computer network by enabling distantprocesses to communicate with one another at the procedure call level.Although of great utility even in its present form, this rudimentary"distributed programming system (DPS)" supports only the most fundamentalaspects of remote procedure calling. In particular, it permits thecaller to identify the remote procedure to be called, supply the necessary arguments, determine the outcome of the procedure, and recover its results. The present paper extends this simple procedure call modeland standardizes other common forms of process interaction to providea more powerful and comprehensive distributed programming system. Theparticular extensions proposed in this paper serve hopefully to reveal the DPS concept's potential, and are offered not as dogma but rather asstimulus for further research.The first section of this paper summarizes the basic distributedprogramming system derived in [1]. The second section describes thegeneral strategy to be followed in extending it. The third and longestsection identifies and explores some of the aspects of process interactionthat are sufficiently common to warrant standardization, and suggestsmethods for incorporating them in the DPS model. REVIEWING THE BASIC SYSTEMThe distributed programming system derived in [1] assumes the existenceof and is built upon a network-wide "inter-process communication (IPC)"facility. As depicted in Figure 1, DPS consists of a high-level model ofcomputer processes and a simple, application-independent "procedurecall protocol (PCP)" that implements the model by regulating the dialogbetween two processes interconnected by means of an IPC communication "channel." DPS is implemented by an installation-provided "run-time environment (RTE)," which is link loaded with (or otherwise madeavailable to) each applications program. -1-Network Working Group James E. WhiteRequests for Comments: 708 Elements of a Distributed Programming System Reviewing the Basic SystemThe ModelThe procedure call model (hereafter termed the Model) views a process as acollection of remotely callable subroutines or "procedures." Each procedureis invoked by name, can be supplied a list of arguments, and returns to itscaller both a boolean outcome, indicating whether it succeeded or failed,and a list of results. The Model permits the process at either end of the IPC channel to invoke procedures in its neighbor, and further permits aprocess to accept two or more procedure calls for concurrent execution.The arguments and results of procedures are modeled from a small set ofprimitive "data types," listed below: LIST: A list is an ordered sequence of N data objects called "elements" (here and throughout these descriptions, N is confined to the range [0, 2**15-1]). A LIST may contain other LISTs as elements, and can therefore be employed to construct arbitrarily complex, composite arguments or results. CHARSTR: A character string is an ordered sequence of N ASCII characters, and conveniently models a variety of textual entities, from short user names to whole paragraphs of text. BITSTR: A bit string is an ordered sequence of N bits and, therefore, provides a means for representing arbitrary binary data (for example, the contents of a word of memory). INTEGER: An integer is a fixed-point number in the range [-2**31, 2**31-1], and conveniently models various kinds of numerical data, including time intervals, distances, and so on. INDEX: An index is an integer in the range [1, 2**15-1]. As its name and value range suggest, an INDEX can be used to address a particular bit of character within a string, or element within a list. Furthermore, many of the protocol extensions to be proposed in this paper will employ INDEXES as handles for objects within the DPS environment (for example, processes and channels). BOOLEAN: A boolean represents a single bit of information and has either the value true or false. EMPTY: An empty is a valueless place holder within a LIST of parameter list. -2-Network Working Group James E. WhiteRequests for Comments: 708 Elements of a Distributed Programming System Reviewing the Basic SystemThe ProtocolThe procedure call protocol (hereafter terms the Protocol), whichimplements the Model, defines a "transmission format" (like those suggestedin Appendix A) for each of the seven data types listed above, andrequires that parameters be encoded in that format whenever they aretransported between processes.The Protocol also specified the inter-process messages by which remoteprocedures are invoked. These messages can be described symbolically asfollows: message-type=CALL [tid] procedure-name arguments message-type=RETURN tid outcome resultsThe first message invokes the procedure whose NAME is specified using theARGUMENTS provided. The second is returned in eventual response to thefirst and reports the OUTCOME and RESULTS of the completed procedure.Whenever OUTCOME indicates that a procedure has failed, the procedure's RESULTS are required to be an error number and diagnostic message, the former to help the invoking program determine what to do next, the latter for possible presentation to the user. The presence of anoptional "transaction identifier (TID)" in the CALL message constitutesa request by the caller for an acknowledging RETURN message echoing theidentifier.Although data types and their transmission formats serve primarily asvehicles for representing the arguments and results of remote procedures,they can just as readily and effectively be employed to represent themessages by which those parameters are transmitted. The Protocol,therefore, represents each of the two messages described above as a PCP data object, namely, a LIST whose first element is an INDEX messagetype. The following concise statement of the Protocol results: LIST (CALL, tid, procedure, arguments) INDEX=1 [INDEX] CHARSTR LIST LIST (RETURN, tid, outcome, results) INDEX=2 INDEX BOOLEAN LISTHere and in subsequent protocol descriptions, elements enclosed in squarebrackets are optional (that is, may be EMPTY). The RESULTS of anunsuccessful procedure would be represented as follows: LIST (error, diagnostic) INDEX CHARSTR -3-Network Working Group James E. WhiteRequests for Comments: 708 Elements of a Distributed Programming System Reviewing the Basic SystemThe Run-Time EnvironmentThe run-time environment (hereafter termed the environment) interfaces theapplications program to a remote process via an IPC channel. In doing so,it provides the applications program with a collection of "primitives,"implemented either as subroutines or system calls, that the applicationsprogram can employ to manipulate the remote process to which the channelconnects it. The environment implements these primitives by sendingand receiving various protocol messages via the channel.In its present rudimentary form, the Protocol enables the environment tomake a single, remote procedure calling primitive like the followingavailable to the applications program: CALLPROCEDURE (procedure, arguments -> outcome, results) CHARSTR LIST BOOLEAN LISTThis primitive invokes the indicated remote PROCEDURE using the ARGUMENTSprovided and returns its OUTCOME and RESULTS. While this primitiveblocks the invoking applications program until the remote procedurereturns, a variant that simply initiates the call and allows theapplications program to collect the outcome and results in a secondoperation can also be provided.Since the interface between the environment and the applications programis machine- and possibly even language-dependent, environment-providedprimitives can only be described in this paper symbolically. AlthoughPCP data types provide a convenient vehicle for describing theirarguments and results are therefore used for that purpose above andthroughout the paper, such parameters will normally be transmittedbetween the environment and the applications program in some internalformat. BOOTSTRAPPING THE NEW PROTOCOL FUNCTIONSSince the Protocol already provides a mechanism for invoking arbitraryremote procedures, the Model extensions to be proposed in this paperwill be implemented whenever possible as procedures, rather than asadditional messages. Unlike applications procedures, these special"system procedures" will be called and implemented by run-time environments, rather than by the applications programs they serve. Although inaccessibleto the remote applications program via the normal environment-providedremote procedure calling primitive, system procedures will enable theenvironment to implement and offer new primitives to its applicationsprogram. -4-Network Working Group James E. WhiteRequests for Comments: 708 Elements of a Distributed Programming System Bootstrapping the New Protocol FunctionsThe calling sequences of many of these new primitives will closelycorrespond to those of the remote system procedures by which they areimplemented. Other primitives will be more complex and require for theirimplementation calls to several system procedures, possibly in differentprocesses. Besides describing the Protocol additions required by variousModel extensions proposed, the author will, throughout this paper, suggestcalling sequences for the new primitives that become available to the applications program. -5-Network Working Group James E. WhiteRequest for Comments: 708 Elements of a Distributed Programming System Some Possible Extensions to the Model SOME POSSIBLE EXTENSIONS TO THE MODEL1. Creating Remote ProcessesBefore a program in one machine can use resources in another, it must eithercreate a new process in the remote machine, or gain access to an existingone. In either case, the local process must establish an IPC channel to aresident dispatching process within the remote system, specify the program to be started or contacted. and identify itself so that its access to theprogram can be established and billing carried out. After these preliminarysteps have been accomplished, the requested process assumes responsibilityfor the IPC channel and substantive communication begins.The manner in which the environment carries out the above scenario islargely dictated by the IPC facility upon which the distributed system isbased. If the IPC facility itself provides single primitive thataccomplishes the entire task, then the environment need only invoke thatprimitive. If, on the other hand, it only provides a mechanism by whichthe environment can establish a channel to the remote dispatcher, as isthe case within the ARPA computer Network (the ARPANET), then the Protocol itself must contain provisions for naming the program to be run andpresenting the required credential.Adding to the Protocol the following system procedure enables the localenvironment to provide the remote dispatcher with the necessary informationin this latter case: INIPROCESS (program, credential) CHARSTR LIST (user, password, account) CHARSTR CHARSTR CHARSTRIts arguments include the name of the applications PROGRAM to be run; andthe USER name, PASSWORD, and ACCOUNT of the local user to whom its use isto be billed.This new procedure effectively adds to the Model the notion of "creation," and enables the environment to offer the following primitivesto its applications program: CRTPROCESS (computer, program, credential -> ph) CHARSTR CHARSTR (as above) INDEX DELPROCESS (ph) INDEX -6-Network Working Group James E. WhiteRequest for Comments: 708 Elements of a Distributed Programming System Some Possible Extensions to the Model Creating Remote ProcessesThe first primitive creates a new process or establishes contact with anexisting one by first creating a channel to the dispatcher within theindicated COMPUTER and then invoking the remote system procedure INIPROCESSwith the specified PROGRAM name and CREDENTIALS as arguments. The primitivereturns a "process handle PH" by which the applications program can refer to the newly created process in subsequent dialog with the local environmentby the IPC facility, an index into a table within the environment, or anythingelse the environment's implementor may find convenient.The second primitive "deletes" the previously created process whose handlePH is specified by simply deleting the IPC channel to the remote process andreclaiming any internal table space that may have been allocated to theprocess.2. Introducing Processes to One AnotherThe simplest distributed systems begin with a single process that creates,via the CRTPROCESS primitive described above, one or more "inferior"processes whose resources it requires. Some or all of these inferiors may in turn require other remote resources and so create interiors of theirown. This creative activity can proceed, in principle, to arbitrary depth.The distributed system is thus a tree structure whose nodes are processes and whose branches are IPC channels.Although a distributed system can include an arbitrarily large number ofprocesses, each process is cognizant of only the process that created itand those it itself creates, that is, its parent and sons. The radiuswithin which a process can access the resources of the tree is thusartificially small. This limited sharing range, which prevents theconvenient implementation of many distributed systems, can be overcomeby extending the Model to permit an arbitrarily complex network ofcommunication paths to be superimposed upon the process tree.One of the many ways by which the Protocol can provide for such communicationpaths is to permit one process to "introduce" and thereby make known to one another any two processes it itself knows (for example, two of its sons,or its parent and son). Once introduced, the two processes would be able to invoke one another's procedures with the same freedom the introducingprocess enjoys. They could also introduce one another to other processes,and so create even longer communication paths.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -