Why does Exchange use dynamic ports for the Information Store, et cetera?

Not so long ago, we had this question as a blog subject suggestion, so here it is:

Exchange implements many of its services through the remote procedure call (RPC) facilities provided by Windows.  RPC is not limited to any particular transport (e.g. TCP/IP).  Instead, a service providing RPC access registers itself on startup and for each supported transport RPC assigns a port or other appropriate resource (in RPC language, this is called an endpoint).  When the client wishes to invoke a remote procedure, a request is sent to the endpoint mapper service (which is at a fixed location, e.g. port 135 for TCP or UDP) and it tells the client where to find the service, which might change every time the service is started.
For communicating over TCP/IP, this design has advantages given the limited numbers of ports available (65536).  If every new application that supported remote calls needed its own port, port collisions would be inevitable.  With RPC, a much longer identifier (primarily a 16-byte GUID) is used instead to identify the service making the chance of two services colliding miniscule.   RPC does allow the endpoint (i.e. port) to be specified, but this is usually needed only when firewalls are involved.  Even in those cases, any port can be chosen without changing the clients (which will always query for the location), so there is significant flexibility over a design in which both the client and the server expect to communicate over a fixed port.
Trivia: RPC as implemented on Windows belongs to DCE (Distributed Computing Environment)/RPC family, which has its origins in work done at Apollo Computer back in the in 1980s on their Network Computing System (NCS).  A contemporaneous RPC protocol originated at Sun and is now called ONC (Open Network Connection)/RPC which derives from work on their Network File System (NFS).  The Open Software Foundation adopted DCE as the standard for RPC in the early 1990s in part to encourage more standardization in the industry around a particular RPC mechanism.  Nonetheless, new RPC protocols continue to be proposed and adopted, a recent one being SOAP.  The old adage that the great thing about standards is that there are so many to choose from rings true about RPC.

- Kevin Chase

Comments (2)
  1. Mohammed Athif Khaleel says:

    Nice explanation:-) Thanks.

  2. joe wannabe says:

    We use fixed ports for Exchange RPC and if it can be used and specified, why doesn’t Exchange just specify a port or ports to be used?

Comments are closed.

Skip to main content