Imagine you are walking down the street, chatting with friends about politics or a traumatic experience in life when a stranger comes up and interrupts the conversation.

“I wish you would die”, the stranger says. “You’re a c**t”. I wish someone would shoot you.”

What would the reaction be - simply to shrug and say, well that’s the modern world for you? Or deem it as aggressive, threatening behaviour that should be challenged and dealt with by police?

With the rise of social media platforms such as Twitter and Facebook, there has been a well recognised increase in online abuse. The ability to post comments anonymously or hide behind a false identity has led to a boom in harassment to which no-one is immune: from ordinary members of the public to politicians and the rich and famous. But it the problem is getting worse, not better.

In just one recent example, singer Lily Allen announced earlier this month she was taking a break from Twitter after being taunted about the stillbirth of her son. “My timeline is full of the most disgusting, sexist, misogynistic racist s**t,” she wrote. “Really, new levels.”

So-called trolling - deliberately posting abusive and bullying comments on networking sites - is hardly new. With an estimated 1.86 billion users on Facebook and more than 300 million users on Twitter it is one which will take effort to address.

There are some examples of action being taken by the police and courts against the worst offenders. High profile cases in the past include Sean Duffy, from Reading, who was convicted in 2011 after mocking a 15-year-old who committed suicide and leaving obscene messages on a condolence page set up by her family. He was later also convicted of posting an offensive doctored image online of a teenager who was accidentally shot by her boyfriend in Moray.

In 2014, Stewart McInroy received a 10-month sentence after sending a message to the father of a missing man from Glenrothes claiming he had “brutally tortured and murdered” his son.

Speaking after the sentencing, the father Allan Bryant Snr told of the devastating impact of receiving the messages saying: “It caused heartache beyond words.”

McInroy was later jailed for a second time after sending a barrage of abuse against an ex-girlfriend via Facebook.

The number of complaints to police about behaviour on social media show how the problem has risen sharply in recent years. In 2014, police in Scotland received nearly 3000 reports of threatening or abusive behaviour on networking sites such as Facebook and Twitter – more than twice the 1300 total in 2012.

Yet it cannot be a problem which can be dealt with solely by the police and courts. Twitter has long been criticised for not doing enough to target the trolls which plague its site. It has announced a number of changes in recent weeks to address the problem, including updating how abusive Tweets can be reported and stopping the creation of new abusive accounts, as well as actively trying to identify accounts engaging in abusive behaviour even if they have not been reported. But how effective these new measures will be remains to be seen.

Facebook has mechanisms in place to allow reporting of abusive comments, but has also been criticised for failing to do enough to tackle the issue.

One argument which is often used by opponents of any crackdown is that measures to prevent trolling behaviour would be a potential threat to freedom of speech.

However, the right to express an opinion does not equate to the right to dish out abuse, as pointed out last month by shadow home secretary Diane Abbott, who has frequently spoken out about racist and sexist abuse she has suffered online.

Calling for Facebook and Twitter to do more to shutdown people sending these kind of messages, she said: “No-one has a right to peddle this racist and sexist abuse."

It is not enough to dismiss trolls sending abusive and disturbing messages as an inevitable but unpleasant part of the world of social media or tell people to log off if they want to avoid being a target of criminals hiding behind a keyboard.

Aggressive, threatening behaviour needs to become as unacceptable in the digital world as in the real world - and the only step which will ensure that is the police, the courts and social media firms working in together to bring perpetrators to justice.