RFC 4321 INFORMATIONAL SIP · MESSAGING · PROTOCOLS

SIP non-INVITE problems: Problems Identified Associated with the Session Initiation Protocol's (SIP) Non-INVITE Transaction

Six edge cases in which a SIP request that is not an INVITE can time out, be ignored, or be answered too late to be useful.

On rfc-editor.org ↗
PUBLISHED
January 2006
AUTHORS
R. Sparks
STREAM
IETF
NON-INVITE TRANSACTION DURATION
64*T1
DEFAULT VALUE OF T2
8*T1
RECOVERY WITHOUT A PROVISIONAL
Within 2*T1
WORST-CASE PROVISIONAL DELAY
Up to 3.5 seconds
PROBLEMS IDENTIFIED
6
DOI
10.17487/RFC4321

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Network Working Group                                          R. Sparks
Request for Comments: 4321                              Estacado Systems
Category: Informational                                     January 2006


                Problems Identified Associated with the
       Session Initiation Protocol's (SIP) Non-INVITE Transaction


Status of This Memo

   This memo provides information for the Internet community.  It does
   not specify an Internet standard of any kind.  Distribution of this
   memo is unlimited.

Copyright Notice

   Copyright (C) The Internet Society (2006).

Abstract

   This document describes several problems that have been identified
   with the Session Initiation Protocol's (SIP) non-INVITE transaction.

Table of Contents

   1. Problems under the Current Specifications .......................2
      1.1. NITs must complete immediately or risk losing a race .......2
      1.2. Provisional responses can delay recovery from lost
           final responses ............................................3
      1.3. Delayed responses will temporarily blacklist an element ....4
      1.4. 408 for non-INVITE is not useful ...........................6
      1.5. Non-INVITE timeouts doom forking proxies ...................7
      1.6. Mismatched timer values make winning the race harder .......7
   2. Security Considerations .........................................8
   3. Acknowledgements ................................................8
   4. Informative References ..........................................9

1.  Problems under the Current Specifications

   There are a number of unpleasant edge conditions created by the SIP
   non-INVITE transaction (NIT) model's fixed duration.  The negative
   aspects of some of these are exacerbated by the effect that
   provisional responses have on the non-INVITE transaction state
   machines as currently defined.

1.1.  NITs must complete immediately or risk losing a race

   The non-INVITE transaction defined in RFC 3261 [1] is designed to
   have a fixed and finite duration (dependent on T1).  A consequence of
   this design is that participants must strive to complete the
   transaction as quickly as possible.  Consider the race condition
   shown in Figure 1.

                         UAC           UAS
                          |   request   |
                     ---  |---.         |
                      ^   |    `---.    |
                      |   |         `-->|  ---
                      |   |             |   ^
                      |   |             |   |
                    64*T1 |             |   |
                      |   |             |   |
                      |   |             | 64*T1
                      |   |             |   |
                      |   |             |   |
                      v   |             |   |
        timeout <=== ---  |   200 OK    |   |
                          |         .---|   v
                          |    .---'    |  ---
                          |<--'         |

                Figure 1: Non-Invite Race Condition

   The User Agent Server (UAS) in this figure believes it has responded
   to the request in time, and that the request succeeded.  The User
   Agent Client (UAC), on the other hand, believes the request has
   timed-out, hence failed.  No longer having a matching client
   transaction, the UAC core will ignore what it believes to be a
   spurious response.  As far as the UAC is concerned, it received no
   response at all to its request.  The ultimate result is that the UAS
   and UAC have conflicting views of the outcome of the transaction.

   Therefore, a UAS cannot wait until the last possible moment to send a
   final response within a NIT.  It must, instead, send its response so
   that it will arrive at the UAC before that UAC times out.
   Unfortunately, the UAS has no way to accurately measure the
   propagation time of the request or predict the propagation time of
   the response.  The uncertainty it faces is compounded by each proxy
   that participates in the transaction.  Thus, the UAS's only choice is
   to send its final response as soon as it possibly can and hope for
   the best.

   This result constrains the set of problems that can be solved with a
   single NIT.  Any delay introduced during processing of a request
   increases the probability of losing the race.  If the timing
   characteristics of that processing are not predictable and
   controllable, a single NIT is an inappropriate model for handling the
   request.  One viable alternative is to accept the request with a 202
   and send the ultimate results in a new request in the reciprocal
   direction.

   In specialized networks, a UAS might have some reliable knowledge of
   inter-hop latency and could use that knowledge to determine if it has
   time to delay its final response in order to perform some processing
   such as a database lookup while mitigating its risk of losing the
   race in Figure 1.  Establishing this knowledge across arbitrary
   networks (perhaps using resource reservation techniques and
   deterministic transports) is not currently feasible.

1.2.  Provisional responses can delay recovery from lost final responses

   The non-INVITE client transaction state machine provides reliability
   for NITs over unreliable transports (UDP) through retransmission of
   the request message.  Timer E is set to T1 when a request is
   initially transmitted.  As long as the machine remains in the Trying
   state, each time Timer E fires, it will be reset to twice its
   previous value (capping at T2) and the request is retransmitted.

   If the non-INVITE client transaction state machine sees a provisional
    response, it transitions to the Proceeding state, where
   retransmission continues, but the algorithm for resetting Timer E is
   simply to use T2 instead of doubling at each firing.  (Note that
   Timer E is not altered during the transition to Proceeding.)

   Making the transition to the Proceeding state before Timer E is reset
   to T2 can cause recovery from a lost final response to take extra
   time.  Figure 2 shows recovery from a lost final response with and
   without a provisional message during this window.  Recovery occurs
   within 2*T1 in the case without the provisional.  With the
   provisional, recovery is delayed until T2, which by default is 8*T1.

   In practical terms, a provisional response to a NIT in currently
   deployed networks can delay transaction completion by up to 3.5
   seconds.

                 UAC       UAS               UAC        UAS
                  |         |                 |          |
            ---   |----.    |            ---  |----.     |
             ^    |     `-->|             ^   |     `--->|
         E = T1   |         |         E = T1  |    .-----|(provisional)
             v    |         |             v   |<--'      |
            ---   |----.    |            ---  |----.     |
             ^    |     `-->|             ^   |     `--->|
             |    |   X<----|(lost final) |   |   X<-----|(lost final)
             |    |         |             |   |          |
         E = 2*T1 |         |             |   |          |
             |    |         |             |   |          |
             |    |         |             |   |          |
             v    |         |             |   |          |
            ---   |----.    |             |   |          |
                  |     `-->|             |   |          |
                  |   .-----|(final)      |   |          |
                  |<-'      |             |   |          |
                  |         |             |   |          |
                 \/\       /\/           /\/ /\/        /\/
                                      E = T2
                 \/\       /\/           /\/ /\/        /\/
                  |         |             |   |          |
                  |         |             v   |          |
                  |         |            ---  |----.     |
                  |         |                 |     `--->|
                  |         |                 |    .-----|(final)
                  |         |                 |<--'      |
                  |         |                 |          |

                   Figure 2: Provisionals Can Harm Recovery

   No additional delay is introduced if the first provisional response
   is received after Timer E has reached its maximum reset interval of
   T2.

1.3.  Delayed responses will temporarily blacklist an element

   A SIP element's use of DNS Service Record Resource Records [3] is
   specified in RFC 3263 [2].  That specification discusses how SIP
   ensures high availability by having upstream elements detect failure
   of downstream elements.  It proceeds to define several types of
   failure detection and instructions for failover.  Two of the
   behaviors it describes are important to this document:

   o  Within a transaction, transport failure is detected either through
      an explicit report from the transport layer or through timeout.
      Note specifically that timeout will indicates transport failure
      regardless of the transport in use.  When transport failure is
      detected, the request is retried at the next element from the
      sorted results of the SRV query.

   o  Between transactions, locations reporting temporary failure
      (through 503/Retry-After, for example) are not used until their
      requested black-out period expires.

   The specification notes the benefit of caching locations that are
   successfully contacted, but does not discuss how such a cache is
   maintained.  It is unclear whether an element should stop using
   (temporarily blacklist) a location returned in the SRV query that
   results in a transport error.  If it does, when should such a
   location be removed from the blacklist?

   Without such a blacklist (or equivalent mechanism), the intended
   availability mechanism fails miserably.  Consider traffic between two
   domains.  Proxy pA in domain A needs to forward a sequence of non-
   INVITE requests to domain B.  Through DNS SRV, pA discovers pB1 and
   pB2, and the ordering rules of [2] and [3] indicate it should use pB1
   first.  The first request to pB1 times out.  Since pA is a proxy and
   a NIT has a fixed duration, pA has no opportunity to retry the
   request at pB2.  If pA does not remember pB1's failure, the second
   request (and all subsequent non-INVITE requests until pB1 recovers)
   are doomed to the same failure.  Caching would allow the subsequent
   requests to be tried at pB2.

   Since miserable failure is not acceptable in deployed networks, we
   should anticipate that elements will, in fact, cache timeout failures
   between transactions.  Then the race in Figure 1 becomes important.
   If an element fails to respond "soon enough", it has effectively not
   responded at all and will be blacklisted at its peer for some period
   of time.

   (Note that even with caching, the first request timeout results in a
   timeout failure all the way back to the original submitter.  The
   failover mechanisms in [2] work well to increase the resiliency of a
   given INVITE transaction, but do nothing for a given non-INVITE
   transaction.)

