home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_j_p / draft-ietf-oncrpc-rpcbind-01.txt < prev    next >
Text File  |  1996-08-28  |  28KB  |  1,069 lines

  1.  
  2.  
  3.  
  4. INTERNET-DRAFT                                         Stephen X. Nahm
  5. August 28, 1996                                        Sun Microsystems
  6.  
  7.                   Binding Protocols for ONC RPC Version 2
  8.  
  9.                      draft-ietf-oncrpc-rpcbind-01.txt
  10.  
  11.  
  12. ABSTRACT
  13.  
  14. This document describes the binding protocols used in conjunction with the
  15. ONC Remote Procedure Call (ONC RPC Version 2) protocols.
  16.  
  17.  
  18. STATUS OF THIS MEMO
  19.  
  20. This document is an Internet-Draft.  Internet-Drafts are working documents
  21. of the Internet Engineering Task Force (IETF), its areas, and its working
  22. groups.  Note that other groups may also distribute working documents as
  23. Internet-Drafts.
  24.  
  25. Internet-Drafts are draft documents valid for a maximum of six months.
  26. This Internet-Draft expires on February 28, 1996.  Internet-Drafts may be
  27. updated, replaced, or obsoleted by other documents at any time. It is not
  28. appropriate to use Internet-Drafts as reference material or to cite them
  29. other than as "work in progress."
  30.  
  31. To learn the current status of any Internet-Draft, please check the "1id-
  32. abstracts.txt" listing contained in the Internet-Drafts Shadow Directories
  33. on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au (Pacific
  34. Rim), ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast).
  35.  
  36. Distribution of this memo is unlimited.
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. Expires: February 28, 1996                                 [Page 1]
  61.  
  62.  
  63.  
  64. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  65.  
  66.  
  67. CONTENTS
  68.  
  69.    1. Introduction
  70.    2. RPCBIND Program Protocol
  71.    2.1 RPCBIND Protocol Specification (in RPC Language)
  72.    2.2 RPCBIND Operation
  73.    2.2.1 RPCBIND Version 3
  74.    2.2.2 RPCBIND, Version 4
  75.    3. Port Mapper Program Protocol
  76.    3.1 Port Mapper Protocol Specification (in RPC Language)
  77.    3.2 Port Mapper Operation
  78.    4. Security Considerations
  79.    5. References
  80.    6. AUTHOR'S ADDRESS
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123. Expires: February 28, 1996                                 [Page 2]
  124.  
  125.  
  126.  
  127. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  128.  
  129.  
  130. 1. Introduction
  131.  
  132. This document specifies the binding protocols used in conjunction with ONC
  133. RPC Version 2.  As a prerequisite, the reader is expected to be familiar
  134. with [1] and [2] which describe the ONC RPC Version 2 and XDR (External
  135. Data Representation) protocols.
  136.  
  137. An RPC service is identified by its RPC program number, version number, and
  138. the transport address where it may be reached.  The transport address, in
  139. turn, consists of a network address and a transport selector.  In the case
  140. of a service available over TCP/IP or UDP/IP, the network address will be
  141. an IP address, and the transport selector will be a TCP or UDP port number.
  142.  
  143. A client program needs to know the RPC program number, version number, and
  144. the transport address corresponding to a service in order to utilize the
  145. service.  Of these, the RPC program number and version number are usually
  146. built into the client program, as part of the service definition.  The
  147. network address component of the transport address is usually available in
  148. a name service, or is given as a parameter to the client program.  The
  149. transport selector (ie., the TCP or UDP port) is usually determined
  150. dynamically, and varies with each invocation of the service.  Server
  151. programs allocate a transport address, and register it with a well-known
  152. lookup service (well-known because it uses a fixed transport selector, and
  153. resides at the same network address as the server).  Client programs
  154. consult the lookup service in order to obtain the server's transport
  155. address.
  156.  
  157. Such a lookup service is very desirable because the range of well-known
  158. transport selectors is very small for some transports and the number of
  159. services is potentially very large.  By running only the lookup service on
  160. a well-known transport selector, the transport addresses of other remote
  161. programs can be ascertained by querying the lookup service.
  162.  
  163. This document describes three versions of a lookup service, all of which
  164. use the same RPC program number (100000, decimal).  They all use port 111
  165. over TCP and UDP transports.  Versions 3 and 4 are described in Section 2
  166. ("RPCBIND Program Protocol").  Version 2 is described in Section 3 ("Port
  167. Mapper Program Protocol").
  168.  
  169. The distinguishing characteristic of RPCBIND (versions 3 and 4) is that
  170. this protocol uses a transport-independent format for the transport
  171. address, known as the universal address format.  An address in universal
  172. address format is an ASCII string representation of the transport dependent
  173. address.  For example, the universal address format for a TCP/IP transport
  174. address is the dotted-decimal representation [3] of the address extended
  175. with the port number.  If the IP address is "192.0.0.1" and the port number
  176. is "111", then the universal address is "192.0.0.1.0.111".
  177.  
  178. String representation of addresses corresponding to a transport are defined
  179. by the addressing authority for the transport.  The RPCBIND protocol can be
  180. used for binding ONC RPC clients and servers over any transport.
  181.  
  182.  
  183.  
  184.  
  185.  
  186. Expires: February 28, 1996                                 [Page 3]
  187.  
  188.  
  189.  
  190. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  191.  
  192.  
  193. The Port Mapper (version 2), on the other hand, is an older protocol that
  194. is specific to TCP and UDP.  It handles TCP and UDP ports directly.
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249. Expires: February 28, 1996                                 [Page 4]
  250.  
  251.  
  252.  
  253. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  254.  
  255.  
  256. 2. RPCBIND Program Protocol
  257.  
  258. The RPCBIND program maps RPC program and version numbers to universal
  259. addresses, thus making dynamic binding of remote programs possible.
  260.  
  261. The RPCBIND program is bound to a well-known address of each supported
  262. transport, and other programs register their dynamically allocated
  263. transport address with it.  The RPCBIND program then makes those addresses
  264. publicly available.
  265.  
  266. The RPCBIND program also aids in broadcast RPC.  A given RPC program will
  267. usually have different transport address bindings on different machines, so
  268. there is no way to directly broadcast to all of these programs. The RPCBIND
  269. program, however, does have a well-known address.  So, to broadcast to a
  270. given program, the client actually sends its message to the RPCBIND program
  271. located at the broadcast address. Each instance of the RPCBIND program that
  272. picks up the broadcast then calls the local service specified by the
  273. client.  When the RPCBIND program gets the reply from the local service, it
  274. sends the reply back to the client.
  275.  
  276. 2.1 RPCBIND Protocol Specification (in RPC Language)
  277.  
  278. /*
  279.  * rpcb_prot.x
  280.  * rpcbind protocol, versions 3 and 4, in RPC Language
  281.  */
  282.  
  283. typedef int             int32;          /* basic data type is 32-bit int */
  284. typedef unsigned int    u_int32;
  285.  
  286. /*
  287.  * rpcbind address for TCP/UDP
  288.  */
  289. const RPCB_PORT = 111;
  290.  
  291. /*
  292.  * A mapping of (program, version, network ID) to address
  293.  *
  294.  * The network identifier  (r_netid):
  295.  *   This is a string that represents a local identification for a network.
  296.  *   This is defined by a system administrator based on local conventions,
  297.  *   and cannot be depended on to have the same value on every system.
  298.  * The RPC program owner identifier  (r_owner):
  299.  *   This is a string that represents a user who "owns" the RPC program
  300.  *   represented by the rpcb structure.  This is usually the user who started
  301.  *   the server that supplies this RPC program.  rpcbind allows only the
  302.  *    program owner to unregister the RPC program (some implementations also
  303.  *    allow the user represented by the string "superuser" to unregister any
  304.  *    RPC program).
  305.  */
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312. Expires: February 28, 1996                                 [Page 5]
  313.  
  314.  
  315.  
  316. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  317.  
  318.  
  319. struct rpcb {
  320.  u_int32 r_prog;          /* program number */
  321.  u_int32 r_vers;          /* version number */
  322.  string r_netid<>;        /* network id */
  323.  string r_addr<>;         /* universal address */
  324.  string r_owner<>;        /* owner of this service */
  325. };
  326.  
  327. struct rpcblist {
  328.  rpcb rpcb_map;
  329.  struct rpcblist *rpcb_next;
  330. };
  331.  
  332. typedef rpcblist *rpcblist_ptr;        /* results of RPCBPROC_DUMP */
  333.  
  334. /*
  335.  * Arguments of remote calls
  336.  */
  337. struct rpcb_rmtcallargs {
  338.  u_int32 prog;              /* program number */
  339.  u_int32 vers;              /* version number */
  340.  u_int32 proc;              /* procedure number */
  341.  opaque args<>;             /* argument */
  342. };
  343.  
  344. /*
  345.  * Results of the remote call
  346.  */
  347. struct rpcb_rmtcallres {
  348.  string addr<>;            /* remote universal address */
  349.  opaque results<>;         /* result */
  350. };
  351.  
  352. /*
  353.  * rpcb_entry contains a merged address of a service on a particular
  354.  * transport, plus associated netconfig information.  A list of rpcb_entry
  355.  * items is returned by RPCBPROC_GETADDRLIST.  The meanings and values used
  356.  * for the r_nc_* fields are given below.
  357.  *
  358.  * The network identifier  (r_nc_netid):
  359.  *   This is a string that represents a local identification for a network.
  360.  *   This is defined by a system administrator based on local conventions,
  361.  *   and cannot be depended on to have the same value on every system.
  362.  *
  363.  * Transport semantics (r_nc_semantics):
  364.  *   This represents the type of transport, and has the following values:
  365.  *     NC_TPI_CLTS     (1)      Connectionless
  366.  *     NC_TPI_COTS     (2)      Connection oriented
  367.  *     NC_TPI_COTS_ORD (3)      Connection oriented with graceful close
  368.  *     NC_TPI_RAW      (4)      Raw transport
  369.  *
  370.  * Protocol family (r_nc_protofmly):
  371.  *   This identifies the family to which the protocol belongs.  The
  372.  
  373.  
  374.  
  375. Expires: February 28, 1996                                 [Page 6]
  376.  
  377.  
  378.  
  379. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  380.  
  381.  
  382.  *   following values are defined:
  383.  *     NC_NOPROTOFMLY   "-"
  384.  *     NC_LOOPBACK      "loopback"
  385.  *     NC_INET          "inet"
  386.  *     NC_IMPLINK       "implink"
  387.  *     NC_PUP           "pup"
  388.  *     NC_CHAOS         "chaos"
  389.  *     NC_NS            "ns"
  390.  *     NC_NBS           "nbs"
  391.  *     NC_ECMA          "ecma"
  392.  *     NC_DATAKIT       "datakit"
  393.  *     NC_CCITT         "ccitt"
  394.  *     NC_SNA           "sna"
  395.  *     NC_DECNET        "decnet"
  396.  *     NC_DLI           "dli"
  397.  *     NC_LAT           "lat"
  398.  *     NC_HYLINK        "hylink"
  399.  *     NC_APPLETALK     "appletalk"
  400.  *     NC_NIT           "nit"
  401.  *     NC_IEEE802       "ieee802"
  402.  *     NC_OSI           "osi"
  403.  *     NC_X25           "x25"
  404.  *     NC_OSINET        "osinet"
  405.  *     NC_GOSIP         "gosip"
  406.  *
  407.  * Protocol name (r_nc_proto):
  408.  *   This identifies a protocol within a family.  The following are
  409.  *   currently defined:
  410.  *      NC_NOPROTO      "-"
  411.  *      NC_TCP          "tcp"
  412.  *      NC_UDP          "udp"
  413.  *      NC_ICMP         "icmp"
  414.  */
  415.  
  416. struct rpcb_entry {
  417.  string          r_maddr<>;            /* merged address of service */
  418.  string          r_nc_netid<>;         /* netid field */
  419.  u_int32         r_nc_semantics;       /* semantics of transport */
  420.  string          r_nc_protofmly<>;     /* protocol family */
  421.  string          r_nc_proto<>;         /* protocol name */
  422. };
  423.  
  424. /*
  425.  * A list of addresses supported by a service.
  426.  */
  427. struct rpcb_entry_list {
  428.  rpcb_entry rpcb_entry_map;
  429.  struct rpcb_entry_list *rpcb_entry_next;
  430. };
  431.  
  432. typedef rpcb_entry_list *rpcb_entry_list_ptr;
  433.  
  434.  
  435.  
  436.  
  437.  
  438. Expires: February 28, 1996                                 [Page 7]
  439.  
  440.  
  441.  
  442. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  443.  
  444.  
  445. /*
  446.  * rpcbind statistics
  447.  */
  448. const rpcb_highproc_2 = RPCBPROC_CALLIT;
  449. const rpcb_highproc_3 = RPCBPROC_TADDR2UADDR;
  450. const rpcb_highproc_4 = RPCBPROC_GETSTAT;
  451.  
  452. const RPCBSTAT_HIGHPROC = 13;    /* # of procs in rpcbind V4 plus one */
  453. const RPCBVERS_STAT     = 3;    /* provide only for rpcbind V2, V3 and V4 */
  454. const RPCBVERS_4_STAT   = 2;
  455. const RPCBVERS_3_STAT   = 1;
  456. const RPCBVERS_2_STAT   = 0;
  457.  
  458. /* Link list of all the stats about getport and getaddr */
  459. struct rpcbs_addrlist {
  460.  u_int32 prog;
  461.  u_int32 vers;
  462.  int32 success;
  463.  int32 failure;
  464.  string netid<>;
  465.  struct rpcbs_addrlist *next;
  466. };
  467.  
  468. /* Link list of all the stats about rmtcall */
  469. struct rpcbs_rmtcalllist {
  470.  u_int32 prog;
  471.  u_int32 vers;
  472.  u_int32 proc;
  473.  int32 success;
  474.  int32 failure;
  475.  int32 indirect;    /* whether callit or indirect */
  476.  string netid<>;
  477.  struct rpcbs_rmtcalllist *next;
  478. };
  479.  
  480. typedef int32 rpcbs_proc[RPCBSTAT_HIGHPROC];
  481. typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
  482. typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
  483.  
  484. struct rpcb_stat {
  485.  rpcbs_proc              info;
  486.  int32                   setinfo;
  487.  int32                   unsetinfo;
  488.  rpcbs_addrlist_ptr      addrinfo;
  489.  rpcbs_rmtcalllist_ptr   rmtinfo;
  490. };
  491.  
  492. /*
  493.  * One rpcb_stat structure is returned for each version of rpcbind
  494.  * being monitored.
  495.  */
  496.  
  497. typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
  498.  
  499.  
  500.  
  501. Expires: February 28, 1996                                 [Page 8]
  502.  
  503.  
  504.  
  505. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  506.  
  507.  
  508. /*
  509.  * rpcb_netbuf structure, used to store the transport specific form of
  510.  * a universal transport address.
  511.  */
  512. struct rpcb_netbuf {
  513.  u_int32 maxlen;
  514.  opaque buf<>;
  515. };
  516.  
  517.  
  518. /*
  519.  * rpcbind procedures
  520.  */
  521. program RPCBPROG {
  522.  version RPCBVERS {
  523.      bool
  524.      RPCBPROC_SET(rpcb) = 1;
  525.  
  526.      bool
  527.      RPCBPROC_UNSET(rpcb) = 2;
  528.  
  529.      string
  530.      RPCBPROC_GETADDR(rpcb) = 3;
  531.  
  532.      rpcblist_ptr
  533.      RPCBPROC_DUMP(void) = 4;
  534.  
  535.      rpcb_rmtcallres
  536.      RPCBPROC_CALLIT(rpcb_rmtcallargs) = 5;
  537.  
  538.      u_int32
  539.      RPCBPROC_GETTIME(void) = 6;
  540.  
  541.      rpcb_netbuf
  542.      RPCBPROC_UADDR2TADDR(string) = 7;
  543.  
  544.      string
  545.      RPCBPROC_TADDR2UADDR(rpcb_netbuf) = 8;
  546.  } = 3;
  547.  
  548.  version RPCBVERS4 {
  549.      bool
  550.      RPCBPROC_SET(rpcb) = 1;
  551.  
  552.      bool
  553.      RPCBPROC_UNSET(rpcb) = 2;
  554.  
  555.      string
  556.      RPCBPROC_GETADDR(rpcb) = 3;
  557.  
  558.      rpcblist_ptr
  559.      RPCBPROC_DUMP(void) = 4;
  560.  
  561.  
  562.  
  563.  
  564. Expires: February 28, 1996                                 [Page 9]
  565.  
  566.  
  567.  
  568. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  569.  
  570.  
  571.      /*
  572.       * NOTE: RPCBPROC_BCAST has the same functionality as CALLIT;
  573.       * the new name is intended to indicate that this
  574.       * procedure should be used for broadcast RPC, and
  575.       * RPCBPROC_INDIRECT should be used for indirect calls.
  576.       */
  577.      rpcb_rmtcallres
  578.      RPCBPROC_BCAST(rpcb_rmtcallargs) = RPCBPROC_CALLIT;
  579.  
  580.      u_int32
  581.      RPCBPROC_GETTIME(void) = 6;
  582.  
  583.      rpcb_netbuf
  584.      RPCBPROC_UADDR2TADDR(string) = 7;
  585.  
  586.      string
  587.      RPCBPROC_TADDR2UADDR(rpcb_netbuf) = 8;
  588.  
  589.      string
  590.      RPCBPROC_GETVERSADDR(rpcb) = 9;
  591.  
  592.      rpcb_rmtcallres
  593.      RPCBPROC_INDIRECT(rpcb_rmtcallargs) = 10;
  594.  
  595.      rpcb_entry_list_ptr
  596.      RPCBPROC_GETADDRLIST(rpcb) = 11;
  597.  
  598.      rpcb_stat_byvers
  599.      RPCBPROC_GETSTAT(void) = 12;
  600.  } = 4;
  601. } = 100000;
  602.  
  603. 2.2 RPCBIND Operation
  604.  
  605. RPCBIND is contacted by way of an assigned address specific to the
  606. transport being used.  For TCP/IP and UDP/IP, for example, it is port
  607. number 111.  Each transport has such an assigned, well-known address.  The
  608. following is a description of each of the procedures supported by RPCBIND.
  609.  
  610. 2.2.1 RPCBIND Version 3
  611.  
  612. RPCBPROC_SET:
  613.  
  614. When a program first becomes available on a machine, it registers itself
  615. with RPCBIND running on the same machine.  The program passes its program
  616. number "r_prog", version number "r_vers", network identifier "r_netid",
  617. universal address "r_addr", and the owner of the service "r_owner".  The
  618. procedure returns a boolean response whose value is TRUE if the procedure
  619. successfully established the mapping and FALSE otherwise.  The procedure
  620. refuses to establish a mapping if one already exists for the ordered set
  621. ("r_prog", "r_vers", "r_netid").  Note that neither "r_netid" nor "r_addr"
  622. can be NULL, and that "r_netid" should be a valid network identifier on the
  623. machine making the call.
  624.  
  625.  
  626.  
  627. Expires: February 28, 1996                                [Page 10]
  628.  
  629.  
  630.  
  631. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  632.  
  633.  
  634. RPCBPROC_UNSET:
  635.  
  636. When a program becomes unavailable, it should unregister itself with the
  637. RPCBIND program on the same machine.  The parameters and results have
  638. meanings identical to those of RPCBPROC_SET.  The mapping of the ("r_prog",
  639. "r_vers", "r_netid") tuple with "r_addr" is deleted.  If "r_netid" is NULL,
  640. all mappings specified by the ordered set ("r_prog", "r_vers", *) and the
  641. corresponding universal addresses are deleted.  Only the owner of the
  642. service or the super-user is allowed to unset a service.
  643.  
  644. RPCBPROC_GETADDR:
  645.  
  646. Given a program number "r_prog", version number "r_vers", and network
  647. identifier  "r_netid", this procedure returns the universal address on
  648. which the program is awaiting call requests.  The "r_netid" field of the
  649. argument is ignored and the "r_netid" is inferred from the network
  650. identifier of the transport on which the request came in.
  651.  
  652. RPCBPROC_DUMP:
  653.  
  654. This procedure lists all entries in RPCBIND's database.  The procedure
  655. takes no parameters and returns a list of program, version, network
  656. identifier, and universal addresses.
  657.  
  658. RPCBPROC_CALLIT:
  659.  
  660. This procedure allows a caller to call another remote procedure on the same
  661. machine without knowing the remote procedure's universal address.  It is
  662. intended for supporting broadcasts to arbitrary remote programs via
  663. RPCBIND's universal address.  The parameters "prog", "vers", "proc", and
  664. args are the program number, version number, procedure number, and
  665. parameters of the remote procedure.
  666.  
  667. Note - This procedure only sends a response if the procedure was
  668. successfully executed and is silent (no response) otherwise.
  669.  
  670. The procedure returns the remote program's universal address, and the
  671. results of the remote procedure.
  672.  
  673. RPCBPROC_GETTIME:
  674.  
  675. This procedure returns the local time on its own machine in seconds since
  676. the midnight of the First day of January, 1970.
  677.  
  678. RPCBPROC_UADDR2TADDR:
  679.  
  680. This procedure converts universal addresses to transport specific
  681. addresses.
  682.  
  683. RPCBPROC_TADDR2UADDR:
  684.  
  685. This procedure converts transport specific addresses to universal
  686. addresses.
  687.  
  688.  
  689.  
  690. Expires: February 28, 1996                                [Page 11]
  691.  
  692.  
  693.  
  694. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  695.  
  696.  
  697. 2.2.2 RPCBIND, Version 4
  698.  
  699. Version 4 of the RPCBIND protocol includes all of the above procedures, and
  700. adds several additional ones.
  701.  
  702. RPCBPROC_BCAST:
  703.  
  704. This procedure is identical to the version 3 RPCBPROC_CALLIT procedure.
  705. The new name indicates that the procedure should be used for broadcast RPCs
  706. only.  RPCBPROC_INDIRECT, defined below, should be used for indirect RPC
  707. calls.
  708.  
  709. RPCBPROC_GETVERSADDR:
  710.  
  711. This procedure is similar to RPCBPROC_GETADDR.  The difference is the
  712. "r_vers" field of the rpcb structure can be used to specify the version of
  713. interest.  If that version is not registered, no address is returned.
  714.  
  715. RPCBPROC_INDIRECT:
  716.  
  717. Similar to RPCBPROC_CALLIT.  Instead of being silent about errors (such as
  718. the program not being registered on the system), this procedure returns an
  719. indication of the error.  This procedure should not be used for broadcast
  720. RPC. It is intended to be used with indirect RPC calls only.
  721.  
  722. RPCBPROC_GETADDRLIST:
  723.  
  724. This procedure returns a list of addresses for the given rpcb entry.  The
  725. client may be able use the results to determine alternate transports that
  726. it can use to communicate with the server.
  727.  
  728. RPCBPROC_GETSTAT:
  729.  
  730. This procedure returns statistics on the activity of the RPCBIND server.
  731. The information lists the number and kind of requests the server has
  732. received.
  733.  
  734. Note - All procedures except RPCBPROC_SET and RPCBPROC_UNSET can be called
  735. by clients running on a machine other than a machine on which RPCBIND is
  736. running.  RPCBIND only accepts RPCBPROC_SET and RPCBPROC_UNSET requests by
  737. clients running on the same machine as the RPCBIND program.
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753. Expires: February 28, 1996                                [Page 12]
  754.  
  755.  
  756.  
  757. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  758.  
  759.  
  760. 3. Port Mapper Program Protocol
  761.  
  762. The port mapper program maps RPC program and version numbers to transport-
  763. specific port numbers.  This program makes dynamic binding of remote
  764. programs possible.  The port mapper protocol differs from the newer RPCBIND
  765. protocols in that it is transport specific in its address handling.
  766.  
  767. 3.1 Port Mapper Protocol Specification (in RPC Language)
  768.  
  769.       typedef int               int32;          /* basic data type is 32-bit int */
  770.       typedef unsigned int      u_int32;
  771.  
  772.       const PMAP_PORT = 111;      /* portmapper port number */
  773.  
  774.       /*
  775.        * A mapping of (program, version, protocol) to port number:
  776.        */
  777.       struct pmap {
  778.          u_int32 pm_prog;
  779.          u_int32 pm_vers;
  780.          u_int32 pm_prot;
  781.          u_int32 pm_port;
  782.       };
  783.  
  784.       /*
  785.        * Supported values for the "pm_prot" field:
  786.        */
  787.       const PMAP_IPPROTO_TCP = 6;      /* protocol number for TCP/IP */
  788.       const PMAP_IPPROTO_UDP = 17;     /* protocol number for UDP/IP */
  789.  
  790.       /*
  791.        * A list of mappings:
  792.        */
  793.       struct pmaplist {
  794.          pmap pml_map;
  795.          pmaplist *pml_next;
  796.       };
  797.       typedef pmaplist *pmaplist_ptr;
  798.  
  799.       /*
  800.        * Arguments to callit:
  801.        */
  802.       struct rmtcallargs {
  803.          u_int32 prog;
  804.          u_int32 vers;
  805.          u_int32 proc;
  806.          opaque args<>;
  807.       };
  808.  
  809.       /*
  810.        * Results of callit:
  811.        */
  812.       struct rmtcallres {
  813.  
  814.  
  815.  
  816. Expires: February 28, 1996                                [Page 13]
  817.  
  818.  
  819.  
  820. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  821.  
  822.  
  823.          u_int32 port;
  824.          opaque res<>;
  825.       };
  826.  
  827.       /*
  828.        * Port mapper procedures:
  829.        */
  830.       program PMAP_PROG {
  831.          version PMAP_VERS {
  832.             void
  833.             PMAPPROC_NULL(void)         = 0;
  834.  
  835.             bool
  836.             PMAPPROC_SET(pmap)          = 1;
  837.  
  838.             bool
  839.             PMAPPROC_UNSET(pmap)        = 2;
  840.  
  841.             u_int32
  842.             PMAPPROC_GETPORT(pmap)      = 3;
  843.  
  844.             pmaplist_ptr
  845.             PMAPPROC_DUMP(void)         = 4;
  846.  
  847.             rmtcallres
  848.             PMAPPROC_CALLIT(rmtcallargs)= 5;
  849.          } = 2;
  850.       } = 100000;
  851.  
  852. 3.2 Port Mapper Operation
  853.  
  854. The portmapper program currently supports two protocols (UDP and TCP).  The
  855. portmapper is contacted by talking to it on assigned port number 111
  856. (ONCRPC) on either of these protocols.
  857.  
  858. The following is a description of each of the portmapper procedures:
  859.  
  860. PMAPPROC_NULL:
  861.  
  862. This procedure does no work.  By convention, procedure zero of any protocol
  863. takes no parameters and returns no results.
  864.  
  865. PMAPPROC_SET:
  866.  
  867. When a program first becomes available on a machine, it registers itself
  868. with the port mapper program on the same machine.  The program passes its
  869. program number "pm_prog", version number "pm_vers", transport protocol
  870. number "pm_prot", and the port "pm_port" on which it awaits service
  871. request.  The procedure returns a boolean reply whose value is "TRUE" if
  872. the procedure successfully established the mapping and "FALSE" otherwise.
  873. The procedure refuses to establish a mapping if one already exists for the
  874. tuple "(pm_prog, pm_vers, pm_prot)".
  875.  
  876.  
  877.  
  878.  
  879. Expires: February 28, 1996                                [Page 14]
  880.  
  881.  
  882.  
  883. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  884.  
  885.  
  886. PMAPPROC_UNSET:
  887.  
  888. When a program becomes unavailable, it should unregister itself with the
  889. port mapper program on the same machine.  The parameters and results have
  890. meanings identical to those of "PMAPPROC_SET".  The protocol and port
  891. number fields of the argument are ignored.
  892.  
  893. PMAPPROC_GETPORT:
  894.  
  895. Given a program number "pm_prog", version number "pm_vers", and transport
  896. protocol number "pm_prot", this procedure returns the port number on which
  897. the program is awaiting call requests.  A port value of zeros means the
  898. program has not been registered.  The "pm_port" field of the argument is
  899. ignored.
  900.  
  901. PMAPPROC_DUMP:
  902.  
  903. This procedure enumerates all entries in the port mapper's database.  The
  904. procedure takes no parameters and returns a list of program, version,
  905. protocol, and port values.
  906.  
  907. PMAPPROC_CALLIT:
  908.  
  909. This procedure allows a client to call another remote procedure on the same
  910. machine without knowing the remote procedure's port number.  It is intended
  911. for supporting broadcasts to arbitrary remote programs via the well-known
  912. port mapper's port.  The parameters "prog", "vers", "proc", and the bytes
  913. of "args" are the program number, version number, procedure number, and
  914. parameters of the remote procedure.  Note:
  915.  
  916. (1) This procedure only sends a reply if the procedure was successfully
  917. executed and is silent (no reply) otherwise.
  918.  
  919. (2) The port mapper communicates with the remote program using UDP only.
  920.  
  921. The procedure returns the remote program's port number, and the reply is
  922. the reply of the remote procedure.
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942. Expires: February 28, 1996                                [Page 15]
  943.  
  944.  
  945.  
  946. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  947.  
  948.  
  949. 4. Security Considerations
  950.  
  951. Additional information about vulnerabilities of certain implementations of
  952. the rpcbind and Port Mapper protocols can be found in "Firewalls and
  953. Internet Security"[4].
  954.  
  955. 4.1 Address Registration and Unregistration
  956.  
  957. The rpcbind protocol specifies that the RPCBPROC_SET and RPCBPROC_UNSET
  958. procedures only be accepted from the same machine on which rpcbind is
  959. running.  The intention is that only the local owner of the service be
  960. allowed to unset the registration for the RPC program.  Some
  961. implementations extend this requirement by only allowing RPCBPROC_SET and
  962. RPCBPROC_UNSET procedures to be invoked over a secure machine-local
  963. transport through which the identity of the owner can be directly verified
  964. by rpcbind.
  965.  
  966. The Port Mapper protocol does not specify that the PMAPPROC_SET and
  967. PMAPPROC_UNSET procedures are only accepted from the local machine, and
  968. many early implementions of the port mapper service accepted these requests
  969. from any machine on the network.  As a result, any user would be able to
  970. unregister an RPC program on such systems, and register potentially
  971. spurious information about the service in its place.
  972.  
  973. Systems supporting the Port Mapper protocol are encouraged to restrict
  974. registration and unregistration requests to the local system.
  975. Implementations should be careful to also disallow portmapper requests
  976. which are made through the PMAPPROC_CALLIT procedure, as these operations
  977. will appear to originate from the local system.
  978.  
  979. Where possible, portmapper implementation should further restrict
  980. PMAPPROC_SET and PMAPPROC_UNSET operations to a secure machine-local
  981. transport, as described above for rpcbind.  Although the Port Mapper
  982. protocol does not include an "owner" field in the PMAPPROC_SET and
  983. PMAPPROC_UNSET arguments, an implementation using such a secure machine-
  984. local transport which conveys the caller's identity can record this
  985. identity in its internal registration records, and allow only the same user
  986. to unregister the service.
  987.  
  988. 4.2 RPCBPROC_CALLIT, RPCBPROC_INDIRECT, and PMAPPROC_CALLIT
  989.  
  990. The procedures listed in this section's header implement two types of
  991. special RPC operations:  Broadcast RPC and Indirect RPC.  Both use rpcbind
  992. or the portmapper to forward a request from a remote caller to an RPC
  993. program on the local system.  As a result, the request appears to originate
  994. from the local system.  RPC programs that provide sensitive services should
  995. examine the address of the caller to determine whether the request
  996. originated from rpcbind or portmapper, in which case the request should be
  997. handled as though it came from a remote system.
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005. Expires: February 28, 1996                                [Page 16]
  1006.  
  1007.  
  1008.  
  1009. INTERNET-DRAFT    Binding Protocols for ONC RPC Version 2      28-August-96
  1010.  
  1011.  
  1012. 5. References
  1013.  
  1014. [1]  "Remote Procedure Call Protocol Version 2",
  1015.      draft-ietf-oncrpc-rpcv2-02.txt, 1996.
  1016.  
  1017. [2]  "XDR: External Data Representation Standard",
  1018.      draft-ietf-oncrpc-xdr-01.txt, 1994.
  1019.  
  1020. [3]  "Requirements for Internet Hosts -- Application and Support", STD-3,
  1021.      October 1989.
  1022.  
  1023. [4]  Cheswick, W.R., and Bellovin, S.M., "Firewalls and Internet Security,"
  1024.      Addison-Wesley, 1994.
  1025.  
  1026. 6. AUTHOR'S ADDRESS
  1027.  
  1028. Stephen X. Nahm
  1029. Sun Microsystems, Inc.
  1030. 2550 Garcia Avenue
  1031. Mountain View, CA 94043
  1032.  
  1033. Phone: +1 (415) 786-5086
  1034.  
  1035. E-mail: sxn@sun.com
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068. Expires: February 28, 1996                                [Page 17]
  1069.