---
title: "Firewall and its types"
subject: "Operating System"
chapter: 8
key: "semester_6/operating_system:firewall-types"
source: https://www.bctengineer.com/q/semester_6/operating_system/firewall-types
site: BCT Engineering
---

# Firewall and its types

Operating System · Chapter 8: Security

- Asked in: year not given
- Video: [Firewall Types - CompTIA Security+ SY0-701 - 3.2](https://www.youtube.com/watch?v=mq1HRM-zGtQ) — Professor Messer
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/firewall-types
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-8

## Question

What is a firewall? Explain 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.

## Answer

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.

```text
 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.

| Type | Layer | Strength | Weakness |
|---|---|---|---|
| Packet filter | 3–4 | Fast, cheap | No content checking |
| Stateful | 3–4 | Tracks connections | More memory |
| Application proxy | 7 | Deep checking | Slower |

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

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is the basic job of a firewall placed between a trusted internal network and the Internet?
   A. Monitor traffic and allow or block it according to security rules
   B. Encrypt every packet that leaves the internal network
   C. Assign IP addresses to internal hosts
   D. Speed up Internet access by caching all pages
   Answer: A. A firewall filters all traffic against a set of rules, permitting authorised traffic and blocking the rest. (Key point: Purpose of a firewall)

2. A packet-filtering firewall decides to forward or drop a packet by examining which information?
   A. The application data inside the packet, such as the email text
   B. The packet header: source/destination IP, port and protocol
   C. The history of all earlier packets in the session
   D. The user's login password
   Answer: B. Packet filters work at network/transport layer and check only header fields against rules, so they are fast but cannot inspect content. (Key point: Packet-filtering firewall)

3. How does a stateful inspection firewall improve on a simple packet filter?
   A. It works only at the application layer
   B. It checks only the source IP address
   C. It tracks connection state and allows only packets that belong to an established session
   D. It removes viruses from the data
   Answer: C. Stateful firewalls remember the state of connections (e.g. the TCP handshake), so unrelated or spoofed packets are rejected. (Key point: Stateful inspection)

4. Why is an application-level gateway (proxy firewall) slower but more thorough than a packet filter?
   A. It only reads TCP handshakes
   B. It makes the request on the client's behalf and examines the content of HTTP, FTP or mail traffic
   C. It works only on a single host
   D. It uses a smaller rule set
   Answer: B. The client connects to the proxy, which inspects application content and then makes the request, which gives deep checking at the cost of speed. (Key point: Application-level gateway)
