9/10/2026 | 2 min read
Inside SkyLink: Engineering an Automated ISP Billing & MikroTik Network Management System
A comprehensive technical dive into how I built a full-stack commercial ISP management SaaS automating PPPoE sessions, real-time OLT fiber telemetry, and instant bKash webhook reconciliation for 2,400+ users.

Managing an Internet Service Provider (ISP) network manually with spreadsheets and individual router logins becomes impossible once you scale past a few hundred subscribers. I engineered **SkyLink** as a centralized network automation and billing platform to solve this exact operational challenge for over 2,400 active broadband users.
## Core System Architecture
The application is structured into three primary architectural tiers:
1. **Network Provisioning Engine**: Direct TCP socket integration with MikroTik RouterOS API (`/ip/pool`, `/ppp/secret`, and `/queue/simple`).
2. **Telemetry & Fiber Monitoring**: Real-time polling of Optical Line Terminals (OLT) and Optical Network Units (ONU) measuring optical RX/TX power levels in dBm to detect fiber cuts before customer complaints arrive.
3. **Automated Billing & IPN Webhook Pipeline**: Instant Payment Notification (IPN) handlers integrated with bKash and Nagad payment gateways for sub-second account reactivation.
## Communicating with MikroTik RouterOS
Connecting to MikroTik routers requires robust connection pooling and state validation. When a subscriber's bill is overdue, the system executes an automated firewall redirect rather than dropping PPPoE packets, guiding them to an automated payment portal:
```typescript
import { RouterOSAPI } from 'node-routeros';
export async function throttleSubscriberSpeed(subscriberIp: string, targetQueue: string) {
const conn = new RouterOSAPI({
host: process.env.MIKROTIK_HOST,
user: process.env.MIKROTIK_USER,
password: process.env.MIKROTIK_PASSWORD,
keepalive: true,
});
await conn.connect();
const queue = await conn.write('/queue/simple/print', [
`?name=${targetQueue}`,
]);
if (queue.length > 0) {
await conn.write('/queue/simple/set', [
`=.id=${queue[0]['.id']}`,
'=max-limit=512k/512k',
'=comment=Auto-throttled due to payment lapse',
]);
}
conn.close();
}
```
## Immutable Ledger for Payments
ISP billing requires zero tolerance for accounting discrepancies. In PostgreSQL 16, every recharge transaction writes an immutable record to a transaction log table wrapped in strict serializable database transactions. If an MFS gateway webhook fires twice, idempotent order IDs prevent duplicate balance top-ups.
Automating these workflows eliminated over 90% of manual support tickets while ensuring zero downtime during peak evening bandwidth hours.
Comments
0 replies- No comments yet. Be the first to share your thoughts.