home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 00s / rfc56.txt < prev    next >
Text File  |  1997-07-02  |  13KB  |  325 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                Ed Belove (Harvard)
  8. Request for Comments: 56                            Dave Black (Harvard)
  9.                                                        Bob Flegel (Utah)
  10.                                                  Lamar G. Farquar (Utah)
  11.                                                                June 1970
  12.  
  13.  
  14.                           Third Level Protocol
  15.  
  16.                             Logger Protocol
  17.  
  18.                           General Description
  19.  
  20.  
  21. In our view of the world each host has a set of four programs to allow a
  22. user teletype to communicate with a foreign monitor. The exact
  23. implementation of these programs is highly installation-dependent.  Thus
  24. all explanations are meant to describe functional characteristics rather
  25. than design.
  26.  
  27. The four programs come in two male/female pairs. A user employs a send-
  28. logger at his site to communicate with receive-logger at the appropriate
  29. foreign site in order to establish a full duplex link between the user's
  30. teletype and the foreign machine's monitor. This puts him in the
  31. equivalent of a pre-logged in state at the other machine.  After the
  32. link has been established, the two loggers drop out of the picture, and
  33. the user is left talking to a sender in his machine, whose main function
  34. is to take input from the user's teletype and send it down the link that
  35. was established by the loggers to the receiver in the foreign host which
  36. passes it along to its monitor (making it look like input from a local
  37. teletype). Replies from the foreign monitor are given by it to the
  38. receiver, which transmits them back along the link to the sender, which
  39. outputs them on the user's teletype. The sender and receiver in each
  40. machine must either exist in multiple copies, one for each network user,
  41. or there must be a single copy which can handle all of the network
  42. users. The loggers, however, need be able to handle only one user at a
  43. time, since their task is quickly accomplished, leaving them free to
  44. satisfy other requests.  However there should be some method of queuing
  45. requests that can not be satisfied immediately. A less satisfactory
  46. alternative would be to give a busy message to any user who tries to use
  47. the logger while it is busy. (This, of course, does not preclude the
  48. possibility of an installation having a re-entrant logger, or of having
  49. multiple copies of the logger.)
  50.  
  51. The receive-logger should be user zero in every machine and should
  52. always be listening to socket zero. (This same thing can be accomplished
  53. by having the NCP intercept all messages to user zero, socket zero, and
  54. send them to the receive-logger; but it is simpler and cleaner to have
  55.  
  56.  
  57.  
  58.                                                                 [Page 1]
  59.  
  60. the logger actually be user zero and have the NCP handle its messages
  61. the same as everyone else's.)
  62.  
  63. When the send-logger is called, it pulls a pair of unused sockets (2N
  64. and 2N+1) from a pool of free sockets and CONNECT from 2N+1 to User 0,
  65. Socket 0 in the desired foreign host. This activates the receive-logger,
  66. which accepts the connection if it has an available slot for the foreign
  67. teletype. He then immediately closes down this connection to allow links
  68. from other sources to be initiated. If, on the other hand, there is no
  69. room for the foreign teletype (or if, for some other reason, the
  70. receive-logger does not wish to connect) the attempted link to socket
  71. zero is refused. This notifies the send-logger that he cannot log on the
  72. foreign host and it then notifies the user of this fact. There is no
  73. guarantee, however, that the close was actually sent by the foreign
  74. logger. It could have been sent by the NCP if, for example, the pending
  75. call queue for the socket was overloaded.
  76.  
  77. If the link to socket zero has been accepted (thus indicating that the
  78. receive-logger can accommodate the request) after closing that link, the
  79. receive-logger picks an available pair of sockets (2M and 2M+1) from its
  80. pool, and connects from 2M+1 to 2N. (It found the identity of 2N when
  81. its listen was answered by the link with 2N+1.)  The send-logger has
  82. meanwhile listened to socket 2N and now accepts the link, and CONNECTS
  83. from 2N+1 to 2M. The receive-logger has been listening to this socket
  84. and accepts the attempted link.
  85.  
  86. At this point, there is a full duplex connection between the two
  87. loggers. They then activate the sender and receiver, which handle all
  88. other communication between the user and the foreign monitor.  (The
  89. senders and receivers can be part of the loggers, or can be called by
  90. them, etc.)
  91.  
  92. When the user is finished and escapes back to his monitor, it is up to
  93. the sender to close down the links. On the receiving end, it would be
  94. highly desirable for the NCP to notify the receiver of this fact, so it
  95. could log the user off (if he had failed to do that himself) and could
  96. free any resources that he had been using.
  97.  
  98. A more formal outline of the proposed protocol described in the scenario
  99. above follows:
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.                                                                 [Page 2]
  112.  
  113.    1. Stable state: receive-logger at foreign host listening to User 0,
  114.    Socket 0.
  115.  
  116.    2. Local user calls send-logger.
  117.  
  118.    3. Send-logger calls CONNECT (port, 2N+1, <foreign host#,0,0>).
  119.  
  120.    4. Send-logger calls LISTEN (port, <local host#, user#, 2N>).
  121.  
  122.    5. Foreign logger's LISTEN is answered, and he is told local user
  123.    number, host and #2N+1.
  124.  
  125.    6. Foreign logger looks for available sockets (2M and 2M+1).  If they
  126.    exist and it is able to establish connection, it accepts and then
  127.    immediately closes the link.
  128.  
  129.    7. Foreign logger calls CONNECT (port, 2M+1, <local host#, user#,
  130.    2N>).
  131.  
  132.    8. Foreign logger calls LISTEN (port, <local host#, user#, 2M>).
  133.  
  134.    9. Send-logger has listened to 2N and accepts link, then calls
  135.    CONNECT (port, 2N+1, <foreign host#, user#,2M>).
  136.  
  137.    10. Receive-logger, which is listening on 2M, accepts link.
  138.  
  139.    11. Loggers activate appropriate handlers.
  140.  
  141.    12. When the user is finished, sender closes down both links.
  142.  
  143. This basic method of establishing a full duplex connection should be
  144. standard throughout the network. The particular way each installation
  145. handles the implementation of the sender, receiver, and the two loggers
  146. is of no consequence to the network and is highly machine dependent.
  147. (Even the fact of needing a sender and receiver is machine dependent in
  148. that some members of the network might be able to handle their functions
  149. in other ways.) However, some conventions must be established regarding
  150. communication between the sender and receiver, or their equivalents.
  151.  
  152. Network Standard Code
  153.  
  154. In order to facilitate use of the network, we propose the convention
  155. that all teletype-to-foreign-monitor communication be done using 128
  156. character USASCII. (This is the code used by the IMP's and is in the
  157. appendix to the IMP operating manual.) It makes sense to require
  158. machines to make only one conversion to a standard code, than to have to
  159. make conversions to every code on the net.
  160.  
  161.  
  162.  
  163.  
  164.                                                                 [Page 3]
  165.  
  166. In addition, since most of the network machines use ASCII as their
  167. internal character code, it will be no trouble for them. Even those
  168. machines that use a different code must translate to and from ASCII in
  169. order to communicate with local teletypes. Extending this translation to
  170. the network should cause very little trouble. We envision this
  171. translation as taking place in the sender and receiver, but again that
  172. is implementation dependent.
  173.  
  174. If ASCII is adopted as a standard, we would suggest that all non-ASCII
  175. machines create a monitor to the machine's internal code. This would
  176. make the complete character set available to those who wished to use it
  177. (and were willing to write a simple conversion routine for the local
  178. machine.) In this way, those users who wanted to could use any machine
  179. on the net from their teletype, without requiring their machines to have
  180. records of all the network codes, and yet could use the full power of
  181. the foreign machine if they wanted.
  182.  
  183. Again, this standard applies only for teletype-to-foreign-monitor
  184. communication.
  185.  
  186. Break Characters
  187.  
  188. A standard way of handling the break character has to be established for
  189. the network and be included in the protocol. Problems with the break
  190. character arise in several contexts. First, there are two distinct
  191. purposes served by the break character. One is as a panic button. This
  192. says, "I do not care what is happening, stop and get me out to monitor
  193. level now." This command is executed immediately upon receipt, and is
  194. most commonly used to get out of a program that one does not want to be
  195. in (e.g., one that is in an infinite loop, etc.)
  196.  
  197. The other purpose that is served is that of an exit from a subsystem, or
  198. on a machine with a forking structure as a method to get back to the
  199. next higher level fork. This second purpose is not an immediate one in
  200. that the user wants the system to finish all that he has told it to do
  201. before exiting.
  202.  
  203. We assume that there does not exist in every system 1) a way of
  204. performing each of these functions, or 2) a clear cut distinction
  205. between the calling and operation of the two. Furthermore, there are
  206. subtle distinctions as to how each system treats the commands.
  207.  
  208. The panic button function can easily be performed by the proposed
  209. control command <INT>. This function must be accomplished by using a
  210. control command, since a program can enter a state where it is accepting
  211. no input: hence, the program cannot be aborted by sending it a message
  212. down the teletype link. There is no reason to worry about the race
  213. condition caused by sending this command down the control link since its
  214.  
  215.  
  216.  
  217.                                                                 [Page 4]
  218.  
  219. whole purpose is to force the machine to disregard everything else the
  220. user has sent.
  221.  
  222. In our implementation of this, we would ask the user to specify to the
  223. logger a seldom used character that he wants to be his foreign panic
  224. button. Then, it would be a simple task for the sender to map this
  225. character into an <INT> command, which the foreign machine must
  226. interpret properly. This scheme would work well for most machines, but
  227. some may lend themselves to different ways of generating the <INT>.
  228.  
  229. The other problem that presents itself is what to do if the foreign
  230. machine's "exit" character is the same as the local machine's.  The
  231. problem is that while a user is talking to a foreign machine, he would
  232. want to be in a transparent mode, where everything he types is sent
  233. directly to the other machine. The way he would get himself out of this
  234. mode is to type either his machine's "exit" character or its panic
  235. button. Thus, if the foreign machine has the same one, there would be no
  236. way to send it. The way out of this is the same as above--merely a
  237. mapping of another seldom used character into the foreign machine's
  238. "exit" character. This type of mapping can be carried as far as each
  239. installation deems necessary. Giving the user complete control over
  240. translation is helpful in that it allows him to user characters that his
  241. teletype cannot generate.
  242.  
  243. Command Message Formats
  244.  
  245. Each site should establish its now conventions about when to send a
  246. monitor command string, and in what size chunks. When performing a
  247. routine operation, one might want to send several command lines as a
  248. single message. If working with the monitor as usual, a reasonable break
  249. point might be at every carriage return. When using a highly interactive
  250. language such as QED, one might decide character-by-character
  251. transmission was a necessity. We feel that each user should have the
  252. choice between these three methods (and possible more). Furthermore, the
  253. user should be able to change between each mode at will. The differences
  254. in syntax of the send-message commands mentioned above should be noted.
  255. For the first, a special send-message command character must be defined,
  256. and it should not be sent along with the message. For the second, the
  257. carriage return acts dually as the send-message command and as a command
  258. delimiter. Therefore it must be sent with the message. Finally, the case
  259. of character-by-character transmission with its implicit send command
  260. should pose no significant problems.
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.                                                                 [Page 5]
  271.  
  272. The preceding discussion is meant to imply also that the receiver must
  273. be able to buffer up each of the above types of transmission into a form
  274. acceptable to its own monitor interface.
  275.  
  276. In addition, all echoing should be done in the local host, with the
  277. foreign machine suppressing its echoes (if it can.)
  278.  
  279.  
  280. We would like to thank Carl Ellison (of Utah) for his valuable
  281. suggestions and criticisms of this work, and Jim Curry (of Utah) for his
  282. encouragement and support of the effort.
  283.  
  284.  
  285.        [ This RFC was put into machine readable form for entry ]
  286.           [ into the online RFC archives by Jon Ribbens 7/97 ]
  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.  
  321.  
  322.  
  323.                                                                 [Page 6]
  324.  
  325.