A Java application that simulates network packet filtering using Cisco-style Standard and Extended Access Control Lists (ACLs).
This project models network traffic evaluation against configured access-list rule sets. It parses Cisco IOS-style ACL configuration files, converts IPv4 addresses and wildcard masks into numerical values for bitwise comparison, and evaluates simulated network packets sequentially to determine whether each packet is permitted or denied based on first-match semantics and implicit deny rules.
- Standard ACL Evaluation (
StandardACLMain.java):- Evaluates packets based strictly on source IPv4 addresses.
- Supports explicit source addresses with wildcard masks (e.g.,
0.0.0.0) and theanykeyword.
- Extended ACL Evaluation (
ExtendedACLMain.java):- Evaluates packets based on source IP, destination IP, protocol rules, and port conditions.
- Supports single port filtering (
eq <port>) and port range filtering (range <start>-<end>). - Supports wildcard masking for both source and destination subnets as well as
anykeywords.
- Bitwise Address Matching:
- Converts 32-bit IPv4 dotted-quad addresses to
longintegers and applies inverted wildcard masks via bitwise operations for exact subnet matching.
- Converts 32-bit IPv4 dotted-quad addresses to
- Default Implicit Deny:
- Automatically denies any packet that does not match an explicit permitting rule in the list.
network-acl-simulator/
├── .gitignore # Git ignore rules for compiled binaries and tooling
├── README.md # Project documentation
├── ExtendedACLMain.java # Driver program for Extended ACL simulation
├── ExtendedRule.java # Data model and matching logic for Extended ACL rules
├── Packet.java # Packet representation (source IP, destination IP, port)
├── StandardACLMain.java # Driver program for Standard ACL simulation
├── StandardRule.java # Data model and matching logic for Standard ACL rules
├── extended_input.txt # Extended test packet stream (Test case 1)
├── extended_input2.txt # Extended test packet stream (Test case 2)
├── extended_input3.txt # Extended test packet stream (Test case 3)
├── extended_rules.txt # Extended ACL rule configurations (Test case 1)
├── extended_rules2.txt # Extended ACL rule configurations (Test case 2)
├── extended_rules3.txt # Extended ACL rule configurations (Test case 3)
├── standard_input.txt # Standard test packet stream (Test case 1)
├── standard_input2.txt # Standard test packet stream (Test case 2)
├── standard_input3.txt # Standard test packet stream (Test case 3)
├── standard_rules.txt # Standard ACL rule configurations (Test case 1)
├── standard_rules2.txt # Standard ACL rule configurations (Test case 2)
└── standard_rules3.txt # Standard ACL rule configurations (Test case 3)
- Rule Format (
standard_rules.txt):access-list <id> <permit|deny> <source-ip> <wildcard-mask> access-list <id> <permit|deny> any - Packet Format (
standard_input.txt):<source-ip>
- Rule Format (
extended_rules.txt):access-list <id> <permit|deny> <protocol> <source-ip> <source-mask> <dest-ip> <dest-mask> access-list <id> <permit|deny> <protocol> <source-ip> <source-mask> <dest-ip> <dest-mask> eq <port> access-list <id> <permit|deny> <protocol> <source-ip> <source-mask> <dest-ip> <dest-mask> range <start-port>-<end-port> access-list <id> <permit|deny> <protocol> any <dest-ip> <dest-mask> eq <port> access-list <id> <permit|deny> <protocol> any any - Packet Format (
extended_input.txt):<source-ip> <dest-ip> <source-ip> <dest-ip> <port>
javac *.javajava StandardACLMainSample Output:
Packet from 192.168.30.30 denied
Packet from 192.168.30.31 permitted
Packet from 10.5.5.1 permitted
Packet from 172.16.0.100 permitted
java ExtendedACLMainSample Output:
Packet from 192.168.10.5 to 192.168.30.20 on port 21 denied
Packet from 192.168.10.5 to 192.168.30.20 on port 80 permitted
Packet from 192.168.20.10 to 192.168.30.30 on port 25 denied
Packet from 192.168.20.10 to 192.168.30.30 on port 443 permitted