sippy / rtpproxy

The RTPproxy is a high-performance software proxy for RTP streams that can work together with Sippy B2BUA, Kamailio, OpenSIPS and SER.
http://rtpproxy.org
BSD 2-Clause "Simplified" License
405 stars 114 forks source link

RTCP port udp socket leak ? #111

Closed CyBHFal closed 3 years ago

CyBHFal commented 4 years ago

Hi,

In the following use case, the N+1 (RTCP port) is never closed. I try to correct the problem but i do not find where socket close is (or should be) done.

Version: 2.1.0 on Linux x64

To reproduce:

rtpproxy -fF -d DBUG -T 300

echo "U test0 1.2.3.4 1111 from-tag0" | socat - UNIX:/var/run/rtpproxy.sock 61092

netstat -anu Proto Recv-Q Send-Q Adresse locale Adresse distante Etat udp 0 0 0.0.0.0:61092 0.0.0.0: udp 0 0 0.0.0.0:61093 0.0.0.0:

echo "D test0 from-tag0" | socat - UNIX:/var/run/rtpproxy.sock 0

netstat -anu Proto Recv-Q Send-Q Adresse locale Adresse distante Etat **udp 0 0 0.0.0.0:61093 0.0.0.0:*** <--- SHOULD BE CLOSED

Doing this 10 times give 10 udp ports not release, each time the N+1 port.

Is this a known problem ?

Regards.

sobomax commented 4 years ago

Hmm, no, I'll check it out. Thanks for letting me know!

-Max

On Tue., Jun. 30, 2020, 11:02 a.m. CyBHFal, notifications@github.com wrote:

Hi,

In the following use case, the N+1 (RTCP port) is never closed. I try to correct the problem but i do not find where socket close is (or should be) done.

Version: 2.1.0 on Linux x64

To reproduce:

rtpproxy -fF -d DBUG -T 300

echo "U test0 1.2.3.4 1111 from-tag0" | socat - UNIX:/var/run/rtpproxy.sock 61092

netstat -anu Proto Recv-Q Send-Q Adresse locale Adresse distante Etat udp 0 0 0.0.0.0:61092 0.0.0.0: udp 0 0 0.0.0.0:61093 0.0.0.0:

echo "D test0 from-tag0" | socat - UNIX:/var/run/rtpproxy.sock 0

netstat -anu Proto Recv-Q Send-Q Adresse locale Adresse distante Etat *udp 0 0 0.0.0.0:61093 http://0.0.0.0:61093 0.0.0.0 http://0.0.0.0:** <--- SHOULD BE CLOSED

Doing this 10 times give 10 udp ports not release, each time the N+1 port.

Is this a known problem ?

Regards.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sippy/rtpproxy/issues/111, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVMJW62RL2ZCQ5I4DYWPTRZISDJANCNFSM4OMQK4RA .

sobomax commented 3 years ago

Hi CyBHFal,

Thanks for reporting, after further investigation I have figured out it's some minor issue already fixed in master branch. I call it a minor issue, since it's not really a leak, but rather some misbehavior in quite rare condition that would keep RTCP ports open indefinitely as long as proxy has no fully connected open RTP sessions. As long as one such session appears, all such ports that have been piled up would be freed at once. For tat reason nobody really stumbled upon such issue before, since it requires proxy to stay basically idle.

In any case I've merged relevant fix from master into the rtpp_2_1, so it should do the right thing even in this somewhat unusual scenario.

I am closing the ticket now, please check and feel free to let me know if the issue persists.

Thanks again and have a good weekend!