Applies to: BLAZE
Summary
This article explains how to verify the WebRTC peer-to-peer (P2P) negotiation status within client logs when using cloud-based logins. It also explains how to identify whether the connection uses a Local, P2P, or Relay transmission path.
Connection Types
Local (Direct P2P Connection)
A Local connection is the fastest and most efficient connection type because data travels directly between peers using public IP addresses and ports. This connection typically works when both peers are on the same local network or when the network NAT is open and permissive. No relay server is involved, which results in the lowest latency.
P2P (STUN-Assisted Connection)
If a direct Local connection fails, WebRTC attempts a STUN-assisted P2P connection. STUN (Session Traversal Utilities for NAT) servers help devices behind NAT discover their public-facing IP address and port mapping so the peers can establish a direct connection through NAT hole punching. The STUN server only assists with address discovery and does not relay media traffic.
Relay (TURN-Relayed Connection)
If both the direct connection and the STUN-assisted connection fail, WebRTC uses a TURN relay connection. In this mode, a TURN server relays all traffic between peers. Relay mode provides the highest connection success rate in restrictive network environments, but it increases latency because all traffic passes through the relay server.
Compared to a Local connection, WebRTC connections may show increased latency and reduced bandwidth. This effect is more noticeable in Relay mode because all traffic passes through a cloud relay server.
Checking the Remote Connection Type
To check the remote connection type from both the server log and the client log:
- Search the logs for Selected Candidate Pair.
- Check the selected IP and connection type.
The connection type displays as one of the following: host, srflx, or relay.
Connection modes are defined based on the type combination:
Both are Host-Host: Direct/Local
Both are srflx-srflx: P2P STUN
Server is relay, client is srflx:
Server to client: P2P STUN
Client to server: Relay TURN
Server is srflx, client is relay:
Server to client: Relay TURN
Client to server: P2P STUN
Both are relay: Relay TURN
Comments
0 comments
Article is closed for comments.