The Song court maintained diplomatic relations with Chola India, the Fatimid Caliphate of Egypt, Srivijaya, the Kara-Khanid Khanate of Central Asia, the Goryeo kingdom in Korea, and other countries that were also trade partners with Japan. Chinese records even mention an embassy from the ruler of "Fu lin" (拂菻, i.e. the Byzantine Empire), Michael VII Doukas, and its arrival in 1081. However, China's closest neighbouring states had the greatest impact on its domestic and foreign policy. From its inception under Taizu, the Song dynasty alternated between warfare and diplomacy with the ethnic Khitans of the Liao dynasty in the northeast and with the Tanguts of the Western Xia in the northwest. The Song dynasty used military force in an attempt to quell the Liao dynasty and to recapture the Sixteen Prefectures, a territory under Khitan control since 938 that was traditionally considered to be part of China proper (Most parts of today's Beijing and Tianjin). Song forces were repulsed by the Liao forces, who engaged in aggressive yearly campaigns into Northern Song territory until 1005, when the signing of the Shanyuan Treaty ended these northern border clashes. The Song were forced to provide tribute to the Khitans, although this did little damage to the Song economy since the Khitans were economically dependent upon importing massive amounts of goods from the Song. More significantly, the Song state recognized the Liao state as its diplomatic equal. The Song created an extensive defensive forest along the Song-Liao border to thwart potential Khitan cavalry attacks.