Application Layer · Computer Networks

SVGVector Architecture Diagram (SVG)
COMPUTER NETWORKS · Module 5 · Application Layer★ High PriorityIT Sem 6 · Code 100602Network FirewallsMNEMONICFirewall = Guard at the gate: ALLOW or DENY by rules, default DENY.Types go up the layers: Packet, Stateful, Proxy, NGFW.Core BreakdownOverviewA firewall sits between a trusted network and an untrusted one and filters traffic by security rules.It can be hardware, software or a cloud service; it protects, but it is not a complete defence.Packet FilterStateless, works at network and transport layers: source / destination IP, port and protocol.Fast and simple, but cannot see the payload or know which packets belong to one session.StatefulKeeps a state table of open connections, so replies to allowed requests pass automatically.Blocks unsolicited inbound packets and stops many spoofing and scan attacks.Proxy/AppApplication-level gateway: the client talks to the proxy, which makes a second connection for it.Inspects content (HTTP, FTP); very secure, but slower; hides internal addresses.NGFWNext-generation firewall: stateful plus deep packet inspection, IPS, application awareness, user identity.Can block a specific application or malware, not just a port.RulesRule table: source, destination, port, protocol, action. The first matching rule wins.Best practice: default deny, then allow only what is needed (least privilege).DMZDemilitarized zone: a separate subnet for public servers (web, mail, DNS) between two firewalls.If a DMZ server is hacked, the inner LAN is still protected.LimitsCannot stop insider threats, malware brought in by USB, or attacks inside allowed traffic (without DPI).Needs updates and good rules; one wrong rule can open the network.Diagram: Firewall and DMZInternet(untrusted)FIREWALLallow / denyby rulesInternal LANDMZ serversRule order: first match wins; default = DENY allPacket filterL3/L4 headersStatefultracks connectionsProxy / AppL7 contentNGFWDPI + IPSSample rule tableSrc IPDst portProtoActionany443TCPALLOW (web)anyanyanyDENY (default)Packet filter: stateless, fast, cannot see payloadDMZ: public servers kept apart from the inner LAN⚠️ Exam Traps & Viva Favorites① Stateless vs stateful?Packet filter judges each packet alone.Stateful remembers connections in a statetable and allows the matching replies.② What is a DMZ?A subnet for public servers between theInternet and the inner LAN. A breach of aDMZ server does not expose the LAN.③ Default policy?Default DENY: block everything, allow onlywhat is listed. Rules are checked in orderand the FIRST match wins.Tip: default deny · first match winsMaster Revision Table(learn it row by row!)TypeLayerChecksStrengthWeaknessPacket filterNetwork / TransportIP, port, protocolFast, cheapNo state, no payloadStatefulNetwork / TransportPacket plus connection stateBlocks unsolicitedNo content checkProxy / AppApplicationFull content, per protocolVery secureSlowerNGFWLayers 3 to 7DPI, IPS, apps, usersRich controlCostly, complexDMZDesign (zone)Isolates public serversProtects the LANNeeds 2 firewallsQUICK FACTSTypes: packet filter · stateful · proxy (application gateway) · NGFWPolicy: default DENY · first matching rule wins · least privilegeDMZ: public servers in a separate subnet between two firewallsVERIFIED★ Golden rule: Default deny, first match wins, public servers go in the DMZ.

Network Firewalls


1. Concept and Role of a Firewall

A Firewall is a network security system—implemented as dedicated hardware, software, or a combination—that monitors, filters, and controls incoming and outgoing network traffic based on predetermined security policies.

It serves as a protective barrier (electronic perimeter) separating a Trusted Internal Network (corporate LAN or private home network) from an Untrusted External Network (the public Internet).

MermaidDiagram
Rendering diagram…

2. Classification of Firewalls

Firewalls are categorized by the OSI layer at which they inspect traffic:

MermaidDiagram
Rendering diagram…

3. Detailed Firewall Types

