Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to implement Jitter? #137

Closed
severindellsperger opened this issue Jun 5, 2020 · 4 comments
Closed

How to implement Jitter? #137

severindellsperger opened this issue Jun 5, 2020 · 4 comments
Assignees

Comments

@severindellsperger
Copy link

severindellsperger commented Jun 5, 2020

Hi @thombashi

For an application, I need to implement a jitter. In the case that the mean delay is enough large we can work with the delay-distro command. For example:
tcset eth0 --overwrite --delay 10ms --delay-distro 2ms
The result comes quite close to the selected delay-distro value which in this case represents the jitter value.
We face a problem if the mean delay is smaller than the jitter-value. In an example like the following the delay-distro approach isn't working successfully:
tcset eth0 --overwrite --delay 1ms --delay-distro 5ms
I understand that the problem is originated because the delay value can't be negative and therefore the delay-distro action can't take place correctly (+/- delay-distro value can't be applied).

Do you have an idea of how to solve the problem?
Especially the problem if the mean_delay is greater than the jitter value is a tough one...

Kind
severindellsperger

@severindellsperger
Copy link
Author

severindellsperger commented Jul 2, 2020

I think the problem could be solved if another parameter is introduced to set the distribution of the latency. The problem is related because the delay distribution is set to normal distribution by default (which is not always the best solution). If I like to set the jitter to an exact value a uniform distribution would make more sense.

@thombashi thombashi self-assigned this Jul 20, 2020
@thombashi
Copy link
Owner

Hi @severindellsperger,

As you pointed out, the current implementation of tcconfig only supports latency that normally distributed.
I will consider adding an option to set delay distribution other than normal for future release.

@thombashi
Copy link
Owner

You can now use --delay-distribution option with tcconfig 0.26.0.
Using --delay-distribution, You can use distributions {normal,pareto,paretonormal}.
However, uniform distribution can not be used, caused by tc. tc command does not accept uniform distribution even though tc-netem man describe that distribution.

https://man7.org/linux/man-pages/man8/tc-netem.8.html

@severindellsperger
Copy link
Author

Awesome! Thanks for your work. I took a look at the implementation of tc and the source code of the Linux kernel. It looks like the network latency is normally distributed per default. However, the normal distribution would be possible if there exists some normally distributed correlation data on the localhost (see here for more information). I wrote my own implementation, which had worked with the normal distribution, and just raised an exception if the needed correlation table was missing. Maybe you can add this feature in a future release (if someone needs it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants