This keeps away dangerous wasps and flies that try to lay eggs in the caterpillar. Many swallowtails have an osmeterium, including the Zebra Swallowtail . Legs Caterpillars have two types of legs which perform different functions. Caterpillar's thoracic legs hold onto its food. The prolegs are stumpy legs that let the caterpillar climb very well, even up vertical surfaces.
Caterpillars usually have five pairs of stumpy prolegs on the abdomen.
These prolegs disappear in the adult. Locomotion A caterpillar moves in a rippling fashion. It contracts the muscles in its rear segments, pushing blood into the forward segments, which lengthens the front part of the body. The legs hold onto the forward position and then the front muscles contract, pulling the rear segment forward. Breathing Spiracles are an insect's breathing pores.