Re: [B.A.T.M.A.N.] BATMAN routing

Sven Eckelmann
2011-02-24T10:23:41Z

[-- Attachment #1: Type: Text/Plain, Size: 2726 bytes --]

Disclaimer: I will not comment on the whole subject. All my comments are only
based on following code.

On Thursday 24 February 2011 10:58:02 hlabishi kobo wrote:
> int weighted_bit_packet_count(TYPE_OF_WORD *seq_bits)
> {
> int i, count = 0;
> TYPE_OF_WORD word;
>
> for (i = 0; i < NUM_WORDS; i++) {
> //word = seq_bits[i];
>
> if (seq_bits[i] == 1)
> count += i;
> }
> return count;
>
> }

You only gave us the following code and no other information. I must assume
that other parts of the code weren't modified. The part of the code seems to
be derived from following function:

int bit_packet_count(unsigned long *seq_bits)
{
int i, hamming = 0;

for (i = 0; i < NUM_WORDS; i++)
hamming += hweight_long(seq_bits[i]);

return hamming;
}

It is easy to notice that the original function is aware that many bits inside
a word (unsigned long) are set either to zero or to one. The sum of all bits
inside all words (sum of the hamming weights) is complete set of information
the routing algorithm needs to make any decision.

Your function is also operating on the same data, but only tests if the last
bit in every word is 1. Lets assume that a unsigned long is 64 bit long and we
have 8 of them. That means that we are only allowed to have received every 8th
ogm and that we are currently shifted these bits to the lsb position of each
word. Something tells me that I should not start to calculate the probability
of such an event.

I would suggest that you check your originator and global/local translation
tables.

Best regards,
Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]