Skip to content

About

Simulation of network packet filtering using Standard and Extended Access Control Lists (ACLs) in Java.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

network-acl-simulator

A Java application that simulates network packet filtering using Cisco-style Standard and Extended Access Control Lists (ACLs).


Overview

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.


Features

  • 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 the any keyword.
  • 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 any keywords.
  • Bitwise Address Matching:
    • Converts 32-bit IPv4 dotted-quad addresses to long integers and applies inverted wildcard masks via bitwise operations for exact subnet matching.
  • Default Implicit Deny:
    • Automatically denies any packet that does not match an explicit permitting rule in the list.

Project Structure

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)

File Formats

Standard ACL Rules & Packets

  • 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>
    

Extended ACL Rules & Packets

  • 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>
    

How to Run

1. Compile the Source Code

javac *.java

2. Run the Standard ACL Simulator

java StandardACLMain

Sample 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

3. Run the Extended ACL Simulator

java ExtendedACLMain

Sample 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

About

Simulation of network packet filtering using Standard and Extended Access Control Lists (ACLs) in Java.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages