PAMPA (Power-Aware Message Propagation Algorithm) is a broadcast algorithm for mobile ad hoc networks (MANETS). Like broadcast algorithms described in [Tseng:02], [Haas:02] or [Huang:06], PAMPA tries to save resources of participants in MANETs by reducing the number of nodes that are required to retransmit a message so that it gets delivered to every node. The novelty of PAMPA is that the selection of the nodes that retransmit is based on the signal strength of the delivery while most of the remaining peek some nodes at random.
PAMPA was first presented in [Miranda:06]. A more complete survey on broadcast algorithms, a full description of PAMPA and extensive simulation results can be found in [Miranda:07].
A prototype of PAMPA was developed for the ns-2 network simulator. The same code can also be used for testing other algorithms (see below the list of current algorithms). Here we describe the instructions for including PAMPA in ns-2. This procedure was experimented with a ns-2 allinone distribution v. 2.32. Previously I've followed the same exact set of procedures for setting it up on ns-2 v. 2.28. The instructions assume that you have some basic knowledge of C++, TCL and of the ns-2 so that you are able to determine the most adequate location of the patches. If necessary, send me an e-mail and I'll try to give some support.
PT_PAMPA
to the enum
packet_t
after the line with:
// insert new packet types here
name_[PT_PAMPA]="pampa";
to the
p_info()
constructorPAMPA
to the long list that follows
foreach prot {
OBJ_CC
void format_pampa(Packet *p,int
offset);
to the declaration of class
CMUTrace : public Trace
#include <pampa/hdr_pampa.h>
to the list of included files
void CMUTrace::format_pampa(Packet* pkt,int offset) {
hdr_pampa *pampahdr=hdr_pampa::access(pkt);
sprintf(pt_->buffer() + offset,"-P pampa -Ps %d -Pi %d -Ps %d -Pt %g -Ph %d", pampahdr->source_,pampahdr->uid_,pampahdr->size_, pampahdr->timesent_,pampahdr->nHops_);
}
Ideally, it should be possible to use the code for:
For now, the code is only ready for testing broadcast algorithms. I plan to extend it to address 2. in the near future. I'll raise the priority of this task on demand.
Use test.tcl as an example. It is based on the tcl files used in the ns-2 distribution. In brief, the differences are:
Agent/PampaAgent
and
attaches it to port 3323. If you want to change the port
number, change also the constant PAMPA_PORT
in
pampaagent.h and recompile.The PAMPA agent accepts the following commands:
As is, test.tcl reads the policy and its arguments from the
command line (-optpampa <policy> -optargs
"<args>"
). Note that arguments are passed as
one unique argument so you must enclose them between ""
either in the command line or in the test.tcl code. An
example of a full command line for starting a simulation is:
ns test.tcl -traf traffile -mov movfile -optpampa
policy-delpwr -optargs "3e6 2"
. Arguments
-traf
and -mov
accept two filenames
with TCL code. The goal is to import "traffic" (e.g. as
produced by traffgen
) and "movement" (e.g. produced
by setdest
or BonnMotion)
files but they can be used for any other purposes or even be empty
files if there is nothing to set.
The source code of PAMPA for tinyOS is available here. It is released with GPL License 3.0. You may want to check the README file first.
This page is maintained by Hugo Miranda, University of Lisbon. E-mail:
Last updated Jan 18, 2012.