SIP-TIMERS “Timing is everything”
There are several aspects of
SIP that ensure that messages are delivered on time. 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.
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. 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. 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. Final because at 32
seconds we’ve reached Timer B.
Timers
B and F function close to the network layer and are responsible for making sure
that messages are received by the next hop. They aren’t particularly
interested in what those messages are attempting to do.
If no ACK is received
for the final response of the INVITE request, the responses are retransmitted.
Comments