Hi, Llorente
For historical reasons, REST API cannot use full of fields defined in
ofproto/*.py.
The list of match fields REST API can use is shown here:
http://ryu.readthedocs.io/en/latest/app/ofctl_rest.html#description-of-match-and-actions
To use "tun_ipv4_src" and "tun_ipv4_dst" via REST API,
adding fields in this list might be good:
https://github.com/osrg/ryu/blob/6dfda4a227c493c1aed6c468d763650d21d5acce/ryu/lib/ofctl_v1_3.py#L195
Thanks,
Fujimoto
On 2017年06月01日 22:47, Llorente Santos Jesus wrote:
Hello community!
I am trying to use Ryu REST API to insert a flow in an OpenvSwitch
datapath. Unfortunately, I have run into problems with the fields
tun_ipv4_src and tun_ipv4_dst. However, if I add the intended flow via
ovs-ofctl, then I can then fetch it correctly through the Ryu REST API.
The ovs-ofctl command is the following:
# ovs-ofctl add-flow -O OpenFlow13 br-test0
"table=0,priority=10,in_port=100,ip,nw_src=192.168.0.100,nw_dst=172.16.0.1
actions=set_field:100.64.1.130->tun_src,set_field:100.64.2.130->tun_dst,set_field:5->tun_id,output:101"
Is there any way around this issue? I took a look at the ofctl_rest.py
but couldn't figure out myself how to modify the parser so it accepts
Nicira fields.
Thank you!
Jesus
PS: This is exactly the same problem as already reported by Zhao Jun
on 2016-03-03. I copy it here for further reference
>>> Hi, all
>>> I want to use ryu rest api to add a flow rule to OpenvSwitch.
>>> Here is the body I use
>>> { "dpid": 95529493015, "table_id": 0, "idle_timeout": 0,
"hard_timeout": 1800, "priority": 11, "match":{
"in_port":2, "tunnel_id_nxm":5001,
"tun_ipv4_src":"52.193.10.12", "dl_type":2048,
"nw_src":"10.0.0.0/24", "nw_dst":"10.0.1.0/24" },
"actions":[ { "type":"SET_FIELD",
"field":"tunnel_id_nxm", "value":5001 },
{ "type":"SET_FIELD", "field":"tun_ipv4_dst",
"value":"52.33.232.199" }, { "type":"OUTPUT",
"port": 0xfffffff8 } ]}
>>> The log shows that "Unknown match field: tunnel_id_nxm" and
"Unknown match field: tun_ipv4_src"
>>> These two match fields are found here:
https://github.com/osrg/ryu/blob/7a9b1be5d6874933fdfbf4e610992dd302915ed9/ryu/ofproto/nx_match.py
>>> I guess they are corresponding with "tun_id" and "tun_src" in
OpenvSwitch.
>>> But the result is not same as I expected. So if I want to match
"tun_id" and "tun_src" in Openvswitch, which match field shoud I use?
>>> Many thanks.
>>>
>>> Zhao Jun
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel