Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

5 Answers 5

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

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

You might also consider using a combination of:

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

share|improve this answer

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

Scapy is a powerful interactive packet manipulation program. It is able to forge or decode packets of a wide number of protocols, send them on the wire, capture them, match requests and replies, and much more. It can easily handle most classical tasks like scanning, tracerouting, probing, unit tests, attacks or network discovery (it can replace hping, 85% of nmap, arpspoof, arp-sk, arping, tcpdump, tethereal, p0f, etc.)

And about packet loss and delay:

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

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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