Introduction
Picture a small bakery with one front door. On a normal morning, a steady line of customers comes through, orders a loaf, and leaves. The baker copes fine. Then one afternoon, ten thousand people turn up at once and crowd the doorway. None of them wants bread. They just stand there, blocking the entrance. The real customers cannot get in. The baker cannot serve anyone. The shop is not broken — it is buried.
That is a distributed denial of service attack, usually shortened to DDoS. It is one of the oldest tricks on the internet, and it still works, because it does not need to find a flaw in your code or steal a password. It just needs to send more traffic than your website can handle. A site that answers ten requests a second without breaking a sweat can fall over when ten thousand arrive in the same second, and the attacker does not even need a powerful computer of their own — they borrow thousands of other people's machines.
This is worth understanding even if you never run a server, because almost everyone depends on services that get attacked: banks, games, shops, schools, news sites. When one of them goes dark for an afternoon, a DDoS is often the reason. And if you do run a website, a little preparation goes a long way — the difference between surviving an attack and staying down for hours is usually decided beforehand, in the unglamorous choices about hosting and caching.
What a DDoS Attack Actually Is
A denial of service attack tries to make a service unavailable. The "distributed" part means the traffic comes from many places at once, which is what makes it so hard to stop. Blocking one attacking computer achieves nothing when ten thousand more are sending the same junk.
Think about what a website has to do for every visitor. The request arrives, the server reads it, looks something up, builds a response, and sends it back. Each step costs a little time, memory, and processing power. A normal server can handle hundreds or thousands of these per second. But every server has a limit, and once that limit is reached, new requests start queuing. The queue fills up. Real visitors get timeouts or a blank page. From the outside it looks exactly like the site is broken. From the inside, the server is working flat out on requests that lead nowhere.
The key point is that the attacker does not need to break anything. No data is stolen, nothing is deleted, and no password is guessed. The damage is the outage itself. For an online shop, an hour offline on a busy day can mean thousands in lost sales. For a game, it means angry players. Some attacks are about money — pay up or stay offline — and some are about making a point. A surprising number are simply someone showing off, or testing a tool they bought online for the price of a pizza.
The Botnet Behind the Flood
A single computer cannot take down a modern website. A home connection might push out a few hundred requests a second, and most servers would shrug that off. So attackers do not use one computer. They use a botnet: a network of machines they control without the owners knowing.
These machines are ordinary devices. A home router with a default password. A security camera that has never been updated. An old laptop with a piece of malware on it. A smart fridge, in a few famous cases. Each one is infected quietly, and then it waits. The owner notices nothing. The device still works fine. But when the attacker gives the order, every infected device starts sending traffic at the target at the same time. Ten thousand weak devices, each sending a little, add up to a flood no single server can drink from.
The largest botnets have contained hundreds of thousands of devices, spread across every country. That is what makes blocking a DDoS so frustrating. You cannot simply block a country, because the traffic comes from everywhere. You cannot block the attacking addresses one by one, because there are too many, and new ones keep appearing. And the owner of each attacking device is usually an innocent bystander whose camera or router was never patched.
The Dyn attack in 2016 is the textbook example. Dyn ran part of the internet's phone book — the DNS service that turns names like twitter.com into addresses computers can find. Attackers aimed a botnet made largely of infected cameras and home routers at Dyn, and for hours, huge parts of the internet went unreachable. Twitter, Netflix, Reddit, and dozens of others were down or crawling, not because their own servers had failed, but because nobody could find them.
Three Kinds of Attack: Volume, Protocol, and Application Layer
Not all floods are the same. Security people usually sort DDoS attacks into three kinds, and the distinction matters because each one is stopped differently.
Volumetric attacks are the simplest: sheer quantity. The attacker sends so much data that the connection to the server fills up, like a road jammed with cars. A common version abuses services that answer small questions with big replies: the attacker sends a tiny request to an open server somewhere, fakes the return address so it looks like it came from the victim, and the server replies with a response many times bigger, aimed at the victim. GitHub was hit this way in 2018, with a flood measured at over a terabit per second. GitHub stayed up, but only because it had the kind of protection most sites can only rent.
Protocol attacks are sneakier. Instead of filling the road, they exhaust something the server needs to keep track of — usually the table where it records half-open connections. The classic version is the SYN flood: the attacker starts thousands of conversations with the server and never finishes them. The server holds a slot open for each one, waiting politely for a reply that never comes, and eventually there are no slots left for real visitors. It is the equivalent of someone phoning a restaurant, asking to be put on hold, and never hanging up, until every line is busy.
Application layer attacks are the hardest to spot, because the traffic looks normal. The attacker sends requests that seem perfectly legitimate — loading the homepage, searching for a product, logging in — but sends them thousands of times a second. Each request is small, but each one forces the server to do real work: run a database query, build a page, check a password. A few hundred of these a second can bring a small site to its knees, and because each request looks like a genuine visitor, simple filters cannot tell them apart.
What It Feels Like When Your Site Is Hit
Most people first meet a DDoS attack as a mystery. The site is slow. Then it is slower. Then it stops loading entirely. You check the code — nothing changed. You restart the server — nothing improves. The hosting dashboard shows the processor pinned at full capacity and the memory full, but there is no obvious bug. If you look at the logs, the pattern is usually clear in hindsight: thousands of requests from addresses all over the world, all asking for the same page, or all hitting a search box that normally gets a handful of queries an hour.
For a small business this is a miserable afternoon. Orders stop coming in. Customers email to ask if the shop has closed. And because the site looks broken, some owners start "fixing" things — changing code, restarting databases, even switching hosts — which wastes the very time they need to deal with the actual problem. The first thing to do in any outage is to check whether the traffic itself is the problem, before touching anything else.
There is also the ransom version, which has become common enough to have its own name: ransom DDoS. It usually starts with an email. Pay a sum in cryptocurrency, the message says, or a large attack will begin on a certain date. Sometimes a small attack arrives first, as a demonstration. The honest advice from security professionals is almost always the same: do not pay. Paying does not guarantee the attacks stop, and it marks you as someone who pays, which invites a second demand. The better response is to treat the threat seriously, put your defences in place, and tell your hosting provider what is coming.
How Big Sites Absorb the Flood
The reason a site like GitHub can survive a terabit-per-second flood while a small shop falls over at a fraction of that is not better code. It is architecture — specifically, having a lot of capacity spread across a lot of places, with something in front of the server that soaks up the attack before it arrives.
The most important piece is a content delivery network, or CDN. A CDN is a network of servers spread around the world that keep copies of your site's pages and files. When someone visits your site, they usually get the copy from the nearest CDN server, not from your own server at all. During an attack, that matters enormously, because the flood hits the CDN's vast network instead of your single machine. A CDN built to handle the traffic of thousands of big sites can absorb an attack that would flatten any one server.
Closely related is anycast, a routing trick that lets the same internet address point to many servers in many cities. Traffic automatically goes to the nearest one, which spreads the flood out instead of letting it all pile onto one door. Your own server never sees most of it. The big protection services — the ones whose names you will see again and again, like Cloudflare and Akamai — combine both: a huge global network, plus the ability to spot attack traffic and drop it before it reaches you.
Caching is the quieter hero. A page that is built fresh for every visitor is expensive to serve. A page that is built once and handed out as a copy is almost free. If your homepage and product pages can be cached, an attack that asks for them a thousand times a second costs almost nothing. The pages that cannot be cached — search results, shopping carts, account pages — are the ones attackers aim at, and the ones worth protecting most carefully.
None of this is exotic. A small site can sit behind a free tier of a CDN in an afternoon. The mistake is waiting until the attack to do it. Setting up protection while the site is already down is like buying insurance while the house is on fire: possible in theory, miserable in practice.
Rate Limiting, Firewalls, and Filtering the Bad Traffic
Absorbing traffic is only half the job. The other half is telling the bad traffic apart from the good, and refusing the bad. That is where filtering comes in, and it works best in layers, each one catching what the previous one missed.
Rate limiting is the simplest layer, and it works on a principle anyone can understand: nobody needs to load the same page fifty times a second. A rate limit says that any single address can make only so many requests in a short period, and anything beyond that gets slowed down or blocked. Real visitors never notice, because people do not browse that fast. Bots do. Rate limits belong on the expensive parts of a site first — the login page, the search box, the checkout — because those are the pages an attacker can use to make the server do the most work with the least effort.
A web application firewall, or WAF, is the next layer. It looks at the content of requests, not just how many there are, and blocks the ones that match known attack patterns. A WAF is not a magic shield — attackers adapt, and a badly configured WAF will block real customers — but it takes a large class of crude attacks off the table entirely.
Then there is the human test, which most people meet as a CAPTCHA — the little puzzle that asks you to pick out the traffic lights. During an attack, a protection service can put suspicious visitors behind one of these checks, letting humans through and stopping automated traffic cold. Nobody loves CAPTCHAs, and used too aggressively they drive real visitors away. Used only when traffic looks suspicious, they are one of the most effective tools there is.
The honest truth about filtering is that it is a judgement call, made under pressure. Block too little and the site stays down. Block too much and you lock out real customers, which is the attacker achieving their goal for you. The sites that handle this well have decided their rules in advance, and they test them before they need them.
What a Small Site Can Actually Do
If you run a small website — a shop, a blog, a booking page — the advice about DDoS can sound like it was written for companies with a security team. It mostly is. But the practical steps for a small site are short, cheap, and worth doing before anything happens.
First, put a CDN in front of the site. This is the single most effective thing a small site can do, and the basic tiers of the big providers cost nothing. It also speeds up the site for normal visitors, so it is not a cost with no benefit — it is an improvement you would want anyway.
Second, turn on caching for everything that can be cached, and set sensible rate limits on the pages that cannot. Your hosting provider or CDN can usually do both with a few settings, and neither requires writing code.
Third, hide your server's real address. If attackers can find the IP address of your actual server, they can attack it directly and go around the CDN entirely. A CDN only protects you if all the traffic is forced to go through it.
Fourth, know who to call. When an attack starts, the fastest help usually comes from your hosting provider or your CDN, not from anything you can do in your own dashboard. Having their support details and your account information to hand, and knowing whether your plan includes attack mitigation, saves frantic searching in the middle of an outage.
Finally, keep a copy of the site backed up, somewhere separate. A DDoS attack does not delete data, but an attack is a bad time to discover that your backups were stored on the same server that is now unreachable.
None of these steps is expensive. Most of them are free. Together they move a small site from "down for hours" to "a bad half hour, then back", which is about as good as it gets without a dedicated security budget.
During an Attack: A Short Playbook
If it happens to you, here is the order that works. First, confirm it is an attack and not a bug: check your traffic graphs and your logs. A sudden spike from thousands of addresses, all hitting the same endpoint, is an attack. A spike from one place, or traffic that looks like your normal visitors, is something else.
Second, call your provider. Your hosting company and your CDN have seen this before, many times, and they have tools you do not. They can reroute traffic, turn on stricter filtering, and absorb far more than your server can.
Third, tighten the filters. Turn on the stricter mode your CDN offers, put the login and search pages behind a check, and consider blocking the worst-offending regions or networks if your real customers are not there. Be careful, though: every block is a guess, and an over-broad block can hurt more than the attack.
Fourth, talk to your users. A short message — on social media, or on a status page if you have one — saying the site is under attack and you are working on it, buys a surprising amount of patience.
Fifth, do not pay a ransom, and do not start rebuilding the site in a panic. The site is not broken. Wait for the traffic to drop, check the logs, and write down what happened: when it started, what it targeted, what helped. That note is the beginning of your plan for next time, and there is very often a next time.
Conclusion
DDoS attacks work because the internet was built to answer every request, and answering is expensive. An attacker does not need to outsmart your site; they only need to ask it for more than it can give, using thousands of borrowed machines to do the asking. That sounds unbeatable, and for a single unprotected server, it nearly is. But the defence is not a secret either. Spread the load across a network built for it. Cache what can be cached. Limit how fast any one visitor can ask for things. Filter the traffic that does not look human. And have a plan, and a provider to call, before the bad afternoon arrives.
Most sites will never face a serious attack. But the ones that do, and survive it with a shrug, are almost never the ones with the cleverest code. They are the ones that put a CDN in front of the site, turned on caching, and decided in advance what they would do. Those are small, boring steps. They are also the whole game.
Frequently Asked Questions
What is a DDoS attack in simple terms? A DDoS attack is when thousands of computers send junk traffic to a website at the same time, overwhelming it so real visitors cannot get through. The site is not hacked or broken; it is simply too busy answering fake requests to serve real ones.
How is a DDoS attack different from normal heavy traffic? Normal heavy traffic comes from real people who want something from your site, and it rises and falls in patterns that make sense — a sale, a news story, a viral post. Attack traffic comes from thousands of addresses at once, often asks for the same page repeatedly, and does not behave like a human browsing.
Can a small website really be a target? Yes. Attackers often target small sites precisely because they are unprotected, and because a small attack is enough to take one down. Some attacks are personal, some are ransom attempts, and some are simply someone testing a tool. Being small does not make you invisible; it makes you cheap to attack.
Does a CDN stop a DDoS attack completely? A CDN stops most attacks from ever reaching your server, because its global network absorbs the flood and filters much of the junk traffic. It is the single most effective defence a small site can use, but no single tool stops every kind of attack, which is why caching, rate limiting, and a plan still matter.
Should I pay a ransom to stop a DDoS attack? Security professionals almost always advise against it. Paying does not guarantee the attacks will stop, and it marks you as a payer, which often brings a second demand. The better response is to put your defences in place, tell your hosting provider, and report the extortion to the authorities.
Comments
Post a Comment