TCP Communication in Brief

Misunderstandings about TCP communication and its security aspects (e.g. firewall settings) among system administrators and IT-infrastructure administrators are quite common. This section briefly explains how TCP communication works using the data flow of system:inmation as an example.

Concept of TCP Server and Client

TCP communication is always established between a TCP server and a TCP client. Both can be running on the same or on different hosts, which has no immediate effect on the communication concept. The TCP server is constantly, passively waiting (listening) for a connection. In contrast, the TCP client actively initiates a connection when required. This difference has significant impact on the configuration of a firewall that might be regulating the traffic between the server and the client, because the direction of the communication can be taken into account when allowing or prohibiting TCP traffic. Once a connection is established, both TCP server and TCP client are equivalent communication partners.

The communication between the Connector service and the Core service is a good example: The Connector service usually acts as a TCP server (when in Passive configuration), while the Core service acts as a TCP client. In this configuration, communication between the two is initiated by the Core service, including all attempts to reconnect if network connection is lost.

If the Connector service is installed as an Active component then it is able to initiate communication with the Core service.

More information on this can be found in the Inter-component communication section of the documentation.

Concept of TCP Ports

TCP servers listen on a specific port only. A port can be thought of as a small breakdown of an IP-address. In order to send a communication request, the TCP client needs to know the IP address of the machine running the server as well as the port the server is listening on (the server port).

In order to reply to the connection request from the client, the server needs to know the IP address of the machine running the client and the port the client is using for the communication (the client port). This information is encapsulated in the communication request of the client.

In an environment where no IP address and/or port restriction exists (e.g. client and host run on the same machine), the following outlines the typical way of establishing TCP connections:

The TCP Client picks a random high port (1024-65335) which is currently not occupied by any other process. Then, the client sends a connection request to the TCP server, encapsulating its own address information.

Port numbers range from 0 to 65535. The port numbers in the range from 0 to 1023 are the well-known ports. They are used by system processes that provide widely used types of network services. They should never be used for non-system TCP communication.

In inmation, this means that before the Core service can send any communication request to a Connector service, it needs to know the IP address and the port on which a Connector is listening for a TCP connection. To let the Core service know the available communication partners and their TCP addresses, they need to be configured in the system. Again, the Core service needs to know what it should include in the request as the reply address. This can be the typical random high port selection, or a specific client port. These settings can also be configured during installation or by using DataStudio afterwards.

By default, Connector Services are listening on port 6510, and Core Services expecting the reply on random high ports.

Security Impact of TCP Ports

TCP traffic is usually regulated by firewalls, be it corporate hardware firewalls or software firewalls on each host. While hardware firewalls typically rule traffic in both directions, software firewalls on the individual hosts only filter incoming (called "inbound") traffic, and most of the time allow all outgoing ("outbound") traffic.

However, local software firewalls might still prevent outgoing TCP traffic to all or some destination addresses and ports. In this case, please contact your IT administrator for details on how to enable outgoing TCP traffic as required per system:inmation configuration.

Whenever a communication between a TCP server and TCP client needs to pass a firewall, the configuration of the firewall has to first allow it. From a high level perspective, firewalls restrict TCP traffic based on a local IP address and port, and remote IP address and port, while having separate rules for the inbound and outbound direction.

Most corporate firewalls also allow more advanced filtering techniques, such as application-based filtering. If these techniques are used at your site, please contact your IT administrator for details on how to enable outgoing TCP traffic as required per system:inmation configuration.

In order to retain your high security standards, system:inmation allows two different ways of initiating the TCP communication that also have a counterpart when configuring your local firewall rules. The two options are explained using the sample sketch below.

Example TCP Communication
Figure 1. Example TCP Communication

Random High Port Reply

In this scenario, the TCP client (Core Service) connects to the TCP server (Connector Service) on the fixed port it is listening on (1), and the server replies on a random high port (2). For this configuration, your firewall needs to allow:

Table 1. Random High Port Communication
Leg From IP From Port To IP To Port On Host Direction

(1)

172.16.0.9

Any

192.168.0.5

6510

TCP Client

Outbound

(1)

172.16.0.9

Any

192.168.0.5

6510

TCP Server

Inbound

(2)

192.168.0.5

6510

172.16.0.9

Any

TCP Server

Outbound

(2)

192.168.0.5

6510

172.16.0.9

Any

TCP Client

Inbound

Single Port Communication

In this scenario, the TCP client (Core Service) connects to the TCP server (Connector Service) on the fixed port it is listening on, and the server replies on a fixed port specified by the client (default also 6510). For this configuration, your firewall needs to allow:

Table 2. Single Port Communication
Leg From IP From Port To IP To Port On Host Direction

(1)

172.16.0.9

6510

192.168.0.5

6510

TCP Client

Outbound

(1)

172.16.0.9

6510

192.168.0.5

6510

TCP Server

Inbound

(2)

192.168.0.5

6510

172.16.0.9

6510

TCP Server

Outbound

(2)

192.168.0.5

6510

172.16.0.9

6510

TCP Client

Inbound

Communication over Corporate Firewall

In the event that TCP traffic between TCP server and client is regulated by an additional corporate firewall, the local firewalls should still be configured as described above. The basic communication stays the same and only the additional firewall(s) between the TCP server and the client needs to be configured according to the communication type (single or random high port reply).

Example TCP Communication 2
Figure 2. Example TCP Communication 2

Any firewall between the two hosts needs to allow the traffic in the same way described above. Some firewall types allow specification of the "Established Connection" parameter, meaning that if a connection from TCP client to TCP server was successfully created, the reply will always be allowed with no further specification of outbound rules.

Further information on the security aspects of inmation communication can be found in the Secure Communication section of the documentation.