Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Honored Contributor I
820 Views

CRC Compiler - IP Packet checksum

Hi  

I am trying to parse IP Ethernet packet in FPGA and planning to use CRC compiler to generate checksum for IP packet header and ethernet packet. 

 

If I use option CRC code as CRC-32 works fine with Ethernet packet checksum - Ethernet packet checksum is 32 bits  

 

I am not able to understand how to calculating 16 bit checksum for IP header. What to use CRC-16-ANSI or CRC-16-CCITT. I tried every option but looks like it is calculating some thing other then expected. 

It would be great if some one can enlighten me with whats the difference between ANSI and CCITT and what options do I need to use for generating checksum for IP header. 

 

Thanks
0 Kudos
2 Replies
Highlighted
Honored Contributor I
31 Views

If your referring to IPv4, the checksum is really a checksum rather than a crc. RFC0791 specifies: 

 

--- Quote Start ---  

The checksum field is the 16 bit one's complement of the one's complement sum of all 16 bit words in the header. For purposes of computing the checksum, the value of the checksum field is zero. 

--- Quote End ---  

0 Kudos
Highlighted
Honored Contributor I
31 Views

Thank you ... this cleared my confusion. I was thinking CRC and checksum are same.  

 

Thanks once again.
0 Kudos