仮想データセンター(OneBox設定例)
PIF (物理NIC)
Hypervisor
Hypervisor
Windows Intranet (PSBM5)
VPS Servers
eth1
Internal Network
eth2
Web Mail
VPN
Vyatta eth1
(PPTP)
Web Windows
Source Static eth3 Server
Proxy
(Int‐> Ext)
NAT NAT DMZ
eth0
External Network
PIF (物理NIC) PIF (物理NIC)
Japan Vyatta
5
Users Group
6.
仮想データセンター(OneBox設定例)
の公開
Web Serverの公開
Web Mail
Static NAT設定: eth1
Static NAT eth3
DMZ
set service nat rule 10
destination address <external‐address:eth0> eth0
destination port <http‐port:80>
inbound‐interface <external‐if:eth0> External Network
inside‐address address <web‐server:eth1>
p otoco tcp
protocol tcp
type destination
Japan Vyatta
6
Users Group
7.
仮想データセンター(OneBox設定例)
内部VPSからの外部アクセス : Web / その他
Windows
VPS
Web Proxy 設定:
Web Proxy
eth1
Internal Network
set service webproxy listen‐address <internal‐addr:eth2>
eth2
TCP
Source NAT (
S d ) 設定
(masquerade) 設定: 3128
Web
set service nat rule 20 Proxy
Source
NAT
outband‐interface <external‐interface:eth0>
outband interface <external interface:eth0> (Int > Ext)
(Int‐> Ext)
type masquerade eth0
Japan Vyatta
7
Users Group
8.
仮想データセンター(OneBox設定例)
VPN(PPTP)によるアクセス Windows
VPS
eth1 Internal
PPTP Server 設定:
VPN(PPTP) 設定: Network
set vpn p pptp remote‐access
set vpn ppremote‐access
p pptp p
pp p eth2
outside‐address <internet>
outside‐address <external‐addr:eth0>
client‐ip‐pool start <local‐pool‐start>
client‐ip‐pool start <local‐pool‐start>
VPN
client ip pool stop <local pool stop>
client‐ip‐pool stop <local‐pool‐stop>
client ip pool stop <local pool stop>
client‐ip‐pool stop <local‐pool‐stop> (PPTP)
dns‐servers <dns‐name> <dns‐addr>
dns‐servers <dns‐name> <dns‐ip>
authentication mode local
authentication mode local
eth0
authentication local‐users
authentication local users
authentication local‐users username
authentication local users username
username <user> password <password>
<username> password <password>
Japan Vyatta
8
Users Group
9.
仮想データセンター(OneBox設定例)
set service nat rule 10
destination address 10.81.14.201
destination address 10 81 14 201 Windows
destination port 80 VPS
inbound‐interface eth0 172.16.14.100
inside‐address address 172.16.20.100
protocol tcp
protocol tcp
type destination
set service webproxy listen‐address 172.16.14.201 eth2: 172.16.14.201 172.16.20.100
Web
W b
set service nat rule 20
outband‐interface eth0 VPN Vyatta
type masquerade (PPTP)
Web Source
Source Static
Static eth3:
eth3:
Proxy NAT NAT
set vpn pptp remote‐access (Int‐> Ext) 172.16.20.201
outside‐address 10.81.14.201
eth0: 10.81.14.201
client‐ip‐pool start 10.81.100.11
client‐ip‐pool stop 10.81.100.20
client ip pool stop 10 81 100 20
dns‐servers dns01 8.8.8.8
authentication mode local
authentication local‐users username user password pass PIF (物理NIC)
Japan Vyatta
9
Users Group
10.
日本語の入門書あります!
第1章 Vyattaの全体像
第2章
第 章 Vyattaクイックスタートガイド ガ ド
第3章 Vyattaの初歩的な設定
第4章 企業内ネットワークで使うための機能
第5章 ネットワークインターフェイス
第 章 ネ トワ クインタ フ イス
第6章 経路制御(ルーティング)
第7章 ネットワークセキュリティ機能
第8章 VPN(Vi t l P i t N t
VPN(Virtual Private Network)機能
k)機能
第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
Japan Vyatta
10
Users Group
マルチキューによる性能向上
/ 等と呼ばれる
• Receive‐Side Scaling, Scalable I/O 等と呼ばれる
g,
• CPU Core数増加により、パケット処理性能の向上
• 複数のキューを持ち、パケットをCPUの各Coreに割り
振る
Core Core Core Core CPU
③ Coreへの割込み
④ パケット処理
① パケット受信
NIC
② キューへの割り振り
(アドレス・ポート等)
( ド ポ 等)
Japan Vyatta
18
Users Group
仮想化環境におけるパケット転送のしくみ
• I/O仮想化の種類
–デバイス・エミュレーション
• Hypervisor (VMM) based device emulation
Hypervisor (VMM) based device emulation
• User space device emulation
– I/O準仮想化
• New Software Interface
– I/O デバイス割り当て(VT d)
I/O デバイス割り当て(VT‐d)
– I/O デバイス割り当て+共有(SR‐IOV)
Japan Vyatta
22
Users Group
23.
デバイス・エミュレーション
デバイスを Hypervisor (VMM) がエミュレーション
オーバーヘッド=大
オ バ ド 大
User‐space device
Guest OS (VM) Guest OS (VM) Guest OS (VM) Guest OS (VM)
emulation
Guest Guest Emulated Guest Guest
driver driver device driver driver
Emulated device
Physical driver Hypervisor (VMM) Physical driver Hypervisor (VMM)
Physical device Hardware Platform Physical device Hardware Platform
Hypervisor‐based device emulation User space device emulation
・Parallels Server Bare Metal
Parallels Server Bare Metal ・ KVM + Qemu
KVM + Qemu
・ VMware ESXi
Japan Vyatta
23
Users Group
24.
I/O準仮想化
Guest/VMMが連携して動作(専用のドライバ)
オーバーヘッド=小
Guest OS (VM) Guest OS (VM)
KVM:virtio‐net
Vmware:vmxnet3 Front End Front End
driver driver
Xen:netfront
Back End driver
Emulated device
Physical driver Hypervisor
(VMM)
Physical device Hardware
Platform
Japan Vyatta
24
Users Group
25.
• Stephen Hemminger
Stephen Hemminger
– Vyatta Inc. プリンシパルエンジニア(米国)
– Linux Kernel Contributor (network)
– “netem” network emulator
– bridging, iproute maintaner
• @Linuxcon Japan
– 2011年6月2日
Japan Vyatta
25
Users Group
26.
デバイス・エミュレーション 性能比較
仮想化無しを100とした場合
100
90
80
70
60
50 送信(Tx)
40 受信(Rx)
30
20
10
0
Hyper‐V VMware KVM
Stephen Hemminger @ Li
St h H i @ Linuxcon J
Japan 2011/06/02
2011/06/02
Japan Vyatta
26
Users Group
27.
I/O準仮想化 性能比較
仮想化無しを100とした場合
100
90
80
70
60
50 送信(Tx)
40 受信(Rx)
30
20
10
0
Hyper‐V VMware KVM
Stephen Hemminger @ Li
St h H i @ Linuxcon J
Japan 2011/06/02
2011/06/02
Japan Vyatta
27
Users Group
28.
I/O デバイス割り当て(VT‐d)
物理デバイス(NIC)を VMに割り当て
パケットをDMA転送
オーバーヘッド=極小
Guest OS (VM) Guest OS (VM)
1ポート(※)に1VMのみ Physical
driver
Guest
driver
Emulated
device
Physical driver
(※) 1 PCIe Function DMA Remapping Hardware (VT‐d)
Physical device Physical device
Japan Vyatta
28
Users Group
29.
VT‐d :メモリアドレス(番地)変換
Guest OS 物理メモリ
VM物理メモリ
(VM)
1100
Buffer
100 ③ 物理メモリ番地1100 へコピー
メモリアドレス変換テーブル
Hypervisor (VMM) VM1 番地100 → 番地1100
VM2 番地100 → 番地2100
DMA Remapping ② Look Up …
Hardware (VT‐d)
( ) VMn 番地100 → 番地3100
① VM1番地100へコピー
NIC
Japan Vyatta
29
Users Group
30.
VT‐d:物理構成
• North Bridgeに実装されている
CPU CPU
→Motherboard選択に注意
• CPUやNICの対応も必要
System Bus
North Bridge
DMA Remapping DRAM
Hardware (
(VT‐d)
) (Memory)
PCI, Legacy
PCIe Device (NIC) South Bridge
devices
Japan Vyatta
30
Users Group
31.
I/O デバイス割り当て+共有(SR‐IOV)
物理デバイス(NIC)を VMに割り当て+共有
オーバーヘッド=極小 Guest OS Guest OS
(VM) (VM)
VF VF
複数VMでポート共有可能
ポ driver driver
VMからは VF=NIC(Port) PF
に見える driver
Hypervisor (VMM)
Hypervisor (VMM)
DMA Remapping Hardware (VT‐d)
PF VF VF VF SR‐IOV
Physical device
Hardware Platform
* PF = Physical Function
* VF = Virtual Function (PCIe subset)
* VF Virtual Function (PCIe subset)
Japan Vyatta
31
Users Group
32.
SR‐IOV
SR‐IOV 有り:NICがパケット振り分け
SR‐IOV 無し:VMMがパケット振り分け
VMMはパス・スルー
VM VM VM VM VM VM
vNIC vNIC vNIC vNIC vNIC vNIC
Hypervisor
Rx0 Rx1 RxN
Rx0 Tx1 (VMM)
Tx0 Tx1 TxN
VF0 VF1 VFn
Software Switch DMA転送 Rx0 Rx1 RxN
Rx0 Tx1
Tx0 Tx1 TxN
NIC Layer 2 Classifier / Sorter
MAC / PHY
MAC / PHY MAC / PHY
MAC / PHY
Rx1 Tx0 Rx1 Tx0
Rx0 Tx1 MACアドレス・VLANを Rx0 Tx1
RxN Tx1 RxN Tx1
Rx0
R 0 TxN
T N 元に振り分け Rx0
R 0 TxN
T N
Japan Vyatta
32
Users Group
33.
準仮想化、デバイス割り当て、SR‐IOV性能比較
送信(Tx)
VT‐d はシングルキュー
グ キ
受信(Rx)
出典:http://www.xen.org/files/xensummit_intel09/xensummit2009_IOVirtPerf.pdf
出典:http://www xen org/files/xensummit intel09/xensummit2009 IOVirtPerf pdf HVM = Xen Hardware Virtual Machine
IO Virtualization Performance, HUANG Zhiteng (zhiteng.huang@intel.com) PV = Para Virtualization (準仮想化 )
Japan Vyatta
33
Users Group