You are on page 1of 33

PowerManagementforThroughput

EnhancementinWirelessAdHocNetworks
usingClusters
Abstract

Mobile Adhoc network is an autonomous network of mobile nodes where the mobiles uses
the services of other mobiles for routing and packet transmission.

In this project we introduce the notion of power management within the context of wireless
ad-hoc networks. More specifically , we investigate the effects of using different transmit
powers on the average power consumption and end-to-end network throughput in a wireless
ad-hoc environment. This power management approach would help in reducing the system
power consumption and hence pro-longing the battery life of mobile nodes. Furthermore, it
improves the end-to-end network throughput as compared to other ad-hoc networks in which
all mobile nodes use the same transmit power.
Further the work is extended to cluster based routing where the data is routed through higher
energy nodes called clusters with dynamic cluster management.
The improvement is due to the achievement of a tradeoff between minimizing interference
ranges, reduction in the average number of hops to reach a destination, the probability of
having isolated clusters, and the average number of transmissions (including retransmis-sions
due to collisions). The protocols would first dynamically determine an optimal connectivity
range wherein they adapt their transmit powers so as to only reach a subset of the nodes in the
network. The connectivity range would then be dynamically changed in a distributed manner
so as to achieve the near optimal throughput. Minimal power routing is used to further
enhance performance. Simulation studies are carried out in order to investigate these design
approaches using Omnet++ event driven simulator. It is seen a network with such a power
managed scheme would achieve a better throughput performance and lower transmit power
than a network without such a scheme.

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

Chapter 1:
Preamble
1.1 Statement of the Problem
The fundamental problem with Adhoc network are mainly twofold:
1) No control over the sessions due to decentralized topology
2) No power control technique due to non centralized architecture.
Various techniques are being proposed to solve the problem, mainly by
using Backbone routing, cluster based routing and so on. Various power
control algorithms are also implemented for enhancing the energy
utilization of the network. In this work we combine the power control and
cluster based routing features to derive a new routing and transmission
protocol for manet to improve the performance of the system.
1.2 Objective of the Study
Variousroutingalgorithmshavebeenproposedforwirelessadhocnetworksintheliterature.Those
algorithmsaremainlyfocusedonestablishingroutes,andmaintainingtheseroutesunderfrequentand
unpredictableconnectivitychanges.Theimplicitassumptioninmostoftheearlierworkisthatnodes'
transmittedpowersarefixed.Tothebestofourknowledge,thereisnopriorknownworkthatproposes
theconceptofmobileadhocnodesusingdifferenttransmitpowers.Itisevidentthatthisapproachis
restrictedtoadhocnetworksofrelativelylowmobilitypatterns.Ifthenodesarehighlymobile,thepower
managementalgorithmmightfailtocopewiththefastandsuddenchangesduetofadingandinterference
conditions.

therefore the objective is to investigates the benefits, and possibly the


tradeoffs, of deploying different transmit powers in the wireless ad-hoc
environment. We propose a power management scheme with cluster
based topology control which can be used in conjunction with traditional
table-driven routing protocols, with possibly minor modifications. The
performance measures are taken to be the end-to-end network
throughput and the average power consumption.

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
1.3 Scope of the Study
The work can be used as a benchmark for practical Adhoc networks like
office network which forms clusters of mobile nodes with laptops as
cluster heads or domain controllers. The system can be used to enhance
the lifetime of the nodes by suitable power management. The system
produces better performance in terms of higher packet delivery ratio and
throughput. The load is distributed through cluster heads which are
essentially more energy efficient nodes. The system can also be used for
transmission of multimedia traffic or VBR traffic where more stability is
needed for the topology for data transmission.
1.4 Introduction to Mobile Adhoc Network
[Yourself]

1.5 Limitation of the Study


Even though the system produces better performance than conventional
AODV based techniques, the protocol applies higher load on cluster nodes.
If the cluster nodes are considered to be normal mobiles and not Laptops
or other power enabled nodes, then the system drains the node's energy
thick and fast. Further the power management process introduces higher
latency to the system.

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

Chapter 2

Related Work
[Yourself]

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

Chapter 3
Power Management in MANET
Whenthepowermanagementschemeisimplemented,eachnodetransmitsataminimumpowerlevelsuchthat
onlyafixednumberofneighboringnodescanhearthetransmission.Forexample,anodemighttransmitwitha
powersuchthatonlyitsthreeclosestneighborscanhearitstransmission.
Thus,inFigure1below,nodeAtransmitswithapowerP1suchthatonlyit'sthreenearestneighborsi.e.,nodes
B,CandDcanhearit.Similarly,nodeDwouldtransmitwithadifferentpower,sayP2suchthatonlyit'sthree
nearestneighborsi.e.,nodesA,CandEcanhearit.

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

In order to set up the framework to investigate the effect of transmit powers on the end-to-end
network throughput, we make the following assumptions and introduce some appropriate
notations:

The wireless ad-hoc network consists of n nodes; each node has a unique ID, denoted by
Node ID.

The mobile nodes are assumed to have low mobility patterns, that is, they are typical
pedestrians. This, in turn, implies that the network topology changes slowly and the class of
shortest-path routing algorithms is applicable.
Each mobile node has direct connectivity to its N clos-est neighbors only, where N is to be
adapted dynamically.

Assume connectionless (datagrams) type of traffic, i.e. routing decisions are made on a
packet-by-packet-basis.

The transmit power of any mobile node is upper bounded by a maximum power level denoted
as Pmax
The limited size and weight of the mobile terminal dictate this constraint.

The transmit power of any mobile node is lower bounded by a minimum power level Pmin.
This constraint is essential to avoid partitioning the network into isolated islands.

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
1.1

General

The section describes the procedures for the support of the service-level interworking for the
Short Message Service as defined in [C.S0015] and Instant Messaging service as defined in
[OMASIMPLE].
NOTE:In the procedures in the following subclauses, the I-CSCF, P-CSCF and ASs such as
IM AS are not shown in the figures.
1.2

SMS-GW IMS 3rd Party Registration call flow

This call flow shall be according to the procedures described in [X.S0048].


1.3
Interaction between transport-level and service-level interworking with interworking
in the originating side
1.3.1

General

The interaction between transport-level interworking (between SMS over CS and SMS over
IMS) and service-level interworking (between Instant Messaging and SMS) depends on the
user subscription and authorisation, on the UE capabilities, and on operator policy.
If a user is only subscribed to either transport-level interworking or service-level
interworking, only procedures defined for the subscribed interworking type may be
performed.
If a user is subscribed to both transport-level interworking and service-level interworking, but
the user is only authorized for one of the interworking types when the message is processed,
only the authorized interworking may be performed.
If a user is subscribed to both transport-level interworking and service-level interworking,
and the user is authorized for both types, the behavior of the SMS-GW depends on the
specific scenario, on the registered capabilities of the UE, and finally is defined by operator
policy and user preferences.
For a user subscribed to service-level interworking, two Application Servers in the network
are normally called upon to handle an Instant Message:
-

the IM AS, defined in [OMASIMPLE];

the SMS-GW.

The following sections describe the different interaction scenarios.

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
1.3.2

IMS Originating

In the originating network, a UE sends a SIP MESSAGE (Encapsulated Short Message or


Instant Message). The originating S-CSCF forwards the SIP MESSAGE to the SMS-GW
based on the iFC. If there is no subscription for the interworking service, the SMS-GW is not
included in the iFC and the S-CSCF continues with the subsequent iFC check. After all the
originating iFC triggers have been handled, the S-CSCF attempts to route the SIP MESSAGE
to the terminating IMS network. If it fails, an error is returned to the sender.
NOTE 1:
If an IM AS is present in the network, Instant Messages are routed to it before
going to the SMS-GW.
NOTE 2:
An encapsulated Short Message uses the PSI of the Message Center as the
Request-URI. If the user is not subscribed to transport-level interworking and the SMS-GW
is not invoked, the ENUM query fails, and an error is returned to the sender. How the UE is
provided with the PSI of the Message Center is outside the scope of this document.
When the SMS-GW receives the SIP MESSAGE, it shall decide which interworking is
performed based on the content of the received SIP MESSAGE, as the SMS-GW can
distinguish between an encapsulated Short Message and an Instant Message. If an
encapsulated Short Message is received and if the subscriber is authorized for the transportlevel interworking, the SMS-GW maps the encapsulated Short Message to a Short Message.
Similarly, when an Instant Message is received, the SMS-GW determines whether the Instant
Message is routable in IMS. If the Instant Message is not routable in IMS and the service
level interworking is authorized, the SMS-GW shall perform the service-level interworking.

