# Network design ## Target transports - IPv4 and IPv6 - ICE host and server-reflexive candidates - TURN over UDP as preferred relay - TURN over TCP/TLS as restrictive-network fallback - Direct peer connectivity where possible ## Initial ports - API/signaling HTTPS/WSS: TCP 443 (or 8080/8081 in local development) - STUN/TURN: UDP/TCP 3478 - TURN TLS: TCP 5349 - TURN relay range: configure a bounded UDP range and open it in the firewall Port 443 cannot be shared blindly between HTTPS and TURN-TLS. Use a dedicated IP/listener or explicit routing architecture. TURN credentials must be short-lived and generated using the coturn REST shared-secret mechanism. ## Recovery Observe Android network callbacks and WebRTC ICE state. On network changes or failed ICE, perform a controlled ICE restart. Preserve the authenticated call session only while its cryptographic state remains valid. Never reset packet counters under an unchanged key; rekey if required by the media protocol. ## Test matrix LTE/LTE, 5G/5G, Wi-Fi/Wi-Fi, Wi-Fi/LTE, IPv4-only, IPv6-only, dual-stack, CGNAT, UDP blocked, TCP/TLS relay, airplane-mode interruption and handover.