Internet Policy & Society

How National Firewalls Work

How countries filter internet traffic at scale, where the filtering sits, and why it blocks more than intended.

Key takeaways

  • National filtering usually combines border gateways, equipment inside providers and legal duties placed on companies.
  • Techniques include DNS manipulation, address blocking, name filtering, traffic inspection and throttling.
  • Filters can follow a blocklist, a stricter allowlist or a mix, and each brings different errors.
  • Overblocking, performance costs and an arms race with encryption are built into the design.
  • Law and corporate compliance are often as important as the network equipment.

A national firewall is a country-wide system of technical filters and rules that controls what internet traffic people inside the country can reach. It isn't one giant box. It is usually a combination of filtering equipment at international connections and inside providers, official blocklists, laws that require companies to cooperate and domestic services that fill the space left by blocked ones.

This explainer describes the architecture and its trade-offs, so you can understand reports about it. It doesn't cover ways to defeat filtering.

An ordinary firewall, scaled up

A firewall on a home router or company network decides which traffic may pass according to rules. A national system applies the same idea at an enormous scale and with goals set by the state. Instead of protecting a network from attackers, it restricts what its users can reach, and sometimes watches what they do.

The scale creates problems an office firewall never faces: huge traffic volumes, many providers, constantly changing websites and encrypted connections. No system filters everything perfectly, so designers choose where to be strict and where to accept leaks.

Where the filtering sits

A request passing through national filtering
1 Your device Asks for a name or address. 2 Local provider May apply required DNS or filter rules. 3 National backbone Inspection equipment checks traffic. 4 International gateway Few border links allow central control. 5 Foreign service Reached only if nothing blocks it. Your device Asks for a name or address. 1 Local provider May apply required DNS or filter rules. 2 National backbone Inspection equipment checks traffic. 3 International gateway Few border links allow central control. 4 Foreign service Reached only if nothing blocks it. 5

Central chokepoints. If international traffic passes through only a handful of state-controlled gateways, equipment there can inspect or block much of what crosses the border. Countries with this layout find centralized control easier.

Distributed filtering. Where many providers have their own international links, authorities instead require each to install equipment or apply blocklists. Russia's approach since a 2019 "sovereign internet" law, for example, has involved state-managed inspection devices placed in operators' networks. Distributed systems can be patchy because providers differ.

Endpoints and services. Filtering can also move into apps, app stores, domestic platforms and device requirements, so the network doesn't have to do all the work.

The main techniques

Technique What it does Typical side effect
DNS manipulation Gives wrong or empty answers for blocked names Caching can spread bad answers further
IP blocking and routing Drops traffic to listed addresses Takes down co-hosted sites
Name filtering in handshakes Reads server names to cut connections Fails if names are hidden
Deep packet inspection Classifies traffic by content and pattern Costly, can misclassify
Connection reset injection Sends forged messages that end a session Looks like a network fault
Keyword filtering Matches words where text is visible Catches innocent uses
Throttling Degrades selected traffic Hard to attribute

The most widely studied example, often called China's Great Firewall, combines several of these and has changed over many years. Researchers outside the country infer its behavior by measurement, since its operators don't publish a full design. Treat very specific claims about its internals with care.

For a user's view of the symptoms, see censorship methods explained.

Who builds and runs it

Running national filtering takes institutions as much as machines. A regulator or security agency typically decides what to block. A registry or list is distributed to providers, often with deadlines for compliance. Providers apply it using equipment they buy or are supplied with. Inspectors and fines check compliance.

Commercial filtering and inspection products developed for corporate networks and carriers can be adapted to this role. That has led to debate over export controls and the responsibility of vendors, a question related to restrictions on network equipment.

Lists need maintenance. Addresses change, sites move, and new services appear. Automated classifiers can add entries at scale, but they also add errors that affected owners may never be told about. The quality of an appeals process says a lot about how a system behaves in practice.

Measuring from outside

Because operators rarely document their systems, outside researchers infer them. They send test requests from inside and outside a country, compare DNS answers, record which connections are reset and look at where along a path interference seems to occur. Tools that trace network routes can suggest the hop where a packet is altered, though results require careful interpretation.

Findings change over time, and different regions or providers in one country may behave differently. A block can be switched on around a sensitive date and lifted afterward. Good reports state the date, networks tested and method, so others can repeat them. Volunteers who run such tests in restrictive places should understand the legal and personal risk before they start.

Blocklists and allowlists

A blocklist (deny list) permits everything except what is listed. It is simpler to start but never complete, since new sites appear constantly. An allowlist permits only approved destinations. It is far stricter and far more disruptive, because unlisted services, including many ordinary business tools, simply fail.

Two filtering philosophies
Blocklist Open unless listed Needs constant updating Misses new or renamed sites Less disruptive to commerce Allowlist Closed unless approved Predictable for the censor Breaks many ordinary services Heavy approval burden VS Blocklist Open unless listed Needs constant updating Misses new or renamed sites Less disruptive to commerce Allowlist Closed unless approved Predictable for the censor Breaks many ordinary services Heavy approval burden

Some systems use blocklists normally and tighten during crises.

Some countries also build a domestic network, a set of national services designed to keep working if foreign links are restricted. Iran's national information network is a frequently cited example. Domestic services can also make isolation cheaper for the government, since banking and government portals stay online.

Law and corporate duties

Equipment is only part of the system. Rules commonly require:

  • licensing of providers and international connections;
  • storage of certain data inside the country;
  • identification of users when they sign up for phone or internet service;
  • companies to remove listed content within set time limits;
  • foreign firms to appoint local representatives;
  • penalties for hosting or sharing banned material.

Because companies fear losing licenses, they often remove more than the law strictly requires. This outsourced moderation is invisible to a network test. Data storage requirements connect to data residency and sovereign clouds and to cross-border data transfers.

Why filters make mistakes

Web architecture works against precision. Thousands of sites may share one address behind a reverse proxy or a content delivery network. Blocking an address to remove one page can silence all of them. Blocking a large cloud provider's range can break payment systems, software updates and business tools at once.

Encryption pushes the same way. When a filter can't read which page you requested, the choice often becomes block the whole service or allow it. Standards that hide even the server name narrow the options further. Authorities may then block the newer protocol, pressure companies, require local certificates or inspect traffic patterns, and engineers respond with further changes. The back-and-forth continues.

Requiring users to trust a government-controlled certificate so that traffic can be decrypted is an especially serious step, because it undermines the protection HTTPS provides. Browser makers have acted against such attempts in at least one well-publicized case. See how certificate authorities work.

A hypothetical collateral-damage case

Say an authority orders providers to block one page that criticizes a local official. The page sits on a shared hosting service that also serves a clinic's appointment form and hundreds of small shops. With an HTTPS connection, the provider can't see which page a visitor asked for, so it can block the server name, if the page has its own, or the shared address.

Blocking the name might affect only that publication. Blocking the address takes the clinic and the shops offline too. They get no notice and may spend days blaming their web developer. A system with public lists and quick appeals would shorten that confusion. A system without them leaves the owners to guess.

Costs and consequences

Filtering carries real costs. Inspection adds delay and expense. Blocked foreign tools can hamper developers, researchers and exporters. Domestic champions may benefit from reduced competition. Users learn to doubt whether a failure is censorship or an ordinary fault, which can itself discourage searching.

Governments that run such systems argue that they protect social stability, national security, culture and children, and that they let a country set its own rules online. Critics argue they violate rights to seek and receive information, hide wrongdoing and fragment the global network, a risk discussed in the splinternet. Democracies also block some categories of content, so debates often turn on transparency, legal process, scope and independent review.

Questions to ask about any filtering plan

  1. What categories are blocked, and is the list or its criteria public?
  2. Who can order a block, and does a court review it?
  3. Can a site owner find out and appeal?
  4. How are mistakes detected and fixed?
  5. Are blocks time limited and reported in public?
  6. What new surveillance capability does the equipment create?

The last question matters because the same inspection hardware that blocks a page can often record who tried to open it.

Reading reports sensibly

When a story says a country "blocked" a service, look for who measured it, on which networks and for how long. A block on one mobile operator differs from a nationwide one. Check whether the evidence comes from repeated network tests, official orders or user complaints. Remember that travelers and businesses are also subject to local law; check official travel guidance and your organization's legal advice before assuming a tool you use at home is permitted elsewhere.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in Internet Policy & Society →

Latest news on this topic