"Because wasting IP addresses is a crime against the network."
First-Fit Memory Allocation • Gap Filling Logic • Visual Mapping
Most subnet calculators are glorified spreadsheets. They just append subnets linearly, wasting space and failing to visualize fragmentation.
This is different. This tool treats IP address space like computer memory. It implements a strict First-Fit Interval Algorithm (ported from low-level C) to intelligently fill gaps. If a large subnet leaves a "hole" due to binary alignment rules, this solver will circle back and fit smaller subnets (like /30 links) into those empty pockets.
Wrapped in a high-fidelity Stealth/Matrix UI, because networking tools shouldn't look like they were built in 1998.
- Cup Visualization: A unique visual representation of IP blocks (32 IPs per "Cup"). Instantly spot fragmentation, reserved space, and broadcast overhead.
- Gap Filling Logic: Unlike standard linear allocators, this engine creates a map of "Free Intervals" and fits subnets into the first valid slot that adheres to alignment rules (
Offset % BlockSize == 0). - Strict Validation: Regex-based IP policing, overlap detection, and capacity overflow protection.
- Stealth UI: Fully custom dark mode interface with neon accents,
framer-motionanimations, and reactive inputs. - Detailed Breakdown: Provides a line-by-line analysis of Network, Router, Usable Range, and Broadcast IPs for every subnet.
The core logic is based on Memory Management Principles:
- Normalization: All inputs are converted to unsigned 32-bit integers.
- Sorting: Subnets are sorted by size (Descending), prioritizing Hosts over Links to minimize fragmentation.
- Interval Scanning:
- The network starts as one giant
Free Interval. - For each request, we scan the intervals for a slot where
StartIP % BlockSize == 0. - Once placed, the interval is split, creating new (smaller) free intervals before and after the block.
- The network starts as one giant
- Backfilling: Small subnets (like Point-to-Point links) automatically fill the gaps left by the alignment of larger blocks.
- Framework: Next.js 14 (App Router)
- Language: TypeScript (Strict Mode)
- Styling: Tailwind CSS
- Animations: Framer Motion
- Icons: Lucide React
-
Clone the repository:
git clone https://github.com/Retsos/Subnetting-Solver.git cd my-app -
Install dependencies:
npm install # or yarn install -
Run the dev server:
npm run dev
-
Open the portal: Navigate to http://localhost:3000.
This tool is a collaboration between low-level logic and high-level visuals.
- [MasterTsif]: Logic Core & C Implementation. The one who talks to the metal.
- [Retsos]: Frontend Architecture, UI/UX & Visuals. The one who makes the Matrix look good.
Distributed under the MIT License. Use it to optimize your networks, pass your exams, or just stare at the falling code.
SYSTEM READY