UDP checksum calculation

Posted by Deepak Konidena on Stack Overflow See other posts from Stack Overflow or by Deepak Konidena
Published on 2009-09-26T06:29:51Z Indexed on 2010/04/23 0:13 UTC
Read the original article Hit count: 375

Filed under:
|

Hi,

The UDP header struct defined at /usr/include/netinet/udp.h is as follows

struct udphdr
{
  u_int16_t source;
  u_int16_t dest;
  u_int16_t len;
  u_int16_t check;
};

What value is stored in the check field of the header? How to verify if the checksum is correct? I meant on what data is the checksum computed? (Is it just the udp header or udp header plus the payload that follows it?)

Thanks.

© Stack Overflow or respective owner

Related posts about udp

Related posts about checksum