A. Packet-Filtering Firewall (Stateless)

  • Operates at Layers 3 and 4 (Network & Transport).
  • Treats every single packet in isolation, comparing header values against an Access Control List (ACL):
    • Source IP Address & Destination IP Address.
    • Transport Protocol (TCP, UDP, ICMP).
    • Source Port & Destination Port.
    • Inbound or Outbound Interface.
  • Rules Actions: ALLOW (forward) or DENY (drop silently or return ICMP unreachable).
  • Advantages: Wire-speed performance, low resource utilization, transparent to users.
  • Disadvantages: Stateless—cannot determine if an inbound packet is a legitimate response to an internal request; vulnerable to IP address spoofing.

B. Stateful Inspection Firewall (Dynamic Packet Filtering)

  • Operates at Layers 3 and 4, but maintains a dynamic State Connection Table:
  • Monitors full TCP connection lifecycles (tracking SYN, SYN-ACK, ACK, and sequence numbers).
  • When an internal host sends an outbound request to a web server, the firewall records the active session: (Src IP: 192.168.1.5, Src Port: 54102 <-> Dst IP: 93.184.216.34, Dst Port: 443).
  • Inbound Rule: The firewall automatically allows inbound return packets ONLY if they match an existing active entry in the state table! Unsolicited incoming packets from the outside Internet are blocked instantly.
  • Advantages: Superior security over stateless filters; prevents port scans and forged sessions.

C. Application-Level Gateway (Proxy Firewall)

  • Operates at Layer 7 (Application Layer).
  • Functions as an intermediary Proxy: the external client connects directly to the proxy, and the proxy initiates a separate, independent connection to the destination server.
  • Performs Deep Packet Inspection (DPI): examines the actual application payload (HTTP headers, URL strings, SQL syntax, attachment filetypes).
  • Advantages: Can detect and block SQL Injections, Cross-Site Scripting (XSS), and data leakage.
  • Disadvantages: Computationally intensive; introduces noticeable latency; requires separate proxy software for every supported protocol.

D. Next-Generation Firewall (NGFW)

  • Modern enterprise standard integrating:
    1. Stateful Packet Filtering.
    2. Integrated Intrusion Prevention System (IPS).
    3. TLS/SSL Decryption & Inspection (inspecting encrypted HTTPS payloads).
    4. Application awareness (identifying Skype, BitTorrent, or Zoom regardless of port used).
    5. Threat intelligence sandboxing against zero-day malware.

4. Firewall Architecture: The Demilitarized Zone (DMZ)

To host public-facing servers (Web, DNS, Mail) without exposing internal corporate databases to the Internet, networks deploy a DMZ Architecture:

MermaidDiagram
Rendering diagram…
  • Internet users are granted access strictly to the DMZ servers.
  • If a hacker compromises the public web server in the DMZ, the Internal Firewall blocks the attacker from pivoting into the protected internal corporate intranet!

5. Comprehensive Firewall Comparison

Parameter Packet-Filtering Stateful Inspection Application Proxy
Operating Layer Layer 3 & 4 (Network/Trans) Layer 3 & 4 + State Layer 7 (Application)
Connection Tracking None (Stateless) Yes (Dynamic state table) Full connection termination
Payload Inspection No (Headers only) No (Headers & flags only) Yes (Deep payload inspection)
Processing Speed Extremely Fast (Wire speed) Very Fast Slower (High CPU overhead)
Defense Against Spoofing Poor Strong Complete
Resource Cost Minimal memory Moderate (State memory) High (Per-connection proxy)

Frequently Asked Questions

QHow does a Stateful firewall improve upon a Stateless packet filter?

A stateless filter evaluates packets individually based on static header rules. A stateful firewall tracks the entire session lifecycle in a state table, automatically allowing return traffic for legitimate internally initiated connections while rejecting unsolicited external connection attempts.

QWhat is a Demilitarized Zone (DMZ) and why is it used?

A DMZ is an isolated subnetwork positioned between the public Internet and the private intranet that hosts public-facing servers (HTTP, SMTP). It ensures that if a public server is compromised, the attacker cannot directly access the private internal corporate network.

QWhat layer does an Application Proxy firewall operate at?

Layer 7 (Application Layer), allowing it to inspect application commands, URLs, and payloads for malicious patterns like SQL injections.

QWhat extra capabilities does a Next-Generation Firewall (NGFW) provide?

An NGFW combines stateful filtering with an integrated IPS, TLS/SSL decryption and inspection, application awareness regardless of port, and threat-intelligence sandboxing.

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.

← All Computer Networks modules