📐Using vnStat for Monitoring Bandwidth on an SD-WAN Edge⚙️
vnStat efficiently monitors bandwidth using kernel data, minimizing system load in SD-WAN deployments with multiple links and cost-sensitive data.
In the world of Software-Defined Wide Area Networking (SD-WAN), managing network performance is critical to ensure seamless connectivity and optimal usage of available bandwidth. One useful tool for monitoring bandwidth usage on SD-WAN edge devices is vnStat
, a lightweight, console-based network traffic monitor that helps track bandwidth consumption over time.
Unlike other bandwidth monitoring tools, vnStat
is highly efficient, using data provided by the kernel to avoid adding any additional load on the system. For businesses running SD-WAN deployments where multiple links and cost-sensitive data usage need to be closely tracked, vnStat
offers valuable insights without requiring heavyweight processing.
What is vnStat
?
vnStat
is a simple network traffic monitor that tracks bandwidth usage on network interfaces over various time periods. It collects and maintains a log of network traffic, providing statistics for hourly, daily, monthly, and yearly bandwidth usage. It can be run on any Linux-based system and, therefore, can be easily deployed on SD-WAN edge devices running a Linux distribution, often used in solutions like OpenWrt or other NFV-based SD-WAN platforms.
The primary advantage of vnStat
is its low resource usage, making it perfect for SD-WAN edge environments where performance is key and monitoring overhead needs to be minimized.
Why is vnStat
Useful for SD-WAN?
In an SD-WAN environment, you often have multiple last-mile connections, including fibre, wireless, and mobile. Monitoring how much traffic each link carries is crucial for managing bandwidth costs and identifying usage patterns. For example, mobile networks typically have expensive data plans, and being able to monitor how much traffic is going over a mobile backup link can help prevent unexpected overages.
vnStat
provides historical usage information, allowing you to see the bandwidth consumption trends on each interface, such as:
Hourly usage patterns to pinpoint times of peak network traffic.
Daily statistics for ongoing monitoring of traffic over each business day.
Monthly reports to assess the long-term bandwidth consumption and costs associated with each link.
This data is especially helpful in environments where bandwidth usage affects operational costs. For example, SD-WAN edge devices may use multiple types of connections with different billing structures, and careful monitoring ensures cost-effective traffic routing.
Installing & Configuring vnStat
on an SD-WAN Edge
Setting up vnStat
on a Linux-based SD-WAN edge device is simple. Installation is usually done using the system’s package manager. For example, on a Debian-based system, you can install it using the following command:
sudo apt install vnstat
Once installed, vnStat
automatically starts monitoring traffic on all available interfaces. It begins collecting data, and you can view usage statistics immediately.
To check the bandwidth usage on a specific interface (e.g., eth0
), simply run:
vnstat -i eth7
This command will provide a summary of the traffic for that interface, showing the received and transmitted traffic in various timeframes, including daily and monthly usage. Example output:
The output provides a quick glance at the bandwidth consumption of the interface, showing how much data has been received (rx
), transmitted (tx
), and the total traffic.
Key Features & Information Provided by vnStat
Low Overhead Monitoring:
vnStat
uses the kernel’s own traffic counters, which means it doesn’t introduce additional load on the SD-WAN edge device. This makes it ideal for deployments where performance is critical.Hourly, Daily, Monthly, and Yearly Statistics:
vnStat
allows you to break down bandwidth usage into multiple timeframes. This flexibility is particularly useful when monitoring links for billing purposes or managing data limits on mobile or wireless connections.Interface-Specific Monitoring: In an SD-WAN environment, multiple interfaces (e.g., fibre, LTE, wireless) are used to create a seamless network.
vnStat
lets you monitor each individual link separately, giving you a clear view of which connections are carrying the most traffic.Historical Data Retention:
vnStat
logs usage over time, making it easy to track historical data and notice trends in bandwidth usage. This can be particularly useful for identifying peak usage periods or sudden spikes in traffic, allowing for better traffic management and planning.Custom Reports: You can create custom reports with
vnStat
to focus on specific timeframes or interfaces. For example, you can generate daily reports to see traffic per business day, allowing you to adjust traffic routing policies if one link becomes too congested.Detailed Bandwidth Breakdown: The tool provides detailed breakdowns for incoming and outgoing traffic, which is crucial for identifying specific issues like upload congestion or download-heavy periods that affect application performance.
Monitoring SD-WAN Edge Performance with vnStat
SD-WAN devices deployed at the business edge need to handle traffic efficiently across multiple connections. Monitoring bandwidth with vnStat
ensures that each last-mile connection is being utilised effectively. For example, by reviewing the bandwidth usage on each link, you can:
Optimise traffic routing: Route more traffic over cheaper links, such as fibre, while keeping higher-cost mobile connections as a backup.
Detect anomalies: If one link shows unusual spikes in usage, it may indicate a misconfiguration or a potential security issue.
Plan for upgrades: Over time,
vnStat
can help identify if certain links are consistently operating at or near capacity, signalling that an upgrade may be required.
Wrap
For SD-WAN edge deployments, especially those leveraging multiple types of last-mile connections, vnStat
is a highly effective tool for monitoring bandwidth usage. Its lightweight nature and detailed reporting capabilities make it ideal for tracking traffic across fibre, fixed wireless, and mobile links, helping to manage costs and ensure optimal network performance. By providing historical usage statistics in various timeframes, vnStat
empowers network administrators to make informed decisions about traffic management and capacity planning, ensuring the SD-WAN network operates smoothly and efficiently.
Ronald Bartels ensures that Internet inhabiting things are connected reliably online at Fusion Broadband South Africa - the leading specialized SD-WAN provider in South Africa. Learn more about the best SD-WAN in the world: 👉Contact Fusion🚀