Take the 2-minute tour ×

I remember that in Linux (when doing make menuconfig) somewhere there was an option that said something like this:

Use this only if you want to generate network traffic, or if you want to create faulty network traffic

Unfortunately I can't remember where this was or even remember any tool that allows me to actually create such traffic.

What I'm after is

  • creating erroneous ICMP packets
  • injecting high latency or packet loss

on a network which is otherwise perfectly fine.

The purpose is to test the behavior of some applications that have to work with links that are between EU and US. I'd like to "stress test" the application how much latency it will swallow or how much packet loss it can deal with.

share|improve this question
add comment

5 Answers

up vote 4 down vote accepted

The option you are thinking of is CONFIG_NET_PKTGEN.

share|improve this answer
I whish I could upvote twice, it seems like the option I was looking for, plus the link is great. I didn't know there was some "make menuconfig" explanation on the web. Seem like the linuxfoundation site is worth investigating, I filed it under "yeah another enterprise linux site thingie" originally –  Server Horror Jun 17 '09 at 16:30
Server Horror, I'll upvote for you :-) –  rkthkr Jun 17 '09 at 17:09
add comment

hping lets you generate TCP, UDP, ICMP and RAW-IP protocol packets.

share|improve this answer
True, but not to simulate high latency or packet drop. –  bortzmeyer Jun 18 '09 at 6:16
add comment

You might also consider using a combination of:

Mixing this with the expected levels of traffic generated by your app.

share|improve this answer
add comment

There is also tool called scapy. It can generate almost any type of packet. As author says:


And about packet loss and delay:

  • iptables have --probability option
  • IIRC it can QUEUE packets to insert delay
share|improve this answer
add comment

Linux is not so well equipped than FreeBSD here. But you can try Netem with tc (package iproute).

Load Netem

modprobe sch_netem

Drop half of the packets on device tap0:

tc qdisc add dev  tap0 root netem delay 50ms loss 50% 
share|improve this answer
tc seems like the userspace tool I was looking for. Thanks. –  Server Horror Jun 18 '09 at 8:39
add comment

Your Answer


