19
RyuBGPSpeakerを 活用したOpenFlow簡易ルータ を試してみた 2014.12.24 @ttsubo 1

RyuBGPSpeakerを活用したOpenFlow簡易ルータを試してみた

Embed Size (px)

Citation preview

RyuBGPSpeakerを 活用したOpenFlow簡易ルータ

を試してみた

2014.12.24

@ttsubo

1

RyuBGPSpeakerは、BGPによるダイナミックルーティングが動作可能だが、データプレーンは未対応なので、実環境には適用できません。

OpenFlow簡易ルータを自作して、BGP/OpenFlowと連携させてみた

2

First Step..RouterBOARDをOpenFlow化させ、RyuBGPSpeakerで学習したPrefixをFlow Tableに注入してみる。

internetOpenFlow スイッチ

Ryuコントローラ

BGP Message

OpenFlow Message

Quagga1 Quagga2

3

OpenflowRouterRouterController

REST-IF

data

SimpleRouter

WSGI Application

Simple BGPSpeaker

PortTableArpTableRoutingTable

PortStatsFlowStats

SimpleMonitor

RyuApp

FlowTable OpenFlowスイッチ (OpenvSwitch)

BGPルータ (Quagga)

OpenFlow Message

BGP Message

OpenFlowチャネルBGPチャネル

NorthBound

4

確かに、このBGPネットワーク構成で、 期待どおりに動作したのだが....

5

192.168.200.1

OpenFlow チャネル

192.168.201.1

Ryuコントローラ

192.168.200.100 192.168.201.100AS:65001

この構成の課題は、BGP Peer数が増えるごとに、RyuコントローラとOpenFlowスイッチ間

のケーブル結線も増えてしまう。

AS:65002

AS:65002 (固定)

Port1 Port2

BGP チャネル

....

6

LinuxBox上にOpenFlowスイッチとRyuコントローラを 同居させて、LinuxBox内部インターフェスで繋げてみる。

Second Step..

internet

192.168.100.1

Quagga1

Quagga3

Quagga2

OVS1

OVS2

OVS3

AS65001 AS65002

192.168.100.0/24 192.168.102.0/24

192.168.102.1

7

internet

192.168.100.1

Quagga1

Quagga3

Quagga2

OVS1

OVS2

OVS3

192.168.102.1

iBGP

eBGP

eBGP

iBGPiBGP

iBGP

AS65001 AS65002

192.168.100.0/24192.168.102.0/24

BGPルータ間でBGP経路伝搬させて… BGPネットワーク面を経由してinternetに繋いでみる

8

internet

192.168.100.1

Quagga1

Quagga3

Quagga2

OVS1

OVS2

OVS3

192.168.102.1

iBGP

eBGP

iBGPiBGP

iBGP

AS65001 AS65002

192.168.100.0/24192.168.102.0/24

万一、BGPネットワーク面の途中区間で通信断が発生しても、適切に通信経路を迂回させてみる

Down

9

実際に、ネット通信が可能であり、途中区間で通信断が発生しても、約1分程度で回復できた

10

Quagga1

Quagga2

OVS1

OVS2

AS65001

192.168.100.1/24

MED100

MED200

OVS3 Quagga3

AS65002

root@Quagga-3:~# ping 192.168.100.1 PING 192.168.100.1 (192.168.100.1): 56 data bytes 64 bytes from 192.168.100.1: seq=0 ttl=254 time=1.999 ms 64 bytes from 192.168.100.1: seq=1 ttl=254 time=1.344 ms 64 bytes from 192.168.100.1: seq=2 ttl=254 time=1.272 ms 64 bytes from 192.168.100.1: seq=3 ttl=254 time=1.241 ms 64 bytes from 192.168.100.1: seq=4 ttl=254 time=1.217 ms 64 bytes from 192.168.100.1: seq=60 ttl=253 time=2.081 ms 64 bytes from 192.168.100.1: seq=61 ttl=253 time=1.414 ms 64 bytes from 192.168.100.1: seq=62 ttl=253 time=1.172 ms 64 bytes from 192.168.100.1: seq=63 ttl=253 time=1.364 ms 64 bytes from 192.168.100.1: seq=64 ttl=253 time=1.333 ms 64 bytes from 192.168.100.1: seq=65 ttl=253 time=1.323 ms ^C --- 192.168.100.1 ping statistics --- 66 packets transmitted, 11 packets received, 83% packet loss round-trip min/avg/max = 1.172/1.432/2.081 ms

192.168.101.1/24

Down

Pingも途中で通信断になったが、約1分後に回復できた

11

OpenFlow簡易ルータは、 Githubにて公開してます。

https://github.com/ttsubo/simpleRouter/tree/v0.3

12

以下、参考

13

Quagga1

Quagga2

OVS1

OVS2

192.168.100.1/24

OVS3 Quagga3

192.168.101.1/24

Status codes: * valid, > best Origin codes: i - IGP, e - EGP, ? - incomplete Network Labels Next Hop Reason Metric LocPrf Path *> 192.168.102.0/24 None 172.16.201.1 Only Path 100 i *> 172.16.103.0/24 None 192.168.201.1 Only Path 100 65001 ? *> 172.16.102.0/24 None 192.168.201.1 Only Path 100 65001 ? *> 192.168.202.0/24 None 192.168.201.1 Only Path 100 65001 ? *> 192.168.100.0/24 None 192.168.201.1 Only Path 100 65001 ? *> 0.0.0.0/0 None 192.168.201.1 Only Path 100 65001 ? *> 10.0.0.2/32 None 192.168.201.1 Only Path 100 65001 ? *> 172.16.201.101/32 None 172.16.201.1 Only Path 100 i *> 192.168.101.1/32 None 172.16.201.1 Only Path 100 i *> 172.16.202.101/32 None 172.16.201.1 Only Path 100 i *> 172.16.104.0/24 None 192.168.201.1 Only Path 100 65001 ? *> 172.16.101.0/24 None 192.168.201.1 Only Path 100 65001 ? *> 192.168.201.0/24 None 192.168.201.1 Only Path 100 65001 ? *> 192.168.0.0/24 None 192.168.201.1 Only Path 100 65001 ? *> 10.0.0.1/32 None 192.168.201.1 Only Path 100

Show_rib_ipv4 in OVS1

192.168.201.0/24

192.168.202.0/24

172.16.203.0/24

172.16.201.0/24

172.16.202.0/24

14

http:/http http://www.nexcom-jp.com/FilData/getimg/5712caac-3256-4d8b-b0ce-9c4ed262bed2://www.n http://www.nexcom-jp.com/FilData/getimg/5712caac-3256-4d8b-b0ce-9c http://www.nexcom-jp.com/FilData/getimg/

5712caac-3256-4d8b-b0ce-9c4ed262bed2 4ed262bed2 excom-jp.com/FilData/getimg/5712caac-3256-4d8b-b0ce-9c4ed262bed2/www.nexcom-jp.com/FilData/

getimg/5712caac-3256-4d8b-b0ce-9c4ed262bed2

Quagga1

Quagga2

OVS1

OVS2

192.168.100.1/24

OVS3 Quagga3

192.168.101.1/24

Status codes: * valid, > best Origin codes: i - IGP, e - EGP, ? - incomplete Network Labels Next Hop Reason Metric LocPrf Path * 192.168.201.0/24 None 192.168.202.1 200 65001 ? *> None 172.16.203.1 MED 100 200 65001 ? * 0.0.0.0/0 None 192.168.202.1 200 65001 ? *> None 172.16.203.1 MED 100 200 65001 ? * 172.16.102.0/24 None 192.168.202.1 200 65001 ? *> None 172.16.203.1 MED 100 200 65001 ? * 192.168.100.0/24 None 192.168.202.1 200 65001 ? *> None 172.16.203.1 MED 100 200 65001 ? * 10.0.0.1/32 None 192.168.202.1 200 65001 ? *> None 172.16.203.1 MED 100 200 65001 ?

…(snip)

*> 192.168.102.0/24 None 172.16.202.1 Only Path 100 i *> 192.168.101.1/32 None 172.16.202.1 Only Path 100 i *> 172.16.202.101/32 None 172.16.202.1 Only Path 100 i *> 172.16.201.101/32 None 172.16.202.1 Only Path 100 i

Show_rib_ipv4 in OVS2

192.168.201.0/24

192.168.202.0/24

172.16.203.0/24

172.16.201.0/24

172.16.202.0/24

15

Quagga1

Quagga2

OVS1

OVS2

192.168.100.1/24

OVS3 Quagga3

192.168.101.1/24

Status codes: * valid, > best Origin codes: i - IGP, e - EGP, ? - incomplete Network Labels Next Hop Reason Metric LocPrf Path *> 192.168.0.0/24 None 172.16.201.101 Only Path 100 300 65001 ? *> 172.16.202.101/32 None 0.0.0.0 Only Path i *> 192.168.201.0/24 None 172.16.201.101 Only Path 100 300 65001 ? *> 10.0.0.1/32 None 172.16.201.101 Only Path 100 300 65001 ? *> 172.16.104.0/24 None 172.16.201.101 Only Path 100 300 65001 ? *> 172.16.101.0/24 None 172.16.201.101 Only Path 100 300 65001 ? *> 192.168.102.0/24 None 192.168.101.1 Only Path i *> 172.16.201.101/32 None 0.0.0.0 Only Path i *> 192.168.100.0/24 None 172.16.201.101 Only Path 100 300 65001 ? *> 10.0.0.2/32 None 172.16.201.101 Only Path 100 300 65001 ? *> 192.168.101.1/32 None 0.0.0.0 Only Path i *> 192.168.202.0/24 None 172.16.201.101 Only Path 100 300 65001 ? *> 172.16.103.0/24 None 172.16.201.101 Only Path 100 300 65001 ? *> 172.16.102.0/24 None 172.16.201.101 Only Path 100 300 65001 ? *> 0.0.0.0/0 None 172.16.201.101 Only Path 100 300 65001 ?

Show_rib_ipv4 in OVS3

192.168.201.0/24

192.168.202.0/24

172.16.203.0/24

172.16.201.0/24

172.16.202.0/24

16

Quagga1

Quagga2

OVS1

OVS2

192.168.100.1/24

OVS3 Quagga3

192.168.101.1/24

Down

Show_rib_ipv4 in OVS1

Status codes: * valid, > best Origin codes: i - IGP, e - EGP, ? - incomplete Network Labels Next Hop Reason Metric LocPrf Path *> 192.168.102.0/24 None 172.16.201.1 Only Path 100 i *> 0.0.0.0/0 None 172.16.203.101 Only Path 200 200 65001 ? *> 172.16.103.0/24 None 172.16.203.101 Only Path 200 200 65001 ? *> 192.168.0.0/24 None 172.16.203.101 Only Path 200 200 65001 ? *> 172.16.102.0/24 None 172.16.203.101 Only Path 200 200 65001 ? *> 192.168.202.0/24 None 172.16.203.101 Only Path 200 200 65001 ? *> 192.168.201.0/24 None 172.16.203.101 Only Path 200 200 65001 ? *> 172.16.101.0/24 None 172.16.203.101 Only Path 200 200 65001 ? *> 10.0.0.1/32 None 172.16.203.101 Only Path 200 200 65001 ? *> 192.168.100.0/24 None 172.16.203.101 Only Path 200 200 65001 ? *> 172.16.104.0/24 None 172.16.203.101 Only Path 200 200 65001 ? *> 10.0.0.2/32 None 172.16.203.101 Only Path 200 200 65001 ? *> 172.16.201.101/32 None 172.16.201.1 Only Path 100 i *> 192.168.101.1/32 None 172.16.201.1 Only Path 100 i *> 172.16.202.101/32 None 172.16.201.1 Only Path 100

