A protocol stack that recovers from loss, a jitter buffer, or a checksum check is easier to test when you can apply a known impairment to a file rather than hoping the live path misbehaves. Pcap Workbench Web Community 1.8.10 does that from the Recipes tab with the Impairment tool. The tool description calls it offline network impairment analogous to Linux tc/netem: Drop, Duplicate, Reorder, Delay / Jitter, or Corrupt. It edits a capture; it does not shape live traffic.

The six-packet teaching file below stays under the Community 10-packet write cap for every recipe in this article. The walk-through starts with Drop, then uses the same input for the other four actions. Each action is a one-step recipe; re-open the original input before you run the next one. The Packet editor list has No., Protocol, Length and Initial bytes — there is no Time column — so order changes are visible in the list, and timestamps are checked with tshark.

Try it yourself in the browser Download the input PCAP

What is in the file

impair-input.pcap is an Ethernet capture in the documentation prefix 192.0.2.0/24 (RFC 5737): an ICMP echo, a DNS lookup for testhost.lab.example, a second echo request, and an ARP request. Timestamps start at 0.

No. Time (s) Protocol Length Content
10.000ICMP60Echo request, 192.0.2.10 → 192.0.2.20, seq 1
20.001ICMP60Echo reply, seq 1
30.010DNS80Query 0x1234 A testhost.lab.example
40.011DNS116Response 0x1234, A 192.0.2.30
50.100ICMP60Echo request, seq 2
60.200ARP42who-has 192.0.2.20 says 192.0.2.10

tshark 4.4 reports no expert warnings on this file, and the IP, ICMP and UDP checksums verify as good. The web edition ships no demo captures, so this is the file the article publishes.

Try it yourself: drop two packets

These steps were run on the public Web Community 1.8.10 page at packetbuilder.net/pcap-workbench-web/.

  1. Open the page and wait until the status at the bottom right says Ready. The badge in the top right should read Web Community 1.8.10.
  2. In the Packet editor tab, click Open capture and choose impair-input.pcap. The summary should read 6 of 6 packets shown. The list shows ICMP, ICMP, DNS (80), DNS (116), ICMP and ARP.

Pcap Workbench Packet editor with impair-input.pcap open. The summary reads 6 of 6 packets shown: two ICMP, two DNS, a third ICMP and an ARP.

  1. Open Recipes (the Recipes button in the toolbar, or the PCAP tools tab, which starts on the Recipes subtab). The hint on that page says tools are chained as a recipe and that each step writes an intermediate capture that the next step reads.
  2. In the tool list, select Impairment and click + Add step. Action defaults to Drop, and Drop probability % (Drop only) defaults to 100. The help under that field says “0-100. 100 = drop every eligible packet.” Leave those defaults. Set Packets to Selected packets / ranges and Packet numbers / ranges to 3,5. The other fields stay visible, labelled for the other actions; they are not used for Drop.

Pcap Workbench Impairment recipe step with Action Drop, Drop probability 100, Packets set to Selected packets / ranges, and Packet numbers / ranges 3,5.

  1. Click the blue Run recipe button. Recipes use the capture that is open in the Packet editor; if none is open, the page asks you to open one first.

The Result panel should show exit code 0 and a Download out.pcap link. The stdout is JSON from the Community runner. In this run it reported packets_in 6, packets_processed 6, community_limited false, a step result of action: Drop, dropped: 2, total packets: 4, and packets_out 4.

Pcap Workbench Result panel after Impair Drop of packets 3 and 5. Exit code 0, community_limited false, step result action: Drop, dropped: 2, total packets: 4, and a Download out.pcap link.

Open the downloaded file — or the published copy impair-drop.pcap — in the Packet editor. The summary is 4 of 4 packets shown: the echo request, the echo reply, the DNS response (length 116), and the ARP request. The DNS query and the second echo request are gone, and the remaining packets are renumbered from 1. You can also open this file next to the original input in the Compare tab.

Packet editor on impair-drop.pcap, 4 of 4 packets shown: ICMP, ICMP, DNS length 116, and ARP. The DNS response is selected.

A drop probability below 100 uses the Random seed field (default 0). The help says the same seed and the same input give the same result, and that an empty seed is not reproducible. A side check with probability 50, seed 0 and All relevant packets kept three of the six packets (1, 2 and 5) and produced the same file when run twice. The published recipe uses probability 100, so the seed is unused.

Duplicate, reorder, delay and corrupt

Re-open impair-input.pcap in the Packet editor before each of the following recipes. Remove the previous Impairment step if it is still there, add a new one, change Action, and fill only the fields for that action plus the packet selection.

Duplicate

Set Action to Duplicate, Copies to insert (Duplicate only) to 1, and Delay per copy, ms (Duplicate only) to 10. The help under the delay says “0 = back-to-back duplicate. Nonzero models a TCP retransmission after this delay.” Select packet 1. Run the recipe. The step result in this run was action: Duplicate, duplicated (originals): 1, total packets: 7.

The published copy is impair-duplicate.pcap. The editor list shows two identical ICMP echo requests at the top, then the reply, the DNS exchange, the second request and ARP. The copy is inserted immediately after the original; the file is not re-sorted by time. tshark shows the original at 0.000 s, the copy at 0.010 s, and the echo reply still at 0.001 s — so a later timestamp sits earlier in the file than the reply. A side check with the delay left at 0 puts a second copy at the same 0.000 s timestamp, back to back.

Packet editor on impair-duplicate.pcap, 7 of 7 packets shown. Two ICMP echo requests sit at the top; packet 2, the inserted copy, is selected.

Reorder

Set Action to Reorder and Positions to move forward (Reorder only) to 2. Select packet 1. Run the recipe. The step result was action: Reorder, reordered: 1, total packets: 6.

The published copy is impair-reorder.pcap. In the editor the first row is now the echo reply, then the DNS query, then the original echo request (the packet that was moved), then the DNS response, the second request and ARP. Reorder changes only the file order; it keeps the original timestamps. The moved request is still at 0.000 s, which is earlier than the reply now sitting at the start of the file. tshark’s time relative to the first packet in the file goes negative on that row.

Packet editor on impair-reorder.pcap. The list order is echo reply, DNS query, echo request, DNS response, second request and ARP. Packet 3, the moved echo request, is selected.

Delay / Jitter

Set Action to Delay / Jitter, Delay, ms (Delay/Jitter only) to 50, and leave Jitter +/-, ms (Delay/Jitter only) at 0. Leave Re-sort capture by new timestamp (Delay/Jitter only) checked (the default). Select packet 2 (the echo reply). Run the recipe. The step result was action: Delay / Jitter, retimed: 1, total packets: 6.

The published copy is impair-delay.pcap. Because re-sort is on, the reply moves in the list: it now sits after the DNS exchange, as packet 4. tshark shows its timestamp as 0.051 s (the original 0.001 plus 50 ms). The Packet editor does not show that timestamp; the new position in the list is what you see. A side check with re-sort unchecked kept the original file order and only changed the reply’s timestamp, so the times in the file then go 0.000, 0.051, 0.010, …

Nonzero jitter, per the field help, is uniformly distributed around the delay and uses the Random seed. The published file uses jitter 0, so the seed is unused.

Packet editor on impair-delay.pcap. The list is echo request, two DNS packets, then the delayed echo reply as packet 4, the second request and ARP. Packet 4 is selected and shows icmp.type 0.

Corrupt

Set Action to Corrupt, leave Bits to flip (Corrupt only) at 1 and Random seed at 0, and select packet 1. The help under Bits to flip says “Checksums are NOT recomputed — that’s the point.” Run the recipe. The step result was action: Corrupt, corrupted: 1, total packets: 6.

The published copy is impair-corrupt.pcap. The list order is unchanged. Select packet 1: Packet view ends with -impai2-ping instead of -impair-ping. Seed 0 flipped one bit in the ICMP data (byte 54, r → 2). Protocol view still shows icmp.checksum 0x6186, the same value as the input — the editor does not mark it good or bad. tshark 4.4, with IPv4 checksum checking on, reports the IPv4 header checksum still correct and the ICMP checksum incorrect (should be 0xa186), with an expert warning.

The flipped bit is chosen across the whole Ethernet frame. Other seeds on this same packet landed in the Ethernet header, the IPv4 header, or the ICMP header; seed 0, the default used here, landed in the data. Use the same seed when you want the published file to match.

Packet editor on impair-corrupt.pcap, packet 1 selected. Packet view shows the ASCII -impai2-ping. Protocol view still shows icmp.checksum 0x6186.

Verify with tshark

A compact way to see order and time together, for any of the published outputs:

tshark -r impair-delay.pcap -T fields \
  -e frame.number -e frame.time_relative -e _ws.col.Protocol -e _ws.col.Info

On the delay file that prints the echo reply as packet 4 at 0.051 s. On the corrupt file, checksum checking confirms the stale ICMP checksum:

tshark -r impair-corrupt.pcap -Y 'frame.number==1' -T fields \
  -e ip.checksum.status -e icmp.checksum \
  -o ip.check_checksum:TRUE

Editions and limits

Recipes that write a capture are subject to the Community 10-packet write cap. This teaching file has six packets, and the largest published output (Duplicate) has seven, so every runner in this article reported community_limited: false and processed the whole file. On a larger input, Community sees only the first 10 packets of each writing step. Duplicate can also turn those 10 into more than 10 output frames. Compare, by contrast, is read-only and is not capped that way; see How to Compare Two PCAP Files.

The Drop, Duplicate, Reorder, Delay and Corrupt outputs above were produced with the Community Edition runner and, for Drop, also from the web Recipes tab (byte-identical). This walk-through was verified in the web edition. The same Impairment tool is in the desktop app; that UI was not used here.

Related

Companion articles in this series:

Earlier articles on related workflows: edit a PCAP without breaking checksums (the inverse of Corrupt, which leaves checksums stale on purpose), build a PCAP regression set with PASS/FAIL checks, replay a PCAP to a lab device, anonymize a PCAP before you share it, and strip VLAN tags or decapsulate GTP-U.

Try it yourself in the browser Input PCAP Drop Duplicate Reorder Delay Corrupt Input PCAPNG