←Back to Subject
Notes
Notes
Study material and explanations
Diagrams
Diagrams
Visualize concepts easily
Mnemonics
Mnemonics
Tricks to remember faster
One Night Prep
One Night Prep
Short and focused revision
Revision
Revision
Quick summary and key points
Important Questions
Important Questions
Practice most relevant questions
Notes

Firewalls & Virtual Private Networks (VPN): Types, Working & Diagrams

Study material and explanations for Unit 3

Firewalls and Virtual Private Networks (VPN)

Firewalls and Virtual Private Networks (VPNs) are the two most important perimeter defense technologies used by every company, university, and home router in the world.


Part 1: Firewalls

What is a Firewall? (In Simple Words)

A Firewall is a network security device (either hardware, software, or both) that sits as a barrier (security gatekeeper) between a trusted internal network (your college/office LAN or laptop) and an untrusted external network (the public Internet).

It inspects every incoming and outgoing data packet against a set of pre-defined security rules and decides whether to ALLOW (Pass) or BLOCK (Drop) the traffic.

💡 Real-Life Analogy:
Think of a Security Guard at the main gate of a university campus. The guard checks every visitor’s ID card:

  • Genuine students and professors with valid ID cards are Allowed inside.
  • Unauthorized strangers or suspicious troublemakers are Stopped at the gate.
    That guard is a Firewall!
How a Network Firewall Works
🌍 Untrusted InternetGenuine Traffic + Hackers
➔
🧱 FIREWALLChecks IP, Port & Security Rules
➔
💻 Trusted Internal LANOnly Safe Traffic Enters

Types of Firewalls (Must Write in Exams!)

There are 4 main types of Firewalls:

1. Packet-Filtering Firewall (Stateless Firewall)

  • Operates at the Network & Transport Layers (Layers 3 & 4).
  • Inspects each packet individually by checking its header:
    • Source IP Address & Destination IP Address
    • Source Port & Destination Port (e.g., Block Port 23 Telnet, Allow Port 443 HTTPS)
    • Protocol type (TCP, UDP, ICMP)
  • Pros: Very fast and cheap (built into standard routers).
  • Cons: Does not look inside the actual message payload and cannot remember past packets.

2. Stateful Inspection Firewall (Dynamic Packet Filter)

  • More intelligent than a simple packet filter.
  • Keeps track of active connections in a State Table (remembers whether an incoming packet was actually requested by an internal user).
  • If an external hacker sends an unrequested packet, the Stateful Firewall immediately blocks it.

3. Application-Level Gateway (Proxy Firewall)

  • Operates at the Application Layer (Layer 7).
  • Acts as a middleman (Proxy) between the internal user and the internet. The internal computer never talks directly to the external web server; the Proxy Firewall fetches the web page, inspects its actual content for malware/commands, and passes it to the user.
  • Pros: Highest security; hides internal IP addresses completely.
  • Cons: Slower because it inspects every single request in detail.

4. Circuit-Level Gateway

  • Operates at the Session Layer (Layer 5).
  • Monitors the TCP 3-Way Handshake between packets to verify that the session is legitimate, without inspecting the deep application content of every packet.

Limitations of a Firewall (What a Firewall CANNOT Do):

  1. Cannot stop Insider Attacks: If an angry employee inside the office steals data on a USB pen drive, the external firewall cannot stop them.
  2. Cannot stop traffic that bypasses it: If an employee connects their office laptop to a mobile hotspot, they bypass the company firewall.
  3. Traditional Firewalls cannot scan encrypted viruses: Unless it is a Next-Gen Firewall (NGFW), it may not detect a virus hidden inside an encrypted ZIP file.

Part 2: Virtual Private Networks (VPN)

What is a VPN? (In Simple Words)

A Virtual Private Network (VPN) is a technology that creates a safe, encrypted “secret tunnel” across a public, untrusted network (like the Internet) so that users can send and receive data as if their devices were directly connected to a private local network!

💡 Real-Life Analogy:
Imagine a glass tunnel built underwater through a shark-infested ocean, with tinted black walls. Even though you are travelling right through the public ocean (the Public Internet), the sharks (hackers) outside cannot see who you are or touch what is moving inside your Encrypted VPN Tunnel!

How VPN Tunneling & Encryption Work
🧑‍💻 Remote UserLaptop at Home / Cafe
➔
🔐 Encrypted VPN TunnelIPSec / SSL Encapsulation over Public Internet
➔
🏢 Corporate ServerVPN Gateway Decrypts Data

How Does a VPN Work? (2 Key Mechanisms)

  1. Encryption: Before data leaves your laptop, the VPN client encrypts it (usually with AES-256) so that even if your ISP or a Wi-Fi hacker intercepts it, they only see gibberish.
  2. Tunneling (Encapsulation): The encrypted data packet (along with your private IP address) is wrapped inside an outer IP packet (IPSec or SSL/TLS) and sent to the VPN Server, masking your real IP address and location.

Two Main Types of VPNs:

Type of VPN How It Works Best Used By
1. Remote-Access VPN (Client-to-Site) Connects an individual user’s laptop/phone (working from home or a hotel) to the company’s central office network via a VPN app Work-from-home employees, students accessing university library resources
2. Site-to-Site VPN (Router-to-Router) Permanently connects the entire local network (LAN) of Branch Office A (e.g., Indore) to Head Office B (e.g., Mumbai) over the internet Banks and IT companies with offices in multiple cities

Key Benefits of Using a VPN:

  1. Safe Use of Public Wi-Fi: Protects your passwords and banking data on railway station, airport, or cafe Wi-Fi.
  2. IP Address & Location Masking: Websites only see the IP address of the VPN server, protecting user privacy.
  3. Secure Remote Work: Employees can safely access internal company databases from home without leasing expensive private cables.

💡 DAVV Exam Preparation Tips

10-Mark Question: “What is a Firewall? Explain different types of Firewalls. What is a Virtual Private Network (VPN) and how does it work?”

  • Draw both the Firewall Block Diagram and the VPN Encrypted Tunnel Diagram.
  • Explain the 4 Firewall types: Packet-Filtering, Stateful Inspection, Application Proxy, and Circuit-Level Gateway.
  • For VPN, highlight the two core concepts: Encryption + Tunneling (Encapsulation), and compare Remote-Access VPN vs. Site-to-Site VPN.