1.4.  408 for non-INVITE is not useful

   Consider the race condition in Figure 1 when the final response is
   408 instead of 200.  Under the current specification, the race is
   guaranteed to be lost.  Most existing endpoints will emit a 408 for a
   non-INVITE request 64*T1 after receiving the request if they have not
   emitted an earlier final response.  Such a 408 is guaranteed to
   arrive at the next upstream element too late to be useful.  In fact,
   in the presence of proxies, these messages are even harmful.  When
   the 408 arrives, each proxy will have already terminated its
   associated client transaction due to timeout.  Therefore, each proxy
   must forward the 408 upstream statelessly.  This, in turn, is
   guaranteed to arrive too late.  As Figure 3 shows, this can
   ultimately result in bombarding the original requester with spurious
   408s.  (Note that the proxy's client transaction state machine never
   enters the Completed state, so Timer K does not enter into play.)

                     UAC        P1         P2         P3         UAS
                      |          |          |          |          |
                ---  ===---.     |          |          |          |
                 ^    |     `-->===---.     |          |          |
                 |    |          |     `-->===---.     |          |
                 |    |          |          |     `-->===---.     |
               64*T1  |          |          |          |     `-->===
                 |    |          |          |          |          |
                 |    |          |          |          |          |
                 v    |          |          |          |          |
      (timeout) ---  ===         |          |          |          |
                      |    .-408===         |          |          |
                      |<--'      |    .-408===         |          |
                      |    .-408-|<--'      |    .-408===         |
                      |<--'      |    .-408-|<--'      |    .-408===
                      |    .-408-|<--'      |    .-408-|<--'      |
                      |<--'      |    .-408-|<--'      |          |
                      |    .-408-|<--'      |          |          |
                      |<--'      |          |          |          |
                      |          |          |          |          |

                     Figure 3: Late 408s to Non-INVITEs

   This response bombardment is not limited to the 408 response, though
   it only exists when participating client transaction state machines
   are timing out.  Figure 4 generalizes Figure 1 to include multiple
   hops.  Note that even though the UAS responds "in time" to P3, the
   response is too late for P2, P1, and the UAC.

                     UAC        P1         P2         P3         UAS
                      |          |          |          |          |
                ---  ===---.     |          |          |          |
                 ^    |     `-->===---.     |          |          |
                 |    |          |     `-->===---.     |          |
                 |    |          |          |     `-->===---.     |
               64*T1  |          |          |          |     `-->===
                 |    |          |          |          |          |
                 |    |          |          |          |          |
                 v    |          |          |          |          |
      (timeout) ---  ===         |          |          |          |
                      |    .-408===         |          |    .-200-|
                      |<--'      |    .-408===   .-200-|<--'      |
                      |    .-408-|<--'.-200-|<--'     ===         |
                      |<--'.-200-|<--'      |          |         ===
                      |<--'      |          |          |          |
                      |          |          |          |          |

                  Figure 4: Additional Timeout-Related Error

1.5.  Non-INVITE timeouts doom forking proxies

   A single branch with a delayed or missing final response will
   dominate the processing at proxy that receives no 2xx responses to a
   forked non-INVITE request.  This proxy is required to allow all of
   its client transactions to terminate before choosing a "best
   response".  This forces the proxy's server transaction to lose the
   race in Figure 1.  Any response it ultimately forwards (a 401, for
   example) will arrive at the upstream elements too late to be used.
   Thus, if no element among the branches would return a 2xx response,
   failure of a single element (or its transport) dooms the proxy to
   failure.

1.6.  Mismatched timer values make winning the race harder

   There are many failure scenarios due to misconfiguration or
   misbehavior that the SIP specification does not discuss.  One is
   placing two elements with different configured values for T1 and T2
   on the same network.  Review of Figure 1 illustrates that the race
   failure is only made more likely in this misconfigured state (it may
   appear that shortening T1 at the element behaving as a UAS improves
   this particular situation, but remember that these elements may trade
   roles on the next request).  Since the protocol provides no mechanism
   for discovering/negotiating a peer's timer values, exceptional care
   must be taken when deploying systems with non-defaults to ensure that
   they will never directly communicate with elements with default
   values.

