Hello,
I have a problem in the communication between an OpenFlow switch (I use OpenVswitch) and my NOX controller, connected out-of-band. The two machines connects, but, after I install the first flow, I get the following error message:

*openflow-event|ERR:received Openflow error packet from dpid=XXXXXX:
type=1, code=7, 24 bytes of data*


and the "*ovs-openflowd*" terminal showed following error


*"attempt to reuse the buffer"*

While discussing on ovs-discuss mailing list they suggest that "Send a given buffer_id only in a single OpenFlow request". I have also seen that there was a guy who wrote here an email as he had the same problem, so maybe you already solved this.

In my controller I want to install flows after a miss in the flow table. Here is a part of the code.

def packet_in_callback(self, dp_id, inport, ofp_reason, total_frame_len, buffer_id, packet):
        ethr_pkt = packet.find('ethernet')

                if (ofp_reason == openflow.OFPR_NO_MATCH) :
print "!!!!!!!!!!!!!!!!!!! W A R N I N G !!!!!!!!!!!!!!!!!!!!"
                        print "No matching rule in the flow table."

                        if(ethr_pkt.type == ethernet.ARP_TYPE):
                        m_arp = ethr_pkt.find('arp')
                        src_ip = ip_to_str(m_arp.protosrc)
                        dst_ip = ip_to_str(m_arp.protodst)
print "Received an ARP packet with", "\n src_ip: ", src_ip, "dst_ip: ", dst_ip
                        arp_type = m_arp.opcode
                        if (arp_type == 1):
print "This is an ARP REQUEST coming from port", inport
                        elif (arp_type == 2):
print "This is an ARP REPLY coming from port", inport
                        attr = {}
                        attr [core.IN_PORT] = inport
                        attr [core.DL_TYPE] = ethr_pkt.type
                        idle_timeout = openflow.OFP_FLOW_PERMANENT
                        hard_timeout = openflow.OFP_FLOW_PERMANENT
                        priority = 5
                        if inport == 25:
                            outport = 26
                        elif inport == 26:
                            outport = 25
                        actions = [[openflow.OFPAT_OUTPUT, [0,outport]]]
                        self.install_datapath_flow(dp_id,
                                                                   attr,
idle_timeout, hard_timeout,
                                                                   actions,
priority)


            elif(ethr_pkt.type == 0x0800):
                        ip_pkt = packet.find('ipv4')
                        src_ip = ip_to_str(ip_pkt.srcip)
                        dst_ip = ip_to_str(ip_pkt.dstip)
                        tos = ip_pkt.tos
                        nw_proto = ip_pkt.protocol
print "The incoming packet has the following structure: ", "\n L3 Protocol: ", nw_proto, "\n src_ip: ", src_ip
                        print  " dst_ip: ", dst_ip, "\n TOS: ", tos


                        if (ip_pkt.protocol == 1):
                            attrs = {}
                            attrs[core.IN_PORT] = inport
                            attrs[core.DL_TYPE] = ethr_pkt.type
                            attrs[core.NW_SRC] = ip_pkt.srcip
                            attrs[core.NW_DST] = ip_pkt.dstip
                            attrs[core.NW_PROTO] = nw_proto
                            attrs[core.NW_TOS] = tos
                            idle_timeout = openflow.OFP_FLOW_PERMANENT
                            hard_timeout = openflow.OFP_FLOW_PERMANENT
                            if inport == 26:
                                outport = 25
                            elif inport == 25:
                                outport = 26
actions = [[openflow.OFPAT_OUTPUT, [0, outport]]]
                            self.install_datapath_flow(dp_id,
attrs, idle_timeout, hard_timeout, actions, None, openflow.OFP_DEFAULT_PRIORITY, inport, None)



and so on with other if-else conditions.
Do you have any ideas of what could be the cause of such a behaviour and how could I solve it?

I also extended NOX source code a little in order to add a new L4 protocol for my work. Do you think this issue could be related to some mistakes I could have done?


Thanks,
Giorgio Mazza
_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev

Reply via email to