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.
Linux is not so well equipped than FreeBSD here. But you can try Netem with tc (package iproute).
Load Netem
Drop half of the packets on device tap0:
The option you are thinking of is
CONFIG_NET_PKTGEN
.hping lets you generate TCP, UDP, ICMP and RAW-IP protocol packets.
There is also tool called scapy. It can generate almost any type of packet. As author says:
And about packet loss and delay:
You might also consider using a combination of:
Mixing this with the expected levels of traffic generated by your app.
You might also consider using PcapPlusPlus. It has a packet creation engine that supports ICMP and a way to send packets to the network. Here is an example code for what you want (sending high-latency erroneous ICMP packets):