Hi All,
Although I discovered that I was working in a wrong directory 'le' instead
of '4bitle', the unsatisfied statements claim still hold.
minPkt = BLQ_PKT_WINDOW;
for (i = 0; i < NEIGHBOR_TABLE_SIZE; i++)
{
ne = &NeighborTable[i];
if (ne->ll_addr == n)
{
if (ne->flags & VALID_ENTRY)
{
ne->flags |= MATURE_ENTRY;
totalPkt = ne->rcvcnt + ne->failcnt;
if (totalPkt < minPkt)
//STATEMENT 1
totalPkt = minPkt;
if (totalPkt == 0)
//STATEMENT 2
ne->inquality = (ALPHA * ne->inquality) / 10;
else
{
newEst = (250UL * ne->rcvcnt) / totalPkt;
ne->inquality = (ALPHA * ne->inquality +
(10-ALPHA) * newEst)/10;
}
ne->rcvcnt = 0;
ne->failcnt = 0;
updateETX(ne, computeETX(ne->inquality));
}
else
dbg("LI", " - entry %i is invalid.\n", (int)i);
}
}
2010/3/6 Islam Hegazy <[email protected]>
Hi
I was tracing the code of 4bit link estimator in LinkEstimatorP.nc when I
came to the following 2 statements which can'tbe satisfied.
In the function updateNeighborEntryIdx the following if statement calls the
function updateNeighborTableEst
if (NeighborTable[idx].rcvcnt >= BLQ_PKT_WINDOW)
{
updateNeighborTableEst(NeighborTable[idx].ll_addr);
}
Inside the updateNeighborTableEst function we have the statements
minPkt = BLQ_PKT_WINDOW;
totalPkt = ne->rcvcnt + ne->failcnt;
then we have the condition
if (totalPkt < minPkt)
{
totalPkt = minPkt; //statement 1
}
which will never be satisfied because, at least, rcvcnt = BLQ_PKT_WINDOW
(from the if in updateNeighborEntryIdx) . So, always total >= BLQ_PKT_WINDOW
'minPkt'
The second statement is right after statement 1 in updateNeighborTableEst
if (totalPkt == 0)
{
ne->inquality = (ALPHA * ne->inquality) / 10; //statement 2
}
This statement is never satisfied because statement 1 always set totalPkt >
0. Another main reason for not satisfying this statment, updateNeighborTableEst
will never be called if rcvcnt < BLQ_PKT_WINDOW which means totalPkt > 0
(remember totalPkt = ne->rcvcnt + ne->failcnt).
I searched the code for other calls to updateNeighborTableEst but I didn't
find any. I'd appreciate it if someone can highlight the importance of these 2
statements.
Regards
Islam Hegazy
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help