Figure 1
1.3.3

Figure 6.3.2: Performing interworking service on originating side

IMS Terminating

When the SMS-GW receives a Short Message from the legacy network on the terminating
side, it performs the domain selection to determine the preferred domain to transfer the Short
Message. If the selected network is IMS, the SMS-GW will determine whether the transport
level interworking or the service level interworking is to be preformed based on the users'
subscription and authorization, and on the UE capability as indicated during IMS registration.
If the user has subscribed to both services, is authorized for both and the UE has indicated its
capability to receive both encapsulated Short Messages and Instant Messages, the priority
between the transport-level interworking and the service-level interworking is based on
operator policy and user preferences.

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
NOTE:If the incoming Short Message is interworked to an Instant Message, the resulting
Instant Message could be routed to the IM AS before being sent to the UE.

Figure 2
Figure 6.3.3: Performing interworking service on terminating side for an
incoming Short Message
1.4
IM capable UE sends an Instant Message to an SMS user with interworking in the
originating side

Figure 3
1)

Figure 6.4: Successful IM origination to SMS procedure

The UE registers to S-CSCF according the IMS registration procedure.

2)
UE submits the Instant Message to the S-CSCF using an appropriate SIP method. The
UE may request to hide its Public User Identity from the recipient within the Instant Message,
as described in [OMASIMPLE].
3)

S-CSCF forwards the Instant Message toSMS-GW based on stored iFC.

NOTE 1:
Subscribers with no subscription for service level interworking will not be
provided with the relevant iFCs.
4)
The SMS-GW shall decide whether to perform service-level interworking depending
on SIP request header field (e.g. Request-URI), operator policy, when the Instant Message is
not routable in the IMS. If the service-level interworking is authorized, the originating UE's
SMS-GW delivers the SMS message to the terminating SMS-GW in a MAP SMDPP
message. The terminating SMS-GW is not shown for brevity.
5)
The terminating SMS-GW responds by sending a MAP smdpp message back to the
sender of the MAP SMDPP message.
6)
If service authorization is successful, the SMS-GW acknowledges the Instant
Message.
7)

Instant Message acknowledgement is forwarded by S-CSCF to UE.

NOTE 2:
Steps 6 and 7 can occur anytime after the subscriber authorization check has
been performed by the SMS-GW.
8)
The terminating SMS-GW acknowledges message delivery to the MS by sending
MAP: SMDPP (Delivery Report).

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
9)
The originating SMS-GW responds by sending a MAP smdpp message back to the
sender of the MAP SMDPP message.
10)
SMS-GW translates the received Delivery report to an appropriate Instant Message,
and forwards it to the S-CSCF. If the SMS-GW sent concatenated Short Messages to
terminating SMS-GW in step 4, the SMS-GW should wait for the last Delivery Report, and
translate the last Delivery Report to an appropriate Instant Message, and forward it to the
S-CSCF.
11)

S-CSCF sends the translated Instant Message to the UE.

12)

UE acknowledges the translated Instant Message.

13)
Acknowledgement of the translated Instant Message is forwarded by S-CSCF to
SMS-GW.
1.5
IM capable UE sends an Instant Message to an SMS user with interworking in the
terminating side
This procedure describes the delivery of an Instant Message to a registered IMS subscriber
that is presently being served by a 1xRTT network.

