appneta / tcpreplay

Pcap editing and replay tools for *NIX and Windows - Users please download source from
http://tcpreplay.appneta.com/wiki/installation.html#downloads
1.16k stars 268 forks source link

[Bug] Support TSO "TCP segmentation offload" #730

Closed blackham closed 2 years ago

blackham commented 2 years ago

Describe the bug Failure to send TSO packet. The packet has a IPv4 reported size of 0, but the actual size is 1535.

14:09:04.1652728144 IP 192.168.1.2.51539 > 192.168.1.37.54321: UDP, length 166
14:09:04.1652728144 IP bad-len 0
Warning: Unable to send packet: Error with PF_PACKET send() [25]: Message too long (errno = 90)
Actual: 24 packets (4829 bytes) sent in 0.034070 seconds
Rated: 141737.5 Bps, 1.13 Mbps, 704.43 pps
Flows: 11 flows, 322.86 fps, 25 flow packets, 0 non-flow
Statistics for network device: enp10s0f3u4c4i2
        Successful packets:        24
        Failed packets:            1
        Truncated packets:         0
        Retried packets (ENOBUFS): 0
        Retried packets (EAGAIN):  0

To Reproduce Steps to reproduce the behavior:

  1. Use Wireshark to capture data in a VMware/ESXi environment with TSO support.
  2. Replay that data

Sadly I am not able to share the entire content of the packet, but the hex value of the IPv4 part of the packet is 45 02 00 00 56 18 40 00 80 06 00 00 c0 a8 01 02 c0 a8 01 26

Where

45 02          | Version, Header Length, ECN and stuff
00 00          | Total Length
56 18          | Identification
40 00          | Flags
80             | TTL (128)
06             | protocol TCP
00 00          | checksum (disabled)
ca a8 01 02    | the src adr 192.168.1.2
c0 a8 01 26    | the dst adr 182.168.1.38

Note: The total length says it's 00 00

Expected behavior Not blow up when the TCP header reports it's length as 00 00. Perhaps have tcpreplay fix these types of packets so only good data is on the wire. However, include a flag like -r, --raw (or whatever), that plays the packet as you see it. In my case I want to make sure my application can detect and handle TSO packets if it ever runs into them.

Screenshots image

System (please complete the following information):

Additional context Add any other context about the problem here.

blackham commented 2 years ago

Sorry. It's an MTU issue. It just happened to be on a TSO packet too.