From 51b2a07270da8f20de582eb7f96a464b558ebd96 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Thu, 18 Sep 2025 21:50:01 +0100 Subject: [PATCH] Top-level routes for CIDR pages --- src/routes/cidr/+page.svelte | 520 ++++++++++++++++-- src/routes/cidr/mask-converter/+layout.svelte | 2 +- src/routes/cidr/mask-converter/+page.svelte | 0 src/routes/cidr/set-operations/+layout.svelte | 279 +++------- src/routes/cidr/set-operations/+page.svelte | 14 + 5 files changed, 561 insertions(+), 254 deletions(-) create mode 100644 src/routes/cidr/mask-converter/+page.svelte create mode 100644 src/routes/cidr/set-operations/+page.svelte diff --git a/src/routes/cidr/+page.svelte b/src/routes/cidr/+page.svelte index 8cf61ab..8ddb8d5 100644 --- a/src/routes/cidr/+page.svelte +++ b/src/routes/cidr/+page.svelte @@ -1,7 +1,10 @@
-
+

{title}

{description}

diff --git a/src/routes/cidr/mask-converter/+page.svelte b/src/routes/cidr/mask-converter/+page.svelte new file mode 100644 index 0000000..e69de29 diff --git a/src/routes/cidr/set-operations/+layout.svelte b/src/routes/cidr/set-operations/+layout.svelte index 46a99de..be44ec8 100644 --- a/src/routes/cidr/set-operations/+layout.svelte +++ b/src/routes/cidr/set-operations/+layout.svelte @@ -1,184 +1,88 @@ -
-

Set Operations Reference

-

- Mathematical set operations allow you to combine, analyze, and manipulate IP address ranges - systematically. Each operation serves different network analysis and management purposes. -

+
+

{setOperationsContent.title}

+

{setOperationsContent.description}

-
-
-
A ∪ B
-
Union
+ {#each setOperationsContent.operations as operation} +
+
+
{operation.symbol}
+
{operation.name}
+
+
{operation.description}
+
+ Example: {operation.example} +
-
- Combines all addresses from both sets. Results in addresses that are in A OR B. - Useful for merging address allocations or creating comprehensive allow-lists. -
-
- Example: 192.168.1.0/24 ∪ 192.168.2.0/24 = both networks -
-
- -
-
-
A ∩ B
-
Intersection
-
-
- Finds common addresses between sets. Results in addresses that are in BOTH A AND B. - Essential for identifying conflicts or overlapping allocations. -
-
- Example: 192.168.0.0/16 ∩ 192.168.1.0/24 = 192.168.1.0/24 -
-
- -
-
-
A - B
-
Difference
-
-
- Removes B's addresses from A. Results in addresses that are in A but NOT in B. - Critical for calculating remaining capacity or excluding reserved ranges. -
-
- Example: 192.168.1.0/24 - 192.168.1.128/25 = 192.168.1.0/25 -
-
- -
-
-
A ⊆ B
-
Containment
-
-
- Tests if A is completely contained within B. Returns boolean result plus coverage analysis. - Valuable for validating subnet hierarchies and allocation compliance. -
-
- Example: 192.168.1.0/25 ⊆ 192.168.1.0/24 = true -
-
+ {/each}
-
+

Common Network Patterns

-
-
Firewall Management
-
    -
  • Allow Lists: Union of trusted networks
  • -
  • Conflicts: Intersection of allow/deny rules
  • -
  • Exceptions: Difference to exclude specific ranges
  • -
-
- -
-
IP Allocation
-
    -
  • Available Space: Difference from allocated ranges
  • -
  • Overlaps: Intersection of allocation requests
  • -
  • Validation: Containment within authorized blocks
  • -
-
- -
-
Network Analysis
-
    -
  • Coverage: Union of monitoring ranges
  • -
  • Gaps: Difference to find unmonitored areas
  • -
  • Redundancy: Intersection of backup networks
  • -
-
- -
-
Cloud Networks
-
    -
  • VPC Planning: Union of required address space
  • -
  • Peering: Intersection analysis for conflicts
  • -
  • Segmentation: Difference for isolation
  • -
-
+ {#each setOperationsContent.patterns as pattern} +
+
{pattern.title}
+
    + {#each pattern.items as item} +
  • {item.term}: {item.description}
  • + {/each} +
+
+ {/each}
-
+

Implementation Notes

-
-
IPv4 vs IPv6
-

- All operations process IPv4 and IPv6 addresses separately. You cannot perform - set operations between different IP versions - they operate in distinct address spaces. -

-
- -
-
CIDR Optimization
-

- Results are automatically optimized into minimal CIDR representations. - Complex operations may require multiple CIDR blocks to exactly represent the result. -

-
- -
-
Range Normalization
-

- Input ranges are normalized and merged before operations. Overlapping inputs - within the same set are automatically combined for accurate results. -

-
- -
-
Performance Considerations
-

- Operations are optimized for network-sized ranges. Very large address spaces - or numerous small ranges may require additional processing time. -

-
+ {#each setOperationsContent.notes as note} +
+
{note.title}
+

{note.content}

+
+ {/each}
-
+

Best Practices

    -
  • Validate Inputs: Always verify CIDR notation and IP formats before operations
  • -
  • Document Operations: Export results and maintain records of set operations
  • -
  • Test in Stages: For complex operations, break into smaller steps for verification
  • -
  • Monitor Results: Use visualization to verify operations produce expected outcomes
  • + {#each setOperationsContent.bestPractices as practice} +
  • {practice.term}: {practice.description}
  • + {/each}