📄 rfc1833.txt
字号:
Network Working Group R. SrinivasanRequest for Comments: 1833 Sun MicrosystemsCategory: Standards Track August 1995 Binding Protocols for ONC RPC Version 2Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.ABSTRACT This document describes the binding protocols used in conjunction with the ONC Remote Procedure Call (ONC RPC Version 2) protocols.TABLE OF CONTENTS 1. Introduction 1 2. RPCBIND Program Protocol 2 2.1 RPCBIND Protocol Specification (in RPC Language) 3 2.2 RPCBIND Operation 9 2.2.1 RPCBIND Version 3 9 2.2.2 RPCBIND, Version 4 10 3. Port Mapper Program Protocol 11 3.1 Port Mapper Protocol Specification (in RPC Language) 11 3.2 Port Mapper Operation 13 References 14 Security Considerations 14 Author's Address 141. Introduction This document specifies the binding protocols used in conjunction with ONC RPC Version 2. As a prerequisite, the reader is expected to be familiar with [1] and [2] which describe the ONC RPC Version 2 and XDR (eXternal Data Representation) protocols. An RPC service is identified by its RPC program number, version number, and the transport address where it may be reached. The transport address, in turn, consists of a network address and a transport selector. In the case of a service available over TCP/IP or UDP/IP, the network address will be an IP address, and the transport selector will be a TCP or UDP port number.Srinivasan Standards Track [Page 1]RFC 1833 Binding Protocols for ONC RPC Version 2 August 1995 A client program needs to know the RPC program number, version number, and the transport address corresponding to a service in order to utilize the service. Of these, the RPC program number and version number are usually built into the client program, as part of the service definition. The network address component of the transport address is usually available in a name service, or is given as a parameter to the client program. The transport selector (ie., the TCP or UDP port) is usually determined dynamically, and varies with each invocation of the service. Server programs allocate a transport address, and register it with a well-known lookup service (well-known because it uses a fixed transport selector, and resides at the same network address as the server). Client programs consult the lookup service in order to obtain the server's transport address. Such a lookup service is very desirable because the range of well- known transport selectors is very small for some transports and the number of services is potentially very large. By running only the lookup service on a well-known transport selector, the transport addresses of other remote programs can be ascertained by querying the lookup service. This document describes three versions of a lookup service, all of which use the same RPC program number (100000). They all use port 111 over TCP and UDP transports. Versions 3 and 4 are described in Section 2 ("RPCBIND Program Protocol"). Version 2 is described in Section 3 ("Port Mapper Program Protocol"). The distinguishing characteristic of RPCBIND (versions 3 and 4) is that this protocol uses a transport-independent format for the transport address, known as the universal address format. An address in universal address format is an ASCII string representation of the transport dependent address. String representation of addresses corresponding to a transport are defined by the addressing authority for the transport. The RPCBIND protocol can be used for binding ONC RPC clients and servers over any transport. The Port Mapper (version 2), on the other hand, is an older protocol that is specific to TCP and UDP. It handles TCP and UDP ports directly.2. RPCBIND Program Protocol The RPCBIND program maps RPC program and version numbers to universal addresses, thus making dynamic binding of remote programs possible. The RPCBIND program is bound to a well-known address of each supported transport, and other programs register their dynamically allocated transport address with it. The RPCBIND program then makesSrinivasan Standards Track [Page 2]RFC 1833 Binding Protocols for ONC RPC Version 2 August 1995 those addresses publicly available. The RPCBIND program also aids in broadcast RPC. A given RPC program will usually have different transport address bindings on different machines, so there is no way to directly broadcast to all of these programs. The RPCBIND program, however, does have a well-known address. So, to broadcast to a given program, the client actually sends its message to the RPCBIND program located at the broadcast address. Each instance of the RPCBIND program that picks up the broadcast then calls the local service specified by the client. When the RPCBIND program gets the reply from the local service, it sends the reply back to the client.2.1 RPCBIND Protocol Specification (in RPC Language)/* * rpcb_prot.x * rpcbind protocol, versions 3 and 4, in RPC Language *//* * rpcbind address for TCP/UDP */const RPCB_PORT = 111;/* * A mapping of (program, version, network ID) to address * * The network identifier (r_netid): * This is a string that represents a local identification for a * network. This is defined by a system administrator based on local * conventions, and cannot be depended on to have the same value on * every system. */struct rpcb { unsigned long r_prog; /* program number */ unsigned long r_vers; /* version number */ string r_netid<>; /* network id */ string r_addr<>; /* universal address */ string r_owner<>; /* owner of this service */};struct rp__list { rpcb rpcb_map; struct rp__list *rpcb_next;};Srinivasan Standards Track [Page 3]RFC 1833 Binding Protocols for ONC RPC Version 2 August 1995typedef rp__list *rpcblist_ptr; /* results of RPCBPROC_DUMP *//* * Arguments of remote calls */struct rpcb_rmtcallargs { unsigned long prog; /* program number */ unsigned long vers; /* version number */ unsigned long proc; /* procedure number */ opaque args<>; /* argument */};/* * Results of the remote call */struct rpcb_rmtcallres { string addr<>; /* remote universal address */ opaque results<>; /* result */};/* * rpcb_entry contains a merged address of a service on a particular * transport, plus associated netconfig information. A list of * rpcb_entry items is returned by RPCBPROC_GETADDRLIST. The meanings * and values used for the r_nc_* fields are given below. * * The network identifier (r_nc_netid): * This is a string that represents a local identification for a * network. This is defined by a system administrator based on * local conventions, and cannot be depended on to have the same * value on every system. * * Transport semantics (r_nc_semantics): * This represents the type of transport, and has the following values: * NC_TPI_CLTS (1) Connectionless * NC_TPI_COTS (2) Connection oriented * NC_TPI_COTS_ORD (3) Connection oriented with graceful close * NC_TPI_RAW (4) Raw transport * * Protocol family (r_nc_protofmly): * This identifies the family to which the protocol belongs. The * following values are defined: * NC_NOPROTOFMLY "-" * NC_LOOPBACK "loopback"Srinivasan Standards Track [Page 4]RFC 1833 Binding Protocols for ONC RPC Version 2 August 1995 * NC_INET "inet" * NC_IMPLINK "implink" * NC_PUP "pup" * NC_CHAOS "chaos" * NC_NS "ns" * NC_NBS "nbs" * NC_ECMA "ecma" * NC_DATAKIT "datakit" * NC_CCITT "ccitt" * NC_SNA "sna" * NC_DECNET "decnet" * NC_DLI "dli" * NC_LAT "lat" * NC_HYLINK "hylink" * NC_APPLETALK "appletalk" * NC_NIT "nit" * NC_IEEE802 "ieee802" * NC_OSI "osi" * NC_X25 "x25" * NC_OSINET "osinet" * NC_GOSIP "gosip" * * Protocol name (r_nc_proto): * This identifies a protocol within a family. The following are * currently defined: * NC_NOPROTO "-" * NC_TCP "tcp" * NC_UDP "udp" * NC_ICMP "icmp" */struct rpcb_entry { string r_maddr<>; /* merged address of service */ string r_nc_netid<>; /* netid field */ unsigned long r_nc_semantics; /* semantics of transport */ string r_nc_protofmly<>; /* protocol family */ string r_nc_proto<>; /* protocol name */};/* * A list of addresses supported by a service. */struct rpcb_entry_list { rpcb_entry rpcb_entry_map; struct rpcb_entry_list *rpcb_entry_next;};typedef rpcb_entry_list *rpcb_entry_list_ptr;Srinivasan Standards Track [Page 5]RFC 1833 Binding Protocols for ONC RPC Version 2 August 1995/* * rpcbind statistics */const rpcb_highproc_2 = RPCBPROC_CALLIT;const rpcb_highproc_3 = RPCBPROC_TADDR2UADDR;const rpcb_highproc_4 = RPCBPROC_GETSTAT;const RPCBSTAT_HIGHPROC = 13; /* # of procs in rpcbind V4 plus one */const RPCBVERS_STAT = 3; /* provide only for rpcbind V2, V3 and V4 */const RPCBVERS_4_STAT = 2;const RPCBVERS_3_STAT = 1;const RPCBVERS_2_STAT = 0;/* Link list of all the stats about getport and getaddr */struct rpcbs_addrlist { unsigned long prog; unsigned long vers; int success; int failure; string netid<>; struct rpcbs_addrlist *next;};/* Link list of all the stats about rmtcall */struct rpcbs_rmtcalllist { unsigned long prog; unsigned long vers; unsigned long proc; int success; int failure; int indirect; /* whether callit or indirect */ string netid<>; struct rpcbs_rmtcalllist *next;};typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];typedef rpcbs_addrlist *rpcbs_addrlist_ptr;typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;struct rpcb_stat { rpcbs_proc info; int setinfo; int unsetinfo; rpcbs_addrlist_ptr addrinfo; rpcbs_rmtcalllist_ptr rmtinfo;};Srinivasan Standards Track [Page 6]RFC 1833 Binding Protocols for ONC RPC Version 2 August 1995/* * One rpcb_stat structure is returned for each version of rpcbind * being monitored. */typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];/* * netbuf structure, used to store the transport specific form of * a universal transport address. */struct netbuf { unsigned int maxlen; opaque buf<>;};/* * rpcbind procedures */program RPCBPROG { version RPCBVERS { bool RPCBPROC_SET(rpcb) = 1; bool RPCBPROC_UNSET(rpcb) = 2; string RPCBPROC_GETADDR(rpcb) = 3; rpcblist_ptr RPCBPROC_DUMP(void) = 4; rpcb_rmtcallres RPCBPROC_CALLIT(rpcb_rmtcallargs) = 5; unsigned int RPCBPROC_GETTIME(void) = 6; netbuf RPCBPROC_UADDR2TADDR(string) = 7; string RPCBPROC_TADDR2UADDR(netbuf) = 8; } = 3;Srinivasan Standards Track [Page 7]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -