第20回 openstack勉強会 neutron deep dive - dvr
DESCRIPTION
第20回 OpenStack勉強会 Neutron Deep Dive Distributed Virtual Router技術概要TRANSCRIPT
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Title slideSubtitle
Speaker’s Name / Month day, 2014
OpenStack NeutronDistributed Virtual Router技術概要
Hewlett-Packard Company
クラウドチーフテクノロジスト
真壁徹
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
日本OpenStackユーザー会 第20回勉強会
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
はじめに
•自己紹介
–真壁徹 (まかべ とおる)
– HP所属クラウドチーフテクノロジスト
•当セッションを担当する背景
– HPがJunoサイクルでNeutron開発をがんばったので
•セッションのすすめかた
– 腕におぼえのある方向けのDeep Diveですが、概要からお話します
–開発の背景、できること、なにがうれしいか、を全員に持ち帰っていただきたい
– 細かな実装の説明は、最後に
http://stackalytics.com/(Juno, Neutron, Commit)
HP
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
当セッションのテーマ
“DVR”Distributed Virtual Router
分散 仮想 ルーター
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
以上、ご清聴ありがとうございました
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
分散? 何を? 何で?
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
なぜ分散したいのか? ~Neutron ML2 Plugin + Open vSwitch~
•Network Nodeが単一障害点になるから
•Network Nodeがボトルネックになるから(特にEast/Westトラフィック)
Compute Node Compute Node
Network Node
VM VM
Router
外部
Non-DVR集中
すべての、• サブネットまたぎの通信• 外部ネットワークとの通信がNetwork Nodeに集中している
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄
Compute Node
Network Node
VM VM
Router
Non-DVR
たとえば同じCompute Node上にあるVM、サブネットが違うだけで
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
無理無理無理無理無理無理無理無理無理無理無理無理無理無理無理
Compute Node
Network Node
VM VM
Router
Non-DVR
サブネットまたぎの通信、すべてがNetwork Nodeへ
Compute Node
VM VM
Compute Node
VM VM
Compute Node
VM VM
Compute Node
VM VM
Compute Node
VM VM
Compute Node
VM VM
Compute Node
VM VM
Compute Node
VM VM
Compute Node
VM VM
Compute Node
VM VM
Compute Node
VM VM
Compute Node
VM VM
Compute Node
VM VM
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
DVRを3行で説明
•Neutronの仮想ルーター機能を、
•Network Node 1か所への集中配置から、
•各Compute Nodeへ分散配置できるようにした
Compute Node Compute Node
Network Node
VM VM
Router
外部
Compute Node Compute Node
Network Node
VM VM
外部
Router
Router Router
Non-DVR DVR
破線については後述
集中
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
みんな、分散できる商用SDN製品
使ってるのでは?
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
オープンソース/リファレンス実装への期待は高い
http://superuser.openstack.org/articles/openstack-user-survey-insights-november-2014
• オープンソースPluginの利用率が高い
• まだ根強いnova-network人気
• 非集中モデル
• リファレンス実装であるML2 + OVSの底上げには価値がある
• もちろん商用製品、あれは、いいものだ
• ”Choice”は重要
ここから細かくなります
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
DVR 一問一答
•どのバージョンから使える?
– Juno
•対象Pluginは?
– ML2 Plugin + Open vSwitch
•どのような通信で活きる機能?
– サブネットをまたぐ通信すべて
•トンネリングの選択肢は?
– VXLAN or GRE
• DVR使いたくないんだけど?
– DVR/Non-DVR(Legacy Mode)を選択可能
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
DVRを有効にするには?
• neutron.conf (controller node)
router_distributed = True
• l3_agent.ini (all nodes)
– agent_mode = dvr (compute node)
– agent_mode = dvr_snat (network node)
• ml2_conf.ini (all nodes)
[ml2]
mechanism_drivers =openvswitch,l2population
• ovs_neutron_plugin.ini (all nodes)
[agent]
l2_population = True
enable_distributed_routing = True
ON!!
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Non-DVR/DVR VM間の通信パターン比較
サブネット ノード(ハイパーバイザー) Non-DVR DVR
同じ 同じ 仮想スイッチ 仮想スイッチ
同じ 違う トンネル トンネル
違う 同じ Network Node経由 DVR on Compute Node
違う 違う Network Node経由 DVR on Compute Node
Floating IP Network Node経由 DVR on Compute Node
Source NAT Network Node経由 Network Node経由
Compute Node Compute Node
Network Node
VM VM
Router
外部
Compute Node Compute Node
Network Node
VM VM
外部
DVR_SNAT
DVR DVR
Non-DVR DVR
破線: SNAT
East/West通信増大傾向の中、
特にうれしい
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
なぜSNAT通信だけがNetwork Nodeに残ったのか?
[openstack-dev] [Neutron] DVR SNAT shortcuthttp://lists.openstack.org/pipermail/openstack-dev/2014-July/039288.html
•技術的には個々のCompute NodeでSNATするオプションも実装できる
•ただし議論があったため、実装は今後
– 否定派の意見
•Compute NodeごとにSNAT用外部向けIPアドレスを消費する
–でもFloating IPをそれなりに用意できるような環境であれば、問題ではないかも…
•セキュリティや監査、文化の問題で、外部通信はCompute Nodeに分散させたくない
–でもFloating IPを使った外部向け通信はDVRで分散しているので、矛盾してるかも…
ここからさらに細かくなります
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Neutronの主要登場人物 (Non-DVR)
Network Node
Compute Node
Neutron Server
API
ML2 Plugin
MetadataAgent
Nova Metadata
DHCPAgent
OVSAgent
OVS
OVSAgent
OVS
DB
L3Agent
MessageQueue
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Neutronの主要登場人物 (DVR)
Network Node
Compute Node
Neutron Server
API
ML2 Plugin
MetadataAgent
Nova Metadata
DHCPAgent
OVSAgent
OVS
OVS Agent(DVR)
OVS
DB
L3Agent
MessageQueue
Nova Metadata
L3 Agent (DVR)
MetadataAgent
DVRのポイント
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Compute NodeDVRの正体
• L3
– Linux namespaceとLinux iptablesの組み合わせ
– namespaceがテナント分離を実現
•テナント(プロジェクト)毎にnamespaceができる
•ノード毎にFloating IP namespaceができる
– iptablesがフォワーディング、NATを行う
• L2
– Open vSwitch
– Integration bridge(br-int)とTunnel Bridge(br-tun)へDVR関連ルールを書き込む
– DVR-MACアドレスを活用してフロー制御
– L2 Populationがarpテーブルへ他ノードVMのmacアドレスを登録
br-int
br-tun
VM
InternalRouter
他ノード
br-ex
外部ネットワーク
Floating IPNamespace
Tenant Namespaces
Rules
Rules
DVR-MAC
DVR-MAC
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
IR
Compute Node1
VM1
br-int-cn1
br-tun-cn1
Compute Node 2
VM2
br-int-cn2
br-tun-cn2
DVRで最も熱いパターン: サブネットまたぎのノード間通信
IR
VXLAN or GRE Tunnel
Subnet P(Purple)
Subnet B(Blue)
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
IRIR
Compute Node1
VM1
br-int-cn1
br-tun-cn1
Compute Node 2
VM2
br-int-cn2
br-tun-cn2
VM1からVM2への通信は、このような経路をたどる
Subnet P(Purple)
Subnet B(Blue)
送信側ノードはIRを通る
受信側ノードはIRを通らない
VXLAN or GRE Tunnel
でも、ローカルIRから受信したように認識する
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
IRIR
Compute Node1
VM1
br-int-cn1
br-tun-cn1
Compute Node 2
VM2
br-int-cn2
br-tun-cn2
パケットの旅①
①
①VM1からInternal RouterのPインターフェイスへ
srcMAC = VM1, destMAC= IR-P, srcIP = VM1, dstIP = VM2
Subnet P(Purple)
Subnet B(Blue)
VXLAN Tunnel
とりあえずDefault GWへ
IR-P
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
IRIR
Compute Node1
VM1
br-int-cn1
br-tun-cn1
Compute Node 2
VM2
br-int-cn2
br-tun-cn2
パケットの旅②
②
②Internal RouterのBインターフェイスからbr-int-cn1, br-tun-cn1へ
srcMAC = IR-B, destMAC = VM2, srcIP = VM1, dstIP = VM2
Subnet P(Purple)
Subnet B(Blue)
VXLAN Tunnel
ARPテーブルを見て、dstMACをセット
IR-B
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
IRIR
Compute Node1
VM1
br-int-cn1
br-tun-cn1
Compute Node 2
VM2
br-int-cn2
br-tun-cn2
パケットの旅③
③
③br-tun-cn1でVNI付与、srcMACをDVR-MACへ変換
VNI = B, srcMAC = DVR-MAC-CN1, destMAC = VM2, srcIP = VM1, dstIP = VM2
VXLAN Tunnel
Subnet P(Purple)
Subnet B(Blue)
VXLANの旅支度とDVR-MACの指定
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
IRIR
Compute Node1
VM1
br-int-cn1
br-tun-cn1
Compute Node 2
VM2
br-int-cn2
br-tun-cn2
パケットの旅④
④
④br-tun-cn2でVNI削除、ローカルVLANタグを付与
VLAN = B, srcMAC = DVR-MAC-CN1, destMAC = VM2, srcIP = VM1, dstIP = VM2
VXLAN Tunnel
Subnet P(Purple)
Subnet B(Blue)
br-intでフロー制御できるように準備
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
IRIR
Compute Node1
vm1
br-int-cn1
br-tun-cn1
Compute Node 2
vm2
br-int-cn2
br-tun-cn2
パケットの旅⑤
⑤
⑤br-int-cn2でローカルVLANタグを削除、srcMACをIR-Bへ
srcMAC = IR-B, destMAC = VM2, srcIP = VM1, dstIP = VM2
VXLAN Tunnel
Subnet P(Purple)
Subnet B(Blue)
srcのDVR-MACを変換しIR-Bが送信したように見せる
IR-B
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
再掲: Non-DVR/DVR VM間の通信パターン比較
サブネット ノード(ハイパーバイザー) Non-DVR DVR
同じ 同じ 仮想スイッチ 仮想スイッチ
同じ 違う トンネル トンネル
違う 同じ Network Node経由 DVR on Compute Node
違う 違う Network Node経由 DVR on Compute Node
Floating IP Network Node経由 DVR on Compute Node
Source NAT Network Node経由 Network Node経由
Compute Node Compute Node
Network Node
VM VM
Router
外部
Compute Node Compute Node
Network Node
VM VM
外部
DVR_SNAT
DVR DVR
Non-DVR DVR
破線: SNAT
East/West通信増大傾向の中、
特にうれしい
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
制約と展望
•DHCP AgentはNetwork Nodeに残る
– 可用性を高めるには、Network Nodeで複数起動する
– neutron.confの dhcp_agents_per_network = X
•今後DVR RouterとHA Routerは統合される予定
– L3 リファクタリングとも関連
•L3の“Technical debt(技術的負債)”を返済しつつ、機能統合を進めたい
•リファクタリングの議論
–https://review.openstack.org/#/c/131535/4/specs/kilo/restructure-l3-agent.rst
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
参考資料
•Neutron/DVR
– https://wiki.openstack.org/wiki/Neutron/DVR
•Neutron/DVR L2 Agent (フロー制御を見たい人へおすすめ)
– https://wiki.openstack.org/wiki/Neutron/DVR_L2_Agent
• Introduced in the Juno Release of OpenStack Neutron
– http://www.slideshare.net/carlbaldwin/dvr-slides
•DVR Demo
– https://www.youtube.com/watch?v=p4BwAjLHd0M
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Thank you
Twitter: tmak_tw