The silkworm is the larval stage of the family of Bombycidae and Saturniidae of Lepidoptera, an order of moths and butterflies. So it is not a worm at all. It is a caterpillar.