Browse 110+ Media and Streaming Appliances on the NetActuate Media Marketplace

Explore
Blog

Firewall Architecture, Types, and Layers Explained

Mark Mahle
•
December 4, 2026
Firewall Architecture, Types, and Layers Explained

Firewall Architecture, Types, and Layers Explained

A firewall inspects network traffic against an ordered rule set and permits or drops each packet. Firewall types are defined by inspection depth, from packet filters at Layers 3 and 4 to application layer firewalls at Layer 7. Firewall architecture defines where those enforcement points sit inside the network topology.

What Is a Firewall and How Does It Work?

A firewall works by comparing every packet against an ordered list of rules and applying the first matching action, either accept or drop.

Rules match on source address, destination address, protocol, and port number. Evaluation is sequential, so rule order changes the outcome. Any packet that matches no rule falls through to the default policy. Hardened deployments set that default to deny, which blocks all traffic unless a rule explicitly permits it.

Connection state is the second variable. A stateful firewall records active sessions in a state table and automatically permits return traffic for connections it already approved. A stateless filter evaluates each packet in isolation. That forces administrators to write mirrored inbound and outbound rules and leaves openings for spoofed response traffic.

How Do Firewalls Protect Networks?

Firewalls reduce exposed attack surface. Restricting a public server to ports 22 and 443 removes every other listening service from internet reachability, whether or not it is patched. Firewalls also help contain lateral movement, because segmented rule sets stop a compromised host from reaching production databases. What they do not do is inspect encrypted payloads by default, or stop attacks delivered over permitted ports. That is why they operate alongside DDoS mitigation and intrusion prevention rather than replacing either.

What Are the Types of Firewalls?

There are five main types of firewalls, separated by how deep into the packet each one inspects.  

  1. Circuit-level gateways verify session setup.
  2. Packet filtering firewalls read headers only.
  3. Stateful inspection firewalls track connection state.
  4. Application layer firewalls parse payload content.
  5. Next generation firewalls combine stateful inspection with application identity and integrated threat prevention.
Firewall type
What it inspects
OSI layer
Main trade-off
Packet filtering
IP addresses, ports, protocol flags
Layers 3 and 4
Fastest, but no session or payload awareness
Circuit-level gateway
TCP handshake and session setup
Layer 5
Validates sessions, ignores content
Stateful inspection
Headers plus connection state table
Layers 3 and 4
Strong default; blind to payload attacks
Application layer (proxy)
Full protocol content and payload
Layer 7
Deepest inspection, typically the highest latency cost
Next generation (NGFW)
State, application identity, signatures
Layers 3 to 7
Throughput can drop under full inspection

What Is a UTM Firewall, and How Is It Different from an NGFW?

A UTM firewall, or unified threat management firewall, is a single appliance that consolidates firewalling, intrusion prevention, antivirus scanning, web content filtering, and VPN termination under one management console.

UTM optimizes for breadth and simplicity, which suits mid-market networks with small security teams. Next generation firewalls optimize for depth on application control and user identity. The two categories overlap heavily in current products. The practical differences are often licensing model and sustained throughput under full inspection rather than feature availability.

For teams that need UTM or NGFW features, NetActuate also offers dedicated hardware firewall and third-party appliance options for custom requirements.

DESIGN REVIEW

Choosing a firewall type is the easy half. Mapping enforcement points across a distributed footprint is where most designs break down. Our engineers will walk your topology with you.

Book an architecture call →

What Are the Generations of Firewalls?

Firewalls are commonly grouped into five generations, each adding inspection depth to close a gap in the one before it.

  1. First generation, stateless packet filters. Matched packet headers against rules with no session tracking, so they could not tell a legitimate response from a forged one.
  2. Second generation, stateful inspection. Added the connection state table and closed the spoofed-response gap.
  3. Third generation, application layer and proxy firewalls. Terminated connections and inspected protocol content, catching attacks hidden inside allowed ports.
  4. Fourth generation, next generation firewalls. Merged stateful inspection with deep packet inspection, application identification, and inline intrusion prevention.
  5. Fifth generation, cloud-delivered platforms. Shared threat intelligence and automated policy response across distributed enforcement points.

Generation labels vary by vendor, but the progression from headers to state to content holds across most accounts.

What OSI Layer Does a Firewall Operate At?

Most network firewalls operate at Layers 3 and 4, and application layer firewalls operate at Layer 7. No single OSI layer answers the question for every firewall, because the layer is a property of the inspection method rather than of the device.

‍

OSI layer
What is visible
Firewall category
Layer 2 (data link)
MAC addresses, VLAN tags
Transparent or bridging firewall
Layer 3 (network)
Source and destination IP
Packet filter
Layer 4 (transport)
TCP and UDP ports, flags, state
Stateful inspection firewall
Layer 5 (session)
Session establishment
Circuit-level gateway
Layer 7 (application)
HTTP headers, payload, protocol logic
Proxy firewall, web application firewall (WAF)

‍

The line between Layer 3 and Layer 4 is blurry in practice. Many products described as Layer 3 firewalls also match on ports and protocols, which makes them Layer 3 and 4 in OSI terms. A Layer 8 firewall is vendor terminology for identity-based policy that maps rules to authenticated users. There is no eighth layer in the OSI model.

INCLUDED, NOT LICENSED

NetActuate's stateful cloud firewall filters on IP, port, and protocol, with rule sets you assign per VM from the portal or API. It is included with the IaaS platform at no additional charge. No per-rule fees, no connection-based capacity units.

