Vyatta and Virtualization 仮 想 環 境 でのVyattay Meeting @ Hiroshima 海 老 澤 健 太 郎 Twitter: @ebiken ebiken.g@gmail.com
クラウド オートメーションを 実 現 するアーキテクチャ コントロールパネル マーケットプレイス ビジネスの 自 動 化 Parallels (Business) Automation Parallels Plesk Billing クラウドパッケージ 化 及 び 配 信 運 用 の 自 動 化 Parallels Operations Automation Parallels Virtual Automation Parallels Plesk Poducts Parallels Small Business Panel シェアードウェブ ホスティング メッセージング& コラボレーション 仮 想 インフラ サービス SaaS 仮 想 インフラストラクチャ ハイパーバイザとOS 仮 想 化 の 最 良 のコンビネーション Parallels Virtuozzo Containers Parallels Server Bare Metal 2
1. 仮 想 データセンター 本 日 のお 話 し 2. Vyatta 転 送 性 能 ( 仮 想 化 無 し) 3. 仮 想 化 環 境 におけるパケット 転 送 のしくみ 1. デバイス エミュレーション 2. I/O 準 仮 想 化 3. I/O デバイス 割 り 当 て(VT d) 4. I/O デバイス 割 り 当 て+ 共 有 (SR IOV) 4. 仮 想 化 技 術 をサポートするハードウェア 3
仮 想 データセンター From: http://www.vyatta.com/solutions/virtual/optimizedvirtualmachines 4
仮 想 データセンター(OneBox 設 定 例 ) PIF ( 物 理 NIC) Windows VPS eth1 Intranet Servers Hypervisor (PSBM5) Internal Network eth2 VPN (PPTP) Web Proxy (Int > Ext) Source NAT Vyatta Static NAT eth3 Web eth1 DMZ Mail Windows Server eth0 External Network PIF ( 物 理 NIC) 5 PIF ( 物 理 NIC)
仮 想 データセンター(OneBox 設 定 例 ) Web Serverの の 公 開 Web Mail Static NAT 設 定 : set service nat rule 10 destination address <external address:eth0> destination port <http port:80> inbound interface <external if:eth0> inside address address <web server:eth1> protocol potocotcptcp type destination eth0 Static NAT eth3 eth1 DMZ External Network 6
仮 想 データセンター(OneBox 設 定 例 ) 内 部 VPSからの 外 部 アクセス : Web / その 他 Web Proxy 設 定 : set service webproxy listen address <internal addr:eth2> Windows VPS eth1 Internal Network Source NAT (masquerade) 設 定 : set service nat rule 20 outband interface <external interface:eth0> type masquerade TCP 3128 Web Proxy (Int > > Ext) eth2 Source NAT eth0 7
仮 想 データセンター(OneBox 設 定 例 ) VPN(PPTP) によるアクセス VPN(PPTP) PPTP Server 設 定 設 : 定 : set set vpn vpn pptp pptp p remote access p outside address <external addr:eth0> <internet> client ip pool start start <local pool start> client ip pool ip pool ip pool stop <local pool stop> stop> dns servers <dns name> <dns ip> <dns addr> authentication mode mode local local authentication local users users username <username> <user> password <password> Windows VPS VPN (PPTP) eth1 Internal Network eth2 eth0 8
仮 想 データセンター(OneBox 設 定 例 ) set service nat rule 10 destination address 10.81.14.201 14 destination port 80 inbound interface eth0 inside address address 172.16.20.100 protocol tcp type destination Windows VPS 172.16.14.100 set service webproxy listen address 172.16.14.201 eth2: 172.16.14.201 172.16.20.100 set service nat rule 20 outband interface eth0 type masquerade set vpnpptpremote access outside address 10.81.14.201 client ip pool start 10.81.100.11 client ip pool ip pool stop 10.81.100.20 100 dns servers dns01 8.8.8.8 authentication mode local authentication local users username user password pass VPN (PPTP) Web Proxy (Int > Ext) Source NAT Vyatta Static NAT eth0: 10.81.14.201 PIF ( 物 理 NIC) Wb Web eth3: 172.16.20.201 9
日 本 語 の 入 門 書 あります! 第 1 章 Vyattaの 全 体 像 第 2 章 Vyattaクイックスタートガイドガ ド 第 3 章 Vyattaの 初 歩 的 な 設 定 第 4 章 企 業 内 ネットワークで 使 うための 機 能 第 5 章 ネットワークインターフェイス イス 第 6 章 経 路 制 御 (ルーティング) 第 7 章 ネットワークセキュリティ 機 能 第 8 章 VPN(Virtual Pi Private Nt Network) 機 能 第 9 章 Vyattaによる 高 可 用 性 の 実 現 第 10 章 QoSの 使 用 方 法 2011 年 6 月 16 日 発 売 近 藤 邦 昭, 松 本 直 人, 浅 間 正 和, 大 久 保 修 一, ( 日 本 Vyattaユーザー 会 ) 著 B5 変 形 判 /288ページ 定 価 3,360 円 ( 本 体 3,200 円 ) ISBN 978 4 7741 4711 6 http://gihyo.jp/book/2011/978 4 7741 4711 6 10
VYATTA 転 送 性 能 ( 仮 想 化 無 し) 11
テスト 構 成 Vyatta Core の Hardware 構 成 Traffic Generator Model HP DL160 G6 (~15 万 円 ) Ge0 IXIA IxN2X Ge1 CPU Xeon E5620 2.40GHz (Quad Core) Memory DDR3 SDRAM 1333MHz 6GB NIC オンボード:Broadcom BCM5715 追 加 :Intel 82576EB Dual Port eth0 eth1 宛 先 アドレス(IPv4) Ge0 Ge1: 11.0.0.0~11.0.0.255 Ge1 Ge0: 12.0.0.0~12.0.0.255 宛 先 アドレス(IPv6) Ge0 Ge1: 2400::~2400::ff Ge1 Ge0: 2400:1::~2400:1::ff Vyatta Core 6.1 12
パケットサイズと 転 送 性 能 (IPv4) 2000 1800 1600 1400 1200 1000 800 600 400 200 0 オンボード:Broadcom BCM5715 Mbps kpps 64 128 256 512 1024 1280 1518 800 700 600 500 400 300 200 100 0 13
パケットサイズと 転 送 性 能 (IPv6) 2000 1800 1600 1400 1200 1000 800 600 400 200 0 オンボード:Broadcom BCM5715 Mbps kpps 78 128 256 512 1024 1280 1518 700 600 500 400 300 200 100 0 14
NICによるパフォーマンスへの 影 響 オンボード Broadcom BCM571 からNICを 変 更 Intel : PRO/1000 PT Dual Port Server Adapter 型 番 : EXPI9402PT (Intel 82571GB Gigabit Controller) 価 格 :~18,000 円 Intel (MQ) : Gigabit ET Dual Port Server Adapter 型 番 :E1G42ET (Intel 82576 Gigabit Controller) 価 格 :~22,000 円 15
NICによるパフォーマンス(IPv4) Mbps 2000 1800 1600 1400 1200 1000 800 600 400 200 0 Intel Broadcom 64 128 256 512 1024 1280 1518 16
NICによるパフォーマンス(IPv6) Mbps 2000 1800 1600 1400 1200 1000 800 600 400 200 0 Intel Broadcom 64 128 256 512 1024 1280 1518 17
マルチキューによる 性 能 向 上 Receive Side Scaling, Scalable I/O 等 と 呼 ばれる CPU Core 数 増 加 により パケット 処 理 性 能 の 向 上 複 数 のキューを 持 ち パケットをCPUの 各 Coreに 割 り 振 る Core Core Core Core CPU 3 Coreへの 割 込 み 4 パケット 処 理 1パケット 受 信 2 キューへの 割 り 振 り (アドレス ポート 等 ) NIC 18
NICのスペックシートで 確 認 参 照 :http://www.intel.com/products/server/adapters/gb ET Dual Port/Gb ET Dual Port overview.htm 19
マルチキューによる 性 能 向 上 (IPv4) Mbps 2000 1800 1600 1400 1200 1000 800 600 400 200 0 Intel Broadcom Intel (MQ) 64 128 256 512 1024 1280 1518 20
仮 想 化 環 境 におけるパケット 転 送 のしくみ 21
仮 想 化 環 境 におけるパケット 転 送 のしくみ I/O 仮 想 化 の 種 類 デバイス エミュレーション Hypervisor (VMM) based device emulation User space device emulation I/O 準 仮 想 化 New Software Interface I/O デバイス 割 り 当 て(VT d) I/O デバイス 割 り 当 て+ 共 有 (SR IOV) 22
デバイス エミュレーション デバイスを Hypervisor (VMM) がエミュレーション オーバーヘッド= 大 Guest OS (VM) Guest OS (VM) User space device emulation Guest OS (VM) Guest OS (VM) Guest driver Guest driver Emulated device Guest driver Guest driver Emulated device Physical driver Hypervisor (VMM) Physical driver Hypervisor (VMM) Physical device Hardware Platform Physical device Hardware Platform Hypervisor based device emulation Parallels Server Bare Metal VMware ESXi User space device emulation KVM + Qemu 23
I/O 準 仮 想 化 Guest/VMMが 連 携 して 動 作 ( 専 用 のドライバ) オーバーヘッド= 小 KVM:virtio net Vmware:vmxnet3 Xen:netfront Guest OS (VM) Front End driver Back End driver Emulated device Guest OS (VM) Front End driver Physical driver Hypervisor (VMM) Physical device Hardware Platform 24
Stephen Hemminger Vyatta Inc. プリンシパルエンジニア( 米 国 ) Linux Kernel Contributor (network) netem network emulator bridging, iproute maintaner @Linuxcon Japan 2011 年 6 月 2 日 25
デバイス エミュレーション 性 能 比 較 100 仮 想 化 無 しを100とした 場 合 90 80 70 60 50 送 信 (Tx) 40 受 信 (Rx) 30 20 10 0 Hyper V VMware KVM Stephen Hemminger @ Linuxcon Japan 2011/06/02 26
I/O 準 仮 想 化 性 能 比 較 100 仮 想 化 無 しを100とした 場 合 90 80 70 60 50 送 信 (Tx) 40 受 信 (Rx) 30 20 10 0 Hyper V VMware KVM Stephen Hemminger @ Linuxcon Japan 2011/06/02 27
I/O デバイス 割 り 当 て(VT d) 物 理 デバイス(NIC)を VMに 割 り 当 て パケットをDMA 転 送 オーバーヘッド= 極 小 Guest OS (VM) Guest OS (VM) 1ポート( )に1VMのみ Physical driver Guest driver ( ) 1 PCIe Function DMA Remapping Hardware (VT d) Physical device Emulated device Physical driver Physical device 28
VT d :メモリアドレス( 番 地 ) 変 換 Guest OS (VM) VM 物 理 メモリ 物 理 メモリ 100 Buffer 1100 3 物 理 メモリ 番 地 1100 へコピー メモリアドレス 変 換 テーブル Hypervisor (VMM) DMA Remapping Hardware (VT d) NIC 2 Look Up 1 VM1 番 地 100へコピー VM1 番 地 100 番 地 1100 VM2 番 地 100 番 地 2100 VMn 番 地 100 番 地 3100 29
VT d: 物 理 構 成 CPU CPU System Bus North Bridgeに 実 装 されている Motherboard 選 択 に 注 意 CPUやNICの 対 応 も 必 要 North Bridge DMA Remapping Hardware (VT d) DRAM (Memory) PCIe Device (NIC) South Bridge PCI, Legacy devices 30
I/O デバイス 割 り 当 て+ 共 有 (SR IOV) 物 理 デバイス(NIC)を VMに 割 り 当 て+ 共 有 オーバーヘッド= 極 小 複 数 VMでポート ポ 共 有 可 能 Guest OS (VM) VF driver Guest OS (VM) VF driver VMからは VF=NIC(Port) に 見 える PF driver DMA Remapping Hardware (VT d) Hypervisor (VMM) PF VF VF VF SR IOV Physical device Hardware Platform * PF = Physical Function * VF = Virtual Function (PCIe subset) 31
SR IOV SR IOV 無 し:VMMがパケット 振 り 分 け SR IOV 有 り:NICがパケット 振 り 分 け VMMはパス スルー VM VM VM VM VM VM vnic vnic vnic vnic vnic vnic Rx0 Rx0 Rx1 RxN Tx1 Tx0 Tx1 TxN Hypervisor (VMM) Software Switch MAC / PHY DMA 転 送 NIC VF0 VF1 VFn Rx0 Rx1 RxN Rx0 Tx1 Tx0 Tx1 TxN Layer 2 Classifier / Sorter MAC / PHY Rx1 Rx0 RxN R0 Tx0 Tx1 Tx1 TN MACアドレス VLANを Rx0 TxN 元 に 振 り 分 け Rx1 Rx0 RxN R0 Rx0 Tx0 Tx1 Tx1 TN TxN 32
準 仮 想 化 デバイス 割 り 当 て SR IOV 性 能 比 較 送 信 (Tx) VT d はシングルキュー 受 信 (Rx) 出 典 :http://www.xen.org/files/xensummit_intel09/xensummit2009_iovirtperf.pdf intel09/xensummit2009 pdf HVM = Xen Hardware Virtual Machine IO Virtualization Performance, HUANG Zhiteng (zhiteng.huang@intel.com) PV = Para Virtualization ( 準 仮 想 化 ) 33
仮 想 化 技 術 をサポートする ハードウェア 34
Intel CPU VT x, VT d サポート 確 認 方 法 http://ark.intel.com/ 1) Click!! 2) Click!! 35
Intel CPU VT x, VT d サポート 確 認 方 法 VT x VT d Click!! 36
Intel CPU VT x, VT d サポート 確 認 方 法 http://ark.intel.com/search/advanced/?s=t&vtx=true&vtd=true 37
SR IOVサポートする Intel NIC 一 覧 http://www.intel.com/support/network/adapter/pro100/sb/cs 031492.htm 38
Intel NIC VT d, SR IOV サポート 確 認 方 法 http://www.intel.com/products/ethernet/resource.htm Controllerの の 型 番 からデータシートや 参 考 資 料 が 入 手 可 能 39
Mother Board VT d, SR IOV サポート 確 認 方 法 VT d サポートする Chip Set 記 載 http://wiki.xensource.com/xenwiki/vtdhowto Mother Board は 落 とし 穴 が 多 数 BIOSが が 対 応 してないとダメ! メーカー 独 自 管 理 パーツついてるとうまくいかな い 場 合 も 40
まとめ 仮 想 化 環 境 のパケット 転 送 性 能 は 構 成 に 大 きく 依 存 ハードウェアによって 使 えない 構 成 ( 仮 想 化 技 術 )も 試 して 動 いたらみんなでシェア! こんな 構 成 で 動 いたよ 性 能 でたよ! バッドノウハウも! この 構 成 だと 性 能 でない 動 かない 宛 先 はこちら: vyatta users@vyatta users.jp http://www.vyatta users.jp/ 41