192.168.201.0/24

192.168.202.0/24

172.16.203.0/24

172.16.201.0/24

172.16.202.0/24

17

Quagga1

Quagga2

OVS1

OVS2

192.168.100.1/24

OVS3 Quagga3

192.168.101.1/24

Down

Show_rib_ipv4 in OVS2

Status codes: * valid, > best Origin codes: i - IGP, e - EGP, ? - incomplete Network Labels Next Hop Reason Metric LocPrf Path *> 192.168.201.0/24 None 192.168.202.1 Only Path 200 65001 ? *> 0.0.0.0/0 None 192.168.202.1 Only Path 200 65001 ? *> 172.16.102.0/24 None 192.168.202.1 Only Path 200 65001 ? *> 192.168.100.0/24 None 192.168.202.1 Only Path 200 65001 ? *> 10.0.0.1/32 None 192.168.202.1 Only Path 200 65001 ? *> 172.16.104.0/24 None 192.168.202.1 Only Path 200 65001 ? *> 192.168.202.0/24 None 192.168.202.1 Only Path 200 65001 ? *> 172.16.103.0/24 None 192.168.202.1 Only Path 200 65001 ? *> 172.16.101.0/24 None 192.168.202.1 Only Path 200 65001 ? *> 10.0.0.2/32 None 192.168.202.1 Only Path 200 65001 ? *> 192.168.0.0/24 None 192.168.202.1 Only Path 200 65001 ? *> 192.168.102.0/24 None 172.16.202.1 Only Path 100 i *> 192.168.101.1/32 None 172.16.202.1 Only Path 100 i *> 172.16.202.101/32 None 172.16.202.1 Only Path 100 i *> 172.16.201.101/32 None 172.16.202.1 Only Path 100 i

192.168.201.0/24

192.168.202.0/24

172.16.203.0/24

172.16.201.0/24

172.16.202.0/24

18

Quagga1

Quagga2

OVS1

OVS2

192.168.100.1/24

OVS3 Quagga3

192.168.101.1/24

Down

Show_rib_ipv4 in OVS3

Status codes: * valid, > best Origin codes: i - IGP, e - EGP, ? - incomplete Network Labels Next Hop Reason Metric LocPrf Path *> 192.168.100.0/24 None 172.16.202.101 Only Path 200 100 65001 ? *> 172.16.202.101/32 None 0.0.0.0 Only Path i *> 172.16.102.0/24 None 172.16.202.101 Only Path 200 100 65001 ? *> 192.168.102.0/24 None 192.168.101.1 Only Path i *> 172.16.201.101/32 None 0.0.0.0 Only Path i *> 192.168.101.1/32 None 0.0.0.0 Only Path i *> 0.0.0.0/0 None 172.16.202.101 Only Path 200 100 65001 ? *> 172.16.101.0/24 None 172.16.202.101 Only Path 200 100 65001 ? *> 192.168.201.0/24 None 172.16.202.101 Only Path 200 100 65001 ? *> 192.168.0.0/24 None 172.16.202.101 Only Path 200 100 65001 ? *> 172.16.104.0/24 None 172.16.202.101 Only Path 200 100 65001 ? *> 10.0.0.1/32 None 172.16.202.101 Only Path 200 100 65001 ? *> 10.0.0.2/32 None 172.16.202.101 Only Path 200 100 65001 ? *> 172.16.103.0/24 None 172.16.202.101 Only Path 200 100 65001 ? *> 192.168.202.0/24 None 172.16.202.101 Only Path 200 100 65001 ?

192.168.201.0/24

192.168.202.0/24

172.16.203.0/24

172.16.201.0/24

172.16.202.0/24

19