Ancient India was unified for a short time, and most of the time it was divided, not a unified country.
Due to the barrier between the Himalayas and the Qinghai-Tibet Plateau, China and India had little contact in ancient times, and of course they were not affiliated countries of China.