15 March 2011

SIP Loop Detection - Part 1: RFC3261 Summary

This post is a short summary based on RFC3261. The goal of this post is to filter RFC content relevant to loop detection prior detailed investigation of looped call behaviour on Cisco gateways.

There are two kinds of "looped" calls described in RFC3261: spiral and loop.
Spiral is not an error. A typical example is call forwarding. Look at the picture, the call was forwarded to bob@example.com. Changed request content (typically, changed Request-URI) is the most important distinguisher of a spiral. The result is different processing decision than the original request.
.                          |=======|                           |=======|
  INVITE joe@example.com   |       |  INVITE joe@example.com   |       |
 ------------------------> | Proxy | ------------------------> |Proxy 2| --|
  INVITE bob@example.com   |       |                           |       |   |
 |-----------------------> |=======|                           |=======|   |
 |                                                                         |
 |-------------------------------------------------------------------------|
Loop is an error. A request that arrives, is forwarded and later comes back. Request-URI and other header fields that affects proxy operation are unchanged, processing decision would be the same. SIP relies on special procedures for loop detection and handling.