目前分類:SDN (8)

瀏覽方式: 標題列表 簡短摘要
  1. 檢查Pica OS的版本 (only for L2/L3 mode)
    #cli
  2. 設定下次開機預設使用的是OVS mode or L2/L3 mode
    #sudo picos_boot
  3. 新增OpenFlow Bridge br1
    #ovs-vsctl add-br br1 -- set bridge br1 datapath_type=pica8
  4. 設定br1的OpenFlow Version

qmaw 發表在 痞客邦 PIXNET 留言(0) 人氣()

之前的文章中,已經有介紹過如何利用Ryu的Rest API來設定Switch的Flow Entry,

不過那些都是沒有mask的下法,現在要來介紹有match filed有mask時,應該怎麼下。

1. 啟動Ryu。

Screenshot 2014-10-15 02.21.24

qmaw 發表在 痞客邦 PIXNET 留言(0) 人氣()

我已經儘全力了,最右邊還是很大一格,不會自己換行,大家可以用複製的,就可以看到完整的語法了。

Index Field Ryu Rest API 語法
20 OXM_OF_ICMPV4_TYPE

curl -X POST -d '{"dpid":"0000000000000001", "priority":"32766","match":{"eth_type":2048,"ip_proto":1,"icmpv4_type":1}, "actions":[{"type":"OUTPUT","port":2}]}' http://127.0.0.1:8080/stats/flowentry/add

21 OXM_OF_ICMPV4_CODE

curl -X POST -d '{"dpid":"0000000000000001", "priority":"62766","match":{"eth_type":2048,"ip_proto":1,"icmpv4_code":1}, "actions":[{"type":"OUTPUT","port":30}]}' http://127.0.0.1:8080/stats/flowentry/add

22 OXM_OF_ARP_OP

curl -X POST -d '{"dpid":"0000000000000001", "priority":"22766","match":{"eth_type":0x0806,"arp_op":1}, "actions":[{"type":"OUTPUT","port":30}]}' http://127.0.0.1:8080/stats/flowentry/add

qmaw 發表在 痞客邦 PIXNET 留言(0) 人氣()

Index Field Ryu Rest API 語法
1 OXM_OF_IN_PORT ~# curl -X POST -d '{"dpid":"0000000000000001", "priority":"32766","match":{"in_port":2}, "actions":[{"type":"OUTPUT","port":1}]}' http://127.0.0.1:8080/stats/flowentry/add
2 OXM_OF_IN_PHY_PORT N/A
3 OXM_OF_METADATA

curl -X POST -d '{"dpid":"0000000000000001", "priority":"32766","match":{"metadata":"1234567890"}, "actions":[{"type":"OUTPUT","port":1}]}' http://127.0.0.1:8080/stats/flowentry/add

4 OXM_OF_ETH_DST

curl -X POST -d '{"dpid":"0000000000000001", "priority":"32766","match":{"eth_dst":"00:11:22:33:44:55"}, "actions":[{"type":"OUTPUT","port":1}]}' http://127.0.0.1:8080/stats/flowentry/add

5 OXM_OF_ETH_SRC

curl -X POST -d '{"dpid":"0000000000000001", "priority":"32766","match":{"eth_src":"00:11:22:33:44:55"}, "actions":[{"type":"OUTPUT","port":1}]}' http://127.0.0.1:8080/stats/flowentry/add

6 OXM_OF_ETH_TYPE

curl -X POST -d '{"dpid":"0000000000000001", "priority":"32766","match":{"eth_type":0x86dd}, "actions":[{"type":"OUTPUT","port":1}]}' http://127.0.0.1:8080/stats/flowentry/add

qmaw 發表在 痞客邦 PIXNET 留言(0) 人氣()

在OpenFlow的Spec.裡,常會提到一些縮寫字,但是並沒有一個名詞解釋的總表,所以我自己作了一點,提供給大家作參考

Name Type
OFPFC_* OpenFlow Protocol Flow Control
OFPPC_* OpenFlow Protocol Port (role) Control
OFPET_* OpenFlow Protocol Error Type
OFPBMC_* OpenFlow Protocol Bad Match Code
OFPBAC_* OpenFlow Protocol Bad Action Code
OFPFMC_* OpenFlow Protocol Flow Modification Code
OFPGC_* OpenFlow Protocol Group Command
OFPPS_* OpenFlow Protocol Port Status
OFPPC_* OpenFlow Protocol Port Config
OFPMC_* OpenFlow Protocol Meter Command
OFPGMFC_* OpenFlow Protocol Group Modification Failed Code
OFPMMFC_* OpenFlow Protocol Meter Modification Failed Code
OFPT_* OpenFlow Protocol Type
OFPP_* OpenFlow Protocol Port 
OFPPF_ OpenFlow Protocol Port Feature
OFPQT_* OpenFlow Protocol Queue Property(??)
OFPQ_* OpenFlow Protocol Queue (??)
OFPXMC_* OpenFlow Protocol Extensible  Match ClassID
OFPXMT_OFB_* OpenFlow Protocol Extensible  Match Type_ OpenFlow Basic
OFPIEH_* OpenFlow  Protocol IPv6 Extension Header
OFPIT_* OpenFlow Protocol Insturction Type
OFPAT_* OpenFlow Protocol Action Type
OFPCML_* OpenFlow Protocol Controller Maximum Length
OFPC_* OpenFlow Protocol Capacity
OFPTT_* OpenFlow Protocol Table Type
OFPFF_* OpenFlow Protocol Flow Flag
OFPMF_* OpenFlow Protocol Meter Flag
OFPMBT_* OpenFlow Protocol Meter Band Type
OFPBRC_* OpenFlow Protocol Bad Request Code
OFPMP_* OpenFlow Protocol MultiPart
OFPTFPT_* OpenFlow Protocol Table Feature Property Type
OFPR_* OpenFlow Protocol Reason
(ofp_packet_in_reason)
OFPPR_* OpenFlow Protocol Port Reason
(ofp_port_reason)
OFPRR_* OpenFlow Protocol Flow Remove Reason

qmaw 發表在 痞客邦 PIXNET 留言(0) 人氣()

以下內容的PCAP檔,可以在下面連結下載。

https://box.nctu.edu.tw/public.php?service=files&t=e8f8a4ff004b8912991d441db8ee19da

拓撲:
(Mininet 2.1.0 192.168.100.7)<---->(RYU Controller   192.168.100.8)

qmaw 發表在 痞客邦 PIXNET 留言(0) 人氣()

學會安裝封包產生器之後,免不了要打打看封包,這裡介紹如何將封包產生器和mininet結合

1. 首先,參考這篇,將Ryu&WEB GUI啟動起來,但是啟動RYU的指令,要換成下面這行,OpenFlow_13才支援等下要作的Push Vlan喔。
#./bin/ryu-manager --verbose --observe-links ryu/topology/switches.py ryu/app/rest_topology.py ryu/app/ofctl_rest.py ryu/app/simple_switch_13.py

2. 接著參考這裡,mininet啟動起來。指令換成下面這行,如此啟動起來的mininet才支援OpenFlow13。

qmaw 發表在 痞客邦 PIXNET 留言(0) 人氣()

import了SDN hub的VM後,總是會想要試看看能不能下個Flow Entry,

現在就來試看看如何手動設定flow entry。

1. 啟動SDN HUB VM內的mininet。
#sudo mn --controller=remote --switch ovsk,protocols=OpenFlow13

qmaw 發表在 痞客邦 PIXNET 留言(3) 人氣()

找更多相關文章與討論