SIPp 學習筆記 一 (安裝)
SIPp可以用來測試各種sip的設備,如終端電話或者proxy, 包括功能和性能上的(性能上只能在linux平臺下纔可以;) 具體的描述可以去參照SIPp的官方網站;
http://sipp.sourceforge.net/doc3.0/reference.html
一,安裝.
首先, 在安裝之前我們必須弄清楚,SIPp程序所支持的OS平臺和其工作的各種模式:
1, SIPp可以工作在兩個不同的平臺,Linux和windows. 還有一些特殊的os的安裝不在我的學習範圍之內, 如HP的os;
2, SIPp能夠支持4中模式:
You have four options to compile SIPp:
Without TLS (Transport Layer Security) and authentication support:
This is the recommended setup if you don't need to handle SIP authentication and/or TLS. In this case, there are no depencies to install before building SIPp. It is straight forward:
# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make
With TLS and authentication support, you must have installed OpenSSL library (>=0.9.8) (which may come with your system). Building SIPp consist only in adding the "ossl" option to the make command:
# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make ossl
With PCAP play and without authentication support:
# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make pcapplay
With PCAP play and authentication support:
# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make pcapplay_ossl
(若win下使用.exe安裝的話,不支持TLS和PCAP. Win下需要編譯源碼才能和linux下一樣,所有功能都支持;)
下面我來說說具體的安裝.
1, Windows, 本人先嚐試的爲Win環境的安裝,如果Win都成功了,Linux環境下肯定就更沒有問題了;
在windows安裝之前,先介紹一個新的東西. CYGWIN,爲必須,類似於一個windows 環境中虛擬一個linux環境的工具, 該工具能將sipp程序和win的api對應上,是linux下網絡程序能在windows下跑, 同時還具有gcc的編譯功能,缺點是安裝起來比較麻煩,爲在線安裝,服務器在日本,很慢,下面推薦給大家一些安裝資料,也是從網上找來並親自實驗過的. 如果你安裝失敗的話使用時可能會出現 “error opening terminal cygwin”;
下載地址: http://www.cygwin.com/setup.exe; 下載下來以後,運行,選擇要按照的鏡像server,我使用的是http://mirrors.kernel.org,速度還可以. 如果是SIPp使用exe來安裝的話,使用下一步就ok了,如果是SIPp需要編譯源碼的話,就必須按照以下的組件.
☼ gcc-core
☼ gcc-g++
☼ libncurses-devel
☼ libncurses8
☼ openssl-devel
☼ make
☼ OpenSLL
安裝完以後在win cmd中通過一下環境變量, C:/>set CYGWIN=tty notitle glob;
Window 下安裝有兩種方法,
一是使用官方網站提供的.exe文件,直接安裝,然後下一步下一步,十分簡單; 如果CYGwin安裝的沒有問題的話, 這就算是安裝好了.
Ps:
n 官方網站之提供了1.1和2.0版本的EXE文件,現在的最新版本已經是3.1了;
n 安裝目錄最好選擇在C盤(系統盤);
n 使用exe安裝不支持TLS和PACP的功能,如果要支持這兩個功能的話就必須使用源碼編譯安裝;
n 下載地址: http://sourceforge.net/project/showfiles.php?group_id=104305;
二爲下載源碼,編譯安裝,
使用CYGwin在windows下進行編譯,所以必須按照cygwin的gcc編譯功能;
事前準備:1,源碼, 從網上download下放到/usr/中,並解壓;
2, winpcap, 從sipp提供的網址down下來以後,解壓縮,並copy到C:/cygwin/lib/WpdPack目錄下;
3, 安裝IPV6, 從sipp提供的網址down下來以後,解壓開並將其覆蓋C:/cygwin/,並修改new-cygwin1.dll爲cygwin1.dll;
然後進行編譯. 使用命令爲 "make pcapplay_cygwin" or "pcapplay_ossl_cygwin” ;
Ps: 要想編譯成功,就必須要安裝Opensll和各種lib庫,否則 make pcapplay_ossl_cygwin會出錯;
在編譯的使用提示找不到cygwin/uio.h, 搜索一下將/usr/include/sys下有這個文件,把它複製到/usr/include/cygwin目錄下,再編譯,O啦。
2,Linux.
Linux下似乎更加簡單,解壓源代碼,根據命令編譯即可,關於opensll和pcap的linux大家可以自己研究.