Hi, I am a student at Catania University. I would like to implement in TinyOS 2 a mechanism of random routing. I thought to change the behavior of the application TestNetwork, through the modification of the file CtpRoutingEngineP, relatively to task void updateRouteTask () but when I execute the application TestNetwork, I realized that the RoutingTable does not contain exact values. Infact through this code: ……. task void updateRouteTask() { uint8_t i; routing_table_entry* entry; routing_table_entry* best; uint16_t minEtx; uint16_t currentEtx; uint16_t linkEtx, pathEtx; if (state_is_root) return; best = NULL; /* Minimum etx found among neighbors, initially infinity */ minEtx = MAX_METRIC; /* Metric through current parent, initially infinity */ currentEtx = MAX_METRIC;
//dbg("TreeRouting","%s\n",__FUNCTION__); for (i = 0; i < 10; i++) { entry = &routingTable[i]; dbg("TreeRouting", "routingTable[%d]: neighbor: [id: %d parent: %d]\n",i, entry->neighbor, entry->info.parent); } …….. I noted that all elements of the routingTable are equal to 0. This is the output $ python test.py >>output.txt …. Booting 0 at time 66239565822 Booting 1 at time 65903208580 Booting 2 at time 74918631651 Booting 3 at time 62765650646 Starting simulation. DEBUG (3): clientPtrs[0] = 0x84e9d8 DEBUG (3): TestNetworkC: Timer fired. DEBUG (3): CtpForwardingEngineP$0$Send$send: sending packet from client 0: 69255e, len 15 DEBUG (3): CtpForwardingEngineP$0$Send$send: queue entry for 0 is 0 deep DEBUG (3): QueueC$0$Queue$enqueue: size is 0 DEBUG (3): head <-[d8e98400] <- tail DEBUG (3): TestNetworkC$sendMessage: Transmission succeeded. DEBUG (3): CtpForwardingEngineP$0$sendTask$runTask: Trying to send a packet. Queue size is 1. DEBUG (3): CtpForwardingEngineP$0$sendTask$runTask: no route, don't send, start retry timer DEBUG (3): QueueC$2$Queue$enqueue: size is 0 DEBUG (3): head <-[4cb07300] <- tail DEBUG (3): QueueC$2$Queue$dequeue: size is 1 DEBUG (3): head <-<- tail DEBUG (1): clientPtrs[0] = 0x84e9c8 DEBUG (0): clientPtrs[0] = 0x84e9c0 DEBUG (0): CtpRoutingEngineP$0$RootControl$setRoot I'm a root now! DEBUG (0): QueueC$2$Queue$enqueue: size is 0 DEBUG (0): head <-[60ab7300] <- tail DEBUG (0): CtpForwardingEngineP$0$sendTask$runTask: Trying to send a packet. Queue size is 0. DEBUG (0): CtpForwardingEngineP$0$sendTask$runTask: queue empty, don't send DEBUG (0): QueueC$2$Queue$enqueue: size is 1 DEBUG (0): head <-[60ab7300] [8aab7300] <- tail DEBUG (0): QueueC$2$Queue$dequeue: size is 2 DEBUG (0): head <-[8aab7300] <- tail DEBUG (0): QueueC$2$Queue$dequeue: size is 1 DEBUG (0): head <-<- tail DEBUG (0): TestNetworkC: Timer fired. DEBUG (0): CtpForwardingEngineP$0$Send$send: sending packet from client 0: 6924e0, len 15 DEBUG (0): CtpForwardingEngineP$0$Send$send: queue entry for 0 is 0 deep DEBUG (0): QueueC$0$Queue$enqueue: size is 0 DEBUG (0): head <-[c0e98400] <- tail DEBUG (0): TestNetworkC$sendMessage: Transmission succeeded. DEBUG (0): CtpForwardingEngineP$0$sendTask$runTask: Trying to send a packet. Queue size is 1. DEBUG (0): Sending queue entry 0x84e9c0 DEBUG (0): CtpForwardingEngineP$0$sendTask$runTask: I'm a root, so loopback and signal receive. DEBUG (0): Received packet at 0:0:6.664972237 from node 0. DEBUG (0): QueueC$1$Queue$enqueue: size is 0 DEBUG (0): head <- [50077300] <- tail DEBUG (0): CtpForwardingEngineP$0$SubSend$sendDone to 0 and 0 DEBUG (0): CtpForwardingEngineP$0$SubSend$sendDone: our packet for client 0, remove 0x84e9c0 from queue DEBUG (0): QueueC$2$Queue$enqueue: size is 0 DEBUG (0): head <-[b4ab7300] <- tail DEBUG (0): QueueC$0$Queue$dequeue: size is 1 DEBUG (0): head <-<- tail DEBUG (0): Send completed. DEBUG (0): Rexmit timer will fire in 24 ms DEBUG (0): Sending packet to UART. DEBUG (0): QueueC$1$Queue$dequeue: size is 1 DEBUG (0): head <-<- tail DEBUG (0): Sending packet to UART. DEBUG (0): QueueC$2$Queue$enqueue: size is 1 DEBUG (0): head <- [b4ab7300] [deab7300] <- tail DEBUG (0): QueueC$2$Queue$dequeue: size is 2 DEBUG (0): head <-[deab7300] <- tail DEBUG (0): QueueC$2$Queue$dequeue: size is 1 DEBUG (0): head <-<- tail DEBUG (0): Sono prima di if DEBUG (0): CtpRoutingEngineP$0$sendBeaconTask$runTask parent: 0 etx: 0 DEBUG (0): QueueC$2$Queue$enqueue: size is 0 DEBUG (0): head <-[08ac7300] <- tail DEBUG (0): AM: Sending packet (id=24, len=7) to 65535 DEBUG (0): QueueC$2$Queue$dequeue: size is 1 DEBUG (0): head <-<- tail DEBUG (1): TestNetworkC: Timer fired. DEBUG (1): CtpForwardingEngineP$0$Send$send: sending packet from client 0: 69250a, len 15 DEBUG (1): CtpForwardingEngineP$0$Send$send: queue entry for 0 is 0 deep DEBUG (1): QueueC$0$Queue$enqueue: size is 0 DEBUG (1): head <-[c8e98400] <- tail DEBUG (1): TestNetworkC$sendMessage: Transmission succeeded. DEBUG (1): CtpForwardingEngineP$0$sendTask$runTask: Trying to send a packet. Queue size is 1. DEBUG (1): CtpForwardingEngineP$0$sendTask$runTask: no route, don't send, start retry timer DEBUG (1): QueueC$2$Queue$enqueue: size is 0 DEBUG (1): head <-[04ad7300] <- tail DEBUG (1): QueueC$2$Queue$dequeue: size is 1 DEBUG (1): head <-<- tail DEBUG (0): CtpForwardingEngineP$0$sendTask$runTask: Trying to send a packet. Queue size is 0. DEBUG (0): CtpForwardingEngineP$0$sendTask$runTask: queue empty, don't send DEBUG (0): QueueC$2$Queue$enqueue: size is 0 DEBUG (0): head <-[32ac7300] <- tail DEBUG (0): QueueC$2$Queue$dequeue: size is 1 DEBUG (0): head <-<- tail DEBUG (3): Sono prima di if DEBUG (3): Sono dopo di if DEBUG (3): routingTable[0]: neighbor: [id: 0 parent: 0] DEBUG (3): routingTable[1]: neighbor: [id: 0 parent: 0] DEBUG (3): routingTable[2]: neighbor: [id: 0 parent: 0] DEBUG (3): routingTable [3]: neighbor: [id: 0 parent: 0] DEBUG (3): routingTable[4]: neighbor: [id: 0 parent: 0] DEBUG (3): routingTable[5]: neighbor: [id: 0 parent: 0] DEBUG (3): routingTable[6]: neighbor: [id: 0 parent: 0] DEBUG (3): routingTable[7]: neighbor: [id: 0 parent: 0] DEBUG (3): routingTable [8]: neighbor: [id: 0 parent: 0] DEBUG (3): routingTable[9]: neighbor: [id: 0 parent: 0] DEBUG (3): Sono dopo il for inventato DEBUG (3): CtpRoutingEngineP$0$sendBeaconTask$runTask parent: 65535 etx: 0 DEBUG (3): QueueC$2$Queue$enqueue: size is 0 DEBUG (3): head <-[76b07300] <- tail DEBUG (3): AM: Sending packet (id=24, len=7) to 65535 DEBUG (3): QueueC$2$Queue$dequeue: size is 1 DEBUG (3): head <-<- tail ……………. Why? _______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help