On Friday 08 June 2007 13:21, Pedro Almeida wrote:
> Hello;
>
> I'm trying to look for documentation where I can understand the exact
> contents, byte by byte, of the MPDU. I've looked into the TEPs and the
> source files themselves, butI wasn't completely clear.
>
> I'm using now the TestNetwork demo, where I receive 32 bytes per message,
> of which I know little about, except for the contents of the message_t
> itself:
>
> typedef nx_struct TestNetworkMsg {
> nx_am_addr_t source;
> nx_uint16_t seqno;
> nx_am_addr_t parent;
> nx_uint16_t metric;
> nx_uint16_t data;
> nx_uint8_t hopcount;
> nx_uint16_t sendCount;
> nx_uint16_t sendSuccessCount;
> } TestNetworkMsg;
>
> That are not, by far, 32 bytes.
> So far I understood the MPDU is made of
>
> 2 bytes - Frame Control
> 1 byte - Data Sequence Number
> 4 to 20 bytes - Address Information
> n bytes - Data Payload
> 2 bytes - Frame Check Sequence
>
> which adds 5 bytes of the SHR and 1 byte of the PHR. So what exactly are
> those 32 bytes??? Which ones are the payload (MSDU) and which ones are not
> (and what are they?)?
>
> An example of the 32 bytes is as follows:
>
> 7E 45 00 FF FF 00 00 13 00 EE 00 01 00 00 00 07 80 EE 00 07 00 80 00 00 00
> 00 20 00 00 53 63 7E

The data above looks like an active message (AM) delivered via a serial 
physical layer.  The hint are the 0x7E bytes, which are sync bytes.  If this 
output came from the PC, then you should be able to map it to the 
serial_packet_t in $TOSDIR/lib/serial/Serial.h.  The payload are delivered 
within the frame appropriate for the link on which the data is sent.  Hence, 
one sees the serial headers and not the radio headers.

I haven't played with Collection or the TestNetwork app, so I can't help out 
there.  But I can provide some info on how the CC2420 component populates the 
802.15.4 compatible frame.  You can see the mapping in the cc2420_header_t 
structure in $TOSDIR/chips/cc2420/CC2420.h.  The physical radio frame looks 
like this:

preamble + sfd + cc2420_header_t + app_data + FCS (crc)

In terms of 802.15.4, the second field of cc2420_header_t, fcf, is the first 
field of the MAC header.  The last field of cc2420_header_t, type, is 
actually part of the MAC payload.  The current radio stack has the cc2420 
generate the FCS (crc) automatically.

In terms of addressing, short addresses with the 802.15.4 PAN ID Compression 
is set, so the address info consists of pan_id + dest_addr + source_addr.  
You can see these fields in the cc2420_header_t structure.  The fcf is set in 
CC2420CsmaP.nc's Send.send() implementation, where length, dsn and source are 
also set (destination has already been set in the header by this time).

All the best,
Steve

>
> Help!
>
> Thank you!!!
>
> Pedro
>
>
> !DSPAM:4669af84166828120612385!
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to