Top Banner
Copyright©2015 NTT corp. All Rights Reserved. Bird in ShowNet SDN/NFV: Lagopus & VNF with Vhost 2016/06/09 hibitomo 1
33

Bird in show_net

Jan 07, 2017

Download

Software

Tomoya Hibi
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

Bird in ShowNet

SDN/NFV: Lagopus & VNF with Vhost

2016/06/09

hibitomo

1

Page 2: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

Agenda

- Bird in ShowNet

- FPGA + Lagopus + VNF

- Lagopus設定のポイント

- コアアサイン

- Flow設計

- 簡易性能評価

- 副産物 lagopus-tools

- ansible

- lago-dsl

- lago-mon

Page 3: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

Bird in ShowNet

- 今年はここに居ました.

引用:https://www.facebook.com/interop.shownet

Page 4: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

VNF(VirNOS) + Lagopus + FPGA

- 処理はFPGA、転送はLagopus

- NetFPGA-SUME

- IPアドレスからハッシュを計算

- ハッシュ値にもとづいて転送先のVMの目印をSrc MACに書き込む(256種類)

- LagopusはSrc MAC値に応じてVMへ転送

4

HV VNF VNF VNF

lagopus

lagopus

uplink

downlink

hash計算とMACへの埋め込み

MACにもとづいてVMへ送信(staticな

flow entry)

Page 5: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

今回接続したVNF

• VirNOS

• IP infusion のコントリビュート

• vRouter/vCPE solutionのVNF

• DPDKが利用可能.

• High performanceモードとTinyモード等の動作モード

• 今回はTinyモードのVirNOSをDPDKでLagopusと接続

5

Page 6: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved. 6

Page 7: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

Challenges

- ホストのLagopus(DPDK)とゲストのVirnos(DPDK)の接続

- 多ポート設定と負荷分散(ShowNetでは8台に分散.ポート数は計18)

7

HV VirNOS VirNOS VirNOS VirNOS

lagopus

lagopus

port2

port4 port6 port8 port10

port9 port7 port5 port3

port1

Eth0

Eth1

Eth0

Eth1

Eth0

Eth1

Eth0

Eth1

Page 8: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

Agenda

- Bird in ShowNet

- FPGA + Lagopus + VNF

- Lagopus設定のポイント

- コアアサイン

- Flow設計

- 簡易性能評価

- 副産物 lagopus-tools

- ansible

- lago-dsl

- lago-mon

Page 9: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

設定のポイント: コアアサイン

- NUMAを意識したLagopusとVNFでコアアサインを設計する.

- パケット・処理の流れを考える

NIC

CPU CPU Memory Memory

NIC

NIC NIC

QPI

PCI-Exp PCI-Exp

Reference: supermicro X9DAi

Page 10: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

設定のポイント: コアアサイン(LagopusとVNF)

- NUMAを意識したLagopusとVNFでコアアサインを設計する.

- パケット・処理の流れを考える

メモリ メモリ

NIC

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

CPU0 CPU1

トラフィック

Page 11: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

設定のポイント: コアアサイン(LagopusとVNF)

- NUMAを意識したLagopusとVNFでコアアサインを設計する.

- パケット・処理の流れを考える

メモリ メモリ

NIC

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

CPU0 CPU1

トラフィック

Lagopus VirNOS

(tiny mode) × 8

Page 12: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

設定のポイント: コアアサイン(LagopusとVNF)

- NUMAを意識したLagopusとVNFでコアアサインを設計する.

- パケット・処理の流れを考える

メモリ メモリ

NIC

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

CPU0 CPU1

トラフィック

Lagopus VirNOS

(tiny mode) × 8

Page 13: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

設定のポイント: コアアサイン(LagopusとVNF)

- NUMAを意識したLagopusとVNFでコアアサインを設計する.

- パケット・処理の流れを考える

メモリ メモリ

NIC

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

CPU0 CPU1

トラフィック

Lagopus VirNOS

(tiny mode) × 8

Page 14: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

設定のポイント: コアアサイン(LagopusとVNF)

- NUMAを意識したLagopusとVNFでコアアサインを設計する.

- パケット・処理の流れを考える

メモリ メモリ

NIC

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

CPU0 CPU1

トラフィック

Lagopus VirNOS

(tiny mode) × 8

Page 15: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

設定のポイント: コアアサイン(LagopusとVNF)

- コアアサインを間違えると性能は半減する

- 横須賀で測定を実施.1500byte, Lagopusはデフォルトのコアアサイン

19

メモリメモリ

NIC

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

CPU0 CPU1

トラフィック

LagopusVNF × 8

メモリメモリ

NIC

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

core

CPU0 CPU1

トラフィック

