public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: hlabishi kobo <hlabishik@gmail.com>
Subject: Re: [B.A.T.M.A.N.] BATMAN routing
Date: Thu, 24 Feb 2011 11:23:41 +0100	[thread overview]
Message-ID: <201102241123.43797.sven@narfation.org> (raw)
In-Reply-To: <AANLkTi=7es_PbdB+-_+pGZ7B1n2Ke8xFUXRA7vFdP_O-@mail.gmail.com>

[-- 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 --]

  reply	other threads:[~2011-02-24 10:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.14.1290812292.944.b.a.t.m.a.n@lists.open-mesh.org>
     [not found] ` <AANLkTimR7VU95r3C-=C9rn5ftZahKkNTu3-cU-Vft+VZ@mail.gmail.com>
2010-11-28 22:01   ` [B.A.T.M.A.N.] Fwd: BATMAN routing hlabishi kobo
2010-11-29 20:13     ` Linus Lüssing
2010-11-29 22:23       ` Linus Lüssing
2010-11-29 22:31     ` [B.A.T.M.A.N.] " hlabishi kobo
2010-11-30 17:26       ` Marek Lindner
2010-12-01  9:46       ` hlabishi kobo
2010-12-01 12:30         ` Marek Lindner
2010-12-02 10:27           ` Linus Lüssing
2010-12-02 12:02             ` Antonio Quartulli
2010-12-06 10:40               ` Daniele Furlan
2010-12-06 16:20                 ` Marek Lindner
2010-12-06 17:06                   ` Daniele Furlan
2010-12-07 10:09               ` Linus Lüssing
2010-12-11  9:51         ` hlabishi kobo
2010-12-20  9:05           ` Linus Lüssing
2011-02-24  9:58             ` hlabishi kobo
2011-02-24 10:23               ` Sven Eckelmann [this message]
2011-02-28 10:46                 ` hlabishi kobo
2011-02-28 12:03                   ` Sven Eckelmann
     [not found]                     ` <AANLkTinja_Hq4ze-fOFbHRK-iDzzA3Tk0oAsJ+CB=M2S@mail.gmail.com>
2011-02-28 19:29                       ` Sven Eckelmann
     [not found]                         ` <AANLkTikj8oj26P_F1LTiGWnt2R=29VESfpD1ZsfeL4X0@mail.gmail.com>
2011-03-08  9:52                           ` Sven Eckelmann
2011-03-17 22:40                             ` hlabishi kobo
2011-03-18 11:18                               ` Sven Eckelmann
2011-03-21 22:40                                 ` hlabishi kobo
2011-03-21 23:01                                   ` Sven Eckelmann
2011-04-03 21:10                                     ` hlabishi kobo
2011-04-03 21:25                                       ` Sven Eckelmann
2011-04-19 10:21                                         ` hlabishi kobo
2010-11-29 22:31     ` [B.A.T.M.A.N.] Fwd: " Chris Lang
2010-11-28 21:28 [B.A.T.M.A.N.] " hlabishi kobo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201102241123.43797.sven@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=hlabishik@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox