'Sipp'에 해당되는 글 5건
- 2011.01.18 Sipp 설치 ( Linux - fedora9 )
- 2011.01.18 Sipp 설치 ( Windows )
- 2009.09.11 Asterisk Sipp Test3 - 설명 보안 1
- 2009.05.28 Asterisk Sipp Test2 - Pcap Play ( Audio, Video )
- 2009.05.28 Asterisk Sipp Test 설정
Sipp를 Linux에 설치 시, Pcap 및 authentication을 사용 할 것이 아니라면 sipp만 받아서 설치하시면 됩니다.
그러나 두 기능을 사용하시려면 각각 라이브러리가 설치가 되어 있어야 합니다.
1. Pcap
1.1 리눅스에서 sipp 실행시 Pcap play를 하기 위해서는 Libpcap이 sipp설치 전에 설치되어 있어야 합니다.
1.2 홈페이지
http://www.tcpdump.org
1.3 설치 확인
$> ls -l /usr/include/pcap.h
$> ls -l /usr/local/include/pcap.h
$> locate pcap.h
1.4 libpcp 파일 (libpcap-1.1.1)
http://www.tcpdump.org/release/libpcap-1.1.1.tar.gz
1.4 설치
$> tar -zxvf libpcap-1.1.1.tar.gz
$> cd libpcap-1.1.1/
$> ./configure
$> make
$> make install
2. authentication
2.1 authentication를 사용하기 위해서는 OpenSSL 라이브러리가 설치 되어있어야 합니다.
2.2 홈페이지
http://www.openssl.org/
2.3 설치 확인
$> which openssl
/usr/bin/openssl
$> locate openssl
2.3 OpenSSL 파일 (openssl-1.0.0c)
http://www.openssl.org/source/openssl-1.0.0c.tar.gz
2.4 설치
$> tar -zxvf openssl-1.0.0c.tar.gz
$> cd openssl-1.0.0c
$> ./config --prefix=/usr/local
$> make
$> make install
3. Sipp
3.1 홈페이지
http://sipp.sourceforge.net
3.2 Sipp 파일
http://sourceforge.net/projects/sipp/files/sipp/3.2/sipp.svn.tar.gz/download
3.3 설치
$> tar -zxvf sipp.svn.tar.gz
$> cd sipp.svn
$> make pcapplay_ossl
▶ Without TLS(No pcap, No authentication) : make
▶ With TLS(No pcap) : make ossl
▶ With Pcap, Without TLS(No authentication) : make pcapplay
▶ With Pcap, With TLS : make pcapplay_ossl
Sipp를 Windows에 설치하기
1. Sipp에서 pcap을 사용하기 위해서는 WinPcap을 받아 미리 Sipp 설치하기 전에 먼저 설치가 되어있어야 합니다.
현재 최신버전인 WinPcap 4.1.2 버전을 받아 설치를 합니다.
설치 버젼 : http://www.winpcap.org/install/bin/WinPcap_4_1_2.exe
2. WinPcap 홈페이지에서 받은 WpdPack_4_1_2.exe 파일을 실행하여 설치합니다.
3. Sipp 홈페이지에서 윈도우 설치용 최신 버전 파일을 받아 설치합니다.
윈도우용 설치 버전 : http://sourceforge.net/projects/sipp/files/sipp/3.2/sipp-win32-3.2-setup.exe/download
4. 받은 파일 sipp-win32-3.2-setup.exe을 실행하여 설치합니다.
5. C:\Program Files\Sipp_3.2안에 sipp.exe 파일을 실행하면 됩니다.
Sipp 홈페이지 : http://sipp.sourceforge.net/
WinPcap 홈페이지 : http://www.winpcap.org/default.htm
Asterisk Stress 테스트 인 Sipp Test시 녹취가 가능하도록 Pcap 까지 플레이 해주는 방법
1. 환경설정
sip.conf
[general]
progressinband=yes ;와이파이 컬러링 문제 때문에 필요 <- 주석 처리
;;클라이언트 단 Peer 설정
[sippuac]
type=peer
;secret=1111
context=sipptest
username=sippuac
host=XXX.XXX.XXX.XXX
port=5065
dtmfmode=rfc2833
insecure=no
canreinvite=no
nat=no
qualify=no
;;서버 단 Peer 설정
[sippuas]
type=peer
context=sipptest
username=sippuas
host=XXX.XXX.XXX.XXX
port=5066
;dtmfmode=rfc2833
insecure=no
;canreinvite=no
nat=no
qualify=no
extensions.conf
[sipptest]
exten=>s,1,Noop(SIPp Test)
exten=>s,n,Noop(=========================SIPp Test)
;;exten=>s,n,AGI(agi://localhost/managertest.agi)
;exten=>s,n,Dial(SIP/9805&SIP/9806&SIP/9807&SIP/9809,8,twWR)
exten=>s,n,Dial(SIP/9805&SIP/9806&SIP/9807&SIP/9809,8,R)
exten=>s,n,Dial(SIP/sippuas,8)
exten=>s,n,Hangup
2. 실행 명령어
클라이언트 단 실행 명령어
C:\Program Files\Sipp_3.1>sipp -s s -sf pcap.xml -p 5065 -i XXX.XXX.XXX.XXX xxx.xxx.xxx.xxx -r 5 -rp 1000 -nr -mi XXX.XXX.XXX.XXX -mp 6006
서버단 실행 명령어
C:\Program Files\Sipp_3.1>sipp -sn uas -p 5066 -mi XXX.XXX.XXX.XXX -mp 6003 -i XXX.XXX.XXX.XXX -rtp_echo -nr
3. 실행 시나리오 ( 서버는 기본, 클라이언트는 이름부분 수정)
----------------------------- pcap.xml -----------------------------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public License as -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version. -->
<!-- -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program; if not, write to the -->
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Sipp 'uac' scenario with pcap (rtp) play -->
<!-- -->
<scenario name="UAC with media">
<!-- In client mode (sipp placing calls), the Call-ID MUST be -->
<!-- generated by sipp. To do so, use [call_id] keyword. -->
<send retrans="500">
<![CDATA[
INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: sippuas <sip:sippuas@[local_ip]:[local_port]>;tag=[pid]SIPpTag09[call_number]
To: sippuac <sip:[service]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: 1 INVITE
Contact: sip:sippuas@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[local_ip_type] [local_ip]
t=0 0
m=audio [auto_media_port] RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-11,16
]]>
</send>
<recv response="100" optional="true">
</recv>
<recv response="180" optional="true">
</recv>
<!-- By adding rrs="true" (Record Route Sets), the route sets -->
<!-- are saved and used for following messages sent. Useful to test -->
<!-- against stateful SIP proxies/B2BUAs. -->
<recv response="200" rtd="true" crlf="true">
</recv>
<!-- Packet lost can be simulated in any send/recv message by -->
<!-- by adding the 'lost = "10"'. Value can be [1-100] percent. -->
<send>
<![CDATA[
ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: sippuas <sip:sippuas@[local_ip]:[local_port]>;tag=[pid]SIPpTag09[call_number]
To: sippuac <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 1 ACK
Contact: sip:sippuas@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0
]]>
</send>
<!-- Play a pre-recorded PCAP file (RTP stream) -->
<nop>
<action>
<exec play_pcap_audio="pcap/g711a.pcap"/>
</action>
</nop>
<!-- Pause 8 seconds, which is approximately the duration of the -->
<!-- PCAP file -->
<pause milliseconds="20000"/>
<!-- Play an out of band DTMF '1' -->
<nop>
<action>
<exec play_pcap_audio="pcap/dtmf_2833_1.pcap"/>
</action>
</nop>
<pause milliseconds="1000"/>
<!-- The 'crlf' option inserts a blank line in the statistics report. -->
<send retrans="500">
<![CDATA[
BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: sippuas <sip:sippuas@[local_ip]:[local_port]>;tag=[pid]SIPpTag09[call_number]
To: sippuac <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 2 BYE
Contact: sip:sippuas@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0
]]>
</send>
<recv response="200" crlf="true">
</recv>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<!-- definition of the call length repartition table (unit is ms) -->
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
</scenario>
# 녹음 또는 녹화 되어 있는 Pcap을 플레이.
# 활용 방안은 오디오 같은 경우 일정 음성을 들려주고 Hangup 한다던가, 비디오의 경우 무료 전화 서비스시 일정 광고를 보여준 후 , 통화를 하도록 설정 할 수 있음.
# 이후 고민 사항....
(1) 전화번호나 어떤 특정 조건에 따른 다른 오디오나 비디오가 나오도록 해야할것
(2) 현재 데몬을 여러개 띄우고 각기 다른 번호를 이용하면 가능하나 비효율적
1. Asterisk 환경 설정
sip.conf
;; Server 만 설정, 1111로 전화만 받는 peer 등록
[1111]
type=peer
context=outbound
username=1111
host=XXX.XXXX.XXX.XXX
port=5067
dtmfmode=rfc2833
insecure=very
canreinvite=no
nat=yes
qualify=no
disallow=all
allow=alaw
allow=ulaw
allow=g729
allow=h263
allow=h263a
videosupport=yes
Dialplan의 경우 그냥 Dial을 이용했으므로 크게 변경 사항 없음. ( 각 내선번호의 Peer로 등록하였기 때문에 )
2. SIPP 설정
가. 시나리오 XML
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public License as -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version. -->
<!-- -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program; if not, write to the -->
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Sipp default 'uas' scenario. -->
<!-- -->
<scenario name="Modify UAS PCAP PLAY kimos">
<!-- By adding rrs="true" (Record Route Sets), the route sets -->
<!-- are saved and used for following messages sent. Useful to test -->
<!-- against stateful SIP proxies/B2BUAs. -->
<recv request="INVITE" crlf="true">
</recv>
<!-- The '[last_*]' keyword is replaced automatically by the -->
<!-- specified header if it was present in the last message received -->
<!-- (except if it was a retransmission). If the header was not -->
<!-- present or if no message has been received, the '[last_*]' -->
<!-- keyword is discarded, and all bytes until the end of the line -->
<!-- are also discarded. -->
<!-- -->
<!-- If the specified header was present several times in the -->
<!-- message, all occurences are concatenated (CRLF seperated) -->
<!-- to be used in place of the '[last_*]' keyword. -->
<send>
<![CDATA[
SIP/2.0 180 Ringing
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag01[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag01[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0 8 101
a=fmtp:101 0-15
a=rtpmap:101 telephone-event/8000
m=video [media_port] RTP/AVP 34
a=fmtp:34 QCIF=1;CIF=1
a=rtpmap:34 H263/90000
]]>
</send>
<recv request="ACK"
optional="false"
rtd="true"
crlf="true">
</recv>
<!-- Play a pre-recorded PCAP file (RTP stream) -->
<nop>
<action>
<exec play_pcap_video="pcap/b.pcap"/>
</action>
</nop>
<!-- Pause 8 seconds, which is approximately the duration of the -->
<!-- PCAP file -->
<pause milliseconds="80000"/>
<send retrans="500">
<![CDATA[
BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag09[call_number]
To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 2 BYE
Contact: sip:sipp@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0
]]>
</send>
<send>
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<!-- Keep the call open for a while in case the 200 is lost to be -->
<!-- able to retransmit it if we receive the BYE again. -->
<timewait milliseconds="4000"/>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<!-- definition of the call length repartition table (unit is ms) -->
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
</scenario>
# 시나리오에 쓰인 PCAP 파일들
1.Asterisk 설정 환경 파일 설정 ( /etc/asterisk/ )
sip.conf 설정 ( 유저 등록 )
;; 클라이언트 peer 등록
[sipp]
type=peer
username=sippuac
;; sipp 실행하는 PC의 IP와 Port
host=192.168.0.3
port=5065
context=sipptest
dtmfmode=rfc2833
insecure=very
canreinvite=no
nat=yes
qualify=no ;; <== 이부분이 빠지면 실행되지 않음.. 정확이는 잘...
;; 서버 peer 등록
[sippuas]
type=peer
context=sipptest
username=sippuas
;; sipp 실행하는 PC의 IP와 Port
host=192.168.0.3
port=5067
dtmfmode=rfc2833
insecure=very
canreinvite=no
nat=yes
qualify=no
extensions.conf 설정 ( Dialplan 정의 )
[sipptest]
exten=>s,1,Dial(SIP/sippuas,20 )
2.Sipp 설정
sipp 실행명령어
Clent =>
sipp -s s -sn uac -p 5065 -i 192.168.0.3 192.168.0.2 -nr -r 1 -rp 1000
-s : service name
-sn : 기본 지원하는 XML 시나리오
-p : port
-i : local ip
-nr : Disable retransmission in UDP mode ( UDP 재전송 모드 해제 )
-r : rate(cps), 초당 콜수
-rp : 위의 초 시간을 정함, 단위는 ms. 1000 = 1초임.
Server =>
sipp -sn uas -p 5067 -mp 6003 -i 123.140.245.80 -nr
-mp : Media Port