Our DS is respectful most of the time. He has the odd lapse (but then so do I) but he's quick to apologise if he does. But then we're respectful to him. He's allowed to say 'can I finish this first' if we ask him to do something (not always getting the answer he wants but he's entitled to ask).
We're trying to bring him up to give and EXPECT respect. And I think it works. I've heard him on the phone saying 'no X, speak to me nicely or don't speak to me at all. I'm not carrying on the conversation if you're going to be rude' to his best friend - which is quite right. There's good and there's a doormat. He has to be guided on how to be the first and not the second.
We've tried hard to listen to him when he tries to explain if he's feeling 'growl-y' - his way of trying to put the hormonal peaks and troughs into words. We try to cut a bit of slack then, hugs if he wants them, peace and quiet if he prefers that. He's a child, not a robot. But we expect him to get control and behave well as soon as he can.
We've always followed through with any 'threats' so we've always been careful to make sure they are in keeping with the problem. There's no point in saying 'that's it, the x box is confiscated for a week' because they forgot to make their bed one day. Or the classic 'your birthday party/Christmas presents/day out at Legoland is cancelled if you don't behave' knowing full well you'll not do it. No mixed messages. I honestly don't remember the last time we had to follow through though. He knows we mean what we say so he doesn't push it. It's a lot easier to say to a five year old 'right, no Octonauts this afternoon' and switch the TV off for that one programme, than to confiscate their favourite toy for a week for a tiddly little thing. That way they learn you'll follow through, fairly, rather than you having to feel awful for over reacting and your child obeying because they're frightened of you.
We probably followed what a lady did when we were on our first holiday with DS when he was about a year old. She had asked her DS to behave as he was kicking his sister under the table at dinner. He did it again causing a massive fight at the table. Mum quietly and gently got the boy up in her arms, walked out without a word. We saw her, through the window, with her arm around him but obviously telling him off (you can tell by the body language and the stern look on her face). Then she gave him a kiss on the head and a hug. He came back in, apologised to his sister and his dad who was still at the table, sat down and it was all giggles again.
As he grew up we kept that in mind I suppose. We didn't allow DS to gather an audience when he was having a tantrum (few and far between but they happened when he was little of course). He'd be asked to stop it, given something to distract him etc. But if it started again one of us would just take him outside, tell him why it wasn't nice to behave like that, deal with it and bring him back in (always after a hug - he's our son, we don't like the behaviour but we love the boy). We'd ask him to say sorry but wouldn't push it if he wanted to silently sulk - we'd just ignore it and he'd come round when he was ready.
But, if he was behaving well we'd always give him a quick thumbs up or a hug or a 'well done - you were really kind when you helped that lady or when you held the door for that man'.
So the essence is - any 'punishment' should be in keeping with the 'crime'. Explanation of what is acceptable. Lots of praise when they're doing it right. Quiet telling when they're doing it wrong.
But start it young. I always remember Jo Frost (the TV nanny) saying to a woman 'when are you going to stop that behaviour (kicking her) in your son? It's fine when he's four and you can lift him out of the way but when he's fourteen and a foot taller than you he will do you some damage. Stop him at four'.