In the Han dynasty
胡 meant above all the
匈奴 and other northern nomads. Later it widened to the peoples of Central Asia, such as the Sogdians, famous in Tang China as merchants, musicians and dancers. The word survives in names of things they brought:
胡椒 pepper,
胡萝卜 carrot,
胡桃 walnut,
胡琴 the two-stringed fiddle.