[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/le LinkEstimatorP.nc, 1.1.2.3, 1.1.2.4

Omprakash Gnawali gnawali at users.sourceforge.net
Sun Oct 15 19:28:24 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/le
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17625

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	LinkEstimatorP.nc 
Log Message:
no self originating beacons, return large eetx value (60) when number of successful pkt = 0 in an estimation window

Index: LinkEstimatorP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/le/Attic/LinkEstimatorP.nc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** LinkEstimatorP.nc	7 Oct 2006 03:13:18 -0000	1.1.2.3
--- LinkEstimatorP.nc	16 Oct 2006 02:28:22 -0000	1.1.2.4
***************
*** 72,80 ****
      INFINITY = 0xff,
      // update the link estimate this often
!     TABLEUPDATE_INTERVAL = 6,
      // send a beacon this often unless user of
      // this component is sending a beacon atleast
      // at this rate
!     BEACON_INTERVAL = 2,
      // decay the link estimate using this alpha
      // we use a denominator of 10, so this corresponds to 0.2
--- 72,80 ----
      INFINITY = 0xff,
      // update the link estimate this often
!     TABLEUPDATE_INTERVAL = 48,
      // send a beacon this often unless user of
      // this component is sending a beacon atleast
      // at this rate
!     BEACON_INTERVAL = 16,
      // decay the link estimate using this alpha
      // we use a denominator of 10, so this corresponds to 0.2
***************
*** 82,86 ****
      // number of packets to wait before computing a new
      // DLQ (Data-driven Link Quality)
!     DLQ_PKT_WINDOW = 5
    };
  
--- 82,93 ----
      // number of packets to wait before computing a new
      // DLQ (Data-driven Link Quality)
!     DLQ_PKT_WINDOW = 5,
!     // number of beacons to wait before computing a new
!     // BLQ (Beacon-driven Link Quality)
!     BLQ_PKT_WINDOW = 3,
!     // largest EETX value that we feed into the link quality EWMA
!     // a value of 60 corresponds to having to make six transmissions
!     // to successfully receive one acknowledgement
!     LARGE_EETX_VALUE = 60
    };
  
***************
*** 294,298 ****
    // update data driven EETX
    void updateDEETX(neighbor_table_entry_t *ne) {
!     uint16_t estETX= (10 * ne->data_total) / ne->data_success - 10;
      updateEETX(ne, estETX);
      ne->data_success = 0;
--- 301,313 ----
    // update data driven EETX
    void updateDEETX(neighbor_table_entry_t *ne) {
!     uint16_t estETX;
! 
!     if (ne->data_success == 0) {
!       // if there were no successful packet transmission in the
!       // last window, assign a large eetx estimate
!       estETX = LARGE_EETX_VALUE;
!     } else {
!       estETX = (10 * ne->data_total) / ne->data_success - 10;
!     }
      updateEETX(ne, estETX);
      ne->data_success = 0;
***************
*** 326,334 ****
        q = (10*q) / q2 - 10;
        if (q > 255) {
! 	q = INFINITY;
        }
        return (uint8_t)q;
      } else {
!       return INFINITY;
      }
    }
--- 341,349 ----
        q = (10*q) / q2 - 10;
        if (q > 255) {
! 	q = LARGE_EETX_VALUE;
        }
        return (uint8_t)q;
      } else {
!       return LARGE_EETX_VALUE;
      }
    }
***************
*** 342,346 ****
      uint8_t minPkt;
  
!     minPkt = TABLEUPDATE_INTERVAL / BEACON_INTERVAL;
      dbg("LI", "%s\n", __FUNCTION__);
      for (i = 0; i < NEIGHBOR_TABLE_SIZE; i++) {
--- 357,362 ----
      uint8_t minPkt;
  
!     //    minPkt = TABLEUPDATE_INTERVAL / BEACON_INTERVAL;
!     minPkt = BLQ_PKT_WINDOW;
      dbg("LI", "%s\n", __FUNCTION__);
      for (i = 0; i < NEIGHBOR_TABLE_SIZE; i++) {
***************
*** 417,421 ****
    command error_t StdControl.start() {
      dbg("LI", "Link estimator start\n");
!     call Timer.startPeriodic(LINKEST_TIMER_RATE);
      return SUCCESS;
    }
--- 433,437 ----
    command error_t StdControl.start() {
      dbg("LI", "Link estimator start\n");
!     //    call Timer.startPeriodic(LINKEST_TIMER_RATE);
      return SUCCESS;
    }
***************
*** 667,670 ****
--- 683,693 ----
      print_packet(msg, len);
  
+     // update the beacon-driven link quality estimators if we have
+     // received BLQ_PKT_WINDOW number of beacons
+     curEstInterval = (curEstInterval + 1) % BLQ_PKT_WINDOW;
+     if (curEstInterval == 0) {
+       updateNeighborTableEst();
+     }
+ 
      if (call SubAMPacket.destination(msg) == AM_BROADCAST_ADDR) {
        linkest_header_t* hdr = getHeader(msg);



More information about the Tinyos-2-commits mailing list