|Main Archive Page > Month Archives > wireshark-dev archives|
You've forgotten to include the UDP payload in your calculation. For the calculation the pseudo header must be in front of UDP header and UDP payload.
-------- Original-Nachricht --------
> Datum: Fri, 5 Aug 2011 15:45:38 +0200
> Von: "news.gmane.com" <AndreasSander1@gmx.net>
> An: firstname.lastname@example.org
> Betreff: [Wireshark-dev] Question about UDP checksum
> 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 =
> 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?
-- NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurÃ¼ck-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone ___________________________________________________________________________ Sent via: Wireshark-dev mailing list <email@example.com> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:firstname.lastname@example.org?subject=unsubscribe