Subject: [Hipsec] example checksums

From: [email-masked] (Henderson, Thomas R)
Date: Tue Oct 7 21:40:02 2003

Here are some examples that I came up with based on our checksumming=20
code. These are for HIP I1 packets only-- not for TCP/UDP.
- IPv4 I1=20
- IPv4 I1 using alternate UDP format
- IPv6 I1

I'm happy to share the test program I used to generate these, but
I'm interested in some other people independently verifying these.
I used the same v4 addresses in v6 (works out to same checksums)
but could easily generate other v6 addresses if desired.

src IP addresss:  192.0.2.1 (or ::FFFF:192.0.2.1)
dst IP address:   192.0.2.2 (or ::FFFF:192.0.2.2)
sender's HIT:     4000::1
receiver's HIT:   4000::2=20
IP protocol:	  99 (decimal)
HIP controls:     0
HIP packet:       I1

IPv4 I1 with pseudoheader (first 12 bytes) and corresponding checksum:
	c0000201
	c0000202
	00630028
	3b040110
	000058bf
	40000000
	00000000
	00000000
	00000001
	40000000
	00000000
	00000000
	00000002

IPv4 UDP I1 with pseudoheader (first 12 bytes) and corresponding =
checksum:
	c0000201
	c0000202
	0063002c
	01100110
	002c0cf8
	00000110
	40000000
	00000000
	00000000
	00000001
	40000000
	00000000
	00000000
	00000002

IPv6 I1 with pseudoheader (first 40 bytes) and corresponding checksum:
	00000000
	00000000
	0000ffff
	c0000201
	00000000
	00000000
	0000ffff
	c0000202
	00000028
	00000063
	3b040110
	000058bf
	40000000
	00000000
	00000000
	00000001
	40000000
	00000000
	00000000
	00000002

---

From: [email-masked] (Mika Kousa)
Date: Wed Oct 8 09:02:00 2003

On Tue, 7 Oct 2003, Henderson, Thomas R wrote:

-> Here are some examples that I came up with based on our checksumming
-> code. These are for HIP I1 packets only-- not for TCP/UDP.
-> - IPv4 I1
-> - IPv4 I1 using alternate UDP format
-> - IPv6 I1
-> ...

We (HIPL) can currently calculate the checksum only for IPv6 I1. Using the
same test data our checksumming code gets the same (0x58bf) checksum as
your code.

-- 
  "Real programmers don't comment their code. It was hard to write, it
   should be hard to understand."