def detect_protocol_and_get_its_field_names(packet, field_names):
    """
    Tries to find first protocol with defined field names.
    :param packet: Packet from Packets Parser stage.
    :param field_names: Dictionary with known protocols and their field names.
    :return: Protocol field names of the first detected protocol, None otherwise.
    """
    for field_name in field_names:
        if field_name in packet:
            return field_names[field_name]
    return None