Community discussions

MikroTik App
 
uberdome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Fri Oct 31, 2014 5:50 pm

How to Add Latency for Testing?

Wed Nov 23, 2022 4:10 am

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
 
User avatar
nichky
Forum Guru
Forum Guru
Posts: 1275
Joined: Tue Jun 23, 2015 2:35 pm

Re: How to Add Latency for Testing?

Wed Nov 23, 2022 6:53 am

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
 
sindy
Forum Guru
Forum Guru
Posts: 10205
Joined: Mon Dec 04, 2017 9:19 pm

Re: How to Add Latency for Testing?

Wed Nov 23, 2022 10:42 am

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).
 
User avatar
Buckeye
Forum Veteran
Forum Veteran
Posts: 883
Joined: Tue Sep 11, 2018 2:03 am
Location: Ohio, USA

Re: How to Add Latency for Testing?

Wed Nov 23, 2022 7:42 pm

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
 
User avatar
chechito
Forum Guru
Forum Guru
Posts: 2989
Joined: Sun Aug 24, 2014 3:14 am
Location: Bogota Colombia
Contact:

Re: How to Add Latency for Testing?

Thu Nov 24, 2022 12:03 am

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)
 
uberdome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Fri Oct 31, 2014 5:50 pm

Re: How to Add Latency for Testing?

Fri Nov 25, 2022 7:22 pm

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.

Who is online

Users browsing this forum: aoravent, stevencameron16 and 93 guests