Nomadic empire
The Xiongnu were a confederation of nomadic tribes from Central Asia with a ruling class of unknown origin and other subjugated tribes. They lived on the Mongolian Plateau between the 3rd century BC and the 460s AD, their territories including modern day Mongolia, southern Siberia, western Manchuria, and the modern Chinese provinces of Inner Mongolia, Gansu, and Xinjiang. The Xiongnu was the first unified empire of nomadic peoples. Relations between early Chinese dynasties and the Xiongnu were complicated and included military conflict, exchanges of tribute and trade, and marriage treaties. When Emperor Qin Shihuang drove them away from the south of the Yellow River, he built the famous Great Wall to prevent the Xiongnu from coming back.
Hexi Corridor
During the Han–Xiongnu War, Han China expelled the Xiongnu from the Hexi Corridor in 121 BCE and even drove them from Lop Nur when King Hunye surrendered to Huo Qubing in 121 BCE. The Han acquired a territory stretching from the Hexi Corridor to Lop Nur, thus cutting the Xiongnu off from their Qiang allies. Again, Han forces repelled a joint Xiongnu-Qiang invasion of this northwestern territory in 111 BCE. After 111 BCE, new outposts were established, four of them in the Hexi Corridor, namely Jiuquan, Zhangye, Dunhuang, and Guzang (Wuwei).
From roughly 115–60 BCE, Han forces fought the Xiongnu over control of the oasis city-states in the Tarim Basin. Han was eventually victorious and established the Protectorate of the Western Regions in 60 BCE, which dealt with the region's defense and foreign affairs.