00->1
Learning pathStep 40 of 62Network attacks and defence ← All writeups

DoS vs DDoS Attacks, Explained

If you are reading this, you have probably seen a website "go down" under attack and heard "DoS" and "DDoS" used as if they meant the same thing, and you want to know what each really is, what the attacks look like, and what actually helps.

By the end you will be able to define DoS and DDoS and say exactly how they differ, name the three types of DDoS technique, explain reflection and amplification, describe how botnets power attacks, recall three real cases, recognise the signs, and describe what organizations do before, during and after an attack. It builds on Spoofing, Handshakes (SYN floods) and the CIA triad's availability goal in The CIA Triad.


1. What a denial-of-service attack is

NIST's glossary defines denial of service as "the prevention of authorized access to resources or the delaying of time-critical operations." (CNSSI 4009-2022; SP 800-12 adds that "time-critical may be milliseconds or it may be hours, depending upon the service provided".)

CISA puts it in plain words: a denial-of-service (DoS) attack "occurs when legitimate users are unable to access information systems, devices, or other network resources due to the actions of a malicious cyber threat actor" (CISA). RFC 4732, the IETF's analysis of DoS, says it is when one or more machines "target a victim and attempt to prevent the victim from doing useful work."

In CIA-triad terms, a DoS attack targets availability. It usually does not steal or change anything. It makes the service unusable.

Two ways to cause a denial of service

RFC 4732 separates two families:

Family How it works Example
Exploit a flaw A malformed input crashes or hangs the software A single crafted packet that triggers a software bug
Exhaust a resource (flooding) The attacker uses up a finite resource: bandwidth, memory, CPU, disk, or the number of connections the system can hold Sending more traffic or requests than the target can handle

Not every denial of service is an attack. NIST SP 800-153 notes, for wireless networks, that a DoS "can occur inadvertently, such as other electronic devices causing interference, or it can occur intentionally, such as an attacker sending large numbers of messages at a high rate to flood the WLAN."


2. DoS vs DDoS

The difference is the number of sources.

DoS DDoS
Sources One machine, or a small number (CISA/FBI/MS-ISAC) Many machines at once, often a botnet
Volume Limited by what one source can send "A significantly higher volume of traffic" (CISA joint guide)
Blocking it Traffic comes from one source or a few CISA: "increased difficulty" compared with a DoS, because the traffic comes from many sources and blocking each address is not effective
Tracing One origin to trace Harder, especially if source addresses are spoofed
NIST wording Prevention of authorized access to resources "A denial of service technique that uses numerous hosts to perform the attack"

RFC 4732 describes how the "distributed" version gets its scale: "sufficient scale can be achieved by compromising enough end-hosts (typically using a virus or worm) or routers, and using those compromised hosts to perpetrate the attack." A joint guide from CISA, the FBI and MS-ISAC (March 2024) says the main advantage of a DDoS over a DoS is "the ability to generate a significantly higher volume of traffic", and that DDoS attacks can use IP spoofing to disguise their origin.

A useful memory aid: DoS is one person leaning on a door. DDoS is a crowd, each pushing a little, so the door cannot hold. You cannot stop a crowd by removing one person.


3. The three technique types

The CISA, FBI and MS-ISAC guide groups DoS and DDoS techniques into three types. It adds that they are not mutually exclusive and attackers combine them.

Type Goal OSI layers Examples
Volume-based Consume the target's bandwidth or system resources with a massive amount of traffic, so legitimate requests cannot get through Not tied to one layer Floods of packets; reflection and amplification (section 5)
Protocol-based Exploit weaknesses in how network protocols or services work, so the target malfunctions or degrades Layers 3 (network) and 4 (transport) SYN floods and Smurf attacks
Application-layer Target a specific application or service, consuming its processing power or causing it to malfunction, rather than overwhelming the network Layer 7 (application) Attacks aimed at what a particular web application or service does

SYN flood (protocol-based)

A TCP connection starts with a three-way handshake (see Handshakes). In a SYN flood, "an attacker sends a request to connect to the target server but does not complete the connection" (CISA). RFC 4987 explains the effect: the server keeps state for every half-finished connection; when the backlog of half-open connections fills with bogus entries, real users are refused. SYN cookies are the classic defence.

Smurf attack (protocol-based)

CISA describes a Smurf attack as sending ICMP broadcast packets to many hosts, with a spoofed source address that belongs to the target, so all the hosts reply to the victim.


4. Botnets: where the crowd comes from

A botnet is a group of hijacked internet-connected devices controlled by an attacker. CISA's guidance notes that attackers typically use botnets to carry out large-scale attacks.

Mirai (2016)

CISA's alert on Mirai (TA16-288A) describes the botnet's recipe:

  • It targeted internet-connected devices such as home routers, network cameras and digital video recorders.
  • It logged in using a short list of 62 common default usernames and passwords.
  • Its source code was published at the end of September 2016, so others could copy it.

Two attacks, in CISA's account:

Date Target Size
September 2016 A security journalist's website Exceeded 620 Gbps
October 2016 The DNS provider Dyn At least 1.1 Tbps, possibly as large as 1.5 Tbps

The lesson: default passwords on connected devices become weapons aimed at someone else. See How Malware Works for botnets in general.


5. Reflection and amplification

Some attacks do not need a large botnet, because they borrow other people's servers.

  1. Reflection. The attacker sends a request to a public server but forges the source address to be the victim's. The server sends its reply to the victim. RFC 4732 describes it: an attacker "can send traffic from the spoofed source address of the victim and cause larger responses to be returned to the victim."
  2. Amplification. The reply is much larger than the request, so the victim receives far more traffic than the attacker had to send.

CISA's alert on UDP-based amplification (TA14-017A) explains why UDP is the usual choice: it is connectionless, so "an attacker can easily forge the IP packet datagram ... to include an arbitrary source IP address". It gives bandwidth amplification factors, meaning how many times larger the reply is than the request:

Protocol Amplification (CISA)
DNS 28 to 54 times
NTP 556.9 times
SNMPv2 6.3 times
NetBIOS 3.8 times
SSDP 30.8 times
CharGEN 358.8 times
QOTD 140.3 times
Memcached 10,000 to 51,000 times

CISA also lists BitTorrent, Quake and Steam protocols among the others. It states that in general a single packet can generate 10 to 100 times the original bandwidth, and recommends ingress filtering (BCP 38 and BCP 84) so spoofed packets are blocked at the source. Another point from the CISA response guidance: reflection attacks typically come from legitimate public servers, so the sources look innocent.

Real case: GitHub, 28 February 2018

GitHub's incident report describes a memcached amplification attack with an amplification factor of up to 51,000. The traffic "originated from over a thousand different autonomous systems (ASNs) across tens of thousands of unique endpoints" and "peaked at 1.35 Tbps via 126.9 million packets per second." GitHub was unavailable from 17:21 to 17:26 UTC and intermittently until 17:30 UTC. It responded by moving its traffic onto Akamai's edge network, which handled the attack. GitHub stated that the confidentiality and integrity of data were never at risk, which shows the nature of the attack: it hits availability only.


6. DDoS for hire

Attacks can be bought. "Booter" or "stresser" services sell DDoS attacks to anyone with a payment. In December 2022, as part of an international effort called Operation PowerOFF, the FBI seized 48 internet domains and six people were charged with operating such sites. According to BleepingComputer's report on the case, an FBI affidavit said these services "exist to conduct DDoS attacks on victim computers not controlled by the attacker, and without the authorization of the victim", even though some describe themselves as "stress testing." The same report quotes US Attorney Martin Estrada: booter services "allow anyone to launch cyberattacks that harm individual victims and compromise everyone's ability to access the internet."

For learners, the rule is simple. Do not point any flood or "stress" tool at a system you do not own or have written permission to test. Even a "test" against someone else's site is an attack.


7. Spotting an attack

CISA's early advice (ST04-015) lists three warning signs: unusually slow network performance, a particular website being unavailable, or being unable to access any website. The joint guide extends this to ten indicators, including:

  • Sudden network congestion or an unexplained traffic spike.
  • Unusual traffic patterns: many requests from specific IP addresses, or a lot of traffic aimed at one resource or URL.
  • Server or application crashes, and sustained high CPU, memory or bandwidth use.
  • Trouble reaching other services such as DNS servers or firewalls.
  • Disruption to VoIP or messaging.
  • A surge of spam or malicious email (an attack can be combined with others).
  • An alert from a DDoS protection service.

CISA's list is a set of symptoms, not proof: confirm with monitoring and traffic analysis, because other causes can produce some of the same signs.


8. Defence

Before an attack (CISA, FBI and MS-ISAC)

The 2024 guide lists fifteen preparation steps. The ones that matter most:

Step Why
Risk assessment and an incident response plan You need roles, contacts and predefined actions before the attack, not during it
Network monitoring and a traffic baseline You cannot see abnormal traffic if you do not know what normal is
A DDoS mitigation service Specialists with large capacity filter malicious traffic before it reaches you
CDN and load balancing Spread content and traffic across many servers and data centers
Spare bandwidth and redundancy Absorb spikes, and keep running if one path or site fails
Firewall rules and rate limiting Block known-bad traffic and cap request rates
Patching and web application security Vulnerable systems can be used to amplify attacks or be exhausted
CAPTCHA Helps tell humans from bots on sites and services
Communication plan and tested backups Keep stakeholders informed and recover quickly

Network-level controls

Control Where it helps
Ingress filtering (BCP 38, RFC 2827; RFC 3704) ISPs and edge networks refuse spoofed source addresses. This blocks reflection at the source and makes attackers traceable
SYN cookies and larger backlogs Protect servers against SYN floods (RFC 4987)
Do not be an amplifier CISA tells providers to update software and configurations to limit abuse (for example DNS response rate limiting), to "disable and remove unwanted services, or deny access to local services over the internet", and to use rate limiting
Change default passwords on connected devices Keeps your devices out of botnets like Mirai

During an attack (CISA, FBI and MS-ISAC response list)

  1. Confirm the attack with monitoring and traffic analysis.
  2. Activate the incident response plan.
  3. Notify your ISP or hosting provider. They may reroute traffic or have mitigations.
  4. Gather evidence: timestamps, source addresses, packet captures, logs.
  5. Apply traffic filtering and rate limits; use access control lists for suspicious addresses or protocols.
  6. Enable your DDoS mitigation service and CDN.
  7. Scale up bandwidth and resources if you can.
  8. Communicate with staff, customers and partners.

Tips from the guide: give the attacking addresses to your ISP, remember that reflection attacks come from legitimate public servers, and consider asking your ISP for port and packet-size filtering.

After an attack

Assess the impact, restore services, do a post-incident analysis, fix what the attack exposed, and update the plan.

What a home user can do

CISA's early advice for individuals: install antivirus software and a firewall, follow good security practices for your devices (so they do not join a botnet), and consider a DoS protection service if you run something that matters. If you think you are under attack, contact your network administrator and ISP.


9. Common mistakes

Myth The facts
"DoS and DDoS are the same thing" DoS uses one source or a few. DDoS uses many, which makes it bigger and harder to block
"A DDoS means my data was stolen" Usually not. It attacks availability. GitHub's 2018 report says data confidentiality and integrity were never at risk
"A big firewall stops DDoS" A firewall on your own link can be saturated before it sees the traffic. Large attacks need upstream capacity (ISP, CDN, mitigation service)
"Just block the attacker's IP" In a DDoS there are thousands of sources, and in reflection attacks they are legitimate servers
"Every slowdown is an attack" CISA's own list says symptoms vary. Confirm with network monitoring and traffic analysis
"Stress-testing tools are fine to try on anything" Using them on systems you do not control is an attack and is illegal in many places
"A DDoS is always a huge flood of traffic" CISA's application-layer type targets a specific application's processing power instead of overwhelming the network

Closing

A denial-of-service attack makes a service unavailable by crashing it or by exhausting its resources. A distributed attack does the same from many sources at once, usually a botnet of hijacked devices, which makes it larger and much harder to block. Attacks are volume-based, protocol-based or application-layer, and attackers use spoofed addresses and amplification to multiply their power. Defence is mostly preparation: a plan, monitoring, spare capacity, a mitigation service or CDN, ingress filtering at the network edge, and secure connected devices, so that yours do not become part of the crowd.

Keep these points:

  • DoS attacks availability. DDoS does it from many sources.
  • Three types: volume, protocol (layers 3 and 4) and application (layer 7).
  • Reflection plus amplification lets a small attacker send a big flood, using other people's servers and a forged victim address.
  • Botnets (like Mirai) are built from insecure devices. Change default passwords.
  • Ingress filtering (BCP 38) is the root fix for spoofed traffic. A mitigation service or CDN handles the volume.
  • Plan before, notify your ISP during, learn after.
  • Never test floods on systems you do not own.