You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
What is Cestoda and explain in detail?
Cestoda is a class of parasitic worms in the flatworm phylum (Platyhelminthes). Most of the species—and the best-known—are those in the subclass Eucestoda; they are ribbon-like worms as adults, known as tapeworms. Their bodies consist of many similar units known as proglottids—essentially packages of eggs which are regularly shed into the environment to infect other organisms. Species of the other subclass, Cestodaria, are mainly fish infecting parasites.
All cestodes are parasitic; many have complex life histories, including a stage in a definitive (main) host in which the adults grow and reproduce, often for years, and one or two intermediate stages in which the larvae develop in other hosts. Typically the adults live in the digestive tracts of vertebrates, while the larvae often live in the bodies of other animals, either vertebrates or invertebrates. For example, Diphyllobothrium has at least two intermediate hosts, a crustacean and then one or more freshwater fish; its definitive host is a mammal.  Some cestodes are host-specific, while others are parasites of a wide variety of hosts. Some six thousand species have been described; probably all vertebrates can host at least one species.
The adult tapeworm has a scolex (head), a short neck, and a strobila (segmented body) formed of proglottids. Tapeworms anchor themselves to the inside of the intestine of their host using their scolex, which typically has hooks, suckers, or both. They have no mouth, but absorb nutrients directly from the hosts gut. The neck continually produces proglottids, each one containing a reproductive tract; mature proglottids are full of eggs, and fall off to leave the host, either passively in the feces or actively moving. All tapeworms are hermaphrodites, with each individual having both male and female reproductive organs.
Humans are subject to infection by several species of tapeworms if they eat undercooked meat such as pork (Taenia solium), beef (T. saginata), and fish (Diphyllobothrium), or if they live in, or eat food prepared in, conditions of poor hygiene (Hymenolepis or Echinococcus species). The unproven concept of using tapeworms as a slimming aid has been touted since around 1900.

Diversity and habitat
All 6,000 species of Cestoda are parasites, mainly intestinal; their definitive hosts are vertebrates, both terrestrial and marine, while their intermediate hosts include insects, crustaceans, molluscs, and annelids as well as other vertebrates.T. saginata, the beef tapeworm, can grow up to 20 m (65 ft); the largest species, the whale tapeworm Tetragonoporus calyptocephalus, can grow to over 30 m (100 ft). Species with small hosts tend to be small. For example, vole and lemming tapeworms are only 13–240 mm (0.5–9.4 in) in length, and those parasitizing shrews only 0.8–60 mm (0.03–2.36 in).

Anatomy
Cestodes have no gut or mouth and absorb nutrients from the hosts alimentary tract through their specialised neodermal cuticle, or tegument, through which gas exchange also takes place. The tegument also protects the parasite from the hosts digestive enzymes and allows it to transfer molecules back to the host.The body form of adult eucestodes is simple, with a scolex, or grasping head, adapted for attachment to the definitive host, a short neck, and a strobila, or segmented trunk formed of proglottids, which makes up the worms body. Members of the subclass Cestodaria, the Amphilinidea and Gyrocotylidea, are wormlike but not divided into proglottids. Amphilinids have a muscular proboscis at the front end; Gyrocotylids have a sucker or proboscis which they can pull inside or push outside at the front end, and a holdfast rosette at the posterior end.The Cestodaria have 10 larval hooks while Eucestoda have 6 larval hooks.

Scolex
The scolex, which attaches to the intestine of the definitive host, is often minute in comparison with the proglottids. It is typically a four-sided knob, armed with suckers or hooks or both. In some species, the scolex is dominated by bothria, or "sucking grooves" that function like suction cups. Cyclophyllid cestodes can be identified by the presence of four suckers on their scolices. Other species have ruffled or leaflike scolices, and there may be other structures to aid attachment.In the larval stage the scolex is similarly shaped and is known as the protoscoleces.

Body systems
Circular and longitudinal muscles lie under the neodermis, beneath which further longitudinal, dorso-ventral and transverse muscles surround the central parenchyma. Protonephridial cells drain into the parenchyma. There are four longitudinal collection canals, two dorso-lateral and two ventro-lateral, running along the length of the worm, with a transverse canal linking the ventral ones at the posterior of each segment. When the proglottids begin to detach, these canals open to the exterior through the terminal segment.The main nerve centre of a cestode is a cerebral ganglion in its scolex. Nerves emanate from the ganglion to supply the general body muscular and sensory endings, with two lateral nerve cords running the length of the strobila. The cirrus and vagina are innervated, and sensory endings around the genital pore are more plentiful than in other areas. Sensory function includes both tactoreception (touch) and chemoreception (smell or taste).

Proglottids
Once anchored to the hosts intestinal wall, tapeworms absorb nutrients through their surface as their food flows past them. Cestodes are unable to synthesise lipids, which they use for reproduction, and are therefore entirely dependent on their hosts.The tapeworm body is composed of a series of segments called proglottids. These are produced from the neck by mitotic growth, which is followed by transverse constriction. The segments become larger and more mature as they are displaced backwards by newer segments. Each proglottid contains an independent reproductive tract, and like some other flatworms, cestodes excrete waste through flame cells (protonephridia) located in the proglottids. The sum of the proglottids is called a strobila, which is thin and resembles a strip of tape; from this is derived the common name "tapeworm". Proglottids are continually being produced by the neck region of the scolex, as long as the scolex is attached and alive.Mature proglottids are essentially bags of eggs, each of which is infective to the proper intermediate host. They are released and leave the host in feces, or migrate outwards as independent motile proglottids. The number of proglottids forming the tapeworm ranges from three to four thousand. Their layout comes in two forms: craspedote, meaning any given proglottid is overlapped by the previous proglottid, or acraspedote, indicating the proglottids do not overlap.

Reproduction
Cestodes are exclusively hermaphrodites, with both male and female reproductive systems in each body. The reproductive system includes one or more testes, cirri, vas deferens, and seminal vesicles as male organs, and a single lobed or unlobed ovary with the connecting oviduct and uterus as female organs. The common external opening for both male and female reproductive systems is known as the genital pore, which is situated at the surface opening of the cup-shaped atrium. Though they are sexually hermaphroditic and cross-fertilization is the norm, self-fertilization sometimes occurs and makes possible the reproduction of a worm when it is the only individual in its hosts gut. During copulation, the cirri of one individual connect with those of the other through the genital pore, and then spermatozoa are exchanged.

Life cycle
Cestodes are parasites of vertebrates, with each species infecting a single definitive host or group of closely related host species. All but amphilinids and gyrocotylids (which burrow through the gut or body wall to reach the coelom) are intestinal, though some life-cycle stages rest in muscle or other tissues. The definitive host is always a vertebrate but in nearly all cases, one or more intermediate hosts are involved in the lifecycle, typically arthropods or other vertebrates. Infections can be long-lasting; in humans, tapeworm infection may last as much as 30 years. No asexual phases occur in the lifecycle, as they do in other flatworms, but the lifecycle pattern has been a crucial criterion for assessing evolution among Platyhelminthes.Cestodes produce large numbers of eggs, but each one has a low probability of finding a host. To increase their chances, different species have adopted various strategies of egg release. In the Pseudophyllidea, many eggs are released in the brief period when their aquatic intermediate hosts are abundant (semelparity). In contrast, in the terrestrial Cyclophyllidea, proglottids are released steadily over a period of years, or as long as their host lives (iteroparity). Another strategy is to have very long-lived larvae; for example, in Echinococcus, the hydatid larvae can survive for ten years or more in humans and other vertebrate hosts, giving the tapeworm an exceptionally long time window in which to find another host.Many tapeworms have a two-phase lifecycle with two types of host. The adult Taenia saginata lives in the gut of a primate such as a human, its definitive host. Proglottids leave the body through the anus and fall to the ground, where they may be eaten with grass by a grazing animal such as a cow. This animal then becomes an intermediate host, the oncosphere boring through the gut wall and migrating to another part of the body such as the muscle. Here it encysts, forming a cysticercus. The parasite completes its lifecycle when the intermediate host passes on the parasite to the definitive host, usually when the definitive host eats contaminated parts of the intermediate host, for example a human eating raw or undercooked meat.  Another two-phase lifecycle is exhibited by Anoplocephala perfoliata, the definitive host being an equine and the intermediate host an oribatid mite.Diphyllobothrium exhibits a more complex, three-phase lifecycle. If the eggs are laid in water, they develop into free-swimming oncosphere larvae. After ingestion by a suitable freshwater crustacean such as a copepod, the first intermediate host, they develop into procercoid larvae. When the copepod is eaten by a suitable second intermediate host, typically a minnow or other small freshwater fish, the procercoid larvae migrate into the fishs flesh where they develop into plerocercoid larvae. These are the infective stages for the mammalian definitive host. If the small fish is eaten by a predatory fish, its muscles too can become infected.Schistocephalus solidus is another three-phase example. The intermediate hosts are copepods and small fish, and the definitive hosts are waterbirds. This species has been used to demonstrate that cross-fertilisation produces a higher infective success rate than self-fertilisation.

