如何在每两个交换机上添加流量table? (迷你网)

How to add flow table on each two switches? (mininet)

我设置拓扑如下图所示。我想为每个开关添加不同的 flow-tables。但是如果我输入

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

流 table 同时添加到 s1 和 s2!

如何为每个交换机添加不同的流-table?

您不能使用 dpctl 命令执行此操作,您必须使用 "sh ovs-ofctl" 命令。

mininet也在this link

中回答了一个与dpctl相关的问题

这是我所做的:

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:

让转储流量:

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>

如果已经创建了 link,我们如何设置来自 xterm hosts

的 link 的优先级