Wireshark mailing list archives

Question about UDP checksum


From: "news.gmane.com" <AndreasSander1 () gmx net>
Date: Fri, 5 Aug 2011 15:45:38 +0200

Hello,

I try to implement a UDP checksum routine. Unfortunately it calculates a 
completely different value than Wireshark does. I don't known what I am 
doing wrong. Can you help me?

The calculation is done using a UDP pseudo header with the structure

struct pseudo
{
    uint32 source;
    uint32 destination;
    uint8 zero;
    uint8 protocol;
    uint16 udp_length;
};

When I have a UDP frame with IP source = "192.168.100.132" and IP 
destination = "192.168.144.255", and UDP Length = 66 (IP Total_Length = 86) 
I get this data in the pseudo header:

 c0 a8 64 84
 c0 a8 90 ff
 00 11 00 42

The sum is 0x32874 which is must be folded to 0x2874+0x0003 = 0x8277. The 
complement is 0xd788.

But Wireshark detects an error and says the checksum must be 0x5528. Can 
anybody give me a hint what's wrong?

-- 
Andy



___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: