tags:

views:

1338

answers:

2

I'm experimenting w/java sockets. I can connect to a socket and send/receive bytes of data w/o a problem. However I am also sniffing the traffic using wireshark and noticing each packet that comes from the java socket is marked by wireshark as "tcp checksum incorrect."

Anyone have any insight?

java version "1.6.0_12" Java(TM) SE Runtime Environment (build 1.6.0_12-b04) Java HotSpot(TM) Client VM (build 11.2-b01, mixed mode, sharing)

Wireshark v1.0.6 w/WinPcap 4.0.2

+8  A: 

I've found that under many cases, using a tool like Wireshark will give you incorrect tcp checksums on local packets.

This is because the OS, sensibly, does not waste effort populating the tcp checksums on packets which are destined for the local host (they couldn't possibly be incorrect, after all).

Also, locally generated packets going out on a real physical interface probably have hardware-generated tcp checksums anyway. This means that sent packets generally look like they have incorrect checksums (on the wire, they'll be correct).

Set up a monitor port on your switch, run Wireshark on a separate box connected to that, and you'll see the true picture.

MarkR
+5  A: 

This is documented in the Wireshark wiki here.

sigjuice