Dear all, Currently, I am implementing a new function in openvswitch.
This new function is extension to OpenFlow protocol v1.0.0. In OpenFlow, if a packet does not match the flow table on a switch, the packet will be sent to the controller via a packet-in message. Then the OpenFlow controller will react this packet-in message by sending packet-out or flow-mod message back to the switch. What I am going to do is to add a new OpenFlow action, namely "BUFFER" action, to the OpenFlow1.0 protocol. This BUFFER action buffers packets into the OpenFlow buffer by calling pktbuf_save() function described in /ofproto/pktbuf.c. In addition, some new logic inserting the BUFFER entry should be added to the switch. For example, when a packet does not match with the flow table (cannot find any matched rule), my switch will insert an entry to the flow table. The match fields of this entry is a copy of the header of the mismatching packet and the action field of the entry is BUFFER. Thus, when the following packets in the same flow come to the switch, those packet will match this BUFFER entry and be stored into the OpenFlow buffer. To achieve these functions, what I should do is: 1. add the BUFFER action to OpenFlow protocol However, I know there are lots of places in the ovs code where OpenFlow actions are defined and where the OpenFlow actions are executed on packets... for example, in/include/openflow/openflow-1.0.h, in /lib/ofp-actions.c and in /ofproto/ofproto-dpif.c. My question is What corresponding changes should be made in order to make ovs support a new OpenFlow action like BUFFER? 2. Insert an entry with BUFFER action when a packet cannot find a matched entry in the flow table. For my understanding, this function should be integrated into execute_controller_action() in /ofproto/ofproto-dpif.c, since this function callsconnmgr_send_packet_in(), which sends the packet-in message to a controller (packet-in implies a mis-matching packet). Is that correct? 3. buffer the packets that matching the BUFFER entry. I highly doubt my currect understanding of the ovs code. I think the execution of BUFFER action should be handled in do_xlate_actions() in /ofproto/ofproto-dpif.c. This is because the switch-case block here processes all kinds of OpenFlow actions. However, here in the case of OFPACT_BUFFER, my new action, I found that ctx->packet, supposed to be the pointer of the matched packet, is NULL. Do you have any suggestion about how to buffer a packet matching with BUFFER entry? THANKS! Best, Xiaoye -- Xiaoye (Steven) Sun, Ph.D. Student Department of Electrical and Computer Engineering (ECE) & Department of Computer Science (CS) George R. Brown School of Engineering Rice University, Houston, Texas, USA
_______________________________________________ discuss mailing list [email protected] http://openvswitch.org/mailman/listinfo/discuss
