Latency Simulation

From HoerupWiki
Jump to: navigation, search

I forbindelse med udviklingen af et overvågningssystem til Grundfos havde jeg brug for at kunne undersøge hvordan at klienten opførte sig over en langsom linie med høj latency, selv om jeg sad direkte på firmaets LAN.

Til linux er der mest udbredte værktøj NIST. -> Netem

Man kan også overveje at bruge en FreeBSD og dennes dummynet


Old stuff

Kernel scheduler


I'm shocked no-one has posted this!

It's been in the kernel for while, though I don't know much about using it. I never bothered even looking at it (had no need) until a coworker wanted to use it (on Thursday) to do some testing and asked me about it.

Here's the chunk of Kconfig:

tristate "Delay simulator"
depends on NET_SCHED
Say Y if you want to delay packets by a fixed amount of
time. This is often useful to simulate network delay when
testing applications or protocols.

To compile this driver as a module, choose M here: the module will be called sch_delay.

Please reply to this if you have been able to get this working... the tuning parameters to tc we found give errors (and yes, we built installed the latest iproute2 tarball). Then again, we only spent a few minutes playing with it (he had to leave).


Hvis at man vil simulere begrænset båndbredde på linux, kan man alternativt bruge shaper modulet og det tilhørende user-level program shapecfg

modprobe shaper
shapecfg attach shaper0 eth0
shapecfg speed shaper0 9600 # in baud
ifconfig shaper0 <eth0-address> netmask <eth0-netmask>
# remote automatic route added by above
route del -net <eth0-network> netmask <eth0-netmask> dev shaper0
# add routes to be choked
route add -host <otherhost> dev shaper0
# or if going through a router
route add -net <othernet> gw <router> dev shaper0