FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6355 Discussions

CRC Compiler - IP Packet checksum

Altera_Forum
Honored Contributor II
1,044 Views

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
Altera_Forum
Honored Contributor II
255 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
Altera_Forum
Honored Contributor II
255 Views

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

 

Thanks once again.
0 Kudos
Reply