'Send PacketIn'

def send_packet_in(self, in_port, buffer_id=None, packet='', reason=None, data_length=None):

    if hasattr(packet, 'pack'):
        packet = packet.pack()
    assert assert_type('packet', packet, bytes)
    self.log.debug('Send    PacketIn')
    if (reason is None):
        reason = OFPR_NO_MATCH
    if ((data_length is not None) and (len(packet) > data_length)):
        if (buffer_id is not None):
            packet = packet[:data_length]
    msg = ofp_packet_in(xid=0, in_port=in_port, buffer_id=buffer_id, reason=reason, data=packet)
    self.send(msg)
