code: def packet2chain(packet):
      
      chain = [type(packet).__name__]
      payload = packet.data
      while not isinstance(payload, bytes):
          chain.append(type(payload).__name__)
          payload = payload.data
      return ':'.join(chain)
docs: Fetch DPKT packet protocol chain.