Figure 4
Figure 6.5: Successful IM terminating to SMS procedure with interworking in
the Terminating Side
1)
UE submits an Instant Message, destined to another IM user in another IMS domain,
using an appropriate SIP method. The UE may request to hide its Public User Identity from
the recipient within the Instant Message, as described in [OMASIMPLE].
2)
The S-CSCF resolves the destination domain and routes the message towards the SCSCF in the terminating network ("Terminating S-CSCF").
3)
The terminating S-CSCF forwards the Instant Message to the IM AS ("Terminating
IM AS") based on stored iFC.
NOTE:Depending on iFC configuration, it is possible that the IM AS is not triggered for the
unregistered subscribers.
4)
The terminating IM AS invokes terminating IM services as applicable for the
destination IM user.

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
5)
The IM AS can forward the Instant Message back to the terminating S-CSCF, e.g.
when the terminating IM user is offline.
6)
The terminating S-CSCF forwards the Instant Message to the SMS-GW, e.g. based on
stored iFC.
7-11) The SMS-GW sends Accepted towards the IM capable UE to indicate that the Instant
Message has been accepted for further processing.
12)
The SMS-GW performs service level interworking of the received instant message
(step 11). After the service level interworking, the SMS-GW sends a MAP SMDPP Invoke
message to the Serving MSC and starts timer SMT. The MAP SMDPP Invoke message
containing the SMS Delivery message [C.S0015] in the SMS_BearData Parameter.
13)
The MSC sends an ADDS Page message [A.S0014] to the BS. The ADDS Page
message contains the SMS Delivery message in the ADDS User Part information element.
If the MSC requires an acknowledgment, it includes the Tag information element in the
ADDS Page message and starts timer T3113.
14)
The BS sends the SMS Delivery Message to the MS on the Paging Channel or the
Forward Common Control Channel. Before sending the short message, the BS may perform
vendor specific procedures such as paging the MS to determine the cell in which the MS is
located.
15)
If a Layer 2 Ack was solicited in the Data Burst Message (Step 14), the MS
acknowledges the receipt of the message by a Layer 2 Ack.
16)
If the MSC requested an acknowledgment by including the Tag information element
in the ADDS Page message (step 13), the BS replies with an ADDS Page Ack message
including the Tag information element set identical to the value sent by the MSC (step 13). If
timer T3113 was previously started, it is now stopped.
17)
The MSC acknowledges the MAP SMDPP invoke message (step 12) by sends a
SMDPP return result to the SMS-GW. Upon receiving the MAP SMDPP return result
message the SMS-GW stops timer SMT.
18)
If a Reply Option subparameter received in an SMS Deliver Message (step 14)
indicates that User Acknowledgment is requested, the mobile station should indicate the
request to the user. When the user acknowledges the message, the mobile station sends an
SMS User Acknowledgement Message in response to the SMS Deliver Message.

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
19)
If a Layer 2 Ack was solicited in the Data Burst Message (Step 18), the BS
acknowledges the receipt of the message by a Layer 2 Ack.
20)
The BS sends the MSC an ADDS Transfer message. The ADDS Transfer message
contains the SMS User Acknowledgment Message in its ADDS User Part information
element.
21)
The MSC sends the SMS-GW a MAP SMDPP Invoke message and starts timer SMT.
The MAP SMDPP Invoke message contains the SMS User Acknowledgment Message in the
SMS_BearData Parameter.
22)
The SMS-GW acknowledges the MAP SMDPP invoke message (step 21) by sending
an SMDPP return result to the MSC. Upon receiving the MAP SMDPP return result message
the MSC stops timer SMT.
23)
SMS-GW translates the received SMS User Acknowledgment Message to an
appropriate Instant Message, and forwards it to the terminating S-CSCF.
24-27) The terminating S-CSCF sends that Instant Message containing the delivery status of
the message towards the IM capable UE.
28-32) The IM capable UE sends OK response the SMS-GW.
1.6

