1

I want to use network emulation (netem) on a PREEMPT-RT kernel to emulate latency and jitter down to 0.5 ms +- 10 %.

Thus, I initially thought that I have to adapt the internal kernel clock rate to at least 2000 Hz as this means I can add time-deterministic delays of 0.5 ms.

However, it seems that with lower kernel clock rates, it should work fine too (measured with experiments). After some research, I thought it could be due to a tickless setting or dynamic tick in the kernel config, but basically I am now rather confused how kernel clock rate works and why it is important.

So is the kernel clock rate adaption needed at all and do I have a comprehension problem how the clock rates actually work?

Thanks for your help :)

2
  • As far as I understand, the internal Kernel Clock Rate doesn't directly converge to network latency, but it may help to reduce latency by increasing the internal Kernel Clock Rate. Also, most data transmissions are done in anti-synchron (async) mode, where dedicated hardware or software interrupt routines handle the data transmissions without direct interaction of kernel, meaning the internal Kernel Clock Rate is mostly irrelevant for those use cases. The kernel just gives the start/stop command to the dedicated hardware/software interrupt routines (hardware drivers). Commented Jan 29, 2024 at 12:38
  • Ok thank you. If it is as you said and as I use this Intel network interface (link), I may need to adapt the "InterruptThrottleRate". However, I think it works just fine at the moment. Commented Jan 29, 2024 at 13:01

1 Answer 1

1

So is the kernel clock rate adaption needed at all

Not at all and since a long time ago :

netem has used high res timers for several years and is independent of HZ value.

High resolution timers's granularity does not depend on the linux kernel timer frequency (CONFIG_HZ). They are only limited by the clock source chosen as reference and can reach the ns.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.