Reverse connection and port forwarding

From KitwarePublic
Jump to navigationJump to search

This page describes how to configure a paraview client/server reverse connection between a compute node cluster and your desktop when it is not possible to open a direct connection between compute node and desktop. A common situation is that compute nodes are only accessible from login nodes.

The setup using reverse connection and portfwd

Using a reverse connection the paraview client will bind to a port and wait for an incoming connection from the server. When the mpi enabled paraview server (referred to as pvserver) is launched on a set of compute nodes, the 0th pvserver process opens a connection to the host machine where the paraview client is waiting.


The problem arises when it is not possible for the compute node to connect to the host machine- the compute node can only connect to a login node. The problem is solved by forwarding traffic from a port on the login node to a port on the host machine. This can be accomplished using a simple utility called portfwd found at http://portfwd.sourceforge.net/.


For this example, let's say the paraview client is waiting for a reverse connection on port 11111 of host client_host (client_host:11111), and the compute node can only connect to port 11111 of host login_node (login_node:11111). In this example pvserver is launched on the compute nodes using the command:

mpirun -np 512 pvserver --reverse-connection --client-host=login_node --server-port=11111

Next, we use portfwd to forward login_node:11111 to client_host:11111. In some situtations it is possible to accomplish the kind of port fowarding using ssh tunnels, but portfwd is much simpler. First write a configuration file, fwd.cfg:

  /*
  fwd.cfg
  forwards localhost:11111 to client_host:11111
  */
  
  tcp { 11111 { => client_host:11111 } }


Then launch portfwd on the login node (this example uses the flag --foreground to keep portfwd running in the foreground so it can be killed with control-c):

portfwd --config fwd.cfg --foreground


Now when the pvserver connects to login_node:11111 the traffic will be forwarded to client_host:11111.