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.
History of Mongolia
The first significant appearance of nomads came late in the 3rd century BC, when the Chinese repelled an invasion of the Xiongnu (Hsiung-nu in Wade–Giles romanisation) across the Yellow River from the Gobi. A Chinese army, which had adopted Xiongnu military technology—wearing trousers and using mounted archers with stirrups—pursued the Xiongnu across the Gobi in a ruthless punitive expedition. Fortification walls built by various Chinese warring states were connected to make a 2,300-kilometre Great Wall along the northern border, as a barrier to further nomadic inroads.