Barbaria was the name used by the ancient Greeks for littoral northeast Africa. The corresponding Arabic term, bilad al-Barbar, was in use in the Middle Ages. According to the Periplus of the Erythraean Sea, a 1st-century travelogue written by a Greek merchant based in Alexandria, Barbaria extended from the border of Egypt just south of Berenice Troglodytica to just north of Ptolemais Theron. From there to the Bab-el-Mandeb was the kingdom ruled by Zoskales, after which the "rest of Barbaria" extended to Opone. This second Barbaria was the location of the so-called "far-side" ports. In the Geography of Ptolemy, Barbaria is said to extend even further, as far south as Zanzibar, although the land south of Opone is called Azania in the Periplus. In the Periplus, Barbaria is said to lack central government and is ruled by local chiefs. Azania, on the other hand, is subject to the Sabaeans and Himyarites. In the Periplus, the inhabitants of the first Barbaria, or the Barbarike chora, include the eponymousBarbaroi, but also Ichthyophagoi, Agriophagoi and Moschophagoi. These are probably the same people as the Trogodytes of other ancient geographers. The Moschophagoi may correspond to the Rhizophagoi and Spermatophagoi of other geographers. The first contact of the Greeks with Barbaria came in the 3rd century BC, when the Ptolemies set up bases for elephant hunting. These bases remained in use as ports for the export of myrrh and frankincense throughout antiquity. There were many smaller ports that exportedtortoiseshell and ivory. The name of Barbaria is preserved today in the name of the Somali city ofBerbera, the city known to the Greeks as Malao. Arabic sourcesrefer to the coast as the Baḥr Berberā or al-Khalīj al-Berberī and its inhabitants as the Berbera or Berābir. They are the Somalis, distinguished from the Habash to their north and the Zanj to their south. From Arabic, this terminology for northeast Africa entered Hebrew, Persian and even Chinese. Most of these usages are associated with Somalia. The Chinese term, although probably derived from Berbera, refers to the coast and hinterland and not just the port.