Hey,
I'm fairly new to the IBR-DTN router and was working on creating my own routing protocol for it. I had a couple of questions and Brenton Walker suggested that I post them here.
1. Is there a way to get a block from a received bundle and split it up into several smaller blocks that I can then make into new bundles with new EIDs?
2. How does the bundle filter work? When we pull bundles out of it to transfer, are they removed from the database as well? I'm working on a data dissemination router and if there was a way to prevent that and maybe sequentially or randomly pull different data from the database as well, that would be useful.
That's it for now in terms of questions, but I'm sure I will have more in the future.
Thanks, Carson
Hello Carson.
Am 07.11.2011 16:25, schrieb Carson Dunbar:
I'm fairly new to the IBR-DTN router and was working on creating my own routing protocol for it. I had a couple of questions and Brenton Walker suggested that I post them here.
Brenton was right and welcome here. :-)
- Is there a way to get a block from a received bundle and split it
up into several smaller blocks that I can then make into new bundles with new EIDs?
Each routing module has the ability to load bundle from the storage with getBundle() and create new bundles. To announce the new bundles you should inject it like the local apps do this...
dtn::core::BundleGeneratedEvent::raise(bundle);
- How does the bundle filter work? When we pull bundles out of it
to transfer, are they removed from the database as well? I'm working on a data dissemination router and if there was a way to prevent that and maybe sequentially or randomly pull different data from the database as well, that would be useful.
The bundle filter is just a filter for the database. If you query for some bundles they do not get removed. To get different bundles each time you query, you should use a BundleList to select/reject offered bundles in the shouldAdd() function.
Kind regards, Johannes
Thanks for the quick response, just as a follow up question:
If I do have a bundle, let's say the received.bundle from local, is there a way to split up its payload into smaller payloads and make each new payload its own bundle? My objective is to send in a file and then break it up into smaller payloads then choose among them to send to other nodes.
Thanks, Carson
On Mon, Nov 7, 2011 at 10:47 AM, Johannes Morgenroth < morgenro@ibr.cs.tu-bs.de> wrote:
Hello Carson.
Am 07.11.2011 16:25, schrieb Carson Dunbar:
I'm fairly new to the IBR-DTN router and was working on creating my own routing protocol for it. I had a couple of questions and Brenton Walker suggested that I post them here.
Brenton was right and welcome here. :-)
- Is there a way to get a block from a received bundle and split it
up into several smaller blocks that I can then make into new bundles with new EIDs?
Each routing module has the ability to load bundle from the storage with getBundle() and create new bundles. To announce the new bundles you should inject it like the local apps do this...
dtn::core::BundleGeneratedEvent::raise(bundle);
- How does the bundle filter work? When we pull bundles out of it
to transfer, are they removed from the database as well? I'm working on a data dissemination router and if there was a way to prevent that and maybe sequentially or randomly pull different data from the database as well, that would be useful.
The bundle filter is just a filter for the database. If you query for some bundles they do not get removed. To get different bundles each time you query, you should use a BundleList to select/reject offered bundles in the shouldAdd() function.
Kind regards, Johannes
-- Johannes Morgenroth Institut fuer Betriebssysteme und Rechnerverbund Tel.: +49-531-391-3249 Muehlenpfordtstrasse 23 Fax.: +49-531-391-5936 TU Braunschweig D-38106 Braunschweig
Am 07.11.2011 16:59, schrieb Carson Dunbar:
If I do have a bundle, let's say the received.bundle from local, is there a way to split up its payload into smaller payloads and make each new payload its own bundle? My objective is to send in a file and then break it up into smaller payloads then choose among them to send to other nodes.
If the received.bundle variable is a object of type dtn::data::Bundle (if not you have to load the bundle from the database first) you can access the payload like this:
dtn::data::PayloadBlock &payload = bundle.getBlockdtn::data::PayloadBlock();
To get the data itself you need to allocate and lock the stream associated with it...
// get BLOB reference ibrcommon::BLOB::Reference ref = b.getData();
// lock the stream - while we are between the curlies, the stream is locked. { ibrcommon::BLOB::iostream stream = ref.iostream(); [ ... read from / write to the stream .... ] }
Once you got the stream you can do standard C++ streaming operations on it. In your case I would read the from the stream continuously and generate a bundle for each chunk while reading the stream.
Kind regards, Johannes
Hello, In your previous email you mentioned using getData() to get the BLOB::reference out of a bundle. Right now I am trying to work with bundles that are received.fromlocal (which I assume is the data sent in through the api) but since these come from the data namespace I can't access them the way you do for bundles in the api name space. Maybe I'm just confused on how the name spaces work, but is there a way to get the same information you mentioned from the data namespace bundles? Thanks
Carson Dunbar
On Mon, Nov 7, 2011 at 11:13 AM, Johannes Morgenroth < morgenro@ibr.cs.tu-bs.de> wrote:
Am 07.11.2011 16:59, schrieb Carson Dunbar:
If I do have a bundle, let's say the received.bundle from local, is there a way to split up its payload into smaller payloads and make each new payload its own bundle? My objective is to send in a file and then break it up into smaller payloads then choose among them to send to other nodes.
If the received.bundle variable is a object of type dtn::data::Bundle (if not you have to load the bundle from the database first) you can access the payload like this:
dtn::data::PayloadBlock &payload = bundle.getBlockdtn::data::PayloadBlock();
To get the data itself you need to allocate and lock the stream associated with it...
// get BLOB reference ibrcommon::BLOB::Reference ref = b.getData();
// lock the stream - while we are between the curlies, the stream is locked. { ibrcommon::BLOB::iostream stream = ref.iostream(); [ ... read from / write to the stream .... ] }
Once you got the stream you can do standard C++ streaming operations on it. In your case I would read the from the stream continuously and generate a bundle for each chunk while reading the stream.
Kind regards, Johannes
-- Johannes Morgenroth Institut fuer Betriebssysteme und Rechnerverbund Tel.: +49-531-391-3249 Muehlenpfordtstrasse 23 Fax.: +49-531-391-5936 TU Braunschweig D-38106 Braunschweig
-- !! This message is brought to you via the `ibr-dtn' mailing list. !! Please do not reply to this message to unsubscribe. To unsubscribe or adjust !! your settings, send a mail message to ibr-dtn-request@ibr.cs.tu-bs.de !! or look at https://www.ibr.cs.tu-bs.de/mailman/listinfo/ibr-dtn.
Hi.
First I need more information. Are you trying to implement an application using the API or do you embed code into the daemon? What type of object is your "received.fromlocal"?
Namespaces in C++ are just an convention not a barrier and you can access different namespaces as you like. http://www.cplusplus.com/doc/tutorial/namespaces/
Best regards Johannes
Am 21.11.2011 15:20, schrieb Carson Dunbar:
Hello, In your previous email you mentioned using getData() to get the BLOB::reference out of a bundle. Right now I am trying to work with bundles that are received.fromlocal (which I assume is the data sent in through the api) but since these come from the data namespace I can't access them the way you do for bundles in the api name space. Maybe I'm just confused on how the name spaces work, but is there a way to get the same information you mentioned from the data namespace bundles? Thanks
Carson Dunbar
I am currently trying to embed code into the demon via a new router. When I mentioned received.fromlocal I guess I misspoke. I am currently trying to work with bundles that would be sent using the dtnsend command (We do have direct access to those right?). The bundles are actually received.bundle which are dtn::data::Bundles. What I am wondering is, what is the relation between dtn::data::Bundle, and dtn::api::Bundle.
Thanks Carson
On Mon, Nov 21, 2011 at 9:31 AM, Johannes Morgenroth < morgenro@ibr.cs.tu-bs.de> wrote:
Hi.
First I need more information. Are you trying to implement an application using the API or do you embed code into the daemon? What type of object is your "received.fromlocal"?
Namespaces in C++ are just an convention not a barrier and you can access different namespaces as you like. http://www.cplusplus.com/doc/tutorial/namespaces/
Best regards Johannes
Am 21.11.2011 15:20, schrieb Carson Dunbar:
Hello, In your previous email you mentioned using getData() to get the BLOB::reference out of a bundle. Right now I am trying to work with bundles that are received.fromlocal (which I assume is the data sent in through the api) but since these come from the data namespace I can't access them the way you do for bundles in the api name space. Maybe I'm just confused on how the name spaces work, but is there a way to get the same information you mentioned from the data namespace bundles? Thanks
Carson Dunbar
-- Johannes Morgenroth Institut fuer Betriebssysteme und Rechnerverbund Tel.: +49-531-391-3249 Muehlenpfordtstrasse 23 Fax.: +49-531-391-5936 TU Braunschweig D-38106 Braunschweig
Am 21.11.2011 15:41, schrieb Carson Dunbar:
What I am wondering is, what is the relation between dtn::data::Bundle, and dtn::api::Bundle.
dtn::api::Bundle ist just a wrapper for lightweight handling of dtn::data::Bundle. The daemon itself do not work with instances of dtn::api::Bundle. You will need to work with dtn::data::Bundle objects if you want to add new functionality to the daemon.
Since received.bundle is a object of type dtn::data::Bundle you could do exactly what I have written before to get the payload of the bundle.
dtn::data::PayloadBlock &payload = received.bundle.getBlockdtn::data::PayloadBlock();
To get the data itself you need to allocate and lock the stream associated with it...
// get BLOB reference ibrcommon::BLOB::Reference ref = b.getData();
// lock the stream - while we are between the curlies, the stream is locked. { ibrcommon::BLOB::iostream stream = ref.iostream(); [ ... read from / write to the stream .... ] }
Johannes
hello list,
i dont know if you heard about the nasa mars exploration programm http://mars.jpl.nasa.gov/
I read that DTN was origninally made for a planetary internet http://www.dtnrg.org
NASA Tests First Deep Space Internet (DTN) http://www.youtube.com/watch?v=wYySDpaMuwY
You think they test this on the "mars exploration programm" or are there some infos about it ?
thanks
Marc
-- Les enfants teribbles - research / deployment Marc Manthey- Vogelsangerstrasse 97 50823 Köln - Germany Tel.:0049-221-29891489 Mobil:0049-1577-3329231 web: http://let.de project : http://stattfernsehen.com twitter: http://twitter.com/macbroadcast/ facebook: http://www.facebook.com/opencu
Please think about your responsibility towards our environment: Each printed e-mail causes about 0.3 grams of CO2 per page.
Opinions expressed may not even be mine by the time you read them, and certainly don't reflect those of any other entity (legal or otherwise).
participants (3)
-
"Marc Manthey (macbroadcast )"
-
Carson Dunbar
-
Johannes Morgenroth