Hi,
What exactly error did you get?
For adding tcp_src/tcp_dst match fields, please check the "7.2.3.6 Flow
Match Field Prerequisite" in OpenFlow Spec 1.3, first.
For example, if you want to add tcp_dst=80, you also need to specify
eth_type=0x0800 and ip_proto=6.
$ git diff
diff --git a/ryu/app/simple_switch_13.py b/ryu/app/simple_switch_13.py
index 3e7c598..9f29041 100644
--- a/ryu/app/simple_switch_13.py
+++ b/ryu/app/simple_switch_13.py
@@ -48,6 +48,11 @@ class SimpleSwitch13(app_manager.RyuApp):
ofproto.OFPCML_NO_BUFFER)]
self.add_flow(datapath, 0, match, actions)
+ match = parser.OFPMatch(eth_type=0x0800, ip_proto=6, tcp_dst=80)
+ actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER,
+ ofproto.OFPCML_NO_BUFFER)]
+ self.add_flow(datapath, 0, match, actions)
+
def add_flow(self, datapath, priority, match, actions, buffer_id=None):
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
$ sudo mn --controller remote
...(snip)
mininet> sh ovs-ofctl dump-flows s1
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=11.877s, table=0, n_packets=0, n_bytes=0, idle_age=11,
priority=0 actions=CONTROLLER:65535
cookie=0x0, duration=11.877s, table=0, n_packets=0, n_bytes=0, idle_age=11,
priority=0,tcp,tp_dst=80 actions=CONTROLLER:65535
Thanks,
Iwase
On 2016年09月23日 02:20, Aidin Kelki wrote:
> Hi guys
>
>
> I am trying to add tcp_src/tcp_dst to the flow table but whenever I run Ryu,
> it gives me error. also I checked the msg but there is no tcp(src_port,
> dst_port). I want to ask how to add tcp_src/tcp_dst to match so I can get
> that from the flow?
>
>
> Thank you
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel