A protective fibrous case spun by the larvae of moths and other insects. Cocoons provide protection during pupation. Silk is obtained from the cocoon of silkworms.