[Tinyos-help] Questions concerning the TestNetwork app
Pedro Almeida
pedralm at gmail.com
Tue Apr 17 09:11:32 PDT 2007
Thank you, Phillip, for your kind help!
Some things are now clearer (thanks to the more commented code of the
MultihopOscilloscope) , while others still remain confusing.
>
> > - i dont clearly understand the implementation of CTP, even after
> > reading the CTP 123 TEP. i believe it's done some sort of
> > automatically once the "wiring" is done, but i dont clearly "see it".
> >
>
> >CTP has three basic parts: the forwarding engine, the routing engine,
> >and the link estimator. Take a look in lib/net/ctp. The forwarding
> >engine decides when to transmit data packets, the routing engine
> >decides when to send control packets and to whom to send data
> >packets, and the link estimator estimates link qualities.
>
> I understand that, but I don't see its actual implementation in the code.
> The lines of code implying "use CTP for routing data to the root node".
> - the AMSend at the uartEchoTask task is set broadcast (0xffff).
> > Shouldnt it be 0 for the messages to go to the root node? Or is
> > this related to the CTP somehow?
>
> >It's sending it to the serial port.
>
> I'm not yet clear here. I understood that this Receive is for the serial
> port and not for the radio.
But the Receive interface works for both Radio and Serial port (as i've seen
in the BaseStation app)? And the AMSend and Send can both work for radio?
And the Send can be used for both? How to make the distinction?
>
> - and finally, the usage of the Pool throughout the program. I read
> that
>
> command t *get()
> Allocate an element from the pool.
>
> and
>
> command error_t put(t *newVal)
> Deallocate an object, putting it back into the pool.
>
> But I dont understand how it's used in the Receive.receive and
> UARTSend.sendDone. I really dont know how to ask, other than a
> clear explanation of these two procedures (the .receive and
> the .sendDone) and how they use the Pool, like why after sendDone
> the message gets put into the Pool, for example.
>
When you receive a message, you allocate a message from the pool (if
there are any), to pass back to the radio layer. Think of it like this:
msg* receive(msg* recvdMsg) {
msg* emptyBuffer = allocate_buffer_from_pool();
put recvdMsg on the send queue
reutrn emptyBuffer for the radio stack to use for the next packet;
}
>CTP sends the packet at the head of the queue. But it doesn't take it
>off the queue until it succeeds or it gives up. In either case, in
>sendDone it takes it off the queue and returns it to the message pool.
So the message is received by the serial port, and placed in the send queue
to be sent. I understand the queue. What i dont understand is the Pool. When
a message is received from the serial port, another is taken from the pool
to be used by the radio stack. Where is that being used? Why after a message
is sent it gets placed into that queue?
As you can see my doubts are very related to basic concepts of the tiny os
architecture. I hope once I understand this better things become clearer.
Many thanks once more!
Pedro Almeida
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070417/b47c915a/attachment.html
More information about the Tinyos-help
mailing list