【NW】pfsense VS Vyatta 
Vyattaを2-3日いじってみて中々pfsenseとは性格が違ったので、そのときの備忘録としてのメモとベンチなどを取ってみました。
ついでにどう違うか比較してみました。

Vyattaバージョン

vyatta@vyatta# uname -a
Linux vyatta 2.6.35-1-586-vyatta #1 SMP Fri Feb 4 05:07:37 PST 2011 i686 GNU/Linux


pfsenseバージョン

2.0-RC1 (i386)
built on Fri Apr 1 20:54:38 EDT 2011



amd64を使うべきか悩みましたが2Gしかメモリ積んでいないし相手が32ビットなのであえて32ビット版を使っています。

使用したハードウェア構成

このご時世仮想マシンではなくて実マシンを使っています。HDDも結構余ってるのでHDDに入れて実験しました。

Vyattaとpfsenseを入れたマシン

MB: P5M2/2GBL

これのSASオミット版です


Mem DDR2 800(667動作) 2G*1
CPU PentiumDC 5200@定格
NIC Broadcom BCM5721 PCI-E Gb LAN*2(オンボード)




写真にはDualportなNICが刺さってますが実験の時には抜きました。ifconfigしたときにeth0から6まで並ぶのを見るのは幸せな気分になれる反面間違えが増えますw

AB!(Apache Bench)&IperfされるNAPT内側のマシン構成

OS BacktrackLinux 4 R2
MB TPower I45
CPU E5400@定格
Mem DDR2 800 2GB*2
NIC RTL8111/8168B PCI Express Gigabit Ethernet controller

いつもの実験用バラックマシンです。BTはUSBに入れておくとサクッと実験用マシンを作れるので便利です。

NAPT外側マシン

OS Ubuntu 10.0.4 amd64
MB TYAN-Toledo-i3210W-i3200R-S5220
CPU C2Q6600@定格
Mem Mem DDR2 800 2GB*2
NIC Intel 82573L Gigabit Ethernet Controller*2

信頼のintelNIC

基本設定



---Vyatta---


Vyatta はルーターとして注力してるだけあって、vbashと呼ばれる(いわゆるCISCOのIOSライクな体系の)コマンドを持った独自のシェルを持っていて、方言さえ吸収できればそこらのネットワーク機器をいじったことのある人なら勘で設定できるようになってます。

Configureでコンフィグレーションモードに入ってset interface ethernet ethx addressでアドレスを固定して…といった感じです。
ちなみに、デフォルトでは全てAcceptになっていてパケットは全て通ります。

ただ、インストールが終わるといきなり$プロンプトなので、初心者向けかと言われるとちょっと悩みます(初心者がこんなものいじるかというのは置いておいて w)。ドキュメントは揃っているので必要なことは全てドキュメントを読めば記述してありますが、どちらかというとこの手の機器をいじったことのある中級者向けだと思います。

ちなみにvbashと言いつつも中身はDebianベースなのでsudo bash等と打てばrootで普通のbashが使えます。aptなどもレポジトリを追加すれば普通のパッケージも入ります。

一応WebUIも持っているは持っていますが基本はSSH/S0(シリアルポート)などからCLIで設定することになると思います。


---pfsense---


インストールが終わったらインターフェースのIPを指定すれば最初からDHCPdが有効になるので、そこから初期設定含めてWebUIから行うのがメインです。次へ次へで基本設定は終わるのでわかりやすいのはこっちだと思います。
pfsenseはFirewallなので、デフォルトは外からのパケットは全て破棄されます。たまにこれを忘れて繋がらないと悩むことがありますw
NAT,NAPTなんかはこっちの方が直感的なUIなので設定しやすいです。

設定すればSSHも使えるので、tcsh等のシェルからFWなどの設定をしようと思えば色々設定できますが、下手にいじるとWebUIがバグることがあるので注意が必要です。
BSDなのでPortsも使えます。まあBSDを使うような人はやろうと思ったら何でも出来ると思いますが。


WebUI



---vyatta---


GUIといっても簡易的なものです。
コマンドがディレクトリになっていて、そこに値を入れるようになっています。
vbashコマンドと対応しているので、CLIがわからないとわかりづらいと思います。




DNATのポリシーをいじっているとき、SSHとWebUIからいじっていたらWebUIからCommitした瞬間SSHの方の設定がCommit出来なくなってDeleteすら出来なくなったというバグ?があったので同時にいじるのはおすすめしません


---pfsense---


Vyattaとは全く違って高機能です。




市販のBBルータのようなUIなのである程度わかれば苦労はないと思います。
逆に設定するときにはトップから一々辿らないといけないとも言えますが。
viで/cf/conf/config.xmlを直に編集すればCUIから全て設定できると言えばできますが…。

Config




---vyatta---


まずVyattaの設定です。基本的なNAPTのみを有効にした場合の性能です。


config
interfaces {
ethernet eth4 {####LANインターフェース########
address 192.168.3.45/24
duplex auto
hw-id 00:18:f3:7d:5f:c2
smp_affinity auto
speed auto
}
ethernet eth5 {####WANインターフェース########
address 192.168.1.46/24
duplex auto
hw-id 00:18:f3:7d:5f:c3
smp_affinity auto
speed auto
}
loopback lo {
}
}
service {
https {
}
nat {
rule 10 { ####ApacheBenchのNAPTエントリ####
destination {
port 80
}
inbound-interface eth5 ####Eth5が外側のインターフェース####
inside-address {
address 192.168.3.46 ####←NAPT先マシン####
}
protocol tcp
type destination
}

rule 40 {########Iperf用エントリ########
destination {
port 5001
}
inbound-interface eth5
inside-address {
address 192.168.3.46
}
protocol tcp
type destination
}
rule 100 { ####内側から外側へ出るエントリ####
outbound-interface eth5
type masquerade
}

}
ssh {
port 22
protocol-version v2
}
}
system {
config-management {
commit-revisions 20
}
console {
device ttyS0 {
speed 9600
}
}
gateway-address 192.168.1.1
host-name vyatta
login {
user vyatta {
authentication {
encrypted-password ****************
}
level admin
}
}
name-server 192.168.1.18
ntp {
server 0.vyatta.pool.ntp.org {
}
server 1.vyatta.pool.ntp.org {
}
server 2.vyatta.pool.ntp.org {
}
}
package {
auto-sync 1
repository community {
components main
distribution stable
password ****************
url http://packages.vyatta.com/vyatta
username ""
}
}
syslog {
global {
facility all {
level notice
}
facility protocols {
level debug
}
}
}
time-zone GMT
}



一般的なNAPT用設定です。

最初はDNAT元アドレスにインターフェースアドレスを指定しないといけないのかと思った(つまり固定IPが必要だと思った)のですがPortを指定しておけばAddressを指定しなくても問題ない(=動的アドレスでも大丈夫)みたいです。

---pfsense---


NAPTだけを有効にした状態です。細かいことはいじってないです。




Iperf によるスループット





ーーーVyatta Iperfーーー



root@1:/home/owner# iperf -c 192.168.1.46 -i 1 -w 128K -t 30
------------------------------------------------------------
Client connecting to 192.168.1.46, TCP port 5001
TCP window size: 256 KByte (WARNING: requested 128 KByte)
------------------------------------------------------------
[ 3] local 192.168.1.22 port 57698 connected with 192.168.1.46 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 111 MBytes 934 Mbits/sec
[ 3] 1.0- 2.0 sec 111 MBytes 935 Mbits/sec
[ 3] 2.0- 3.0 sec 112 MBytes 936 Mbits/sec
[ 3] 3.0- 4.0 sec 112 MBytes 939 Mbits/sec
[ 3] 4.0- 5.0 sec 111 MBytes 935 Mbits/sec
[ 3] 5.0- 6.0 sec 112 MBytes 936 Mbits/sec
[ 3] 6.0- 7.0 sec 112 MBytes 937 Mbits/sec
[ 3] 7.0- 8.0 sec 112 MBytes 937 Mbits/sec
[ 3] 8.0- 9.0 sec 112 MBytes 940 Mbits/sec
[ 3] 9.0-10.0 sec 112 MBytes 938 Mbits/sec
[ 3] 10.0-11.0 sec 111 MBytes 931 Mbits/sec
[ 3] 11.0-12.0 sec 112 MBytes 942 Mbits/sec
[ 3] 12.0-13.0 sec 110 MBytes 925 Mbits/sec
[ 3] 13.0-14.0 sec 112 MBytes 936 Mbits/sec
[ 3] 14.0-15.0 sec 112 MBytes 940 Mbits/sec
[ 3] 15.0-16.0 sec 111 MBytes 933 Mbits/sec
[ 3] 16.0-17.0 sec 112 MBytes 943 Mbits/sec
[ 3] 17.0-18.0 sec 111 MBytes 935 Mbits/sec
[ 3] 18.0-19.0 sec 111 MBytes 935 Mbits/sec
[ 3] 19.0-20.0 sec 112 MBytes 935 Mbits/sec
[ 3] 20.0-21.0 sec 112 MBytes 935 Mbits/sec
[ 3] 21.0-22.0 sec 112 MBytes 939 Mbits/sec
[ 3] 22.0-23.0 sec 111 MBytes 934 Mbits/sec
[ 3] 23.0-24.0 sec 113 MBytes 944 Mbits/sec
[ 3] 24.0-25.0 sec 111 MBytes 933 Mbits/sec
[ 3] 25.0-26.0 sec 111 MBytes 931 Mbits/sec
[ 3] 26.0-27.0 sec 112 MBytes 936 Mbits/sec
[ 3] 27.0-28.0 sec 113 MBytes 946 Mbits/sec
[ 3] 28.0-29.0 sec 111 MBytes 930 Mbits/sec
[ 3] 29.0-30.0 sec 112 MBytes 939 Mbits/sec
[ 3] 0.0-30.0 sec 3.27 GBytes 936 Mbits/sec


そのときのCPU使用率


ATOP - vyatta 2011/04/02 18:05:01 3 seconds elapsed
PRC | sys 0.03s | user 0.00s | #proc 85 | #zombie 0 | #exit 0 |
CPU | sys 0% | user 0% | irq 3% | idle 196% | wait 0% |
cpu | sys 0% | user 0% | irq 3% | idle 97% | cpu000 w 0% |
cpu | sys 0% | user 0% | irq 1% | idle 99% | cpu001 w 0% |
CPL | avg1 0.00 | avg5 0.00 | avg15 0.00 | csw 70 | intr 104834 |
MEM | tot 2.0G | free 1.9G | cache 38.2M | buff 7.4M | slab 8.8M |
SWP | tot 0.0M | free 0.0M | | vmcom 61.4M | vmlim 1.0G |
NET | transport | tcpi 9 | tcpo 9 | udpi 0 | udpo 0 |
NET | network | ipi 170928 | ipo 170928 | ipfrw 170919 | deliv 9 |
NET | eth5 97% | pcki 242124 | pcko 121368 | si 978 Mbps | so 22 Mbps |
NET | eth4 97% | pcki 121373 | pcko 242131 | si 22 Mbps | so 978 Mbps |
NET | lo ---- | pcki 8 | pcko 8 | si 1 Kbps | so 1 Kbps |

PID SYSCPU USRCPU VGROW RGROW RDDSK WRDSK ST EXC S CPU CMD 1/1
4332 0.03s 0.00s 0K 0K 0K 0K -- - R 1% atop
1671 0.00s 0.00s 0K 0K 0K 0K -- - S 0% bgpd
1657 0.00s 0.00s 0K 0K 0K 0K -- - S 0% ripd


すごい、NAPTして1Gのトラフィック流してもCPU使用率は僅かです。さすがCiscoの機材にも勝つ性能があると言っているだけはあります。

---pfsense iperf---



