Skip to content
Contents
GuidesOpenWrt

Measure router device capacity with packets per second and connection counts

A router can achieve high throughput with large packets, but may hit CPU limits when handling small packets, frequent new connections, or a large number of NAT…

A router can achieve high throughput with large packets, but may hit CPU limits when handling small packets, frequent new connections, or a large number of NAT states. Measure the service performance by breaking it down into three aspects: packet size, connections per second, and concurrent connections.

Make test traffic pass through the router

Place one high-performance traffic host at each end, isolating a dedicated test network. Fix packet size and incrementally increase transmission rate, recording received PPS, packet loss, p95 latency, and CPU utilization. Specify which layer's packet size is being used; if converting to line rate, also account for Ethernet frame and inter-frame overhead.

Read packet and drop counters on the lab interface. · OpenWrt 25.12.6 x86/64 (QEMU/KVM).
Check the terminal output
Read packet and drop counters on the lab interface. · OpenWrt 25.12.6 x86/64 (QEMU/KVM).
Read packet and drop counters on the lab interface. · OpenWrt 25.12.6 x86/64 (QEMU/KVM). Open the original image

Identify Bottlenecks with Different Packet Sizes and Connection Counts

Fixed devices, rules, and network interfaces, and test with large/small packet flows as well as new connections. Record PPS, throughput, CPU peak usage, and packet loss.

Add different five-tuples, then separately test connection establishment and concurrency. Record whether NAT is used, whether offloading is enabled, packet size, and test interval. Compare service peak performance with overload thresholds, and retain a predicted margin. Additional testing is needed for wireless terminal count, including wireless medium performance and business type.

When small packets arrive early and exceed the upper limit, prioritize PPS (packets per second). For services with high concurrency, evaluate resource availability and status table conditions. Only after these conditions are recorded can hardware performance be meaningfully compared.

Which layer does the 64 B start from in the table?

First, record the frame length field in the log sheet. The Ethernet test according to RFC 2544 uses 64-byte frames. The shortest Ethernet frame without VLAN tagging typically consists of 64 bytes from destination MAC address to FCS. These 64 bytes include the frame header and checksum. When calculating line occupancy time, additional 8 bytes for preamble and frame start delimiter, plus 12 bytes for inter-frame gap, must also be accounted for. Host packet capture often fails to show the FCS, and network interface statistics may use an alternative byte count. If the tool specifies UDP application payload, an additional 64 bytes must be added for UDP, IP, and link-layer overhead.

At 1 Gbit/s in one direction, sending minimum-length Ethernet frames with no extra idle time beyond the standard interframe gap takes the equivalent of 84 bytes of wire time per frame. The theoretical limit is about 1,000,000,000 ÷ (84 × 8) = 1,488,095 frames per second. Before comparing results, check whether the frame size includes the FCS and whether the figure adds transmit and receive counts. This calculation alone cannot tell you how many frames your router dropped.

How to verify throughput, PPS, and connections during the same test round?

What question would you like to ask? Where to obtain digital? How to avoid miscalculating?
How many packets per second can it forward? At the receiver, divide the difference between the packet reception count at the end of the window and the beginning of the window by the number of seconds, while simultaneously recording the packet transmission increment at the sender; the difference between receive and send is then used to detect packet loss. Take the number of successful receptions at the receiving end as the benchmark; do not add ingress and egress when measuring in a single direction.
How much effective data is received by the application? (Received bytes × 8) / seconds TCP retransmissions, protocol header, and acknowledgment packet counts, and application-delivered byte counts respectively recorded
How many states can it maintain? On a gateway with connection tracking enabled, read /proc/sys/net/netfilter/nf_conntrack_count and nf_conntrack_max The former is a transient entry containing entries for other services and states awaiting timeout; the difference between two readings can only yield the net change.
How many connections can be established per second? The number of handshakes or business requests completed within the same window, based on successful connection logs from authorized applications. What does "success" refer to in advance and is fixed for connection lifetime; a long-term TCP session can transmit a large number of packets.

Use existing low-rate traffic to confirm the endpoints, direction and available counters. On Linux, run ip -s link show dev IFNAME, replacing IFNAME with the actual interface name. Read RX/TX packets, errors and drops. Drivers, offload, aggregation and other traffic can affect these counters. Keep both endpoint records and investigate discrepancies before drawing conclusions. Report frame or payload size, NAT and offload settings, stream count, duration and the receiver's results. Mark unmeasured values as unmeasured.

Measure 2.5 GbE throughput with an iperf3 endpoint on each side

OpenWrt Isolation Experiment SSH Output

Read the connection table occupancy and limit simultaneously, then check the packet count per interface in each direction. The two counters have distinct units.

Why does a 64-byte iperf3 UDP test produce a 106-byte capture?

With iperf3, -l 64 sets the UDP block length. It does not request a 64 B Ethernet frame. Put endpoints A and B on different routed subnets. Send UDP traffic at 50 kbit/s for two seconds. Capture on the same interface at B and change only -l. This low-rate probe checks lengths; it does not measure the router’s line rate.

UDP block length at A Ethernet length captured at B Total Length in the IPv4 header UDP payload reported by tcpdump
64 B 106 B 92 B 64 B
256 B 298 B 284 B 256 B

