You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Netem中不指定标准差定义高斯分布?

Netem Normal Distribution Delay: Clarifying Correlation vs. Standard Deviation

Hey there, great question—Netem’s delay distribution parameters can be tricky to parse, especially if docs seem to mix up terms like correlation and standard deviation. Let’s unpack this properly.

First, let’s start with the command you’re using:

sudo tc qdisc change dev eth2 root netem delay 100ms 20ms distribution normal

Let’s set the record straight on standard Netem behavior first, since there might be a misinterpretation in the docs you’re referencing:

  • The first value (100ms) is the central mean of the normal distribution—this part you already have down.
  • The second value (20ms) is actually the standard deviation of the distribution. That means ~68% of your delay samples will land within 100ms ± 20ms, ~95% within 100ms ± 40ms, and so on—following the classic rules of a normal distribution.
  • Correlation is an optional third parameter (e.g., delay 100ms 20ms 30% distribution normal). This controls how closely consecutive delay values are linked: a 30% correlation means each new delay value has a 30% tendency to stay close to the previous one, rather than being a completely independent sample from the distribution.

Now, addressing the scenario you mentioned where your docs claim the ±20ms represents correlation instead of standard deviation:
This is almost certainly a misstatement or misinterpretation of the parameters. Netem doesn’t use the second delay parameter for correlation—correlation is always the optional third value. If we hypothetically go with the docs’ claim, there’s no standard way Netem would define the standard deviation in that case, which doesn’t align with how the tool is built.

To confirm which is which, you can:

  • Run tc qdisc show dev eth2 after applying your command—this will print the exact parameters Netem is using, labeling the mean, jitter (which maps to standard deviation for the normal distribution), and correlation if set.
  • Test with a tool like ping eth2 (or a more precise measurement tool like mtr) to collect delay samples, then calculate the standard deviation manually—you’ll see it’s very close to the 20ms value you set.

内容的提问来源于stack exchange,提问作者ElenaPhys

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 04:06:41