Skip to content

Weighted sampling from multiple networks #67

@davidchall

Description

@davidchall

The sample_ipv4(), sample_ipv6() and sample_network() functions support sampling addresses from a single network. When sampling from multiple networks, the current advice is to use an accept-reject algorithm. This is fine for generating IPv4 public addresses (~87% acceptance), but is computationally inefficient when the acceptance is low.

We could add a new function (or adjust sample_network()) to sample from a list of networks. By default, these networks would be sampled according to their size. But we could also allow the user to specify weightings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions