Previous section.

Protocols for Interworking: XNFS, Version 3W
Copyright © 1998 The Open Group

Port Mapper Protocol

Introduction

This chapter describes the port mapper protocol which is related to, but separate from, the RPC protocol. The port mapper protocol is not specified as a part of the RPC protocol to allow the implementor flexibility and to facilitate the development of new mechanisms without requiring the revision of related protocols.

Introduction to Port Mapper Program Protocol

The port mapper program maps RPC program and version numbers to transport-specific port numbers. This program makes dynamic binding of remote programs possible. This is desirable because the range of reserved port numbers is very small, and the number of potential remote programs is very large. By running only the port mapper on a reserved port, the port numbers of other remote programs can be ascertained by querying the port mapper.

The port mapper also aids in broadcast RPC. A given RPC program will usually have different port number bindings on different machines, so there is no way to directly broadcast to all of these programs. The port mapper, however, does have a fixed port number. So, to broadcast to a given program, the client actually sends its message to the port mapper located at the broadcast address. Each port mapper that picks up the broadcast then calls the local service specified by the client. When the port mapper gets the reply from the local service, it sends the reply back to the client. For interoperation with personal computer clients, the port mapper program must support the UDP/IP protocol. The port mapper is contacted by talking to it on assigned port number 111 (decimal).

Port Mapper Protocol Specification (in RPC Language)

const PMAP_PORT = 111; /* port mapper port number */ /* * A mapping of (program, version, protocol) to port number. */ struct mapping { unsigned int prog; unsigned int vers; unsigned int prot; unsigned int port; }; /* * Supported values for the "prot" field. */ const IPPROTO_TCP = 6; /* protocol number for TCP/IP */ const IPPROTO_UDP = 17; /* protocol number for UDP/IP */ /* * A list of mappings. */ struct *pmaplist { mapping map; pmaplist next; }; /* * Arguments to callit. */ struct call_args { unsigned int prog; unsigned int vers; unsigned int proc; opaque args<>; }; /* * Results of callit. */ struct call_result { unsigned int port; opaque res<>; };

Port Mapper Procedures

/* * Port mapper procedures */ program PMAP_PROG { version PMAP_VERS { void PMAPPROC_NULL(void) = 0; bool PMAPPROC_SET(mapping) = 1; bool PMAPPROC_UNSET(mapping) = 2; unsigned int PMAPPROC_GETPORT(mapping) = 3; pmaplist PMAPPROC_DUMP(void) = 4; } = 2; } = 100000;

The port mapper program currently supports two protocols (UDP/IP and TCP/IP). The port mapper is contacted by talking to it on assigned port number 111 on either of these protocols.

The following reference pages define each of the port mapper procedures.


Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.

Contents Next section Index