The standard works on the ancient Indian history (whether called history or pre-history) usually discuss: a) Indus valley civilisation, roughly 3000-2000 BC, b) arrival of aryans over centuries in Indo-Gangetic plains and their migrations towards peninsular India (Rig veda, the earliest exstant Sanskrit document, 1500-1200 BC), Aryans being pastoral nomads, c) Buddha, and spread and decline of Buddhism in India (beginning in Fifth century BC , d) Discovery of iron, transition to agriculture from pastoral life, emergence of states and empires, particularly rise of Magadh, Mauryan Empire (Third Century BC) etc., transition to feudalism This should clarify what I meant by "ancient times". (Indian history is thus broadly divided into the following epoches: Ancient, Feudal and Modern. Modern period is further subdivided into colonial and post-colonial periods.)
The caste system is said have emerged over centuries during the Vedic period, beginning roughly in 1500 BC. I mean by caste well known division of Indian society into four categories: Priests (brahmins), Warriors (kshatriyas), Traders and farmers (vaisyas) outside and sudras, the lowest sub-caste. In this sense, the caste was a endogamous unit, with prohibition on marriages outside the caste. On the other hand, gotras or clans (or septs) were exogamous units prohibiting marriages within gotras. Both, the clan and the caste existed in the period called the ancient period.
Ulhas