PacketGuard Logo
PacketGuard
CN Mini Project Deck
πŸ–₯️ Live Simulator πŸ“„ Full Report
Computer Networks • Mini Project

PacketGuard: Multi-Client Stateful Packet-Filtering Firewall

  • Stateful Layer 3 & 4 Packet Inspection: Implements RFC-compliant 5-tuple filtering and dynamic connection tracking (conntrack).
  • Multi-Client Enterprise Architecture: Distinct isolation between Admin Workstation (192.168.1.50), Developer (192.168.1.51), and Rogue Client (192.168.1.99).
  • Live Domain Interception: Demonstrates real-world website filtering (blocking google.com vs permitting example.com).
  • 21-Test Assertion Verification: 100% test pass rate with sub-millisecond filtering latency.
System Architecture Overview
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Admin (.50)  β”‚   β”‚  Dev (.51)   β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
       └────►│ Rogue (.99)β”‚β—„
             β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                   β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚   Core Switch (.2)   β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚ PacketGuard Firewall β”‚ ──► [BLOCKED]
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β–Ό                           β–Ό
[Internal Servers]        [Internet Cloud]
- Web Server (10.0.0.10)  - 8.8.8.8
- DB Server  (10.0.0.20)  - Live Web
- Bastion    (10.0.0.30)
          
Motivation & Objectives

Why Stateful Filtering & Multi-Client Security?

  • Stateless Limitations: Traditional packet filters inspect packets in complete isolation, requiring wide-open inbound ports and failing against spoofed attacks.
  • Zero-Trust Architecture: Perimeter defenses must enforce granular policy by source IP, isolating internal administrative workstations from rogue or guest endpoints.
  • Application-Layer Threats: L3/L4 filters miss domain exfiltration; firewalls need Layer 7 domain filtering to block unauthorized search & malware sites.
  • Real-Time Deflection: Visualizing dropped packets, connection state, and return routing in real time.
Stateless vs Stateful Comparison
STATELESS FIREWALL:
Client ──► SYN (80) ────► Server (OK)
Client ◄── SYN-ACK ─────X BLOCKED!
*Requires dangerous open inbound rules!

STATEFUL (PACKETGUARD):
Client ──► SYN (80) ────► [conntrack Table]
                             └── (SYN_SENT)
Client ◄── SYN-ACK ────── [Match ESTABLISHED]
                             └── (Allowed!)
          
Network Infrastructure

Enterprise Multi-Client & Multi-Server Topology

  • Three Distinct Clients: Admin Workstation (192.168.1.50), Developer Laptop (192.168.1.51), Rogue/Untrusted Host (192.168.1.99).
  • Three Server Tiers: Web Server (10.0.0.10:80/443), Database Server (10.0.0.20:3306), SSH Bastion (10.0.0.30:22).
  • Core Switch (192.168.1.2): Handles Layer 2 segment traffic, anchoring SVG vector paths dynamically.
  • Edge Gateway Router (203.0.113.1): Connects firewall to upstream Internet Cloud (8.8.8.8) and live websites.
Node Roles & Permissions
CLIENTS:
β€’ Admin (.50): Full Access, Bastion SSH
β€’ Dev (.51):   Web access, Read DB, No Bastion
β€’ Rogue (.99): Zero Internal Trust, Blocked DB

SERVERS:
β€’ Web (10.0.0.10):    Port 80/443 (HTTP/S)
β€’ DB (10.0.0.20):     Port 3306 (MySQL)
β€’ Bastion (10.0.0.30):Port 22 (SSH Auth)
          
Packet Evaluation

5-Tuple Structure & RFC Protocol Standards

  • The 5-Tuple Identity: Source IP, Destination IP, Source Port (ephemeral 49152-65535), Destination Port (service), Transport Protocol (TCP/UDP/ICMP).
  • RFC 791 (IPv4): 32-bit unsigned bitwise CIDR mask evaluation (e.g., 192.168.1.0/24 subnet calculations).
  • RFC 793 (TCP): Flag parsing (SYN, ACK, PSH, FIN, RST) verifying 3-way handshake compliance.
  • RFC 768 (UDP): Stateless flow mapping for DNS queries on Port 53.
5-Tuple Header Layout
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  IP Header: [192.168.1.50]           β”‚
β”‚         ──► [10.0.0.10]              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ TCP Header: [Port: 52140]            β”‚
β”‚         ──► [Port: 80]               β”‚
β”‚      Flags: [SYN, ACK]  Seq: 1024    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    Payload: GET /index.html HTTP/1.1 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          
Core Engine

Stateful Connection Tracking (conntrack)

  • Bidirectional Session Table: Maps forward hash srcIp:srcPort->dstIp:dstPort and reverse return key simultaneously.
  • State Lifecycle: Tracks transitions: NEW (SYN) → SYN_RECV → ESTABLISHED → FIN_WAIT → CLOSED.
  • Rule #1 Precedence: All established and related return packets immediately match Rule #1, bypassing redundant filtering.
  • Automatic Garbage Collection: Idle flows and torn-down FIN/RST connections clean up automatically.
TCP State Machine Flow
          [CLOSED]
             β”‚ SYN (NEW)
             β–Ό
        [SYN_SENT]
             β”‚ SYN-ACK
             β–Ό
        [SYN_RECV]
             β”‚ ACK
             β–Ό
       [ESTABLISHED] ◄── Rule #1 Matches!
             β”‚ FIN
             β–Ό
       [FIN_WAIT_1]
             β”‚ FIN-ACK
             β–Ό
        [TIME_WAIT] ──► [CLOSED]
          
Live Demonstration

Real Website Request & Client-Side Blocking

  • Real Domain Evaluation: PacketGuard inspects FQDNs and destination hosts (Layer 7 policy inspection).
  • Demonstrable Blocking (google.com): Requests to Google match Rule #2 (Block Google / External Search Policy). The packet deflects to red arc, returning an authentic 403 Forbidden client screen!
  • Genuine Live Internet Fetch (example.com): Safe requests pass the firewall, reach Python gateway / internet, returning genuine 200 OK HTML payload and latency telemetry!
  • Client-Side Browser Inspector: An interactive simulated browser window displays the actual client experience!
Live Request Telemetry
TEST 1: https://google.com
Verdict:      BLOCKED (403 Forbidden)
Rule:         #2 Block Google & Restricted
Action:       TCP RST / Deflected Drop
Client View:  🚫 403 Access Intercepted

TEST 2: https://example.com
Verdict:      ALLOWED (200 OK)
Rule:         #6 Allow HTTP Web Traffic
Latency:      78ms
Client View:  🌐 200 OK Example Domain
          
Decision Logic

Priority Rule Engine & Deflection Mechanics

  • Strict First-Match Semantics: Rules evaluate sequentially (#1, #2, #3...); the first matching rule dictates ALLOW or DENY. Evaluation stops immediately.
  • Zero-Trust Default Deny: Any traffic not explicitly permitted by an enabled rule falls through to Rule #10 (Default Deny All).
  • Dynamic Curved Deflection: Blocked packets don't just disappearβ€”they curve off the firewall shield along a quadratic BΓ©zier SVG arc.
  • Live Rule Management: Add custom rules, toggle enable/disable, or drag-and-drop priority in real time!
Active Rule Priority Order
#1 ALLOW Established (conntrack)
#2 DENY  google.com, facebook.com
#3 DENY  Rogue (.99) -> DB (.20)
#4 DENY  Port 22 (SSH Block)
#5 ALLOW Admin (.50) -> Bastion (.30)
#6 ALLOW Port 80 (HTTP)
#7 ALLOW Port 443 (HTTPS)
#8 ALLOW Port 53 (DNS UDP)
#9 DENY  Attack Ports (23,25,445)
#10 DENY Default All (Zero Trust)
          
User Interface

Interactive Dashboard & Wireshark Inspector

  • Column 1: Request Crafter: Source client picker, target selector, method, ports, live presets, and rate sparkline.
  • Column 2: Visual Topology & Timeline: Vector cables, active node glows, smooth ease-in-out packet flight, and 8-column packet audit timeline.
  • Column 3: Rule Manager & Server Console: Real-time rule list, rule hit highlights, and sys-log terminal output.
  • Deep Packet Inspector: Click any packet or timeline row to view Layer 2 Ethernet, Layer 3 IP, Layer 4 TCP/UDP, and Layer 7 Payload!
Dashboard Layout
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 1. REQUEST   β”‚ 2. TOPOLOGY      β”‚ 4. RULES    β”‚
β”‚    CRAFTER   β”‚    CANVAS        β”‚    LIST     β”‚
β”‚              β”‚ (Vector Cables)  β”‚             β”‚
β”‚ β€’ Client A/B β”‚                  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ Targets    β”‚ 3. TIMELINE      β”‚ 5. CONSOLE  β”‚
β”‚ β€’ Live Tests β”‚    AUDIT LOG     β”‚    TERMINAL β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          
Validation & Benchmarks

21-Test Automated Verification & Benchmarks

21 / 21
Automated Assertions Passed (100%)
1.2 ms
End-to-End Processing Latency
10.2 Gbps
Simulated Throughput Capacity
100,000+
Concurrent conntrack Sessions
Automated Test Execution Summary
βœ” PASS [1] Web HTTP (Port 80) ALLOWED by Rule #6          βœ” PASS [12] Port 443 Matched
βœ” PASS [2] Return HTTP 200 OK ALLOWED by Rule #1 (conntrack)βœ” PASS [13] Port 8080 Rejected
βœ” PASS [3] SSH (Port 22) BLOCKED by Rule #4               βœ” PASS [14] Port Range 5000 Matched
βœ” PASS [4] HTTPS (Port 443) ALLOWED by Rule #7            βœ” PASS [15] Privileged Port 80 Filtered
βœ” PASS [5] DNS Query (UDP 53) ALLOWED by Rule #8          βœ” PASS [16] Disabled Rule Skipped
βœ” PASS [6] Database Query (3306) BLOCKED by Rule #10      βœ” PASS [17] Custom Rule Allows Admin SSH
βœ” PASS [7] Telnet (Port 23) BLOCKED by Rule #9            βœ” PASS [18] google.com BLOCKED by Domain Rule #2
βœ” PASS [8] CIDR /24 Matches Internal Host                 βœ” PASS [19] example.com ALLOWED by HTTP Rule
βœ” PASS [9] CIDR /24 Rejects External Host                 βœ” PASS [20] Rogue Client (.99) BLOCKED from DB (.20)
βœ” PASS [10] CIDR /8 Matches Host                          βœ” PASS [21] Client B (.51) to Web (.10) ALLOWED
          
Summary & Future Scope

Conclusion & Future Roadmap

  • Project Outcome: Successfully engineered and validated a multi-client stateful packet-filtering firewall with Layer 7 domain filtering.
  • Core Demonstrations: Verified stateful return connections, rogue host isolation, live Google blocking, and sub-millisecond filtering.
  • Future Scope: IPv6 flow label tracking, eBPF / XDP kernel-space offload for line rate, and ML-based anomaly detection.
  • Educational Impact: Provides an intuitive, visual bridge between networking theory (RFCs) and production security operations.
Key Deliverables Delivered
βœ“ Multi-Client & Multi-Server Topology
βœ“ Live Website Interception (google.com)
βœ“ Interactive Client Browser Inspector
βœ“ Comprehensive 8,500-word Report (REPORT.md)
βœ“ 10-Slide Interactive Presentation Deck
βœ“ 21/21 Automated Unit Tests Passed

Thank you! Q&A Session.