Subject: [pim] Reg: Query on Hash value calculation for the election of RP for the Group.

From: "Ganga Prabha" <[email-masked]>
Date: Wed, 29 Aug 2007 12:51:33 +0530

Dear All,
       I have following doubts on the formula used for hash value
calculation for the election of RP for the Group.

 Value(G,M,C(i))= (1103515245 * ((1103515245 * (G&M)+12345) XOR C(i)) +
12345) mod 2^31

1) Is 2 ^ 31 used in the calculation represents  2 XOR 31 or 2 power of 31?
      I have this doubt because in RFC 4601 Page 106 First Paragraph
 " For example, the digest of the IPv6 address 3ffe:b00:c18:1::10 would be
computed as 0x3ffe0b00 ^ 0x0c180001 ^ 0x00000000 ^ 0x00000010, where ^
represents the exclusive-or operation."

2) This doubt is regarding the calculation of (G & M) in the above mentioned
the formula.I want to know which one of the below mentioned calculation is
correct.

        For example,
             if  Group Address = ff0e::7
                 Mask Length    =  96 (0x60)

Calculation A:
---------------------
                   G = ff0e0000 XOR 00000000 XOR 00000000 XOR 00000007
                        = 0xff0e0007
                    M  = 0x60

         (G & M )  =  (0xff0e0007 & 0x60)
                       = 0
Calculation B:
---------------------
 As the Mask length is 96 , the  value of
          (G & M )  =  0xff0e0000(   ( We take only the first 96 bits from
the Group Address)

I request you to clarify me on the above mentioned queries as soon as
possible.
-- 
Thanks & Regards,
K.Ganga Prabha
_______________________________________________
pim mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/pim

---

From: Christopher Thomas Brown <[email-masked]>
Date: Wed, 29 Aug 2007 15:09:00 -0700

> 1) Is 2 ^ 31 used in the calculation represents  2 XOR 31 or 2 power of 31?

2 to the 31st power. 0x80000000 in hexidecimal.

> the formula.I want to know which one of the below mentioned calculation is

Hash mask can't be greater than 32 even for IPv6 addresses.

>              if  Group Address = ff0e::7

If it is a v4 compat address then you take only the 32 least significant digits.
If its not then you xor the 4 32-bit values like in A. But, you misunderstand the
hash mask, its mask length and it can't be > 32. So if you had a mask length of
say 30 you would calculate G & M as 0xff0e0007 & 0xfffffffc = 0xff0e0004.

Chris

---

From: Christopher Thomas Brown <[email-masked]>
Date: Wed, 29 Aug 2007 15:26:33 -0700

> Hash mask can't be greater than 32 even for IPv6 addresses.

Sorry, I misspoke. The hash mask can be upto 128 bits.

> >              if  Group Address = ff0e::7

You want to & the group address and mask then calculate the 32-bit digest

So in your example you could calculate G&M as:

(0xff0e0000 and 0xffffffff) xor (0x00000000 and 0xffffffff)
  xor (0x00000000 and 0xffffffff) xor (0x00000007 and 0x00000000)

Which gives
0xff0e0000.

> If it is a v4 compat address then you take only the 32 least significant digits.

If the RP address is a v4 compat you want to use only the 32 least significant digits
for the C(I) part of the hash function. Otherwise you xor the 32-bit components like
above.

Sorry about misspeaking.

Chris

---

From: Su Haiyang <[email-masked]>
Date: Thu, 30 Aug 2007 09:43:37 +0800

Dear All,
  I don't think that hash mask for IPv6 BSR mechanism shouldn't be more than
32,
'cause a 126 hash mask length is recommended at draft-ietf-pim-sm-bsr-10.txt
draft.
Hash Mask Len
     The length (in bits) of the mask to use in the hash function.  For
     IPv4 we recommend a value of 30.  For IPv6 we recommend a value of
     126.  This field SHOULD be the same for all fragments belonging to
     the same Bootstrap message.

Regarding the G & M issue at the RP hash function, I think that we should
first and G with M and then XOR each 32-bits. That make it sense that M is
used to guarantee that consecutive group choose the same RP. 
G = ff0e0000  00000000 00000000  00000007
&
M  = 0xffffffff  ffffffff ffffffff 00000000
   = ff0e0000 XOR 00000000 XOR 00000000 XOR 00000000
   
-----Original Message-----
From: Christopher Thomas Brown [mailto:[email-masked]] 
Sent: Thursday, August 30, 2007 6:27 AM
To: Ganga Prabha
Cc: [email-masked]
Subject: Re: [pim] Reg: Query on Hash value calculation for the election of
RP for the Group.

Which gives
0xff0e0000.

> If it is a v4 compat address then you take only the 32 least significant
digits.

If the RP address is a v4 compat you want to use only the 32 least
significant digits
for the C(I) part of the hash function. Otherwise you xor the 32-bit
components like
above.

Sorry about misspeaking.

Chris