North Korea - far from being a Chinese "attack dog" or satellite is a vehemently independent country, which China is trying to rein in. US threats are simply making that more difficult.

As China makes no effort to hide its growing exasperation with both Washington and Pyongyang, now is perhaps a good moment to discuss the complex relationship between China and North Korea.

Korea borders China and relations between China and Korea have an exceptionally long history, to the very start of the Korean state at roughly the time the Roman empire was forming in Europe. Any visitor to Korea - North or South - cannot fail but notice the huge and deep influence of Chinese culture on Korea. By comparison US influence in South Korea seems ephemeral.

This long interaction has not however always been happy with the Koreans - a proud and passionate people - often allied to China, but also sometimes resisting Chinese attempts to dominate them.

This provides the essential background to understanding the present relations between North Korea and China. Though both are nominally Communist countries and though China's military intervention in 1950 was critical to North Korea's survival, the North Korean leadership is wary of China and resistant to any Chinese action which it sees as intended to dominate itself.

This is what ultimately lies behind Kim Il-sung's Juche ideology. Its extreme doctrine of national self-reliance is ultimately an expression of North Korea's determination to maintain the greatest possible distance that it can from China, the one country which could theoretically achieve political and economic dominance over it. Since total independence from China can, for North Korea however, never be more than an aspiration, this is never expressed openly, leading to confusion in the West about what Juche actually means. However North Koreans and China's leadership can hardly have any doubts about it.

That Juche is in fact a doctrine intended to keep North Korea independent of China and is incidentally shown by North Korean practice during Kim Il-sung's lifetime. In reality, far from being totally self-reliant or even aspiring to be so, up to the point when the USSR collapsed, North Korea was actually tightly integrated into the Soviet economy. Only after the USSR collapsed did the extent of this - and of the closeness of Soviet and North Korean political ties - become clear. Since Juche was and is aimed first and foremost at China, this did not worry Kim Il-sung or his officials over-much, if it concerned them at all.

North Korea's ballistic missile and nuclear weapons program follows the same rationale. The solution to increasing US pressure which might have been followed by a more conventional regime after the USSR collapsed would have been to ally North Korea closer to China. China after all is in a position to provide North Korea with all the economic assistance it needs and to provide it with security guarantees. However, that would have made North Korea dependent on China, and potentially subservient to it. Since that would have been contrary to the North Korean leaders' determination to achieve the greatest possible degree of independence from China, they chose to seek security by developing ballistic missiles and nuclear weapons instead.

Since North Korea's ballistic missile and nuclear weapons program is as much intended to assert North Korea's independence from China as it is to deter the US, it is completely unsurprising that the Chinese oppose it. Besides from their point of view by increasing regional tensions, it works against Chinese interests.

The Chinese, for example, have in recent years been working hard to develop a close relationship with South Korea. North Korea's ballistic missile and nuclear weapons program has put that in jeopardy and has tightened South Korea's connections to the US.

The Chinese also cannot be happy that North Korea's development of ballistic missiles and nuclear weapons is increasing the prospects that countries which might feel threatened by North Korea - such as South Korea and Japan - might decide at some point to acquire their own ballistic missiles and nuclear weapons as well.

In the case of Japan - which conducted a prolonged and horrific war of aggression against China during the first half of the twentieth century - and with which China still has extremely prickly relations, the prospect of Japan one day acquiring ballistic missiles and nuclear weapons which could potentially reach China is for the Chinese leadership and people an especially great cause for concern.

China therefore has good reason to dislike the North Korean ballistic missile and nuclear weapons program and to want to end it. However precisely because the North Koreans have developed their ballistic missile and nuclear weapons program in part in order to distance themselves from China, China has only limited leverage over North Korea to end it - a point the Chinese repeatedly make but which the West is deaf to.

In reality, far from North Korea being China's "attack dog" - as some Western commentators profess to think - the truth is almost the diametric opposite, and the whole thrust of Chinese policy for years has not been to incite North Korea forward but to rein it in.

This truth is so obvious to anyone who makes any serious study of Chinese-North Korean relations, that it says much about the delusional quality of Western discourse about North Korea and China that so few can see it.

However, if China and North Korea have a tense relationship - and have had one ever since the Korean War - there is, despite the tension and mutual dislike at times, a shared dependence - much as there was between China and North Vietnam during the Vietnam War.

China is indeed North Korea's most important economic partner and the main source of such technology as North Korea imports, though the extent of this may be exaggerated since the whole point of Juche - still very much the dominant policy and ideology of North Korea - is to limit this as much as possible. China's role in the North Korean economy - and its trade with North Korea - may only look big because everyone else is so small. The fact that North Korea's annual exports last year were said to be just $3 billion shows how unimportant to North Korea's economy foreign trade actually is. My guess is that the only product North Korea buys from China that really matters to North Korea, and which it would struggle to replace internally, is oil. Importantly the Chinese have consistently ruled out the idea of an indefinite embargo on their oil exports to North Korea precisely because they know that that is the one step which might cause an internal crisis there which could put Kim Jong-un's position in jeopardy.

More importantly for North Korea than the economic relationship with China is the fact that China is the regional colossus which came to its rescue in 1950, and which continues to counter-balance the US in the region. It is because the relationship with China - however tense and unhappy - is crucial to North Korea's security that North Korea cannot ignore it.

The same is also true for China. Though China makes no secret of its disapproval of North Korea's ballistic missile and nuclear weapons program and indeed of its general dislike of North Korea's entire Juche policy, the fact remains that China considers the survival of an independent North Korea as vital for its national security, just as it did when it intervened militarily to prevent North Korea's collapse in 1950.

The Chinese have made it very clear what they want to see in the Korean Peninsula: total denuclearization, with North Korea giving up its nuclear weapons and ballistic missiles and the US withdrawing all its troops from the Korean Peninsula, and with North Korea establishing diplomatic relations with South Korea and the US and reforming its economy and political system on Chinese lines. The Chinese are no doubt confident that were that to happen the two Koreas - North and South - would be drawn into China's orbit, and would become for China an important economic partner and a counter-balance to Japan.

In order to achieve this the Chinese will exert pressure on North Korea - including by way of sanctions imposed via the UN Security Council, though they adamantly oppose sanctions imposed unilaterally - but they will act decisively to stop any attempt to overthrow North Korea's government.

This is a difficult policy to implement given North Korean attitudes to China, if only because it creates a standing temptation to North Korea's leaders to increase tensions with the US in order to obtain greater support from China. A wise US policy would understand this, and would see that responding to North Korean actions by increasing tensions further will only increase China's support for North Korea, which is exactly what North Korea wants.

A much wiser policy - indeed in the context of the regional tensions in the Korean Peninsula the only wise one - is to work with the Chinese to achieve the broad settlement of the conflict in the Korean Peninsula that the Chinese want and which is also in the US interest. That means doing what the Chinese suggest, which is talking to Pyongyang.