Hi, Fahmy

"match" must be a dict, so the following command will be accepted.
curl -H "Content-Type: application/json" -X POST -d '{"dpid": 2, "cookie": 42, "priority": 45000, "match": {"nw_src": "10.0.0.1","nw_dst":"10.0.0.4"}, "actions": [{"type":"OUTPUT", "port": 4}]}' http://localhost:8080/stats/flowentry/add <http://localhost:8080/stats/flowentry/add>

---

FYI, this rule will not be registered to your switch, because "dl_type" is not specified. In OpenFlow 1.0, "dl_type" must be specified to 2048 if you want to match packets with "nw_src" and "nw_dst".
The following command will be work well:
curl -H "Content-Type: application/json" -X POST -d '{"dpid": 2, "cookie": 42, "priority": 45000, "match": {"nw_src": "10.0.0.1","nw_dst":"10.0.0.4","dl_type": 2048}, "actions":[{"type":"OUTPUT", "port": 4}]}' http://localhost:8080/stats/flowentry/add


Thanks,
Fujimoto

On 2017年04月26日 01:58, Fahmy Sherif Alaa Salaheldin wrote:

Good Evening​,


I am currently using RYU for a proof on concept for my master thesis and I am facing a problem:


When i intialize tyu-manager with just the ryu.app.ofctl_rest I try to curl some rules and for some reason if I try to match more than one field it doesn't work and tells me Attribute Error!


For example this works: ( Match IP source)


curl -H "Content-Type: application/json" -X POST -d '{"dpid": 2, "cookie": 42, "priority": 45000, "match": {"nw_src": "10.0.0.1"}, "actions": [{"type":"OUTPUT", "port": 4}]}' http://localhost:8080/stats/flowentry/add


While this DOES NOT: (​ Match IP source AND DESTINATION)


curl -H "Content-Type: application/json" -X POST -d '{"dpid": 2, "cookie": 42, "priority": 45000, "match": [{"nw_src": "10.0.0.1","nw_dst":"10.0.0.4"}], "actions": [{"type":"OUTPUT", "port": 4}]}' http://localhost:8080/stats/flowentry/add <http://localhost:8080/stats/flowentry/add>


DOES THAT MEAN RYU CONTROLLER CAN ONLY MATCH ONE FIELD?? THANK YOU


Thanks in advance,

Best,

Sherif



------------------------------------------------------------------------------
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
Ryu-devel@lists.sourceforge.net
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to