owner@Server:~$ iperf -c 192.168.1.45 -w 128K -i 1 -t 30
------------------------------------------------------------
Client connecting to 192.168.1.45, TCP port 5001
TCP window size: 256 KByte (WARNING: requested 128 KByte)
------------------------------------------------------------
[ 3] local 192.168.1.14 port 57503 connected with 192.168.1.45 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 112 MBytes 942 Mbits/sec
[ 3] 1.0- 2.0 sec 112 MBytes 940 Mbits/sec
[ 3] 2.0- 3.0 sec 112 MBytes 940 Mbits/sec
[ 3] 3.0- 4.0 sec 113 MBytes 944 Mbits/sec
[ 3] 4.0- 5.0 sec 112 MBytes 941 Mbits/sec
[ 3] 5.0- 6.0 sec 112 MBytes 942 Mbits/sec
[ 3] 6.0- 7.0 sec 112 MBytes 941 Mbits/sec
[ 3] 7.0- 8.0 sec 112 MBytes 940 Mbits/sec
[ 3] 8.0- 9.0 sec 113 MBytes 946 Mbits/sec
[ 3] 9.0-10.0 sec 111 MBytes 933 Mbits/sec
[ 3] 10.0-11.0 sec 112 MBytes 942 Mbits/sec
[ 3] 11.0-12.0 sec 112 MBytes 940 Mbits/sec
[ 3] 12.0-13.0 sec 112 MBytes 942 Mbits/sec
[ 3] 13.0-14.0 sec 112 MBytes 938 Mbits/sec
[ 3] 14.0-15.0 sec 112 MBytes 942 Mbits/sec
[ 3] 15.0-16.0 sec 112 MBytes 941 Mbits/sec
[ 3] 16.0-17.0 sec 113 MBytes 945 Mbits/sec
[ 3] 17.0-18.0 sec 112 MBytes 939 Mbits/sec
[ 3] 18.0-19.0 sec 112 MBytes 944 Mbits/sec
[ 3] 19.0-20.0 sec 112 MBytes 939 Mbits/sec
[ 3] 20.0-21.0 sec 112 MBytes 938 Mbits/sec
[ 3] 21.0-22.0 sec 112 MBytes 939 Mbits/sec
[ 3] 22.0-23.0 sec 113 MBytes 944 Mbits/sec
[ 3] 23.0-24.0 sec 112 MBytes 941 Mbits/sec
[ 3] 24.0-25.0 sec 112 MBytes 943 Mbits/sec
[ 3] 25.0-26.0 sec 112 MBytes 939 Mbits/sec
[ 3] 26.0-27.0 sec 113 MBytes 945 Mbits/sec
[ 3] 27.0-28.0 sec 112 MBytes 938 Mbits/sec
[ 3] 28.0-29.0 sec 112 MBytes 941 Mbits/sec
[ 3] 29.0-30.0 sec 112 MBytes 944 Mbits/sec
[ 3] 0.0-30.0 sec 3.29 GBytes 941 Mbits/sec


そのときのCPU使用率@top

last pid: 27079; load averages: 0.00, 0.02, 0.04 up 0+00:27:40 00:35:07
33 processes: 1 running, 32 sleeping
CPU: 0.0% user, 0.0% nice, 0.0% system, 64.1% interrupt, 35.9% idle
Mem: 36M Active, 17M Inact, 48M Wired, 356K Cache, 33M Buf, 1890M Free

Vyattaは単純なスループット測定時には10%もCPUを使っていなかったので、それを考えるとpfsenseはCPUを食います。
まあ、裏でPacketFilterが動いてパケットを見ているので仕方がないのですが。





ApacheBench





---Vyatta ApacheBench---


AB先はApacheデフォルトのIt works!!ページです。
<html><body><h1>It works!</h1></body></html>


※試した限りどうもLighttpdの方がセッションを捌くのが早いのでLighttpdを使っています。


root@1:/home/owner# ab -n 10000 -c 500 http://192.168.1.46/index.html
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.46 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software: lighttpd/1.4.19
Server Hostname: 192.168.1.46
Server Port: 80

Document Path: /index.html
Document Length: 45 bytes

