It was quite hard for me to find a good resource on how to calculate the IP header checksum.
The RFC 791 only says:
The checksum algorithm is:
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.