A small teaching and demonstration routing simulator written in Java (Spring Boot project layout).
This repository contains a lightweight routing simulator with modules for devices, routers, DHCP, DNS server, and a few simple command utilities (ping, nslookup, nmap-like scanner).
Important Note: All the responses are stored in HTML format (as we wanted to display them on the web page) in the "responses" folder. The corresponding requests are all stored in the requests.json file in the same folder.
- Provide a simple simulation environment for networking concepts (IP addressing, DHCP, DNS, routing).
- Offer small command modules to exercise the simulated network.
- Serve as a learning codebase for students and contributors.
Status: Use the instructions below to build, run, and extend.
The Routing Sandbox project is a lightweight network simulator developed in Java (Spring Boot).
It provides a practical environment for simulating networking operations such as ping, nmap, and nslookup, along with building and visualizing network topologies.
To develop an educational and experimental routing simulator that helps users learn and test fundamental networking concepts and routing algorithms.
The system supports:
- Running network commands (ping, nslookup, nmap).
- Building and managing network topologies with routers and devices.
- Simulating routing algorithms like Dijkstra’s shortest path.
- Managing DNS, DHCP, and IP allocations. Data is stored using simple file handling (TXT, JSON).
- Educational institutions for networking courses.
- Network professionals seeking a lightweight testing environment.
- Developers and learners exploring routing and topology simulation.
The simulator accepts API-based input, processes it through a layered Model → Service → Controller architecture,
and stores persistent state in files (dns_records.txt, network.json, etc.).
This makes the project modular, lightweight, and easily extensible.
- Project Overview
- Architecture & Important Classes
- Build & Run
- Testing
- Running the Included Nmap-style Command
- Data Files
- Contributors
- API Endpoints
- Development Notes & Guidelines
- Troubleshooting
The simulator models a simple network with managers (tenants), each managing devices and small services. It includes the following subsystems:
- DHCP: Generates and assigns private IPv4 addresses.
- DNS: Small in-memory DNS backed by
dns_records.txt. - Devices: Models network devices exposing ports.
- Commands: CLI-like utilities implemented as Java classes (e.g.,
NmapCommand).
This code follows a Spring Boot project layout but can be executed as a standalone Java application.
GlobeManager(modules/manager/GlobeManager.java): Top-level manager of the simulated network. ManagesManagerinstances, the network graph, and theDNSServer.Manager(modules/manager/Manager.java): GroupsModelinstances (devices, routers, DHCP, public servers) and assigns public IPs.Device(modules/models/device/Device.java): Represents a host with an IPv4 and a list of active ports.DNSServer(modules/models/DnsServer/DNSServer.java): Lightweight DNS implementation backed by a text file.NmapCommand(modules/commands/NmapCommand.java): TCP-based port scanner that works on real or simulated devices.
Refer to routingSimulator/src/main/java/com/example/routingSimulator for all modules (network, models, service, controller).
- Java 11+ (JDK)
- Maven installed (
mvnon PATH)
cd routingSimulator
mvn -DskipTests packagecd routingSimulator
mvn spring-boot:runjava -cp target/classes com.example.routingSimulator.Maindns_records.txt— Stores domain-to-IP mappings (e.g.,example.com,192.168.1.10).data/services.txt— Optional service-to-port mapping used byNmapCommand.
All contributors made equal and significant contributions involving design, implementation, and testing of core modules — including Manager, Models, Network Graph, Commands, and Services.
| Contributor | Contributions |
|---|---|
| Jos Samuel Biju | Implemented the N-map command, developed Device.java, and handled debugging and testing. |
| Macwan Darell | Designed the Abstract Model Class and developed models like Router, Public Server, and DHCP. Implemented IP logic. |
| Vedansh Patel | Developed connection link functionality and integrated command operations. |
| Vedant Savani | Implemented Network Topology and integrated Dijkstra’s Algorithm for pathfinding. |
| Karan Mansuria | Implemented the DNS Server, NS-Lookup command, and file management. |
| Tanuj Shah | Implemented the Ping command and Manager module, and assisted in debugging and testing. |
@GetMapping("/{id}/managers")Retrieves all managers within a specific sandbox.
@GetMapping("/{id}/{mid}/devices")Lists all devices managed by a specific manager.
@GetMapping("/{id}/{deviceid}")Lists all active ports for a specific device.
@GetMapping("/{id}/network")Returns the complete network graph.
@GetMapping("/{id}/links/{u}/{v}")Provides detailed information about the link between nodes u and v.
@GetMapping("/{id}/links/bandwidth/{u}/{v}")Returns the bandwidth between nodes u and v.
@GetMapping("/{id}/links/{u}")Retrieves all links originating from node u.
@DeleteMapping("/{id}/links/{u}/{v}")Deletes the link between nodes u and v (tested using Postman).
@GetMapping("/{id}/network/path/{u}/{v}")Returns the actual network path between nodes u and v.
@GetMapping("/{id}/network/path/cost/{u}/{v}")Returns the path cost (mathematical distance) between u and v.
@GetMapping("/{id}/network/distance/{u}")Retrieves the distance from node u to all other nodes.
@GetMapping("/{id}/network/fullpathDetails/{u}/{v}")Returns detailed path information between nodes u and v.
- Follow consistent coding style used in the project.
- Add unit tests under
routingSimulator/src/test/java. - Run the application with
mvn spring-boot:runduring development. - Ensure
dns_records.txtis located in the correct working directory.
-
DNS Resolution Issues: Verify that
dns_records.txtincludes valid domain-IP mappings. Example:
example.com,192.168.1.10
The IP should correspond to a registeredPublicServerin theGlobeManager. -
Missing Device Ports: Ensure ports are added via
device.addPort(port)before registering the device to a manager.