How to Measure Subscriber Speed in Stingray BNG

November 27, 2026
BNG/BRAS
5 out of 5
How to Measure Subscriber Speed in Stingray BNG
"My internet is slow" is one of the most common support complaints, and one of the vaguest. Behind it could be a maxed-out plan bandwidth, a congested uplink, weak Wi-Fi at the subscriber's home, or traffic that bypasses the BNG altogether. A few commands on the Stingray server are enough to find out which of these is actually going on.

What you need

  • Stingray in BNG mode with RADIUS integration, or in DPI mode managed via API.
  • Statistics collection configured (see Step 1).

Step 1. Make sure statistics are being collected

Speed is calculated from traffic volume, so Stingray has to accumulate it as accounting data. Check that the following parameters are enabled in /etc/dpi/fastdpi.conf:

# Enable accounting
enable_acct=1
# Enable volume statistics accumulation (accounting). The netflow parameter is a bitmask and can take combined values. For example, to enable accounting and full statistics (8) at the same time, set netflow=12.
netflow=4

In addition, service 9 (statistics export for billing) must be enabled for the subscriber’s IP or login. You can enable it in Access-Accept with the VasExperts-Enable-Service=”9:on” attribute or with the command

fdpi_ctrl load --service 9 --ip 192.168.0.1
fdpi_ctrl load --service 9 --login test

If the BNG is already running and accounting is enabled, the data is being collected and there’s nothing to configure. Go to Step 2.

For more on accounting setup, see the documentation: “Accounting: traffic metering (service 9)”.

Step 2. Check accumulated traffic

The subs traffic stat command shows the subscriber’s accumulated billing statistics, that is, the traffic volume that has already passed policing. It outputs the number of packets and bytes in both directions, broken down by traffic classes cs0–cs7 (shown as dscp in the output).

If rating group statistics are enabled for the subscriber, they are included in the output too.

By the subscriber’s IP address:

fdpi_cli subs traffic stat 10.240.34.56

You can also query by login. In that case, you get the combined statistics for all of the subscriber’s IP addresses:

fdpi_cli subs traffic stat login=JSmith

To see in advance which IP addresses are bound to the login and will be included in the total, use the subs bind show command. By default, it shows the binding as it is currently set in fastDPI.

fdpi_cli subs bind show JSmith

To get separate IPv4 and IPv6 statistics by login:

fdpi_cli subs traffic stat login=JSmith ip4
fdpi_cli subs traffic stat login=JSmith ip6

The command output contains two blocks of counters: subs->inet is the subscriber’s outgoing traffic (upload), and inet->subs is incoming traffic (download). For complaints about slow downloads, look at the inet->subs block. The counters in each block are broken down by traffic classes cs0–cs7, so you can see which class carries most of the volume.

The counters are cumulative, so you can use them to estimate speed. Run the command twice with an interval of, say, 10 seconds: the difference in bytes shows the volume over that time, and the average speed is calculated as follows:

How to measure subscriber speed of internet

Let’s say you took two readings 10 seconds apart, and the inet->subs counter grew by 62,500,000 bytes during that time. Convert to bits and divide by the time: 62,500,000 × 8 / 10 = 50 Mbps. If the subscriber has a 100 Mbps plan and complains that “everything is lagging,” this number already tells you a lot: the bandwidth is only half used, and the bottleneck is most likely not the plan.

And if rating group statistics (services 18 and 20) are enabled for the subscriber, the same command also shows exactly where the traffic is going. Service 18 assigns protocols to traffic classes cs0–cs7 and RG groups, and service 20 applies its own speed limits and quotas to those groups.

Average speed is a good first indicator, but to see what’s happening with the traffic right now and where exactly it hits the plan limit, move on to the next step.

Step 3. Measure the speed

The subs traffic stat command itself shows volume, not speed. For real-time speed, use the aliases from the bngaliases package. They do the same thing we did manually in Step 2: take the traffic volume and calculate the subscriber’s speed.

Install the package:

dnf clean all
yum install bngaliases

Display speed with updates every second:

speedip 10.240.34.56
speedlogin JSmith

speedip shows the subscriber’s per-second speed by IP address, speedlogin by login.

If the subscriber has a 100 Mbps plan and speedlogin shows about 100 Mbps during a download, the subscriber is getting the full speed they pay for, and the cause of the complaint lies outside the operator’s network. If the number is noticeably lower, it’s worth finding out where the traffic hits a limit. The speed shown by speedip is the end result. To understand whether policing is cutting it or less traffic is coming in, you need a policing trace.

Here’s how rate limiting works in Stingray: the subscriber’s traffic enters the queue for its class, and if the subscriber tries to send or receive more than the plan allows, the excess packets are dropped. Tracing (plc_trace_ip) enables detailed statistics on this process for a single IP address: how much traffic of a specific traffic class cs0–cs7 was processed, how much was sent, and how much was dropped. The output is per interface. Stingray writes it to the statistics log /var/log/dpi/fastdpi_stat.log.

  1. Specify the subscriber’s IP address in /etc/dpi/fastdpi.conf:
    plc_trace_ip=10.240.34.56
  2. Reload the configuration:
    service fastdpi reload
  3. Reload policing for this address, for example:
    fdpi_ctrl load --policing --profile.name rate_10Mbps --ip 10.240.34.56
  4. Check the statistics for the address in the log:
    grep -A 7 "10.240.34.56" /var/log/dpi/fastdpi_stat.log | more

Sample output for outgoing traffic:

[STAT ][2014/10/30-19:25:16:441786] HTB : Statistics (IP=109.234.130.131) dscp=7, if 'dna2' :
DSCP_actual stats Rcvd: [358187060 bytes][47.73 Mbit/sec]
                        [232589 pkts ][3,874.07 pkt/sec]
                  Drop: [354236960 bytes][98.90 %]
                        [230024 pkts ][98.90 %]
                  Send: [0 bytes][0.00 Mbit/sec]
                        [0 pkts ][0.00 pkt/sec]

The block header shows the subscriber’s IP address (IP=), the traffic class (dscp=7), and the network interface (if ‘dna2’). Below are three lines of statistics.

  • Rcvd: how much traffic was received, here 47.73 Mbps.
  • Drop: what share was dropped, here 98.9%.
  • Send: how much was forwarded, here 0 Mbps.

In this example, almost all class 7 traffic is dropped and nothing gets through. If Drop is close to zero and Send is almost equal to Rcvd, traffic in this class is not being policed.

The log is updated every timeout_alarm period (every 15 seconds by default), so new numbers won’t appear right away.

If the log shows nothing for the address, check the following in order. Tracing shows policing statistics, so first make sure policing is assigned to the subscriber (see the commands in Step 4). If policing is assigned but the log is still empty, either traffic isn’t passing through Stingray or the interface orientation is wrong. in_dev must face the subscribers.

When you’re done, remove the plc_trace_ip line from fastdpi.conf and run service fastdpi reload again to disable tracing. For more on tracing, see the Wiki: “Subscriber channel policing”.

Step 4. Check the subscriber’s plan and services

In Stingray, a subscriber’s plan is a policing profile. Billing assigns it via RADIUS during authorization. The profile can be bound to an IP address or to a login: if billing returned a login, Stingray applies the plan to the login, and then you need to check by login.

To see which policing is assigned to the subscriber:

fdpi_ctrl list --policing --ip 10.240.34.56
fdpi_ctrl list --policing --login JSmith

The fdpi_ctrl output is quite long and is easier to parse with scripts. For a manual check, it’s simpler to use the findsub alias from the “Alias” page. It runs the same command and shows the result as a compact table.

findsub 89.179.251.130

Sample output:

Current time: 2024-08-21T13:54:15.917Z
IP Address: 89.179.251.130
Subscriber's policing rules:
DIRECTION  CLASS  RATE_LIMIT
outbound   0      110 mbps
outbound   1      110 mbps
outbound   2      8 bps
outbound   3      8 bps
outbound   4      110 mbps
outbound   5      110 mbps
outbound   6      110 mbps
outbound   7      110 mbps
inbound    0      110 mbps
inbound    1      110 mbps
inbound    2      8 bps
inbound    3      8 bps
inbound    4      110 mbps
inbound    5      110 mbps
inbound    6      110 mbps
inbound    7      110 mbps
IMPORTANT! "8 bps" is equivalent to "0 bps"

