Boots cable modems from MySQL tables, in six Rust processes.
docsis_server is an integrated provisioning server for DOCSIS cable plants. Working alongside a CMTS, it boots cable modems and the customer equipment behind them: it answers DHCPv4 and DHCPv6, hands each modem its configuration file over TFTP, serves time-of-day, and collects syslog from the plant. All of it is driven from MySQL tables that an existing provisioning or billing system can write to directly.
unsafe forbidden throughout · clean under clippy::pedantic
Repository: github.com/mmqr-developer/docsis_server · The four DOCSIS projects also have a site of their own at docsis-admin.com.
Six processes, one per port
A crash in one does not take the others down, and a supervisor restarts it.
From power-on to online
SELECT ... FOR UPDATE over the candidate range, so two servers sharing a database cannot hand out the same address. Deadlocks are retried; a lost race looks elsewhere rather than declaring the pool full.
/dev/shm, so a plant-wide reboot storm is answered without waiting on the database.
tell-docserv queues a command for a running service: flush the caches, change the log level, or shut down. When a pool runs out of addresses an external program is invoked, rate-limited per kind.
Nine standalone binaries
count-ipsAddress pool usage for one CMTS VLANdb-config-encoderCompiles configuration fragment text into its binary formdelete-old-leasesAges out stale leases on one VLAN, with a dry-run modegen-cache-filesRegenerates the /dev/shm hand-off cacheslist-messagesPrints recent rows from any log tablesummarize-logsRotates old log rows into the archive databasetell-docservQueues a remote command for a running serverstress-config-generatorBenchmarks configuration-file generationtest-cv-macMAC address conversion round-trip checkBuild, load the schema, start
You need a Rust toolchain supporting edition 2024 (1.85 or newer), MySQL 8.x or MariaDB 10.11 or newer, and a CMTS configured to relay DHCP to this server. The docsis encoder is needed only if you use generated configuration files.
# build git clone https://github.com/mmqr-developer/docsis_server.git cd docsis_server cargo build --release # the provisioning database, and the two the logs go in mysql -u root -p -e "CREATE DATABASE docsis_server DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE DATABASE docsis_server_logs DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE DATABASE syslog_server DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" # the tables, into the provisioning database only mysql -u root -p docsis_server < scripts_and_docs/schema-dhcp.sql mysql -u root -p docsis_server < scripts_and_docs/schema-dhcpv6.sql # if you serve IPv6 # copy and edit the configuration, then start the activated services cp scripts_and_docs/docsis-server.json /etc/docsis-server.json docsis_server
The configuration file is JSON read with a relaxed parser — comments, trailing commas and unquoted keys are all allowed — and it ships heavily annotated. Every key is typed: a misspelling or an out-of-range value is reported at start-up with the line and column rather than silently ignored. The schema files name no database, so a second plant can live on the same MySQL server under a different name.
Deploying
INSTALL.md covers a full deployment including the systemd units; INSTALL.cisco.md covers the CMTS side and INSTALL.mysql-users.md the database accounts and the grants each needs.
The tables
SQL_INFO.md names every table and column, what writes it and what reads it. Both schema files and the configuration file are annotated and worth reading alongside it.
Devices
Worked guides for embedded telephony adapters, set-top boxes and wireless gateways and eRouters, plus a worked set of configuration fragments and upgrading from the C server, setting by setting.