0
0
Computer Networksknowledge~10 mins

Firewalls and packet filtering in Computer Networks - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Firewalls and packet filtering
Incoming Network Packet
Check Firewall Rules
Packet Allowed
Forward to Device
End Process
A network packet arrives and the firewall checks it against rules. If it matches allowed rules, it passes through; otherwise, it is blocked.
Execution Sample
Computer Networks
Packet arrives
Firewall checks source IP
If IP allowed, forward packet
Else, block packet
This simple process shows how a firewall filters packets based on source IP rules.
Analysis Table
StepPacket Source IPRule CheckedRule Match?Action TakenResult
1192.168.1.10Allow 192.168.1.0/24YesForward packetPacket sent to device
210.0.0.5Allow 192.168.1.0/24NoBlock packetPacket dropped
3172.16.0.3Allow 172.16.0.0/16YesForward packetPacket sent to device
48.8.8.8Allow 172.16.0.0/16NoBlock packetPacket dropped
5End---No more packets to check
💡 Packets are processed one by one; if no rule matches, packet is blocked by default.
State Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4Final
Packet Source IPNone192.168.1.1010.0.0.5172.16.0.38.8.8.8No more packets
Rule MatchNoneYesNoYesNoN/A
Action TakenNoneForwardBlockForwardBlockN/A
Key Insights - 3 Insights
Why does the packet from 10.0.0.5 get blocked even though it is a valid IP?
Because the firewall rules only allow packets from 192.168.1.0/24 subnet in step 2, and 10.0.0.5 does not match this rule, so it is blocked as shown in execution_table row 2.
What happens if a packet does not match any allow rule?
It is blocked by default. This is shown in steps 2 and 4 where packets not matching any allow rule are dropped.
How does the firewall decide to forward or block a packet?
It checks the packet's source IP against the rules. If a rule matches (Yes in Rule Match column), it forwards; otherwise, it blocks, as seen in the execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what action is taken for the packet from 172.16.0.3 at step 3?
ABlock packet
BForward packet
CIgnore packet
DLog packet only
💡 Hint
Check the 'Action Taken' column at step 3 in the execution_table.
At which step does the firewall block a packet because it does not match the allowed subnet?
AStep 2
BStep 3
CStep 1
DStep 5
💡 Hint
Look for 'Block packet' in the 'Action Taken' column and check the corresponding step.
If the firewall rule allowed 10.0.0.0/8 instead of 192.168.1.0/24, what would happen to the packet from 10.0.0.5 at step 2?
AIt would be logged only
BIt would be blocked
CIt would be forwarded
DIt would cause an error
💡 Hint
Refer to the variable_tracker for 'Packet Source IP' and 'Rule Match' changes if the rule changes.
Concept Snapshot
Firewalls check incoming packets against rules.
Packets matching allow rules are forwarded.
Packets not matching are blocked.
Rules often filter by IP, port, or protocol.
Default action is usually to block unknown packets.
Full Transcript
A firewall acts like a gatekeeper for network traffic. When a packet arrives, the firewall checks it against a list of rules. If the packet's source IP matches an allowed range, the firewall forwards it to the device. If not, the firewall blocks the packet and stops it from passing through. This process repeats for each packet. If no rules match, the packet is blocked by default. This simple filtering helps protect networks from unwanted or harmful traffic.