Subject: Re: OSPF checksum error between two differents contructors router s

From: "Manral, Vishwas" <[email-masked]>
Date: Fri, 31 May 2002 07:00:58 -0400

Arnaud,

You are right. The Fletchers checksum algorithm never gives a checksum value
of 0.

The router expecting a checksum of 0 is the one thats probably wrong.

Thanks,
Vishwas

-----Original Message-----
From: Arnaud Lemaire [mailto:[email-masked]]
Sent: Friday, May 31, 2002 4:15 PM
To: [email-masked]
Subject: OSPF checksum error between two differents contructors routers

Hi,

i have got a problem with a multi-constructor network :

Here is my question : Two equipments are connected in OSPF, one send LSA
update with a 0xFFFF checksum the second router drop the packet and
said "checksum eror, should be zero".

RFC 2328 says : "a checksum should never be zero".

RFC 905 about Fletcher Checksum says :" one's  complement  arithmetic  in
which  if  any  of  the variables  has the value minus zero (i.e. 255 "or
OxFFFF) it shall be regarded as though it was plus zero (i.e. 0).

Can we conclude wich equipement is wrong : the one which sent the FFFF
checksum or the one which said should be zero ?

What i understand is that sending an FFFF checksum is like sending a 0
cehcksum and it is an wrong value.

Thanx for helping,

---

From: Arnaud Lemaire <[email-masked]>
Date: Fri, 31 May 2002 08:04:51 -0400

Thanks Vishwas,

but i think i made an error:
Fletcher checksum is only used in LS checksum. the problem i got is
concerning OSPF'header checksum. wich use another way of calculation :

Checksum (RFC2328)
            The standard IP 16-bit one's complement checksum of the
            entire OSPF packet, excluding the 64-bit authentication
            field.  This checksum is calculated as part of the
            appropriate authentication procedure; for some OSPF
            authentication types, the checksum calculation is omitted.
            See Section D.4

one told me a one's complement could never be FFFF (maths theory). so an
OSPF checksum could never be FFFF.

Anybody do confirm that ?

regards,

---

From: "Manral, Vishwas" <[email-masked]>
Date: Fri, 31 May 2002 08:47:00 -0400

Arnaud,

The LSUpdate packet uses a 16 bits ones complement checksum, the LSA use the
Fletchers checksum.

I tried and see the algorithm in RFC1071 which gives it as

   in 6
       {
           /* Compute Internet Checksum for "count" bytes
            *         beginning at location "addr".
            */
       register long sum = 0;

        while( count > 1 )  {
           /*  This is the inner loop */
               sum += * (unsigned short) addr++;
               count -= 2;
       }

           /*  Add left-over byte, if any */
       if( count > 0 )
               sum += * (unsigned char *) addr;

           /*  Fold 32-bit sum to 16 bits */
       while (sum>>16)
           sum = (sum & 0xffff) + (sum >> 16);

       checksum = ~sum;
   }

As value of sum cannot be 0(unless the entire contents of the packet is 0)
because every overflow is added back, the value of checksum cannot be
0xffff(complement of (uns16) 0).

Thanks,
Vishwas

-----Original Message-----
From: Arnaud Lemaire [mailto:[email-masked]]
Sent: Friday, May 31, 2002 5:35 PM
To: [email-masked]
Subject: Re: OSPF checksum error between two differents contructors
router s

Thanks Vishwas,

Checksum (RFC2328)

regards,