Network Defence Mechanisms

πŸ“ Concept Note β€” CSF & NS Unit III | Source: MCA Sem III Syllabus


The Problem It Solves

A network without defence is like a building with no walls, no doors, and no locks. Network defence mechanisms provide the walls, doors, locks, guards, and surveillance cameras of the digital world.


🧭 Unit III Deep Dives

This note is the Unit III overview. Each topic below has a dedicated deep-dive note explaining how it actually works at mechanism level, plus supplementary videos.

Deep diveWhat’s inside
Firewalls5-tuple matching, the stateful connection table, DPI/NGFW app-ID, rule order & implicit deny, egress filtering, why NAT β‰  security
IDS & IPSDetection pipeline, why normalisation defeats evasion, passive SPAN vs inline placement, signature vs anomaly, FP/FN and tuning
DMZ & Network SegmentationNorth-south vs east-west, lateral movement, single vs dual-firewall DMZ, 802.1Q VLAN tagging, VLAN hopping, micro-segmentation
VPNEncapsulation, IPsec IKE phase 1/2, ESP vs AH, tunnel vs transport mode, SSL/TLS VPN, WireGuard, split tunnelling, VPN β‰  anonymity
Proxy ServersTwo-connection model, forward vs reverse, transparent vs explicit, TLS interception via internal CA, WAF/load balancing
Zero Trust ArchitectureNIST SP 800-207 PE/PA/PEP, continuous verification, least privilege, assume breach, ZTNA vs VPN
Wireless SecurityWPA2 4-way handshake (PTK/GTK, nonces, MIC), offline cracking, 802.1X/RADIUS, WPA3 SAE, evil twin, deauth, KRACK

Firewalls

What is a Firewall?

A network security device that monitors and controls incoming and outgoing traffic based on predetermined security rules.

Types of Firewalls

1. Packet Filtering Firewall

  • Examines individual packets against rules (source/dest IP, port, protocol)
  • Stateless β€” doesn’t track connection state
  • Fast but limited

2. Stateful Inspection Firewall

  • Tracks state of active connections
  • Understands response packets belong to allowed requests
  • More secure than packet filtering

3. Application-Layer / Next-Gen Firewall (NGFW)

  • Inspects actual application data (Layer 7)
  • Deep Packet Inspection (DPI)
  • Includes IPS, antivirus, URL filtering

Firewall Rules

Rules processed top to bottom β€” first match wins:

Priority  Action   Source IP        Dest IP         Port    Protocol
1         ALLOW    192.168.1.0/24  Any             443     TCP
2         ALLOW    10.0.0.5        192.168.1.100   22      TCP
3         DENY     Any             Any             22      TCP
4         ALLOW    Any             192.168.1.50    80      TCP
5         DENY     Any             Any             Any     Any    ← Default DENY

πŸ’‘ Best practice: End every rule set with β€œDENY ALL” β€” whitelist approach.

DMZ Architecture

                   Internet
                      β”‚
                 β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”
                 β”‚ External β”‚
                 β”‚ Firewall β”‚
                 β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
                      β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
              β”‚      DMZ      β”‚
              β”‚  Web Server   β”‚
              β”‚  Mail Server  β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
                 β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”
                 β”‚ Internal β”‚
                 β”‚ Firewall β”‚
                 β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
                      β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
              β”‚  Internal LAN  β”‚
              β”‚  Databases     β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Why DMZ? If public-facing server is compromised, attacker is still blocked from internal network.


Intrusion Detection & Prevention Systems

IDS vs IPS

FeatureIDS (Detection)IPS (Prevention)
ActionDetects and ALERTSDetects and BLOCKS
PlacementPassive (copy of traffic)Inline (traffic flows through)
RiskMay miss blockingMay block legitimate traffic
AnalogySecurity cameraSecurity guard

Detection Methods

Signature-Based: Compares against known attack patterns. Fast, accurate for known threats. ❌ Cannot detect zero-day attacks.

Anomaly-Based: Establishes baseline of normal behaviour, alerts on deviation. βœ… Can detect unknown attacks. ❌ Higher false positives.

HIDS vs NIDS

FeatureHIDS (Host-based)NIDS (Network-based)
MonitorsSingle hostEntire network segment
SeesFile changes, logs, processesNetwork packets
ExampleOSSEC, WazuhSnort, Suricata

Common NIDS tools: Snort (the original signature-based engine) and Suricata (modern, multi-threaded, also does full network security monitoring). Both match traffic against rules β€” see those notes for how the detection pipeline works.

Reducing False Positives

  • Tune rules for your environment
  • Whitelist known-good traffic
  • Set alert thresholds
  • Regular rule review and updates

VPNs (Virtual Private Networks)

Types

Site-to-Site: Connects entire networks (office to office)

Mumbai LAN ──── [Encrypted Tunnel] ──── Delhi LAN

Remote Access: Individual user connects to corporate network

Employee Laptop ──── [Encrypted Tunnel] ──── Corporate Network

VPN Protocols

ProtocolSecuritySpeedUse Case
IPsecVery strongGoodSite-to-site, corporate
SSL/TLS VPNStrongGoodRemote access, browser-based
WireGuardVery strongFastestModern, all purposes

Split Tunnelling

  • Full tunnel: ALL traffic goes through VPN (more secure, slower)
  • Split tunnel: Only corporate traffic through VPN; internet goes direct (faster, less secure)

⚠️ VPN does NOT make you anonymous: Provider can see traffic, DNS leaks possible, endpoint still vulnerable.


Proxy Servers

Forward Proxy: Between internal users and internet β€” hides user IPs, filters content, caches pages.

Reverse Proxy: Between internet and internal servers β€” hides server IPs, load balancing, DDoS protection. Examples: Nginx, Cloudflare.

Transparent vs Explicit: Transparent = users unaware; Explicit = browser configured manually.


Network Segmentation

Flat vs Segmented

Flat (BAD): All devices on one network β€” attacker accesses everything.

Segmented (GOOD): VLANs separate users, servers, databases. Firewall rules control inter-VLAN traffic. Limits lateral movement.

Micro-Segmentation

Even more granular than VLANs β€” individual workloads have own security policies. Common in cloud/data centres. Zero Trust at network level.


Zero Trust Architecture

β€œNever trust, always verify”

AspectTraditionalZero Trust
Inside networkTrustedUntrusted
AuthenticationAt perimeterEvery request
AccessBroad once insideMinimum needed
AssumptionPerimeter is secureBreach has occurred

Key Principles

  1. Verify explicitly β€” Authenticate based on all data points
  2. Least privilege β€” Minimum permissions needed
  3. Assume breach β€” Design as if attackers are already inside

Wireless Security

WPA2 vs WPA3

FeatureWPA2WPA3
Key ExchangePSKSAE (resistant to offline attacks)
Forward SecrecyNoYes
Open NetworksNo encryptionOWE (individual encryption)

Common Wi-Fi Attacks

AttackHow It WorksDefence
Evil TwinFake AP with same SSIDVPN, verify AP
DeauthenticationDisconnect clients forciblyWPA3, 802.11w
KRACKExploits WPA2 handshakePatch firmware, WPA3

Securing Wireless

  1. Use WPA3 (or WPA2 with strong passphrase)
  2. Disable WPS
  3. Change default SSID and admin credentials
  4. Separate guest network
  5. Keep firmware updated