[libnice] a question on STUN retransmission timer

Tom Chen chentom60 at hotmail.com
Fri Nov 6 11:02:43 PST 2015

My multiple tests show that, the local candidates gathering does not stop until the timer timeout no matter whether it has established connection with remote machine or not. And the total timeout is only related to. 

 total_timeout =  initial_timeout * (2^(max_retransmissions + 1) - 1);

Even if all local candidates have been gathered,  the candidate gathering done signal is not sent until timer timeouts.

From: chentom60 at hotmail.com
To: nice at lists.freedesktop.org
Date: Fri, 6 Nov 2015 10:38:58 -0800
Subject: [libnice] a question on STUN retransmission timer


In stun\usages\timer.h, there are some flags related to STUN retransmission timer.

 * The default intial timeout to use for the timer

 * The default maximum retransmissions allowed before a timer decides to timeout

 * stun_timer_start:
 * Starts a STUN transaction retransmission timer.
 * This should be called as soon as you send the message for the first time on
 * a UDP socket.
 * The timeout before the next retransmission is set to @initial_timeout, then
 * each time a packet is retransmited, that timeout will be doubled, until the
 * @max_retransmissions retransmissions limit is reached.
 * total_timeout =  initial_timeout * (2^(max_retransmissions + 1) - 1);

Reducing STUN_TIMER_DEFAULT_MAX_RETRANSMISSIONS can significantly reduce the time used in local candidate gathering.

I am wondering why the equation in timer.h which is used to calculate the total time needed for local candidate gathering does not consider the number of local & remote network interfaces?

 total_timeout =  initial_timeout * (2^(max_retransmissions + 1) - 1);


nice mailing list
nice at lists.freedesktop.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nice/attachments/20151106/aa660891/attachment.html>

More information about the nice mailing list