IM user receives Short Message from an SMS user

An IMS registered user with SIMPLE IM service receives a Short Message formatted via
service-level interworking to an Instant Message.

We deploy the classical shortest-path routing algorithm with a slight modification where
routing is performed through cluster heads. The cluster heads are selected absed on the degree
of neighborhood and energy consideration. The link costs are chosen to be the transmitted
powers. Therefore, the objective is to route the packet from the source to the destination
through the minimum power path.

12.
The received power at any mobile node has to be greater than a minimum power
level, denoted by Min-RecvPower. This is crucial in order to guarantee reliable
communication between the transmitter and the receiver. This value helps determine the
power level at which a mo-bile has to transmit in order to directly reach a neighboring node.

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
13.
It is expected that unidirectional links will be formed when transmit powers are thus
manipulated, i.e. we might have a cluster of nodes that can communicate with each other but
no packets can either enter or leave this cluster. Modifications to the the protocol to eliminate
this effect

are being investigated. However, it should be noted that this does not change the routing
methodology1 since the signaling channel is bidirectional.
14.

The Signaling Packet format is shown in Figure 2 below,

Node ID

Neighbor ID Transmit Power Level

Figure 2: Signaling Packet Format

where,

Node ID: Identifier for the node broadcasting the signaling packet.

Neighbor ID: Identifier for a direct neighbor to which the node is broadcasting the signaling
packet.

Transmit Power Level: Minimum power level needed to reach that neighbor.

15. The Data Packet format is shown in Figure 3.

Source ID

Destination IDCurrent Node ID

Next Node ID Re-Transmissions

Payload

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

Figure 3: Data Packet Format

where,

Source ID: Identifier of the node that generated the packet. Destination ID: Identifier of the
packet's destination node. Current Node ID: Identifier of the relay node at which the packet is
currently stored on its path to the destination.

Next Node ID: Identifier of the next relay node to which the packet is to be transmitted on its
path to the destina-tion.

Re-Transmissions: Total number of retransmission at-tempts performed on that packet.


