Military history of the Three Kingdoms
By the time of the Three Kingdoms period the Xiongnu had already ceased to be a major power. Their last stand as a steppe empire was in 89 when Dou Xian led an army of 45,000 and decisively defeated them at the Battle of the Altai Mountains. The Xiongnu Empire was replaced by a loose confederation of disorganized Xianbei tribes, who were nonetheless highly aggressive and proved problematic to their southern neighbors. A southern branch of the Xiongnu split off from their northern neighbors in 50 AD and continued to exist as a Han puppet state in Bing Province. However, in 188 the Xiuchuge clan rebelled against their Chanyu, Qiangqu, for sending troops to aid the Han against the rebels Zhang Ju and Zhang Chun. They replaced Qiangqu with his son Yufuluo, who's hold on power was tenuous, and he was ousted over a marquis of the Xubu clan. When the marquis of Xubu died the next year an elderly king became the nominal head of state without the title of Chanyu and the Southern Xiongnu ceased to exist as a coherent entity. In 216 the Xiongnu of the Ordos were settled but the region remained outside the jurisdiction of Cao Wei's administration.
Jiangqu
In 51 BCE a pretender to the Xiongnu's throne Huhanye re-established the "heqin" peace and kinship treaty with the Han empire, and fled to China with a fraction of the Xiongnu, partitioning the Xiongnu state into the Northern Xiongnu and Southern Xiongnu, and establishing a new polity allied with China. The Southern Xiongnu retained a title "Chanyu" for their leader, and started a new dynastic line beginning with Huhanye. Huhanye himself belonged to the 8th generation of the Maodun line of the dynastic paternal Luanti tribe, the tribe Qiang ("Kiyan") was a maternal dynastic tribe of the Southern Xiongnu. During the existence of the Southern Xiongnu state, its Xiongnu population greatly varied depending on the events in the steppe, at times it was swelling with numerous Xiongnu tribes fleeing trouble events, and at times it was losing Xiongnu tribes when they returned after return of peaceful times. The Chinese policies also affected the in and out flows. Until the event with Zhang Xiu in 179 CE, the Southern Xiongnu continued electing their Chanyus without explicit Chinese intervention, Jiangqu was the first Southern Xiongnu Chanyu who broke the traditional Xiongnu succession laws, undermining the integrity of the Southern fraction. Tribes that did not want to recognise a non-eligible leader either revolted against him, or left the area under his control.