ER-XのPPPoEスループット

家庭用として使うときは、PPPoE接続時におけるNATとfirewallありでのスループットが性能の目安になるかと思います。今回はこれを計測してみました。

計測環境

CentOS7 Aをクライアント、CentOS7 Bをサーバーにし、iperf3を実行しスループットの測定を行います。テストに使うPPPoEサーバーはMikrotik社のソフトウェアアプライアンス CHR(Cloud Hosted Router)のv6.44.3を使いました。フレッツ環境を意識し、PPPoEサーバーのMTUは1454に設定しています。基本Basic Setupのものですが、MSS clampingを入れるため、以下の設定を追加で入れています。

set firewall modify MSS_CLAMPING_PPPoE rule 10 action modify
set firewall modify MSS_CLAMPING_PPPoE rule 10 modify tcp-mss 1414
set firewall modify MSS_CLAMPING_PPPoE rule 10 protocol tcp
set firewall modify MSS_CLAMPING_PPPoE rule 10 tcp flags SYN
set interfaces ethernet eth0 pppoe 0 firewall in modify MSS_CLAMPING_PPPoE
set interfaces ethernet eth0 pppoe 0 firewall out modify MSS_CLAMPING_PPPoE

EdgeRouterやLinuxのiptablesに慣れていないと、なぜfirewallの設定として入れるのか???ですが(私も最初は戸惑いました)、EdgeRouterのfirewallは実質的にはLinuxのiptablesであり、EdgeRouterのfirewall modifyはiptalbesのmangleテーブルの処理に相当します。パケットの書き換えは(MSS clampingもその一種)はiptablesではmangleテーブルでの処理となり、EdgeRouterではfirewall modifyで処理することとなります。firewall modifyというネーミングは相当イマイチです・・・。

検証に使うER-Xのファームウェアはv1.10.9となります。

計測結果

CentOS7 Aでのiperf3の実行結果が以下となります。-Mオプションを使ってMSSを変えてテストを行っています。消費電力はTAP-TST10での目測値で無負荷時は2.6Wとなります。先ずはoffloadなしで。

offloadなしの場合 receiver sender
MSS Mbps CPU 消費電力 Mbps CPU 消費電力
1414(指定なし) 203 53% 3.3W 172 33% 3.2W
1200 169 51% 3.4W 173 52% 3.3W
800 113 50% 3.3W 114 52% 3.3W
400 47.7 33% 3.2W 40 35% 3.2W

やはりoffloadがないとNAT+firewallの結果と同様冴えない結果です。次はhwnat=enableで計測します。

offloadありの場合 receiver sender
MSS Mbps CPU 消費電力 Mbps CPU 消費電力
1414(指定なし) 928 0% 2.7W 900 0% 2.7W
1200 911 0% 2.7W 882 0% 2.7W
800 873 0% 2.7W 827 0% 2.7W
400 761 0% 2.7W 689 0% 2.7W

NATやstateful firewallに加えてPPPoEを入れてもあまりスループットが悪化しません。

にくいね、ER-X

ただ一つ気になるのは、MSS 800byteやMSS 400byteのsenderのケースで、60秒間のiperf3でretrがそれぞれ5000、14000とかなり発生しています。

ER-XのConfig

テストに使ったconfigは、基本Basic Setupで設定したものに、先に説明のMSS Clampingとhwnatだけ追加設定をしたものとなります。

set firewall modify MSS_CLAMPING_PPPoE rule 10 action modify
set firewall modify MSS_CLAMPING_PPPoE rule 10 modify tcp-mss 1414
set firewall modify MSS_CLAMPING_PPPoE rule 10 protocol tcp
set firewall modify MSS_CLAMPING_PPPoE rule 10 tcp flags SYN
set firewall name WAN_IN default-action drop
set firewall name WAN_IN description 'WAN to internal'
set firewall name WAN_IN rule 10 action accept
set firewall name WAN_IN rule 10 description 'Allow established/related'
set firewall name WAN_IN rule 10 state established enable
set firewall name WAN_IN rule 10 state related enable
set firewall name WAN_IN rule 20 action drop
set firewall name WAN_IN rule 20 description 'Drop invalid state'
set firewall name WAN_IN rule 20 state invalid enable
set firewall name WAN_LOCAL default-action drop
set firewall name WAN_LOCAL description 'WAN to router'
set firewall name WAN_LOCAL rule 10 action accept
set firewall name WAN_LOCAL rule 10 description 'Allow established/related'
set firewall name WAN_LOCAL rule 10 state established enable
set firewall name WAN_LOCAL rule 10 state related enable
set firewall name WAN_LOCAL rule 20 action drop
set firewall name WAN_LOCAL rule 20 description 'Drop invalid state'
set firewall name WAN_LOCAL rule 20 state invalid enable
set interfaces ethernet eth0 description 'Internet (PPPoE)'
set interfaces ethernet eth0 duplex auto
set interfaces ethernet eth0 pppoe 0 default-route auto
set interfaces ethernet eth0 pppoe 0 firewall in modify MSS_CLAMPING_PPPoE
set interfaces ethernet eth0 pppoe 0 firewall in name WAN_IN
set interfaces ethernet eth0 pppoe 0 firewall local name WAN_LOCAL
set interfaces ethernet eth0 pppoe 0 firewall out modify MSS_CLAMPING_PPPoE
set interfaces ethernet eth0 pppoe 0 mtu 1454
set interfaces ethernet eth0 pppoe 0 name-server auto
set interfaces ethernet eth0 pppoe 0 password test
set interfaces ethernet eth0 pppoe 0 user-id ppp1
set interfaces switch switch0 address 192.168.100.1/24
set interfaces switch switch0 description Local
set interfaces switch switch0 mtu 1500
set interfaces switch switch0 switch-port interface eth1
set interfaces switch switch0 switch-port interface eth2
set interfaces switch switch0 switch-port interface eth3
set interfaces switch switch0 switch-port interface eth4
set interfaces switch switch0 switch-port vlan-aware disable
set service nat rule 5010 description 'masquerade for WAN'
set service nat rule 5010 outbound-interface pppoe0
set service nat rule 5010 type masquerade
set system offload hwnat enable

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です