Lagopus VNF× 8約4.4Gbps

約10Gbps

2倍以上の差

Page 16: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

HV VirNOS VirNOS VirNOS VirNOS

lagopus

lagopus

port2

port4 port6 port8 port10

port9 port7 port5 port3

port1

Eth0

Eth1

Eth0

Eth1

Eth0

Eth1

Eth0

Eth1

設定のポイント: コアアサイン(LagopusのI/O)

- Pollingでパケットの監視,転送を行うため,ポートが増えるほど性能が落ちる.

- 今回のアーキテクチャでは物理NICへのトラフィックの偏りが顕著

20

10/4 Gbps 10Gbps

Page 17: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

HV VirNOS VirNOS VirNOS VirNOS

lagopus

lagopus

port2

port4 port6 port8 port10

port9 port7 port5 port3

port1

Eth0

Eth1

Eth0

Eth1

Eth0

Eth1

Eth0

Eth1

設定のポイント: コアアサイン(LagopusのI/O)

- トラフィックの偏りを考慮したコアアサインを行う

- ShowNetでは4コアをI/Oに利用.下図の様に割り当てた

21

10Gbps

10Gbps

5Gbps 5Gbps

Page 18: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

Lagopus設定のポイント(フロールール)

- 256種類のsrc MACをマッチする必要がある.uplinkとdownlinkがあるため,srcMACのExact matchのルールが512種類必要.

- Hash値は下位1byteに埋め込まれ,平等に分散されていることが期待できるので,Maskを用いて下位3bitだけ見るルールに変更することができる.するとルール数は16種類に削減できる.

22

in_port dl_src action

1 52:54:00:00:00:01 1

1 52:54:00:00:00:02 2

… … …

1 52:54:00:00:00:FF X

in_port dl_src action

1 **:**:**:**:**:*0 1

1 **:**:**:**:**:*1 2

… … …

1 **:**:**:**:**:*7 7

Page 19: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

Agenda

- Bird in ShowNet

- FPGA + Lagopus + VNF

- Lagopus設定のポイント

- コアアサイン

- Flow設計

- 簡易性能評価

- 副産物 lagopus-tools

- ansible

- lago-dsl

- lago-mon

Page 20: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

性能評価(参考情報)

- いろいろな機器を通っているため,参考情報です.

- トラフィックのボトルネックがLagopusであることは確認済

- 東京テクニカさんにご協力頂きました

24

Page 21: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

性能評価(参考情報)

- テスターの値をグラフ化.

- Lagopusには物理->VNFとVNF ->物理NICでトラフィックが2倍かかっている

25

[byte]

[Mbps]

0

1000

2000

3000

4000

5000

6000

7000

8000

9000

10000

0 200 400 600 800 1000 1200 1400

wire rate

lagopus

パケットサイズ

トラフィック量

Page 22: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

Agenda

- Bird in ShowNet

- FPGA + Lagopus + VNF

- Lagopus設定のポイント

- コアアサイン

- Flow設計

- 簡易性能評価

- 副産物 lagopus-tools

- ansible

- lago-dsl

- lago-mon

Page 23: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

副産物:lagopus-tools

• 元々はインターン生に作らせたAnsibleとRyuのサンプル置き場

• Lagopusが関連するトラブルがほぼなかったため,待ち時間でツールを作成

• 突貫で作ったコードなので,とりあえずfork先しか更新しておりません

• fork先: https://github.com/hibitomo/lagopus-tools

~/lagopus-tools$ ls ansible examples lago-dsl lago-mon LICENSE README.md

Page 24: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

副産物:ansible

- v0.2.4から旧playbookが使えなくなっていた

- 今回,最新のLagopus用に更新.ついでに機能追加.

- 新機能

- DSLの自動生成

- 実行スクリプト自動生成 (vhost, pcap, pipeのvdevにも対応)

- 新ansibleサンプル

- Lagopus - VMを接続するサンプル(qemuの起動スクリプトも生成)

Page 25: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

副産物:lago-dsl

• lagopusのDSLを直接叩くスクリプト.

• デバッグ用途以外の使用は推奨しない.

• 直接,flow,interface等の編集をすることができる.

• 実行

$ ./lago-dsl.py [lagopus DSL]

$ ./lago-dsl.py < [lagopus DSL file]

Page 26: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

副産物:lago-mon

- Lagopus用モニタリングツール

- 動作確認の為に`lagosh -c show xxx` を連打してカウンタの差分を目grepするのは辛い.

- logを取る為に`lagosh -c show xxx`を定期的に実行して,整形済みjsonを一行に戻すのは手間.

- 16 x 16ドットのロゴ

