Some species curl themselves up into tight balls, thus exposing only their armored upper sides to the predator.
Many millipedes, but not all of them, have a series of stink glands that open along the sides of the body and that, if the millipede is attacked, emit a fluid or a vapor with an offensive smell.
In at least some species, this fluid contains hydrogen cyanide and is sometimes strong enough to kill insects that are confined in a closed jar with an individual of one of these species.
Possibly Related Questions: