Consultor Eletrônico



Kbase 12532: Progress, TCP/IP Network, and Sockets
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Verified

GOAL:

How PROGRESS works on a TCP/IP network.


FIX:

This is helpful information for the initial configuration of networks as well as ongoing maintenance, network bottlenecks, and problem solving.

When a client on one machine attempts to connect to a database on another machine, Progress must utilize system resources to allow the communication between the client process and the broker and server processes.

Upon initial connect of a client to a database server, it's a two-pass process for the client.  Upon initialization of the Broker process the Broker will utilize 1 listen socket to handle all requests for access to the database.

PHASE I -

T-1A - client machine
T-1B - broker machine

When a client process on machine T-1A attempts to connect to a database server on T-1B for the first time.  The client will open a socket on T-1A specified in the /etc/services file.  It will send a message via the socket to the broker process, requesting a connect to the database.  One ethernet connection on each machine
will be utilized for the function.  In addition, the connected client will cause the Broker to have an additional socket and file descriptor for the client connection.

PHASE II -

T-2A - client machine
T-2B - broker machine

Once the message has been received by the Broker, the Broker must determine what action it needs to perform to satisfy the request.

One of two scenarios will happen:

ONE - The server process is NOT available.  If this is the case then the broker will spawn a server process, and at this time assign a volatile socket number, to function as a listen socket for that server.  This volatile socket number will consume 1 available socket, and 1 file descriptor associated with the server process on (T-2B).  After initiating the server process, the Broker will
return the volatile socket number to T-2A via the original socket which was open from PHASE I on the client machine.  Once the client has received this socket number, the Broker will close the connection file descriptor and socket for that client, returning to where it has only 1 socket and 1 file descriptor for the listen allocated.

TWO - The server process IS available.  If this is the case the broker will return that server's volatile socket number to T-2A, via the original connection socket which was open from PHASE I on the client machine.  Once the client has received this socket number, both the broker and the client will close their original connection sockets and file descriptors.

PHASE III -

T-3A - client machine
T-3B - server machine

Once the volatile socket number has been returned to the client process, the client must now connect to the server.  The client process will do this via the volatile socket.  This will consume 1 socket on the client machine.  The socket has already been allocated on the server machine, however once the client has connected to the server process, another socket/file descriptor will be allocated for handling read/write requests from the server to the client process.  This completes the connection cycle for a client to a server.

NOTES:

All resources indicated above will remain allocated, until the
client logs out, unless specified within the actual Version 6
Progress source code -- allowing you to connect & disconnect on the
fly.


RESOURCES TO NOTE ARE:

      Client Machine                  Broker/Server Machine
-----------------------------      -----------------------------

# Available Sockets                # Available Sockets
# Available File Descriptors       # Available File Descriptors

- Each client will use 1           - The Broker 1 - 2 sockets &
socket (port address) and 1        file descriptors 1 set for
file descriptor for each           listen.
database that they are
connected to.                      - In addition, the Br.oker will
                                  allocate 7 or so file descrip-
- In addition each client          tors at start up for temp files.
will allocate between 6 - 8
file descriptors for temp-
orary files.                       - Each Server process allocates
                                  1 listen socket & file descrip-
                                  tor.  In addition, one communi-
                                  cation socket and file descrip-
                                  tor per client.

                                  - 10+ file descriptors are
                                  allocated at the start of each
                                  server process.


Some operating systems (SCO, Unisys) have limits for the number of
sockets per machine..