def _in_order(expected, received):
    """Determine whether or not the received queue is in the order
    that we expect. A rule's destination port is used as its ID.

    :param expected: list of rules in the expected order.
    :param received: list of rules in ACLSwitch's order
    :return: True if in order, False otherwise.
    """
    list_size = len(expected)
    for i in range(list_size):
        if str(expected[i]["rule"]["port_dst"]) != str(received[i]):
            return False
    return True