Openflowについて
2013年1月31日
ヤフー株式会社
ネットワーク 黒帯
松谷 憲文
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
2.
アジェンダ P2
1部 Openflowとは?
2部 相互接続検証
□Openflowコントローラ
Big Switch Netoworks
□Openflowスイッチ
Arista
Brocade
NEC
Pica8
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
3.
P3
1部 Openflowとは?
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
4.
Openflowとは? P4
Openflowコントローラ
ネットワーク機器1台に組み込まれていた
(コントロールプレーン)
コントロールプレーンとデータプレーンを分離し、
Openflowプロトコルによって情報を交換する
コントロールプレーン
Openflowプロトコル
データプレーン
Openflowスイッチ
(データプレーン)
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
5.
Openflowとは? P5
Openflowコントローラ
(コントロールプレーン)
Openflowプロトコルによって、
OpenflowコントローラとOpenflowスイッチ間で Openflowプロトコル
どんなMessageがやりとりされているのか?
Openflowスイッチ
(データプレーン)
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
Openflowとは? P7
Openflowコントローラ
OpenflowコントローラとOpenflowスイッチの間で
Messageをどのようにやり取りするのか、 Openflowプロトコル
順を追って見ていきたいと思います
Openflowスイッチ
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
8.
Openflowとは? セキュアチャンネル P8
Openflowコントローラ
とにかく初めは
セキュアチャンネルの確立
TCPで接続を行いSSL化なども出来る
セキュアチャンネルの確立
Openflowスイッチ
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
9.
Openflowとは? Hello P9
Openflowコントローラ
初期接続時にバージョンの
ネゴシエーションを行う
同一バージョンの場合は次のステップへ
Hello
Hello
Openflowスイッチ
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
10.
Openflowとは? Features P10
Openflowコントローラ
Features Request Datapath ID、ポート情報
Openflowスイッチの機能、
Openflowスイッチの などの情報を送信
スペックを問い合わせ
Features Reply
Openflowスイッチ
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
11.
Openflowとは? Packet in P11
Openflowコントローラ
Openflowスイッチが
パケットを受け取った際に、
パケットに対応するフローが無い場合
Openflowコントローラに
Packet inメッセージを送信
Packet in
パケットを送信 Openflowスイッチ
フローテーブルに無い
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
12.
Openflowとは? Flow mod P12
受信したパケット情報を
Openflowコントローラ
元にフローを作成し、
Openflowスイッチにフローエントリ
を書き込む
(リアクティブ型)
Flow mod
Openflowスイッチ
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
13.
Openflowとは? Packet out P13
Openflowコントローラ
Openflowスイッチのバッファに
保存されているパケットを送信
Packet out
Openflowスイッチ
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
14.
Openflowとは? フローとは? P14
どんな情報が
フローとして
Openflowスイッチに
送信されるの?
フローとは?
ヘッダフィールド
アクション
統計情報
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
15.
Openflowとは? フローの中身 P15
ヘッダフィールド 説明 区分 Counter
Per Table Active Entries
Ingress Port 物理ポート番号
Packet Lookups
Ether src 送信元MACアドレス
Packet Maches
Ether dst 宛先MACアドレス Per Flow Received Packets
Ether type イーサネットの種別 Received Bytes
VLAN id VLAN ID Duration(Seconds)
Durations(nanoseconds)
VLAN priority VLANのPCP
Per Port Received Packets
IP src 送信元IPアドレス
Transmitted Packets
IP dst 宛先IPアドレス Received Bytes
IP proto IPプロトコルの種別 Transmitted Bytes
IP ToS bits IPのToS情報 Received Drops
Transmit Drops
TCP/UDP src port 送信元ポート番号
Received Errors
TCP/UDP dst port 宛先ポート番号
Transmit Errors
Receive Frame Alignment Errors
アクション 説明 Receive Overrun Errors
Forward パケットを指定したポートへ転送する Receive CRC Eroors
Collisions
Modify-Field パケットの特定のフィールドを書き換える
Per Queue Transmit Packets
Drop パケットを破棄する
Transmit Bytes
Enqueue スイッチで設定されてるQueueに入れる Transmit Overrun Errors
上記情報をもとにフローを作成し、Openflowスイッチのフローテーブルに登録
フローテーブルの情報をもとに転送処理を行う Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
16.
Openflowとは? フローの仕組み P16
Openflowコントローラ
Ether srcが00:25:90:39:7b:f0
Ether dstが00:25:90:39:7b:f2
Ingress PortがPort0/1
Etc…
Packet in
Port0/1 Port0/2
00:25:90:39:7b:f0 Openflowスイッチ 00:25:90:39:7b:f2
Flow
(Flow tableに該当情報が無い状態)
Table
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
17.
Openflowとは? フローの仕組み P17
ヘッダフィールドが
Openflowコントローラ 「Ether dstに00:25:90:39:7b:f2」
等の時、アクションは
「Port0/2にForward」
というフローを※1Flow mod
によってFlow Tableに登録
Flow mod
Port0/1 Port0/2
00:25:90:39:7b:f0 Openflowスイッチ 00:25:90:39:7b:f2
Flow [Ether dst 00:25:90:39:7b:f2]→[Port 0/2にForward]
Table
※1実際はARPのBroadcastやunknown unicastなどのフラッディングが発生するが本資料では割愛
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
18.
Openflowとは? フローの仕組み P18
Openflowコントローラ
Openflowスイッチにバッファされていた
パケットはFlow Tableをもとに送信される
Packet out
Port0/1 Port0/2
00:25:90:39:7b:f0 Openflowスイッチ 00:25:90:39:7b:f2
Flow [Ether dst 00:25:90:39:7b:f2]→[Port 0/2にForward]
Table
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
19.
P19
2部 相互接続検証
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
20.
相互接続検証 P20
Big Switch Networksのコントローラを使用し、下記4台のopenflow対応スイッチを接続
Openflowコントローラ
Big Switch Networks
Pica8 Brocade NEC Arista
Pront3295 NetIron XMR4000 PF5240 7050S
Openflowスイッチ
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
21.
相互接続検証 P21
実験構成 下図のように接続しhop-by-hop方式を検証
※サーバが2台しか準備できなかったのでスイッチを挟んで対応
Big Switch
Networks
セキュアチャンネル用の
ネットワーク
Pica8 Brocade NEC Arista
tmp23 tmp24
Openflow用の
ネットワーク
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
相互接続検証 NEC設定 P24
Openflowのバージョン指定と
openflow openflow-id 1
protocol-version 01 コントローラの設定
controller controller-name bsn 255 10.222.176.171 port 6633 tcp
NEC
PF5240
dpid 0000000000000001 DPIDの設定
openflow-interface gigabitethernet 0/1-6 Openflowで使用したい
Enable
ポートを設定
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
25.
相互接続検証 Arista設定 P25
openflow
controller tcp:10.222.176.171:6633 コントローラの設定と
bind-vlan 10
Openflowを動作させるvlanを設定
Arista Enable
7050S
interface Ethernet1
switchport access vlan 10
インターフェースにopenflowで設定
したvlanを設定
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
26.
相互接続検証 BSN設定 P26
switch 00:00:00:00:00:00:00:01
switch-alias NEC
Big Switch Networks !
switch 00:00:00:00:00:00:00:02
switch-alias Pica8
Showコマンドで見やすくするため、
! DPIDに対してAliasを登録しておく
switch 00:00:00:1c:73:10:ee:3a
switch-alias Arista
!
switch 00:00:00:24:38:2c:be:00
switch-alias Brocade
!
host 00:25:90:39:7b:f0
host-alias tmp23
!
Showコマンドで見やすくするため、
host 00:25:90:39:7b:f2 MACに対してAliasを登録しておく
host-alias tmp24
bvs-definition green BVS(Big Virtual Switch)の設定
interface-rule tmp23 Ruleにはip-subnet、mac、switch、
match mac 00:25:90:39:7b:f0
interface-rule tmp24 tagsが設定可能
match mac 00:25:90:39:7b:f2 Definition単位で一つのL2セグメ
ントとなる
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
27.
相互接続検証 DPID決定方法 P27
各スイッチのDPIDの設定については、下表のようになっている
メーカ デフォルトの値 DPIDの変更 確認方法
Arista '0x0000' + system MAC address × show openflow
Brocade '0x0000'+managementのMAC × show openflow
address datapath-id
NEC ‘0x0001’+ system MAC address 〇 show openflow
(ユニークに設定変更可能) openflow-id 1
Pica8 '0x0000' + brのMACアドレス 〇 ovs-ofctl show br0
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
28.
相互接続検証 P28
疎通試験 tmp23 → tmp24へping
Big Switch
Networks
セキュアチャンネル用の
ネットワーク
Pica8 Brocade NEC Arista
Ping
tmp23 tmp24
Openflow用の
ネットワーク
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
29.
相互接続検証 Brocade flow P29
Brocade
NetIron XMR4000
NetIron XMR-4000 Router#show openflow flows Flow ID: 134 Priority: 0 Status: Active
Total Number of data packets sent to controller: 8831883 Rule:
Total Number of data bytes sent to controller : 606004852 In Port: e2/16
In Vlan: Untagged
Total Number of Flows: 3 Source Mac: 0025.9039.7bf2
Destination Mac: 0025.9039.7bf0
Flow ID: 132 Priority: 0 Status: Active Source Mac Mask: ffff.ffff.ffff
Rule: Destination Mac Mask: ffff.ffff.ffff
In Port: e2/15 Action: FORWARD
In Vlan: Untagged Out Port: e2/4
Source Mac: 0025.9039.7bf0 Statistics:
Destination Mac: 0025.9039.7bf2 Total Pkts: 33
Source Mac Mask: ffff.ffff.ffff Total Bytes: -NA-
Destination Mac Mask: ffff.ffff.ffff
Action: FORWARD
Out Port: e2/16
Statistics:
Total Pkts: 4346
Total Bytes: -NA-
Flow ID: 133 Priority: 0 Status: Active
Rule:
In Port: e2/4
In Vlan: Untagged
Source Mac: 0025.9039.7bf0
Destination Mac: 0025.9039.7bf2 Flow IDの133で16番ポートに送信するという
Source Mac Mask: ffff.ffff.ffff flowがある
Destination Mac Mask: ffff.ffff.ffff
Action: FORWARD Flow ID 134は戻りのflow
Out Port: e2/16 ※Flow ID 132は調査中
Statistics:
Total Pkts: 34
Total Bytes: -NA-
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
30.
相互接続検証 NEC flow P30
NEC
PF5240
PF5240# show openflow table detail <entry 121>
Date 2000/01/22 11:15:16 JST table type : normal1
forwarding state : hardware-based
FLOW entries information matched octets : 44564 octets
matched packets : 441 packets
[OpenFlow 1]
green and yellow octets : 44564 octets
<entry 120> green and yellow packets : 441 packets
table type : normal1 red octets : 0 octet
forwarding state : hardware-based red packets : 0 packet
matched octets : 44772 octets idle timer(max/current) : 5 sec / 4 sec
matched packets : 443 packets hard timer(max/current) : 0 sec / 0 sec
green and yellow octets : 44772 octets priority :0
green and yellow packets : 443 packets
added command : flowmod
red octets : 0 octet
red packets : 0 packet added time : 2000/01/22 11:08:04 JST
idle timer(max/current) : 5 sec / 4 sec last modified time : 2000/01/22 11:08:04 JST
hard timer(max/current) : 0 sec / 0 sec flow cookie : 0x20000000000000
priority :0
added command : flowmod match
added time : 2000/01/22 11:08:03 JST match type : STANDARD*
last modified time :-
input port : 0/ 6[0x00000006]
flow cookie : 0x20000000000000
src mac address : 0025.9039.7bf2
match dst mac address : 0025.9039.7bf0
match type : STANDARD* input vlan : untagged
input port : 0/16[0x00000010] input vlan pcp : any
src mac address : 0025.9039.7bf0 ethernet type : any
dst mac address : 0025.9039.7bf2 tos (dscp, ecn) : any
input vlan : untagged
ip protocol : any
input vlan pcp : any
ethernet type : any src ip address : any
dst ip address : any
tos (dscp, ecn)
ip protocol
: any
: any 0/16から入ってきたパケットを ipv6 flow label : any
src ip address
dst ip address
: any
: any 0/6へ送信するflowがある src l4 port
dst l4 port
: any
: any
ipv6 flow label : any metadata : 0x0000000000000000
src l4 port : any
dst l4 port : any
metadata : 0x0000000000000000 action 1
type : OUTPUT
action 1 out port : 0/16[0x00000010]
type : OUTPUT
out port : 0/ 6[0x00000006]
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
31.
相互接続検証 BSN 基本情報 P31
Big Switch Networks
localhost# show switch
# Switch DPID Alias Connected Since IP Address Tunnels Core Switch
-|-----------------------|-------|-----------------------|--------------|-------|-----------
1 00:00:00:00:00:00:00:01 NEC 2013-01-22 06:57:38 UTC 10.222.176.190 False
2 00:00:00:00:00:00:00:02 Pica8 2013-01-26 09:54:16 UTC 10.222.176.193 False
3 00:00:00:1c:73:10:ee:3a Arista 2013-01-24 08:48:55 UTC 10.222.176.149 False
4 00:00:00:24:38:2c:be:00 Brocade 2013-01-24 06:00:55 UTC 10.222.176.192 False
コントローラと接続しているスイッチ
を表示
localhost# show host
# MAC Address Address Space VLAN IP Address Switch/OF Port (Physical Port) Tag Last Seen
-|-------------------------|-------------|----|--------------|------------------------------|---|----------
1 00:1c:73:10:ee:49 default Unknown Inactive 0 minute
2 00:25:90:39:7b:f0 (tmp23) default 114.111.107.53 Brocade/52 (e2/4) 7 minutes
3 00:25:90:39:7b:f2 (tmp24) default 114.111.107.54 NEC/6 (GBE0/6) 11 minutes
4 08:9e:01:41:3e:d3 default Unknown Pica8/16 (ge-1/1/16) 0 minute
サーバの情報を出力
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
32.
相互接続検証 BSN flow P32
Big Switch Networks
localhost# show bvs green flow detail
BVS green (address-space default) flow entries (count: 5)
# Switch Bytes Packets Dur(s) Author Hard Timeout Idle Timeout Priority Table In Port Src MAC Dst MAC Ether Type VLAN ID VLAN PCP Src IP Dst IP Protocol Src Port Dst Port TOS Bits Actions
-|-------|------|-------|------|-------|------------|------------|--------|-----|-------|-------|-------|----------|-------|--------|------|------|--------
|--------|--------|--------|---------
1 NEC 102572 1016 988 FL:forw 0 5 0 0 16 tmp23 tmp24 * 65535 * * * * * * * output=6
2 NEC 102364 1014 987 FL:forw 0 5 0 0 6 tmp24 tmp23 * 65535 * * * * * * * output=16
3 Brocade 0 1012 987 FL:forw 0 5 0 4 64 tmp24 tmp23 * 65535 0 * * * * * * output=52
4 Brocade 0 4346 5230 FL:forw 0 5 0 4 63 tmp23 tmp24 * 65535 0 * * * * * * output=64
5 Brocade 0 1013 988 FL:forw 0 5 0 4 52 tmp23 tmp24 * 65535 0 * * * * * * output=64
スイッチ毎のflowを出力
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
33.
相互接続検証 ポート変更 P33
他のOpenflowスイッチのポートに指しても問題ないかを確認
Big Switch
Networks
セキュアチャンネル用の
ネットワーク
Pica8 Brocade NEC Arista
tmp23 tmp24
Openflow用の
ネットワーク
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
相互接続検証 Arista flow P35
Arista
7050S
DCS-7050S-64#show openflow flows
Flow flow00000000000000000362:
priority: 0
cookie: 9007199254740992 (0x20000000000000)
idle timeout: 5.0 sec
match ingress interface: Ethernet4
match source Ethernet address: 00:25:90:39:7b:f2
match destination Ethernet address: 00:25:90:39:7b:f0
match native VLAN ID
output interfaces: Ethernet15
matched: 261 packets, 26280 bytes
Flow flow00000000000000000361:
priority: 0
cookie: 9007199254740992 (0x20000000000000)
idle timeout: 5.0 sec
match ingress interface: Ethernet15
match source Ethernet address: 00:25:90:39:7b:f0
match destination Ethernet address: 00:25:90:39:7b:f2
match native VLAN ID
output interfaces: Ethernet4
matched: 263 packets, 26488 bytes
Flow __default__:
priority: -1
cookie: 0 (0x0)
output to controller
matched: 14762 packets, 955886 bytes
4番ポートから送出するというアクションがある
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
36.
相互接続検証 Brocade/NEC flow P36
Brocade NEC
NetIron XMR4000 PF5240
<entry 124>
Flow ID: 137 Priority: 0 Status: Active table type : normal1
Rule: forwarding state : hardware-based
In Port: e2/15 matched octets : 75630 octets
matched packets : 750 packets
In Vlan: Untagged green and yellow octets : 75630 octets
Source Mac: 0025.9039.7bf0 green and yellow packets : 750 packets
Destination Mac: 0025.9039.7bf2 red octets : 0 octet
Source Mac Mask: ffff.ffff.ffff red packets : 0 packet
idle timer(max/current) : 5 sec / 4 sec
Destination Mac Mask: ffff.ffff.ffff hard timer(max/current) : 0 sec / 0 sec
Action: FORWARD priority :0
Out Port: e2/16 added command : flowmod
added time : 2000/01/22 11:34:03 JST
Statistics: last modified time : 2000/01/22 11:34:03 JST
Total Pkts: 609 flow cookie : 0x20000000000000
Total Bytes: -NA-
match
match type : STANDARD*
input port : 0/16[0x00000010]
src mac address : 0025.9039.7bf0
dst mac address : 0025.9039.7bf2
input vlan : untagged
input vlan pcp : any
ethernet type : any
tos (dscp, ecn) : any
ip protocol : any
src ip address : any
dst ip address : any
ipv6 flow label : any
src l4 port : any
dst l4 port : any
metadata : 0x0000000000000000
action 1
type : OUTPUT
out port : 0/15[0x0000000f]
途中経路も送出ポートが変更されているのが分かる
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
相互接続検証 BVS定義の分離 P38
現在、下記のようなネットワーク構成
Big Switch
Networks
セキュアチャンネル用の
ネットワーク
Pica8 Brocade NEC Arista
tmp23 tmp24
Openflow用の
ネットワーク
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
39.
相互接続検証 BVS定義の分離 P39
下記のようにネットワークを分けてみる
Big Switch
Networks
セキュアチャンネル用の
ネットワーク
Pica8 Brocade NEC Arista
tmp23 tmp24
Openflow用の
ネットワーク
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
40.
相互接続検証 BSN設定 P40
bvs-definition green
no active
Big Switch Networks active False
interface-rule tmp23
match mac 00:25:90:39:7b:f0
interface-rule tmp24
match mac 00:25:90:39:7b:f2
!
bvs-definition green2
interface-rule tmp23
match mac 00:25:90:39:7b:f0
!
bvs-definition red
interface-rule tmp24
match mac 00:25:90:39:7b:f2
bvs-definitionを2つに分ける
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
41.
相互接続検証 BSN flow P41
Big Switch Networks
localhost# show bvs all flow detail
通信できるhostが無いため、flowがない状態
localhost# show host
# MAC Address Address Space VLAN IP Address Switch/OF Port (Physical Port) Tag Last Seen
-|-------------------------|-------------|----|--------------|------------------------------|---|---------
1 00:1c:73:10:ee:49 default Unknown Inactive 0 minute
2 00:25:90:39:7b:f0 (tmp23) default 114.111.107.53 Pica8/5 (ge-1/1/5) 4 minutes
3 00:25:90:39:7b:f2 (tmp24) default 114.111.107.54 Arista/4 (Ethernet4) 8 minutes
4 08:9e:01:41:3e:d3 default Unknown Pica8/16 (ge-1/1/16) 0 minute
Host情報は保持されている
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.
42.
P42
ありがとうございました
Copyright (C) 2012 Yahoo Japan Corporation. All Rights Reserved.