How to Add Latency for Testing?

I want to add latency for testing purposes. I imagine one of the queue types could be configured to induce latency, but I do not have a solution figured out yet. I’d like to be able to introduce round trip delay adjustable from 5ms to 500ms.

Any suggestions? I don’t actually want speed limited, just the time delay introduced.

Thank you, Chris

i got one to simulate timeout:

/ip firewall filter
add action=drop chain=input nth=2,1 protocol=icmp src-address=x.x.y.y

not sure whether is possible to increase the latency

You need a linux machine for that. The tool to use is netem. To introduce a 500 ms delay for a 1 Gbit/s stream in one direction, you have to store 500 Mbits, i.e. roughly 50 Mbytes, of data in the queue. So on a device with enough RAM, you may be able to achieve this using containers (currently available only on arm, arm64, and x86 CPU architectures in ROS 7).

linux has tc netem available, but I don’t know if MikroTik exposes it (without a container as @sindy mentioned)

Here are some links with documentation.

https://wiki.linuxfoundation.org/networking/netem

Linux Traffic Control WAN Emulation

Using Linux NetEm to emulate a network

Simulating Network Latency, Bandwidth and Packet Loss with a Raspberry Pi

try limiting traffic below the normal speed you achieve with a simple queue using a queue type with a very big size (take in count memory available on the router)

Thank you very much - NetEm provides the exact functionality I was looking for!

It would be nice if it was exposed in RouterOS, but I’ll just setup a separate system for it for now.