Hi all,

I am using RPL on a mesh network and my goal is to delay the forwarding of data 
packets in the relay nodes in the network by a desired amount. For that, I went 
to the code IPForwardingEngineP.nc (lib/net/blip) and instead of allowing the 
function "do_send(next_hop_ifindex, next_hop, &pkt)" to be executed immediately 
inside the event "IPForward.recv", I would like it to be called within some 
fixed amount of time. For that I set a timer, and then when the timer fires I 
call this same function but taking the globally defined inputs as:

do_send(next_hop_ifindextmp, next_hoptmp, &pkttmp);

with the inputs globally defined as:

struct ip6_packet pkttmp;
struct in6_addr *next_hoptmp;
uint8_t next_hop_ifindextmp;

Within the event "IPForward.recv", I set the inputs as:

memcpy(&pkttmp.ip6_hdr, iph, sizeof(struct ip6_hdr));
pkttmp.ip6_data = &v;
pkttmp.ip6_inputif = ifindex;
next_hoptmp = next_hop;
next_hop_ifindextmp = next_hop_ifindex;

which is the same way the original inputs are defined inside that same event.

Running this code makes the data packet forwarding be delayed as desired and 
arriving at the destination, but the packet that arrives to the destination is 
not the same as in the original case and is not considered valid.
The BLIP printf output I get in the original case is:

"UDP - IP.recv: len: 28 (28, 28) srcport: 5678 dstport: 5678", and then 
checksum is performed and the packet is sent to the app layer, while for the 
delayed case I get this:

"UDP - IP.recv: len: 28 (28, 28) srcport: 4352 dstport: 57344" and nothing is 
ever passed to the app layer.

So obviously there is something being modified in the packet information 
between the two cases. I believe I am doing some wrong definition of the 
variables but I cant figure out what. Does anyone have some tips on how to 
solve this issue?

Thank you very much!
Jose
___________________________

PhD student

Department of Automatic Control

KTH Royal Institute of Technology

http://people.kth.se/~araujo/

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

Reply via email to