2017-08-03 45 views

回答

0

你不能dpctl命令做到這一點,你必須使用 「SH OVS-ofctl」 命令。

而且mininet回答與dpctl相關問題this link

這裏是我做的:

[email protected]:~$ sudo mn --topo linear,2,1 --switch ovsk --controller=remote 
*** Creating network 
*** Adding controller 
Connecting to remote controller at 127.0.0.1:6653 
*** Adding hosts: 
h1 h2 
*** Adding switches: 
s1 s2 
*** Adding links: 
(h1, s1) (h2, s2) (s2, s1) 
*** Configuring hosts 
h1 h2 
*** Starting controller 
c0 
*** Starting 2 switches 
s1 s2 ... 
*** Starting CLI: 

讓轉儲流:

mininet> dpctl dump-flows 
*** s1 ------------------------------------------------------------------------ 
NXST_FLOW reply (xid=0x4): 
cookie=0x0, duration=10.979s, table=0, n_packets=21, n_bytes=1674, idle_age=1, priority=0 actions=CONTROLLER:65535 
*** s2 ------------------------------------------------------------------------ 
NXST_FLOW reply (xid=0x4): 
cookie=0x0, duration=10.974s, table=0, n_packets=21, n_bytes=1674, idle_age=1, priority=0 actions=CONTROLLER:65535 

添加流S1:

mininet> sh ovs-ofctl add-flow s1 in_port=5,nw_dst=10.0.0.5,actions=output:5 
2017-08-03T16:06:41Z|00001|ofp_util|INFO|normalization changed ofp_match, details: 
2017-08-03T16:06:41Z|00002|ofp_util|INFO| pre: in_port=5,nw_dst=10.0.0.5 
2017-08-03T16:06:41Z|00003|ofp_util|INFO|post: in_port=5 

現在,如流量轉儲中所見,每個開關的流量是不同的:

mininet> dpctl dump-flows 
*** s1 ------------------------------------------------------------------------ 
NXST_FLOW reply (xid=0x4): 
cookie=0x0, duration=2.644s, table=0, n_packets=0, n_bytes=0, idle_age=2, in_port=5 actions=output:5 
cookie=0x0, duration=20.971s, table=0, n_packets=21, n_bytes=1674, idle_age=11, priority=0 actions=CONTROLLER:65535 
*** s2 ------------------------------------------------------------------------ 
NXST_FLOW reply (xid=0x4): 
cookie=0x0, duration=20.965s, table=0, n_packets=21, n_bytes=1674, idle_age=11, priority=0 actions=CONTROLLER:65535 
mininet> 
+0

謝謝!現在我可以做到 – Jungwon

+0

我不知道如何學習SDN ..你能告訴我一些提示嗎? – Jungwon

+0

Mininet與RYU是一個非常好的起點。你已經開始在正確的地方。我也可以通過https://www.udemy.com/sdn-openflow-nfv-introduction課程來了解基本概念。如果您對SDN的某些問題有任何疑問,我願意幫助。 –

相關問題