SIPp 入門

加藤泰文

Asterisk ユーザ会

自己紹介

名前
加藤泰文 (かとうやすふみ)
http://www.ne.jp/asahi/ka/to/http://iddy.jp/profile/ten-forward/
仕事
ホスティング会社の開発
コミュニティ活動

今日の目標

Agenda

SIPp とは

インストール (1)

インストール (2)

デモ (1)

簡単な使い方

使い方 (オプション)

$ sipp [options] remote_host[:remote_port]

-sn: 組み込みシナリオの指定 (-sn uac)
-sf: シナリオファイルの指定 (-sf uac.xml)
-s: リクエストURIのユーザ名部分
(-s 200 -> ex. INVITE sip:200@192.168.0.1)
-d: 通話が成立したあとのpauseの長さ(ms) (-d 10000 -> 10 秒)
-r: 1秒当たりの通話数(calls per sec.) (-r 10)
-m: 指定した数の通話が終了した時点でテストを終わる (-m 1)
-l: 同時発呼数
-trace_stat: 統計ログの保存
-trace_rtt: 応答時間ログの保存

(例)
$ sipp -sn uac -d 10000 -s 200 -r 10 -m 10000 192.168.0.1
(uac シナリオを使って 192.168.0.1 の 200 番に対して
10 call/sec の割合で 10000 通話テストする)

シナリオ (1)

シナリオ (2)

シナリオ例

UAC UAS
        SIPp UAC            Remote
        |(1) INVITE         |
        |------------------>|
        |(2) 100 (optional) |
        |<------------------|
        |(3) 180 (optional) |
        |<------------------|
        |(4) 200            |
        |<------------------|
        |(5) ACK            |
        |------------------>|
        |                   |
        |(6) PAUSE          |
        |                   |
        |(7) BYE            |
        |------------------>|
        |(8) 200            |
        |<------------------|
        
        Remote              SIPp UAS
        |(1) INVITE         |
        |------------------>|
        |(2) 180            |
        |<------------------|
        |(3) 200            |
        |<------------------|
        |(4) ACK            |
        |------------------>|
        |                   |
        |(5) PAUSE          |
        |                   |
        |(6) BYE            |
        |------------------>|
        |(7) 200            |
        |<------------------|
        

シナリオファイル

<scenario name="Basic Sipstone UAC">
<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: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
To: sut <sip:[service]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: 1 INVITE
Contact: sip:sipp@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Type: application/sdp
Content-Length: [len]
:
: (snip)

Asterisk とのテスト (1)

sip.conf

extensions.conf

デモ (2)

pcap play

デモ(3)

デモ(4)

Echo するだけの extension に対して発信.

# sipp -sn uac_pcap -d 10000 -s 300 -m 1 -i 192.168.0.2 192.168.0.1

extensions.conf

exten => 300,1,Answer()
exten => 300,n,Echo()
exten => 300,n,Hangup()

認証付きテスト

デモ (5)

csv ファイルからの値挿入

デモ (6)

csv で発信元,通話先,認証データを挿入.

csv ファイル

SEQUENTIAL
201;[authentication username=201 password=pass];401
202;[authentication username=202 password=pass];402
203;[authentication username=203 password=pass];403

シナリオ

<scenario name="Basic Sipstone UAC">
  <send retrans="500">
    <![CDATA[
      INVITE sip:[field2]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
      To: [field2] <sip:[field2]@[remote_ip]:[remote_port]>

コマンド

sipp -sf uac_auth_csv.xml -inf demo.csv -m 3 -d 10000 -i 192.168.0.2 192.168.0.1

性能評価 (1)

性能評価方法の例

性能評価 (2)

性能評価項目

性能評価 (3)

(ご参考) 性能評価方法の工夫

「Asterisk運用・開発ガイド」(エムトゥエックス株式会社監修,株式会社アイウィーヴ,マッキーソフト株式会社共著,オーム社)に載っていた性能評価方法.

まとめ

参考文献

ご清聴ありがとうございました.

[any material that should appear in print but not on the slide]
[any material that should appear in notes window but not on the slide]