A symbiotic relationship in which the symbiont (parasite) benefits at the expense of the host by living either within the host (as an endoparasite) or outside the host (as an ectoparasite)