Sometimes, to simulate one corner case, i.e., the TCP
layer splits one application record into multiple packets, I need to use libpcap
to tweak pcap
files. E.g., for following diagram:
I split frame 8
into 3
parts, one will be appended to frame 7
, and the remaining 2
parts will be 2
separated packets.
Generally speaking, only length field in IP
header and Sequence number
field in TCP
header need to be modified. The source code and pcap
file can be referenced here.