I wanted to change software acknowledgement code in CC2420ReceiveP.nc . Current the way software acknowledgments work is that CC2420ReceiveP reads the SACK header (I think 7 bytes) and using the destination address field generates a software ACK command to the CC2420 chip. Since by this time the packet is already in the CC2420 buffer the radio goes ahead and generates an ACK to the sender. CC2420ReceiveP meanwhile continues to read the remainder of the packet.
I wanted to change above behavior of the software acknowledgement code. I wanted to send a software ACK after the whole packet is read in. The way I achieved this, is that disabled the S_RX_FCF state and made in the S_RX_LENGTH state made the code read rxFrameLength bytes worth of data from CC2420 and made it jump to S_RX_PAYLOAD state. In this state once the buffer has cleared the fcf check I added the SACK code as follows: ------------------------------- if ( type == IEEE154_TYPE_DATA ) { if(call CC2420Config.isAutoAckEnabled() && !call CC2420Config.isHwAutoAckDefault()) { if (((( header->fcf >> IEEE154_FCF_ACK_REQ ) & 0x01) == 1) && (header->dest == call CC2420Config.getShortAddr() ) && ((( header->fcf >> IEEE154_FCF_FRAME_TYPE ) & 7) == IEEE154_TYPE_DATA)) { // CSn flippage cuts off our FIFO; SACK and begin reading again //call CSN.set(); call CSN.clr(); call SACK.strobe(); call CSN.set(); call CSN.clr(); call CSN.set(); } ------------------------------------------------------------------ After making the above changes the code does work but there is a serious degradation in throughput. On logging the output I started seeing periodically the retransmission count on some packets was as high as 40-128 retransmission, which is way to high. With the original code with the same topology I did not see a retransmission count higher than 3 to 4 retransmissions. My conclusion was either my above modifications were incorrect, or there is a mismatch between the ACK_WAIT_DELAY parameter in CC2420.h and my current modifications. Earlier the ACK_WAIT_DELAY in CC2420.h was set to 256 jiffies, since now I am reading the entire packet (~ 40 bytes) I changed this value to 1024 jiffies. With 256 jiffies as well as 1024 jiffies the retransmission count with the modified code was still pretty high. I therefore was looking for some suggestions to understand the mistake I am making. Thanks and regards, Avinash -- Phd Dept. of Electrical Engineering University of Southern California http://www-scf.usc.edu/~asridhar _______________________________________________ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help