Open contrail days 2014 fall

49
OpenContrail Days 2014 Fall Daisuke Nakajima Systems Engineer

description

OpenContrail tech doc in Japanese 1.Routing architecture and implementation 2.Service chaining architecture and implementation 3.Neutron router with OpenContrail 4.HA walk

Transcript of Open contrail days 2014 fall

Page 1: Open contrail days 2014 fall

OpenContrail Days 2014 Fall

Daisuke Nakajima

Systems Engineer

Page 2: Open contrail days 2014 fall

本日の内容

Source: https://tools.ietf.org/html/draft-ietf-l3vpn-end-system-04

• Contrailのルーティング

• サービスチェイニングの実装

• ContrailとNeutron Router

• ContrailのHA

Page 3: Open contrail days 2014 fall

Contrailのルーティング

Page 4: Open contrail days 2014 fall

基本的な通信の仕組みBGPベースのVPN

Source: https://tools.ietf.org/html/draft-ietf-l3vpn-end-system-04

• BGP

• インターネットゲートウェイ、L3VPN PEやRoute reflector

• Route-Server• XMPP経由でEnd-systemへルート情報などを送信

• End-System• ハイパーバイザ上のVPN Data

Forwarder

Page 5: Open contrail days 2014 fall

基本的な通信の仕組みRFC Draft を Contrailにあてはめる

SDNコントローラーConfiguration

コントローラー

Configuration Analytics

Control

仮想マシン

VM VM

仮想マシン

VM VM VA物理ネットワーク

XMPP XMPPBGP

オーケストレータ

Internet VPN網

REST

BGP

BGP

vRoutervRouter

VA

ゲートウェイルータ

ハイパーバイザー ハイパーバイザー

• BGP• ゲートウェイルータ

• Route-Server• Control Node

• End-System• VRouter

Page 6: Open contrail days 2014 fall

Contrailのルーティングテーブル

• Contrailは仮想ネットワーク毎にVRFを作成し、RTをアサイン

基本的な考え方

VMG1

VMG2

GreenVirtual Network

VMR1

VMR2

RedVirtual Network

vRouter

VMG1

VMG2

VMR1

VMR2

RT:64512:800001

172.16.1.0/24

172.16.1.2 NH: Comp1 L:1

172.16.1.3 NH: Comp2 L:2

RT:64512:800002

172.16.2.0/24

172.16.2.2 NH: Comp1 L:3

172.16.2.3 NH: Comp2 L:4

Page 7: Open contrail days 2014 fall

Contrailのルーティングテーブルルーティング確認の例

• WebUIからControlノードのRoute情報を確認• VM毎にLabelが割り当てられる(ラベルはコンピュートノードごと)

Page 8: Open contrail days 2014 fall

vRouter

1 2

VMG1

VMG2

VMR1

VMR2

Contrailのルーティングテーブル異なる仮想ネットワーク間の通信

VMG1

VMG2

VMG3

GreenVirtual Network

VMR1

VMR2

VMR3

RedVirtual Network

• VRF間でルーティング情報をリーク

リーク!

RT:64512:800001

172.16.1.0/24

172.16.1.2 NH: Comp1 L:1

172.16.1.3 NH: Comp2 L:2

RT:64512:800002

172.16.2.2 NH: Comp1 L:3

172.16.2.3 NH: Comp2 L:4

RT:64512:800002

172.16.2.0/24

172.16.2.2 NH: Comp1 L:3

172.16.2.3 NH: Comp2 L:4

RT:64512:800001

172.16.1.2 NH: Comp1 L:1

172.16.1.3 NH: Comp2 L:2

Page 9: Open contrail days 2014 fall

ContrailのルーティングテーブルPolicyの設定

• VN1-VN2を通信できるようにPolicyを設定する

Page 10: Open contrail days 2014 fall

Contrailのルーティングテーブルルーティング確認の例

• WebUIからControlノードのRoute情報を確認• VM毎にLabelが割り当てられ、VN1のルーティングテーブルにVN1とVN2が確認できる

Page 11: Open contrail days 2014 fall

Contrailのルーティングテーブル

• 内部IPアドレスをvRrouteでFloating IPに付け替え(NAT)

• Floating IPの仮想ネットワークにもRTを設定

ゲートウェイルータとの通信

VMG1

VMG2

GreenVirtual Network vRouter

VMG1

VMG2

RT:64512:800001

172.16.1.0/24

172.16.1.2

172.16.1.3

RT:64512:10000

203.0.113.0/24

FIP:203.0.113.1

FIP:203.0.113.2

Internet

Internet VPN網

Floating IP

VRF : Public

RT 64512:10000

public.inet.0

203.0.113.1/32 nexthop 10.0.0.1

203.0.113.2/32 nexthop 10.0.0.2

0.0.0.0/0 nexthop Internet

Page 12: Open contrail days 2014 fall

サービスチェイニングの実装

Page 13: Open contrail days 2014 fall

サービスチェイニングの実装方法メタデータ方式とルーティング方式

• メタデータ方式• Network Service Headerをパケットに挿入してサービスチェインを実装

• draft-quinn-sfc-nsh

• draft-zhang-sfc-schなど

• ルーティング方式• ルーティングを制御してECMP/対象ルーティングなサービスチェインを実装

• draft-Mackie-sfc-uting-virtual-networking

• その他のRFC• https://datatracker.ietf.org/wg/sfc/documents/

Page 14: Open contrail days 2014 fall

Contrailのサービスチェイニング仮想サービスが1つの場合

VMG1

VMG2

VMG3

GreenVirtual Network

VMR1

VMR2

VMR3

RedVirtual Network

• VRF間でルーティング情報をリーク

vRouter

1 2

VMG1

VMG2

VMR1

VMR2

RT:64512:800001

172.16.1.0/24RT:64512:800002

172.16.2.0/24

3 4

ControlノードでRouting情報を確認すると、あて先ネットワークのProtocolがServiceChainに変わる

RT:64512:800001

172.16.1.0/24

172.16.1.2 NH: Comp1 L:1

172.16.1.3 NH: Comp2 L:2

RT:64512:800003

172.16.2.2 NH: SC L:5

172.16.2.3 NH: SC L:5

RT:64512:800002

172.16.2.0/24

172.16.2.2 NH: Comp1 L:3

172.16.2.3 NH: Comp2 L:4

RT:64512:800004

172.16.1.2 NH: SC L:6

172.16.1.3 NH: SC L:6

Page 15: Open contrail days 2014 fall

Contrailのサービスチェイニングサービスチェイニング適用前(VN1のルーティングテーブル)

• Next HopはVMのLabel

仮想サービスのIPアドレス

Page 16: Open contrail days 2014 fall

Contrailのサービスチェイニングサービスチェイニング適用後(VN1のルーティングテーブル)

• NextHopが10.84.50.5ラベルがLabel 20になっている

仮想サービスのIPアドレス

Page 17: Open contrail days 2014 fall

Contrailのサービスチェイニング仮想サービスが複数場合

VMG1

VMG2

VMG3

GreenVirtual Network

VMR1

VMR2

VMR3

RedVirtual Network

vRouter

1

VMG1

VMG2

3

RT:64512:800001

172.16.1.1

172.16.1.2

RT:64512:800003

172.16.2.1

172.16.2.2

5 6 2

VMR1

VMR2

RT:64512:800003

172.16.2.1

172.16.2.2

RT:64512:800001

172.16.1.1

172.16.1.2

4

RT:64512:800004

172.16.1.1

172.16.1.2

RT:64512:800005

172.16.2.1

172.16.2.2

RT:64512:800005

172.16.2.1

172.16.2.2

RT:64512:800004

172.16.1.1

172.16.1.2

RT:64512:800005

172.16.1.1

172.16.1.2

RT:64512:800006

172.16.2.1

172.16.2.2

RT:64512:800006

172.16.2.1

172.16.2.2

RT:64512:800002

172.16.1.1

172.16.1.2

RT:64512:800001

172.16.1.0/24

RT:64512:800002

172.16.2.0/24

• 仮想サービスのleft/rightインターフェイス毎にVRFを作成

Page 18: Open contrail days 2014 fall

Contrailのサービスチェイニング複数サービスチェイニング適用後(NFV間のルーティングテーブル)

• NextHopが10.84.50.5ラベルがLabel 20になっている

Page 19: Open contrail days 2014 fall

Contrailのサービスチェイニング複数サービスインスタンスを使う場合

VMG1

VMG2

VMG3

GreenVirtual Network

VMR1

VMR2

VMR3

RedVirtual Network

• Next Hopが複数作成され、ECMPで通信

RT:64512:800001

172.16.1.0/24

RT:64512:800002

172.16.2.0/24

ControlノードでRouting情報を確認すると、ServiceChainの経路が2つできている

vRouter

1

VMG1

VMG2

2

VMR1

VMR2

3 4

RT:64512:800001

172.16.1.0/24

172.16.1.1 NH: Comp1 L:1

172.16.1.2 NH: Comp2 L:2

RT:64512:800003

172.16.2.1 NH: SC L:5

NH: SC L:7

172.16.2.2 NH: SC L:5

NH: SC L:7

RT:64512:800002

172.16.2.0/24

172.16.2.1 NH: Comp1 L:3

172.16.2.2 NH: Comp2 L:4

RT:64512:800004

172.16.1.1 NH: SC L:6

NH: SC L:8

172.16.1.2 NH: SC L:6

NH: SC L:8

Page 20: Open contrail days 2014 fall

Contrailのサービスチェイニング複数サービスインスタンス適用後(VN1のルーティングテーブル)

• NextHopが10.84.50.5ラベルがLabel 20になっている仮想サービスの

IPアドレス

Page 21: Open contrail days 2014 fall

Contrailのサービスチェイニング複数サービスインスタンス適用後(仮想サービスの状態)

• VN1とVN2には同じIPアドレスが割り当てられている

Page 22: Open contrail days 2014 fall

ContrailとNeutron Router

Page 23: Open contrail days 2014 fall

ContrailとNeutron Router

• Neutron Router• 仮想ネットワーク間の通信を許可

• 外部ネットワーク通信時に仮想ネットワークの送信元IPアドレスを、Neutron RouterのExternal GatewayのIPアドレスでNAT

Neutron routerの機能Internet

Neutron Router

VMR1

VMG1

VMG1

VMR1

Gateway Router

Page 24: Open contrail days 2014 fall

ContrailとNeutron Router

• neutron router-interface-add

• 追加された仮想ネットワーク間はルートがリークされ、通信が可能になる

• ただし、異なるテナントのNeutron Routerとは通信できない。

ContrailのRouter内通信Neutron Router1

VMG1

VMG2

VMR1

VMR2

Neutron Router2

VMG1

VMG2

VMR1

VMR2

Page 25: Open contrail days 2014 fall

Compute Node

ContrailとNeutron Router

• SNAT用のnetwork namespaceを作成• コンピュートノードにnamespaceを切り、パケットを転送。NamespaceのEgressでNAT

• vRouterとnamespace間はvethで接続

• 仮想ネットワークと外部ネットワーク間にLSN用のIPアドレスを使用

ContrailのSNAT実装

1 3

VMG1

VMG2

Internet VPN網

ゲートウェイルータ

2

Network namespace NAT203.0.133.1

100.64.0.0/29

RT:64512:800001

192.168.1.0/24

192.168.1.1 NH: Comp1 L:1

192.168.1.2 NH: Comp2 L:2

RT:64512:800002

0.0.0.0/32 NH: Static Name

space L:3

RT:64512:800002

0.0.0.0/32 NH: Static (SC) L:3

RT:64512:800001

192.168.1.0/24

192.168.1.1 NH: Comp1 L:1

192.168.1.2 NH: Comp2 L:2

RT:64512:10000

0.0.0.0/32 NH: Gateway L:4

203.0.133.1 NH: Comp1 L:5

3

192.168.1.0/24

203.0.113.0/24

Page 26: Open contrail days 2014 fall

ContrailとNeutron Router

• network namespaceの冗長化• 異なるコンピュートノードに1つずつNAT用network namespaceを作成

• Local Prefで重み付けし、Act/Stbを実現

ContrailのSNAT実装

SV2Network namespace

Standby

SV1Network namespace

Active

VMG1

VMG2

100.64.0.0/29

100.64.0.1 203.0.113.1 100.64.0.1 203.0.113.10.0.0.0/0 NH 100.64.0.1/32

SV1 Local Pref 200

0.0.0.0/0 NH 100.64.0.1/32

SV2 Local Pref 100

203.0.113.1 NH 100.64.0.1/32

SV1 Local Pref 200

203.0.113.1 NH 100.64.0.1/32

SV2 Local Pref 100

Page 27: Open contrail days 2014 fall

ContrailとNeutron Router

• network namespaceの冗長化• ActのNamespaceがダウンした場合、Local Prefの小さい経路がルーティングテーブルに載り、Stb経由でSNATを継続

ContrailのSNAT実装

SV2Network namespace

Standby

SV1Network namespace

Active

VMG1

VMG2

100.64.0.0/29

100.64.0.1 203.0.113.1 100.64.0.1 203.0.113.10.0.0.0/0 NH 100.64.0.1/32

SV2 Local Pref 100 203.0.113.1 NH 100.64.0.1/32

SV2 Local Pref 100

Page 28: Open contrail days 2014 fall

Contrail ControllerのHigh Availability

Page 29: Open contrail days 2014 fall

Contrail ControllerのHigh Availability

• Controllerの冗長化は• Config Node

• Control Node

• Analytics Node

• DB Node• Cassandra

• Zookeeper

• この中で、IPアドレス冗長が必要なのはConfig Node

全体図

Source: http://www.opencontrail.org/opencontrail-quick-start-guide/

Page 30: Open contrail days 2014 fall

Contrail ControllerのHigh Availability

• REST API Server• IPアドレス/サーバ冗長が必要

• IF-MAP Server• サーバ冗長が必要

• Schema Transformer• サーバ冗長が必要

• Service Monitor• サーバ冗長が必要

• Discovery Server• IPアドレス/サーバ冗長が必要

• RabbitMQ• IPアドレス/クラスター化が必要

Config Nodeの構成

HA proxyHA proxyKeepalived

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Discovery Server

Service Monitor

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Discovery Server

Service Monitor

Control Node Control Node

Page 31: Open contrail days 2014 fall

ContrailのHigh Availability

• REST APIにデータを送信• HA ProxyはREST API Serverにデータを送信

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 32: Open contrail days 2014 fall

ContrailのHigh Availability

• データの保存• Cassandraにデータを保存

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 33: Open contrail days 2014 fall

ContrailのHigh Availability

• Rabbit MQにメッセージを送信• Notification Messageを送信する

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 34: Open contrail days 2014 fall

ContrailのHigh Availability

• クラスタにMSGをコピー• RabbitMQクラスタ内にメッセージをコピー

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 35: Open contrail days 2014 fall

ContrailのHigh Availability

• MSGを取得• REST API ServerはRabbitMQからNotification Messageを取得

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 36: Open contrail days 2014 fall

ContrailのHigh Availability

• データを取得• Cassandraから先ほど保存したデータを取得

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 37: Open contrail days 2014 fall

ContrailのHigh Availability

• IF-MAP Serverへデータ送信• IF-MAP Serverはデータをメモリ上に保存

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 38: Open contrail days 2014 fall

ContrailのHigh Availability

• Schema Transformerがデータを取得• ActiveなSchema Transformerは

IF-MAP Serverから処理するデータを取得

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 39: Open contrail days 2014 fall

ContrailのHigh Availability

• 処理したデータをREST API Serverに送信• HA Proxy 経由でREST API

Serverにデータを送信

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 40: Open contrail days 2014 fall

ContrailのHigh Availability

• データの保存• Cassandraにデータを保存

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 41: Open contrail days 2014 fall

ContrailのHigh Availability

• Rabbit MQにメッセージを送信• Notification Messageを送信する

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 42: Open contrail days 2014 fall

ContrailのHigh Availability

• クラスタにMSGをコピー• RabbitMQクラスタ内にメッセージをコピー

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 43: Open contrail days 2014 fall

ContrailのHigh Availability

• MSGを取得• REST API ServerはRabbitMQからNotification Messageを取得

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 44: Open contrail days 2014 fall

ContrailのHigh Availability

• データを取得• Cassandraから先ほど保存したデータを取得

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 45: Open contrail days 2014 fall

ContrailのHigh Availability

• IF-MAP Serverへデータ送信• IF-MAP Serverはデータをメモリ上に保存

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 46: Open contrail days 2014 fall

ContrailのHigh Availability

• Control Nodeにデータを送信• Control NodeはIF-MAP Serverからデータを受信

Config Nodeの処理の流れ

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Control Node Control Node

HA proxyHA proxyKeepalived

Page 47: Open contrail days 2014 fall

ContrailのHigh Availability

• Service MoniterとSchemaTransformerはStandbyからActiveへ昇格

• HA Proxyはノードダウンを検地し、対象サーバを切り離し

• Control Nodeは別のIF-MAP Serverに再接続

• REST-API ServerはCassandra

のデータを確認し、処理中のデータが残っている場合、再処理を行う

Config Nodeが障害になったら?

HA proxyHA proxyKeepalived

Configuration Node 1

REST API Server

Cassandrazookeeper

IF-MAPserver

RabbitMQ

Schema Transformer

Active

Discovery Server

Service Monitor

Configuration Node 2

REST API Server

IF-MAPserver

RabbitMQ

Schema Transformer

Standby

Discovery Server

Service Monitor

Control Node Control Node

Activeに昇格

Downになったサーバを切り離し

接続変更

DB整合性確認

Page 48: Open contrail days 2014 fall

Open Contrail活動報告

Page 49: Open contrail days 2014 fall

最近のOpenContrailの状況

• apt-get install でContrialがインストールできるようになりました• Openstack Havana / Icehouseに対応

• 対応OS 12.04 / 14.04

• OVSDBでToRスイッチをコントロール• OpenStack Summit in Paris でデモしました

• OpenContrailWikiのアップデート計画• fab のインストール方法の充実

• Server Managerの使い方

• ソフトウェアvGWの使用方法と解説