Search code examples
sip

SIP Timer inside core


I have below question on behavior of SIP Core in SIP communication.

Suppose party A calling party B. B receives INVITE and generates a '200 OK'. After generating '200 OK', B reaches the terminating state (SIP State Machine) and consequently there is no state machine in B.

Now if '200 OK' does not reach A, B is suppose to re-transmit '200 OK' as it has not receive ACK. RFC 3261 says it is SIP Core responsibility to re-transmit the '200 OK'.

So what is trigger in B's SIP core to send this re-transmit? Does it maintains any timers? Or is it implementation dependent?

Regards, Sudhansu


Solution

  • The restransmission of 2xx from B is explained in Section 13.3.1.4 The INVITE is Accepted

    The exact text is this one:

    The 2xx response is passed to the transport with an
    interval that starts at T1 seconds and doubles for each
    retransmission until it reaches T2 seconds (T1 and T2 are defined in
    Section 17).  Response retransmissions cease when an ACK request for
    the response is received.
    

    The end of retransmission is explained after:

    If the server retransmits the 2xx response for 64*T1 seconds without
    receiving an ACK, the dialog is confirmed, but the session SHOULD be
    terminated.  This is accomplished with a BYE, as described in Section
    15.
    

    This means that the application layer (ie: not the transaction layer) needs to manage the timers.

    The timers T1 and T2 are defined in table 4: A Table of Timer Values.

    T1       500ms default    Section 17.1.1.1     RTT Estimate
    T2       4s               Section 17.1.2.2     The maximum retransmit
                                                   interval for non-INVITE
                                                   requests and INVITE
                                                   responses
    T4       5s               Section 17.1.2.2     Maximum duration a
                                                   message will
                                                   remain in the network
    

    Is it allowed to modify the T1, T2 and T4 values. However, in theory, for usual Internet, they shouldn't be changed.

    For example, if all ACK are lost, the retransmission would be made within those intervals:

    500ms 1s 2s 4s 4s 4s 4s ...

    until total is 64*T1 = 32 seconds