Thousands of people have lined the streets of Hamilton to pay their respects to an unarmed soldier gunned down as he stood ceremonial guard in Ottawa last week in what the prime minister called a terrorist attack.

Members of his regiment as well as scores of soldiers and police officers are marching in a procession accompanying the casket of Corporal Nathan Cirillo atop a gun carriage to Christ's Church Cathedral where his funeral is being held.

Cirillo's five-year-old son Marcus is walking behind the casket, carrying a Canadian flag and wearing the head-gear of his father's regiment.

Ron Weinberger, whose son Ryan was a close friend of Cirillo's, is among those invited to the funeral.

He says he believes something positive has come out of the tragedy of Cirillo's death, because it really seemed to unite the country.

In a message to Cirillo's regiment, the Queen expressed sorrow at his death under such "grievous" circumstances.

She also sends her deepest sympathy to all those affected by the tragedy, in particular his family members.

Prime Minister Stephen Harper and his wife Laureen are among dignitaries attending the service, which is open to invited guests only.

Proceedings are to be broadcast on screens at a sporting arena in the city, where mourners have the opportunity to gather.