Kernel/userspace network ping-pong testing module

This module uses simple ping-pong protocol and exchange number of messages with userspace server.

The latter does not require any configuration except address and port to listen at:

 $ ./upp -p 10250 -a 0.0.0.0
Server is now listening at 0.0.0.0:10250

Kernel module has following parameters:

  • kpp_addr – address to connect to as 32bit value, default is loopback: 0x7f000001
  • kpp_port – port to connect to, default is 1025
  • kpp_protocol – protocol to use (userspace supports only tcp though), default is TCP: 6
  • kpp_num – number of messages to exchange, default is 1000
  • kpp_send_fragments – to use or not to use fragmented sending (first 4 bytes are sent, then rest 60 bytes of the packet), default is not to use fragmented sending: 0
  • kpp_send_msg_more – to use or not to use MSG_MORE flag for the first fragment, default not to use: 0
  • kpp_recv_fragments – to use or not to use fragmented receiving (first 4 bytes are received, then rest
    60 bytes of the packet), default is not to use fragmented receiving: 0

Usage example:

# insmod ./kpp.ko kpp_addr=0xa000001 kpp_port=10250 kpp_num=1000
  kpp_send_fragments=1 kpp_recv_fragments=1 kpp_send_msg_more=0
insmod: error inserting './kpp.ko': -1 Operation not permitted
# dmesg | tail -n3
[61590.379241] Initializing kernel network ping-pong testing module.
[61590.379243]       addr: 10.0.0.1, port: 10250, protocol: 6, num: 1000, send_framgents: 1,
  use_msg_more: 0, recv_fragments: 1.
[61630.268499] Client: 10.0.0.1:10250, num: 1000, time: 40.4257398967.

Source can be found in archive. Replace KDIR variable in Makefile to point to your kernel tree.