Hello guys, I hope someone can help me.

I've implemented some logging to the ibr-dtn source code to know when the priority is assigned and what priority the bundles have in the queue.

After some research I found that:

1.- when you send a file with dtnsend -p 1, you save the priority in the bundle with b.setpriority(p) which assigns the correct bits to the PRIORITY_BIT1 and 2.

2.- this bundle is saved in a priority queue which checks the PRIORITY_BITS and order the bundles according to this. 

(here I have a logger that tells me with which priority the bundle was saved.

3.- after this, the bundle is waiting until the destination node is detected.


The problem I've found happens when I have an intermediate node. All the routers are set with epidemic routing and the R1 can only see R2

R1 -------- R2 --------- R3 (destination)

Now, happens this:

1.- I use dtnsend -p 1 in R1 to send the file to R3.

2.- this bundle is saved in a priority queue which checks the PRIORITY_BITS and order the bundles according to this.

(here I have a logger that tells me that the priority of the saved bundle was 1, perfect)

3.- Now i think that tries to process the epidemic routing

Thu Jan 31 11:48:32 2013 DEBUG.5: processing static routing task ProcessBundleTask: [412948112.1] dtn://node1.dtn/XdkTGFPAfiJdlFB
Thu Jan 31 11:48:32 2013 DEBUG.50: search static route for [412948112.1] dtn://node1.dtn/XdkTGFPAfiJdlFB
Thu Jan 31 11:48:32 2013 DEBUG.5: processing neighbor routing task ProcessBundleTask: [412948112.1] dtn://node1.dtn/XdkTGFPAfiJdlFB
Thu Jan 31 11:48:32 2013 DEBUG.5: processing neighbor routing task SearchNextBundleTask: dtn://node2.dtn
Thu Jan 31 11:48:32 2013 DEBUG.50: processing epidemic task SearchNextBundleTask: dtn://node2.dtn
Thu Jan 31 11:48:32 2013 DEBUG.5: got 0 items to transfer to dtn://node2.dtn
Thu Jan 31 11:48:32 2013 DEBUG.40: search some bundles not known by dtn://node2.dtn
    NOTICE: BundleGeneratedEvent: Bundle generated [412948112.4] dtn://node1.dtn/routing -> dtn://node2.dtn/routing

The problem is that when it generates this new bundle to send it to R2, my priority logger says that the priority of the bundle saved is different from the one that it saved previously, so my questions are:

Why do you need to generate a new bundle to send to the intermediate nodes instead of copying the one that is already stored? Why the priority is lost? I want to implement that the intermediate nodes save the custody bundles keeping the priority of the original bundle, so the QoS can be keeped too. It makes no sense that the priority of a bundle only affects the local queue from where it is sent.

So where in the source code is the class that generates this bundle from the original one to send it as a custory for the R2? 


Thanks in advance!