[R] parallel: socket connection behind a NAT router

Jiefei Wang @zwj|08 @end|ng |rom gm@||@com
Mon Jan 18 15:44:58 CET 2021

Hi all,

I have a few cloud instances and I want to use them to do parallel
computing. I would like to create a socket cluster on my local machine to
control the remote instances. Here is my network setup:

local machine -- NAT -- Internet -- cloud instances

In the parallel package, the server needs to call `makeCluster()` and
listens to the connection from the workers. In my case, the server is the
local machine and the workers are the cloud instances. However, since the
local machine is hidden behind the NAT, it does not have a public address
and the worker cannot connect to it. Therefore, `makeCluster()` will never
be able to see the connection from the workers and hang forever.

One solution for letting the external machine to access the device inside
the NAT is to use port forwarding. However, this would not work for my case
as the NAT is set by the network provider(not my home router) so I do not
have access to the router. As the cloud instances have public addresses,
I'll wonder if there is any way to build the cluster by letting the server
connect to the cloud? I have checked `?parallel::makeCluster` and
`?snow::makeSOCKcluster` but I found no result. The only promising solution
I can see now is to use TCP hole punching, but it is quite complicated and
may not work for every case. Since building a connection from local to the
remote is super easy, I would like to know if there exists any simple
solution. I have searched it on Google for a week but find no answer. I'll
appreciate it if you can provide me any suggestions!


	[[alternative HTML version deleted]]

More information about the R-help mailing list