On Sat, 2005-12-10 at 11:37 +0800, Shili Xiang wrote:
> Hi Philip,
> Thank you very much!
> With your suggestion, I furthered tried the lossy model to output a
> loss topology of a 10 by 10 grid, with 50 foot spacing, and change the
> loss rate to be 0.0, and write it to the file "10_10_50_lossless.nss".
> I hope to achieve the effect that every node has at most 4 neighbors
> (all neighors are of no communication error) so that the interference
> in the network will be less and hence has the property of scalability.
> The .nss file is of the form:
> 0 0 0.0 0.0 0.0
> 0 1 0.0 0.0 0.0
> 0 10 0.0 0.0 0.0
> 1 0 0.0 0.0 0.0
> 1 1 0.0 0.0 0.0
> 1 2 0.0 0.0 0.0
> 1 11 0.0 0.0 0.0
> ...
> However, when i run TinyDB with 30 nodes with "./build/pc/main.exe -
> r=lossy -pf=10_10_50_lossless.nss 30", the parents of all nodes are
> 0xffff (broadcast address), so they assume the network topology hasn't
> been initialized? After around 2 minutes, it seems that a topology has
> been set up and parent of node are of a less than 30 value. However,
> the parent-child relationship doesn't agree with the topology file i
> put in. For example, node 24's parent is 20, while node 23's parent is
> 9, and node 28's parent is 0.
>
> I am wondering why the topology file doesn't take effect. To confirm
> that the topology file has actually been read, i tried to give an
> illegal filename under "pf=" and error messages come out. Hence, i
> assume that the topology file has been read...
>
> Why the toplogy file doesn't take effect? How should i simulate a
> network in which only the nodes within 50 feet of each other can
> communicate without affecting other nodes out of range to
> receive packets and drop packets? Any help is greatly appreciated!
>
Hrm. I don't know what the issue is. Many people have been able to
successfully use beta/TOSSIM-packet. One possiblity (and a common source
of this kind of bug in simulation) is that you're not correctly
observing buffer swaps. The way the implementation works, this can cause
some nodes to receive packets that they shouldn't. But normally it
doesn't appear in this way.
My one suggestion is to look in beta/TOSSIM-packet/packet_sim.c, and
instrument it in this way. In connectivity_init:
void connectivity_init(char* cFile) {
int mote_one, mote_two;
double packet, positive, negative;
FILE* f = fopen(cFile, "r");
if (f == NULL) {
fprintf(stderr, "SIM: Could not load packet configuration file %s
\n", cFile);
return;
}
while (read_packet_entry(f, &mote_one, &mote_two, &packet, &positive,
&negative)) {
link_t* new_link;
new_link = allocate_link(mote_two);
new_link->data = packet;
new_link->neg = negative;
new_link->pos = positive;
new_link->next_link = packet_connectivity[mote_one];
packet_connectivity[mote_one] = new_link;
}
}
add comment in the while loop that outputs the links being created.
Something like:
dbg(DBG_TEMP, "Creating link from %i to %i with paramters %llf %llf %
llif\n", mote_one, mote_two, packet, negative, positive);
Then include "packet" and "temp" as DBG modes. The former should tell
you when TOSSIM is delivering packets, and the latter will tell you what
it thinks the topology is.
Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help