[1] Testing may target the firewall, IDS, TCP/IP stack, router or any other component of the network.
[1][2][3] Packets may be of any protocol and are designed to test specific rules or situations.
For example, a TCP packet may be created with a set of erroneous flags to ensure that the target machine sends a RESET command or that the firewall blocks any response.
[2] Programs such as Scapy, Ostinato, Netdude allow a user to modify recorded packets' fields, checksums and payloads quite easily.
Tcpreplay is the most common program for this task since it is capable of taking a stored packet stream in the pcap format and sending those packets at the original rate or a user-defined rate.