Hello all.

I'm using TOSSIM under TinyOS 2.1.1 and I would like to ask you all two
questions:

### First

I noticed that inside TossimActiveMessageC.nc in command AMSend.send we can
find this piece of code:

"err = call Model.send((int)addr, amsg, len + sizeof(tossim_header_t));"

But the documentation on this function (command error_t send(int node,
message_t* msg, uint8_t len)) says that this command sends a packet with a
data payload of length "len".
Therefore, I found it a little awkward that we're adding the size of the
header since the command only requests the length of the DATA PAYLOAD.

I proceed to the next call on the next component (TossimPacketModelC).
Within this component, it will be created an event to fulfill our request of
sending a message and that event will be inserted on a queue. Later, the
event will eventually be popped from that queue and the operation of sending
the message will take place, calling the "send_transmit(sim_event_t* evt)"
function. Inside that function we can find the following line:

"duration = 8 * (sendingLength + sim_packet_header_length());" being
sendingLength the len parameter previously defined inside AMSend.send.

My question is: why are we adding the length of the header again? This way,
the header's length will be added twice! And why isn't the footer being
added too?

### Second

I would like to keep track of radio's state (receiving, transmitting,
listening and idling). I know that this behavior is defined by MAC (media
access control) protocols, but my question is: does TOSSIM simulate any MAC
protocol? I mean, I know it does CSMA (Carrier Sense Multiple Access) to
avoid collisions, but I was wondering about the radio state. If it really
simulates a MAC protocol at this level, how can I get the radio state on
each moment? Keep in mind that I'm working with TOSSIM.

I would be very appreciated if anyone could help me on this matter.

Kind regards,
Pedro Nunes
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to