Saving Data: How to Shape & Limit Traffic in Ubuntu Linux and Windows: A Step-by-Step Guide
How to Shape Traffic in Ubuntu Linux and Windows: A Step-by-Step Guide
Article Credit: dotifi.com
Network bandwidth management, commonly known as traffic shaping, allows you to allocate, throttle, and prioritize network speed across applications and devices. Whether you need to prevent background downloads from saturating your bandwidth, simulate slow network conditions, or cap usage at specific limits (like 355 Kbps), traffic shaping gives you total control over your network behavior.
Below is a guide on how to configure traffic limits in Ubuntu Linux using WonderShaper and Windows using NetLimiter, along with steps for interface identification, Git checking, troubleshooting, speed testing, and key network terms.
Part 1: Traffic Shaping in Ubuntu Linux (using WonderShaper)
WonderShaper is a lightweight bash script designed to set maximum upload and download speed limits on specific Linux network interfaces using kernel-level traffic control (tc).
Step 1: Identify Your Active Wi-Fi or Internet Connection Name
Before applying speed caps, you must know the exact system name of your network interface.
-
Open your terminal (
Ctrl + Alt + T). -
Run one of the following commands:
Baship link showOr:
Baship addr -
Look for your active network interface:
-
Wi-Fi interfaces typically begin with
wlan0,wlp2s0, orwlp1s0. -
Wired Ethernet interfaces typically begin with
eth0,enp3s0, oreno1.
-
Step 2: Check if Git is Installed & Install WonderShaper
Checking Git Installation
Run:
git --version
-
If installed: The terminal displays the version number (e.g.,
git version 2.x.x). -
If not installed: You can install Git by running:
Bashsudo apt update && sudo apt install git -y
Installing WonderShaper
You can install WonderShaper directly via apt or clone the repository using Git for the latest updates.
Method A: APT Install (Quickest)
sudo apt update
sudo apt install wondershaper -y
Method B: Git Clone (Latest Version)
cd /usr/local/bin
sudo git clone https://github.com/magnific0/wondershaper.git
cd wondershaper
sudo make install
Step 3: Set Traffic Limits at 355 Kbps
WonderShaper measures speeds in kilobits per second (Kbps).
Assuming your interface name is wlp1s0 (replace wlp1s0 with your actual Wi-Fi or Ethernet name):
-
Set Download and Upload limits to 355 Kbps:
Bashsudo wondershaper -a wlp1s0 -d 355 -u 355(Flags:
-aspecifies the interface,-dsets download rate in Kbps, and-usets upload rate in Kbps.) -
Check status of applied limits:
Bashsudo wondershaper -sa wlp1s0 -
Clear/Reset traffic limits:
Bashsudo wondershaper -ca wlp1s0
Step 4: Ubuntu Troubleshooting
| Issue | Cause | Solution |
command not found: wondershaper |
Binary is not in system PATH. | Use /usr/bin/wondershaper or complete make install inside the cloned directory. |
Operation not permitted |
Missing root permissions. | Always execute WonderShaper with sudo. |
| Limits don’t seem to apply | Wrong interface specified. | Re-check active connection via ip addr to confirm correct adapter selection. |
Part 2: Traffic Shaping in Windows (using NetLimiter)
NetLimiter is an internet traffic control and monitoring application designed for Windows that allows setting granular download and upload speed limits per application or per adapter.
Step 1: Download & Install NetLimiter
-
Download NetLimiter from the official website (
netlimiter.com). -
Run the executable installer (
.exe) and complete the installation wizard. -
Restart your PC if prompted to complete driver installation.
Step 2: Identify Your Wi-Fi or Network Connection
-
Open Settings > Network & Internet.
-
Click Properties on your active Wi-Fi or Ethernet network to view its name (e.g.,
Wi-Fi 2,Ethernet 1). -
Alternatively, open NetLimiter; its Network Adapters tab lists all active connections and their assigned system interface names.
Step 3: Set Traffic Limits at 355 Kbps
-
Launch NetLimiter.
-
In the Activity window, locate either your Global / Adapter connection or a specific application (e.g.,
chrome.exe). -
Check the box under the DL Limit (Download Limit) or UL Limit (Upload Limit) column next to the entry.
-
Right-click the limit value and select Edit Rule.
-
Set the speed value to 355 and change the unit dropdown to KB/s or Kbps depending on requirement:
-
Note: 355 Kbps = ~44.37 KB/s.
-
-
Click Save to enable real-time throttling.
Step 4: Windows Troubleshooting
-
Throttling is non-responsive: Ensure the main toggle switch (“Enable Traffic Control”) in the NetLimiter toolbar is switched ON.
-
Driver Conflict: If speeds fluctuate, open Windows Device Manager, expand Network Adapters, update drivers, or temporarily disable conflicting third-party VPN virtual adapters.
Part 3: How to Test Traffic Shaping
To confirm your 355 Kbps cap is actively functioning:
-
Terminal Test (
iperf3/curl): Run a download stream in Linux:Bashcurl -o /dev/null http://speedtest.tele2.net/10MB.zipObserve the transfer rate—it should stabilize near ~44 KB/s (~355 Kbps).
-
Browser Test: Open any web speed test tool and run a check. The resulting graph should peak and flatten out directly at your configured threshold.
Part 4: 10 Alternatives to Fast.com for Speed Testing
While Netflix’s Fast.com provides quick download reads, these 10 platforms offer detailed network diagnostics, latency tracking, and multi-server benchmarking:
-
Speedtest.net by Ookla – Comprehensive network speed test featuring global testing servers, historical log retention, and jitter metrics.
-
Cloudflare Speed Test – Designed for gamers and real-time app testing; measures packet loss, jitter, and latency distributions.
-
TestMy.net – Server-side HTML5 testing platform that doesn’t rely on third-party browser extensions.
-
M-Lab (Measurement Lab) – Open-source speed test used directly inside Google search results.
-
Opensignal – Mobile-first platform evaluating carrier coverage, Wi-Fi performance, and streaming quality.
-
SpeedOf.Me – Lightweight HTML5 speed test that works seamlessly on desktop and mobile browsers.
-
Xfinity Speed Test – Simple broadband speed test utility built by Comcast.
-
Google Fiber Speedtest – Minimalist speed test measuring gigabit capability without heavy ads.
-
nPerf – Speed test suite offering bitrate, video streaming stability, and web browsing assessments.
-
DSLReports Speed Test – Advanced diagnostic utility that reports bufferbloat levels across multiple connection types.
Part 5: Key Network & Latency Terms Explained
Understanding traffic shaping requires clarity on how latency and queueing impact internet performance:
1. Latency (Ping)
Latency is the round-trip time (measured in milliseconds, ms) it takes for a data packet to travel from your device to a remote server and back. Lower numbers mean higher responsiveness.
2. Unloaded Latency
Unloaded Latency represents your network’s baseline response time when no other traffic is active on your connection. It reflects the raw speed of your ISP connection under ideal conditions.
3. Loaded Latency
Loaded Latency measures response times while heavy network transfers (e.g., a large file download or 4K video stream) are occurring simultaneously. If loaded latency jumps significantly higher than unloaded latency, online games will lag and video calls will freeze.
4. Bufferbloat
Bufferbloat occurs when routers queue excessive amounts of data packets in memory buffers instead of transmitting them efficiently. This creates high loaded latency and degrades real-time interactive traffic. Traffic shaping tools (like WonderShaper) eliminate bufferbloat by throttling saturation levels.
5. Jitter
Jitter measures the variability or fluctuation in network latency over time. Consistent 30ms latency is ideal, whereas latency swinging between 20ms and 250ms indicates high jitter and unstable packet delivery.
6. Bandwidth vs. Throughput
-
Bandwidth: The maximum theoretical capacity of your internet link (e.g., 100 Mbps).
-
Throughput: The actual volume of data successfully transmitted over the connection per second in real-world conditions.
Article Credit: dotifi.com






