# Network

The network system can be configured in multiple ways depending on your network setup. By default, the Streamer acts as the initiator of the connection and the Player acts as a responder. Also, a single link is used by default. In this setup, the receive port of the Player must be accessible by the Streamer.

## Settings

![remote streamer network](_images/remote-streamer-network.png)

Figure 1. Network settings overview.

Bind IP

The IP address to bind to when opening the network socket. If nothing or `0.0.0.0` is specified, the address will be assigned automatically by the operating system.

Bind Device

Linux only. This means that all traffic associated with this link will go through the specified interface. Be aware that this also effectively bypasses any configured network routes on the system.

Mode

The link mode to use. An Initiator link will try to initiate the connection. A Responder link will listen and then reply to traffic from an Initiator link. More technically, this means that an Initiator link can be behind a NAT and the Responder link must be on a public IP. This restriction can be circumvented by using encryption and routing through a WireGuard server, see [Encryption](#encryption).

### Responder Link

Receive Port

The network port used to listen to incoming traffic.

### Initiator Link

Destination Addr.

The address of the corresponding Responder link. Can be either a domain name or an IP address.

Destination Port

The receive port of the corresponding Responder link.

## Link Stats

![remote streamer link stats](_images/remote-streamer-link-stats.png)

Figure 2. Link Stats.

If you enable link stats you get the following stats for each link.

The first section shows the incoming and outgoing bandwidth categorized by the traffic type.

The second section of the link stats shows a graph where each column is a frame and each pixel in that column is the relative timing of a packet in that frame and the top red pixel shows when the first packet of the next frame arrived.

## Encryption

![remote streamer encryption](_images/remote-streamer-encryption.png)

Figure 3. Overview of the encryption settings.

Here are the settings to setup encryption and authentication of the traffic that the application sends using the WireGuard protocol.

For encryption to work you first have to configure your private key. This can be accomplished using the "Generate Key Pair" button.

Then you need to configure the public key of all clients that you want to allow communication with.

The last settings in the encryption tab is the Internal Src and Internal Dst settings. If you are relaying your traffic from the Streamer to the Player through a WireGuard server then you need to set the Internal Src and Dst to the corresponding IP addresses of the Player and the Streamer as configured in the WireGuard server.

## P2P

P2P enables a link to automatically transition to a peer-to-peer connection if possible. This is useful in order to reduce network latency if connected over a WireGuard server. This has no effect if the connection is already peer-to-peer.

Enable

Enables the P2P negotiation

STUN Server

STUN server used to detect the client WAN IP and port. The default server `stun.l.google.com:19302` is freely provided by Google and used for WebRTC in Google Chrome.
