Differences of Roundtrip time, latency between Xenomai 2 and Xenomai 3

Per Oberg pero at wolfram.com
Fri Aug 16 14:01:52 CEST 2019


----- Den 16 aug 2019, på kl 10:17, xenomai xenomai at xenomai.org skrev:

> Hello,

> I have made a comparison for Roundtrip time between Xenomai 2 / RTnet,
> Xenomai 3 and Debian distribution. I would like to ask you some specific
> questions as I am not sure.

> 1. I have read that Xenomai does work on Linux and the Interrupt Pipeline
> does know which message is for real-time (Xenomai) and which not (Debian).
> As I am copy Xenomai on a SD-Card am I just using real-time messages or is
> it also possible to use non-real-time messages? Does Xenomai need Debian
> distribution or can it work by itself?

You would probably need at least a small Linux distribution.
Xenomai does not now how to talk to all hardware there is, e.g. read write to disk or allocate memory etc. so someone else has to do that. And just to be clear, let's differentiate between a Linux kernel and a GNU/Linux OS. The programs you write needs libraries with common functions,  for example math functions or stdio or similar and these are not part of the Linux kernel. They are most often GNU (or from other sources). 

And also, the Xenomai kernel IS a Linux kernel with some addons to handle interrupts and some of the hardware. 

If you really want to slim down you would need

a) A Xenomai Linux kernel (would boot on its own, but may also need some help with loading firmware blobs for certain hardware)
b) A Xenomai compiled application. I guess if it's statically linked you could actually get away with running that instead of the regular init.

But in most cases you also need

c) A minimal Linux distribution, possibly just something to be able to load drivers, set the time etc. (See for example Yocto/Openembedded that can run busybox)
d) Some Xenomai runtime software like dynamically linked libraries for code you haven't statically linked and some software for controlling Xenomai drivers such as rtcan etc. 


> 2. I have seen some big difference in jitter between Xenomai 2 / RTnet and
> Xenomai 3 without RTnet while testing the latency. Xenomai 3 does have a
> much smaller jitter than Xenomai 2 / RTnet. Can you tell me where exactly
> the difference come from?

> 3. I have also seen that the Roundtrip time for Xenomai 3 is twice the size
> of Xenomai 2 / RTnet. So my question is: I thought that RTnet ist just for
> synchronization and TDMA. Does RTnet also make it "more" real-time than
> Xenomai 3 itself?

Lets see if I can clarify things a bit. Perhaps it will answer some of your questions indirectly. 

First, with regards to networking there are simply put two driver variants to choose from in Xenomai, the regular Kernel driver or the RTNet driver. 

The regular kernel driver is handled by the regular kernel which is allowed to process data when Xenomai thinks its fitting to do so. The RTNet driver is handled directly by Xenomai. The problem with handing over things to the regular kernel is that it might have other things that it thinks it needs to to while in charge of the CPU, so this should give a bit more random behavior. If we decide to wait for an answer/result we may be waiting a long time if the Linux kernel has other things to do so we may miss or deadline. 

Secondly, when programming for Xenomai you may choose a skin of your liking. When using the posix skin you may write posix UDP/TCP code for sending/reading a socket regardless of if its a RTNet driver or a regular driver. Xenomai should use the correct function automatically, but if it doesn't you may use macros or special functions with prefixes (__STD or __COBALT). 

In practice this means that sending a UDP message from Xenomai on a network card that has the RTNet driver loaded is completely handled by the real time part while sending on network card that has the regular Linux driver will need regular Linux kernel to step in.

> Kind regards

> Daniel

Best regards
Per Öberg 



More information about the Xenomai mailing list