Host immunity
Hosts can become immune to infection by a cestode if the lining, the mucosa, of the gut is damaged. This exposes the hosts immune system to cestode antigens, enabling the host to mount an antibody defence. Host antibodies can kill or limit cestode infection by damaging their digestive enzymes, which reduces their ability to feed and therefore to grow and to reproduce; by binding to their bodies; and by neutralising toxins that they produce. When cestodes feed passively in the gut, they do not provoke an antibody reaction.

Evolution and phylogeny
Fossil history
Parasite fossils are rare, but recognizable clusters of cestode eggs, some with an operculum (lid) indicating that they had not erupted, one with a developing larva, have been discovered in fossil shark coprolites dating to the Permian, some 270 million years ago.The fossil Rugosusivitta, which was found in China at base of the Cambrian deposits in Yunnan  just above the Ediacaran-Cambrian border, has great similarities to present day Cestodians. If correct, this would be the earliest example of a Platyzoan and also one of the earliest bilaterian body-fossils and might thus provide an insight to the living mode of Cestodians before they became specialized parasites.

External
The position of the Cestoda within the Platyhelminthes and other Spiralian phyla based on genomic analysis is shown in the phylogenetic tree. The non-parasitic flatworms, traditionally grouped as the "Turbellaria", are paraphyletic, as the parasitic Neodermata including the Cestoda arose within that grouping. The approximate times when major groups first appeared is shown in millions of years ago.

Internal
The evolutionary history of the Cestoda has been studied using ribosomal RNA, mitochondrial and other DNA, and morphological analysis and continues to be revised. "Tetraphyllidea" is seen to be paraphyletic; "Pseudophyllidea" has been broken up into two orders, Bothriocephalidea and Diphyllobothriidea. Hosts, whose phylogeny often mirrors that of the parasites (Fahrenholzs rule), are indicated in italics and parentheses, the life-cycle sequence (where known) shown by arrows as (intermediate host1 [→ intermediate host2 ] → definitive host). Alternatives, generally for different species within an order, are shown in square brackets.
The Taeniidae, including species such as the pork tapeworm and the beef tapeworm that often infect humans, may be the most basal of the 12 orders of the Cyclophyllidea.

Interactions with humans
Infection and treatment
Like other species of mammal, humans can become infected with tapeworms. There may be few or no symptoms, and the first indication of the infection may be the presence of one or more proglottids in the stools. The proglottids appear as flat, rectangular, whitish objects about the size of a grain of rice, which may change size or move about. Bodily symptoms which are sometimes present include abdominal pain, nausea, diarrhea, increased appetite and weight loss.There are several classes of anthelminthic drugs, some effective against many kinds of parasite, others more specific; these can be used both preventatively and to treat infections. For example, praziquantel is an effective treatment for tapeworm infection, and is preferred over the older niclosamide. While accidental tapeworm infections in developed countries are quite rare, such infections are more likely to occur in countries with poor sanitation facilities or where food hygiene standards are low.

History and culture
In ancient Greece, the comic playwright Aristophanes and philosopher Aristotle described the lumps that form during cysticercosis as "hailstones"