Audio-only publish fails with "Failed by ICE keep alive" on a good connection

Dani

Member
Setup
  • WCS 5.3.498, Web SDK 2.0.286, WebRTC only.
  • Keep-alive settings are the defaults: keep_alive.algorithm=HIGH_LEVEL, keep_alive.server_interval=5000, keep_alive.probes=10.
Problem

In several cases, the first party's audio-only publish failed with the status info "Failed by ICE keep alive", although the first party had a good connection:

  • The video publish's RTT in getStats was 11 ms in one case and 16 ms in the other, with no packet loss. Video bitrate was 2.2-2.5 Mbps.
  • Both had been publishing for over an hour.
  • The Web SDK session (WebSocket) stayed ESTABLISHED.
  • The selected ICE candidate pair was TCP (prflx)
Questions
  1. What exactly does the server check for "ICE keep alive" on a publish stream? Is it the STUN binding requests and responses on that stream's own ICE connection? Which timeout applies, and can it be configured?
  2. Is a low-bitrate audio-only stream (Opus) over TCP known to be more exposed to this? For example, could the browser send consent checks less often on that connection?
  3. Which server log or CDR field shows the last STUN activity for a stream, so we can see what happened before the failure?
  4. Is there a setting to make an audio-only stream more robust?
 
Good day.
What exactly does the server check for "ICE keep alive" on a publish stream? Is it the STUN binding requests and responses on that stream's own ICE connection? Which timeout applies, and can it be configured?
Yes, ICE keep alive controls STUN binding requests and responses timeout. Please see a detalied WebRTC description here. The parameter is
Code:
ice_keep_alive_timeout=15
The timeout is 15 seconds by default. If no responce received to the STUN binding request in this interval, the ICE connection fails.
Is a low-bitrate audio-only stream (Opus) over TCP known to be more exposed to this? For example, could the browser send consent checks less often on that connection?
No. The most possible reason is ports blocking at client side or between client and server. This affects both audio only and audiio+video streams.
Which server log or CDR field shows the last STUN activity for a stream, so we can see what happened before the failure?
The successful ICE logs look like this (in the example, the server port negotiated for audio only stream is 31010)
Server logs:
Code:
23:44:49,306 INFO             TcpServer - ICE-TCP-pool-40-thread-1 Channel connected /*.*.*.27:9399
23:44:49,314 INFO             TcpServer - ICE-TCP-pool-40-thread-2 Channel connected /*.*.*.27:29979
23:44:49,390 INFO  ergingDatagramSocket - ICE-TCP-pool-40-thread-1 Adding allowed address: *.*.*.27:9399/tcp
23:44:49,454 INFO  ergingDatagramSocket - ICE-TCP-pool-40-thread-2 Adding allowed address: *.*.*.27:29979/tcp
23:44:49,486 INFO    AbstractStunSocket - FScheduling-pool-1-thread-4 Stun connection established, create remote candidate: bundle/
23:44:49,486 INFO    AbstractStunSocket - FScheduling-pool-1-thread-4 All stream are connected by STUN, calling agent listener: COMPLETED
23:44:49,487 INFO                 Agent - Stun-Clbk-thread tcp//*.*.*.39:31010 ICE state changed from Running to Completed. Local ufrag 12203210/cc17/11f1/8cc1/11c880ef7cbdatie41k5b8rc7a
23:44:49,487 INFO          MediaSession - IceTimeoutThread - 12203210-cc17-11f1-8cc1-11c880ef7cbd Ice timeout thread interrupted
23:44:50,310 INFO             TcpServer - ICE-TCP-pool-40-thread-3 Channel connected /*.*.*.27:31533
23:44:50,445 INFO  ergingDatagramSocket - ICE-TCP-pool-40-thread-3 Adding allowed address: *.*.*.27:31533/tcp
Client logs:
Code:
23:44:48,874 INFO              IceAgent - API-ASYNC-pool-2-thread-44 Create custom STUN agent: 12203210/cc17/11f1/8cc1/11c880ef7cbdatie41k5b8rc7a
...
23:44:48,878 INFO              IceAgent - API-ASYNC-pool-2-thread-44 Create custom STUN media stream: bundle
23:44:48,879 INFO             Component - API-ASYNC-pool-2-thread-44 Component created on socket port: 31010
23:44:48,884 INFO              IceAgent - API-ASYNC-pool-2-thread-44 Change agent state to: RUNNING
...
23:44:48,885 INFO              IceAgent - API-ASYNC-pool-2-thread-44 Start component: Component id=1 parent stream=bundle
1 Local candidates:
default candidate: candidate:1 1 tcp 2113929471 *.*.*.39 31010 typ host
candidate:1 1 tcp 2113929471 *.*.*.39 31010 typ host
no remote candidates.
23:44:49,487 INFO              IceAgent - Stun-Clbk-thread tcp//*.*.*.39:31010 Change agent state to: COMPLETED
Is there a setting to make an audio-only stream more robust?
You may try to change media ports range (media_ports_from-media_ports_to) to use ports which are not blocked at client side.
 
Top