Académique Documents
Professionnel Documents
Culture Documents
DEGREE PROJECT
Computer Engineering
Keywords
VoIP, Asterisk, SIP, Real Time Database model, Resources, Parameters, VoIP traffic, Performance
analysis
Abstract
The main objective of this Degree project was to analyze performance of VoIP based
Private Branch Exchange (PBX) “Asterisk”for business purposes. The performance
analysis is useful for predicting the baseline performance measurement of Asterisk
in static and real-time call processing on different platforms, with different speed
CPU. Call success rate and CPU utilization in static and real-time (database) call
processing are example of performance measures.
To reach the goals of defined system, different operating system and hardware
parameters were used. Firstly, two PC-based PBX with connected IP phones on
LAN were setup and configured for static and real-time call processing on different
speed Linux Servers to fulfill the requirement of a complete enterprise VoIP system.
After that performance was analyzed by generating the burst of variable calls load
(calls/sec) at static and real-time Asterisk’
s. The SIP traffic generator software was
used to generate and receive the burst of SIP calls. Windows analyzing tool based
on the performance parameters call success rate, CPU and memory utilization, is
used to analyze the results.
Based on the analysis results, the conclusion was drawn that Asterisk is platform
dependent for call success rate in static and real-time call processing. The
performance is analyzed for 350 MHz and 2.4 GHz Asterisk servers for static and
real-time call processing and results are concluded. This performance analysis is
very useful for small office system, to investigate the limited number of calls/sec with
low cost hardware.
PREFACE
The report presents the master thesis, concluding my studies to Master in Computer
Engineering majors in Telecommunications at Dalarna University, Faculty of
Computer and Electrical Engineering. The aim of this thesis work was to gain
experience in the independent research work, and achieve deeper understanding of
a key subject area. The workload is about 30 ECTS.
My supervisor in the project has been Mr. Kari Bjorn; I would like to thank for his
valuable help and guiding me through this thesis. I also like to thank Mr. Anh Dung
Le (Cuuma Communications) for his smooth and independent attitude to instruct me
through the contents of this master thesis.
I would like to thank the entire faculty of Dalarna University and Helsinki Polytechnic
Stadia, especially professor Mark Dougherty, program coordinators Dr. Pascal
Rebreyend and Hasan Fleyeh who gave me chance to pursue my Master studies in
Sweden.
Additionally, I want to thank my family and friends for patience and support during
this thesis work.
Table of Contents
1 Introduction ...............................................................................................................................7
1.1 Background...........................................................................................................................8
1.3 Limitations............................................................................................................................9
1.4 Questions For Investigation.................................................................................................9
1.5 Structure of Thesis .............................................................................................................10
2 Problem Formulation .............................................................................................................11
3 System Overview .....................................................................................................................12
3.1 Circuit Switched Network .................................................................................................14
3.2 Packet Switched Network..................................................................................................14
3.3 Voice over IP......................................................................................................................15
3.3.1 User Terminals............................................................................................................15
3.3.2 Codecs .........................................................................................................................15
3.3.3 Call Processing Server / IP PBX................................................................................16
3.3.4 Media / VoIP Gateway ...............................................................................................17
3.2.5 IP Network / Gatekeeper ............................................................................................18
4 Session Initiation Protocol (SIP) ...........................................................................................18
4.1 SIP Distributed Architecture .............................................................................................19
4.1.1 User Agents.................................................................................................................20
4.1.2 Proxy Server................................................................................................................20
4.1.3 Registrar Server ..........................................................................................................22
4.1.4 Location Server...........................................................................................................22
4.1.5 Redirect Server............................................................................................................23
4.2 General SIP Transactions Model ......................................................................................24
4.3 SIP Messages......................................................................................................................25
4.3.1 SIP Requests ...............................................................................................................25
4.3.2 SIP Responses.............................................................................................................27
4.4 Real-time Transport Protocol (RTP).................................................................................28
4.4.1 RTP Components........................................................................................................28
1 Introduction
Voice-over-IP is a technological buzz in the world of telecommunications that has
the potential to completely rework the traditional telephony. VoIP have been
developing very rapidly in the last decade, the main idea behind this revolution was
to achieve the increased functionality, scalability and low cost telephony.
In current-day VoIP networks, the main quest is to achieve the better performance
and quick response time. The bottleneck in shifted from physical link limitation (high-
speed and high bandwidth) to the performance of the processing elements. These
processing elements ca be hardware components, functional software or protocols.
To evaluate the performance of a system different evaluation techniques need to be
considered. Performance evaluations are activities undertaken to characterize the
operations of the system. The study of performance evaluation is applied to both
existing system and system to be designed. These systems are evaluated for the
purpose of assessing and improving their performance.
This thesis study is concerned with performance evaluation of the VoIP server
“Asterisk”using different specifications hardware to analyze the upper call limit and
CPU utilization in static and real-time call processing. The performance analysis is
useful for predicting the performance of the Asterisk for small business, to help in
designing a VoIP network with limited number of resources. Asterisk is a complete
PC-based Private Branch Exchange (PBX) that provides all the functionality and
features of a normal PBX. It is the middle-ware that connects any telephone line,
VoIP interface or telephone circuit to any other interface or service including PSTN
through Asterisk applications.
In this project work the Asterisk performance with static and real-time (database) dial
plans are under investigation. In static dial plans the entire configuration is saved in
the file system, and Asterisk services need to reload when new changes take effect,
while in real-time configuration there is no need to reload Asterisk services when the
configuration is changed, In real-time system all the dial plans are saved and
retrieved from a database. The performance of the host CPU and memory utilization
is also investigated for server health.
1.1 Background
This degree project is the requirement for the award of degree in International
Master of Science in Computer Engineering, Hogskolan Dalarna, Sweden. This
project work has been accomplished as the part of ongoing research “SER”(SIP
Express Router) in the Cuuma Communications Oy in Finland. The project is lead by
the research department of Helsinki Polytechnic Stadia with the partner company
Cuuma Communications Oy, and carried out in the premises of High Tech Center
(HTC), Finland.
1.2 Objective
The main objective of this project work is design and analysis of Asterisk VoIP
server, the thesis requires the performance measurement for real-time aspects of
the applications involved. Based on the analysis results, the performance is
measured for the call quantitative aspects of Asterisk for small business area. This
performance analysis is helpful for designing and evaluating the performance of
Asterisk VoIP server for real-time business call processing.
• Setup and configure two Linux based Asterisk server with connected IP
phones on LAN.
• Make the call establishment and record routing possible between different
Asterisks and IP phones.
• Configure the Asterisk for static and real-time (Database) call processing.
• Analyze the results and make the performance conclusion for business
purpose.
1.3 Limitations
This project work is limited to the performance of the 350 MHz and 2.4 GHz Asterisk
VoIP servers. To analyze the performance of the systems many hardware and
software parameters were need to be considered. It was impossible in this project
work to implement all the parameters; due to lack of resources, hardware and
software parameters are few. The most crucial resources in this project work were IP
telephones to generate and receive SIP calls. SIP call generator was used to
generate and receive the SIP calls, but that software was also for the limited trial
period of time. Due to these limited resources, analysis is restricted to the 350 MHz
and 2.4 GHz Asterisks.
• How Asterisk static and real-time dial plans effects the CPU speed.
and methods used are discussed. Result analysis is made based on the extreme
tested raw statistics, and conclusion is drawn based on analysis in the last section of
the thesis.
2 Problem Formulation
In current era, IP telephony offers great promises to simplify business networks due
to its flexible and unique architecture. The increasing popularity and number of users
in VoIP network are effecting the performance of the processing elements. These
processing elements can be hardware components, functional software or protocols.
The performance issues arise in the form of call failure, jitter, delay or latency etc.
3 System Overview
In data communication networks, many transactions are based on client/server
model of computing. In client server architecture, client machine make a request for
services to server machine, which performs these services and return the results,
Web server, Email server and Database server are the example of client/server
architecture. In addition to voice services on IP network, IP PBX was introduced to
provide these services in innovative way. IP PBX server is PC-based software,
which typically serves as core IP telephony server. It performs all the functionality
like a traditional telephony PBX does. It is the middle-ware that connects IP
telephony to other telephony networks. [1]
In this project work, the performance of IP PBX “Asterisk”is analyzed to find out the
upper calls success limit and CPU utilization for static and real-time dial plans. The
architecture of experimental setup consist of two Asterisk servers with speed of 350
MHz and 2.4 GHz shown in figure 3-1; three fast computers are being used to
evaluate the performance of a single Asterisk for static and real time dial plans.
Computer A with the CPU speed of 2.4 GHz was used as SIP Call generator and
traffic observer, which generates the required number of variable calls (calls/sec) at
the same time to the Asterisk server and monitors the call processing as well.
Computer B with the same processor speed of 2.4 GHz receives and answers the
routed calls from Asterisk as actual IP phones serves. To observe the server health
(CPU, memory utilization) and availability, Computer C performs operations at
threshold level; Linux performance analyzer is installed on 2.4 GHz machine and
connected to Asterisk server through secure SSL connection.
`
Asterisk Server1 Asterisk Server 2 Server performance Analyzer
(Computer C)
` `
Switch
SIP call generator (Computer A) SIP calls receiver (Computer B)
WLAN /
INTERNET
IP Phone
IP Telephone Provider
POTS
Analog Phone
Circuit Switched Network uses five main components; Voice encoding, PSTN
Switches, Private Branch Exchange, Signalling and Telephones. Every component
performs its operations to provide the fast and reliable calls on PSTN. A typical
dedicated circuit through the PSTN, from physical connection to logical connection
uses many switches. At the conversation, encoded voice passed along the
dedicated circuit through these switches.
The structure of data packets is as, each packet consists of header section and their
payload – are snippets of voice conversation. To transmit Voice over IP network, the
voice is need to be converted from analog to digital, cut into packets, sent across the
network in packet format, resembled and converted back from digital to analog.
Encoders and decoders at either end do the conversation from analog to digital and
back. Different components are involved to transmit the Voice over IP network,
described in the next section. [1] [6]
3.3.2 Codecs
A Codec simply known as the coder / decoder or in more general words compressor
/ decompressor, is a hardware or software that samples analog sound, converts it to
digital bits, and output it at a predetermined data rate. Each codec use different data
rate, G.711u and G.711a works at the nominal data rate of 64kbps with
packetization delay of 1ms; G.726 performs compression at 32 kbps and G.729
codes the voice segment at 8 kbps data rate with packetization delay of 25 ms. The
packetization delay refers to a delay time of codec to convert from analog to digital
and back. Some codecs performs compression to save bandwidth. There are
dozens of codecs available, each with its own characteristics. The most common
codecs used in VoIP are G.711u, G.711a, G.726-32, G.729, G.723.1 MPMLQ and
G.723.1 ACELP. [1]
In this thesis work, G.711 codec was used to encode the VoIP calls. The G.711
codec is generally known as the Pulse Code Modulation (PCM), the signalling
functionality of this codec is described below,
• It uses the frequency range of 4kHz to capture the human voice conversation.
An IP PBX provides all the functions and features similar to those that a traditional
PBX provides. It manages call control and signalling traffic of the VoIP network, the
basic function of signalling traffic is to establish and terminate a call. The signalling
traffic also provides control over the call session. There are different protocols
available to serve as the VoIP signalling protocol, SIP and H.323 being the two
major choices.
Trunk gateways provide the interface between the traditional telephone network
and VoIP network.
Session initiation protocol is an application layer signaling protocol, which has been
developed and designed within the IETF [1]. It is used to define initiation,
modification and termination of multimedia communication sessions between end
users. Here, session is considered to be communication states kept between
senders and receivers during the communication. Examples of communication
sessions are Internet telephone calls, distribution of multimedia etc. In the next
section, the structural, functional and characteristics features of SIP are discussed in
detail.
PSTN
`
Proxy Server Proxy Server
User Agent
Gateway
These all elements work together on one computer to perform specific task.
Installation of these elements on the same machine increases the speed and
processing between the network elements. The above figure 4-1 describes SIP
components internal working on single machine. These components are described
in the next section in detail. [10][11][12]
Request
Response
UAC UAS
SESSION
In Figure 4-2, general model between UAC and UAS is described. UAC sends
request to UAS, UAS response that request and the session established between
them.
extensions for each inbound call and forward the call to related server of gateway.
[11]
There are two types of proxy server, Stateless and Stateful proxy servers.
Stateful servers are more complex as compared to the stateless servers. These
servers keep the state alive until the transaction finish. Stateful servers perform
some important features like forking (searching of one request at multiple
destinations).
Session Established
Destination 1
STATEFUL
ANSWER UAC
INVITE
UAS
Figure 4-3 illustrates the stateful proxy server behavior. UAC requests for UAS and
Proxy server forward the request to multiple destinations. The current destination of
UAS answers the invitation; remaining sends the decline message.
UA Registrar Location
Location Database
Register
200 OK
`
Registrar Server
User Agent
P ro x y S e rv e r L o c a tio n D a ta b a s e R e d ire c t S e rv e r
F ig u r e 4 - 5 , L o c a t io n S e r v e r
R e d ir e c t S e r v e r
il y
1
ar
TE
30 por
VI
m
2
IN
te
ed
ov
M
IN V IT E 2
` `
F ig u r e 4 - 6 , R e d ir e c t S e r v e r o p e r a ti o n a l b e h a v io r
` `
User Agent Proxy Server Location / R edirect Server Proxy Server User Agent
INVITE INVITE
302
M oved Tem porarily
ACK
INVITE
INVITE
302
M oved Tem porarily
ACK
INVITE
R TPMM
RTP E DIAPATH
EDIA PA TH
200 OK 20 0 OK 200 OK
In Above Figure 4-7, Sequence of requests and their responses are used in number
of steps to complete the call process. The detail of these requests and responses
are described in next section to understand their purpose of working.
SIP requests are the messages from client to server, and distinguished by having a
Request-Line for a start-line. A Request-Line contains a method name, a Request-
URI, and the protocol version separated by single space (SP) character. The format
of the Request-Line is as
Method is an important entity in the request line and used to decide the function of
request, six types of methods are defined: REGISTER, INVITE, ACK, CANCEL,
BYE, OPTIONS. [10][11]
Register request is used to register user agents and allow registrar to save the user
information (IP address, port) in the location database.
Invite is request to initiate the call by inviting the user to participate in the session.
The message contains a description of the session, using session description
protocol (SDP), and type of the media that is to be used for the session.
ACK Confirms the final response of the Invite request, that user is available for
communication.
Cancel is used to cancel not yet fully established session. It is used when caller
wants to refuse the call invitation from Callee.
Bye message is used to terminate the specified communication session. All the
participating communicating parties can send BYE message to end the call. BYE
method only terminates the call and dialog associated with it.
Option is method used for querying the capabilities of SIP server or client. Option
method allows a UA to query another UA or a proxy server as to its capabilities.
This allow client to discover information about supported methods, content types,
extensions, codec etc. without “ringing”the other party.
The reply code is integer number from 100 to 699 and indicates type of response.
There are 6 classes of responses:
2xx: This response indicates that call is processed successfully and accepted.
When caller sends the call request and callee picks up the phone, 200 OK
messages is sent back by the indication that call is successful.
3xx: 3xx or redirect responses, gives the new location information of the callee.
4xx: These are the bad syntax or negative responses at the sender side. These
responses indicate that there is problem at the sender end and can not processed at
server side.
5xx: Server Failure Responses, which means that request is valid but server is
unable to solve the request.
6xx: Global Failure responses, Indicates that request cannot process at any server.
This is usually the decline response from user agent when it does not want to
participate in the session.
RTP is the most commonly used voice streaming protocol in Internet telephony
applications. Real-time transport protocol is used to transmit multimedia data such
as audio, video or simulation data, over multicast or unicast network, after call setup.
RTP does not in itself guarantee real-time delivering of multimedia data. The Control
protocol (RTCP) is used to monitor the data delivery, control and identification
functionality in a manner scalable to large multicast networks. RTP works with other
protocols to make call possible. Typically RTP runs on top of the UDP protocol,
although specification is general to support other transport protocols. [1]
RTP Payload type indicates the specific media encoding, which codec to use. The
codec conveys the type of the data (such as voice, audio or video) and how it is
encoded. It can be changed if it has to adapt the variation in bandwidth, frame
indication, which arks the beginning and end of each frame.
Sequence number helps the receiving sides reassemble the data and detect lost,
out-of-order and duplicate packets (datagram’
s).
Time Stamp, It is used to reconstruct the timing of the original audio and video. It
also helps the receiving side determine variations in packet arrival times, known as
jitter. It is the time stamp that brings real value to RTP. At receiving side each packet
is compares with time stamp to make RTP transmission possible.
RTP is a connectionless protocol and its datagram encapsulates inside the UDP
datagram to travel through the network. In this project work, RTP is used as voice
streaming protocol to send real-time traffic.
P r o b le m - I d e n t if ic a t io n a n d
R e q u ir e m e n ts A n a ly s is
C h a r a c te r iz a tio n
(W o r k lo a d /S y s te m P a r a m e te r s )
E x p e r im e n t s M o d e lin g
(M o n it o r in g o f R e a l S y s te m s ) (W o r k lo a d /S y s te m B e h a v io r )
S y n th e s is o f O p tim iz e d S t r u c t u r e s
S e n s itiv ity A n a ly s is
F ig u r e 5 -1 , O v e r v ie w o f P e r fo r m a n c e E v a lu a tio n M e th o d o lo g y [
“However, since system consist of hardware and software, it is also common to fully
design, implement and functionally test them before an attempt is made to determine
their performance characteristics”(E Brinksma). [3]
The first step towards the correctness of the system is conformance testing. A
system being designed or to be designed must satisfy the predetermined
specification of the system. Conformance testing ensures the performance of the
system in accordance with the specification on which it was build. These
specifications varies from system to system depends on the operations, system
elements and services performance as expected.
The next logical step after conformance testing is interoperability. A system can be
defined as the set of components working together to perform specific tasks. The
performance of any system is affected by the performance of its component’
s and
the way these components are connected together. For example, if there are two
systems A and B satisfying the specification X, Interoperability evaluates the extent
to which system A and B can work with one another.
A correct design may not imply one that performs blazingly fast or very cost
effective. Several other factors are involved in the performance of any system. Cost
and speed are the parameters under investigation.
This may be due to other conditions – for example, we may need to trade off
performance or perfect correctness to save cost per unit. (E Brinksma) [3]
The most important driving factor in designing and development of a system are its
efficient performance and functionality in cost effective manner. To improve the
functionality and efficiency of the system, two evaluation classes are defined
comparative evaluation and analytic evaluation.
The analytic evaluation is very effective in some cases, where the system is
examined with respect to various system parameters and system workload, such as
building an analytical model in which different system parameters are related by
equations.
most of the time the comparison is not reliable, because the cost, performance and
correctness of every system is different. [4][5]
Direct measurement is the most commonly used and flexible technique for the
investigation of the system. In direct measurement set of predefined parameters are
used to evaluate the performance of the system. It could be as needed or
continuous monitoring of the system via dedicated monitoring tool (software or
hardware) and analyzed by comparison of the system; Speed and cost are the
example of parameters measures.
The direct measurement always concerned with the correctness of the system
according to life cycle phases. It is very accurate and flexible approach to evaluate
the performance of an existing system. While, in some situation where system is not
fully designed or the to be designed, the modeling plays an important role in the
development and evaluation of the system. In the next section, these two
techniques are discussed in detail.
To obtain a good measurement results different tools and techniques are used. In
measurement, the actual behavior of the system is investigated by applying the
theory and tools, not a conceptual difference in either theory or tools. The need of
computer system measurement can be divided into three categories depending on
the reason for which one does the measurements: diagnostic measurement,
performance measurement and analytic measurement.
Model is considered to be accurate, if it gives the concise and close results to the
results taken from the direct measurement on the existing real system. The model
results are based on the performance measures parameters, these parameters may
vary from system to system. A model can be consider a good model, if physical laws
that can be used to describe a system are discussed in detail, secondly the Pictorial
representation can be made to provide the better understanding of the model, the
last but not least is system inputs, element, and output are of manageable
magnitude.
R EA L SY STEM
Ab
st
P r r a c ti
o ce on
ss
M o d e ls
F ig u r e 5 - 3 , M o d e lin g o f S y s te m [ 4 ]
A sterisk A pp lication A P I
T ranslator
G .723s f
GS M S ched uler
G .7 23 and G S M sf
M u -Law A pplication
Linear A - I/O W av e
Law
L aun cher
M a nag er
ADPCM M P3
M P3
PBX AU
Sw itching D ynam ic
C ore M odule
Loader
A sterisk C h annel A P I
Dynamic Module Loader is the engine that works at the start of Asterisk. Dynamic
module loader loads and initialize all the drivers for channels, file format, call detail
record back ends, codecs, applications and more, linking them with appropriate
internet API’
s.
PBX Switching Core is an important engine of Asterisk core, it accept calls from
interfaces and handling them according to instructions found in dial plans.
Application Launcher The PBX switching core uses the application launcher for
ringing phones, connecting to voicemail and dialing out outbound trunks.
Scheduler and I/O Manager is a core component engine that provides environment
to applications and drivers to take advantage of Asterisks.
Codec Translator The main purpose of codec translator is to allow the differently
compressed coded channels to talk with one another.
Channel API Channels are the logical entities use to connect signalling and
transmission path between end points. Every call in Asterisk is placed over an
interface in its own distinct channel. Channels are of different types based on their
nature, like physical channels (such as FXO port) or software-based (SIP, IAX). In
Asterisk, dial plans rules are used to define and connect different channels together.
Channel API is used to connect these channels in distinct fashion according to dial
plans. A channel is named usually after its interface or protocol such as SIP, IAX,
Zap for Zaptel.
Application API Asterisk supports number of application, for example voice mail,
call waiting, conferencing, Interactive voice response and automatic call distribution
etc. These all applications are available to the dial plans when processing the
incoming calls to take advantage of Asterisk PBX features and pass through the
application API.
Codec Translator API A codec translator API is used to translate the coded voice
or signal into desired coded voice or signal or to decompress the data packets or
analog signals, no matter where it is coming from. GSM, G.723, ADPCM and MP3
are supported.
File Format API Asterisk support wide variety of format for audio files and uses
these files to store audio data such as ring tones, music on hold and voice mail. File
format API allows Asterisk to read and play sound in different formats including
WAV, AU, and MP3. This gives Asterisk-based applications more flexibility in dealing
with ring tones, DTMF etc. [4] [2][1]
Context is an organizational part of the dial plan structure. It is the section defined
by the administrator to keep the executable instructions (extensions) separately. In
simple words, it is an auto attendant menu used to execute the referenced plan. For
example, the incoming calls context can be called when press “1”or PSTN with “0”.
The context is generally denoted by their name in the square bracket, simply
[incoming] for incoming calls and [PSTN] for pstn calls.
Priorities are the numbered steps in execution of Asterisk dial plans. For example if
there are more then one instructions in the sequence, the priority set the limit which
command have to execute first.
In this example, the number 1000 is used as an extension. When a call is made to
this extension, the first priority Asterisk will answer the number, then Asterisk will
play a good-bye message to user, and in the last priority hang up command will
execute. Asterisk code is not sequence dependent, priorities set the execution
sequence.
Applications are used to manipulate calls and giving the user an interactive system.
Each priority calls one specific application to perform an action on voice channel,
such as playing sound, voice mail, dial, answer or hanging up the call are example
of applications. Applications perform action on behalf of the arguments passed.
There are lots of built in applications in Asterisk like Dial, hang up, answer etc.
A principle difference between Static (flat file) and Real-time (database) system is
the way data collected and organized. A flat file is organized physically; items
proceed or follow other items. While in contrast the content of database are
organized according to the data model. In Asterisk data model is the road map,
which define the routing processes and how unit relates to each other.
Another big difference between static and real-time system is the way you access
them. In Asterisk file-system the instruction query read the file sequentially, looking
for particular vales at particular location in each time or record. In contrast, when
process the query in database it use the terms that data model defines. Simply,
when Asterisk access dial plans that are stored in a file, it sequentially read in
physical layout of the file. When it queries the database, it ignore the arcane detail of
the computer storage and state query in terms that reflect real world, at least to the
extent that the data model reflects the real world.
The advantage of database over file system is, that it can be use the common
source for many users. Multiple users can query and modify database
simultaneously, while in file system records are updated statically.
In Asterisk, various configuration files are used to load the dial plans. For static
configuration, most commonly used files are sip.conf and extensions.conf, these files
reflects the dial plan operations in sequential order, described in APPENDIX B. The
entire configuration related static dial plan stores in both files. In Real-time
(database) system, the entire configuration related dial plans are keep updated in
database, described in APPENDIX D. For query the dial plans from the database,
some extra configuration modules are needed to install for connectivity of Asterisk
with database, such as Asterisk-add-ons, described in APPENDIX C.
SIMPLE GROUPS – files simply define the existence of various entities, like
mailboxes, conference rooms, etc. Examples include extensions.conf, logger.conf,
meetme.conf, musiconhold.conf, parking.conf, and voicemail.conf.
INDIVIDUAL ENTITIES - These types of configuration files are used most often for
VoIP services. Examples include iax.conf, oh323.conf, and sip.conf.
The following table describes the location, where Asterisk associated file stores [1].
/var/lib/Asterisk/keys Private and public keys used within Asterisk for RSA
authentication. IAX uses keys stored here.
/var/lib/Asterisk/mohmp3 MP3 files used for music on hold. The configuration for
music on hold is found in the directory
/var/lib/Asterisk/sounds.
Table 1 presents the whole structure of Asterisk file organization while its
configuration details are in APPENDIX A.
For the performance evaluation of a single Asterisk server shown in figure 7-1, it was
impossible to measure the performance with 1000 or more connected IP phones, so
traffic generator software was used to generate and receive the SIP calls. Two new
and fast computers are being used as SIP calls generator (computer A) and SIP
calls receiver (Computer B). Burst of calls (number of calls/sec) from the total
number of calls offered was generated to the Asterisk server, and after processing
from Asterisk server; the calls are being forwarded to the Logical SIP Phones at SIP
Calls receiver. The signal, connectivity, load and call success rate were measured
and analyzed by number of calls completed and summary reports from WINSIP
Software [1]. The performance of hardware parameters such as, CPU and memory
utilization of the server is measured by third party tool named windows application
manager 6 (Computer C), by creating the secure SSL connection. This software’
s
are discussed in detail in the next chapter.
A s t e r is k S e r v e r
100 Mbps
100 M bps 100 M bps
` `
S IP C A L L G E N E R A T O R (C o m p u te r A ) S IP C A L L R E C E IV E R (C o m p u te r B )
100 Mbps
`
S E R V E R M O N IT O R I N G T O O L ( C o m p u te r C )
F ig u r e 7 -1 , E x p e r im e n t S e tu p O v e r v ie w
In this section software used in experiments are described in detail, two main piece
of software are used for testing and performance evaluation of the system, WINSIP
for Call generation and emulation and Application Manager6 for monitoring the
performance of hardware components of the Asterisk.
The “WINSIP – SIP call generation and Emulation” [15], a Software is a SIP
connection and real-time call generation tool for VoIP network. It is the window-
based application to generate, receive and monitor the SIP calls. It performs several
modes of operation, like Initiate calls, answer calls, unattended answer, registrar
testing and proxy server. It has ability to diagnose signal, connectivity, load, call and
session summary report etc. WINSIP provides the comprehensive VoIP call matrices
(connected calls, success and failure), Initial response latency, post dial delay, ring
duration, media start delay and tear down time etc.
As, WINSIP places actual calls; we used it in the same manner as the normal IP
phone does. In the initiation mode of operation, SIP generated traffic (hundred to
thousands of calls) can route to the application server (Asterisk). For SIP traffic, user
selects the total number of calls, throughput (calls/sec), phone numbers of the
senders and receivers incrementally or fixed, IP address of sender and receiver with
same communication port number, inter packet delay and timing can also be set.
The important parameter in the call establishment is RTP media streaming; it can set
by selecting send only, mirror or via options to send or receive the select coded
media traffic. SIP generated traffic can save in files, and remains available to view
the call establishment matrices from the log-generated file.
In the answer mode of operation, the SIP calls are received at number of logical
phones, from the application server. In this mode of operation all the properties are
set according to the initiation mode but in reverse. The receiver address becomes
the sender address and vice versa. For the answer mode, IP address of the receiver
and sender of the application are also set with same port number.
In this experimental setup, WINSIP is not only used to generate and receive the SIP
traffic, but also provides the comprehensive summary report about call processing
features, specifically the call success rate.
hardware and software components. In this thesis work, the CPU and memory
utilization of Linux based Asterisk server is examined against Asterisk call load.
“Monitoring a VoIP server means watching the hardware, the operating system, the
major application running on the server.” [1] The operating system may include,
Windows, Linux and Solaris. Applications include web servers, databases, and file
transfer services.
made on these results. The whole experimental setup is divided into four test
scenarios, described below in detail.
server. The server health and availability is examined through secure SSL
connection, at the threshold level through third party tool, Application Manager6 [16]
(computer C), described in section 7.2.
C OM PUTER A C OM PUTER B
A s te ris k P B X
100 Mbps
COMPUTER C
F ig u r e 7 -2 , T est S c en a r io 1 S e tu p O v e rv ie w
In Test Scenario 2, MYSQL database version 5 was installed with Asterisk add-ones
modules to support MYSQL connectivity and working with Asterisk. Various
configuration changes were made for data retrieval and access plans from database,
attached in APPENDIX C.
The experimental features such as, the upper call limit and CPU utilization is
observed carefully with the help of monitoring software’
s. The gathered statistical
information is analyzed based on real-time experiment results.
For Asterisk real-time dial plans, fifteen different experiments were conducted to
analyze the performance of real-time (database) configured Asterisk by generating
200 number of calls with different number bursts of calls between 1 to 15 calls per
second, with encoded media of G.711 u-law and 20 ms of packet size using the SIP
for inbound and outbound calls, to find out the best call serve rate and CPU
utilization in figures, table 3 and 4 in APPANDIX F summarize the test results.
D a ta b a s e
S IP C A L L G E N E R A T O R ( C o m p u te r A ) A s te r is k S e r v e r S IP C A L L R E C E IV E R (C o m p u te r B )
100 Mbps
S E R V E R M O N IT O R IN G T O O L (C o m p u te r C )
F ig u r e 7 -3 , T e s t S c e n a r io 2 S e t u p O v e r v ie w
To test the Asterisk static and real-time features at 2.4 GHz machine, ten different
experiments were conducted for each to analyze the performance of Asterisk for
both dial plans by generating 500 number of calls with different number bursts of
calls between 10 to 30 calls per second, with encoded media of G.711 Ulaw, to find
the best call serve rate and CPU utilization in figures, table 5 and 6 in APPANDIX G
summarize these test results.
The main purpose of test scenario 1 was to investigate upper call limit and CPU
utilization of fully loaded static Asterisk on 350 MHz machine. Fifteen different
experiments were conducted against calls/sec to gather raw call statistics and CPU
utilization to carefully analyze the performance of Asterisk. This section gives the
overall assessment and analysis of recorded results. The Test Scenario 1 is divided
into two phases, phase 1 represents the static Asterisk behavior without system
restart and phase 2 verifies the results by continuously restart the system for every
experiment, described in next section.
Phase 1 illustrates the static Asterisk results without system restart, shown in Figure
8-1. The Figure presents the results of successful calls and CPU utilization against
15 different bursts (calls/sec), while total numbers of calls offered are 200 for every
experiment. The blue dot in the figure indicates the successful calls result and pink
dot displays the CPU utilization against specified bursts (calls/sec). It can be seen
from figure, the Increase in bursts from 1 to 15 (calls/sec) the successful calls limit
decreases and CPU utilization goes up to 100%. After some point, the successful
calls limit decreases with the increase in CPU utilization, even a fall down in a graph
can be seen. There are some investigation question arises, Is this due to some
running services on CPU or Asterisk structural behavior affects the performance?
To verify the question, same methodology was used with system restart, described
in phase 2.
160
140
120
utilization
Phase 2 uses the same stimuli, but the results are recorded with the continuous
restart of the system for every experiment. The Figure 8-2 illustrates the recorded
results, blue dots in the figure represent the successful calls, while pink dot indicates
the CPU utilization against different bursts (calls/sec). The burst range is set from 1
to 15 while the total numbers of calls offered are 200 for every experiment. It can be
observe from the figure 8-2 that the results of phase 2 are still close enough to the
actual results of phase1, but there is some abnormal behavior in the CPU utilization,
the call success rate is continuously decreasing with increase in bursts (calls/sec).
The call success limit at the specified burst for both phases is almost same at 100%
CPU utilization. The analysis on these results is described in section 8.3.
160
140
120
utilization
100
Successful Calls
80
60 CPU Utilization
40
20
0
0 5 10 15 20
Calls/Sec
Phase1 refers to the results of real-time Asterisk without system restart, described in
Figure 8-3. It is shown in figure 8-3, the successful calls are decreasing with the
increase in calls/sec while at some point CPU utilization drop down with some
abnormal behavior, described in result analysis.
200
150
utilization
Successful Calls
100 CPU Utilization
50
0
0 5 10 15 20
Calls/Sec
Phase 2, presents the results of dynamic Asterisk with system restart at every
experiment to verify the results of phase 1, shown in Figure 8-4. The figure shows,
the successful calls are decreasing with increase in burst size (calls/sec) and CPU
utilization is decreasing after threshold level 100% and showing abnormal behavior
at every restart of the experiment at new burst.
250
200
utilization
50
0
0 5 10 15 20
Calls/sec
600
500
utilization
400
Successful Calls
300
CPU utilization
200
100
0
0 5 10 15 20 25 30 35
Calls/Sec
In Test Scenario 4 Asterisk real-time dial plans are verified shown in figure 8-6, At
some point the successful calls are decreasing with the increase in calls/sec while
CPU utilization showing an abnormal behavior after 100% with the increase in
calls/sec bursts.
600
Successful Calls and CPU
500
400
utilization
• In Static test experiments, shown in figure 8-1 and 8-2, it is analyzed that the
best call serving capacity of Asterisk 1.2.7.1 with static configuration at 350
MHz machine is 4 calls/sec. The successful calls ratio is about 140 calls and
CPU utilization goes to 100%. As number of calls per second increases, CPU
utilization increases to 100 % and then remains constant (limit to 100 %) after 4
calls/sec, while number of successful calls decreases.
• Another key point, which is observed during static test experiments from figure
8-2, there is sudden change in CPU utilization, which shows an abnormal
behavior. CPU utilization decreases at 5 calls/sec. It might possible due to
some processes, which are running on CPU. It can be concluded, as “Asterisk
main weakness is uncertainty about how much host CPU is available at any
given instant. PC operating system don’
t do a job of guaranteeing that a
specific amount of CPU and memory will be available at any moment”. [14]
• It is concluded from static test experiments that successful calls are not
effected with and without system restart for Asterisk. The best calls serving
capacity of Asterisk with static configuration is limited to the 4 calls/sec at 350
MHz servers with 100% CPU utilization.
• In dynamic test experiments from figure 8-3 and 8-4, it is analyzed that the best
result is at 3 calls/sec for 350 MHz machine. The successful calls limit is about
150 calls and CPU utilization goes to 100%. It is observed that, without restart
of Asterisk real-time server number of successful calls decreases while CPU
utilization remains constant at 100 % with the increase in calls/sec.
• During real-time test in figure 8-3 and figure 8-4, it is observed that there is
sudden change in CPU utilization, which shows an abnormal behavior. CPU
utilization decreases at 9 calls/sec. It might be possible due to some processes,
which are running on CPU.
• It is concluded from real-time test experiments that successful calls are not
effected with and without system restart for 350 MHz of Asterisk server. The
best calls serving capacity of Asterisk with real-time configuration is limited to
the 3 calls/sec at 350 MHz servers with 100% CPU utilization.
Based on actual experiments, conclusion is drawn that Static dial plans are more
suitable for both machines used in experiments as compared to real-time dial plans
because it serves maximum calls/sec during experiments as a function of CPU
speed, which is a key point for VoIP business industry. However as processing
power of the machine will increase, performance of real-time dial plans supposed to
be improved.
It is clearly analyzed from experiments that static results are most optimized as in
sense it serves maximum calls against real-time dial plans. But in real VoIP
telephony business where billions of users are served at the same instance, it is not
statically possible to serve them. Here company will prefer dynamic dial plans.
Future work could be done by improving the performance of Asterisk. SIP Express
Router is a solution; Asterisk performance can be improved by dynamic load
balancing of incoming calls according to redundant nodes when CPU utilization
exceeds the specified threshold.
REFERENCES
[1] Walker, Hicks, Taking Charge of your VoIP Project, Cisco Press-ISBN 1-58720-
092-9.
[4] Paul Fortier, Howard Michel, Computer System Performance evaluation and
Prediction, ISBN 1-55558-260-8.
[5] Hossien Noshin (2005), Developing a Performance Model for Staselog Network
Equalizer (NE), Helsinki Polytechnic Stadia.
APPENDICES
APPENDIX A: Asterisk Installation and Configuration
APPENDIX B: Asterisk Static Dial plan Configuration
APPENDIX C: MySQL and add-ones for Asterisk Real-time
APPENDIX D: Asterisk Real-time Dial plan Configuration
APPENDIX E: Test Scenario 1 Results (Asterisk Static)
APPENDIX F: Test Scenario 2 Results (Asterisk Real-time)
APPENDIX G: Test Scenario 3 and 4 Results (2.4 GHz)
Asterisk is an open source PBX (Private Branch Exchange). A PBX manages calls
between internal or local users. It shares often a number of lines that connect to the
external, public network.
Install Asterisk
1. Go to the download directory
# cd /usr/local/download/
# wget http://ftp.digium.com/pub/Asterisk/Asterisk-1.2.7.tar.gz
# cd /usr/local/src/Asterisk-1.2.7/
5. Build Asterisk
# make
# make install
# make samples
7. Install documentation
# make progdocs
8. Start Asterisk
# /usr/local/src/Asterisk-1.2.7/Asterisk start
# cd /etc/Asterisk/
Sip.conf
A block of text in the sip.conf file identifies each SIP client and server. Here is the
configuration example of two connected IP phones on LAN.
# kedit sip.conf
[grandstream1]
type=friend ; either "friend" (peer+user), "peer" or "user"
context=from-sip
username=grandstream1; usually matches the section title
password=grandstream1;
host=dynamic ; we have a static but private IP address
nat=yes ; there is not NAT between phone and Asterisk
canreinvite=yes ; allow RTP voice traffic to bypass Asterisk
disallow=all ; need to disallow=all before we can use allow=
allow=ulaw ; Note: In user sections the order of codecs
allow=alaw ;
[grandstream2]
type=friend ; either "friend" (peer+user), "peer" or "user"
context=from-sip
username=grandstream2; usually matches the section title
password=grandstream2;
host=dynamic ; we have a static but private IP address
nat=yes ; there is not NAT between phone and Asterisk
canreinvite=yes ; allow RTP voice traffic to bypass Asterisk
disallow=all ; need to disallow=all before we can use allow=
allow=ulaw ; Note: In user sections the order of codecs
allow=alaw ;
[Incoming]
type=friend ; either "friend" (peer+user), "peer" or "user"
context= incoming
username= Asterisk; usually matches the section title
password= Asterisk;
host= 10.19.200.92 ; we have a static but private IP address
port=5060;
nat=yes ; there is not NAT between phone and Asterisk
canreinvite=yes ; allow RTP voice traffic to bypass Asterisk
disallow=all ; need to disallow=all before we can use allow=
allow=ulaw ; Note: In user sections the order of codecs
allow=alaw ;
[outgoing]
type=friend ; either "friend" (peer+user), "peer" or "user"
context= outgoing
username= grandstream1; usually matches the section title
Extensions.conf
The extensions.conf file contains the dial plan of Asterisk. In the extensions.conf file
is described how incoming and outgoing calls are handled and router. You configure
in this file the behavior of all connections through your PBX.
The context [local] permits the listed extensions to dial 7-digit numbers only. It also
includes the context [default].
The context [long distance] permits to dial a long-distance call. It includes also the
context [local].
# kedit extensions.conf
[default]
include => from-sip
include => incoming
include => outgoing
[From-sip]
exten => 2500,1,Dial(SIP/grandstream1,10)
exten => 2600,1,Dial(SIP/grandstream2,10)
[outgoing]
exten => _XXX,1, Dial(SIP/${EXTEN}@outgoing)
# usr/local/src/Asterisk-1.2.6/Asterisk –r
cli>sip reload
cli>exit
Installation of MySql
1. Download the source file:
a) cd /usr/local/download/
b) wget ftp://ftp.belnet.be/mirror/ftp.mysql.com/Downloads/MySQL-
5.0/mysql-5.0.18.tar.gz
3. Make a Mysql user. The mysql process runs under this username:
groupadd mysql
useradd -g mysql -c "MySQL server" -s /sbin/nologin mysql
4. Compile MySql. –prefix specifies the directory you want to install to.
The second part of the command tells the mysql server it needs to run
under the “mysql” username.
cd /usr/local/src/mysql-5.0.18/
./configure --prefix=/usr/local/mysql/ --with-mysqld-user=mysql
Make
Make install
c) ./bin/mysql_install_db
This installs the necessary databases needed for mysql to run.
d) chown -R root .
e) chown -R mysql var
f) chgrp -R mysql .
These commands set the proper access rights on the folders that mysql
uses. If the server won’
t start, this is the first thing you should be checking!
a) ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
b) ln -s /usr/local/mysql/bin/mysqladmin /usr/bin/mysqladmin
(If you get an error that they already exist, everything is fine. If you do not get the
error, everything will be fine if you executed the above commands)
8. Take care of the security and set and mysql root user password:
mysqladmin -u root password St4d14
This password should NOT be the same as the normal root password!
You should test if the password was accepted by issuing the command:
mysqladmin version –p
d) Normally, you should be prompted for a password. Enter the password
you just configured and you will see some version information.
9. Now make sure mysql boots at startup, using symbolic links to the
mysql server file. We will make a link for runlevel 3 (text based linux)
and runlevel 5 (gui)
a) ln -s /etc/rc.d/init.d/mysql /etc/rc.d/rc5.d/S20mysql
b) ln -s /etc/rc.d/init.d/mysql /etc/rc.d/rc5.d/k08mysql
c) ln -s /etc/rc.d/init.d/mysql /etc/rc.d/rc3.d/S20mysql
d) ln -s /etc/rc.d/init.d/mysql /etc/rc.d/rc3.d/k08mysql
e) Reboot and check if the server is up and running. You can test this by issuing this
command: Shell> mysqladmin version –p
Asterisk-addons Installation
1. Go to the download directory
# cd /usr/src
# cd /usr/src/Asterisk-addons
# make
# make install
# kedit /etc/Asterisk/extconfig.conf
sipusers => mysql,Asterisk,sip_buddies
sippeers => mysql,Asterisk,sip_buddies
# kedit /etc/Asterisk/res_mysql.conf
[general]
dbhost = 127.0.0.1
dbname = Asterisk
dbuser = Asterisk1
dbpass = Asterisk1
dbport = 3306
dbsock = /tmp/mysql.sock
# /usr/local/mysql/bin/mysql -p
# kedit /etc/Asterisk/extconfig.conf
extensions => mysql,Asterisk,extensions_table
# /usr/local/mysql/bin/mysql –p
Calls/Sec 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
CPU% 31 60 60 10 15 26 10 10 10 10 10 10 10 10 10
0 0 0 0 0 0 0 0 0 0
Memory 16 20 21 20 19 18 17 17 17 18 14 17 16 15 17
utilization
Successful 13 13 13 14 11 11 77 70 65 71 69 50 60 58 48
Calls 8 7 6 2 4 1
Calls/Sec 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
CPU% 29 54 80 10 10 10 10 10 10 10 10 10 10 10 10
0 0 0 0 0 0 0 0 0 0 0 0
Memory 19 19 20 20 19 19 19 18 19 19 20 19 17 20 20
utilization
Successful 15 14 14 13 11 94 83 64 62 74 32 31 26 29 24
Calls 2 4 0 6 2
Calls/Sec 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
CPU% 40 79 10 10 10 10 96 10 30 10 10 10 10 10 10
0 0 0 0 0 0 0 0 0 0 0
Memory 21 25 20 26 22 21 20 21 19 22 21 18 19 21 22
utilization
Successful 17 13 13 12 83 91 62 53 57 42 58 42 42 41 34
Calls 8 4 9 6
Calls/Sec 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
CPU% 37 73 95 40 28 26 21 26 19 10 10 30 10 31 30
0 0 0
Memory 24 21 20 22 21 22 22 21 21 20 21 21 19 21 22
utilization
Successful 20 13 13 11 74 10 59 57 54 45 52 48 37 41 40
Calls 0 6 9 0 4
Memory 24 21 20 22 21 22 22 21 21
utilization
Successful 500 500 480 500 500 430 418 370 346
Calls
Memory 24 21 20 22 21 22 22 21 21
utilization
Successful 500 500 500 500 500 496 470 460 376
Calls