The caste system in India is the paradigmatic ethnographic instance of social classification based on castes. It has its origins in ancient India, and was transformed by various ruling elites in medieval, early-modern, and modern India, especially in the aftermath of the collapse of the Mughal Empire and the establishment of the British Raj. It is today the basis of affirmative action programmes in India as enforced through its constitution. The caste system consists of two different concepts, varna and jati, which may be regarded as different levels of analysis of this system.