Tekelec.com

Subscribe via Email

Your email:

SIP Sessions

Current Articles | RSS Feed RSS Feed

FAQ: What is a "SIP proxy" and what does it mean for it to be "stateful"?

We've been diving into some fairly deep subjects recently - here's some lighter technical fare.

We are often asked what SIP proxies are, particularly when they're called stateful proxies.

A SIP proxy, as defined by RFC3261, is the only standard SIP element that is not an endpoint. Following the strict requirements in RFC3261, a SIP proxy forwards a request to one or more destinations, gathers the best response from each of those locations and forwards that response back to the requester.

It is important to note that a SIP proxy can deliver a single request to multiple destinations simultaneously. That is, Alice can call Bob and all five of Bob's phones will start ringing at once (because Bob's proxy was configured to handle calls for Bob that way). Proxies can also try a request at one class of destinations and if they don't provide an answer quickly enough, withdraw the request from them and try somewhere else. For instance, if Bob doesn't answer any of his five phones within 10 seconds, his proxy will cause the phones to stop ringing and will forward Alice's invitation to Bob's voicemail server.

RFC3261 defines two modes of operation for proxies, transaction stateful and transaction stateless. Transaction stateful proxies keep track of transaction state machines - one server state machine for the request it received and several client state machines, one for each request it forwards. The "state" in transaction stateful refers to that information the proxy remembers while handling each request, waiting for responses, and handling the responses that arrive. Keeping this information allows the transaction-stateful proxy to recognize retransmissions of requests, gather responses to forked requests (and eventually chose a best response to send), and to recognize a failure condition where the request doesn't receive any response within the appropriate amount of time.

In contrast, transaction stateless proxies create no transaction state when forwarding a request. As a consequence, retransmitted requests are indistinguishable from new requests and have to be processed again, and that processing has to produce identical results or the overall system will not behave correctly. This limits transaction stateless proxies to  very special routing situations where the request will only be forwarded to exactly one location and that location does not change.

There is a different, less well defined, type of statefulness often referred to as call-stateful. A call-stateful proxy remembers successful INVITEs and keeps track of the dialog usages they create until they are terminated with a BYE. Such call-stateful proxies typically are acting as controllers for firewalls or providing some other form of policy enforcement - all well beyond what RFC3261 defines as a proxy.

Usually, when someone says "stateful proxy" they mean the transaction-stateful proxy as defined in RFC3261. But be careful - if the context in which you encounter the phrase is ambiguous, it's best to ask what was really meant.

Comments

Very good post. A SIP proxy in essence is just the term for the device used to pass the SIP connection correct?
Posted @ Saturday, March 21, 2009 12:55 PM by TJ Stamm
I assume that by "used to pass the SIP connection", you are thinking in terms of an HTTP Proxy. A SIP proxy is typically more than that. A basic (transaction-stateful) proxy can also provide rendezvous features, forking, other request routing features, etc.
Posted @ Tuesday, March 24, 2009 11:58 AM by Ben Campbell
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics

Receive email when someone replies.