Coder Social home page Coder Social logo

userkernelcommunication's Introduction

UserKernelCommunication

About the code

This repository provides test environment to test various mechanism for communications between userland and kernelland. Mechanisms were choosen regardless of how 'dirty' they are considered to be. (ex : /pipe).

The following test environments are provided:

  • Netlink with pre-allocated buffer of fixed size for reception and no resynchronisation (/netlink_simple)
  • Generic Netlink for pseudo-synchronous I/O (transactions), and asynchronous I/O (/genetlink)
  • A character device module with read/write callback (/rwdev)
  • A character device module with mmap callback (/mmapdev)
  • Relay API with debugfs files (/relay)
  • POSIX pipe IPC (/pipe)

Some mechanism provide two implementations:

  • An implementation for user to kernel communication;
  • An implementation for kernel to user communication.

Each implementation has:

  • a kern directory containing the module to be added to the kernel;
  • a user directory containing a binary to communicate with the module.

How to run the different test yourself ?

In user land, output can be read in stdout. In kernel land, output can be read with 'dmesg'.

netlink_simple:

KernToUser : First launch user/nlreader then load nlkern module.

netlink_synchro:

KernToUser : First launch user/nlreader then load nlkern module.

genetlink:

First, load genlbench module, then genlbench_test. Finally, user/benchclient will run tests.

rwdev:

mmapdev:

relay:

pipe:

Some results

Tests were run on an Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz with 2 core and 2 threads per core. Results are provided in clock cycles/messages. Messages are all 1000 to 1024 bytes long.

User to Kernel :

User Sending Kernel receiving
netlink_simple 15 000 NO DATA
netlink_synchro NOT IMPLEMENTED NOT IMPLEMENTED
rwdev 52 405 182
mmapdev
relay NOT POSSIBLE NOT POSSIBLE
pipe NOT IMPLEMENTED NOT IMPLEMENTED

Kernel to User:

Kernel Sending User receiving
netlink_simple 3 498 3 724
netlink_synchro 1 502 5 601
rwdev NOT IMPLEMENTED NOT IMPLEMENTED
mmapdev NOT IMPLEMENTED NOT IMPLEMENTED
relay 158 6078
pipe 4 620 4 622

userkernelcommunication's People

Contributors

yohanpipereau avatar

Stargazers

 avatar

Watchers

 avatar  avatar

userkernelcommunication's Issues

SOL_NETLINK undefined

commit f9b437d5efce93800b51ad2a437c8b1c9616bf80 on glibc add SOL_NETLINK maccro in sys/socket.h. Only version > 2.24 support this macco

Apply :
#ifndef SOL_NETLINK
#define SOL_NETLINK 270
#endif

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.