Add second device: which network connections are made?

Delta Chat version 2.35.0

Hi,

which network connections are made when adding a second device? The docs say, that both devices need to be on the same network, but my phones are on another vlan.

Is some automatic discovery going on? Or is the IP encoded in the QR and the second device tries to connect to this IP on a specific port?

IP addresses and ports are encoded in the QR. There is only the LAN connections to these IP addresses, so devices should be on the same network and be able to connect to each other.

That means the port is random? Not always the same?