Hi, I have been looking at the CC2420 stack recently and as far as I can understand the usage of the cc2420_header_t for acks is just to make the implementation easier. Since data packets and acks have the FCF and DSN in the same place the cc2420_header_t can be used to access the fields in both kinds of packets.
The remaining fields of the cc2420_header_t are not set for acks. Reading them will read data that happen to be stored at the memory locations after the valid information in the ack. Buffers for receiving packets are often re-used, so it is likely that the "junk" data is from previously received packets, so it might not be obviously wrong. As you have noted there is no addressing information in acks. If a sender receives an ack with the right DSN while waiting for an ack it is assumed that the ack is from the destination. I hope this helps. // Lars 2014-10-02 16:09 GMT+02:00 Davide Girardi <[email protected]>: > Hi everyone, > > I'm working with telosb motes for a project which requires capturing > and analyzing packet acknowledgements at the sender end. In other > words, if node A sends a packet to node B, and B acknowledges it, I > analyze the ack recevied by node A. > So far so good since adding some code to the event CC2420.Receive in > the CC2420TransmitP module, I can inspect every field of the ack. > What bugs me lately is understanding where the cc2420_header_t of the > ack actually "comes from", since running some tests with the Cooja > simulator and also looking at the official datasheet of the radio chip > (http://inst.eecs.berkeley.edu/~cs150/Documents/CC2420.pdf), it shows > that acks are composed by 5 bytes, the FCF DSN and FCS fields, and > they don't include the cc2420 header. > > The reason why I need to know this, is because I've been facing an > issue while printing out the SRC field of the ack. Basically, if using > a normal printf statement, I print out the SRC field, while it is a > valid node ID, it is not consistent with regards to the nodes involved > in that particular communication (same DSN). Therefore, knowing the > details requested above could give me an idea on if this is due to > Cooja or something else. > I hope you can help me, thanks in advance! > > P.S by acks, I mean software acknowledgements (default settings) > > -- > Davide Girardi > _______________________________________________ > 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
