UDP Ice connection failed

Hello,
I have a setup with tcp disabled, one worker and one router. The server is behind a NAT.
The worker is configured with all logging tags and with a debug level.
Ports are properly forwarded (checked with netcat), and announcedIp is good. Also the worker bind to 0.0.0.0.
The “UDP ICE pairing” failed systematically.

Browser side, i see the SDP with the correct announced ip. I see the status of the connection change to pending, and finished with a fail after 15 seconds.

Server side, i see the correct port opened, in UDP, and using tcpdump i see packets coming from the client.

Here the kind of packet :
1 0.000000 STUN 150 Binding Request user: p3hbyv4lwkw790n5:975e78e4

I don’t see any outgoing packet nor any logs on the worker output. Is that supposed to be the case? I suppose there isn’t the expected behavior.

I see in the cpp code than we have a MS_TRACE macro. How enable it?

Thanks for advance

After enabling the MS_TRACE macro, is see a bunch of udp packet incoming, but no response.

  e[33;1mmediasoup:Channel e[0m[pid:15] (trace) src/handles/UdpSocketHandler.cpp:257 | UdpSocketHandler::OnUvRecv() e[33m+0mse[0m
  e[33;1mmediasoup:Channel e[0m[pid:15] (trace) src/handles/UdpSocketHandler.cpp:246 | UdpSocketHandler::OnUvRecvAlloc() e[33m+0mse[0m
  e[33;1mmediasoup:Channel e[0m[pid:15] (trace) src/handles/UdpSocketHandler.cpp:257 | UdpSocketHandler::OnUvRecv() e[33m+0mse[0m
  e[33;1mmediasoup:Channel e[0m[pid:15] (trace) src/handles/UdpSocketHandler.cpp:246 | UdpSocketHandler::OnUvRecvAlloc() e[33m+0mse[0m
  e[33;1mmediasoup:Channel e[0m[pid:15] (trace) src/handles/UdpSocketHandler.cpp:257 | UdpSocketHandler::OnUvRecv() e[33m+0mse[0m
  e[33;1mmediasoup:Channel e[0m[pid:15] (trace) src/handles/UdpSocketHandler.cpp:246 | UdpSocketHandler::OnUvRecvAlloc() e[33m+0mse[0m
  e[33;1mmediasoup:Channel e[0m[pid:15] (trace) src/handles/UdpSocketHandler.cpp:257 | UdpSocketHandler::OnUvRecv() e[33m+0mse[0m
  e[33;1mmediasoup:Channel e[0m[pid:15] (trace) src/handles/UdpSocketHandler.cpp:246 | UdpSocketHandler::OnUvRecvAlloc() e[33m+0mse[0m

Digging into the cpp code, i suppose than packets are empty, else where there should have a log about UserOnUdpDatagramReceived function.

mediasoup work on ice-lite mode, your server behind a nat may not support ice-lite.
Ports are properly forwarded means all the udp ports are forwarded from announcedip address?

Hello,
yes, the complete range port is forwarded “as is” to the internal ip address of the server from the announcedIp.
The original ip is kept.

I don’t understand why it could not support ice lite. It is a mediasoup feature right?

Thanks for your response.

Hi Ragot.

In my short experience with mediasoup, and mediasoup-demo, y have setup router forwarding for udp ports to internal server IP (also open these ports in server firewall).

Then configure webRtcTransportOptions ip to ‘0.0.0.0’ and announcedIp to public external ip.

About http transport for the demo, I forwarded 4443 por to internal server ip, and configure listenIp to this ip (ex 192.168.2.10 - not 0.0.0.0 nor 127.0.0.1)

It is running perfect behind de NAT

Yes, it is also the same setup. Not the demo app but based on it.
I have not indicated, than it is working with tcp (random disconnection after a while but working).

The weird thing is than STUN binding request packets are coming to the expected interface, and the expected port, tcpdump show it. But when i look at mediasoup traces, there are no packet received (no log on UserOnUdpDatagramReceived).

up, any suggestion here ? :sunny: