Subject: [OSPF] OSPFv2 LS checksum question

From: "Sergio Luis O. B. Correia" <[email-masked]>
Date: Mon, 19 Apr 2010 09:46:36 -0300

Hello all,

I am trying to calculate the LS checksum regarding the following LSA
header [1], but I am not able to get the 0x389d after applying
Fletcher's checksum.

RFC 2328, section 12.1.7 says the LS checksum field is the checksum of
the complete LS header, excepting the LS Age field. For the LS Header
shown in [1], what would I use as input for the checksum algorithm?

I am merely excluding the two first bytes (LS Age field) and using the
LS checksum field as zero in this calculation, like this:

02 01 c0 a8 aa 03 c0 a8 aa 03 80 00 00 02 00 00 00 30

but it's giving me wrong results (not 0x389d). I believe I am doing
something wrong, but I don't know what. Could someone point me the
right way to perform this calculations?

Thanks in advance,
sergio.

--
[1] LSA Header:

LS Age: 1 seconds
Options: 0x02
Link-State Advertisement Type: Router-LSA (0x01)
Link-State ID: 192.168.170.3 (0xc0a8aa03)
Advertising Router: 192.168.170.3 (0xc0a8aa03)
LS Sequence Number: 0x80000002
LS Checksum: 0x389d
Length: 48 (0x30)

And follows the LSA header, as shown in wireshark:

00 01 02 01 c0 a8 aa 03 c0 a8 aa 03 80 00 00 02 38 9d 00 30

---

From: Acee Lindem <[email-masked]>
Date: Mon, 19 Apr 2010 11:47:04 -0400

Hi Sergio,

> shown in [1], what would I use as input for the checksum algorithm?

RFC 2328 doesn't say that - it says "the complete contents of the LSA, excepting the LS age field".  So, if you're only using the LSA header, you're certain to get the wrong result. 

Hope this helps,
Acee 

> _______________________________________________
> OSPF mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/ospf

---

From: "Sergio Luis O. B. Correia" <[email-masked]>
Date: Tue, 20 Apr 2010 18:46:36 -0300

Hello, Acee.

indeed, I had misread the text. Thanks for pointing out!

greetings,
sergio