home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 700s / rfc708.txt < prev    next >
Text File  |  1992-10-14  |  58KB  |  1,708 lines

  1.  
  2.  
  3.  
  4. Network Working Group                James E. White
  5. Request for Comments:  708            Augmentation Research Center
  6.  
  7.  
  8.  
  9.              Elements of a Distributed Programming System
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                            January 5, 1976
  22.  
  23.                             James E. White
  24.                      Augmentation Research Center
  25.  
  26.                      Stanford Research Institute
  27.                     Menlo Park, California  94025
  28.  
  29.                          (415) 326-6200 X2960
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. This paper suggests some extensions to the simple Procedure Call Protocol
  38. described in a previous paper (27197).  By expanding the procedure call
  39. model and standardizing other common forms of inter-process interaction,
  40. such extensions would provide the applications programmer with an even
  41. more powerful distributed programming system.
  42.  
  43. The work reported here was supported by the Advanced Research Projects
  44. Agency of the Department of Defense, and by the Rome Air Development 
  45. Center of the Air Force.
  46.  
  47. This paper will be submitted to publication in the Journal of Computer
  48. Languages.
  49.  
  50.  
  51. Network Working Group        James E. White
  52. Request for Comments:  708    Elements of a Distributed Programming System
  53.  
  54.  
  55.  
  56.                              INTRODUCTION
  57.  
  58.  
  59. In a companion paper [i], the author proposes a simple protocol and
  60. software framework that would facilitate the construction of distributed
  61. systems within a resource-sharing computer network by enabling distant
  62. processes to communicate with one another at the procedure call level.
  63. Although of great utility even in its present form, this rudimentary
  64. "distributed programming system (DPS)" supports only the most fundamental
  65. aspects of remote procedure calling.  In particular, it permits the
  66. caller to identify the remote procedure to be called, supply the 
  67. necessary arguments, determine the outcome of the procedure, and recover 
  68. its results.  The present paper extends this simple procedure call model
  69. and standardizes other common forms of process interaction to provide
  70. a more powerful and comprehensive distributed programming system.  The
  71. particular extensions proposed in this paper serve hopefully to reveal the 
  72. DPS concept's potential, and are offered not as dogma but rather as
  73. stimulus for further research.
  74.  
  75. The first section of this paper summarizes the basic distributed
  76. programming system derived in [1].  The second section describes the
  77. general strategy to be followed in extending it.  The third and longest
  78. section identifies and explores some of the aspects of process interaction
  79. that are sufficiently common to warrant standardization, and suggests
  80. methods for incorporating them in the DPS model.
  81.  
  82.  
  83.  
  84.                       REVIEWING THE BASIC SYSTEM
  85.  
  86.  
  87. The distributed programming system derived in [1] assumes the existence
  88. of and is built upon a network-wide "inter-process communication (IPC)"
  89. facility.  As depicted in Figure 1, DPS consists of a high-level model of
  90. computer processes and a simple, application-independent "procedure
  91. call protocol (PCP)" that implements the model by regulating the dialog
  92. between two processes interconnected by means of an IPC communication 
  93. "channel."  DPS is implemented by an installation-provided "run-time 
  94. environment (RTE)," which is link loaded with (or otherwise made
  95. available to) each applications program.
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.                                    -1-
  103.  
  104. Network Working Group                          James E. White
  105. Requests for Comments:  708    Elements of a Distributed Programming System
  106.                              Reviewing the Basic System
  107.  
  108.  
  109.  
  110. The Model
  111.  
  112. The procedure call model (hereafter termed the Model) views a process as a
  113. collection of remotely callable subroutines or "procedures."  Each procedure
  114. is invoked by name, can be supplied a list of arguments, and returns to its
  115. caller both a boolean outcome, indicating whether it succeeded or failed,
  116. and a list of results.  The Model permits the process at either end of the 
  117. IPC channel to invoke procedures in its neighbor, and further permits a
  118. process to accept two or more procedure calls for concurrent execution.
  119.  
  120. The arguments and results of procedures are modeled from a small set of
  121. primitive "data types," listed below:
  122.  
  123.     LIST:  A list is an ordered sequence of N data objects called
  124.     "elements" (here and throughout these descriptions, N is    
  125.     confined to the range [0, 2**15-1]).  A LIST may contain
  126.     other LISTs as elements, and can therefore be employed to
  127.     construct arbitrarily complex, composite arguments or results.
  128.  
  129.     CHARSTR:  A character string is an ordered sequence of N ASCII
  130.     characters, and conveniently models a variety of textual
  131.     entities, from short user names to whole paragraphs of text.
  132.  
  133.     BITSTR:  A bit string is an ordered sequence of N bits and,
  134.     therefore, provides a means for representing arbitrary
  135.     binary data (for example, the contents of a word of memory).
  136.  
  137.     INTEGER:  An integer is a fixed-point number in the range
  138.     [-2**31, 2**31-1], and conveniently models various kinds of
  139.     numerical data, including time intervals, distances, and so on.
  140.  
  141.     INDEX:  An index is an integer in the range [1, 2**15-1].  As
  142.     its name and value range suggest, an INDEX can be used to
  143.     address a particular bit of character within a string, or 
  144.     element within a list.  Furthermore, many of the protocol
  145.     extensions to be proposed in this paper will employ INDEXES as
  146.     handles for objects within the DPS environment (for example,
  147.     processes and channels).
  148.  
  149.     BOOLEAN:  A boolean represents a single bit of information
  150.     and has either the value  true or false.
  151.  
  152.     EMPTY:  An empty is a valueless place holder within a LIST of
  153.     parameter list.
  154.  
  155.  
  156.                                      -2-
  157.  
  158. Network Working Group                          James E. White
  159. Requests for Comments:  708    Elements of a Distributed Programming System
  160.                           Reviewing the Basic System
  161.  
  162.  
  163. The Protocol
  164.  
  165. The procedure call protocol (hereafter terms the Protocol), which
  166. implements the Model, defines a "transmission format" (like those suggested
  167. in Appendix A) for each of the seven data types listed above, and
  168. requires that parameters be encoded in that format whenever they are
  169. transported between processes.
  170.  
  171. The Protocol also specified the inter-process messages by which remote
  172. procedures are invoked.  These messages can be described symbolically as
  173. follows:
  174.  
  175.     message-type=CALL    [tid] procedure-name arguments
  176.     message-type=RETURN      tid  outcome        results
  177.  
  178. The first message invokes the procedure whose NAME is specified using the
  179. ARGUMENTS provided.  The second is returned in eventual response to the
  180. first and reports the OUTCOME and RESULTS of the completed procedure.
  181. Whenever OUTCOME indicates that a procedure has failed, the procedure's 
  182. RESULTS are required to be an error number and diagnostic message, the 
  183. former to help the invoking program determine what to do next, the 
  184. latter for possible presentation to the user.  The presence of an
  185. optional "transaction identifier (TID)" in the CALL message constitutes
  186. a request by the caller for an acknowledging RETURN message echoing the
  187. identifier.
  188.  
  189. Although data types and their transmission formats serve primarily as
  190. vehicles for representing the arguments and results of remote procedures,
  191. they can just as readily and effectively be employed to represent the
  192. messages by which those parameters are transmitted.  The Protocol,
  193. therefore, represents each of the two messages described above as a PCP 
  194. data object, namely, a LIST whose first element is an INDEX message
  195. type.  The following concise statement of the Protocol results:
  196.  
  197.     LIST (CALL,   tid,    procedure, arguments)
  198.               INDEX=1 [INDEX] CHARSTR    LIST
  199.     LIST (RETURN, tid,    outcome,   results)
  200.           INDEX=2 INDEX   BOOLEAN    LIST
  201.  
  202. Here and in subsequent protocol descriptions, elements enclosed in square
  203. brackets are optional (that is, may be EMPTY).  The RESULTS of an
  204. unsuccessful procedure would be represented as follows:
  205.  
  206.     LIST (error, diagnostic)
  207.           INDEX  CHARSTR
  208.  
  209.  
  210.  
  211.                                     -3-
  212.  
  213. Network Working Group                          James E. White
  214. Requests for Comments:  708    Elements of a Distributed Programming System
  215.                               Reviewing the Basic System
  216.  
  217.  
  218.  
  219. The Run-Time Environment
  220.  
  221. The run-time environment (hereafter termed the environment) interfaces the
  222. applications program to a remote process via an IPC channel.  In doing so,
  223. it provides the applications program with a collection of "primitives,"
  224. implemented either as subroutines or system calls, that the applications
  225. program can employ to manipulate the remote process to which the channel
  226. connects it.  The environment implements these primitives by sending
  227. and receiving various protocol messages via the channel.
  228.  
  229. In its present rudimentary form, the Protocol enables the environment to
  230. make a single, remote procedure calling primitive like the following
  231. available to the applications program:
  232.  
  233.     CALLPROCEDURE (procedure, arguments -> outcome, results)
  234.                CHARSTR    LIST         BOOLEAN  LIST
  235.  
  236. This primitive invokes the indicated remote PROCEDURE using the ARGUMENTS
  237. provided and returns its OUTCOME and RESULTS.  While this primitive
  238. blocks the invoking applications program until the remote procedure
  239. returns, a variant that simply initiates the call and allows the
  240. applications program to collect the outcome and results in a second
  241. operation can also be provided.
  242.  
  243. Since the interface between the environment and the applications program
  244. is machine- and possibly even language-dependent, environment-provided
  245. primitives can only be described in this paper symbolically.  Although
  246. PCP data types provide a convenient vehicle for describing their
  247. arguments and results are therefore used for that purpose above and
  248. throughout the paper, such parameters will normally be transmitted
  249. between the environment and the applications program in some internal
  250. format.
  251.  
  252.  
  253.                BOOTSTRAPPING THE NEW PROTOCOL FUNCTIONS
  254.  
  255.  
  256. Since the Protocol already provides a mechanism for invoking arbitrary
  257. remote procedures, the Model extensions to be proposed in this paper
  258. will be implemented whenever possible as procedures, rather than as
  259. additional messages.  Unlike applications procedures, these special
  260. "system procedures" will be called and implemented by run-time environments, 
  261. rather than by the applications programs they serve.  Although inaccessible
  262. to the remote applications program via the normal environment-provided
  263. remote procedure calling primitive, system procedures will enable the
  264. environment to implement and offer new primitives to its applications
  265. program.
  266.                                     -4-
  267.  
  268.  
  269. Network Working Group                          James E. White
  270. Requests for Comments:  708    Elements of a Distributed Programming System
  271.                     Bootstrapping the New Protocol Functions
  272.  
  273.  
  274.  
  275. The calling sequences of many of these new primitives will closely
  276. correspond to those of the remote system procedures by which they are
  277. implemented.  Other primitives will be more complex and require for their
  278. implementation calls to several system procedures, possibly in different
  279. processes.  Besides describing the Protocol additions required by various
  280. Model extensions proposed, the author will, throughout this paper, suggest
  281. calling sequences for the new primitives that become available to the 
  282. applications program.
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.                                        -5-
  321.  
  322. Network Working Group                          James E. White
  323. Request for Comments:  708    Elements of a Distributed Programming System
  324.                        Some Possible Extensions to the Model
  325.  
  326.  
  327.  
  328.                 SOME POSSIBLE EXTENSIONS TO THE MODEL
  329.  
  330.  
  331. 1.  Creating Remote Processes
  332.  
  333. Before a program in one machine can use resources in another, it must either
  334. create a new process in the remote machine, or gain access to an existing
  335. one.  In either case, the local process must establish an IPC channel to a
  336. resident dispatching process within the remote system, specify the program 
  337. to be started or contacted. and identify itself so that its access to the
  338. program can be established and billing carried out.  After these preliminary
  339. steps have been accomplished, the requested process assumes responsibility
  340. for the IPC channel and substantive communication begins.
  341.  
  342. The manner in which the environment carries out the above scenario is
  343. largely dictated by the IPC facility upon which the distributed system is
  344. based.  If the IPC facility itself provides single primitive that
  345. accomplishes the entire task, then the environment need only invoke that
  346. primitive.  If, on the other hand, it only provides a mechanism by which
  347. the environment can establish a channel to the remote dispatcher, as is
  348. the case within the ARPA computer Network (the ARPANET), then the Protocol 
  349. itself must contain provisions for naming the program to be run and
  350. presenting the required credential.
  351.  
  352. Adding to the Protocol the following system procedure enables the local
  353. environment to provide the remote dispatcher with the necessary information
  354. in this latter case:
  355.  
  356.     INIPROCESS (program, credential)
  357.             CHARSTR  LIST (user,   password, account)
  358.                    CHARSTR CHARSTR   CHARSTR
  359.  
  360. Its arguments include the name of the applications PROGRAM to be run; and
  361. the USER name, PASSWORD, and ACCOUNT of the local user to whom its use is
  362. to be billed.
  363.  
  364. This new procedure effectively adds to the Model the notion of "creation," and enables the environment to offer the following primitives
  365. to its applications program:
  366.  
  367.     CRTPROCESS (computer, program, credential -> ph)
  368.             CHARSTR   CHARSTR  (as above)    INDEX
  369.     DELPROCESS (ph)
  370.             INDEX
  371.  
  372.  
  373.                                    -6-
  374.  
  375.  
  376. Network Working Group                        James E. White
  377. Request for Comments:  708      Elements of a Distributed Programming System
  378.                          Some Possible Extensions to the Model
  379.                              Creating Remote Processes
  380.  
  381.  
  382.  
  383. The first primitive creates a new process or establishes contact with an
  384. existing one by first creating a channel to the dispatcher within the
  385. indicated COMPUTER and then invoking the remote system procedure INIPROCESS
  386. with the specified PROGRAM name and CREDENTIALS as arguments.  The primitive
  387. returns a "process handle PH" by which the applications program can refer to 
  388. the newly created process in subsequent dialog with the local environment
  389. by the IPC facility, an index into a table within the environment, or anything
  390. else the environment's implementor may find convenient.
  391.  
  392. The second primitive "deletes" the previously created process whose handle
  393. PH is specified by simply deleting the IPC channel to the remote process and
  394. reclaiming any internal table space that may have been allocated to the
  395. process.
  396.  
  397. 2.  Introducing Processes to One Another
  398.  
  399. The simplest distributed systems begin with a single process that creates,
  400. via the CRTPROCESS primitive described above, one or more "inferior"
  401. processes whose resources it requires.  Some or all of these inferiors may 
  402. in turn require other remote resources and so create interiors of their
  403. own.  This creative activity can proceed, in principle, to arbitrary depth.
  404. The distributed system is thus a tree structure whose nodes are processes 
  405. and whose branches are IPC channels.
  406.  
  407. Although a distributed system can include an arbitrarily large number of
  408. processes, each process is cognizant of only the process that created it
  409. and those it itself creates, that is, its parent and sons.  The radius
  410. within which a process can access the resources of the tree is thus
  411. artificially small.  This limited sharing range, which prevents the
  412. convenient implementation of many distributed systems, can be overcome
  413. by extending the Model to permit an arbitrarily complex network of
  414. communication paths to be superimposed upon the process tree.
  415.  
  416. One of the many ways by which the Protocol can provide for such communication
  417. paths is to permit one process to "introduce" and thereby make known to one 
  418. another any two processes it itself knows (for example, two of its sons,
  419. or its parent and son).  Once introduced, the two processes would be able 
  420. to invoke one another's procedures with the same freedom the introducing
  421. process enjoys.  They could also introduce one another to other processes,
  422. and so create even longer communication paths.
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.                                    -7-
  430.  
  431. Network Working Group                          James E. White
  432. Request for Comments:  708    Elements of a Distributed Programming System
  433.                        Some Possible Extensions to the Model
  434.                     Introducing Processes to One Another
  435.  
  436.  
  437.  
  438. 2.1  Introductions Within a Homogeneous Environment
  439.  
  440. Provided one remains within a "homogeneous environment" (that is, the domain
  441. of a single IPC facility), the introduction of two processes requires little
  442. more than the formation of an IPC channel between them.  Adding to the
  443. Protocol the following system procedures, which manipulate IPC "ports,"
  444. enables the run-time environment of the process performing the introduction
  445. to negotiate such a channel:
  446.  
  447.     ALOPORT (-> ph,   COMPUTER, PORT)
  448.             INDEX CHARSTR   any
  449.     CNNPORT (ph,   computer, port)
  450.          INDEX CHARSTR   any
  451.     DCNPORT (ph)
  452.          INDEX
  453.  
  454. The detailed calling sequences for these procedures are dictated by the IPC
  455. facility that underlies the distributed system.  Those above are therefore
  456. only representative of what may be required within any particular network,
  457. but are only slightly less complicated than those required, for example,
  458. within the ARPANET.
  459.  
  460. To create the channel, the introducing process' run-time environment
  461. allocates a PORT in each target process via ALOPORT, and then instructs
  462. each process via CNNPORT to connect its port to the other's via the IPC
  463. facility.  The process handle PH returned by ALOPORT serves as a handle
  464. both initially for the allocated port, and then later for the process to
  465. which the attached channel provides access.  To "separate" the two processes,
  466. the introducing process' environment need only invoke the DCNPORT procedure
  467. in each process, thereby dissolving the channel, releasing the associated 
  468. ports, and deallocating the process handles.
  469.  
  470. Armed with these three new system procedures, the environment can provide
  471. the following new primitives to its applications program:
  472.  
  473.     ITDPROCESS (ph1,  ph2 -> ph12, PH21, ih)
  474.             INDEX INDEX  INDEX INDEX INDEX
  475.     SEPPROCESS (ih)
  476.             INDEX
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.                                    -8-
  486.  
  487. Network Working Group                          James E. White
  488. Request for Comments:  708    Elements of a Distributed Programming System
  489.                        Some Possible Extensions to the Model
  490.                       Introducing Process to One Another
  491.  
  492.  
  493.  
  494. The first primitive introduces the two processes whose handles PH1 and PH2 
  495. are specified.  Each handle may designate either a son, in which case the
  496. handle is one returned by CRTPROCESS; the parent process, for which a
  497. special handle (for example, 1) must always be defined; or a previously
  498. introduced process, in which case the handle is one obtained in a previous
  499. invocation of ITDPROCESS.
  500.  
  501. ITDPROCESS returns handles PH12 and PH21 by which the two processes will
  502. know one another, as well as an "introduction handle IH" that the applications
  503. program can later employ to separate the two processes via SEPPROCESS.  The
  504. applications program initiating the introduction assumes responsibility for
  505. communicating to each introduced applications program its handle for the 
  506. other.
  507.  
  508. 2.2  Introductions Within a Heterogeneous Environment
  509.  
  510. While their interconnection via an IPC channel is sufficient to introduce
  511. two processes to one another, in a heterogeneous environment the creation
  512. of such a channel is impossible.  Suppose, as depicted in Figure 2, that 
  513. processes P1 and P2 (in computers C1 and C2, respectively) are interconnected
  514. within a distributed system by means of a network IPC facility.  Assume
  515. further that P2 attaches to the system another process P3 in a minicomputer
  516. M that although attached to C2 is not formally a part of the network.  With
  517. this configuration, it is impossible for P2 to introduce processes P1 and P3 
  518. to one another by simply establishing an IPC channel between them, since
  519. they are not within the domain of a single IPC facility.
  520.  
  521. One way of overcoming this problem is to extend the Model to embrace the
  522. notion of a composite or "logical channel" composed of two or more physical 
  523. (that is, IPC) channels.  A message transmitted by process P1 via the logical 
  524. channel to Pn (n=3 in the example above) would be relayed over successive
  525. physical channels by the environments of intermediate processes P2 through
  526. Pn-1.  Although more expensive than physical channels, since each message
  527. must traverse at least two physical channels and be handled by all the
  528. environments along the way, logical channels would nevertheless enable 
  529. processes that could not otherwise do so to access one another's resources.
  530. Since the relaying of messages is a responsibility of the environment, the
  531. applications program need never be aware of it.
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.                                    -9-
  541.  
  542.  
  543.  
  544.  
  545. Network Working Group                          James E. White
  546. Request for Comments:  708    Elements of a Distributed Programming System
  547.                        Some Possible Extensions to the Model
  548.                     Introducing Processes to One Another
  549.  
  550.  
  551.  
  552. As depicted in Figure 3, a logical channel would consist of table entries
  553. maintained by the environment of each process P1 through Pn, plus the
  554. environment to forward messages that arrive with a "routing code" addressing
  555. the local table entry.  Each table entry would contain process handles for
  556. the two adjacent processes, as well as the routing code recognized by each.
  557. To communicate a message to its distant neighbor, the source process (say 
  558. P1) would transmit it via its IPC channel to P2, with a routing code
  559. addressing the appropriate table entry within P2.  Upon receipt of the
  560. message, P2 would locate its table entry via the routing code, update the
  561. message with the routing code recognized by P3, and forward the message
  562. to P3.  Eventually the message would reach its final destination, Pn.
  563.  
  564. Adding to the Protocol the following system procedures enables the
  565. environment to construct a logical channel like that described above:
  566.  
  567.     CRTROUTE (mycode, oldcode -> code, ph)
  568.                   INDEX   [INDEX]    INDEX INDEX
  569.     DELROUTE (yourcode)
  570.               INDEX
  571.  
  572. The simplest logical channel (n=3) is created by P2, which invokes CRTROUTE
  573. in both P1 and P3, specifying in each case the routing code MYCODE it has
  574. assigned to its segment of the logical channel, and receiving in return
  575. the routing CODES and process handles PHs assigned by the two processes.
  576. OLDCODE is not required in this simple case and is therefore EMPTY.
  577.  
  578. More complicated logical channels (n>3) are required when one or both
  579. of the processes to be introduced is already linked, by a logical channel,
  580. to the process performing the introduction.  In such cases, a portion of
  581. the new channel to be constructed must replicate the existing channel, and
  582. hence the routing code OLDCODE for the table entry that represents that
  583. channel within the target process is specified as an additional argument
  584. of the system procedure.  The target process must call CRTROUTE recursively
  585. in the adjacent process to replicate the rest of the model channel.
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.                                  -10-
  596.  
  597.  
  598. Network Working Group                          James E. White
  599. Request for Comments:  708    Elements of a Distributed Programming System
  600.                        Some Possible Extensions to the Model
  601.                     Introducing Processes to One Another
  602.  
  603.  
  604.  
  605. The process Pi that creates a logical channel assumes responsibility for
  606. insuring that it is eventually dismantled.  It deletes the logical channel
  607. by invoking DELROUTE in Pi-1 and Pi+1, each of which propagates the call
  608. toward its end of the channel.
  609.  
  610. 3.  Controlling Access to Local Resources
  611.  
  612. The process introduction primitive proposed above effectively permits
  613. access to a process to be transmitted from one process to another.  Any
  614. process P2 that already possesses a handle to a process P1 can obtain a 
  615. handle for use by a third process P3.  Once P1 and P3 have been introduced,
  616. P3 can freely call procedures in P1 (and vice versa).
  617.  
  618. Although a process can, by aborting the ALOPORT system procedure, prevent
  619. its introduction to another process and so restrict the set of processes
  620. that gain access to it, finer access controls may sometimes be required.
  621. A process may, for example, house two separate resources, one of which
  622. is to be made available only to its parent (for example), and the other
  623. to any process to which the parent introduces it.  Before such a strategy
  624. can be conveniently implemented, the Model must be extended to permit
  625. access controls to be independently applied to individual resources within
  626. a single process.
  627.  
  628. Although a single procedure can be considered a resource, it is more practical and convenient to conceive of larger, composite resources
  629. consisting of a number of related procedures.  A simple data base
  630. management module containing procedures for creating, deleting, assigning
  631. values to, reading, and searching for data objects exemplifies such 
  632. composite resources.  Although each procedure is useless in isolating, the
  633. whole family of procedures provides a meaningful service.  Such "package"
  634. of logically related procedures might thus be the most reasonable object
  635. of the finer access controls to be defined.
  636.  
  637. Access controls can be applied to packages by requiring that a process 
  638. first "open" and obtain a handle for a remote package before it may call
  639. any of the procedures it contains.  When the process attempts to open
  640. the package, its right to do so can be verified and the attempt aborted if
  641. necessary.  Challenging the open attempt would, of course, be less expensive 
  642. than challenging every procedure call.  The opening of a package would also
  643. provide a convenient time for package-dependent state information to be
  644. initialized.
  645.  
  646.  
  647.  
  648.  
  649.  
  650.                                  -11-
  651.  
  652. Network Working Group                          James E. White
  653. Request for Comments:  708    Elements of a Distributed Programming System
  654.                     Some Possible Extensions to the Model
  655.                     Controlling Access to Local Resources
  656.  
  657.  
  658.  
  659. Adding to the Protocol the following pair of system procedures enables the
  660. environment to open and close packages within another process.  For 
  661. efficiency, these procedures manipulate an arbitrary number of packages
  662. in a single transaction.
  663.  
  664.     OPNPACKAGE (packages ->    pkhs)
  665.             LISTofCHARSTRs LISTofINDEXs
  666.     CLSPACKAGE (pkhs)
  667.            (as above)
  668.  
  669. The first procedure opens and returns "package handles PKHS" for the 
  670. specified PACKAGES; the second closes one or more packages and releases
  671. the handles PKHS previously obtained for them.
  672.  
  673. Besides incorporating these two new system procedures, the Protocol must
  674. further require that a package handle accompany the procedure name in every
  675. CALL message (an EMPTY handle perhaps designating a system procedure).  Note
  676. that this requirement has the side effect of making the package the domain
  677. within which procedure names must be unique.
  678.  
  679. The system procedures described above enable the environment to make
  680. available to its applications program, primitives that have calling
  681. sequences similar to those of the corresponding system procedures but
  682. which accept the process handle of the target process as an additional
  683. argument.  Their implementation requires only that the environment
  684. identify the remote process from its internal tables and invoke OPNPACKAGE
  685. or CLSPACKAGE in that process.
  686.  
  687. 4.  Standardizing Access to Global Variables
  688.  
  689. Conventional systems often maintain global "variables" that can be accessed
  690. by modules throughout the system.  Such variables are typically manipulated
  691. using primitives of the form:
  692.  
  693.     (1)  Return the current value of V.
  694.     (2)  Replace the current contents of V with a new value.
  695.  
  696. These primitives are either provided as language constructs or implemented
  697. by specialized procedures.  The former approach encourages uniform
  698. treatment of all variables within the system.
  699.  
  700. Those distributed systems that maintain remotely-accessible variables must
  701. also select a strategy for implementing the required access primitives.  
  702. While such primitives can, of course, be implemented as specialized
  703.  
  704.  
  705.                                      -12-
  706.  
  707.  
  708.  
  709. Network Working Group                          James E. White
  710. Request for Comments:  708    Elements of a Distributed Programming System
  711.                        Some Possible Extensions to the Model
  712.                     Standardizing Access to Global Variables
  713.  
  714.  
  715. applications procedures, adding to the Protocol the following new system
  716. procedures insures a uniform run-time access mechanism:
  717.  
  718.     RDVARIABLE (pkh,  variable -> value)
  719.             INDEX CHARSTR     any
  720.     WRVARIABLE (pkh,  variable, value)
  721.             INDEX CHARSTR   any
  722.  
  723. These procedures effectively define variables as named data objects modeled
  724. from PCP data types, and suggest that they be clustered in packages with
  725. related procedures.  The system procedures return and specify, respectively,
  726. the VALUE of the VARIABLE whose name and package handle PKH are specified.
  727.  
  728. These new procedures enable the environment to make available its applications
  729. program, primitives that have calling sequences similar to those of the 
  730. corresponding system procedures but which accept the process handle of the
  731. target process as an additional argument.  These primitives provide a basis
  732. upon which a suitably modified compiler can reestablish the compile-time
  733. uniformity that characterizes the manipulation of variables in conventional
  734. programming environments.  Their implementation requires only that the local
  735. environment identify the remote process from its internal tables and invoke
  736. RDVARIABLE or WRVARIABLE in that process.
  737.  
  738. Most variables will restrict the range of data types and values that may be
  739. assigned to them; some may even be read-only.  But because they are modeled
  740. using PCP data types, their values can, in principle, be arbitrarily complex
  741. (for example, a LIST of LISTS) and the programmer may sometimes wish to
  742. manipulate only a single element of the variable (or, if the element is 
  743. itself a LIST, just one of its elements; and so on, to arbitrary depth).
  744.  
  745. Adding the following argument to their calling sequences extends the system
  746. procedures proposed above to optionally manipulate a single element of a
  747. variable's composite value:
  748.  
  749.     substructure
  750.     (LISTofINDEXs)
  751.  
  752. At successive levels of the value's tree structure, the INDEX of the desired
  753. element is identified; the resulting list of indices identifies the
  754. SUBSTRUCTURE whose value is to be returned or replaced.
  755.  
  756.  
  757.  
  758.  
  759.  
  760.                                      -13-
  761.  
  762. Network Working Group                          James E. White
  763. Request for Comments:  708    Elements of a Distributed Programming System
  764.                        Some Possible Extensions to the Model
  765.                        Routing Parameters Between Procedures
  766.  
  767.  
  768. 5.  Routing Parameters Between Procedures
  769.  
  770. In conventional programming systems, the results of procedures are used in a
  771. variety of ways, depending upon the context of the calls made upon them.  A
  772. result may, for example:
  773.  
  774.     (1)  Provide the basis for a branch decision within the calling
  775.          program.
  776.     (2)  Become an argument to a subsequent procedure call.
  777.     (3)  Be ignored and thus effectively discarded.
  778.  
  779. At run-time, the knowledge of a result's intended use usually lies solely
  780. within the calling program, which examines the results, passes it to a
  781. second procedure, or ignores it as it chooses.
  782.  
  783. In a distributed system, the transportation of results from callee to caller,
  784. carried out by means of one of more inter-process messages, can be an
  785. expensive operation, especially when the results are large.  Data movement 
  786. can be reduced in Cases 2 and 3 above by extending the Model to permit the
  787. intended disposition of each procedure result to be made known in advance
  788. to the callee's environment.  In Case 2, provided both callees reside
  789. within the same process, the result can be held at its source and later
  790. locally supplied to the next procedure.  In Case 3, the result can be 
  791. discarded at its source (perhaps not even computed), rather than sent and
  792. discarded at its destination.
  793.  
  794. 5.1  Specifying Parameters Indirectly
  795.  
  796. Variables offer potential for the eliminating the inefficiencies involved in
  797. Case 2 above by providing a place within the callees' process where results 
  798. generated by one procedure can be held until required by another.  The
  799. Protocol can be extended to permit variables to be used in this way by 
  800. allowing the caller of any procedure to include optional "argument- and 
  801. result-list mask" like the following as additional parameters of the CALL
  802. message:
  803.  
  804.     parameter list mask
  805.     [LIST variable, ...)]
  806.           [CHARSTR]
  807.  
  808. A parameter list mask would permit each parameter to be transmitted either
  809. directly, via the parameter list, or indirectly via a VARIABLE within the
  810. callee's process.  Thus each element of the mask specifies how the callee's
  811.  
  812.  
  813.  
  814.  
  815.                                     -14-
  816.  
  817.  
  818.  
  819. Network Working Group                          James E. White
  820. Request for Comments:  708    Elements of a Distributed Programming System
  821.                        Some Possible Extensions to the Model
  822.                        Routing Parameters Between Procedures
  823.  
  824.  
  825. environment is to obtain or dispose of the corresponding parameter.  To supply
  826. the result of one procedure as an argument to another, the caller need only
  827. then appropriately set corresponding elements of the result and argument
  828. list masks in the first and second calls, respectively.  The result list
  829. mask should be ignored if the procedure fails, and the error number and
  830. diagnostic message returned directly to the caller.
  831.  
  832. 5.2  Providing Scratch Variables for Parameter Routing
  833.  
  834. Although each applications program could provide variables for use as described
  835. above, a more economical approach is to extend the Model to permit special
  836. "scratch variables," maintained by the environment without assistance from
  837. its applications program, to be created and deleted as necessary at run-time.
  838. Adding to the Protocol the following pair of system procedures enables the
  839. local environment to create and delete such variables in a remote process:
  840.  
  841.     CRTVARIABLE (variable, value)
  842.              CHARSTR   any
  843.     DELVARIABLE (variable)
  844.              CHARSTR
  845.  
  846. These procedures create and delete the specified VARIABLE, respectively.
  847. CRTVARIABLE also assigns an initial VALUE to the newly-created variable.
  848.  
  849. These new procedures enable the environment to make available to its
  850. applications program, primitives that have calling sequences similar to
  851. those of the corresponding system procedures but which accept the process
  852. handle of the target process as an additional argument.  Their implementation
  853. required only that the environment identify the remote process from its
  854. internal tables and invoke CRTVARIABLE or DELVARIABLE in that process.
  855.  
  856. 5.3  Discarding Results
  857.  
  858. The inefficiencies that result in Case 3 above are conveniently eliminated
  859. by allowing the caller to identify via the result list mask (for example,
  860. via a zero-length CHARSTR) that a result will be ignored and therefore need
  861. not be returned to the caller.
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.                                     -15-
  871.  
  872.  
  873.  
  874. Network Working Group                          James E. White
  875. Request for Comments:  708    Elements of a Distributed Programming System
  876.                        Some Possible Extensions to the Model
  877.                Supporting a Richer Spectrum of Control Transfers
  878.  
  879.  
  880. 6.  Supporting a Richer Spectrum of Control Transfers
  881.  
  882. As currently defined by the Model, a procedure call is a simple two-stage
  883. dialog in which the caller first describes the operation it wishes performed
  884. and the callee, after performing the operation, reports its outcome.  
  885. Although this simple dialog form is sufficient to conveniently implement
  886. a large class of distributed systems, more complex forms are sometimes 
  887. required.  The Model can be extended to admit a variety of more powerful 
  888. dialog forms, of which the four described below are examples.
  889.  
  890. 6.1  Transferring Control Between Caller and Callee
  891.  
  892. Many conventional programming systems permit caller and callee to exchange
  893. control any number of times before the callee returns.  Such "coroutine
  894. linkages" provide a means, for example, by which the callee can obtain 
  895. help with a problem that it has encountered or deliver the results of one
  896. suboperation and obtain the arguments for the next.
  897.  
  898. Adding to the Protocol the following system procedure, whose invocation
  899. relinquishes control of another, previously initiated procedure, enables
  900. the environment to effect a coroutine linkage between caller and callee:
  901.  
  902.     TAKEPROCEDURE (tid,  yourtid, parameters)
  903.                 INDEX BOOLEAN  LIST
  904.  
  905. Its arguments include the identifier TID of the affected transaction, an
  906. indication YOURTID of from whose name space the identifier was assigned
  907. (that is, whether the process relinquishing control is the caller or callee),
  908. and PARAMETERS provided by the procedure surrendering control.  By exploiting 
  909. an existing provision of the Protocol (that is, by declining acknowledgment
  910. of its calls to TAKEPROCEDURE) the invoking environment can effect the
  911. control transfer with a single inter-process message.
  912.  
  913. The addition of this new procedure to the Protocol enables the environment
  914. to provide the following new primitive to its applications program:
  915.  
  916.     LINKPROCEDURE (tid,  arguments -> outcome,  results)
  917.                INDEX LIST         [BOOLEAN] LIST
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.                                   -16-
  926.  
  927. Network Working Group                          James E. White
  928. Request for Comments:  708    Elements of a Distributed Programming System
  929.                        Some Possible Extensions to the Model
  930.                   Supporting a Richer Spectrum of Control Transfers
  931.  
  932.  
  933. This primitive assumes that the CALLPROCEDURE primitive is also modified to
  934. return the pertinent transaction identifier should the callee initiate a
  935. coroutine linkage rather than return.  Invocation of LINKPROCEDURE then 
  936. continues the dialog by supplying ARGUMENTS and returning control to the remote
  937. procedure, and then awaiting the next transfer of control and the RESULTS that
  938. accompany it.  If the remote procedure then returns, rather than initiating
  939. another coroutine linkage, the primitive reports its OUTCOME and invalidates 
  940. the transaction identifier.
  941.  
  942. While this primitive blocks the applications program until the remoter
  943. procedure relinquishes control, a variant that simply initiates the coroutine
  944. linkage and allows the applications program to collect the outcome and
  945. results in a second operation can also be provided.
  946.  
  947. 6.2  Signaling the Caller/Callee
  948.  
  949. A monolog is often more appropriate than the dialog initiated by a coroutine
  950. linkage.  The caller or callee might wish, for example, to report an event it 
  951. has detected or send large parameters piecemeal to minimize buffering
  952. requirements.  Since no return parameters are required in such cases, the
  953. initiating procedure need only "signal" its partner, while retaining control
  954. of the call.
  955.  
  956. Adding to the Protocol the following system procedure extends the Model to
  957. support signals and enables the environment to transmit parameters to or
  958. from another, previously initiated procedure without relinquishing control
  959. of the call:
  960.  
  961.     SGNLPROCEDURE (tid,  yourtid, parameters)
  962.                INDEX BOOLEAN  LIST
  963.  
  964. Like the TAKEPROCEDURE procedure already described, its arguments include
  965. the identifier TID of the affected transaction, an indication YOURTID of
  966. from whose name space the identifier was assigned, and the PARAMETERS
  967. themselves.
  968.  
  969. This new procedure enables the environment to make available to its
  970. applications program a primitive that has a calling sequence similar to that 
  971. of the system procedure but which does not require YOURTID as an argument.
  972. Its implementation requires only that the environment identify the remote
  973. process via its internal tables and invoke SGNLPROCEDURE in that process.
  974.  
  975.  
  976.  
  977.  
  978.                                     -17-
  979.  
  980.  
  981. Network Working Group                          James E. White
  982. Request for Comments:  708    Elements of a Distributed Programming System
  983.                        Some Possible Extensions to the Model
  984.                              Supporting a Richer Spectrum of Control Transfers
  985.  
  986.  
  987. By requesting the acknowledgment of each call to SGNLPROCEDURE and, if 
  988. necessary, delaying subsequent calls affecting the same transaction until
  989. the acknowledgment arrives, the invoking environment effects a crude form of 
  990. flow control and so prevents the remote process' buffers from being overrun.
  991.  
  992. 6.3  Soliciting Help from Superiors
  993.  
  994. As in conventional programming systems, remotely callable procedures within
  995. a distributed system will sometimes call upon others to carry out portions
  996. of their task.  Each procedure along the "thread of control" resulting from
  997. such nested calls is, in a sense, responsible to not only its immediate caller
  998. but also to all those procedures that lie above it along the control thread.
  999. To properly discharge its responsibilities, a procedure must sometimes
  1000. communicate with these "superiors."
  1001.  
  1002. Occasionally a procedure reaches a point in its execution beyond which it
  1003. cannot proceed without external assistance.  It might, for example, require
  1004. additional resources or further direction from the human user upon whose
  1005. behalf it is executing.  Before reaching this impasse, the procedure may 
  1006. have invested considerable real and/or processing time that will be lost
  1007. if it aborts.
  1008.  
  1009. Adding to the Protocol the following system procedure minimizes such
  1010. inefficiencies by enabling the environment to solicit help from a callee's
  1011. superiors:
  1012.  
  1013.     HELPPROCEDURE (tid,  number, information -> solution)
  1014.                INDEX INDEX   any            any
  1015.  
  1016. Its arguments include the identifier TID of the affected transaction (the
  1017. direction of the control transfer being implicit in this case), a NUMBER
  1018. identifying the problem encountered, and arbitrary supplementary
  1019. INFORMATION.  
  1020.  
  1021. The primitive that this new procedure enables the environment to provide
  1022. its applications program has an identical calling sequence.  Its implementation
  1023. requires only that the environment identify the remote process from its
  1024. internal tables and invoke HELPPROCEDURE in that process.
  1025.  
  1026. The search for help begins with invocation of HELPPROCEDURE in the caller's
  1027. environment.  If the caller understands the problem (that is, recognizes
  1028.  
  1029.  
  1030.  
  1031.  
  1032.                                      -18-
  1033.  
  1034.  
  1035.  
  1036.  
  1037. Network Working Group                                James E. White
  1038. Request for Comments:  708       Elements of a Distributed Programming Model
  1039.                       Supporting a Richer Spectrum of Control Transfers
  1040.  
  1041.  
  1042. its number) and is able to solve it, HELPPROCEDURE will simply return whatever
  1043. SOLUTION information the caller provides.  Otherwise, HELPPROCEDURE must give
  1044. the next superior an opportunity to respond by calling itself recursively in 
  1045. that process.  The search terminates as soon as a superior responds positively
  1046. or when the end of the control thread is reached.  In the latter case, each of
  1047. the nested HELPPROCEDURE procedures returns unsuccessfully to indicate to its
  1048. caller that the search failed.
  1049.  
  1050. 6.4  Reporting an Event to Superiors
  1051.  
  1052. A procedure sometimes witnesses or causes an event of which its superiors
  1053. should be made aware (for example, the start or completion of some major
  1054. step in the procedure's execution).  Adding to the Protocol the following
  1055. system procedure enables the environment to notify a callee's superiors of an 
  1056. arbitrary event:
  1057.  
  1058.     NOTEPROCEDURE (tid,  number, information)
  1059.                INDEX INDEX   any
  1060.  
  1061. Like HELPPROCEDURE, its arguments include the identifier TID of the
  1062. transaction it affects, a NUMBER identifying the event being reports, and
  1063. arbitrary supplementary INFORMATION.
  1064.  
  1065. The primitive that this new procedure enables the environment to provide its
  1066. applications program has an identical calling sequence.  Its implementation
  1067. requires only that the environment identify the remote process from its
  1068. internal tables and invoke NOTEPROCEDURE in that process.
  1069.  
  1070. By requesting acknowledgment of each call to NOTEPROCEDURE and, if necessary,
  1071. delaying subsequent calls that affect that transaction until the acknowledgment
  1072. arrives, the invoking environment effects a crude form of flow control and so
  1073. prevents the remote process' buffers from being overrun.
  1074.  
  1075. Notification of the procedure's superiors begins with invocation of 
  1076. NOTEPROCEDURE in the caller's process and works its way recursively up the
  1077. thread of control until the top is reached.
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.                                      -19-
  1090.  
  1091.  
  1092.  
  1093.  
  1094. Network Working Group                        James E. White
  1095. Request for Comments:  708      Elements of a Distributed Programming System
  1096.                          Some Possible Extensions to the Model
  1097.                          Aborting Executing Procedures
  1098.  
  1099.  
  1100. 7.  Aborting Executing Procedures
  1101.  
  1102. Conventional systems that accept commands from the user sometimes permit him
  1103. to cancel an executing command issued inadvertently or with erroneous
  1104. parameters, or one for whose completion he cannot wait.  This ability is
  1105. particularly important when the command (for example, one that compiles a
  1106. source file) has a significant execution time.  In a distributed system, the
  1107. execution of such a command may involve the invocation of one or more remote
  1108. procedures.  Its cancellation, therefore, requires the abortion of any 
  1109. outstanding remote procedure calls.
  1110.  
  1111. Adding to the Protocol the following system procedure provides the basis
  1112. for a command cancellation facility by enabling the environment to abort
  1113. another, previously invoked procedure:
  1114.  
  1115.     ABRTPROCEDURE (tid)
  1116.                INDEX
  1117.  
  1118. Its sole argument is the identified TID of the transaction it affects.
  1119.  
  1120. The primitive that this new procedure enables the environment to make 
  1121. available to the applications program has an identical calling sequence.
  1122. Its implementation requires only that the local environment identify the
  1123. remote process from its internal tables and invoke ABRTPROCEDURE in that
  1124. process.
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.                                  -20-
  1147.  
  1148. Network Working Group                          James E. White
  1149. Request for Comments:  708    Elements of a Distributed Programming System
  1150.                                  Conclusions
  1151.  
  1152.  
  1153.                               CONCLUSION
  1154.  
  1155.  
  1156. The EXPANDED Protocol and Model that result from the extensions proposed in
  1157. the present paper are summarized in Appendixes B and C, respectively.  
  1158. Needless to say, many additional forms and aspects of process interaction,
  1159. of which Appendix D suggests a few, remain to be explored.  Nevertheless,
  1160. the primitives already made available by the run-time environment provide
  1161. the applications programmer with a powerful and coherent set of tools for
  1162. constructing distributed systems.
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.                                   -21-
  1205.  
  1206. Network Working Group                          James E. White
  1207. Request for Comments:  708    Elements of a Distributed Programming System
  1208.                                  Acknowledgments
  1209.  
  1210.  
  1211.                            ACKNOWLEDGMENTS
  1212.  
  1213.  
  1214. Many individuals within both SRI's Augmentation Research Center (ARC) and the
  1215. larger ARPANET community have contributed their time and ideas to the
  1216. development of the Protocol and Model described in this and its companion
  1217. paper.  The contributions of the following individuals are expressly
  1218. acknowledged:  Dick Watson, Jon Postel, Charles Irby, Ken Victor, Dave Maynard,
  1219. Larry Garlick of ARC; and Bob Thomas and Rick Schantz of Bolt, Beranek and
  1220. Newman, Inc. 
  1221.  
  1222. ARC has been working toward a high-level framework for network-based
  1223. distributed systems for a number of years now [2].  The particular Protocol
  1224. and Model result from research begun by ARC in July of 1974.  This research 
  1225. included developing the Model; designing and documenting, and implementing
  1226. a prototype run-time environment for a particular machine [4, 5], specifically
  1227. a PDP-10 running the Tenex operating system developed by Bolt, Beranek and
  1228. Newman, Inc. [6].  Three design iterations were carried out during a 12-month
  1229. period and the resulting specification implemented for Tenex.  The Tenex RTE
  1230. provides a superset of the capabilities proposed in this paper.
  1231.  
  1232. The work reported here was supported by the Advanced Research Project Agency
  1233. of the Department of Defense, and by the Rome Air Development Center of the
  1234. Air Force.
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.                                    -22-
  1261.  
  1262. Network Working Group                        James E. White
  1263. Request for Comments:  708      Elements of a Distributed Programming System
  1264.             Appendix A:  Transmission Formats for PCP Data Objects
  1265.  
  1266.  
  1267.                               APPENDIX A
  1268.  
  1269.               TRANSMISSION FORMATS FOR PCP DATA OBJECTS
  1270.  
  1271.  
  1272. Data objects must be encoded in a standard transmission format before they can
  1273. be sent from one process to another via the Protocol.  An effective strategy 
  1274. is to define several formats and select the most appropriate one at run-time,
  1275. adding to the Protocol a mechanism for format negotiation.  Format negotiation
  1276. would be another responsibility of the environment and could thus be made
  1277. completely invisible to the applications program.
  1278.  
  1279. Suggested below are two transmission formats.  The first is a 36-bit binary
  1280. format for use between 36-bit machines, the second an 8-bit binary, "universal"
  1281. format for use between dissimilar machines.  Data objects are fully typed in 
  1282. each format to enable the environment to automatically decode and internalize
  1283. incoming parameters should it be desired to provide this service to the
  1284. applications program.
  1285.  
  1286. PCPB36, For Use Between 36-Bit Machines
  1287.  
  1288.     Bits  0-13 Unused (zero)
  1289.     Bits 14-17 Data type
  1290.        EMPTY  =1  INTEGER=4  LIST=7
  1291.        BOOLEAN=2  BITSTR =5
  1292.        INDEX  -3  CHARSTR=6
  1293.     Bits 18-20 Unused (zero)    
  1294.     Bits 21-35 Value or length N
  1295.        EMPTY       unused (zero)
  1296.        BOOLEAN     14 zero-bits + 1-bit value (TRUE=1/FALSE=0)
  1297.        INDEX       unsigned value
  1298.        INTEGER     unused (zero)
  1299.        BITSTR      unsigned bit count N
  1300.        CHARSTR     unsigned character count N
  1301.        LIST        unsigned element count N
  1302.     Bits 36-   Value
  1303.        EMPTY    unused (nonexistent)
  1304.        BOOLEAN  unused (nonexistent)
  1305.        INDEX    unused (nonexistent)
  1306.        INTEGER  two's complement full-word value
  1307.        BITSTR   bit string + zero padding to word boundary
  1308.        CHARSTR  ASCII string + zero padding to word boundary
  1309.        LIST     element data objects
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.                                     -23-
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321. Network Working                                          James E. White
  1322. Request for Comments:  708    Elements of a Distributed Programming System
  1323.                   Appendix A:  Transmission Formats for PCP Data Objects
  1324.  
  1325.  
  1326. PCPB8, For Use Between Dissimilar Machines
  1327.  
  1328.     Byte    0  Data type
  1329.        EMPTY  =1  INTEGER=4  LIST=7
  1330.        BOOLEAN=2  BITSTR =5
  1331.        INDEX  =3  CHARSTR=6
  1332.     Bytes 1-   Value
  1333.        EMPTY      unused (nonexistent)
  1334.        BOOLEAN    7 zero-bits + 1-bit value (TRUE=1/FALSE=0
  1335.        INDEX      2 byte unsigned value
  1336.        INTEGER    4-type two's complement value
  1337.        BITSTR     2-byte unsigned bit count N + bit string
  1338.                + zero padding to byte boundary
  1339.        CHARSTR    2-byte unsigned character count N + ASCII string
  1340.        LIST          2-byte element count N + element data objects
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.                                        -24-
  1372.  
  1373. Network Working Group                          James E. White
  1374. Request for Comments:  708    Elements of a Distributed Programming System
  1375.                Appendix B:    The Expanded Procedure Call Protocol
  1376.  
  1377.  
  1378.                               APPENDIX B
  1379.  
  1380.                  THE EXPANDED PROCEDURE CALL PROTOCOL
  1381.  
  1382.  
  1383. The Protocol that results from the extensions proposed in this paper is
  1384. summarized below.  The reader should note the concise syntactic description
  1385. made possible by the underlying notion of PCP data types.
  1386.  
  1387. Parameter list masks have been included not only as additional parameters
  1388. of the CALL message, as proposed in the paper, but as arguments of the
  1389. TAKEPROCEDURE and SGNLPROCEDURE system procedures as well.  Throughout the
  1390. Protocol description, "MASK" is shorthand for:
  1391.  
  1392.     [LIST (variable [CHARSTR], ...)]
  1393.  
  1394. Messages
  1395.  
  1396.     LIST (route INDEX, opcode INDEX CALL=1, tid [INDEX],
  1397.           pkh [INDEX], procedure CHARSTR, arguments LIST,
  1398.           argumentlistmask MASK, resultlistmask MASK)
  1399.     LIST (route INDEX, opcode INDEX RETURN=2, tid INDEX,
  1400.           outcome BOOLEAN, results LIST)
  1401.  
  1402.        If OUTCOME is FALSE
  1403.           RESULTS is LIST (error INDEX, diagnostic CHARSTR)
  1404.  
  1405. Process-Related System Procedures
  1406.  
  1407.     INIPROCESS (program CHARSTR,
  1408.             credentials LIST (error CHARSTR, password CHARSTR,
  1409.                       account CHARSTR))
  1410.     ALOPORT    (-> ph INDEX, computer CHARSTR, port)
  1411.     CNNPORT    (ph INDEX, computer CHARSTR, port)
  1412.     DCNPORT    (ph INDEX)
  1413.     CRTROUTE   (mycode INDEX, oldcode [INDEX]
  1414.             -> code INDEX, ph INDEX)
  1415.     DELROUTE   (yourcode INDEX)
  1416.  
  1417. Package-Related System Procedures
  1418.  
  1419.     OPNPACKAGE (packages LISTofCHARSTRs -> pkhs LISTofINDEXs)
  1420.     CLSPACKAGE (pkhs LISTofINDEXs)
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.                                       -25-
  1428.  
  1429.  
  1430.  
  1431. Network Working Group                          James E. White
  1432. Request for Comments:  708    Elements of a Distributed Programming System
  1433.                Appendix B:  The Expanded Procedure Call Protocol
  1434.  
  1435.  
  1436. Variable-Related System Procedures
  1437.  
  1438.     CRTVARIABLE (variable CHARSTR, value)
  1439.     DELVARIABLE (variable CHARSTR)
  1440.     RDVARIABLE  (pkh INDEX, variable CHARSTR,
  1441.              substructure [LISTofINDEXs] -> value)
  1442.  
  1443. Procedure-Related System Procedures
  1444.  
  1445.     TAKEPROCEDURE (tid INDEX, yourtid BOOLEAN, parameters LIST,
  1446.                argumentlistmask MASK, resultlistmask MASK)
  1447.     SGNLPROCEDURE (tid INDEX, yourtid BOOLEAN, parameters LIST,
  1448.                parameterlistmask MASK)
  1449.     HELPPROCEDURE (tid INDEX, number INDEX, information -> solution)
  1450.     NOTEPROCEDURE (tid INDEX, number INDEX, information)
  1451.     ABRTPROCEDURE (tid INDEX)
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.                                      -26-
  1484.  
  1485. Network Working Group                        James E. White
  1486. Request for Comments:  708         Elements of a Distributed Programming
  1487.                     Appendix C:  Summary of RTE Primitives
  1488.  
  1489.  
  1490.                               APPENDIX C
  1491.  
  1492.                       SUMMARY OF RTE PRIMITIVES
  1493.  
  1494.  
  1495. The DPS primitives made available to the applications program as a result of
  1496. the Model extensions proposed in this paper are summarized below.  
  1497. Collectively, they provide the applications programmer with a powerful
  1498. and coherent set of tools for constructing distributed systems.  Some of
  1499. the primitives (for example, CRTPROCESS and DELPROCESS) are necessary elements
  1500. for a "network operating system (NOS)," into which DPS may itself one day
  1501. evolve.
  1502.  
  1503.     CRTPROCESS (computer, program, credentials -> PH)
  1504.     DELPROCESS (ph)
  1505.     ITDPROCESS (ph1, ph2 -> ph12, ph21, ih)
  1506.     SEPPROCESS (ih)
  1507.  
  1508. Packages
  1509.  
  1510.     OPNPACKAGE (ph, packages -> pkhs)
  1511.     CLSPACKAGE (ph, pkhs)
  1512.  
  1513. Variables
  1514.  
  1515.     CRTVARIABLE (ph, variable, value)
  1516.     DELVARIABLE (ph, variable)
  1517.     RDVARIABLE  (ph, pkh, variable, substructure -> value)
  1518.     WRTVARIABLE (ph, pkh, variable, substructure, value)
  1519.  
  1520. Procedures
  1521.  
  1522.     CALLPROCEDURE (ph, pkh, procedure, arguments, argumentlistmask,
  1523.                resultlistmask, -> outcome, results, tid)
  1524.     LINKPROCEDURE (tid, arguments, argumentlistmask,
  1525.                resultlistmask, -> outcome, results)
  1526.     SGNLPROCEDURE (tid, parameters, parameterlistmask)
  1527.     HELPPROCEDURE (tid, number, information -> solution)
  1528.     NOTEPROCEDURE (tid, number, information)
  1529.     ABRTPROCEDURE (tid)
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.                                     -27-
  1540.  
  1541. Network Working Group              Elements of a Distributed Programming System
  1542. Request for Comments:  708    Appendix D:  Additional Areas for Investigation
  1543.  
  1544.  
  1545.                               APPENDIX D
  1546.  
  1547.                   ADDITIONAL AREAS FOR INVESTIGATION
  1548.  
  1549.  
  1550. Although the expanded distributed programming system developed in this paper
  1551. and summarized in the previous appendix is already very powerful, many
  1552. additional aspects of process interaction remain, of course, to be explored.
  1553. Among the additional facilities that the Protocol must eventually enable the
  1554. environment to provide are mechanisms for:
  1555.  
  1556.     (1)  Queuing procedure calls for long periods of time (for
  1557.          example, days).
  1558.  
  1559.     (2)  Broadcasting requests to groups of processes.
  1560.  
  1561.     (3)  Subcontracting work to other processes (without remaining
  1562.          a middleman).
  1563.  
  1564.     (4)  Supporting brief or infrequent inter-process exchanges
  1565.          with minimal startup overhead.
  1566.  
  1567.     (5)  Recovering from and restarting after system errors.
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.                                     -28-
  1595.  
  1596. Network Working Group        Elements of a Distributed Programming System
  1597. Request for Comments:  708                      References
  1598.  
  1599.  
  1600.                               REFERENCES
  1601.  
  1602.  
  1603. 1.  White, J. E., "A High-Level Framework for Network-Based Resource Sharing,"
  1604.     submitted for publication in the AFIPS Conference Proceedings of the 1976
  1605.     National Computer Conference.
  1606.  
  1607. 2.  Watson, R. W., Some Thoughts on System Design to Facilitate Resource
  1608.     Sharing, ARPA Network Working Group Request for Comments 592, Augmentation
  1609.     Research Center, Stanford Research Institute, Menlo Park, California,
  1610.     November 20, 1973 (SRI-ARC Catalog Item 20391).
  1611.  
  1612. 3.  White, J. E., DPS-10 Version 2.5 Implementor's Guide, Augmentation
  1613.     Research Center, Stanford Research Institute, Menlo Park, California,
  1614.     August 15, 1975 (SRI-ARC Catalog Item 26282).
  1615.  
  1616. 4.  White, J. E., DPS-10 Version 2.5 Programmer's Guide, Augmentation Research
  1617.     Center, Stanford Research Institute, Menlo Park, California, August 13, 
  1618.     1975 (SRI-ARC Catalog Item 26271).
  1619.  
  1620. 5.  White, J. E., DPS-10 Version 2.5 Source Code, Augmentation Research
  1621.     Center, Stanford Research Institute, Menlo Park, California, August 13,
  1622.     1975 (SRI-ARC Catalog Item 26267).
  1623.  
  1624. 6.  Bobrow, D. G., Burchfiel, J. D., Murphy, D. L., Tomlinson, R. S., "TENEX,
  1625.     a paged Time Sharing System for the PDP-10," Communications of the ACM,
  1626.     Vol. 15, No. 3, pp. 135-143, March 1972.
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.                                     -29-
  1651. Network Working Group        Elements of a Distributed Programming System
  1652. Request for Comments:  708                     Figure List
  1653.  
  1654.  
  1655.                              FIGURE LIST
  1656.  
  1657.  
  1658. Fig. 1    Interfacing distant applications programs via their run-time
  1659.     environments and an IPC channel.
  1660.  
  1661. Fig. 2    Two processes that can only be introduced via a logical channel.
  1662.  
  1663. Fig. 3  A logical channel.
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.                                       -30-