3

I set topology as can seen in the image below. I want to add different flow-tables to each switch. But if I type

dpctl add-flow in_port=1,nw_dst=10.0.0.2,actions=output:3

the flow table is added to both s1 and s2!

How can I add a different flow-table to each switch?

screen capture

robinCTS
  • 5,746
  • 14
  • 30
  • 37
Jungwon
  • 35
  • 1
  • 6

2 Answers2

2

You can't do this with dpctl command, you have to use "sh ovs-ofctl" command.

Also mininet answered a question related with dpctl in this link

Here is what i did:

yavuz@ubuntu:~$ 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:

Lets dump flows:

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

Add a flow to 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

Now, as seen in flow dump, flows for each switch are different:

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>
Yavuz Sert
  • 2,387
  • 2
  • 13
  • 26
  • Thank you!! Now I can do it – Jungwon Aug 06 '17 at 05:54
  • I don't know how to study about SDN.. Could you tell me some tips? – Jungwon Aug 06 '17 at 06:00
  • 1
    Mininet with RYU is a very good starting point. You've started at the right place. I can also advice https://www.udemy.com/sdn-openflow-nfv-introduction course to understand basic concepts. If you have questions for certain issues about SDN i'd like to help if i can. – Yavuz Sert Aug 06 '17 at 09:56
  • Thanks for suggestion. How could send data using new connection (flow)? Is `s1 ping 10.0.0.5`? – Cloud Cho Aug 14 '23 at 21:04
-1

If already a link is created how do we set the priority of the link from xterm hosts