# Example Network Plans

Sample network plans demonstrating common architectures.

## Available Examples

### 1. Campus Network (`example-campus-network.json`)

**Scenario:** Multi-building university campus with diverse networking needs

**Subnets:**

- Engineering Building (VLAN 10): 100 devices → /24
- Science Lab (VLAN 20): 75 devices → /24
- Student WiFi (VLAN 30): 250 devices → /23
- Administration (VLAN 40): 30 devices → /26
- Guest WiFi (VLAN 50): 50 devices → /25

**Supernet:** 10.100.0.0/21 (2048 addresses)
**Utilization:** 59.4% supernet, 100% range

**Demonstrates:**

- Mixed subnet sizes (from /23 to /26)
- VLSM optimization for diverse requirements
- Large WiFi networks with capacity planning
- VLAN organization for different departments

### 2. Data Center (`example-data-center.json`)

**Scenario:** Three-tier application infrastructure with specialized networks

**Subnets:**

- Web Tier (VLAN 100): 20 devices → /26
- Application Tier (VLAN 110): 30 devices → /26
- Database Tier (VLAN 120): 10 devices → /27
- Storage Network (VLAN 130): 15 devices → /27
- Management (VLAN 140): 8 devices → /27
- Backup Network (VLAN 150): 5 devices → /28

**Supernet:** 172.16.0.0/24 (256 addresses)
**Utilization:** 93.8% supernet, 100% range

**Demonstrates:**

- 93.8% supernet utilization (tight packing)
- Tier-based network segregation
- Small management and backup networks
- Optimal CIDR allocation for data center use

### 3. Branch Office (`example-branch-office.json`)

**Scenario:** Small branch office with basic networking requirements

**Subnets:**

- Office Workstations (VLAN 10): 25 devices → /26
- VoIP Phones (VLAN 20): 15 devices → /27
- Guest WiFi (VLAN 30): 10 devices → /27
- Printers (VLAN 40): 5 devices → /28
- Servers (VLAN 50): 3 devices → /29

**Supernet:** 192.168.10.0/25 (128 addresses)
**Utilization:** 118.8% supernet, 100% range

**Demonstrates:**

- 118.8% supernet utilization (requires larger supernet)
- VoIP network segregation
- Multiple small networks (/28, /29)
- Typical branch office architecture

## Loading Examples

### From the Dashboard

1. Launch cidrly: `cidrly`
2. Press `l` to load a plan
3. Navigate to the `examples/` directory
4. Select an example plan

### From Command Line

```bash
# Load campus network
cidrly view --plan=examples/example-campus-network.json

# Load data center
cidrly view --plan=examples/example-data-center.json

# Load branch office
cidrly view --plan=examples/example-branch-office.json
```

## Understanding the Plans

### Supernet Utilization

Shows how much address space is used relative to the smallest containing supernet:

- **< 60%**: Loose packing, significant unused space
- **60-80%**: Reasonable utilization
- **80-95%**: Tight packing, minimal waste
- **95-100%**: Near-perfect fit within supernet
- **> 100%**: Exceeds smallest supernet capacity (e.g., 118.8% = needs 18.8% more space, requires larger supernet)

### Range Efficiency

Shows how tightly subnets are packed (VLSM optimization):

- **100%**: Perfect VLSM allocation (no gaps)
- **< 100%**: Gaps between subnets (shouldn't happen with cidrly!)

### Capacity Planning (Configurable Growth)

Each example shows "expected devices" vs "planned devices":

- **Expected:** Devices you know about today
- **Planned:** Expected × (1 + growth%) — default 100% (doubles device count)
- **Allocated:** Next power of 2 that fits planned devices

**Default Example:** 25 expected → 50 planned (100% growth) → 64 allocated (/26)

**Customize Growth:**

- Press `p` in the dashboard to adjust growth percentage (0-200%)
- New plans default to 100% growth
- Loaded plans restore their saved growth percentage
- Each plan remembers its own growth setting

## Modifying Examples

Feel free to experiment with these plans:

1. **Load an example**
2. **Add more subnets** (press `a`)
3. **Recalculate** (press `c`)
4. **See how utilization changes**
5. **Save your modified version** (press `s`)

## Common Patterns

### High-Density Networks

Use the data center example to see:

- Tight address packing
- Smaller subnet sizes (/26-/28)
- 93.8% supernet utilization

### Mixed Requirements

Use the campus example to see:

- Large WiFi networks (/23)
- Medium office networks (/24-/25)
- Small admin networks (/26)
- VLSM handling diverse needs

### Small Networks

Use the branch office example to see:

- Very small subnets (/28-/29)
- Limited address space allocation
- Over-allocation example (118.8% utilization)

## Creating Your Own

These examples can serve as templates:

1. **Start with similar example**
2. **Change base IP** (press `b`)
3. **Edit subnet names** (press `e`)
4. **Adjust device counts**
5. **Add/remove subnets** (press `a`/`x`)
6. **Save as new plan** (press `s`)

## Testing Features

Use these examples to test cidrly features:

- Load/save functionality
- Subnet information dialog (press `i`)
- Sortable columns (press `Tab` then `←/→` to navigate, `Enter`/`Space` to sort)
- Configurable growth percentage (press `p`)
- Edit existing subnets
- Delete and recalculate
- Base IP changes
- VLSM optimization
- Utilization calculations

## Questions?

See [CONTRIBUTING.md](../CONTRIBUTING.md) for contribution guidelines and feedback instructions.
