Thursday, May 6, 2010

Stateless & Statefull Servers

There are two basic types of SIP proxy servers--stateless and statefull..

Stateless Servers

Stateful Servers

  • Stateless servers are simple message forwarders.
  • They forward messages independently of each other. Although messages are usually arranged into transactions, stateless proxies do not take care of transactions.
  • Stateless proxies are simple, but faster than stateful proxy servers.
  • They can be used as simple load balancers, message translators and routers.
  • One of drawbacks of stateless proxies is that they are unable to absorb retransmissions of messages and perform more advanced routing, for instance, forking or recursive forwarding.
  • Statefull proxies are more complex.
  • Upon reception of a request, statefull proxies create a state and keep the state
    until the transaction finishes.
  • Some transactions, especially those created by INVITE, can last quite long (until callee picks up or declines the call). Because stateful proxies must maintain the state for the duration of the transactions, their performance is limited.
  • The ability to associate SIP messages into transactions gives stateful proxies some interesting features
  • Statefull proxies can perform forking, that means upon reception of a message two or more messages will be sent out.
  • Statefull proxies can absorb retransmissions because they know, from the transaction state, if they have already received the same message (stateless proxies cannot do the check because they keep no state)
  • Statefull proxies can perform more complicated methods of finding a user. It is, for instance, possible to try to reach user's office phone and when he doesn't pick up then the call is redirected to his cell phone. Stateless proxies can't do this because they have no way of knowing how the
    transaction targeted to the office phone finished.

Most SIP proxies today are stateful because their configuration is usually very complex. They often perform accounting, forking, some sort of NAT traversal aid and all those features require a stateful proxy.

No comments: