SnmpKit.SnmpSim.DeviceDistribution (snmpkit v0.6.6)

Device Type Distribution for realistic device type assignment across port ranges. Supports mixed device populations for authentic testing environments.

Features:

  • Realistic device type distribution patterns
  • Flexible port range assignment strategies
  • Support for custom device mixes
  • Population density calculations
  • Device type metadata and characteristics

Summary

Functions

Build port assignments from a device mix and port range. Distributes devices across the port range maintaining the specified ratios.

Calculate population density statistics for device assignments.

Get the default device type port ranges for large-scale simulation. Optimized for 10K device populations with realistic distribution.

Determine device type for a given port based on port assignments.

Generate device ID with type-specific formatting.

Get device type characteristics and metadata.

Get common device mix patterns for different testing scenarios.

Validate port assignments for consistency and coverage.

Types

device_mix()

@type device_mix() :: %{required(device_type()) => non_neg_integer()}

device_type()

@type device_type() :: :cable_modem | :mta | :switch | :router | :cmts | :server

port_assignments()

@type port_assignments() :: %{required(device_type()) => port_range()}

port_range()

@type port_range() :: Range.t()

Functions

build_port_assignments(device_mix, port_range)

@spec build_port_assignments(device_mix(), port_range()) :: port_assignments()

Build port assignments from a device mix and port range. Distributes devices across the port range maintaining the specified ratios.

calculate_density_stats(port_assignments)

@spec calculate_density_stats(port_assignments()) :: %{required(atom()) => any()}

Calculate population density statistics for device assignments.

default_port_assignments()

@spec default_port_assignments() :: port_assignments()

Get the default device type port ranges for large-scale simulation. Optimized for 10K device populations with realistic distribution.

determine_device_type(port, port_assignments)

@spec determine_device_type(non_neg_integer(), port_assignments()) ::
  device_type() | nil

Determine device type for a given port based on port assignments.

generate_device_id(device_type, port, opts \\ [])

@spec generate_device_id(device_type(), non_neg_integer(), keyword()) :: String.t()

Generate device ID with type-specific formatting.

get_device_characteristics(arg1)

@spec get_device_characteristics(device_type()) :: %{required(atom()) => any()}

Get device type characteristics and metadata.

get_device_mix(atom)

@spec get_device_mix(atom()) :: device_mix()

Get common device mix patterns for different testing scenarios.

validate_port_assignments(port_assignments)

@spec validate_port_assignments(port_assignments()) :: :ok | {:error, term()}

Validate port assignments for consistency and coverage.