How to Measure and Optimize Linux NIC Bandwidth Using ethtool, dmesg, and iperf3
This guide explains the concepts of network bandwidth, shows how to check physical and virtual NIC speeds on Linux using ethtool, dmesg, and mii‑tool, demonstrates real‑world throughput testing with iperf3, and provides tips for identifying network bottlenecks.
1. Network Bandwidth
1.1 Concept
Network bandwidth is the amount of data that can be transferred per second, analogous to the number of lanes on a highway; more lanes mean higher capacity. It is a key metric for network planning, ISP selection, and performance evaluation.
1.2 Calculation
Bandwidth is measured in bits (b) while speed is measured in bytes (B). Common units are Kb, Mb, Gb for bits and KB, MB, GB for bytes. The basic conversion is 1 byte = 8 bits. Example conversions: 1Kb = 1024b, 1KB = 1024B, and so on. Bandwidth and speed share a factor of 1024, so speed = bandwidth / 8.
2. NIC Bandwidth
NIC bandwidth is the per‑second data rate a network card can receive or transmit, expressed in Mbps.
2.1 Check NIC bandwidth with ethtool
Install the utility, find the interface name (e.g., enp129s0f0), then run the following commands:
sudo apt install ethtool ip a ethtool enp129s0f0The output line Speed: 1000Mb/s shows the NIC bandwidth. To display only the speed, use:
ethtool enp129s0f0 | grep -i speed2.2 Check NIC bandwidth with dmesg
Use the kernel ring buffer to locate the NIC link status: dmesg | grep enp129s0f0 | grep up Typical output: igb: enp129s0f0 NIC Link is Up 1000 Mbps Full Duplex.
2.3 Check NIC bandwidth with mii‑tool
Install net‑tools and run:
sudo apt install net-tools sudo mii-tool -v enp129s0f0The line negotiated 1000baseT-FD indicates a 1 Gbps NIC.
3. Virtual Machine NIC Bandwidth
VM NIC bandwidth is limited by the underlying physical NIC, but virtual adapters such as VMXNET3 can advertise higher speeds (e.g., 10 Gbps) even when the host NIC is only 1 Gbps. The virtual switch handles intra‑host traffic without involving the physical NIC, while traffic leaving the host still respects the physical NIC limits.
4. Measure Real Network Bandwidth with iperf3
Install iperf3 on the server: yum install -y iperf3 Start the server: iperf3 -s Run the client from another host: iperf3 -c SERVER_IP iperf3 reports throughput, latency, jitter and packet loss. Example results show real throughput around 935 Mbits/s for two 1 Gbps NICs in the same rack, about 913 Mbits/s across different racks, and around 867 Mbits/s when a VM (hosted on a 1 Gbps NIC) communicates with a bare‑metal server.
5. Identify Network Bottlenecks
Determine the data path from client NIC through routers, switches, firewalls, and server NIC. The overall throughput is limited by the smallest link in the chain (the “bucket” principle). In a LAN where all devices have 1 Gbps NICs but the ISP link is 100 Mbps, the maximum end‑to‑end speed is 100 Mbps (≈12.5 MB/s).
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