2.  Security Considerations

   This document describes some problems in the core SIP specification
   [1] related to the SIP non-INVITE requests, the messages other than
   INVITE that begin transactions.  A few of the problems lead to
   flooding or forgery risk, and could possibly be exploited by an
   adversary in a denial of service attack.  Solutions are defined in
   the companion document [4].

   One solution there prohibits proxies and User Agents from sending 408
   responses to non-INVITE transactions.  Without this change, proxies
   automatically generate a storm of useless responses.  An attacker
   could capitalize on this by enticing User Agents to send non-INVITE
   requests to a black hole (through social engineering or DNS
   poisoning) or by selectively dropping responses.

   Another solution prohibits proxies from forwarding late responses.
   Without this change, an attacker could easily forge messages which
   appear to be late responses.  All proxies compliant with RFC 3261 are
   required to forward these responses, wasting bandwidth and CPU and
   potentially overwhelming target User Agents (especially those with
   low speed connections).

3.  Acknowledgements

   This document captures many conversations about non-INVITE issues.
   Significant contributers include Ben Campbell, Gonzalo Camarillo,
   Steve Donovan, Rohan Mahy, Dan Petrie, Adam Roach, Jonathan
   Rosenberg, and Dean Willis.

4. Informative References

   [1]  Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A.,
        Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP:
        Session Initiation Protocol", RFC 3261, June 2002.

   [2]  Rosenberg, J. and H. Schulzrinne, "Session Initiation Protocol
        (SIP): Locating SIP Servers", RFC 3263, June 2002.

   [3]  Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for
        specifying the location of services (DNS SRV)", RFC 2782,
        February 2000.

   [4]  Sparks, R., "Actions Addressing Identified Issues with the
        Session Initiation Protocol's (SIP) Non-INVITE Transaction", RFC
        4320, January 2006.

Author's Address

   Robert J. Sparks
   Estacado Systems
   17210 Campbell Road
   Suite 250
   Dallas, TX 75252-4203

   EMail: rjsparks@estacado.net

Full Copyright Statement

   Copyright (C) The Internet Society (2006).

   This document is subject to the rights, licenses and restrictions
   contained in BCP 78, and except as set forth therein, the authors
   retain all their rights.

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Intellectual Property

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at
   http://www.ietf.org/ipr.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at
   ietf-ipr@ietf.org.

Acknowledgement

   Funding for the RFC Editor function is provided by the IETF
   Administrative Support Activity (IASA).

ISO Plain Language

On this page
PROBLEMA SIP non-INVITE transaction has a fixed, finite duration, so anything that answers slowly or not at all leaves the two ends disagreeing about what happened.
MECHANISMThe document works through the resulting problems: the race between a final response and the client timeout, the way a provisional response delays recovery, the need to blacklist a server that answers too slowly, the useless 408 response, the effect on forking proxies, and the damage done by mismatched timer settings.
STATUS TODAYIt is an Informational document that states the problems rather than fixing them. The solutions are in the companion document RFC 4320.

§1Six Problems With the Non-INVITE Transaction

The SIP non-INVITE transaction is the transaction model used for SIP requests other than INVITE, such as the requests that begin transactions. A number of unpleasant edge conditions are created by its fixed duration, and the negative aspects of some of them are made worse by the effect that provisional responses have on the non-INVITE transaction state machines as currently defined.

The document lists six problems. A non-INVITE transaction must complete immediately or it risks losing a race against the client's timeout. Provisional responses can delay recovery from a lost final response. Delayed responses will temporarily blacklist an element. The 408 response is not useful for a non-INVITE. Non-INVITE timeouts doom forking proxies. And mismatched timer values make winning the race harder.

The document states the problems only. The solutions are defined in the companion document, RFC 4320.

A SIP transaction that is not an INVITE has to finish quickly, because it is given only a fixed amount of time. The document lists the six ways that fixed limit causes trouble.

§1.1The Race Every Non-INVITE Can Lose

The non-INVITE transaction defined in RFC 3261 is designed to have a fixed and finite duration, dependent on the timer T1. A consequence of this design is that participants must strive to complete the transaction as quickly as possible.

Consider the race condition in Figure 1. The User Agent Server believes it has responded to the request in time, and that the request succeeded. The User Agent Client, on the other hand, believes the request has timed out and therefore failed. No longer having a matching client transaction, the client core ignores what it believes to be a spurious response. As far as the client is concerned, it received no response at all. The result is that the two ends have conflicting views of the outcome.

A UAS therefore cannot wait until the last possible moment to send a final response. It must send its response so that it arrives at the client before that client times out. Unfortunately the UAS has no way to measure the propagation time of the request accurately, or predict the propagation time of the response, and the uncertainty is compounded by each proxy that takes part in the transaction. Its only choice is to send the final response as soon as it can and hope for the best.

This constrains the set of problems a single non-INVITE can solve. Any delay introduced while processing the request increases the probability of losing the race. If the timing of that processing is not predictable and controllable, a single transaction is an inappropriate model for handling the request. One viable alternative is to accept the request with a 202 and send the ultimate results in a new request in the reciprocal direction. In specialised networks, a UAS might have reliable knowledge of inter-hop latency and use it to decide whether it has time to delay its final response for a database lookup, but establishing that knowledge across arbitrary networks, perhaps using resource reservation techniques and deterministic transports, is not currently feasible.

The server and the client each have a timer running. If the server's reply crosses the line just after the client has given up, the server thinks it succeeded and the client thinks it failed, and the client discards the reply as a stray message.

THE TWO SIDES OF THE NON-INVITE RACE
ElementWhat it believes about the transaction
UAS, the serverIt answered in time, so the request succeeded
UAC, the clientThe request timed out, so it failed, and the late reply is ignored as spurious

§1.2Provisional Responses Delay Recovery

The non-INVITE client transaction state machine provides reliability for these transactions over unreliable transports such as UDP through retransmission of the request message. Timer E is set to T1 when a request is initially transmitted. As long as the machine remains in the Trying state, each time Timer E fires it is reset to twice its previous value, capped at T2, and the request is retransmitted.

If the state machine sees a provisional response it transitions to the Proceeding state, where retransmission continues but the algorithm for resetting Timer E is simply to use T2 instead of doubling at each firing. Timer E is not altered during the transition to Proceeding.

Making that transition before Timer E has been reset to T2 can make recovery from a lost final response take extra time. Recovery occurs within 2*T1 in the case without a provisional message. With a provisional response, recovery is delayed until T2, which by default is 8*T1. No additional delay is introduced if the first provisional response is received after Timer E has already reached its maximum reset interval of T2.

In practical terms, a provisional response to a non-INVITE in currently deployed networks can delay transaction completion by up to 3.5 seconds.

When the client is still resending the request, it backs off faster each time. But if the server sends an interim reply, the client stops backing off and settles on the long interval, so a lost final reply is not noticed for much longer.

THE TIMERS THAT GOVERN A NON-INVITE TRANSACTION
  • T1Initial retransmission interval — Timer E is set to T1 when the request is first transmitted, and is doubled on each firing while in the Trying state.
  • T2Maximum retransmission interval — Timer E is capped at T2, and by default T2 is 8*T1.
  • 64*T1Transaction duration — The fixed, finite duration of a non-INVITE transaction, and the delay before an endpoint emits a 408.
  • 2*T1Recovery without a provisional — Recovery from a lost final response occurs within this time when no provisional response has been received.
  • 3.5 secondsWorst-case delay — How much a provisional response can delay completion of a non-INVITE in currently deployed networks.

§1.3A Slow Server Gets Blacklisted

RFC 3263 specifies how a SIP element uses DNS Service Record resource records, and it discusses how SIP ensures high availability by having upstream elements detect the failure of downstream elements. Two behaviours matter here. Within a transaction, transport failure is detected either through an explicit report from the transport layer or through timeout, and timeout indicates transport failure regardless of the transport in use. When transport failure is detected, the request is retried at the next element from the sorted results of the SRV query. Between transactions, locations reporting temporary failure, for example through a 503 with Retry-After, are not used until their requested black-out period expires.

The specification notes the benefit of caching locations that are successfully contacted, but does not discuss how such a cache is maintained. It is unclear whether an element should stop using, that is temporarily blacklist, a location returned in the SRV query that results in a transport error, and if so, when the location should be removed from the blacklist.

Without such a blacklist the intended availability mechanism fails miserably. Consider traffic between two domains. A proxy in domain A has to forward a sequence of non-INVITE requests to domain B. Through DNS SRV it discovers pB1 and pB2, and the ordering rules indicate it should use pB1 first. The first request to pB1 times out. Since a non-INVITE transaction has a fixed duration, the proxy has no opportunity to retry the request at pB2 within that transaction. If the proxy does not remember pB1's failure, the second request, and all subsequent non-INVITE requests until pB1 recovers, are doomed to the same failure. Caching would allow the subsequent requests to be tried at pB2.

