Image copyright AP Image caption Barack Obama began a three-day visit to Vietnam on Sunday

For President Obama, Vietnam is a powerful and encouraging symbol of what his "pivot" to Asia, a rebalancing towards the world's most dynamic region announced in 2011, could be.

Here is a former enemy, a one-party, communist-ruled state, once associated in American minds primarily with a humiliating war, now an increasingly close economic and strategic partner.

Vietnam seeks US backing in its dispute with China over contested islands in the South China Sea. It seeks access to US military technology. It has been an early and enthusiastic participant in the Trans Pacific Partnership (TPP), widely seen as a US-led effort to counter China's growing influence in the region.

So there is a great deal at stake in this visit, with high hopes on the Vietnamese side that it will cement closer ties, which can endure even under a new US administration.

"Military and defence co-operation is an important component of the relationship," says Tran Viet Thai, from the Diplomatic Academy of Vietnam, referring to hopes that the US may ease restrictions on sales of military equipment.

"But we have a comprehensive partnership. And at this moment for Vietnam, trade, investment and economic development are even more important."

There are, however, still jarring differences on human rights and freedom which both sides will try hard to play down, but cannot be ignored.

As it happens, Mr Obama's visit coincides with the five-yearly election for 500 seats in the national assembly. The assembly has little power - that resides with the Communist Party, which is guaranteed the leading role in running the country and vets all candidates for the assembly.

But this year, an unusually large number of independent candidates, more than 100, put themselves forward for the 10% of seats that are allowed to be contested by non-party members.

Media playback is unsupported on your device Media caption Mai Khoi: "Everything has to change - but change in Vietnam is quite slow"

One of those independents is Mai Khoi, a popular 32-year-old singer sometimes dubbed the 'Lady Gaga of Vietnam'. Another is Nguyen Quang A, a well-known businessman-turned-dissident who had hoped to challenge the seat of the Communist party leader, Nguyen Phu Trong.

Despite official statements encouraging younger independents to stand in elections that rarely excite much public interest, the party vetted and rejected nearly every one who did.

"We were excluded unfairly, and the process was not transparent," Mai Khoi told me when we met in Hanoi after she had given a clandestine concert there.

She described how she was informed of a small error in her application by an unnamed party official, and given two hours to resubmit in person - when she was 440km (273 miles) away.

'BBC reporting must stop'

Mai Khoi made an appeal on YouTube for a meeting with President Obama, to seek his help in opening up the political system a little in Vietnam. At the time of writing, it is not clear whether that meeting will be allowed.

Nor has it been possible for us to glean any public sentiment about the Obama visit, or about the election.

All foreign journalists are subject to strict regulation by the Vietnamese authorities, with every interview or piece of filming requiring prior approval. On this trip, our team was told that we would be allowed to do nothing except report on Mr Obama's schedule, and one interview with an officially-sanctioned academic, Tran Viet Thai.

Even pointing a camera vaguely in the direction of an election poster was politely blocked by our minders.

We have now been told that our accreditation has been withdrawn, and all our reporting activities must stop. No reason was given, but in a fraught exchange with foreign ministry officials, it was suggested that I had held an unauthorised meeting with Nguyen Quang A shortly after I had arrived on Friday.

This is clearly untrue - our minder knows we were at another approved meeting at the time - but they are unwilling to withdraw the accusation.

Image copyright AFP/Getty Images Image caption Recent protests against the mass die-off of fish in Vietnam have spooked the government

Vietnam has a great deal going for it. It has a highly-motivated and young population, hungry for success, and a hard-working and low-cost workforce. Economic growth is impressive, and development agencies point to good progress in alleviating poverty and building infrastructure.

The economy stands to do even better if the TPP is ratified in the US, an uncertain prospect given the hostility of leading candidates in the election campaign there.

Communist party officials would no doubt also cite the stability and certainty created by their monopoly on power as an important factor in the country's success, compared, for example, to the weaker performance of rowdy democracies like the Philippines and Indonesia.

But the intolerance of even small signs of dissent suggests some real insecurity by the party over the support it has from the 90m Vietnamese people.

Recent protests over the unexplained mass death of fish in some coastal waters, in which the government was accused of mishandling the disaster, have rattled a party accustomed to a quiescent population focused solely on improving living standards. Those protests followed sometimes violent anti-Chinese demonstrations in recent years.

Mai Khoi's is a moderate, constructive voice of dissent. She insists she is not there to criticise the government. But there are sure to be many more like her who would like more say over how their country is run.