LearnViz CompSci
Home / Learn / Computer Networks / Firewalls

Advanced Topic 40 of 50 Computer Networks

Firewalls

Filters permitting or blocking traffic by rules.

How it works

A firewall filters network traffic according to rules, allowing or blocking packets based on source and destination addresses, ports, protocols and connection state. Stateful firewalls track connections and allow replies automatically, while next-generation firewalls inspect applications, users and content, and web application firewalls understand HTTP attacks. Rules are evaluated in order, usually with a default deny policy.

Step-by-step walkthrough

  1. A packet arrives at the firewall.
  2. It is compared with rules from top to bottom.
  3. The first match decides, so allow 443 lets HTTPS pass.
  4. Anything unmatched falls to default deny.
  5. Stateful firewalls also remember which connections are established.

Where it is used

Network perimeters, host-based firewalls such as iptables, nftables and Windows Defender Firewall, cloud security groups and Kubernetes network policies protect systems from unwanted access.

Common pitfall

Overly permissive rules, such as any-any, or forgotten legacy rules create exposure, while rules that are too strict break applications. Rule order mistakes silently change behavior. A firewall does not stop attacks that arrive over allowed ports or through compromised internal hosts. Review rules regularly, log denied traffic and apply least privilege.

Where it fits in the course

Firewalls is topic 40 of 50 in Computer Networks, rated Advanced. It follows Proxies. The next topic is VPN.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Computer Networks quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Firewalls?
Filters permitting or blocking traffic by rules. It belongs to Computer Networks and is an advanced-level topic.
Where do people use Firewalls?
Network perimeters, host-based firewalls such as iptables, nftables and Windows Defender Firewall, cloud security groups and Kubernetes network policies protect systems from unwanted access.
What is the most common mistake with Firewalls?
Overly permissive rules, such as any-any, or forgotten legacy rules create exposure, while rules that are too strict break applications.
What should I learn before this topic?
Start with Proxies, the topic just before it in Computer Networks.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Computer Networks quiz.
Is Firewalls hard to learn?
It is an Advanced topic. Expect to read the explanation more than once and to connect it with earlier topics. Working through a small example by hand helps most.
How long does it take to learn Firewalls?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Firewalls?
Proxies, VPN, Load Balancers are closely connected. The full list is in the related topics section of this page.
What should I study after Firewalls?
Continue with VPN, the next topic in Computer Networks.

Related topics