faucetsdn / ryu

Ryu component-based software defined networking framework
https://ryu-sdn.org
Apache License 2.0
1.5k stars 1.16k forks source link

How to use the Ryu REST API to add flow tables using MAC address matching. #173

Open zhang-xiaofeng opened 1 year ago

zhang-xiaofeng commented 1 year ago

How to use Ryu restAPI to add stream entries to a switch? for example: curl -X POST -d '{ "dpid": 2, "cookie": 1, "cookie_mask": 1, "table_id": 0, "idle_timeout": 0, "hard_timeout": 0, "priority": 11111, "flags": 1, "match":{ "in_port":3, "dl_dst":"00:00:00:00:00:01" }, "actions":[ { "type":"OUTPUT", "port": 1 } ] }' http://localhost:8080/stats/flowentry/add In the example above, what format should the MAC address match be in? What went wrong?

xetxezarreta commented 1 year ago

I just tested Mininet + Ryu and your POST request works as expected. The following flow entry is added to dpid 2: image

If a packet matches with those match fields (in_port=3 and eth_dst = 00:00:00:00:00:01) it is forwarded from port 1.

zhang-xiaofeng commented 1 year ago

Thanks! now,I have a new question.The OVS is used as a router to connect two hosts on different network segments. In this case, the host will send ARP broadcast packets to ask for the MAC address of the gateway when the ping command is executed between the hosts, but the gateway does not reply. How to set the flow entry so that the host can get the MAC address of the gateway