[Olsr-users] Calculating LQ in 0.5.0 (Was: olsrd-0.5.0: LQ

Bernd Petrovitsch (spam-protected)
Fri Aug 24 11:31:12 CEST 2007


On Fri, 2007-08-24 at 09:51 +0600, Alexey Shinkin wrote:
[...] 
> Maybe would be better to post this to developers as well ... but I
> thought  
> 
> Sven-Ola's  “slow-start LinkQualityWinSize” has a nasty side effect ,
> I’m a bit surprised it hasn’t been noticed yet .
> 
> (even by practical guys … ).

If I understand correctly, it has been:
http://lists.olsr.org/pipermail/olsr-users/2007-June/002137.html
I just didn't had the time and mood to investigate it deeper.

> While LQ=(total-lost)/window_size all seems ok .
>
> As we gather enough packets , LQ =
> (total-lost)/super_optimized_stuff   and it starts to be greater than
> 1.0
>  (in good link condition).
>  
> Now guess what happens if you scale such LQ  (yeah, multiply this by
> 255 and cast to unsigned char!)
> and send it to neighbors via LQ HELLO message ;) 
>  
> Right, they’ll got NLQ  slightly more than 0 ! 
>  
> Even funnier, they’ll return that NLQ to you with TC , you’ll see your
> own LQ>1.0 in Links section and ~0 in Topology !
>  
> Simply clipping LQ to 1.0  solves the problem . 

You mean something like the following?
----  snip  ----

--- src/link_set.c	19 Aug 2007 20:37:41 -0000	1.70
+++ src/link_set.c	24 Aug 2007 09:29:41 -0000
@@ -1046,6 +1046,9 @@
     (float)(entry->total_packets - entry->lost_packets) /
     (float)(entry->loss_window_size < (2 * 4) ? entry->loss_window_size: 
     4 * ((entry->loss_window_size / 4 - 1) * entry->total_packets + entry->loss_window_size) / entry->loss_window_size);
+  if (entry->loss_link_quality > 1.0) {
+      entry->loss_link_quality = 1.0;
+  }
     
   // multiply the calculated link quality with the user-specified multiplier
----    snip  ----

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services






More information about the Olsr-users mailing list