I've introduced a 2000ms latency to all network packets using openwrt netem module.

# This is run on the terminal of the OpenWRT router
tc qdisc add dev wlan1 root netem delay 2000ms

I can clearly see the effects of this when pinging devices in the network.

# ping
PING ( 56 data bytes
64 bytes from seq=0 ttl=64 time=2001.956 ms
64 bytes from seq=1 ttl=64 time=2010.677 ms
64 bytes from seq=2 ttl=64 time=2004.216 ms
64 bytes from seq=3 ttl=64 time=2001.451 ms
64 bytes from seq=4 ttl=64 time=2005.981 ms

However if I attempt to notice this delay while exchanging messages via nc, it seems to be ignored.

|    Terminal 1       |   Terminal 2                   |     
|   (  |               |
|  # nc -l 2389       |                                |
|                     | # nc 2389       |
|                     |      Hello                     |
|  # NO 2s DELAY      |                                |
|  # ALMOST INSTANT   |                                |
|    Hello            |                                |

My questions are:

  • If it's just an case of a miss-configured netem module, what would be toe correct one which would apply delays on all IP packets?

Update This seems to be caused by a bug in the netem module. After the router restart and replying the commands I am experiencing the expected delay.

closed as off-topic by Jeff Schaller Oct 6 at 12:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller
If this question can be reworded to fit the rules in the help center, please edit the question.

  • did you introduce the delay both ways? or only one way? Wouldn't be seen with ping since it's always measuring the delay sum of both ways. – A.B Sep 27 at 12:04

ICMP and TCP are different protocols and if your command affects ICMP packets, it would not affect TCP packets.

  • You're right. That didn't make sense to ask. Deleted the question. – TheMeaningfulEngineer Sep 27 at 10:06
  • 1
    The thing is that tc should affect all packets. – dirkt Sep 27 at 12:06

The docummenation of netem is nice here (https://wiki.linuxfoundation.org/networking/netem), on the other hand, did you check that the interfaces are correct, in general the opewwrt creates network devices and you are reffering to wlan to netem and may be the nc process are on a different network associated a different device


It looks like you added the qdisc on and when you ping from 186 you get a 2-second delay because of the response time and not because of the request time.

For your netcat, the Hello flows from 186 -> 164 and that doesn't go through the netem qdisc (because it is input to the interface). But if you notice closer, you should be able to see a 2-second delay when opening the connection.

You should be able to see the delay if you type the other way around.

Regarding the reboot, is there a chance that you did the test the other way around after the reboot? I.e. typed on 164 instead of 186?

Not the answer you're looking for? Browse other questions tagged or ask your own question.