These captures came from two network namespaces on OpenWrt 25.12.6 x86/64, without VLAN tags or IPv4 options. The 64 B payload plus the 8 B UDP header and 20 B IPv4 header gives 92 B. Adding the 14 B Ethernet header gives the captured 106 B. In tcpdump, UDP, length 64 describes the payload. The Length field in the UDP header includes its own 8 B header. This virtual interface does not capture the FCS, preamble or interframe gap, so 106 is not the full physical wire occupancy.

Two captures on the same receiver interface showing Ethernet length, IPv4 length and UDP payload

Capture on the same interface at the receiver

In the recording, client1 and receiver50 are virtual endpoints. The lab helper /tmp/gm50/probe-length starts the capture, a one-shot server and a rate-limited client. On your own Linux endpoints, run the commands on the hosts indicated and substitute addresses, interfaces and ports belonging to your test network. Check iperf3 --version and iperf3 --help first. Use ip route get 198.51.100.2 on A and ip route get 192.0.2.101 on B to verify that both routes use the gateway under test.

# B, terminal 1: capture 4 packets; press Ctrl-C if there is no traffic.
tcpdump -ni end50 -s 0 -c 4 -w udp-64.pcap 'udp and dst port 18551 and greater 60'
# B, terminal 2: accept one test.
iperf3 -s -1 -B 198.51.100.2 -p 18551
# A: run after the receiver starts listening.
iperf3 -c 198.51.100.2 -p 18551 -u -l 64 -b 50K -t 2 -J > udp-64.json
# B: read the three lengths from one captured packet.
tcpdump -nnve -c 1 -r udp-64.pcap

For the second run, change -l 64 to -l 256 and change 64 to 256 in the filenames. Restart the one-shot server and the capture at B first. If jsonfilter is installed, read the client’s recorded block size with jsonfilter -i udp-64.json -e '@.start.test_start.blksize'. If a short control packet appears, check its source, destination and UDP port against the reported block size. The tcpdump greater expression filters on captured link-layer length, not UDP payload length. For unexpectedly large packets, record capture position, fragmentation and GRO/GSO, then compare with the receiver capture. Close temporary listeners and remove temporary access rules when finished.

Measure 2.5 GbE throughput with an iperf3 endpoint on each side

When should you test fixed-size frames and IMIX?

Use a fixed frame size to find the packet rate at which loss starts. Then use a mix to see how the same configuration handles your traffic proportions. Keep the hosts, direction, flow count, NAT and offload settings the same. Record received frames, elapsed time and loss for each run.

In the RFC 6985 example, aaafg means Ethernet frames of 64, 64, 64, 1280 and 1518 bytes, in that order. Short frames account for 3/5 of the count. The mean is 598 bytes. Sending only 598-byte frames removes the burst of consecutive short frames.

Record the size sequence in each direction, run duration, whether sizes include the FCS and VLAN tags, and whether the tool reports payload or wire rate. Give the fixed-size and mixed runs separate rows. If a report only says IMIX, ask for the sequence or proportions before comparing. This is a worked example of the method. RFC 6985

What size should IPv4 and IPv6 packets be for a fair comparison?

Check that both address families cross the router between two wired hosts. To compare forwarding, hold IP length and offered packets per second constant. To compare the cost of the same message, keep payload and message rate constant, with one datagram per message.

UDP ↔ IP IPv4 IPv6
Fixed UDP payload (64 B) IP = 92 B IP = 112 B
Fixed IP length (128 B) 128 − 20 − 8 = 100 B 128 − 40 − 8 = 80 B

Values are bytes. Allow 8 for UDP and 20 or 40 for the base IP header. Assume no options, extension headers or fragmentation. For a frame-size input, convert using the Ethernet accounting above.

Log actual sent and received PPS, loss and per-core load. If only equal messages slow down, check wire capacity first. If equal packets also slow down, check the sender and forwarding path. Separate IPv4 NAT, plain routing and offload modes. Mark unverified hardware use as unknown. Restore settings and retest both families at low rate.

RFC 791 · RFC 8200 · RFC 768

Why can bursts lose packets at the same average PPS?

Both examples send 10,000 packets per second. Each cell counts packets in one millisecond. The second pattern puts ten times the load into its busy millisecond.

ms 1 2 3 4 5 6 7 8 9 10
A 10 10 10 10 10 10 10 10 10 10
B 100 0 0 0 0 0 0 0 0 0

Connect the endpoints directly in an isolated lab. Check that the peak fits the port including frame spacing. Verify timing from timestamps. Mark it unknown if coalescing obscures it. Resolve endpoint drops first.

Insert the router. Keep frame size, direction, flows, queues, offload and duration fixed. Allow late arrivals, then count missing unique sequence numbers. Compare idle and loaded probe latency, listing timeouts separately. Watch interface drop deltas and backlog during the run. Queues can drain before you look and hardware may bypass them.

tc -s qdisc show

If only bursts lose packets, halve both packets per burst and period at the same peak pace. Restore settings, recheck idle latency and fill in the benchmark sheet.

This cannot measure buffer capacity. For a back-to-back benchmark see RFC 9004.

Can one computer download at the advertised 10 Gbps?

Five full-duplex 1 Gbps ports add up to 10 Gbps if the vendor counts both directions across all ports. A computer on one port still gets at most 1 Gbps in one direction, before protocol overhead. That calculation tells you nothing about routed throughput.

Check both negotiated link speeds. Keep the hosts, frame size and direction fixed. Compare switching within one VLAN with routing between subnets. Run NAT separately if you use it. Record receiver throughput and loss without adding ingress to egress. If only routing slows down, check the forwarding path, load per core and offload status.

Reference

Related guides

Explore hardware

Comments