SimulaTR69

module
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2025 License: MIT

README

TR-069 simulator

A CPE simulator for TR-069 protocol. It supports both TR-098 and TR-181 datamodel formats.

[!WARNING] This project is under active development.

All required TR-069 operations are implemented. Current work focuses on optimizations and compatibility.

Installation

Give it a serial number, point to a datamodel file and the ACS and it should work out of the box.

See server/config.go for available configuration options.

Docker Compose

Add a service to the docker-compose.yml file:

services:
  tr069sim:
    image: ghcr.io/localhots/simulatr69:latest
    volumes:
      - /path/to/datamodel.csv:/app/datamodel.csv
      - sim_state:/state
    ports:
      - 7547
    environment:
      SERIAL_NUMBER: G3000E-9799109101
      DATAMODEL_PATH: /app/datamodel.csv
      STATE_PATH: /state/state.json
      ACS_URL: http://myisp/acs
      LOG_LEVEL: debug

volumes:
  sim_state:

Use

All required methods are supported and should behave realistically, except Upload currently don't do anything. There are quirks though.

Datamodel Format

Datamodel files are provided in CSV format similar to the one used by GenieACS simulator.

It is possible to fake parameter values using parameter noise generators, e.g.:

Parameter,Object,Writable,Value,Type
Device.DeviceInfo.ProcessStatus.CPUUsage,false,true,"perlinNoise(offset=50, alpha=2, beta=2, scale=40) as xsd:int",sim:generator

Parameter Normalization

NORMALIZE_PARAMETERS when set to true will make the simulator attempt to normalize datamodel parameters. Normalization will bring parameter types to common xsd: prefixed format with values checked against their types: negative unsigned integer numbers will be corrected to zeroes, boolean "yes" will be normalized to "true".

Default is false.

Connection Requests

Simulator can accept connection requests made over UDP and HTTP. If the ACS will set the following parameter values they will be respected:

  • ManagementServer.ConnectionRequestUsername
  • ManagementServer.ConnectionRequestPassword

Firmware Upgrades

The simulator supports firmware upgrades in a simple JSON format:

{"version": "123.45"}

If the provided URL can't be loaded or if the firmware file has a different format the simulator will respond with a fault.

If everything is fine the simulator will change DeviceInfo.SoftwareVersion parameter value in its state and pretend to take time to upgrade and reboot.

License

MIT

Directories

Path Synopsis
cmd
convert command
This package allows to convert datamodels into a CSV format that is supported by this simulator.
This package allows to convert datamodels into a CSV format that is supported by this simulator.
server command
Package main initializes and runs the TR-069 device simulator, handling configuration loading, datamodel setup, and server lifecycle management.
Package main initializes and runs the TR-069 device simulator, handling configuration loading, datamodel setup, and server lifecycle management.
Package datamodel provides a comprehensive implementation of a stateful CPE (Customer Premises Equipment) data model.
Package datamodel provides a comprehensive implementation of a stateful CPE (Customer Premises Equipment) data model.
noise
Package noise provides algorithms to generate sequences of values that simulate sensor readings with various patterns, including random walk, piecewise linear, sine wave with noise, and Perlin noise.
Package noise provides algorithms to generate sequences of values that simulate sensor readings with various patterns, including random walk, piecewise linear, sine wave with noise, and Perlin noise.
nolint:revive
nolint:revive
Package simulator provides a TR-069 device simulator that can be used to emulate the behavior of TR-069 compliant devices.
Package simulator provides a TR-069 device simulator that can be used to emulate the behavior of TR-069 compliant devices.
metrics
Package metrics provides a set of Prometheus metrics for monitoring the performance and behavior of a TR-069 simulator.
Package metrics provides a set of Prometheus metrics for monitoring the performance and behavior of a TR-069 simulator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL