Last updated June 17, 2005
Applies to all Versions of GemStone/S and GemStone/S 64 Bit

The netldi is a lightweight GemStone process that runs on the server. Its primary responsibility is to start server-side processes in response to client requests, usually for client login. The Netldi is also used to start process on the server used to synchronize the Shared Page Cache with other machines that are running server processes for the same repository, but this is done through the same mechanisms as client requests, so it need not be considered separately.

The Netldi listens for all requests on a single, fixed TCP/IP port. This port needs to be defined in the operating system’s ‘services’ file. The entry in this file takes the form:

netldi61 10377/tcp #GemStone 6.1.x Network Long Distance Interface

where 10377 is the selected TCP port and everything following the # sign is a comment.

When a request comes from a client, the Netldi will start the server side process and instruct it to listen on a different TCP port for the connection. It then responds to the client that requested the service with the port number it should use to contact the server side process. Once the client and server have used that port to make contact, the port may be re-used by the Netldi to start another process for another client.

The -p parameter on the startnetldi command allows you to specify a range of ports that the Netldi may use as connection ports between the client and server processes. This command takes the form:

startnetldi -p 10076:10078

In this case, the Netldi will use three ports for connecting to clients, 10076, 10077 and 10078. Notice that only one range may be specified and that all ports in that range may be used.

Server processes only listen on this port until a client connection is established. Therefor it is possible to configure the netldi to only use one port (in addition to its own fixed port) for connecting processes. If this is done, requests will be serialized to share this port and some delays at login time may be experienced. Expanding the range of ports allows multiple connections to proceed simultaneously and can improve login times in heavily used systems. There is no requirement to consider the number of concurrent connections when configuring this range of ports, because the port is only required for exclusive use while the initial connection is made. Therefore, a hundred users could be logged in and using GemStone simultaneously, even though there is only a single port defined for connections.

Here is the sequence of events that occurs in establishing a connection:

  1. a client makes a netldi request
  2. netldi spawns a gem (for example, on port 10076)
  3. gem listens on 10076 (listener socket)
  4. client connects on 10076 (established socket)
  5. gem stops listening on 10076

Communication between the client and the gem then proceeds on the established socket on port 10076.

If a new netldi request is made in the short time window between steps 2 and 4, then port 10077 will be used. However, the system strives to conserve resources by using the same port whenever possible. Only one listener socket is possible on any given port, but many established sockets are possible. Most production users will find a small number of dedicated ports to be sufficient.