Concurrency Level: 500
Time taken for tests: 0.680 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 2781112 bytes
HTML transferred: 450180 bytes
Requests per second: 14707.29 [#/sec] (mean)
Time per request: 33.997 [ms] (mean)
Time per request: 0.068 [ms] (mean, across all concurrent requests)
Transfer rate: 3994.40 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 3 6 1.9 6 18
Processing: 4 9 7.0 9 219
Waiting: 3 8 7.0 7 217
Total: 8 15 7.7 14 224

Percentage of the requests served within a certain time (ms)
50% 14
66% 15
75% 15
80% 15
90% 16
95% 26
98% 37
99% 40
100% 224 (longest request)


長いですが要はFailed requests: 0で
Complete requests: 10000のTime taken for tests: 0.680 secondsなので、500同時セッションで10000回のアクセスを0.6秒でセッションを捌ききりました、ということです。
CPU使用率は1秒かからなかったのでatopで観測できませんでした。

ちなみにあんまりnの回数を増やすとセッションのキューに入ってしまうらしく一時待ち時間が入ってしまい、完了まで時間がばらついてしまうのでこの値になっています。configを色々いじってもいまいち効果がでなかったのでデフォルトのconfigです。




---pfsense ApacheBench---




root@1:/home/owner# ab -n 10000 -c 500 http://192.168.1.45/index.html
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
中略
Server Software: lighttpd/1.4.19
Server Hostname: 192.168.1.45
Server Port: 80

Document Path: /index.html
Document Length: 45 bytes

Concurrency Level: 500
Time taken for tests: 1.060 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 2788340 bytes
HTML transferred: 451350 bytes
Requests per second: 9431.15 [#/sec] (mean)
Time per request: 53.016 [ms] (mean)
Time per request: 0.106 [ms] (mean, across all concurrent requests)
Transfer rate: 2568.09 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 5 14 4.0 13 27
Processing: 6 21 34.9 16 702
Waiting: 6 19 34.8 15 700
Total: 15 35 35.1 28 721

Percentage of the requests served within a certain time (ms)
50% 28
66% 33
75% 37
80% 39
90% 42
95% 43
98% 46
99% 272
100% 721 (longest request)


マシンを起動しっぱなしでGWだけ入れ替えたので基本的にVyattaと同じコンディションですが、Time taken for tests: 1.060 secondsなのでやはりVyattaには単純な性能では劣ります。


Firewall




Vyatta



VyattaのFWは、いわゆるACL形式のソース/ディストIPアドレス、ポート、プロトコルで指定する条件合致型です。元々の意味のFirewallですね。
50個ほど作ってみましたがこの程度だと特にAB/Iperfの値に変化はありませんでした。

pfsense



さすがFWなだけあって、たとえば一気にセッションを張ろうとしても100セッション以上はDropする、というような設定にすることも出来ます。






oot@1:/home/owner# ab -n 10000 -c 500 http://192.168.1.45/index.html
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.45 (be patient)
apr_socket_recv: Connection timed out (110)
Total of 99 requests completed


という感じで100セッション以上は張ることが出来なくなりました。
ブロックする対象はn秒間にN回新しいセッションを張る、それプラスSynフラグやらRSTフラグなど、その他諸々いじれる項目は多岐にわたります。

そしてこれらの条件に合致するとロックアウトされます。それをくらうとしばらくホストに接続できなくなります。
また、あまりにやり過ぎるとDiagnostics:→Tables→Virusportに隔離されるので、ここから削除しないとそのIPは一生繋がりません


IPS(Snort)




SnortとはOpensourceなIPSで、パケットの中身をみてたとえばHTTPのヘッダに変なものが含まれていないか等の検査をするL7パケット精査ソフトウェアです。有効にするとかなり重くなります。

---vyatta---



上に書いてある設定に


[edit]
vyatta@vyatta# set content-inspection inspect-all enable
[edit]
vyatta@vyatta# set content-inspection traffic-filter preset all
[edit]
vyatta@vyatta# set content-inspection ips actions priority-1 alert
[edit]
vyatta@vyatta# set content-inspection ips actions priority-2 alert
[edit]
vyatta@vyatta# set content-inspection ips actions priority-3 alert

でSnortを有効化します。

---pfsense---



有効にするにはPackageからSnortを選んでインストールするだけです。
Snortの設定に関して言えばGUIから設定できるpfsenseの方がわかりやすいです。




IPSを有効にした状態での性能





---snortvyatta iperf---



root@1:/home/owner# iperf -c 192.168.1.46 -i 1 -w 128K -t 30
------------------------------------------------------------
Client connecting to 192.168.1.46, TCP port 5001
TCP window size: 256 KByte (WARNING: requested 128 KByte)
------------------------------------------------------------
[ 3] local 192.168.1.22 port 38723 connected with 192.168.1.46 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 26.2 MBytes 220 Mbits/sec
[ 3] 1.0- 2.0 sec 25.7 MBytes 216 Mbits/sec
[ 3] 2.0- 3.0 sec 25.8 MBytes 217 Mbits/sec
[ 3] 3.0- 4.0 sec 25.9 MBytes 217 Mbits/sec
[ 3] 4.0- 5.0 sec 25.1 MBytes 211 Mbits/sec
[ 3] 5.0- 6.0 sec 25.8 MBytes 217 Mbits/sec
[ 3] 6.0- 7.0 sec 26.0 MBytes 218 Mbits/sec
[ 3] 7.0- 8.0 sec 26.0 MBytes 218 Mbits/sec
[ 3] 8.0- 9.0 sec 26.1 MBytes 219 Mbits/sec
[ 3] 9.0-10.0 sec 25.9 MBytes 217 Mbits/sec
[ 3] 10.0-11.0 sec 26.0 MBytes 218 Mbits/sec
[ 3] 11.0-12.0 sec 26.0 MBytes 218 Mbits/sec
[ 3] 12.0-13.0 sec 25.9 MBytes 217 Mbits/sec
[ 3] 13.0-14.0 sec 25.4 MBytes 213 Mbits/sec
[ 3] 14.0-15.0 sec 26.0 MBytes 218 Mbits/sec
[ 3] 15.0-16.0 sec 25.8 MBytes 216 Mbits/sec
[ 3] 16.0-17.0 sec 25.9 MBytes 217 Mbits/sec
[ 3] 17.0-18.0 sec 25.2 MBytes 211 Mbits/sec
[ 3] 18.0-19.0 sec 25.7 MBytes 216 Mbits/sec
[ 3] 19.0-20.0 sec 25.8 MBytes 216 Mbits/sec
[ 3] 20.0-21.0 sec 26.0 MBytes 218 Mbits/sec
[ 3] 21.0-22.0 sec 25.4 MBytes 213 Mbits/sec
[ 3] 22.0-23.0 sec 25.3 MBytes 212 Mbits/sec
[ 3] 23.0-24.0 sec 25.2 MBytes 212 Mbits/sec
[ 3] 24.0-25.0 sec 25.8 MBytes 216 Mbits/sec
[ 3] 25.0-26.0 sec 26.0 MBytes 218 Mbits/sec
[ 3] 26.0-27.0 sec 25.3 MBytes 212 Mbits/sec
[ 3] 27.0-28.0 sec 25.9 MBytes 217 Mbits/sec
[ 3] 28.0-29.0 sec 26.0 MBytes 218 Mbits/sec
[ 3] 29.0-30.0 sec 25.9 MBytes 217 Mbits/sec
[ 3] 0.0-30.0 sec 773 MBytes 216 Mbits/sec


CPU使用率


ATOP - vyatta 2011/04/02 21:41:55 3 seconds elapsed
PRC | sys 1.29s | user 1.70s | #proc 84 | #zombie 0 | #exit ? |
CPU | sys 16% | user 56% | irq 34% | idle 94% | wait 0% |
cpu | sys 15% | user 54% | irq 26% | idle 5% | cpu001 w 0% |
cpu | sys 1% | user 1% | irq 8% | idle 90% | cpu000 w 0% |
CPL | avg1 0.43 | avg5 0.13 | avg15 0.04 | csw 718 | intr 33820 |
MEM | tot 2.0G | free 1.8G | cache 45.3M | buff 6.7M | slab 9.6M |
SWP | tot 0.0M | free 0.0M | | vmcom 209.4M | vmlim 1.0G |
NET | transport | tcpi 5 | tcpo 5 | udpi 0 | udpo 0 |
NET | network | ipi 40968 | ipo 84660 | ipfrw 84655 | deliv 5 |
NET | eth5 22% | pcki 56482 | pcko 28272 | si 228 Mbps | so 5298 Kbps |
NET | eth4 22% | pcki 28536 | pcko 56396 | si 5345 Kbps | so 228 Mbps |
NET | lo ---- | pcki 4 | pcko 4 | si 0 Kbps | so 0 Kbps |

PID SYSCPU USRCPU VGROW RGROW RDDSK WRDSK ST EXC S CPU CMD 1/1
3464 1.27s 1.70s 0K 0K 0K 0K -- - R 98% snort
3787 0.02s 0.00s 0K 0K 0K 0K -- - R 1% atop
1693 0.00s 0.00s 0K 0K 0K 0K -- - S 0% bgpd
106 0.00s 0.00s 0K 0K 0K 0K -- - S 0% bdi-default
3786 0.00s 0.00s 0K 0K 0K 0K -- - S 0% flush-8:0


予測はしていましたがかなり全体のパフォーマンスが落ちました。
まあ、それでも100Mbps以上の速度はあるので現在の環境なら問題ないですけどね。あとは見るパケットをもっと限定するとかチューンが必要だと思います。


---pfsense---




root@1:/home/owner# iperf -c 192.168.1.45 -i 1 -w 128K -t 30
------------------------------------------------------------
Client connecting to 192.168.1.45, TCP port 5001
TCP window size: 256 KByte (WARNING: requested 128 KByte)
------------------------------------------------------------
[ 3] local 192.168.1.22 port 47776 connected with 192.168.1.45 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 75.9 MBytes 637 Mbits/sec
[ 3] 1.0- 2.0 sec 21.5 MBytes 180 Mbits/sec
[ 3] 2.0- 3.0 sec 23.3 MBytes 196 Mbits/sec
[ 3] 3.0- 4.0 sec 24.6 MBytes 206 Mbits/sec
[ 3] 4.0- 5.0 sec 28.6 MBytes 240 Mbits/sec
[ 3] 5.0- 6.0 sec 31.1 MBytes 261 Mbits/sec
[ 3] 6.0- 7.0 sec 34.5 MBytes 289 Mbits/sec
[ 3] 7.0- 8.0 sec 36.6 MBytes 307 Mbits/sec
[ 3] 8.0- 9.0 sec 40.7 MBytes 341 Mbits/sec
[ 3] 9.0-10.0 sec 46.5 MBytes 390 Mbits/sec
[ 3] 10.0-11.0 sec 37.9 MBytes 318 Mbits/sec
[ 3] 11.0-12.0 sec 43.9 MBytes 368 Mbits/sec
[ 3] 12.0-13.0 sec 48.3 MBytes 405 Mbits/sec
[ 3] 13.0-14.0 sec 50.9 MBytes 427 Mbits/sec
[ 3] 14.0-15.0 sec 53.8 MBytes 451 Mbits/sec
[ 3] 15.0-16.0 sec 54.6 MBytes 458 Mbits/sec
[ 3] 16.0-17.0 sec 55.5 MBytes 466 Mbits/sec
[ 3] 17.0-18.0 sec 55.3 MBytes 464 Mbits/sec
[ 3] 18.0-19.0 sec 54.4 MBytes 457 Mbits/sec
[ 3] 19.0-20.0 sec 55.8 MBytes 468 Mbits/sec
[ 3] 20.0-21.0 sec 54.0 MBytes 453 Mbits/sec
[ 3] 21.0-22.0 sec 22.6 MBytes 190 Mbits/sec
[ 3] 22.0-23.0 sec 27.2 MBytes 229 Mbits/sec
[ 3] 23.0-24.0 sec 29.5 MBytes 247 Mbits/sec
[ 3] 24.0-25.0 sec 32.9 MBytes 276 Mbits/sec
[ 3] 25.0-26.0 sec 35.8 MBytes 300 Mbits/sec
[ 3] 26.0-27.0 sec 38.0 MBytes 319 Mbits/sec
[ 3] 27.0-28.0 sec 39.9 MBytes 334 Mbits/sec
[ 3] 28.0-29.0 sec 41.7 MBytes 350 Mbits/sec
[ 3] 29.0-30.0 sec 44.5 MBytes 373 Mbits/sec
[ 3] 0.0-30.0 sec 1.21 GBytes 347 Mbits/sec

ブレが…
一応全てのルールは有効にしてあるのですがVyattaとは有効になってる状態が違う可能性があるので横並びの比較は出来ません。
このようにどの程度メモリを割り当てるかという設定によっても変わってくると思います。




Vyattaにもこれがあると思うんですが疲れたので誰かこれを変更したらどうなるかベンチとって教えてください(他力本願


IPSを有効にした状態でのAB




---snortvyatta AB---




root@1:/home/owner# ab -n 10000 -c 500 http://192.168.1.46/index.html
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Server Software: lighttpd/1.4.19
Server Hostname: 192.168.1.46
Server Port: 80

Document Path: /index.html
Document Length: 45 bytes

Concurrency Level: 500
Time taken for tests: 3.918 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 2780000 bytes
HTML transferred: 450000 bytes
Requests per second: 2552.52 [#/sec] (mean)
Time per request: 195.885 [ms] (mean)
Time per request: 0.392 [ms] (mean, across all concurrent requests)
Transfer rate: 692.97 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 55 383.0 12 3802
Processing: 0 13 23.6 12 244
Waiting: 0 13 23.6 12 244
Total: 1 68 385.3 24 3816

Percentage of the requests served within a certain time (ms)
50% 24
66% 24
75% 24
80% 24
90% 25
95% 28
98% 225
99% 3023
100% 3816 (longest request)


IPS無効時には0.6秒しかかからなかったのにIPSを有効にすると7倍近くかかるようになってしまいました。
L7まで見るIPSなので納得は出来ますが思いの外パフォーマンスの低下が大きいです。
ちなみにLogにはアタックログが残ります。AlertではなくてDropにしておけばそのIPはもうさよなライオンします。

vyatta@vyatta:~$ show ips log
================================================
IPS events logged since Sat Apr 2 19:15:19 2011
================================================
2011-04-02 19:16:51.218303 {TCP} 192.168.1.22:49146 -> 192.168.3.46:80
(bad-unknown) Potentially Bad Traffic (priority 2)
[129:5:1] stream5: Bad segment, overlap adjusted size less than/equal 0
---------------------------------------------------------------------------
2011-04-02 19:16:51.218316 {TCP} 192.168.1.22:49147 -> 192.168.3.46:80
(bad-unknown) Potentially Bad Traffic (priority 2)
[129:5:1] stream5: Bad segment, overlap adjusted size less than/equal 0
---------------------------------------------------------------------------



pfsense



root@1:/home/owner# ab -n 10000 -c 500 http://192.168.1.45/index.html
中略
Server Software: lighttpd/1.4.19
Server Hostname: 192.168.1.45
Server Port: 80

Document Path: /index.html
Document Length: 45 bytes

Concurrency Level: 500
Time taken for tests: 1.229 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 2787784 bytes
HTML transferred: 451260 bytes
Requests per second: 8139.71 [#/sec] (mean)
Time per request: 61.427 [ms] (mean)
Time per request: 0.123 [ms] (mean, across all concurrent requests)
Transfer rate: 2215.99 [Kbytes/sec] received


確かに遅くはなっていますが無効の時と大差ないですね


結論


古い環境や基礎的なルーティングだけあればいいなら Vyatta、パケットフィルタやその他諸々詰め込みたいならpfsenseを選ぶべき

という「んなこと常識だろ!」という結論が出ました。それにしてもVyattaの軽さは凄いと思いました。ゲームでレイテンシを出したくないらVyattaを使うのがいいのではないですかね。

反面、ごてごてしてるながらもやはりpfsenseは高性能でした。
またちょっとネットワーク環境を変えようと思っているので、そのときはpfsenseを本格的に使おうかなと思っています。

[ コメントを書く ] ( 2564 回表示 )   |  このエントリーのURL  |  $star_image$star_image$star_image$star_image$star_image ( 3 / 1799 )  |  

<<最初へ <戻る | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 進む> 最後へ>>