📄 rfc147.txt
字号:
Network Working Group Request for Comment 147 NIC 6750 The Definition of a Socket Joel M. Winett Lincoln Laboratory 360/67 7 May 1971Category: C1, C3, D1, HRFC obsoleted: NoneRFC updated: NoneRelated RFCs: RFC-129 (NIC-5845) This material has not been reviewed for public release and is intended only for use with the ARPA network. It should not be quoted or cited in any publication not related to the ARPA network. [Page 1] MASSACHUSETTS INSTITUTE OF TECHNOLOGY LINCOLN LABORATORYTO: Network Socket Committee and Network Community 7 May 1971FROM: J. M. Winett (LL)SUBJECT: The Definition of a SocketA socket is defined to be the unique identification to or from whichinformation is transmitted in the network. The socket is specified as a 32bit number with even sockets identifying receiving sockets and odd socketsidentifying sending sockets. A socket is also identified by the host inwhich the sending or receiving processer is located.Previous network papers postulated that a process running under control ofthe host's operating system would have access to a number of ports. A portmight be a physical input or output device, or a logical I/O devicesupported by system calls to the host's operating system. The lattercategory includes a) I/O directed to a physical device which is beingspooled by the operating system, b) a physical device whose basiccharacteristics have not been altered but whose access has been limited andpossibly transformed by a mapping algorithm (e.g. device address mapping orcylinder relocation as in virtual mini disks), c) access to a file systemthrough a directory and access method maintained by the operating system,d) a procedure for process to process communications, e) a procedure formachine to machine communication (such as defined by the network protocol.)A socket has been defined to be the identification of a port for machine tomachine communication through the ARPA network. Sockets allocated to eachhost must be uniquely associated with a known process or be undefined. Thename of some sockets must be universally known and associated with a knownprocess operating with a specified protocol. (e.g., a logger socket, RJEsocket, a file transfer socket). The name of other sockets might not beuniversally known, but given in a transmission over a universally knownsocket, (c. g. the socket pair specified by the transmission over thelogger socket under the Initial Connection Protocol (ICP). In any case,communication over the network is from one socket to another socket, eachsocket being identified with a process running at a known host.The question arises as to whether socket names must be known to users ofnetwork programs or whether the specification of sockets can be madetransparent to the user. Also, should the socket used at one time by aprocess be the same socket used at a later time by the same process for thesame purpose? If sockets are not transparent to the user, then the socketsused must not be dependent on the order in which network connections aremade. [Page 2]Network Socket Committee and Network Community 7 May 1971The definition of a socket is also related to the accounting proceduresfollowed for network usage. Network Control Programs (NCPs) should logeach connection made and record the time the connection was made, the timethe connection was closed, the number of messages and number of bitstransmitted over the connection, the sending and receiving hosts, and thesockets at the sending host and receiving host which participated in theconnection. In order for these sockets to be meaningful, they should beidentifiable with the user, account, or process name with which each socketis associated.It has previously been suggested that the sockets used by a network user beidentified with that user no matter which host he used for networkcommunications. Users would be registered at some host and be identified asa user from that host even if he used the system as a second host tocommunicate with the system at a third host.To satisfy the above requirements within the name space of a 32 bit socket,the following procedure is suggested. This procedure has been implementedwith the NCP on the Lincoln Laboratory 360/67 system and is used by allprocesses making use of network facilities. ) A 32 bit socket is dividedinto an 8 bit "home" field, a 16 bit "user" field and an 8 bit "tag" field.The tag consists of a 7 bit "plug" and a one bit "polarity" where a "0"polarity indicates a receive socket and a "1" polarity indicates a sendsocket. Thus a user on one host system may run processes with up to 128send sockets and 128 receive sockets. This procedure allows for 256 hostsand 65,536 users per host. The only difficulty is in mapping user orprocess identifiers at a host into a 16 bit user number. This may be donethrough a table lookup, possibly using a hash coding technique. Thoughmany systems have a unique run time index associated with each process, ifthis index were used as the user number, the user number would not be thesame each time the process were used for network activity. What isrequired, is a unique mapping from a process identifier (usually acharacter string) into a 16 bit binary number.The sockets used for facilities following a common network protocol, suchas the ICP, should also follow this socket definition. Thus the loggersocket at the Lincoln Laboratory 360/67 would be, and is, x'0A0000 01, ',i.e. home 10, user 0, and tag 1.This procedure for defining sockets enables an accounting procedure foridentifying users of network facilities and for measuring network usage. [ This RFC was put into machine readable form for entry ] [ into the online RFC archives by BBN Corp. under the ] [ direction of Alex McKenzie. 12/96 ] [Page 3]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -