You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sending UDP packets with the -x option, the checksum of the UDP is not adjusted. This causes packet receivers that verify the checksum to fail (e.g. socat). Either the checksum should be recalculated and adjusted or the checksum should be set to zero to indicate there is no checksum. Note that this likely applies to TCP packets as well, but I haven't tested that explicitly.
I have attached a pcap (bad_csum.pcap) file that contains two packets. The first was sent with the command sudo packETHcli -m 2 -n 1 -i eno1 -f src-fwd.pcap -d 0
and the second was sent with the command sudo packETHcli -m 2 -n 1 -i eno1 -f src-fwd.pcap -d 0 -x
The pcap shows that with -x the marker and sequence number are properly set, but the checksum is identical to that of the packet sent without the -x option. I have also attached the packet being sent as src-fwd.pcap.
I'm aware of the this "problem". The cli version was actually built as a very simple tool to easily put packet(s) on the wire. The -x option was added later because it makes packet counting much easier. But it breaks testing in case where the L4 checksum is also checked. To correct this the sender should be able to completely parse the packeth it sends and recalculate checksum if needed. But because there are so many options (vlan, double vlan, ip options, ipv6 option headers etc..) this is not so easy to add. Another option as you said is to put the checksum initial packet to 0x0000 but this will work only for UDP. For TCP you need to have the checksum calculated.
For now I would encourage you to use the GUI version (with the cli as the receiver) which doesn't have this problem because it has complete packet dissector (plus many other options).
But thanks for opening the issue, maybe I will add this in next release.
Yes, once I started thinking about implementing this myself, I realized the dizzying array of different kinds of packets you would have to dissect to properly recalculate checksums. Unfortunately, I cannot use the GUI version as I only have terminal access to the systems in question (and they likely don't even run X). For UDP, I just hand-edited the pcap files to have a zero UDP checksum and that allowed me to continue working. It would be cool if the CLI could recompute the checksums properly, but I'd understand if you just closed this issue (or made it a feature request for a far future). By the way, thanks for this tool. It has helped me immensely.
When sending UDP packets with the -x option, the checksum of the UDP is not adjusted. This causes packet receivers that verify the checksum to fail (e.g. socat). Either the checksum should be recalculated and adjusted or the checksum should be set to zero to indicate there is no checksum. Note that this likely applies to TCP packets as well, but I haven't tested that explicitly.
I have attached a pcap (bad_csum.pcap) file that contains two packets. The first was sent with the command
sudo packETHcli -m 2 -n 1 -i eno1 -f src-fwd.pcap -d 0
and the second was sent with the command
sudo packETHcli -m 2 -n 1 -i eno1 -f src-fwd.pcap -d 0 -x
The pcap shows that with -x the marker and sequence number are properly set, but the checksum is identical to that of the packet sent without the -x option. I have also attached the packet being sent as src-fwd.pcap.
bad_csum.zip
The text was updated successfully, but these errors were encountered: