[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/ctp CtpForwardingEngine.h, 1.5, 1.6 CtpForwardingEngineP.nc, 1.15, 1.16 CtpRoutingEngineP.nc, 1.15, 1.16
Phil Levis
scipio at users.sourceforge.net
Fri Aug 15 14:57:33 PDT 2008
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/ctp
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30385
Modified Files:
CtpForwardingEngine.h CtpForwardingEngineP.nc
CtpRoutingEngineP.nc
Log Message:
Make timing the optimal values.
Include commented out code for trickle reset in routing engine.
Index: CtpForwardingEngine.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/ctp/CtpForwardingEngine.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CtpForwardingEngine.h 15 Aug 2008 16:48:14 -0000 1.5
--- CtpForwardingEngine.h 15 Aug 2008 21:57:31 -0000 1.6
***************
*** 59,64 ****
enum {
! #if PLATFORM_MICAZ || PLATFORM_TELOSA || PLATFORM_TELOSB || PLATFORM_TMOTE || PLATFORM_INTELMOTE2
! FORWARD_PACKET_TIME = 4,
#else
FORWARD_PACKET_TIME = 32,
--- 59,64 ----
enum {
! #if PLATFORM_MICAZ || PLATFORM_TELOSA || PLATFORM_TELOSB || PLATFORM_TMOTE || PLATFORM_INTELMOTE2 || PLATFORM_SHIMMER || PLATFORM_IRIS
! FORWARD_PACKET_TIME = 7,
#else
FORWARD_PACKET_TIME = 32,
***************
*** 67,80 ****
enum {
! SENDDONE_FAIL_OFFSET = 512,
! SENDDONE_NOACK_OFFSET = FORWARD_PACKET_TIME << 2,
! SENDDONE_OK_OFFSET = FORWARD_PACKET_TIME << 2,
! LOOPY_OFFSET = FORWARD_PACKET_TIME << 4,
! SENDDONE_FAIL_WINDOW = SENDDONE_FAIL_OFFSET - 1,
! LOOPY_WINDOW = LOOPY_OFFSET - 1,
! SENDDONE_NOACK_WINDOW = SENDDONE_NOACK_OFFSET - 1,
! SENDDONE_OK_WINDOW = SENDDONE_OK_OFFSET - 1,
CONGESTED_WAIT_OFFSET = FORWARD_PACKET_TIME << 2,
! CONGESTED_WAIT_WINDOW = CONGESTED_WAIT_OFFSET - 1,
NO_ROUTE_RETRY = 10000
};
--- 67,80 ----
enum {
! SENDDONE_OK_OFFSET = FORWARD_PACKET_TIME,
! SENDDONE_OK_WINDOW = FORWARD_PACKET_TIME,
! SENDDONE_NOACK_OFFSET = FORWARD_PACKET_TIME,
! SENDDONE_NOACK_WINDOW = FORWARD_PACKET_TIME,
! SENDDONE_FAIL_OFFSET = FORWARD_PACKET_TIME << 2,
! SENDDONE_FAIL_WINDOW = SENDDONE_FAIL_OFFSET,
! LOOPY_OFFSET = FORWARD_PACKET_TIME << 2,
! LOOPY_WINDOW = LOOPY_OFFSET,
CONGESTED_WAIT_OFFSET = FORWARD_PACKET_TIME << 2,
! CONGESTED_WAIT_WINDOW = CONGESTED_WAIT_OFFSET,
NO_ROUTE_RETRY = 10000
};
Index: CtpForwardingEngineP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/ctp/CtpForwardingEngineP.nc,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** CtpForwardingEngineP.nc 15 Aug 2008 16:48:14 -0000 1.15
--- CtpForwardingEngineP.nc 15 Aug 2008 21:57:31 -0000 1.16
***************
*** 275,281 ****
}
! static void startRetxmitTimer(uint16_t mask, uint16_t offset) {
uint16_t r = call Random.rand16();
! r &= mask;
r += offset;
call RetxmitTimer.startOneShot(r);
--- 275,281 ----
}
! static void startRetxmitTimer(uint16_t window, uint16_t offset) {
uint16_t r = call Random.rand16();
! r %= window;
r += offset;
call RetxmitTimer.startOneShot(r);
Index: CtpRoutingEngineP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** CtpRoutingEngineP.nc 4 Jun 2008 04:30:41 -0000 1.15
--- CtpRoutingEngineP.nc 15 Aug 2008 21:57:31 -0000 1.16
***************
*** 298,303 ****
linkEtx = evaluateEtx(call LinkEstimator.getLinkQuality(entry->neighbor));
dbg("TreeRouting",
! "routingTable[%d]: neighbor: [id: %d parent: %d etx: %d]\n",
! i, entry->neighbor, entry->info.parent, linkEtx);
pathEtx = linkEtx + entry->info.etx;
/* Operations specific to the current parent */
--- 298,303 ----
linkEtx = evaluateEtx(call LinkEstimator.getLinkQuality(entry->neighbor));
dbg("TreeRouting",
! "routingTable[%d]: neighbor: [id: %d parent: %d etx: %d retx: %d]\n",
! i, entry->neighbor, entry->info.parent, linkEtx, entry->info.etx);
pathEtx = linkEtx + entry->info.etx;
/* Operations specific to the current parent */
***************
*** 322,325 ****
--- 322,326 ----
if (pathEtx < minEtx) {
+ dbg("TreeRouting", " best is %d, setting to %d\n", pathEtx, entry->neighbor);
minEtx = pathEtx;
best = entry;
***************
*** 355,363 ****
call LinkEstimator.pinNeighbor(best->neighbor);
call LinkEstimator.clearDLQ(best->neighbor);
! atomic {
routeInfo.parent = best->neighbor;
routeInfo.etx = best->info.etx;
routeInfo.congested = best->info.congested;
}
}
}
--- 356,370 ----
call LinkEstimator.pinNeighbor(best->neighbor);
call LinkEstimator.clearDLQ(best->neighbor);
!
! atomic {
routeInfo.parent = best->neighbor;
routeInfo.etx = best->info.etx;
routeInfo.congested = best->info.congested;
}
+ /* If we follow the CTP paper this should be in here.
+ if (currentEtx - minEtx > 20) {
+ call CtpInfo.triggerRouteUpdate();
+ }
+ */
}
}
More information about the Tinyos-2-commits
mailing list