(retransmission will be
Node Throughput is defined as percentage of success-ful transmission attempts.

End-to-End Network Throughput is defined as per-centage of packets that reach their


destinations success-fully

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

The power model is given by

where Pr is the received power, and Pt is the transmission power and


ratio.

is the interference

The Minimum Power Routing (MPR) algorithm proposed is a hop-by-hop shortest path
routing mechanism where the link costs are the transmitted power levels.
The routing algorithm then goes through the following

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
steps:

1. Based on the routing table constructed, the mobile node creates the set of all possible
routes from the source to destination.
2. The routing algorithm employed falls within the general class of shortest path
routing. It searches, within the created route set, for the minimum cost route from sourceto
destination.
3. Determine the next relay node on the minimum power route.

ModifytheNextNodeIDfieldinthedatapacketbeingrouted.

Copythepackettotheretransmissionbufferuntilitssuccessfulreceptionatthenextnodeisindicated
viaanACKmessage.

ThepacketissenttotheMACmodulefortransmissiontothenextrelaynode.

Connectivity Problem
Consideringvariousconditionsofconnectivityandpowermanagement,itisstraightforwardtopoint
outthefollowingissues:

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
Considerawirelessadhocnetworkwithallmobilenodesusingthemaximumpowerlevel(i.e.nopower
management).Accordingly,anymobilenodecanreachalargenumberofnodesinjustonehop.The
advantageofthisapproachisreachingalargenumberofnodesinasinglehopandalmostallofthenodes
inthenetworkintwohops.Thepricepaidishowevertwofold,namelyhighpowerconsumptionand
higherinterference,whichresultsinalargenumberofcollisions.Ifthelinkcostistakentobethe
transmittedpower,itisstraightforwardtonoticethattheCostoftheLinksareequaltoPmax

Each mobile node has a direct link to the closest N out of (n-1) mobile nodes. We call these N
nodes a cluster. Given N, the mobile node adjusts its power to reach at most the farthest node
within its cluster. However, we assume that there is no power adaptation within the cluster.
The advantages of this approach are lower power consumption and possibly, a node's
transmission will cause lower interference to other simultaneous transmissions, when compared to the previous case. The drawbacks are a higher number of hops might have to be
traversed in order to reach a destination, and there exists the possibility of having iso-lated
clusters. Note that link costs (transmitted powers), in this context, are generally different
depending on the ra-dius of each cluster. Accordingly, incorporating the minimum power
routing algorithm is crucial to limit power consumption.

Power Measurement
This procedure emulates the operation of mobile node j capturing the beacon signal
transmitted by node i during node i's allocated signaling slot, where
and
i!=j. The received signal strength depends solely on the transmitted power level (which
is assumed to be Pmax during this phase), the current positions of nodes i and j, and the
effect of the log-normal shadowing. Thus, the received power level is computed by using
the following formula:

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

As pointed out earlier, we rely on average power measurements rather than


instantaneous power measurements. This is due to the fact that instantaneous
measurements could be inaccurate in reflecting the slowly varying channelconditionsin
thepresenceoffastmultipathfading.Therefore,amovingaverageiscomputedbyeachnodetoaverage
outthefastfadingoveraprespecifiednumberofmostrecentinstantaneouspowermeasurements.

PowerManagement

Therearetwosuggestedapproachesforpowermanagementinmobileadhocnetworks:

Nopoweradjustmentwithinacluster.Poweradjustmentwithinacluster.

Thebasicdifferencebetweenthetwoschemesisthatintheformerscheme,thepowerneededto
communicatewiththefarthestnodeintheclusterisalsousedtocommunicatewithanyclosernodeinthe
cluster.Ontheotherhand,thelatterschemesuggestscommunicatingwitheachnodeusingtheminimum
poweritneedsforreliablecommunication.Thisintroduceslessinterferencetosimultaneous
transmissionsofothernodes.

Theobjectiveofdefiningaclusteristoreducecollisions/interferenceandtherebyimprovetheend
toendnetworkthroughput.Asmentionedearlier,weassumeaminimumrequiredlevelofreceived
power,denotedMinRecvPower,thatisnecessarytoguaranteeamaximumaccteptablebiterrorrate.
TheminimumpowerleveltobetransmittedbynodeisuchthatatleasttheMinRecvPowerlevelis
achievedatnodejforagivennetworkconfigurationisgivenby:

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

Chapter
System Design
Data Flow Diagram of the Technique

Power
Measure
Forward if Current Node
is CH

Control Power based on BER

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

Sequence Diagram

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

Chapter

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
Implementation

. Cluster formation using


a. degree
b. energy

n handleHello method whenever a helloPacket Comes


Energy will be retrived from physical layer,

Cluster Head Calculation


Degree of Neighborhood should be high,m
Entropy, Low, Mobility low

ev<<"\nSTART CLUSTER HEAD CALCULATION.........................\n\n";


Physic *d = (Physic*)parentModule()>submodule("physic");;
int N=d->numHost;
cModule* sm = (cModule*)
simulation.module(parentModule()->id());

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
aodv*s1=(aodv*)sm->submodule("route");
int cnt=0;
/*
for( cQueue::Iterator iter(s1->routeTab,1) ; !iter.end(); iter++)
{
cnt++;
}
ev<<parentModule()->id()<<" HAS "<<cnt<<" Numbers of Neighbors\n";
*/
int max=0,maxi=-1;
int ALLC[10];// it will store all cluster heads
int indC=0; // stores how many cluster heads are there
int joinedC=0;// how many nodes have joined the cluster
int totLoop=0;
while(indC<N/3)
{
max=0;
totLoop++;
if(totLoop>5000)
{
totLoop=0;
break;
}
for(int i=2;i<(N+2);i++)
{
cModule* sm = (cModule*) simulation.module(i);
aodv*s1=(aodv*)sm->submodule("route");
Physic*pp1=(Physic*)sm->submodule("physic");
//pp1->isCH=false;
int cnt=0;
for( cQueue::Iterator iter(s1->routeTab,1) ; !iter.end(); iter++)
{
cnt++;
}
ev<<i-2<<" HAS "<<cnt<<" Numbers of Neighbors..ENERY="<<pp1>Energy<<"MOBILITY="<<s1->mobility<<"ENTROPY="<<s1->jointEp <<"\n";
//&&

if((cnt>max) && s1->Energy>2000)


{
int found=0;
// first find if the node with maximum cluster is already a
cluster head or not
ev<< "PRINT ALL OTHER CLUSTER HEADS\n";
for(int j=0;j<indC;j++)
{
ev<<ALLC[j]-2<<"\n";
if(ALLC[j]==i)
{
found=1;
ev<<" AGAIN FOUND THE SAME\n";
}
}
/////////////////////////////
// if not, it may be ch else it cant

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
if(found==0)
{
max=cnt;
maxi=i;
}
}

ev<<"\n--------------------------------------------\n";
ev<<maxi-2<<" HAS MAXIMUM NEIGHBORS... ELECT IT AS CLUSTER HEAD .....
its neighbors are..."<<"\n";
cModule* sm1 = (cModule*) simulation.module(maxi);
Physic*d1=(Physic*)sm1->submodule("physic");
ALLC[indC++]=maxi;
d1->CNO=indC;
d1->isCH=true;
//joinedC++;
/// Now make its neighbors to join the cluster
cModule* sm = (cModule*) simulation.module(maxi);
aodv*s1=(aodv*)sm->submodule("route");
cnt=0;
for( cQueue::Iterator iter(s1->routeTab,1) ; !iter.end(); iter++)
{
e = (RouteTableElement*) iter();
cModule* cj = (cModule*) simulation.module((int)e->destId);
Physic *dc = (Physic*)cj->submodule("physic");;
if(cnt<8)
{

IT\n";

if(!dc->isCH)
{
dc->CNO=(indC);
ev<<"-->"<<(int)e->destId-2<<" ";
cnt++;
joinedC++;
}
else
{
ev<<e->destId-2<<" ALREADY CLUSTER HEAD.. CANT SELECT
}

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
}
ev<<"\n--------------------------------------------\n";
////////////////////////
}
ev<<" TOTAL ...."<< indC<<" NUMBERS OF CLUSTERS FORMED\n";
processed=1;
}
///////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
2. Multiple path
1. Nodes that are cluster head only forwards
RREQ
2. It can only forward RREQ if energy is high,
Entropy low and Mobility high
3. Node must always forward all the RREQ
if(phy->isCH) //(1)
{
double ep=(double)msg->par("Entropy");
double en=(double)msg->par("Energy");
double mob=(double)msg->par("mobility");

if(ep<1.25 && en>4000 && mob<.4) //(2)


{

addNewReq(msg); // we are not checking if its a


new //request (3)
}
Else
{
Return null;
}

ep=ep+jointEp;
mob=mob+mobility;
en=en+phy->Energy;
msg->par("Entropy")=ep;
msg->par("Energy")=en;
msg->par("mobility")=mob;

}
else
{
}
else
{

return NULL;

addNewReq(msg);

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
}

RREQ Packet Format

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

One of the paths that formed

Add these values at each node


handleRREQ
double ep=(double)msg->par("Entropy");
double en=(double)msg->par("Energy");
double mob=(double)msg->par("mobility");
ev<<" DONE upto this*******************\n\n\n";

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters

During transmission if delay is high


generate RERR drop the path
if allpaths are dropped re initialize CH selection

where delay=a* summation of Q*tow +(1+b) Tmacall +


Tdata
cMessage* aodv::handleData(cMessage* msg)
{
cMessage* reply = NULL;
RouteTableElement* e = NULL;
d("hndleData");
//check if the message has been precessed due to the promiscue mode
if(parentModule()->id() != (int)msg->par("mac") )
{
d("received a message not for me...discarding!");
return NULL;
}
d("arrived data msg for "<<msg->par("dest"));
//check if the message is for this host
if(parentModule()->id() == (int)msg->par("dest") )
{
d("DATA MESSAGE ARRIVED AT DESTINATION sent by "<<msg>par("source"));
rcv++;
PDR=rcv/snd;
//collect all the statistic data
statistics.collect(msg, simTime());
hopsHistogram.collect((int)msg->par("hopCount"));
}
else
{
that

return NULL;

//this host in not the final destination but the message states

//this node is used to reach it.


RouteTableElement* e = NULL;
d("Data message not for me but i am on the route,
forwarding...");

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
e = findNode( (int)msg->par("dest") );
snd++;
PDR=rcv/snd;

if(phy->measuredDelay>.5)
{
// if delay is huge
cMessage* reply1 = new
cMessage("RERR",RERR,CTRL_PKT_SIZE,P_RERR);
reply1->addPar("errCount") = 0;
reply1->addPar("ttl") = 1;
reply1->addPar("hopCount") = 0;
reply1->addPar("seqNumS") =
sequenceNumber;
reply1->addPar("cc") ="fatto da
check 1";
reply1->addPar("mac") = BROADCAST;
return reply1;
}
if((e == NULL) || (!e->active))
{
//the route is unknown or expired
//do nothing...
d("ERROR! The route to the destination is unknown!");
return NULL;
}
else
{
d("Data message updated, forwarding!");
reply = copyMessage(msg);
reply->par("mac") = e->nextHop;
/*Perkins....
* Each time a route is used to forward a data packet,
its Active Route Lifetime field of both the destination
and the
be no

next hop on the path to the destination is updated to

less than the current time plus ACTIVE_ROUTE_TIMEOUT.


*/
e->expiration = max(e->expiration,simTime()
+ACTIVE_ROUTE_TIMEOUT);
//shift the invalidation of the route
cancelEvent(e->deleteMessage);
scheduleAt( e->expiration, e->deleteMessage);

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
e = findNode(e->nextHop);
e->expiration = max(e->expiration,simTime()
+ACTIVE_ROUTE_TIMEOUT);
//shift the invalidation of the route
cancelEvent(e->deleteMessage);
scheduleAt(e->expiration, e->deleteMessage);
}
}

OUTput

return reply;

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
Power Management
In the handleMessage function of Physical Layer
if ( msg->arrivedOn("fromMac") )
{
d("msg from Mac");
//compute the trasmission range

range = Pmax*power/rxThreshold;
where range is Ptx,rxThreshold is min received power and Power is the
transmission power
//send the message to all the neighbouts
broadcast(msg);
if( msg!= NULL );
delete msg;
}
else
{
//arrived from outside the module
d("msg from outside");
if(msg->hasBitError())
{

Pmax=Pmax*2;

if Message is not getting recived between two nodes, Increase


Pmax
}
else
{

d("received message with errors...discarding!");


msgWithErr++;
delete msg;

if the reception is Proper, set the Pmax value to actual Value


Pmax=Pmax_org;
d("got message from "<<msg->par("source"));
measuredDelay=FindDelay(parentModule()->id(), (int)msg>par("source"));

ev<<"Delay between "<<parentModule()->id()-2<<" and


"<<(int)msg->par("source")<<" is "<<measuredDelay<<"\n";
send(msg,"toMac"); // FIXME it is illegal to send a msg object and keep
referencing it!!! -Andras
}
}

PowerManagementforThroughput
EnhancementinWirelessAdHocNetworks
usingClusters
Chapter
Conclusion
Power Management is an important aspect in MANET. There are several power management
techniques like Energy aware routing, Optimal Power routing, Power Aware Multipath
routing and so on. It is cited in the text that topology control of MANET is as important as
power control. Therefore we combine the techniques of topology control using cluster
concept and implement power aware routing with it. The system produces better performance
than conventional AODV.
Also the simulation prove that the proposed system is better in terms of power saving. The
system can be further improved by incorporating energy aware concept like energy aware
routing or Energy aware transmission.

You might also like