home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 100s / rfc129.txt < prev    next >
Text File  |  1997-04-17  |  11KB  |  325 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                         22 April 1971
  8. Request for Comments:  129               E. E. Harslem-Rand
  9. NIC 5845                                 J. F. Heafner-Rand
  10.                                          E.    Meyer-MIT
  11.  
  12.                        A REQUEST FOR COMMENTS ON
  13.                          SOCKET NAME STRUCTURE
  14.  
  15. INTRODUCTION
  16.  
  17.      This RFC is in answer to a request (made at the
  18. February NWG Meeting at the University of Illinois) that
  19. we comment on several suggested socket name structures.
  20. We apologize for the delay in getting out these comments
  21. and we hope that you will respond more quickly with your
  22. reactions.
  23.      Please direct your replies via the standard RFC
  24. mechanism.
  25.      Two structures are presented in this RFC as shown
  26. below.
  27.  
  28.                         31                 1
  29.           +-------------------------------+-+
  30.      1.   |         Arbitrary             | | <-- gender
  31.           +-------------------------------+-+
  32.  
  33.                         24             7   1
  34.           +------------------------+------+-+
  35.      2.   |        User ID         | tag  | | <-- gender
  36.           +------------------------+------+-+
  37.  
  38.      Three variations are given for the way in which
  39. socket names are assigned, as examples of use of the
  40. first structure.
  41.      1.   Users pick the arbitrary number arbitrarily
  42.           and associate it with a process.
  43.      2.   A logger chooses the arbitrary number dynamically
  44.           and associates it with a process via a directory.
  45.      3.   The arbitrary number is assigned outside of a
  46.           logger but may be issued by a logger to the
  47.           remote party.
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                                                                 [Page 1]
  59.  
  60. The second format shown above associates sockets specifi-
  61. cally with users as opposed to processes.
  62.      The following discussion covers three different schemes
  63. of socket identifier assignment using a simple example.
  64. User A at Host A has agreed (by letter, telephone, etc.)
  65. with User B at Host B for their respective processes to
  66. establish a connection through the Network at a particular
  67. time.  User B is to be waiting for the connection attempt
  68. initiated by User A.  The issues to be faced are those of
  69. addressing (how is User A to know to which socket to connect?),
  70. and of security (how are both users to be confident that
  71. they are talking each other, and not some interloper?).
  72.      A fourth scheme follows which addresses another concept
  73. of Network use--that connections are made between processes
  74. and that processes not users should be identified via
  75. Socket names.
  76.  
  77. FREELY SELECTED RANDOM SOCKET IDENTIFIERS (Scheme 1)
  78.  
  79.      Under this scheme a user is able to use any 32-bit
  80. socket identifier he chooses.  Two restrictions apply:  the
  81. least significant bit denotes the socket's gender (0-read,
  82. 1-write), and no more than one socket bearing a given iden-
  83. tifier can be active at a host at a time.
  84.      The two users select suitably random identifiers ("a"
  85. and "b").  User A will attempt to activate his socket with
  86. identifier "a" an connect it to socket "b" at Host B.  There
  87. is the possibility that somebody other than User B has
  88. activated socket "b" at Host B so that User A will address
  89. the wrong  party.  However, the possibility that some other
  90. user has accidentally picked this particular identifier is
  91. reasonably small, since there are about a billion different
  92. identifiers.  When the connection request from A gets to
  93. User B, he examines the identifier of the calling socket.
  94. If for some reasom it is not "a" or not from Host A, he
  95. rejects the request, because it is likely to be from some
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.                                                                 [Page 2]
  112.  
  113. outside party.  If the calling socket is named, "a" and
  114. from Host A, User B can be reasonably sure that it is from
  115. User A.  It is very unlikely that some other party will
  116. accidentally address socket "b" from a socket named "a".
  117.      The advantages of this scheme are:  simplicity and
  118. reasonable security in a non-malicious environment.  The
  119. disadvantages are that there are possibilities from annoy-
  120. ingly unavoidable conflicts with other users and that each
  121. pair of users must conduct a prior confidential private
  122. communication (as opposed to a broadcast announcement in
  123. more secure schemes).
  124.  
  125. HOST-SELECTED IDENTIFIERS PLUS DIRECTORY (Scheme 2)
  126.  
  127.      This system uses the same socket identifier structure
  128. as presented above, except that the Host picks the identi-
  129. fier at the time the socket is assigned, and the user has no
  130. no prior knowledge or control of the assignment.  By itself,
  131. this system would be totally unusable, because there would
  132. be no way for User A to address User B.  However, it allows
  133. certain service functions (such as the Network logger) to
  134. have specifically assigned sockets.
  135.      One of these is a Network Directory service.  This
  136. serves to relate a socket identifier at a particular host
  137. to the name of the user operating it.  This might either
  138. be a single distributed service, or there might be a separ-
  139. ate service at each host.
  140.      Under this scheme, each user, A and B, first activates
  141. his socket (or somehow gets his host to assign and tell
  142. him of a socket identifier).  Then he gets the Directory
  143. module at his host to associate his name with the identi-
  144. fier of the socket just activated.  Following this, User A
  145. in some manner gets the Directory Service at Host B to tell
  146. him the socket identifier assigned to User B.  Then User A
  147. dispatches a connection request for this socket.
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.                                                                 [Page 3]
  165.  
  166. When User B gets the request, he similarly calls on the
  167. Directory service at Host A to find out the name of the user
  168. who is operating the socket User B was called by.  If the
  169. name is that of User A, User B can safely accept the request.
  170. Otherwise, he rejects.
  171.      This scheme is rather cumbersome, but some directory
  172. services must exist for Host-selected socket identifiers to
  173. work.  On advantage of the Directory Service is thst it
  174. allows symbolic addressing.  A sizeable disadvantage in view
  175. of its complexity is that it does not provide absolute
  176. security.  (For exemple, after User A gets the identifier
  177. of the socket he is to address, User B could deactivate it,
  178. and somebody else could come along and get the same-named
  179. socket.)
  180.  
  181. ADMINISTRATIVELY ASSIGNED USER IDENTIFIERS (Scheme 3)
  182.  
  183.      This is the system that is put forth on page 5 of
  184. Protocol Document 1(8/3/70).  Under it a user is permanently
  185. assigned a user identifier by his home host.  There is a
  186. user identifier subfield within the socket identifier, and a
  187. user is permitted by an NCP to operate only those sockets
  188. bearing his uder identifier.  This gives the user a selec-
  189. tion of 256 sockets operable by him.
  190.      In arranging for the connection the two Users A and B
  191. tell each other their user identifiers (alternatively a user
  192. ID could be read from a directory), and User B specifies
  193. which of his sockets ("b") that he will "listen" on.  At
  194. connection time, User A selects one of his sockets and
  195. requests connection for it to socket "b" specified by User B.
  196. By protocol only User B can operate socket "b", so User A
  197. can be certain of reaching the right party.
  198.      When User B receives the connection request, he examines
  199. the user identifier subfield of the calling socket identifier.
  200. If it is the user identifier of User A, User B accepts the
  201. connection request, confident that it is actually User A at
  202. the other end.  Otherwise B rejects the request.
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.                                                                 [Page 4]
  218.  
  219. The advantages of this scheme are that if both hosts
  220. involved in a connection enforce the user ID assignment,
  221. the misconnection aspect of security is solved and there
  222. can be no socket naming conflict between users.  Also,
  223. arrangements can be made openly and publicly between many
  224. potential communicators.  A disadvantage to this scheme is
  225. that some systems may be incapable of insuring user ID
  226. integrity.
  227.  
  228. A VIEW OF SOCKET NAME MEANING (Scheme 4)
  229.  
  230.      Another view of Network use is that programs will con-
  231. nect to programs, via NCPs.  Some of these programs may be
  232. multi-access subsystems that are really agents for local
  233. consoles (and TELNETs).  Consoles will generally communicate
  234. through some such software agent rather than directly to
  235. an NCP.
  236.      Programs, then, must have a fixed, unique identifier,
  237. known to its remote users and perhaps to its local logger.
  238. The identifier is constant; it does not change from day to
  239. day.  If such a program is to allow multiple concurrent
  240. connections (for many or a single user) then it must have
  241. a range of variable identifiers as well.  It makes sense
  242. to group these sockets in a contiguous range.  The variable
  243. identifiers are transient and are dynamically associated
  244. with Network logical connections.
  245.  
  246.       +---------------------   ---------------------+
  247.       |                                           |
  248.       | Fixed, unique       /  /  Variable          |
  249.       | Identifier         /  /  Identifier         |
  250.       |                                           |
  251.       +---------------------   ---------------------+
  252.  
  253.       _________  _________/   _________  _________/
  254.                 /                       /
  255.        Identifies the           Identifies a particular
  256.        program uniquely         connection of the program
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.                                                                 [Page 5]
  271.  
  272. The above premise is that the program (or agent) is
  273. doing the communicating with an NCP and thus needs to be
  274. identified for message traffic routing from an NCP.  In
  275. the past it has been said that users can be mobile, i.e.,
  276. log on from different sites, and thus it is the user that
  277. needs identification.  In many typical on-line systems the
  278. user first requests a service and then identifies himself
  279. to the service for purposes of accounting, etc.  User IDs
  280. can be transmitted after requesting a service and can thus
  281. be elevated above the meaning of socket names.
  282.      A program might typically associate the terminals, for
  283. which it is an agent, with the variable part of the identi-
  284. fier, i.e., the particular connection(s).  For example,
  285. the Network Services Program (NSP) at Rand now uses the
  286. following format for socket names.  The first 24 bits are
  287. administratively assigned and would be known to a logger.
  288. The multiplex code is normally chosen randomly.  Predefined,
  289. fixed multiplex codes are possible also.
  290.  
  291.                 24                   7     1
  292.        +------------------------+---------+-+
  293.        | Program Number         |Multiplex| | <-- Gender
  294.        |                        |  Code   | |
  295.        +------------------------+---------+-+
  296.  
  297.      The Socket name structure #1 (page 1) thus accomodates
  298. the above example as well as other exploratory socket name
  299. structures and various "standards" superimposed on the arbi-
  300. trary field.
  301.  
  302.  
  303.        [ This RFC was put into machine readable form for entry ]
  304.          [ into the online RFC archives by Simone Demmel 4/97 ]
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.                                                                 [Page 6]
  324.  
  325.