next up previous contents
Next: Client and Host Attributes Up: Wire Protocols Previous: The FINI command

   
Shall We Dance?

The exchange of startup parameters is completed when the DONE command is received from the server. At this point, it may be necessary for additional socket connections to be established. The agents responsible for each socket must therefore participate in a connect/accept ``dance'', the order of which is defined as follows:

/*
 * Higher ranked host connects, lower ranked host accepts.
 */

        for (i = 0; i < nhosts; i++) {
                if (i < myhostrank) {
                        do_connect(i);
                } else if (i > myhostrank) {
                        do_accept();    /* from anybody */
                }
        }

After a successful connect(), each host must send its rank as a 32-bit value to the accepting process.

Discussion.The above algorithm is simple but has the drawback of being O(N2). Suggestions for O(N) algorithms would be most welcome.(End of discussion.)

Discussion.This section does not include any provisions for security. While potentially elaborate measures are taken in Section 2.3.3, it seems counter-productive to leave a gaping hole here that could be exploited with a well-timed attack. Indeed, the ``from anybody'' comment in the above pseudocode is quite appropriate. A simple solution would be to perform the same authentication protocol that has already been agreed upon in the negotiation phase of startup, with the host perfoming the connect() acting as the ``server'' (in Section 2.3.3), and the host performing the accept() acting as the ``client''.(End of discussion.)


next up previous contents
Next: Client and Host Attributes Up: Wire Protocols Previous: The FINI command
IMPI Protocol ver 0.0
DRAFT March 22, 1999