energy efficiency tcl coding in ns2
#1

hello sir
i want to write a source code for underwater acoustic sensor network energy model for my proposed routing protocol.... i just change that underwater scenario in MAODV protocol and proposed a new routing protocol....pls help me to give some suggestion to develope my protocol based on energy metrics...
Reply
#2
The energy model represents the energy level of the nodes in the network. The energy model defined in a node has an initial value which is the energy level of the node at the beginning of the simulation. This energy is called the initial energy. In the simulation, the variable "energy" represents the energy level in a node at any specified time. The value of initialEnergy_ is passed as an input argument. A node loses a particular amount of energy for each transmitted packet and for each received packet. As a result, the initialEnergy_ value on a node is reduced. The energy consumption level of a node at any point in the simulation can be determined by finding the difference between the current energy value and the initial energy value. If a node's energy level reaches zero, it can not receive or transmit any more packets. The amount of power consumption in a node can be printed in the trace file. The energy level of a network can be determined by adding the energy level of the complete node in the network.

How to create power model in ns2 for MANET
In the wireless network, the power model is one of the optional attributes of a node. The energy model denotes the energy level in a mobile node. The components needed to design the power model include initialEnergy, txPower, rxPower and idlePower. The "initialEnergy" represents the energy level that the node has in the initial stage of the simulation. "TxPower" and "rxPower" denotes the energy consumed to transmit and receive packets. If the node is a sensor, the power model must include a special component called "sensePower". Denotes the energy consumed during the detection operation. The tcl script in sample7.tcl illustrates the wireless network power model with 3 nodes that are deployed in the 500m X 500m area. Each node is assigned to 10 Joules as "initialEnergy".

Example of code segment for the energy model in ns2

#Filename: sample7.tcl
#***************************ENERGY MODEL**********************#
# Simulator Instance Creation
set ns [new Simulator]

#Fixing the co-ordinate of simutaion area
set val(x) 500
set val(y) 500

# Define options
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 10 ;# number of mobilenodes
set val(rp) AODV ;# routing protocol
set val(x) 500 ;# X dimension of topography
set val(y) 500 ;# Y dimension of topography
set val(stop) 10.0 ;# time of simulation end
set val(energymodel) EnergyModel ;#Energy set up

# set up topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)

# configure the nodes
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channelType $val(chan) \
-topoInstance $topo \
-energyModel $val(energymodel) \
-initialEnergy 10 \
-rxPower 0.5 \
-txPower 1.0 \
-idlePower 0.0 \
-sensePower 0.3 \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace ON

# Node Creation
for {set i 0} {$i < 10} {incr i} {
set node_($i) [$ns node]
$node_($i) color black

}
 


Output

[Image: ns2-energy-model-wireless-adhoc-wsn-tcl-scrip.jpg]
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: network coding xor operation in ns2, on the security and efficiency of content distribution via network coding, val matic, tcl code for ns2 projects, how to compute energy for wireless nodes in ns2 by tcl, aodv tcl script for ns2 3, anthocnet ns2 tcl file,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  renewable energy design application in water cooler ppt 1 9,083 16-03-2018, 06:04 PM
Last Post: Guest
  travel agency vb6 0 project report with coding in pdf format 3 3,222 13-03-2018, 12:15 AM
Last Post: Guest
  xcel energy intranet xpressnet 1 1,530 01-01-2018, 12:33 PM
Last Post: dhanabhagya
  viva questions for energy conversion engineering lab pdf 3 2,140 27-11-2017, 09:15 AM
Last Post: pawan
Sad wormhole attack is implemented in ns2 at the network layer 13 4,488 05-05-2017, 01:42 PM
Last Post: neeraj.kuntal90
  matlab code for simulate energy consumption in wsn Mirza Ferdous Rahman 2 1,495 17-04-2017, 07:26 PM
Last Post: lakshmipriya2714
  ns2 projects for wormhole attack detection with source code free download 8 6,357 15-04-2017, 04:31 PM
Last Post: Guest
  ns2 source code free download broadcast message 1 974 15-04-2017, 02:42 PM
Last Post: jaseela123d
  ant colony optimization ns2 code 1 952 15-04-2017, 01:27 PM
Last Post: jaseela123d
  ppt on matteran energy 1 1,072 13-04-2017, 12:12 PM
Last Post: jaseela123d

Forum Jump: