Understanding Firewalls: What You Need to Know About Cybersecurity

Cybersecurity has become one of the most talked-about fields in technology, and for good reason: nearly every part of modern life now depends on networks that can be attacked, disrupted, or exploited. Before diving into advanced topics like penetration testing or malware analysis, it helps to understand the basics of how networks communicate and how they are protected.

 

In this article, I’ll share my perspective on the fundamentals of networking and security, and then explore the device that I believe sits at the heart of almost every network defense strategy: the firewall.

  
1. Why Networking Knowledge Comes First

A useful mental model here is the OSI (Open Systems Interconnection) model, a conceptual framework published by the International Organization for Standardization that splits network communication into seven distinct layers. Every layer has a specific job, relies on the layer below it, and provides a service to the layer above it. When a device sends data, it travels down through the layers, with each layer wrapping the data in its own header (a process called encapsulation); when the data is received, the process runs in reverse, with each layer stripping off its corresponding header (de-encapsulation) until the original message is delivered to the application.


The seven layers, from bottom to top, are:

  • Layer 1 – Physical: The actual hardware — cabling, network interface cards, hubs, and radio signals for wireless links — responsible for transmitting raw bits.
  • Layer 2 – Data Link: Handles node-to-node delivery on the same local network, using MAC addresses and technologies like Ethernet and Wi-Fi. Switches operate here.
  • Layer 3 – Network: Responsible for addressing and routing data between different networks, primarily via IP and ICMP. Routers operate here.
  • Layer 4 – Transport: Ensures data gets from one end of a connection to the other, using TCP (reliable, connection-oriented) or UDP (fast, connectionless), along with port numbers to distinguish services.
  • Layer 5 – Session: Establishes, manages, and tears down the communication sessions between two devices, coordinating dialogue so data streams don’t get mixed up.
  • Layer 6 – Presentation: Translates data between the application and the network — handling encryption/decryption (TLS/SSL), compression, and character encoding.
  • Layer 7 – Application: The layer closest to the end user, where familiar protocols like HTTP/HTTPS, DNS, SSH, and FTP operate, and where most day-to-day interaction with a network actually happens.

 

The seven layers of the OSI model, with example protocols and typical threats at each layer:

Why does this matter for security specifically? Because different attacks target different layers, and knowing the stack helps you reason about where a given threat — or a given defense — actually sits. A denial-of-service flood or IP spoofing attack typically operates at Layer 3–4, ARP spoofing and MAC flooding exploit weaknesses at Layer 2, while phishing, SQL injection, and most web application exploits target Layer 7. This is also exactly why firewall technology evolved the way it did: early packet filters could only reason about Layers 3–4 (IP addresses, ports), while modern Next-Generation Firewalls reach all the way up to Layer 7 to understand the actual application and content of the traffic — a distinction covered in more detail later in this article.

 

Understanding how protocols like TCP/IP, DNS, HTTP/HTTPS, and SSH work at their respective layers makes it much easier to identify unusual behavior, harden systems by disabling unnecessary services, and investigate incidents such as DNS spoofing or man-in-the-middle attacks — since knowing where in the stack an anomaly appears is often the fastest way to figure out what kind of problem you’re looking at.

 

Once you understand how traffic flows through a network, the next logical question is: how do you control what’s allowed to flow through it? That’s where firewalls come in.

2. What Is a Firewall?

At its core, a firewall is a network security device (hardware or software) that monitors and filters incoming and outgoing traffic according to a defined set of security policies. It sits between a trusted internal network and an untrusted external one — most commonly the public internet — and decides what traffic is allowed through and what gets blocked. A simple analogy: if your network were a building, the firewall would be the security guard at the front door, checking IDs before letting anyone in.

 

Firewalls have existed since the late 1980s, and their capabilities have evolved dramatically alongside the threats they were built to stop. It’s common to describe this evolution in generations:

  • Packet-filtering firewalls (late 1980s): The earliest firewalls simply inspected packet headers — source and destination IP addresses, ports, and protocols — at the network layer, and allowed or blocked traffic based on static rules. They had no awareness of the broader context of a connection, which made them vulnerable to techniques like IP fragmentation.
  • Stateful inspection (1990s): A major leap forward came with stateful firewalls, which track the state of active connections rather than evaluating each packet in isolation. This means a firewall can recognize that a packet belongs to an already-established, legitimate session, greatly improving both security and accuracy.
  • Application-layer and proxy firewalls: These operated at Layer 7, inspecting the actual content of application traffic and even fully separating internal and external connections by terminating and re-establishing them at the firewall itself. They offered strong isolation but were often held back by limited processing power.
  • Unified Threat Management (UTM) and Next-Generation Firewalls (NGFW): From the 2010s onward, firewalls began bundling in antivirus, intrusion detection, and other security functions. NGFWs pushed this further by adding deep packet inspection, application-level filtering, and integrated threat prevention in a single platform.
  • Cloud, virtualized, and AI-driven firewalls (today): Modern firewalls now run in containers and cloud environments, are frequently delivered “as a service,” and increasingly use machine learning to detect anomalies and adapt policies without waiting for signature updates.
3. Common Types of Firewalls