Since such failure is not acceptable in deployed networks, elements are expected to cache timeout failures between transactions. Then the race described earlier becomes important: an element that fails to respond soon enough has effectively not responded at all, and will be blacklisted at its peer for some period. Even with caching, the first request timeout still results in a timeout failure all the way back to the original submitter, because the failover mechanisms of RFC 3263 increase the resiliency of an INVITE transaction but do nothing for a given non-INVITE transaction.

Servers are found through a DNS lookup that returns a ranked list. If the first one on the list does not answer, the proxy should remember that and try the next one for later requests, because a non-INVITE cannot be retried inside the same transaction.

§1.4Late Responses, Forking Proxies and Mismatched Timers

408 for a non-INVITE is not useful. Most existing endpoints emit a 408 for a non-INVITE request 64*T1 after receiving the request if they have not emitted an earlier final response, and such a 408 is guaranteed to arrive at the next upstream element too late to be useful. In the presence of proxies the messages are even harmful: by the time the 408 arrives, each proxy has already terminated its client transaction due to timeout, so each proxy must forward the 408 upstream statelessly, and that too arrives too late. The result can be the original requester being bombarded with spurious 408s. The proxy's client transaction state machine never enters the Completed state, so Timer K does not come into play. This response bombardment is not limited to the 408, though it only exists when participating client transaction state machines are timing out, and it can even affect a successful response: even though the server responds in time to the last proxy, the response is too late for the proxies in between and for the client.

Non-INVITE timeouts doom forking proxies. A single branch with a delayed or missing final response dominates the processing at a proxy that receives no 2xx responses to a forked non-INVITE request. This proxy is required to allow all of its client transactions to terminate before choosing a best response, which forces the proxy's server transaction to lose the race described earlier. Any response it ultimately forwards, a 401 for example, arrives at the upstream elements too late to be used. So if no element among the branches would return a 2xx response, the failure of a single element or its transport dooms the proxy to failure.

Mismatched timer values make winning the race harder. There are many failure scenarios due to misconfiguration or misbehaviour that the SIP specification does not discuss. One is placing two elements with different configured values for T1 and T2 on the same network. The race failure only becomes more likely in that state, and it may appear that shortening T1 at the element behaving as the server improves the situation, but these elements may trade roles on the next request. Since the protocol provides no mechanism for discovering or negotiating a peer's timer values, exceptional care must be taken when deploying systems with non-default values, to ensure they never communicate directly with elements using default values.

Three further problems follow. The rejection a server sends after its own timeout arrives long after the caller stopped waiting, so it is wasted work and can be used to flood a caller. A proxy that sent the same request to several servers has to wait for all of them, so one slow server dooms it. And two machines with different timeout settings lose the race more often than two that agree.

THE REMAINING PROBLEMS
  • The 408 arrives too lateA 408 emitted 64*T1 after the request reaches the next element after its own transaction has already timed out, so it must be forwarded statelessly and arrives after the requester stopped waiting.
  • Forking proxies wait for the slowest branchA proxy that sent the request to several servers must let all of its client transactions terminate before choosing a best response, so one failed branch dooms the whole proxy.
  • Mismatched timers make the race worseTwo elements with different T1 and T2 values on the same network lose the race more often, and SIP has no way to discover or negotiate a peer's timer values.

§2Why These Problems Matter for Security

The problems described are in the core SIP specification and concern the SIP requests other than INVITE that begin transactions. A few of them lead to flooding or forgery risk, and could possibly be exploited by an adversary in a denial of service attack. Solutions are defined in the companion document, RFC 4320.

One solution there prohibits proxies and user agents from sending 408 responses to non-INVITE transactions. Without this change, proxies automatically generate a storm of useless responses. An attacker could capitalise on this by enticing user agents to send non-INVITE requests to a black hole, through social engineering or DNS poisoning, or by selectively dropping responses.

Another solution prohibits proxies from forwarding late responses. Without this change, an attacker could easily forge messages which appear to be late responses. All proxies compliant with RFC 3261 are required to forward these responses, wasting bandwidth and processor time and potentially overwhelming target user agents, especially those with low speed connections.

Two of these problems can be turned into an attack. A flood of late rejections wastes the caller's resources, and a forged late response can make every proxy in the path work hard for nothing. The companion document stops both.

§7References