Han dynasty
To the north of China proper, the nomadic Xiongnu chieftain Modu Chanyu (r. 209–174 BC) conquered various tribes inhabiting the eastern portion of the Eurasian Steppe. By the end of his reign, he controlled Manchuria, Mongolia, and the Tarim Basin, subjugating over twenty states east of Samarkand. Emperor Gaozu was troubled about the abundant Han-manufactured iron weapons traded to the Xiongnu along the northern borders, and he established a trade embargo against the group. In retaliation, the Xiongnu invaded what is now Shanxi province, where they defeated the Han forces at Baideng in 200 BC. After negotiations, the "heqin" agreement in 198 BC nominally held the leaders of the Xiongnu and the Han as equal partners in a royal marriage alliance, but the Han were forced to send large amounts of tribute items such as silk clothes, food, and wine to the Xiongnu.
Han–Xiongnu War
When Emperor Wu made the decision to conquer the Hexi Corridor, he had the intention to separate the Xiongnu from the Western Regions and from the Qiang people. In 88 BC, the Xianling tribe of the Qiang people sent an envoy to the Xiongnu, proposing a joint-attack against the Han in the region as they were discontented that they had lost the fertile lands at Jiuquan and Zhangye. It had often been the meeting place between the Xiongnu and the Qiang before the Han empire had conquered and annexed the Hexi Corridor. In 6 BC, Wang Shun (王舜) and Liu Xin noted that the frontier commandaries of Jiuquan, Zhangye, and Dunhuang were established by Emperor Wu to separate the then-powerful Chuoqiang tribe of the Qiang people from the Xiongnu. The Chuoqiang tribe and its king, however, eventually submitted to the Han empire and took part in the campaigns against the Xiongnu.