> For the complete documentation index, see [llms.txt](https://old-docs.vantage6.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://old-docs.vantage6.ai/algorithm-development/concepts/networking.md).

# Networking

The algorithm container is deployed in an isolated network to prevent it from reaching unwanted destinations. There are two exceptions:

1. When the VPN feature is enabled on the server all algorithm containers are able to reach each other using an `ip` and `port`.&#x20;
2. The central server is reachable through a local proxy service. In the algorithm you can use the `HOST`, `POST` and `API_PATH` to find the address of the server.  &#x20;

{% hint style="info" %}
We are currently working on a whitelisting feature which allows a node to configure addresses that the algorithm container is able to reach.
{% endhint %}

## VPN connection

Algorithm containers can expose one or more ports. These ports can then be used by other algorithm containers to exchange data. The infrastructure uses the Dockerfile from which the algorithm has been build to determine to which ports are used by the algorithm. This is done by using the `EXPOSE` and `LABEL` directives.

For example when an algorithm uses two ports, one port for communication `com` and one port for data exchange `data`. The following block should be added to you algorithm Dockerfile:

```docker
# port 8888 is used by the algorithm for communication purposes
EXPOSE 8888
LABEL p8888 = "com"

# port 8889 is used by the algorithm for data-exchange
EXPOSE 8889 
LABEL p8889 = "data"
```

Port `8888` and `8889` are the internal ports to which the algorithm container listens. When another container want to communicate with this container it can retrieve the IP and external port from the central server by using the `result_id` and the label of the port you want to use (`com` or `data` in this case)&#x20;
