Subject: [Isis-wg] LSP checksum generation

From: shuqin <[email-masked]>
Date: Tue, 02 Apr 2002 14:53:38 -0600

Hi,

I have several questions about using the checksum algorithms specified
in ISO-8473, Annex C:
In ISIS, the checksum calculation shall start with LSPID field to the
end of packet.
1. Is it correct to set
n=12 (the position of the first octet of the checksum parameter),
L= pdu_length - 12 (excluding common header, PDU Length field and
Remaining Lifetime field);

2. To calculate X and Y, I use the following formula derived from C.3
     C0 = 0;
     C1 = 0;
     checksum = 0;
     for (i = 0; i < L; i++)
        {
            C0 +=SP[i];
            C1 += C0;
         }
     X = ((L - n) * C0 - C1) % 255;
     Y = ((L - n + 1) * (-C0) + C1) % 255;
     if (X <= 0)
        X += 255;
     if (Y <=0)
        Y += 255;
3.  To calculate checksum,
      checksum = htons( X << 8 + Y);
4. Then I use the algorithm specified in C.4 to check the generated
checksum after I put this checksum value
     into the lsp header, each time checksum fails.

Can anybody tell me what is wrong with the above calculation or
parameter setting? How I can get the result correctly
calculated?

Here is a sample of LSP pkt for checksum calculation starting from field
LSPID, the checksum field is in the 12th,
which is ed52 after calculation.
00 b0 d0 da 92 37 01 00 00 00 00  31 ed 52 03 81 01 cc 84 04 0a 0a 0c 15
02 17 00  0a 80 80 80 00 b0 d0 da
0040  92 37 00 0a 80 80 80 00  00 00 00 00 01 00

Thanks in advance.

- Shuqin
_______________________________________________
Isis-wg mailing list  -  [email-masked]
http://spider.juniper.net/mailman/listinfo/isis-wg