- プロトタイプのファイル名がlagomon.pyだった.作るしか無いと思った.後悔はしていない.

ラゴモン(成長期)

Page 27: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

副産物:lago-mon

- Lagopus用モニタリングツール

- 動作確認の為に`lagosh -c show xxx` を連打してカウンタの差分を目grepするのは辛い.

- logを取る為に`lagosh -c show xxx`を定期的に実行して,整形済みjsonを一行に戻すのは手間.

- 16 x 16ドットのロゴ

- プロトタイプのファイル名がlagomon.pyだった.作るしか無いと思った.後悔はしていない.

- AA版もあります.( 15 x 36 )

######## ## ;;;; ## ## #### ## #### ## ## ## #### ##### ######## ## ############## ## ## ### ######## ## ## #### ## ## ## #### ## #### ## ## ## ## ## ###### #### #### #### #### ########## #################### mmmm ## ##########

ラゴモン(成長期)

Page 28: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

副産物:lago-mon/ifstats-monitor.py

- 実行(指定間隔でJSONを出力するだけ)

- 出力例

{"timestamp": "2016-06-08T14:13:04.253669", "interfaces": {"interface1": {"name": "interface1", "rx-dropped": 0, "tx-errors": 0, "rx-bytes": 0, "tx-packets": 0, "rx-packets": 0, "tx-bytes": 0, "rx-errors": 0, "tx-dropped": 0}, "interface0": {"name": "interface0", "rx-dropped": 0, "tx-errors": 0, "rx-bytes": 0, "tx-packets": 0, "rx-packets": 0, "tx-bytes": 0, "rx-errors": 0, "tx-dropped": 0}}}

$ ./ifstats_monitor.py -l 10 間隔 [sec]

Page 29: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

副産物:lago-mon/ifstats-monitor.py

- 実行(moniter.強いリクエストにより,bpsとppsを表示)

- 出力例

2016/06/08 14:22:49 +------------+------------------+--------------+------------------+--------------+ | name | rx-bps | rx-pps | tx-bps | tx-pps | +------------+------------------+--------------+------------------+--------------+ | interface0 | 0 | 0 | 0 | 0 | | interface1 | 0 | 0 | 0 | 0 | +------------+------------------+--------------+------------------+--------------+

$ ./ifstats_monitor.py -m 10 更新間隔 [sec]

Page 30: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

副産物:lago-mon/flowstats-monitor.py

- 実行(指定間隔でJSONを出力するだけ)

- 出力例

{"timestamp": "2016-06-08T14:25:44.853720", "flows": {"bridge01": {"tables": [{"table": 0, "flows": [{"stats": {"packet_count": 0, "byte_count": 0}, "hard_timeout": 0, "actions": [{"apply_actions": [{"output": 2}]}], "priority": 100, "idle_timeout": 0, "cookie": 0, "in_port": 1}, {"stats": {"packet_count": 0, "byte_count": 0}, "hard_timeout": 0, "actions": [{"apply_actions": [{"output": 1}]}], "priority": 100, "idle_timeout": 0, "cookie": 0, "in_port": 2}]}], "name": "bridge01"}}}

$ ./flowstats_monitor.py -l 10 間隔 [sec]

Page 31: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

副産物:lago-mon/flowstats-monitor.py

- 実行(moniter.同一フローの識別が不可能な為,bps, ppsは無い.)

- 出力例

2016/06/08 14:27:45 bridge01, table: 0 +----------+--------+--------------+------------+----------------+--------------------------------------+--------------+--------------+ | priority | cookie | packet_count | byte_count | data | actions | hard_timeout | idle_timeout | +----------+--------+--------------+------------+----------------+--------------------------------------+--------------+--------------+ | 100 | 0 | 0 | 0 | {"in_port": 2} | [{"apply_actions": [{"output": 1}]}] | 0 | 0 | | 100 | 0 | 0 | 0 | {"in_port": 1} | [{"apply_actions": [{"output": 2}]}] | 0 | 0 | +----------+--------+--------------+------------+----------------+--------------------------------------+--------------+--------------+

$ ./flowstats_monitor.py -m 10 更新間隔 [sec]

Page 32: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

まとめ

- Bird in ShowNet

- LagopusとDPDKでVMに接続

- LagopusとFPGAでVMにロードバランス

- 副産物(lagopus-tools)

- ansible

- lago-dsl.py

- lago-mon

Page 33: Bird in show_net

Copyright©2015 NTT corp. All Rights Reserved.

ご清聴ありがとうございました

37

########## ;;;; #### #### ##

#### #### ## ####

##### ######## ################ ## ##

### ######## ## ###### ## ## ## #### ###### ## ## ## ## ##

###### #### ######## #### ##########

####################mmmm ############