Search code examples
sipvoippjsipsip-server

How to design a carrier grade SIP Server?


There are some SIP Servers which handle few thousand subscribers and some other which can handle millions of subscribers with similar underlying hardware. What are the design and development factors to be considered for implementing SIP Servers which can handle such massive amount of traffic?


Solution

  • First, I'm going to assume you're interested in building your own SIP signaling applications so your question is directed at SIP applications servers and the applications running on top of them. I'm not going to talk about products like Asterisk. There aren't that many choices when it comes to Java app servers that include SIP servlet containers. Basically the big three are IBM's WebSphere server, Oracle's Communications server and Mobicents. I'm mostly familiar with WebSphere which you can download for free at www.wasdev.net but I'm sure all of these products scale on the signaling side very well. Well beyond a couple of thousand endpoints and if you're willing to cluster the servers you could support into the thousands of calls per second fairly easily. This is how tier one providers like AT&T scale their Voip services to massive numbers of endpoints.

    If you are including media processing in your question that is when you quickly start getting into scalability issues. Server-side media processing (record/playback, multiway mixing, SFUs, etc.) can be extremely processor intensive. In the SIP servlet world media servers are controlled via the media control API (JSR 309) which delineates the signaling plane form the media plane. So its hard to provide an answer to your question without knowing more about the types of applications you SIP server needs to host.

    There are a lot of factors that can affect the scalability of SIP servlet applications that rely on a SIP servlet container. Threading is the key. You want to make sure you are never blocking threads in your application code. Everything must be asynchronous to scale. For developers not used to writing asynchronous code this can take a little getting used to but its critical to figure this out before taking on any real-time signaling development. In terms of Java servers you also want to tune your JVM for the best possible results. This goes beyond making sure you have enough heap space to accommodate the number of calls per second you server must support. There are many JVM Garbage Collection (GC) knobs that can be turned to adjust the nursery size, etc. Its critical that the GC configuration is right for your server. Most JVMs also have specific GC algorithms that are designed to work better for real-time applications. For instance, the JVM used with IBM WebSphere supports a GC algorithm called metronome which trades of GC activity for low latency.

    This is an enormous subject so if you can provide some more details about what your trying to accomplish with a SIP server I might be able to provide more insight.