home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / rfc / 1 / rfc0091.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  23.9 KB  |  591 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                          George H. Mealy
  8. Request for Comments:  91                      Harvard University
  9.                                                December 27, 1970
  10.  
  11.  
  12.  
  13.                      A PROPOSED USER-USER PROTOCOL
  14.  
  15. INTRODUCTION:
  16.  
  17. There are many good reasons, and maybe one or two bad ones, for making
  18. it appear that communication over the Network is only a special case of
  19. input/output -- at least as far as user programming is concerned.  Thus,
  20. for instance, the Harvard approach toward implementing the HOST-HOST
  21. protocol and Network Control Program treats each link as a "logical
  22. device" in PDP-10 terminology. Setting up a connection is similar to
  23. local device assignment, and communication over a link will make use of
  24. the standard system input/output UUO's.  This makes it possible to sue
  25. existing programs in conjunction with the Network without modification
  26. -- at least if other PDP-10's are being dealt with.
  27.  
  28. This takes us only so far, however.  The notion of a "logical device"
  29. does not exist on the PDP-10; it does on the IBM 360 (I am speaking here
  30. at the level of the operating system -- user program interface).
  31. Furthermore, in the absence of a Network standard requiring fixed
  32. representations for integers, reals, etc. (which I would oppose), any
  33. pair of user processes must arrive at a local agreement, and one or both
  34. must assume the burden of data conversion where necessary. Any standard
  35. protocol should allow such agreements to be given expression and should
  36. accommodate at least the minimum of control information that will allow
  37. such agreements to function in practice.  Finally, we must note that the
  38. IMP-IMP and HOST-HOST protocols do not provide for a check that an
  39. action requested by a user process is actually accomplished by the other
  40. processes; this type of issue has always been regarded as subject to
  41. treatment at the USER-USER protocol level.
  42.  
  43. This proposal is intended to face the above three types of issue only to
  44. a certain extent.  I can best explain that extent by stating the
  45. criteria I would use to judge any USER-USER protocol proposal:
  46.  
  47.          1.   The notion of a (logical) record
  48.               should be present, and the notion of a message should be
  49.               suppressed. (To a FORTRAN programmer, that which is
  50.               written using one WRITE statement with no accompanying
  51.               FORMAT is a record; to an OS/360 machine language
  52.               programmer, PUT writes a record).
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                                                                 [Page 1]
  59.  
  60.      2.   It should be possible to so implement the
  61.               protocol in HOST systems and/or library routines that now
  62.               existing user programs can access files anywhere in the
  63.               Network without program modification. (Initially, at
  64.               least, this ability must be restricted to HOST systems of
  65.               the same type).
  66.  
  67.          3.   The protocol should be implementable (not
  68.               necessarily implemented) in any HOST system at the SVC or
  69.               UUO level. Specific knowledge of the characteristics of
  70.               the other HOST involved should be unnecessary.
  71.  
  72. It should be noted that the above imply that some user programs must be
  73. aware of the nature of the other HOST -- at least in each case where the
  74. second criterion fails. As we make progress in (or give up on) the cases
  75. where the failure now occurs, the burden of accommodating system
  76. differences will shift toward implementation in protocols (i.e., the
  77. HOST systems) or, by default, in user programs.
  78.  
  79. Quite clearly, any proposal initiated today should be suspect as to the
  80. extent to which it "solves" ultimate problems. How ambitious to be is
  81. strictly a matter of taste. At this stage, I prefer to try something
  82. which I believe can be used by all of us (and, hence, is worth doing),
  83. goes a reasonable distance towards solving our short-range problems, is
  84. easy to do, and offers hope of viability in the long range view. In the
  85. following, I intend to describe the proposal itself with, I hope, proper
  86. motivational arguments for its pieces. I will then sketch the specific
  87. implementation we at Harvard are making for the PDP-10 and describe how
  88. we intend to apply it in the specific case of storage of files on other
  89. PDP-10's in the Network.
  90.  
  91.  
  92. USER-USER PROTOCOL (PROPOSAL)
  93.  
  94. The following protocol is intended to apply to the data bits in messages
  95. between the end of the marking bits and the beginning of the padding
  96. bits.
  97.  
  98. The present IMP-IMP and HOST-HOST protocols are unaffected by this
  99. proposal.
  100.  
  101. The general principle is that each segment (this is not a technical
  102. term) of data is preceded by control information specifying its nature
  103. and extent. The basic scheme has been evolved from that used in the SOS
  104. buffering system (see the papers in JACM, April 1959 and especially that
  105. by O.R. Mock).
  106.  
  107. Our point of view is that a link is a carrier of information.
  108.  
  109.  
  110.  
  111.                                                                 [Page 2]
  112.  
  113. Information is carried in segments of a fixed maximum length called
  114. messages*.
  115.  
  116. That this is so is an accident, from the user's point of view; when he
  117. wishes to transmit a contiguous stream of data, he will in general,
  118. segment it in a different (from the IMP-IMP or HOST-HOST protocol view)
  119. manner -- we will call his segment a record. It should be clear that
  120. this is entirely analogous between the notion of (physical) block and
  121. (logical) record. On the side, file storage systems also make use of
  122. control and status information; we will also.
  123.  
  124. At the USER-USER protocol level, all information transmitted over the
  125. link is a sequence of flags followed by (possibly null) data blocks.
  126.  
  127. The general format will be:
  128.  
  129.      OPERATION     COUNT     DATA
  130.  
  131. The OPERATION field is always present and is four bits long. The COUNT
  132. field, when present, gives the number of data bytes following in the
  133. data block. The bytes size is set be the last preceding SIZE flag (in
  134. most cases). The byte may be between zero and 255 bits long (Yes,
  135. Virginia, zero is zero even when you have a System/360). The OPERATION
  136. field and the COUNT field (when present) are called the flag and the
  137. data bytes (when present) the data block. Flags followed by data blocks
  138. (even when null due to a zero count) are called block flags, and other
  139. flags are called whyte* flags.
  140.  
  141. It is to be noted that, since the SIZE flag sets the byte size for the
  142. following blocks, byte size may be set at that "natural" for the sending
  143. or for the receiving HOST, depending on local agreement between the
  144. sending and receiving processes. It is specifically required that a SIZE
  145. flag appear in each message prior to any block flag (except the ASCII
  146. flag); the SIZE flag may be introduced on a default basis by the
  147. routine(s) implementing the protocol and is intended partially as a
  148. means of detecting certain classes of error.
  149.  
  150. The COUNT field is 8 bits in length (except in the EOM flag, where it is
  151. 16 bits long). The flags are as follows:
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.                                                                 [Page 3]
  165.  
  166. Whyte Flags:
  167.  
  168.  0 - NUL       No operation (consider next flag)
  169.  1 - RS        Record Separator (end of record)
  170.  2 - GS        Group Separator (end of group)
  171.  3 - FS        File Separator (end of file)
  172.  4 - ESC       Escape to local convention for flags
  173.  5 -             (reserved for later assignment)
  174.  6 - EOM N     End of Message (M is total bit count)
  175.  7 - SIZE N    Byte size is N bits
  176.  8 - IGNORE N  Ignore following data bits
  177.  
  178. Block Flags:
  179.  
  180.  9 - SYS N     N bytes of data for receiving HOST system
  181. 10 - CONTROL N N bytes of control data follow
  182. 11 - STATUS N  N bytes of status data follow
  183. 12 - LABEL N   N bytes of identification data follow
  184. 13 - KEY N     N bytes of key data follow
  185. 14 - ASCII N   N (8-bit) bytes of ASCII data follow
  186. 15 - BLOCK N   N bytes of data follow
  187.  
  188. I have already mentioned the requirement for SIZE. Absence of the SIZE
  189. floag in any message containing block flags (except ASCII) is a definite
  190. error. EOM is partially another error-checking device and partially a
  191. device for bypassing the padding conundrum. A user program should never
  192. see EOM on input; the user may write an EOM to force transmission. EOM
  193. delimits the end of the useful information in the message and restates
  194. the total number of bits in the message, starting with the first bit
  195. following the marking and ending with the last bit of the EOM count
  196. field, to check possible loss of information. This is a check against
  197. errors in the IMP-HOST electrical interface and in the HOST mushyware.
  198. EOM must appear at the end of each messager, unless ESC has apeared.
  199.  
  200. ESC is intended as a (hopefully) unused [a]scape hatch, for nonuse by
  201. those installations and/or applications wishing to avoid using more than
  202. four bits of the USER-USER protocol on any link. For instance, it may be
  203. desired to use a link as a bit stream, ignoring even message boundaries.
  204. If and when anarchists can achieve local agreement, more power to them!
  205.  
  206. NUL and IGNORE are intedned to be space fillers, in case it is helpful
  207. to make the first bit of the subsequent data block occur on a convenient
  208. address boundary. (An especially helpful HOST interrupt routine might
  209. even paste a combination of NUL and IGNORE over the marking bits when
  210. receiving a message -- in which case, their bit count should be
  211. transmitted on to the GET rountines to correct the EOM bit count check).
  212. The separator operations introduce the notions of logical record, group,
  213. and file. Specifically, there is no requirement that a record be
  214.  
  215.  
  216.  
  217.                                                                 [Page 4]
  218.  
  219. contained entirely within a message or that only a single record be
  220. contained in a message! In addition, there is no requirement that only
  221. one file be transmitted during a connection. For instance, a user might
  222. wish to use a link to transmit a collection of rountines, and then do
  223. something else with the link. By local agreement, then, a single routine
  224. might consist of a cumber of records forming a group, the whole
  225. collection might form a file, and the link might remain connected after
  226. the FS flag is received.
  227.  
  228. The interpretation of the various block flags is similarly open to local
  229. agreement. The two flags intended to convey pure data are ASCII and
  230. BLOCK; the difference between them is only (as far as the protocol is
  231. concerned) that the byte size is implicit for ASCII (8 bits) and
  232. explicit for BLOCK (the count field of the next preceding SIZE flag).
  233. Beyond this, however, the semantic content of the block following ASCII
  234. is governed by the current standards for ASCII; EBCDIC information may
  235. not be transmitted in an ASCII block!!
  236.  
  237. CONTROL and STATUS are intended for communication of control information
  238. between user processes, and the interpretation of their accompanying
  239. data blocks is open to local agreement.  Generically, CONTROL means "try
  240. to do the following" and STATUS means "but I feel this way, doctor." A
  241. CONTROL flag will prompt a returned STATUS flag, sooner or later, or
  242. never. LABEL is intended for use in identifying the following unit(s) of
  243. data, at the file or group level. Again, the specific interpretation is
  244. a matter of local agreement. KEY is intended to mimic the notion of
  245. address or key -- this is at the record, data item, or even physical
  246. storage block level. For the familiar with PDP-10 system and/or OS/360,
  247. the following parallels are offered for guidance:
  248.  
  249. USER-USER protocol       OS/360    PDP-10
  250.  
  251. CONTROL                  OPEN      OPEN
  252.                          CLOSE     CLOSE
  253. LABEL                    DSCB      File retrieval information
  254. KEY                      KEY       USERI/USETO argument
  255. CONTROL                  READ      IN/INPUT
  256.                          WRITE     OUT/OUTPUT
  257.                          ALLOCATE ?     ENTER
  258.                          OPEN ?    LOOKUP
  259. STATUS                   ?         GETSTS
  260.  
  261. The "?" notations above indicate lack of a very direct parallel.  It is
  262. worth noting that the OS/360 GET and PUT have direct parallels in any
  263. implementation of the USER-USER protocol that embodies the notion of
  264. record; our implementation of the protocol will lead to introduction of
  265. this notion for all PDP-10 input/output involving disc and tape storage,
  266. as well as IMP communication.
  267.  
  268.  
  269.  
  270.                                                                 [Page 5]
  271.  
  272. If I know the MULTICS terminology, I could extend the set of parallels
  273. above with more precision. Although my terminology has been drawn from
  274. systems with explicit input/output imperatives, I wish to emphasize that
  275. this setup in intended to handle control and data communication in
  276. general; MULTICS is a system in which the classical distinction between
  277. external and internal storage is blurred (from the user's point of view)
  278. in a manner I wish it blurred in the USER-USER protocol. I offer SYS
  279. with only slight trepidation. The general notion is that one should be
  280. able to communicate directly with a foreign HOST rather than via a
  281. foreign user process as its intermediary, SYS is like a UUO or SVC, but
  282. for the foreign HOST's consumption rather than my HOST's. From the
  283. HOST's point of view, the problem in implementation is in establishing a
  284. process context record unconnected with any local user process. This,
  285. however, is strongly associated with our current LOGON conundrum. On the
  286. PDP-10, for instance, users are more or less identified with local
  287. teletype lines, and any link is not one of those! Hence, subterfuge is
  288. necessary to let a foreign user log on. OS/360 is as (actually, more)
  289. perverse in its own way.
  290.  
  291. The process of logging a foreign process onto my local system is not
  292. (except possibly for MULTICS) a simple matter of having a special (!!)
  293. user job present w
  294. This proesponsible for doing it.  When and if
  295. anything else is possible, the HOST must provide a system instruction
  296. (UUO or SVC or whatever) that gives the requisite information
  297. establishing a process independent in all senses of the process that
  298. made the request. Otherwise, self- protection mechanisms which are
  299. reasonable for any system will make us all much more interdependent that
  300. we wish. To do this, there must exist in every system a UUO/SVC that
  301. does the right thing (ATTACH, but forget me). If this is true, then the
  302. LOGON process over the Network is tantamount to issuance of a foreign
  303. UUO/SVC by another node in the Network. I see no reasonable way around
  304. this. If that is the case, then SYS N is the kind of flag to use to
  305. convey the requisite data. If that is so, then it is only reasonable to
  306. let SYS convey a request for any OS instruction at the user program-
  307. operating system interface level!
  308.  
  309. The practical questions of implementation are something else! In the
  310. case of the PDP-10, I can pretty well see how to turn a SYS into either
  311. a LOGON request to execute a monitor command or UUO (would that they
  312. were the same) as the case might be. OS/360 is more sophisticaed,
  313. unfortunately. MULTICS might make it.  Naytheless, I hope that is clear
  314. that what we want to do, which is what the protocol should reflect, is
  315. quite a different question from that of how it is to be done in the
  316. context of a specific HOST system. What we want to do is, in general,
  317. rather independent of the system we are dealing with as far as the
  318. protocol is concerned, and we should not fail to introduce general
  319. notions into the protocol just because we are uncertain as to how they
  320. may have to be translated into particular implementation practice.
  321.  
  322.  
  323.  
  324.                                                                 [Page 6]
  325.  
  326. A PDP-10 IMPLEMENTATION
  327.  
  328. Although the following can be implemented as either a set of user
  329. routines or imbedded in the monitor as UUO's (our first implementation
  330. will be the former), the latter version will be used for descriptive
  331. purposes. The UUO's would be:
  332.  
  333.      PUTF    CH, E   Put flag
  334.      PUTD    CH, E   Put data
  335.      PUT     CH, E   Put record
  336.      GETFD   CH, E   Get flag or data
  337.      GET     CH, E   Get record
  338.  
  339. In the above, "CH" is the logical channel number. The customary OPEN or
  340. INIT UUO is used to open the channel. Standard format user buffers are
  341. assigned. However, the ring and buffer headers will be used in a
  342. nonstandard way, so that data mode 12 is assigned for used with Network
  343. buffering and file status bit 31 must be on for input. (Any of the
  344. devices DSK, DTA, MTA, or IMP can be used in this mode.)
  345.  
  346. In the Harvard NCP and HOST-HOST protocol implementation, user buffers
  347. do not correspond directly to messages. On output, each user buffer will
  348. be formatted into a message; on input, a message may become one or two
  349. user buffer loads (128 word buffers are used in order to make maximum
  350. use of the facilities of the disk services routines).
  351.  
  352. PUTF UUO:
  353.  
  354. This UUO places a flag into the output buffer. The effective address is
  355. the location of a word:
  356.  
  357.      XWD operation, count
  358.  
  359. In the case of block flags, the count is ignored, since it will be
  360. computed from the number of bytes actually placed in the buffer before
  361. the next use of PUTF. PUTF and PUTD will insert EOM flags automatically
  362. as each buffer becomes full; if data bytes are currently being placed in
  363. the buffer by PUTD, it will also insert an EOM flag after computing the
  364. count for the previous block flag in the buffer and place a new block
  365. flag of the same type at the beginning of the next buffer, after
  366. inserting a SIZE flag stating the then current byte size.
  367.  
  368. PUTD UUO:
  369.  
  370. This UUO places data into the output buffer. The effective address is
  371. the location of the data byte (if the byte size is less than 36) or of
  372. the next 36 bit word of data to be placed in the buffer. In the first
  373. case, the byte is assumed to be in the low order part of the word
  374.  
  375.  
  376.  
  377.                                                                 [Page 7]
  378.  
  379. addresses. In the second case, the data word containing the final bits
  380. of the byte contains them in the high order part of the word, and the
  381. next data byte starts a new word in PDP-10 storage. Thus, for a byte
  382. size of 64, two .ne 5 entries to PUTD would be used per byte
  383. transmitted, the first containing 36 bits and the second containing 28
  384. bits, left- justified. This strategy allows maximum use of the PDP-10
  385. byte handling instructions.
  386.  
  387. PUT UUO:
  388.  
  389. This UUO places a whole logical record in the output buffer(s).  The
  390. effective address is that of a word:
  391.  
  392.      IOWD count, location
  393.  
  394. A PUTF UUO must have been used to output the proper SIZE flag.
  395. Thereafter, each use of PUT will output a BLOCK flag,*
  396.  
  397. simulate a number of calls to PUTD using the IOWD to discover the
  398. location and size of the user data area, and then output a RS flag to
  399. indicate end of record.
  400.  
  401. In the case of byte size of less than 36 bits, PUT will use the ILDB
  402. instruction to pick up bytes to be output by PUTD. Hence, the standard
  403. PDP-10 byte handling format is used, and the count part of the IOWD is
  404. the total byte count, not word count.
  405.  
  406. The above UUO'S have both an error return and a normal return.
  407.  
  408. GETFD UUO:
  409.  
  410. The calling sequence for this UUO is:
  411.  
  412.      GETFD CH, E
  413.      error return
  414.      whyte flag return
  415.      block flag return
  416.      data return
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.                                                                 [Page 8]
  431.  
  432. The effective address is the location at which the flag or data will be
  433. returned. The flag is returned in the same format as for PUTF and the
  434. data in the same format as for PUTD. Certain flags (NUL, IGNORE, and
  435. EOM) will be handled entirely with the UUO and will not be reported to
  436. the user. SYS should eventually be handled this way, but initially will
  437. be handled by the user.
  438.  
  439. GET UUO:
  440.  
  441. The calling sequence for this UUO is:
  442.  
  443.      GET CH, E
  444.      error return
  445.      end of file return
  446.      end of group return
  447.      normal return
  448.  
  449. GET transmits the next logical record to the user, using GETFD together
  450. with an IOWD in the same format as for PUT. If the IOWD count runs out
  451. before end of record, the remainder of the record will be skipped. In
  452. any case, the updated IOWD will be returned at the effective address of
  453. the UUO in order to inform the user how much data was transmitted or
  454. skipped.
  455.  
  456. PDP-10 FILE TRANSMISSION:
  457.  
  458. Assume that I have a link connected to another PDP-10 and a user process
  459. there that is listening. In order to get that process to send me a file,
  460. the sequence of flags that might be transmitted can be represented as
  461. follows, where the UUO'S executed by me are in the left margin, the
  462. flags are indented, and the commentary opposite them indicates the
  463. nature of the data block transmitted:
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.                                                                 [Page 9]
  484.  
  485. PUT F
  486.      CONTROL   Data with OPEN parameters, requesting OPEN
  487.      LABEL     File identification data for LOOKUP
  488.      EOM       Forces message to be transmitted
  489.  
  490. GETFD
  491.      STATUS         Status returned by OPEN
  492.      SIZE      Byte size to be used
  493.      LABEL          File retrieval information
  494.  
  495. PUTF
  496.      CONTROL        Data requesting INPUT from file
  497.      EOM            Forces request to be transmitted
  498.  
  499. GETFD
  500.      STATUS         Status bits returned by INPUT
  501. GET                 Logical record (one file buffer load)
  502.      (loop back to second PUTF, above, for other records)
  503.  
  504. Finally, the status information returned by the second GETF indicates
  505. end of file, and I wind up with the sequence:
  506.  
  507. PUTF
  508.      CONTROL        Data requesting a CLOSE
  509.      EOM            Forces transmission
  510.  
  511. GETFD
  512.      STATUS         Status bits returned by CLOSE
  513.  
  514. In the case I am getting a file, the main loop looks like:
  515.  
  516. PUTF
  517.      CONTROL        Data requesting OUTPUT
  518.  
  519. PUT                 Logical record (one file buffer load) PUTF
  520.      EOM            Forces transmission
  521.  
  522. GETFD
  523.      STATUS         Status bits returned by OUTPUT
  524.  
  525. The use of both the record and the flag transmission UUO's is worth
  526. noting, as well as the use of the EOM flag to force transmission of a
  527. message when switching between input and output over the link. PUT and
  528. GET UUO's are clearly required above for transmission of the CONTROL and
  529. LABEL data; I suppressed them for the sake of clarity.
  530.  
  531. For this application, the handshaking nature of the transmission of
  532. CONTROL and STATUS flags are mandatory. While the protocol would permit
  533.  
  534.  
  535.  
  536.                                                                [Page 10]
  537.  
  538. transmission of a complete file without the handshaking, it would be an
  539. all or nothing proposition - a single error would necessitate doing it
  540. all over again, presuming that the receiving process did not end up in a
  541. complete tangle.
  542.  
  543. BRIEF DISCUSSION:
  544.  
  545. The PDP-10 space required to implement the above protocol is about 400
  546. instructions, divided equally between the input and the output side.
  547. Enough experimental coding has been done to confirm the feasibility of
  548. this basic strategy, taken together with experience with implementation
  549. and use of the SOS buffering system.
  550.  
  551. The above does not touch the question of LOGON protocol, except
  552. indirectly. My belief is that it can be accommodated in the framework of
  553. this proposal, but I have not tested this theory as yet. As indicated
  554. further above, I would be tempted to handle the matter with the SYS
  555. flag, given that SYS data is interpreted directly by the system (in our
  556. system, we would use the RUN UUO to run the LOGON CUSP, which would, in
  557. turn handshake using ASCII data over the link). In this way, I think we
  558. might be able to dispense with the notion of dedicated sockets and the
  559. reconnection morass.
  560.  
  561. One other point that needs thought is the question of how to handle the
  562. interrupt on link facility. Should it have any direct relation to the
  563. GET/PUT UUO's, or be handled on the side? I am inclined to think that it
  564. should be treated qua interrupt of the user process, quite independently
  565. of the matter of data transmission over the link. Some of our current
  566. work on the PDP-10 monitor would lend itself rather easily to
  567. implementation as a true interrupt.
  568.  
  569.  
  570. ENDNOTES*
  571.  
  572. 1.  A message is that string of bits between any two HOST-HOST headers.
  573. 2.  In memory of an attractive, but nonspelling, SDC secretary who
  574. could not distinguish between black and white, at least during 1957
  575. and in manuscript form.
  576. 3.  PUTF may be used to ouput the block flag, if a different from
  577. BLOCK is required.
  578.  
  579.  
  580.        [ This RFC was put into machine readable form for entry ]
  581.        [ into the online RFC archives by Colin Barrett  9/97   ]
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.                                                                [Page 11]
  590.  
  591.