Description
Generate aligned equal-prefix child blocks within an explicit normalized IPv4 parent, delegating masks/network/broadcast answers and using bounded-memory index sampling; non-overlap samples without replacement, otherwise duplicate blocks are allowed, with no address allocation or routing action.
A protocol fixture is local test data representing headers, messages, identifiers, or request decisions. Serialization and parsing can be checked without contacting a server, while authentication, delivery, and actual client behavior require separate tests.
Generate aligned equal-prefix child blocks within an explicit normalized IPv4 parent, delegating masks/network/broadcast answers and using bounded-memory index sampling; non-overlap samples without replacement, otherwise duplicate blocks are allowed, with no address allocation or routing action.
When to use this tool
Use this generator to create reproducible ipv4 cidr block set cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply parentAddress, parentPrefix, childPrefix, count, nonOverlap in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read parentCidr, availableBlockCount, blocks. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
Normalize the supplied parent IPv4 address to its network, calculate the child-prefix block population, and sample aligned child indexes. Return network and broadcast addresses and total addresses per block, using distinct indexes when nonOverlap is true.1
Delegated operations used for this result: ipv4 cidr; ipv4 network address. Their calculation or parsing conventions apply to the corresponding result fields.2, 3
| Input field | Meaning and units | Accepted input |
|---|---|---|
| parentAddress | Parent Address | Required. Text; minimum UTF-16 length 7; maximum UTF-16 length 15. |
| parentPrefix | Parent Prefix | Required. Safe integer; minimum 0; maximum 32. |
| childPrefix | Child Prefix | Required. Safe integer; minimum 0; maximum 32. |
| count | Requested count; the mechanics explain whether one draw expands into several returned records. | Required. Safe integer; minimum 1; maximum 256. |
| nonOverlap | Non Overlap | Required. Boolean. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| parentCidr | Parent Cidr | Required. Text; minimum UTF-16 length 9; maximum UTF-16 length 18. |
| availableBlockCount | Available Block Count | Required. Safe integer; minimum 1; maximum 4294967296. |
| blocks | Blocks | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 256. |
| blocks[].index | Index | Required. Safe integer; minimum 0; maximum 4294967295. |
| blocks[].cidr | Cidr | Required. Text; minimum UTF-16 length 9; maximum UTF-16 length 18. |
| blocks[].networkAddress | Network Address | Required. Text; minimum UTF-16 length 7; maximum UTF-16 length 15. |
| blocks[].broadcastAddress | Broadcast Address | Required. Text; minimum UTF-16 length 7; maximum UTF-16 length 15. |
| blocks[].addressCount | Address Count | Required. Safe integer; minimum 1; maximum 4294967296. |
| randomness | Replay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional numeric replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"parentAddress": "192.0.2.77",
"parentPrefix": 24,
"childPrefix": 26,
"count": 3,
"nonOverlap": true,
"seed": 42
},
"output": {
"parentCidr": "192.0.2.0/24",
"availableBlockCount": 4,
"blocks": [
{
"index": 2,
"cidr": "192.0.2.128/26",
"networkAddress": "192.0.2.128",
"broadcastAddress": "192.0.2.191",
"addressCount": 64
},
{
"index": 1,
"cidr": "192.0.2.64/26",
"networkAddress": "192.0.2.64",
"broadcastAddress": "192.0.2.127",
"addressCount": 64
},
{
"index": 3,
"cidr": "192.0.2.192/26",
"networkAddress": "192.0.2.192",
"broadcastAddress": "192.0.2.255",
"addressCount": 64
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- childPrefix cannot be shorter than parentPrefix. addressCount includes every address, not just usable host addresses. This constructs address-space fixtures and does not reserve routes, scan networks, or verify deployment suitability.
- A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random HTTP Set-Cookie Attribute Corpus Generator
Compose synthetic Set-Cookie name/value pairs and bounded attribute subsets from supplied value pools, including explicit opaque Expires text, flags, and supported name casing; delegate serializer/parser outputs while preserving attribute order, without dates interpreted, browser acceptance, credentials, or security-policy recommendations.
- Random QR Message Card Set Generator
Sample supplied synthetic message templates, replace literal the index token and the code token tokens with a one-based card index and six random decimal digits, and delegate standard QR SVG symbols with explicit error correction; other text is literal, duplicates are reported, capacity failures stay structured, and app layout/print export are separate.