BQN Documentation
BQN Documentation

Overview

REST Deployment


The BQN subscriber rate policies and the assignment of subscribers to subscriber rate policies can be performed via a REST API, which can also provide subscriber metrics. To do this, of course, the BQN must view the IP addresses of the subscriber data traffic, i.e., there cannot be a NAT between the subscribers and the BQN, because the plan limits will be applied for each IP address. It is also important for the wires to be connected correctly (i.e., for the network ports configured as access ports to be connected on the side of the subscribers).

Currently, only IPv4 addresses are supported.

The integration is between a system that controls the plan definition (e.g., a billing system) and the BQN, through the BQN management interface. The BQN acts as the REST API server. The BQN uses the management IP address (the same used by the GUI) to receive the REST messages listening on TCP port 3443 (configurable).

REST Definition and Selection of Policies


Through the REST API the following operations are possible:

  • Create rate control policies (the subscription plans).
  • Assign a plan to a subscriber.
  • Obtain subscriber metrics for up to 3 months: volume used, maximum speed, latency, retransmissions, and active/created flows.

The following diagram shows an example in which several policies are created and later one each subscriber has one of those policies assigned.

There are operations to create, list, modify and delete both the policies and the subscriber associations.

The REST API is described in more detail in the BQN REST API Guide, that includes the definition of all the possible requests.

REST Configuration

Configure REST in the BQN

1.      To activate the REST API in the BQN, go to Configuration->External Subscriber Data->REST API and switch Rest API to On.

2.      Add the IP addresses of all REST clients to the BQN configuration. In the GUI, go to Configuration->External Subscriber Data->REST API and click on Add Client…

3.      Add the REST users, along with their passwords, to the BQN configuration. In the GUI, go to Configuration->External Subscriber Data->REST API and click on Add User…

Check REST clients

The REST API integration requires to program the API in the element interacting with the BQN, for example a billing system. To test that the BQN REST configuration is correct, REST messages can be sent manually using curl Linux utility.

As an example, to create a policy named my_rest_policy_1and asssign it to a subscriber with IP 10.10.1.232:

curl -i -k -m 20 -u myuser:mypassword -X POSThttps://192.168.0.121:3443/api/v1/policies/rate/my_rest_policy_1 -H"Content-Type: application/json" --data'{"rateLimitDownlink": {"rate": 1000,"burstRate": 2000}, "rateLimitUplink": {"rate":500, "burstRate": 1000}}'

Check the REST API

Once the policies and subscriber associations are created, the table Status->Radius/REST->Policies will show the policies coming from REST. For example, the next table show two policies, with two subscribers each. For the time being, there is no active subscriber (with traffic) with those policies:

Note that there are two active subscribers, without a REST policy and that have a static policy defined in the BQN (rate-default in this example).

To see the list of subscribers with REST policies, select Status->Radius/REST->Subscribers. The next example shows four subscribers and their associated policies:

The subscribers get a policy when the REST message is received. When the subscriber generates traffic, it will appear in the list of active subscribes in Status->Subscribers.

If a digital certificate is needed in the BQN

Sometimes, the REST clients need a specific digital certificate to validate the access.

Log as root to BQN Unix shell and copy the certificate and its key in the following files:

 
/bqn/root/etc/ssl/certs/bqn.crt
/bqn/root/etc/ssl/private/bqn.key

(you can use scp to transfer previously the certificate files to the BQN server).

To apply the change, reboot the BQN server in Administration->Reboot.

previous
NEXT