Communication Channels between Slaves

TCPMPL can be used by any number of users in a system. It should not use any fixed element in the communication channel as it will collide with other user process when they are executed. No specific TCP port should be used for making connection, since any user in the system can be using that specific TCP port for his/her application execution. TCPMPL does not use any static TCP port for making connections or for any communication. The 2-tuple namely (local IP-addr, local TCP-port) for each of the processes should be known by all other processes for each process to establish TCP connections with the other processes. This is achieved with the help of the initiator process. Before staring the remote processes, the initiator process gets the two elements from TCP namely local IP-addr and local TCP-port. It sends this information to the remote processes as a command line argument when it starts off the process on the remote machines. The N processes started on remote machines know the (IP-addr, TCP-port) of the initiator. With this information, the processes started can make a TCP connection with the initiator process. Figure 3(a) shows the sending of the 2-tuple from the initiator to all the N processes. Each process started creates a TCP connection with the initiator. There will be N TCP connections that are created with the initiator from the N processes started. These communication channels are used by initiator to communicate with the processes started on the remote machines and vice versa.

  figure221
Figure 3: Interaction between the initiator, master and the slaves during communication channel establishment; (a) initiator sending (IP addr, TCP port) to master and the slaves; (b) slaves each sending tex2html_wrap_inline659 to the initiator; and (c) initiator sending the tex2html_wrap_inline661 to master and the slaves.

Each process binds itself to a local TCP port and sends a 3-tuple to the initiator. The elements of the 3-tuple are:

  1. Identity of the process
  2. Local IP address
  3. Local TCP port

Figure 3(b) shows each process sending the 3-tuple to the initiator process. The initiator process collects the 3-tuple from all the processes. Once the initiator collects all the information from different processes, it sends the N 3-tuples to all the processes. Each process receives the 3-tuple information about all the other processes. Therfore, each process will get N such 3-tuples including its own 3-tuple. Figure 3(c) shows the initiator sending N 3-tuples to all the processes. With TCP, two processes that need to make a TCP connection have to behave in a client/server fashion to establish a TCP connection. One process should become a server waiting for a connection. The other process should become a client trying to make a connection with the server. A connection can be established even if the two processes try to behave as a client, but it needs perfect synchronization which is very difficult. TCPMPL follows the client/server method for establishing TCP connections. With this restriction, there has to be a mutual aggrement between the processes that desire to establish connection with each other as to which one should behave as server and as client.

TCPMPL follows a generalized mutual agreement policy to establish the TCP connections among the processes. There is an id number associated with each process in the group of communicating processes. TCPMPL uses this identity to follow the protocol to establish connections. TCPMPL uses this id number in the ascending order to make processes act as servers to accept connections from other processes. Effectively each process becomes a server for sometime to accept connections from other processes. The algorithm is as follows:

N = getTotalProcesses();
my_id = get_identity();

// This process acts as a client in this segment
for ( id = 0 ; id <= (my_id-1) ; id++){
connect to process with identity id using (IP addr, TCP port) of it;
}

// This process acts as a server in this segment
for ( id = (my_id+1) ; id <= N-1 ; id++){
wait for connections from process with identity X (X > my_id)
}

Each process first acts as a client and tries to connect to the server. In this part, process with an identity X tries to connect to the process with identity 0 to X-1 acting as a server. In the second part, each process acts as a server. In this part, it waits for connections to arrive from processes with identity X+1 to N-1. After this connection establishment phase, there is a total of tex2html_wrap_inline655 TCP connections that are established. Any two process can communicate among themselves through these TCP connections.



Radharamanan Radhakrishnan
Mon Mar 15 18:20:48 EST 1999