gerwinning.blogg.se

Iptables examples
Iptables examples













# tc qdisc change dev eth0 root netem delay 100ms 20ms distribution normal The netem discipline can take a table to specify a non-uniform distribution. It is more common to use a something like a normal distribution to describe the variation in delay. Typically, the delay in a network is not uniform. This isn't true statistical correlation, but an approximation. This causes the added delay to be 100 ± 10 ms with the next random element depending 25% on the last one. # tc qdisc change dev eth0 root netem delay 100ms 10ms 25% Network delay variation isn't purely random, so to emulate that there is a correlation value as well. This causes the added delay to be 100 ± 10 ms. # tc qdisc change dev eth0 root netem delay 100ms 10ms Real wide area networks show variability so it is possible to add random variation. Later examples just change parameters without reloading the qdisc

iptables examples

On 2.6, the value is a configuration parameter from 1000 to 100 Hz. On most 2.4 systems, the system clock runs at 100 Hz which allows delays in increments of 10 ms. The delay is limited by the clock resolution of the kernel (Hz). Now a simple ping test to host on the local network should show an increase of 100 milliseconds. # tc qdisc add dev eth0 root netem delay 100ms This is the simplest example, it just adds a fixed amount of delay to all packets going out of the local Ethernet.

iptables examples

The examples on their homepage already show how you can achieve what you've asked for: Examples Emulating wide area network delays This is actually what Mark's answer refers to, by a different name.

iptables examples

Netem leverages functionality already built into Linux and userspace utilities to simulate networks.















Iptables examples