<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def bfd_parse(data):
 """ Parse raw packet and return BFD class from packet library. """

        pkt = packet.Packet(data)
        i = iter(pkt)
        eth_pkt = next(i)

        assert isinstance(eth_pkt, ethernet.ethernet)

        ipv4_pkt = next(i)
        assert isinstance(ipv4_pkt, ipv4.ipv4)

        udp_pkt = next(i)
        assert isinstance(udp_pkt, udp.udp)

        udp_payload = next(i)

        return bfd.bfd.parser(udp_payload)[0]