Firewalls and Packet Filtering

Context: Information Security and Cryptography · “how to separate networks from each other?” · a barrier between a more-secure inside and a less-secure outside

Quick Revision

  • 🎯 Objective: a firewall is a barrier that filters (not blocks) traffic between an internal (more secure) and external (less secure, e.g. Internet) network per security rules, in both directions.
  • ⚡ Key Constraint: basic packet filtering is stateless and blind to context/application → it can’t stop app-layer attacks, spoofing, or traffic in encrypted tunnels, and is useless against internal attackers.

📝 What a firewall is

  • Barrier, not a wall ➔ it filters traffic; it does not completely block it. Without it, devices are visible and accessible — and if vulnerable, hackable.
  • Security rules ➔ define what passes and what is blocked, in both directions (in and out).

🔎 Packet filtering

  • Basic firewall ➔ filters packets at the Network layer (and above).
  • Filters onsource/destination IP, protocol IDs, ports, and (if stateful) the current connection stage. Uses a static filtering rule set.
  • Application detection ➔ inspects the first few bytes of the TCP/UDP header to find the application protocol + port (HTTP:80, SMTP:25).
  • Default postureinside→out usually allowed (e.g. block SNMP UDP 161/162); outside→in blocked unless explicitly permitted; non-conforming packets are dropped.

⚖️ Trade-offs

AspectAdvantageDisadvantage
DeploymentRuns on routers/computers or as an appliance (e.g. with a VPN gateway)
Cost/speedVery fast, efficient, cheap; no user interaction
ContextIgnores context/application processes; vulnerable to address spoofing
StateBasic form is stateless → can’t spot malicious packet sequences
CoverageWeak if ports are open, traffic is in encrypted tunnels, or attacks are app-layer
ScopeNo help against internal attackers or compromised inside devices; bypassed by mobile/IoT links

⚠️ Common Mistakes

  • 💡 Filters ≠ blocks ➔ a firewall selectively permits traffic per rules; describing it as “blocking all traffic” misses the point.
  • 💡 Perimeter-only ➔ once an attacker is inside (or a device is compromised, or a phone/IoT link bypasses it), the firewall offers nothing → motivates IPS and Access Control.

🧠 Active Recall