In comedy they say that timing is everything. While it’s not quite everything for SIP, timing is still very important. In fact, there are several aspects of SIP that ensure that messages are delivered on time.
In this blog article I will deal with the three basic SIP timer parameters – T1, Timer 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.
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.
There are other aspects of SIP timing that I will address in later blogs, but understanding T1, Timer B and Timer F are crucial to becoming a SIP guru.
For a further look, please read my Understanding SIP Timers Part II.