Groups | Search | Server Info | Login | Register


Groups > comp.arch.embedded > #32201

Blitzping: A very high-speed, configurable, and portable packet-crafting utility optimized for embedded devices

From Fereydoun Memarzanjany <thraetaona@ieee.org>
Newsgroups comp.lang.c, alt.comp.networking.routers, alt.2600.hackers, comp.os.linux.misc, comp.unix.misc, comp.arch.embedded
Subject Blitzping: A very high-speed, configurable, and portable packet-crafting utility optimized for embedded devices
Date 2024-08-23 11:04 -0600
Organization A noiseless patient Spider
Message-ID <vaaffd$vsfr$1@dont-email.me> (permalink)

Cross-posted to 6 groups.

Show all headers | View raw


https://github.com/Thraetaona/Blitzping

Hello!

I've been working on Blitzping for the past few weeks. Blitzping is an 
open-source (GPLv3.0+) packet-crafting and sending utility designed to 
be much faster, more portable, and more configurable than existing tools 
like nping and hping3.

Developed with embedded devices in mind, Blitzping operates with 
bare-minimum dependencies, requiring only POSIX.1-2001 Berkeley sockets 
(without any non-standard BSD-, GNU-, SysV, or XSI-specific extensions); 
this makes it highly portable to low-power MIPS- and ARM-based routers. 
The codebase uses C11 syntax (e.g., anonymous structs and comma lists) 
but without any hard dependency on actual C11 headers; it can compile 
under C99 just fine. Additionally, seeing how standard-nonconformance 
resulted in hping3's source code failing to compile under new compilers 
without requiring manual patches, Blitzping's source code gets compiled 
under "-Wall -Wextra -Werror -pedantic-errors" by default.

Other than giving the user more control over editing all parts 
(including the reserved bits, unlike hping3/nping) of their packets, 
Blitzping also introduces several unique performance optimizations: 
pre-generating and buffering packets, multithreading, using asynchronous 
sockets, and using vectored I/O to minimize system calls. These 
optimizations enable Blitzping to significantly outperform its 
counterparts, achieving up to millions of (40-byte) packets per second 
even on underpowered ARM-based systems.

Shown below are comparisons between Blitzping, hping3, and nping across 
two CPUs running OpenWrt GNU/Linux v23.05.03 (more details in the linked 
repository https://github.com/Thraetaona/Blitzping):

   #      Quad-Core "Rockchip RK3328" CPU @ 1.3 GHz. (ARMv8-A)        #
   +--------------------+--------------+--------------+---------------+
   | ARM (4 x 1.3 GHz)  | nping        | hping3       | Blitzping     |
   +--------------------+ -------------+--------------+---------------+
   | Num. Instances     | 4 (1 thread) | 4 (1 thread) | 1 (4 threads) |
   | Pkts. per Second   | ~65,000      | ~80,000      | ~3,150,000    |
   | Bandwidth (MiB/s)  | ~2.50        | ~3.00        | ~120          |
   +--------------------+--------------+--------------+---------------+

   # Single-Core "Qualcomm Atheros QCA9533" SoC @ 650 MHz. (MIPS32r2) #
   +--------------------+--------------+--------------+---------------+
   | MIPS (1 x 650 MHz) | nping        | hping3       | Blitzping     |
   +--------------------+--------------+--------------+---------------+
   | Num. Instances     | 1 (1 thread) | 1 (1 thread) | 1 (1 thread)  |
   | Pkts. per Second   | ~5,000       | ~10,000      | ~420,000      |
   | Bandwidth (MiB/s)  | ~0.20        | ~0.40        | ~16           |
   +--------------------+--------------+--------------+---------------+

In terms of protocol support, as of the time of writing, the IPv4 
interface is complete and the TCP frontend is almost finished, too. 
Afterward, I will be adding IPv6, UDP, and ICMP support.

(There's also an entry in the FSF directory for Blitzping: 
https://directory.fsf.org/wiki/Blitzping)

Back to comp.arch.embedded | Previous | NextNext in thread | Find similar


Thread

Blitzping: A very high-speed, configurable, and portable packet-crafting utility optimized for embedded devices Fereydoun Memarzanjany <thraetaona@ieee.org> - 2024-08-23 11:04 -0600
  Re: Blitzping: A very high-speed, configurable, and portable packet-crafting utility optimized for embedded devices rek2 hispagatos <rek2@hispagatos.org.invalid> - 2024-08-23 18:00 +0000
  Re: Blitzping: A very high-speed, configurable, and portable packet-crafting utility optimized for embedded devices David Brown <david.brown@hesbynett.no> - 2024-08-27 11:22 +0200
    Re: Blitzping: A very high-speed, configurable, and portable packet-crafting utility optimized for embedded devices Fereydoun Memarzanjany <thraetaona@ieee.org> - 2024-08-29 15:53 -0600

csiph-web