Request a quote →

What Are the Main Firewall Architectures?

Firewall architecture defines where enforcement points sit relative to the assets they protect. Three models cover most production deployments: screened host, screened subnet, and distributed.

Screened Host, or Single Firewall Architecture

One firewall separates the internet from the internal network, with a DMZ on a third interface. A DMZ, or demilitarized zone, is an isolated segment for public-facing services. Public services live in the DMZ and internal systems sit behind it. The model is inexpensive and easy to reason about, but the entire perimeter depends on one device and one rule set, so a single misconfiguration can expose everything.

Screened Subnet, or Dual Firewall DMZ Architecture

Two firewalls sandwich the DMZ. The external firewall permits only public-facing traffic inbound. The internal firewall permits only specific application traffic from the DMZ to internal systems. An attacker who compromises a DMZ host still faces a second enforcement point running a different rule set, ideally on different vendor code. This is a common pattern for regulated environments and for data center firewall design.

Distributed Firewall Architecture

Enforcement moves from the perimeter to the workload. Each server carries its own rule set, applied at the interface level, so traffic between servers is filtered rather than trusted by default. Distributed models are among the most effective ways to contain lateral movement inside flat cloud networks and across overlay networks. They also scale without funneling internal traffic through a chokepoint appliance.

On NetActuate, firewall sets apply rules to individual virtual machine network interfaces. You can assign them per VM, at deployment, or as an account-wide default.

Why Architecture Matters More Than Firewall Type

Inspection depth determines what a firewall can detect. Placement determines what it gets to look at. Most firewall comparisons end at the feature table, which is the wrong place to stop.

A next generation firewall deployed as a single perimeter device on a flat network inspects north-south traffic thoroughly but has little visibility once an attacker is inside. A basic stateful filter applied per workload in a segmented architecture can see lateral connection attempts as they happen.

Placement is the variable many teams under-invest in, because improving it requires network design work rather than a purchase order. For cloud and edge deployments, the practical answer is to enforce at more than one boundary:

  • Per-instance rules handle workload isolation.
  • Gateway rules on a VPC control what enters the private network.
  • VRF segmentation and encrypted WireGuard tunnels on Cloud Routers, orchestrated by Magic Mesh, handle inter-site traffic.
  • Upstream DDoS mitigation absorbs volumetric floods before they reach any of the above.

This mirrors the layered model NetActuate uses for DDoS defense: upstream filtering at the network edge, edge rules and rate limiting, then per-host firewall rules closest to the application.

Frequently Asked Questions

What is the difference between a stateful and a stateless firewall?

A stateful firewall tracks active connections and automatically allows return traffic for sessions it already approved. A stateless firewall judges each packet on its own, so administrators must write rules for both directions. Stateful filtering is the common default because it blocks unsolicited inbound packets with fewer rules.

How do firewalls affect website performance?

Stateful filtering at Layers 3 and 4 typically adds negligible latency. Deep packet inspection and TLS decryption are the expensive operations and can reduce appliance throughput significantly. Size for inspected throughput rather than raw interface speed. Terminate TLS once, at a Layer 7 load balancer, so the same traffic is not decrypted twice.

What is the difference between a network firewall and a WAF?

A network firewall filters traffic by IP address, port, protocol, and connection state at Layers 3 and 4. A web application firewall (WAF) inspects HTTP requests at Layer 7 for attacks such as SQL injection and cross-site scripting. Most web-facing deployments use both: the network firewall limits what can connect, and the WAF inspects what those connections carry.

What is the difference between a hardware and a software firewall?

A hardware firewall is a dedicated appliance that sits in the network path, often at the perimeter. A software or cloud firewall runs as a service on the host or platform and is managed through a portal or API. Cloud firewalls fit distributed workloads, while appliances suit teams that need specific vendor features or dedicated inspection capacity.

How does an IPS differ from a firewall?

A firewall decides whether a connection is allowed based on policy. An intrusion prevention system inspects allowed traffic for known attack signatures and behavioral anomalies, then blocks matches. The firewall answers whether a connection should exist. The IPS answers whether a permitted connection is malicious.

How do data diodes compare to firewalls?

A data diode enforces one-way transfer through physical hardware, which makes reverse flow impossible rather than merely disallowed. A firewall enforces bidirectional policy in software and can be misconfigured or bypassed. Diodes appear in industrial control and classified environments where assurance outweighs flexibility.

Which type of firewall is considered the most secure?

Application layer firewalls provide the deepest inspection, because they terminate connections and parse protocol content before forwarding. In practice, the strongest posture usually comes from combining deep inspection with good placement, such as proxy-based inspection inside a screened subnet architecture.

How do hackers get through firewalls?

Rarely by defeating the firewall itself. The common paths are permitted ports carrying malicious payloads, credential theft against exposed services, overly broad rules left in place after a change, and traffic that never crosses the perimeter because the attacker is already inside it.

NEXT STEPS

NetActuate operates edge infrastructure in 50+ global locations, with per-VM firewall sets, VPC gateway rules, and always-on DDoS mitigation available on one platform. Tell us what you are protecting and we will help map the enforcement points.

Talk to our team →

‍

‍

‍

‍

Related Blog Posts

Explore All
external-link arrow

Book an Exploratory Call With Our Experts

Reach out to learn how our global platform can power your next deployment. Fast, secure, and built for scale.
Anycast Connectivity
50+ Global Locations
24×7 Expert Support