A hardship early-on in the development of Internet Protocol version 6 (IPv6) tools was the lack of IPv6 packets to use for testing. A simple PCAP-based Internet Protocol (IP) translator was built by the DREN IPv6 Pilot to convert a file containing IPv4 packets into a file containing IPv6 packets. There are now many synthetic packet test generators available, both open source and commercial. A list of some free packet generators is available here.

The SPT translator simply converts TCP and UDP packets from an IPv4 packet trace into IPv6 packets where source and destination IPv6 addresses are derived from the original IPv4 addresses. The IPv4 addresses are converted IPv6 addresses as follows:

4000:ipv4-addr::ipv4-addr

TCP and UDP checksums are re-calculated. No attempt is made to convert Internet Control Message Protocol version 4 (ICMPv4) packets into ICMPv6 packets and anything that is not straight TCP or UDP over IPv4 is not converted (it is simply copied over to the output stream). Fragmented IPv4 packets are dropped.

 

SPT uses “libnet” which is available from: https://github.com/libnet/libnet

Usage
spt [-v] v4-input-file v6-output-file

If there is interest in testing or working with this code, please contact ipv6-team [at] dren.mil.