Beyond this historical evolution, firewalls today also differ by deployment model and use case:

  • Packet-filtering firewalls evaluate traffic against Access Control Lists (ACLs) — ordered sets of rules based on IP addresses, ports, and protocols.
  • Proxy firewalls act as intermediaries, fully terminating and re-establishing connections to hide the internal network from the outside world.
  • Stateful inspection firewalls track ongoing connections rather than evaluating packets individually.
  • Web Application Firewalls (WAF) protect a specific application by inspecting HTTP requests — headers, query strings, and body content — for malicious patterns.
  • AI-powered firewalls apply machine learning to detect novel, zero-day threats and to build behavioral profiles of users and devices.
  • Virtual and cloud firewalls run as software rather than dedicated hardware, enabling flexible deployment across data centers, private clouds, and public cloud platforms.
  • Firewall-as-a-Service (FWaaS) deliver firewall functionality entirely from the cloud, often through globally distributed points of presence.
4. Next-Generation Firewalls: What Sets Them Apart

A Next-Generation Firewall (NGFW) is generally considered the third generation of firewall technology. It combines the traffic-filtering capabilities of a traditional firewall with deeper, application-aware inspection — most notably in-line deep packet inspection (DPI) and an integrated intrusion prevention system (IPS). Where older firewalls operated up to Layer 4 (the transport layer) and made decisions largely based on ports and protocols, NGFWs inspect traffic up to Layer 7, giving them visibility into the actual applications generating that traffic — even when the traffic is encrypted or trying to evade detection.

 

Typical NGFW capabilities include:

  • Application awareness and control: identifying and controlling traffic by the actual application in use, rather than just the port or protocol it happens to use.
  • Deep packet inspection (DPI): examining the content of packets, not just their headers.
  • Intrusion Prevention Systems (IPS): detecting and automatically blocking malicious activity, using signature-based, policy-based, or anomaly-based detection.
  • Encrypted traffic inspection: decrypting and inspecting TLS/SSL traffic, since a large share of both legitimate and malicious traffic today is encrypted.
  • Identity- and user-based policies: integrating with identity systems (LDAP, RADIUS, Active Directory) to apply rules based on who a user is, not just their IP address.
  • Threat intelligence integration: pulling in real-time data from external threat intelligence networks to recognize new and emerging attack patterns.
  • Sandboxing and advanced malware protection: detonating suspicious files in an isolated environment to catch threats that evade traditional signature detection.

By 2026, the focus in this space has shifted somewhat: rather than simply adding more standalone features, NGFWs are increasingly evaluated on how consistently they enforce policy across a hybrid landscape of users, applications, and environments — on-premises, in the cloud, and at the network edge — as part of a broader zero-trust security strategy.

5. Keeping Firewalls Available: High Availability and Clustering

A firewall that goes down stops protecting the network — and often stops the network from functioning at all, since it typically sits directly in the traffic path. This is why High Availability (HA) design is a core part of firewall architecture in any serious enterprise environment.

In an HA setup, two or more firewalls are deployed as a cluster and continuously synchronize their state — connections, policies, and configuration — using a heartbeat connection between the devices. If the active firewall fails, a peer device can take over almost immediately, often preserving existing sessions so that user traffic doesn’t need to restart from scratch. Failover is typically triggered by conditions such as a monitored network interface going down, an unreachable destination, or a missed heartbeat.

Common HA clustering modes include:

  • Active/Passive: One firewall actively handles traffic while a second remains on standby, taking over only if the primary fails. This is the simplest and most common HA design.
  • Active/Active: Multiple firewalls simultaneously handle traffic, sharing the load between them. If one node fails, its traffic is redistributed to the remaining active nodes.
  • N+1 clustering: A pool of active nodes is backed by one or more dedicated standby nodes, offering redundancy without dedicating a full backup device to every active one.

For organizations with very high throughput or uptime requirements, some vendors go a step further with hyperscale, load-sharing firewall clusters, which can dynamically reallocate resources to handle traffic spikes and are designed to support extremely high availability targets alongside very high network throughput.

6. The Firewall Market in 2025–2026

The firewall market has also evolved structurally: analyst firm Gartner now evaluates vendors under the category of “Hybrid Mesh Firewall,” reflecting the reality that most enterprises no longer rely on a single firewall type in a single location, but instead need consistent policy enforcement across on-premises data centers, branch offices, multiple cloud providers, and remote users. In its first Magic Quadrant for this category (2025), several established network security vendors were positioned as Leaders, each emphasizing slightly different strengths — some focused on unified operating systems and purpose-built hardware for performance at scale, others on deep application visibility or on AI-driven, cloud-delivered threat intelligence. Across the market, a few themes stand out heading into 2026: the growing performance cost of inspecting encrypted (TLS 1.3) traffic at scale, the need to keep pace with automated, AI-assisted attacks that no longer wait for daily signature updates, and early moves toward built-in post-quantum cryptography to protect data that might otherwise be harvested today and decrypted once quantum computing matures.

7. Conclusion

Firewalls remain, decades after their invention, one of the most fundamental building blocks of network security — but “firewall” today can mean anything from a simple packet filter to a cloud-delivered, AI-powered platform coordinating policy across an entire hybrid enterprise. Understanding the underlying networking concepts, the historical evolution from packet filtering to NGFW, and the operational realities of keeping firewalls highly available gives you a solid foundation for almost everything else in network security. From here, the natural next steps are exploring Intrusion Detection and Prevention Systems (IDS/IPS) in more depth, Zero Trust architecture, and how firewalls fit into a broader Secure Access Service Edge (SASE) strategy.