After running the command, compare the RATE_LIMIT column with the plan the subscriber paid for. DIRECTION shows the direction (outbound or inbound), CLASS is the traffic class from 0 to 7. In the example, the subscriber has 110 Mbps in all classes except 2 and 3: a value of 8 bps means blocked, which is how Stingray blocks specific types of traffic. If RATE_LIMIT doesn’t match the paid speed, the problem is in the plan settings in billing, not in the network.

Plan settings by profile name:

fdpi_ctrl list profile --policing --profile.name rate_10Mbps

A service can also set a limit. For example, service 18 limits the speed of individual protocols and sessions. Check it like this:

fdpi_ctrl list --service 18 --ip 10.240.34.56
fdpi_ctrl list --service 18 --login JSmith

Step 5. Find out whose side the problem is on

If the plan is fine but the speed is still low, you need to find out where the traffic is being lost: on the subscriber’s side, on the BNG itself, or on the internet link (uplink).

For this, there’s an internet reachability check on behalf of the subscriber:

fdpi_cli ping inet 8.8.8.8 from 10.240.34.56 n=5

Here 8.8.8.8 is any address on the internet, from 10.240.34.56 is the subscriber’s IP address, and n=5 is the number of requests. Help on all parameters: fdpi_cli ping inet ?.

The ready-made alias from the “Alias” page does the same:

subping 8.8.8.8 10.240.34.56

Stingray generates an ICMP request (ping) as if the subscriber sent it and passes it through the entire stack of functions and services, including policing. Only then does the request go out to the internet and come back the usual way. This lets you rule out the access network’s impact on the subscriber’s traffic and send the ping directly from Stingray’s internal interface, from the subscriber’s IP, with their plan (policing) applied.

Look at the lines after the PING header. Each line corresponds to one received reply, and the summary statistics come at the end. They show where to look for the problem:

  • Replies arrive steadily, with no loss and no growing latency. The path from the BNG to the internet is available and most likely not congested. Look for the problem between the subscriber and the BNG or on the subscriber’s side.
  • No replies, or lines end with “- ERROR:” followed by an error message. The problem is on the BNG itself, for example in services or policing, or on the uplink.

This command is easy to confuse with fdpi_cli ping ip=. That one does the opposite: it pings the subscriber from the BNG side and only works in L2 BNG mode. For example:

fdpi_cli ping ip=10.240.34.56 n=3

General troubleshooting workflow for possible causes of slow speed

The result of each step determines whether the next check is needed and which one. If you find the cause earlier, you can stop there.

How to find the cause of a speed complaint
How to find the cause of a speed complaint

Most often, the decision is based on the policing trace from Step 3. Read its Send and Drop lines as follows:

What the log shows What it means What to check
Send close to the plan, Drop high The subscriber has hit the plan bandwidth Plan (Step 4): the speed matches what they pay for
Send close to the plan, Drop near zero, subscriber complains Bandwidth isn’t the issue The specific resources or service the subscriber needs, the subscriber’s Wi-Fi
Send well below the plan, Drop high Policing limit on a specific class or service Subscriber services (Step 4)
Send well below the plan, Drop near zero Little traffic is coming in; the limit isn’t in policing Uplink and operator network (Step 5), subscriber side
Nothing in the log for the IP address Policing isn’t assigned or traffic isn’t passing through Stingray First policing (Step 4), then the traffic route and interface orientation (in_dev facing subscribers)

Key takeaways

You can find the cause of a subscriber’s slow internet with a few commands on the Stingray server. First, check how much traffic the subscriber is actually getting, then whether policing is cutting it, whether the plan matches what they pay for, and whether traffic passes through the BNG to the internet.

You don’t have to wait for complaints. The QoE module shows subscribers who frequently visit speed test sites. Those who do it 3 or more times a week are worth checking first.