In the pupa stage, a weave is netted around by the silkworm to hold itself. After that it swings its head, spinning a fibre made of a protein and becomes a silk fibre. Several caterpillars form a protective layer around pupa and this covering is known as the cocoon.