Skip to main content

Firewall and its types

Short answer

A firewall filters traffic between trusted and untrusted networks based on security rules. Types: packet-filtering (checks headers), stateful inspection (tracks sessions), application gateway (proxy, layer 7), circuit-level, and personal firewall. They cannot prevent insider attacks or viruses in allowed traffic.

What is a firewall? Explain its types.

A firewall is a hardware or software system placed between a trusted internal network and an untrusted external network (such as the Internet) that monitors and filters all traffic according to a set of security rules, allowing authorised traffic and blocking the rest.

 Internet --> [ FIREWALL ] --> Internal network
              permit / deny

Types

  1. Packet-filtering firewall: works at the network/transport layer. It checks each packet's header (source/destination IP, port, protocol) against rules and drops or forwards it. Fast and simple, but cannot examine the data and is weak against spoofing.
  2. Stateful inspection firewall: also remembers the state of connections (e.g. TCP handshake) and allows only packets that belong to an established session. More secure.
  3. Application-level gateway (proxy firewall): works at application layer; the client connects to the proxy, which makes the request for it. It can examine the content (HTTP, FTP, mail), but is slower.
  4. Circuit-level gateway: checks TCP handshakes to see that a session is legitimate, without looking at the data.
  5. Personal (host-based) firewall: software on a single computer.
  6. Next-generation firewall (NGFW): combines the above with intrusion prevention and deep packet inspection.
TypeLayerStrengthWeakness
Packet filter3–4Fast, cheapNo content checking
Stateful3–4Tracks connectionsMore memory
Application proxy7Deep checkingSlower

Limitations: it cannot stop insider attacks or viruses carried in allowed traffic.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 8 questions →