четверг, 25 января 2018 г.

Таймеры в SIP.

In this blog article I will deal with the three basic SIP timer parameters – T1Timer B, and Timer F.  T1 is the estimated round trip time of an IP packet.  By default, T1 is set to 500 milliseconds which for many networks can be a little on the high side.   However, the SIP standard allows you to ignore the default and set it to something that better matches your network characteristics.


The second SIP timer parameter is Timer B.  Timer B is the maximum amount of time that a sender will wait for an INVITE message to be acknowledged — i.e. a SIP response message is received.
Timer F is the maximum amount of time that a sender will wait for a non INVITE message to be acknowledged.  SIP messages such as REFER, INFO, MESSAGE, BYE, and CANCEL fall into this category.
Just the Facts
The way that Timer B and Timer F function is pretty straightforward.   Both timers default to 64 times T1.  If you take the T1 default of 500ms, Timer B and Timer F will be 32 seconds.  In other words, if an INVITE is sent and no response message is received, that INVITE will timeout in 32 seconds.  Seems like a long time, doesn’t it?  It is and that is why some installations will set T1 to something a little more reasonable.
If a SIP message is sent and no response is received, the sender doesn’t keep pounding away at the destination.  Overwhelming an unresponsive SIP endpoint with a barrage of messages will only make matters worse.  Instead, the sender does something called exponential back-off.
Let’s look again at that INVITE.  If an INVITE is sent and no response is received, the INVITE is resent T1 later.  If a response is still not received, the INVITE is sent 2 times the last timeout value.  This doubling goes on until Timer B is reached.
For Example
Assuming the default T1 of 500ms, the first INVITE message is sent at time zero.  The second is sent 500ms after the first.  The third is sent 2 times 500ms (1 second) after the second.  The fourth is sent 2 times 1 second (2 seconds) after the third.  The fifth at 4 seconds, the sixth at 8 seconds, the seventh at 16 seconds, and the eighth and final INVITE would be sent at 32 seconds.  I say final because at 32 seconds we’ve reached Timer B.
It’s as Easy as 1, 2, 3
That isn’t too hard to understand, is it?  You send the first, you send the second at T1, and you keep doubling until you reach Timer B.
Some SIP solutions make it even easier.  Instead of specifying Timer B/F as 64 times T1, Avaya Aura allows you specify the final timeout value.  In other words, you are asked for Timer B/F (Avaya only uses one timer for all SIP message types) in System Manager and that value is used along with T1 (which for Avaya appears to be the default of 500ms).
If you set Timer B/F to 4 seconds, the timeouts would look like this:
First INVITE at zero, second INVITE at 500ms, third INVITE at 1 second, fourth INVITE at 2 seconds, fifth and last INVITE at 4 seconds.  This is far more reasonable than waiting the default of 32 seconds before deciding that a SIP endpoint is not going to respond.
Отсюда https://andrewjprokop.wordpress.com/2013/07/02/understanding-sip-timers-part-i/

Плюс таблица
TimerDefault valueSectionMeaning
T1500 ms17.1.1.1Round-trip time (RTT) estimate
T24 sec.17.1.2.2Maximum retransmission interval for non-INVITE requests and INVITE responses
T45 sec.17.1.2.2Maximum duration that a message can remain in the network
Timer Ainitially T117.1.1.2INVITE request retransmission interval, for UDP only
Timer B64*T117.1.1.2INVITE transaction timeout timer
Timer C> 3 min.16.6 bullet 11Proxy INVITE transaction timeout
Timer D> 32 sec. for UDP17.1.1.2Wait time for response retransmissions
0 sec. for TCP and SCTP
Timer Einitially T117.1.2.2Non-INVITE request retransmission interval, UDP only
Timer F64*T117.1.2.2Non-INVITE transaction timeout timer
Timer Ginitially T117.2.1INVITE response retransmission interval
Timer H64*T117.2.1Wait time for ACK receipt
Timer IT4 for UDP17.2.1Wait time for ACK retransmissions
0 sec. for TCP and SCTP
Timer J64*T1 for UDP17.2.2Wait time for retransmissions of non-INVITE requests
0 sec. for TCP and SCTP
Timer KT4 for UDP17.1.2.2Wait time for response retransmissions

Комментариев нет:

Отправить комментарий