Question about implementing a new forwarding algorithm

77 views
Skip to first unread message

Ken

unread,
Jun 29, 2011, 3:04:37 PM6/29/11
to haggle-developer
Hi,

First of all thanks for open sourcing this framework! I am using it
for my MSc project at the University of Bristol in the UK and have the
aim of implementing new forwarding algorithms to Haggle. I presume
Haggle is using the PROPHET algorithm (as suggested by
ForwardedProphet.cpp). I presume I would have to extend
ForwardedAsynchronous. I have several questions that I could not
figure out on my own and would be ever so grateful if anyone could
provide some insight...

My questions are:

1) If I implement other forwarding algorithms for Haggle, what would
be the best way to test/debug it? I guess the basic thing to do to
test that it works is just to run the provided apps or even write a
simple app that uses the Haggle API to test that data is being
forwarded properly.

2) I would like to test the performance of algorithms implemented in
Haggle properly. Is there a simulator for Haggle that I could run?

3) If simulators do not exist, would manually logging metrics on
physical machines (via fprintfs in code for example) be feasible?
Perhaps I could generate a bunch of data and test the performance of
each forwarding algo?

I sincerely give my thanks in advance and please excuse me if this
seems a bit trivial, I'm still trying to understand it!

Best,
Ken

Erik Nordström

unread,
Jun 29, 2011, 3:30:42 PM6/29/11
to haggle-d...@googlegroups.com, ken...@gmail.com
Hi Ken,

Thank you for your interest in Haggle.

You are correct that Haggle uses the Prophet algorithm by default. I
think a good approach when implementing a new algorithm is to view the
Prophet code as an example. You basically need to inherit
ForwarderAsynchronous and then implement (override) the appropriate
functions.

Debugging is, admittedly, a bit tricky. Currently there is no
simulator that supports Haggle. The problem is that Haggle uses fairly
sophisticated SQL queries for its underlying dissemination scheme, and
such querying would be hard to mimic in a simulator. We've made an
initial attempt to integrate Haggle with the OMNet++ simulator, but we
abandoned this work due to other priorities.

In our research lab, we have instead set up a machine that emulates a
Haggle network using virtual machines (we use Xen). Using this
emulator, we can run multiple Haggle instances and configure
topologies and emulate mobility. You could try to set up a similar
environment. Fredrik Bjurefors <fredrik....@it.uu.se> is the one
to talk to if you have questions about this emulator.

Debugging in a real life set up of Haggle nodes could be feasible. I
guess you would need three nodes at minimum to create any interesting
topologies (with potential for actually doing forwarding). Haggle
supports a way to blacklist interfaces which makes it easy to
configure, e.g., a two hop topology without having to physically
separate nodes. The blacklisting can be done using a "config.xml" file
(see resources/ directory for an example).

Although debugging is feasible with a real life setup, performing
evaluations and comparisons of different forwarding algorithms would
be very difficult in such an environment. I think you really need an
emulator (or simulator) for that, where you have full control of the
connectivity and can easily repeat experiments.

Hope this helps,

Erik

> --
> You received this message because you are subscribed to the Google Groups "haggle-developer" group.
> To post to this group, send email to haggle-d...@googlegroups.com.
> To unsubscribe from this group, send email to haggle-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/haggle-developer?hl=en.
>
>

Ken

unread,
Jun 29, 2011, 7:58:18 PM6/29/11
to haggle-developer
Erik,

Thanks for your response. This is great, it has given me insight as to
how I can proceed. I think the emulator with virtualisation is a great
idea for the comparison of metrics, as I would prefer to stay with
Haggle instead of using simulators. I will certainly follow it up with
Fredrik.

For demonstration, I will probably do a physical setup just to show
off the Haggle framework :). For my demo, I'd love to use the app
shown in the video here: http://www.youtube.com/watch?v=lhYbiYWGoas.
It is the app that represents the relation graph for each node -- I
looked but I am guessing it's not included with the code?

Thanks,
Ken

On Jun 29, 8:30 pm, Erik Nordström <erik.nordst...@gmail.com> wrote:
> Hi Ken,
>
> Thank you for your interest in Haggle.
>
> You are correct that Haggle uses the Prophet algorithm by default. I
> think a good approach when implementing a new algorithm is to view the
> Prophet code as an example. You basically need to inherit
> ForwarderAsynchronous and then implement (override) the appropriate
> functions.
>
> Debugging is, admittedly, a bit tricky. Currently there is no
> simulator that supports Haggle. The problem is that Haggle uses fairly
> sophisticated SQL queries for its underlying dissemination scheme, and
> such querying would be hard to mimic in a simulator. We've made an
> initial attempt to integrate Haggle with the OMNet++ simulator, but we
> abandoned this work due to other priorities.
>
> In our research lab, we have instead set up a machine that emulates a
> Haggle network using virtual machines (we use Xen). Using this
> emulator, we can run multiple Haggle instances and configure
> topologies and emulate mobility. You could try to set up a similar
> environment. Fredrik Bjurefors <fredrik.bjuref...@it.uu.se> is the one

Erik Nordström

unread,
Jul 7, 2011, 9:35:34 AM7/7/11
to haggle-d...@googlegroups.com
Hi Ken,

The "app" in the video you are referring to is available in our "demo"
branch of the mercurial repository on Google code. This branch adds a
Manager to Haggle that feeds information to an external monitor
showing the internal states of Haggle nodes.

The monitor runs a siteManager and visualizer which are found under
src/visualization in that branch.

You need to first run the "siteManager" (all Haggle nodes send their
states to this app). You can then start the visualizer using the
run_demo.sh script. Note, however, that these applications assume
certain IP configurations. There are configuration files you can
modify to change these IPs, but you probably have to set your machines
and devices in ad-hoc mode and configure the appropriate addresses
(for example, the default IP of the siteManager machine I think is
192.168.1.102, see
src/visualization/vendetta/configs/haggledemo/monitor). When the
siteManager is running, you should be able to start Haggle devices and
they should connect to the monitor (given that you have installed the
demo branch on the devices and configured appropriate addresses on the
same subnet). You can set the siteManager IP on each device by
installing a config.xml with the setting for the siteManager (see
resources/ for a template).

Sorry, but this demo branch code is not terribly well documented. I'll
see if I can find some time to put instructions up on the Wiki.

Erik

Ken

unread,
Sep 2, 2011, 12:58:31 PM9/2/11
to haggle-developer
Hi Erik,

Thanks for the previous email -- I haven't had time to play with the
visualisation yet but I have another question regarding omnet++. I
know that the omnet++ part is not working at the moment but how much
work do you think is required before I can make it run some
simulations? I am keen to do some simulation for my thesis.

Regards,
Ken
Reply all
Reply to author
Forward
0 new messages