SlideShare a Scribd company logo
1 of 4
NS2 Leach Implementation
                                          Jason A. Pamplin

Purpose
        This document outlines what is necessary to install and run the LEACH protocol on version
2.27 of ns2. At the time of this writing, this is the newest version of ns2. The LEACH implementation
was written as a stand-alone application. Thus, in the past a version compiled for LEACH may or may
not work for other protocols. In addition, the original version of LEACH was compiled for version
2.5b which is an outdated version of ns2. The following goals have been achieved:
            merged and compiled ns2.27 to support LEACH protocol.
            modified code to allow for support of all protocols including LEACH without
            recompilation.
            validated running of all demos using the ns2.27 validation script.
            Executed LEACH simulation included in the uAMPS changes package
            (tcl/ex/wireless.tcl)
Methodology
        The basic method for integration of the leach code was to make all of the changes as specified
in the uAMPS changes package to the ns-allinone-2.27.tar.gz package. This consisted of using
grep to find all the code segments marked with #ifdef MIT_uAMPS and including them in the proper
place in the most ns codebase. This was done incrementally with compilation and testing done after
individual segments were converted. This was a very manual process by necessity. In some places the
code had to be modified significantly due to changes in the way the latest version 2.27 of ns2 works
verses 2.5b of which the original implementation of LEACH was built for.
       My test cases during conversion were the wireless.tcl and wireless-demo-csci694.tcl.
Both of these simulations are in the tcl/ex directory located in the ns-2.27 base directory. This
allowed me to test effects on other wireless implementations as well as the LEACH implementation.
Surprisingly, the uAMPS changes assume that you will not be running any other wireless protocols.
Thus, straight implementation of the LEACH changes results in Segmentation Faults for other wireless
simulations. This has been fixed.
Changes
Adding LEACH support
       Below is a list of all the line numbers that were changed in existing ns2-27 code. This does not
include the addition of the mit directory with additional code.
        apps/app.cc:53:#ifdef MIT_uAMPS
        apps/app.cc:126:#ifdef MIT_uAMPS
        apps/app.h:53:#ifdef MIT_uAMPS
        common/mobilenode.cc:341:#ifdef MIT_uAMPS
        common/packet.cc:49:#ifdef MIT_uAMPS
        common/packet.cc:127:#ifdef MIT_uAMPS
        common/packet.h:63:#ifdef MIT_uAMPS
        common/packet.h:167:#ifdef MIT_uAMPS
        common/packet.h:223:#ifdef MIT_uAMPS
        common/packet.h:404:#ifdef MIT_uAMPS
        common/packet.h:515:#ifdef MIT_uAMPS
        common/packet.h:587:#ifdef MIT_uAMPS
common/packet.h:610:#ifdef MIT_uAMPS
        common/packet.h:677:#ifdef MIT_uAMPS
        mac/channel.cc:117:#ifdef MIT_uAMPS
        mac/ll.h:55:#ifdef MIT_uAMPS
        mac/ll.h:110:#ifdef MIT_uAMPS
        mac/mac-sensor-timers.cc:5:#ifdef MIT_uAMPS
        mac/mac-sensor-timers.h:5:#ifdef MIT_uAMPS
        mac/mac-sensor.cc:5:#ifdef MIT_uAMPS
        mac/mac-sensor.h:5:#ifdef MIT_uAMPS
        mac/mac.cc:95:#ifdef MIT_uAMPS
        mac/phy.cc:60:#ifdef MIT_uAMPS
        mac/phy.h:93:#ifdef MIT_uAMPS
        mac/phy.h:146:#ifdef MIT_uAMPS
        mac/wireless-phy.cc:94:#ifdef MIT_uAMPS
        mac/wireless-phy.cc:114:#ifdef MIT_uAMPS
        mac/wireless-phy.cc:133:#ifdef MIT_uAMPS
        mac/wireless-phy.cc:220:#ifdef MIT_uAMPS
        mac/wireless-phy.cc:237:#ifdef MIT_uAMPS
        mac/wireless-phy.cc:373:#ifdef MIT_uAMPS
        mac/wireless-phy.cc:433:#ifdef MIT_uAMPS
        mac/wireless-phy.cc:593:#ifdef MIT_uAMPS
        mac/wireless-phy.h:52:#ifdef MIT_uAMPS
        mac/wireless-phy.h:116:#ifdef MIT_uAMPS
        mit/rca/rca-ll.cc:7:#ifdef MIT_uAMPS
        mit/rca/rcagent.cc:7:#ifdef MIT_uAMPS
        mit/uAMPS/bsagent.cc:8:#ifdef MIT_uAMPS
        mit/uAMPS/bsagent.h:8:#ifdef MIT_uAMPS
        trace/cmu-trace.cc:59:#ifdef MIT_uAMPS
        trace/cmu-trace.cc:1026:#ifdef MIT_uAMPS
        trace/cmu-trace.cc:1063:#ifdef MIT_uAMPS
        trace/cmu-trace.cc:1171:#ifdef MIT_uAMPS
        trace/cmu-trace.h:60:#ifdef MIT_uAMPS
        trace/cmu-trace.h:132:#ifdef MIT_uAMPS


        All of the code blocks added is marked with the #ifdef MIT_uAMPS preprocessor directive.
Thus, compilation with LEACH support can be done by adding the DMIT_uAMPS flag to the Makefile.
These code segments are not necessarily exactly as they appear in the original LEACH
implementation. Some of them have been modified significantly to account for changes in the
underlying ns2 code for such services as logging and tracefiles. The changes to the code blocks from
the original are too numerous to list in the document. The reader may compare each code block with
its corresponding file in the uAMPS_changes package. It is important to note that not all code blocks
have a one-to-one correlation with the original as some were merged and deleted during the conversion
process.
Special Changes
Some changes are significant enough in nature to list explicitly. This does not mean that you need to
make these changes if you follow the procedure listed below. These changes could, however, affect
the performance or results of the program and are thus listed here so that you can be aware of them
when you run your simulations.
add-interface
       The method for implementation of the add-interface method of the TCL object library was
extended in the latest version of ns2. This resulted in requiring 3 additional parameters whenever a
node wished to add an interface.          The following code was added at line 207 of the
mit/uAMPS/sims/uamps.tcl file.
        $node topography $topo

        if ![info exist inerrProc_] {
            set inerrProc_ ""
        }
        if ![info exist outerrProc_] {
            set outerrProc_ ""
        }
        if ![info exist FECProc_] {
            set FECProc_ ""
        }

        # Connect the node to the channel.
        $node add-interface $chan $prop $opt(ll) $opt(mac)               
          $opt(ifq) $opt(ifqlen) $opt(netif) $opt(ant) 
          $topo $inerrProc_ $outerrProc_ $FECProc_
        This basically initializes these new required variables to an empty string and calls the add-
interface method to meet the requirement for addition of inerrProc, outerrProc and FECProc
variables in the function call. This was deemed to be easier to implement than adding an overloaded
function to the actual C library. In addition, such overloading would not be in keeping with the intent
of the ns2 developers to require these parameters.
TDMASchedule deletions
       At the beginning of the simulation, the mit/uAMPS/sims/uamps.tcl attempts to clean up
previous simulation results.          One of these files is the TDMA schedules.               This is
done in line 243 with:
        catch "eval exec rm [glob $opt(dirname)/TDMAschedule.*.txt]"
        Unfortunately, this line will fail if there are not matching TDMAschedule.*.txt files in that
directory. The following change corrects the problem:
     catch "eval exec rm [glob -nocomplain $opt(dirname)/TDMAschedule.*.txt]"
Energy Check
        In mac/wireless-phy.cc a new object is created explicitly for the LEACH protocol. This is
basically the energy aware node. However, if other wireless implementations do not call the attach-
energy function for a given node, the energy_ object is never initialized. This is not a problem except
that the sendUp and sendDown functions attempt to adjust the nodes energy value. This results in an
access violation. At line 108, the energy_ variable is initialized to 0 and any place this variable is
accessed a check of if (energy_) is used to be sure that the energy_ variable is not access unless the
energy_ object has indeed been created.

Setup Procedure
     1. Obtain the ns-allinone-2.27.tar.gz package. This can be found at:
        http://www.internetworkflow.com/downloads/ns2leach/ns-allinone-2.27.tar.gz
     2. Unpackage the archive
         gunzip ns-allinone-2.27.tar.gz
         tar xvf ns-allinone-2.27.tar
     3. Change directory to ns-allinone-2.27
         cd ns-allinone-2.27
4. run the install script
        ./install
    5. Add the appropriate environment variables as specified at the end of installation.
    6. Obtain the mit.tar.gz package at
       http://www.internetworkflow.com/downloads/ns2leach/mit.tar.gz .
    7. Place the mit.tar.gz package into the ns-allinone-2.27/ns-2.27 directory.
    8. Change directory to ns-allinone-2.27/ns-2.27
    9. Unpackage the archive which will overwrite all appropriate files and set up symbolic
       links.
        gunzip mit.tar.gz
        tar xvf mit.tar
    10. A sample make file can be found at
        http://www.internetworkflow.com/downloads/ns2leach/Makefile. Edit the Makefile as
        follows:
           Add DMIT_uAMPS to the DEFINE list
           Add I./mit/rca I./mit/uAMPS to the INCLUDE list
           Add the following just prior to the line gaf/gaf.o 
           mit/rca/energy.o mit/rca/rcagent.o 
           mit/rca/rca-ll.o mit/rca/resource.o 
           mac/mac-sensor-timers.o mac/mac-sensor.o mit/uAMPS/bsagent.o 
    11. Clean up previous build
        make clean
    12. Rebuild ns2 this can take a while so I recommend redirecting output, running in
        background and going to lunch.
        nohup make 2>error.log >make.log &
    13. Test default wireless demo and LEACH
        ./test
    14. Validate the full installation   this takes a while too so take a break
        nohup ./validate-full 2>validate.error >validate.log &
References
  [1] Wendi Heinzelm an, Anant ha Chandrakasan, and Hari Balakrishnan. Energy- Efficient
      Com m unicat ion Prot ocol for Wireless Microsensor Net works. Proceedings of the Hawaii
      International Conference on System Sciences, January 4- 7, 2000 © 2000 IEEE.
  [2] MIT µAMPS project ns2 code extensions.
      http://www- mtl.mit.edu/research/icsystems/uamps/research/leach/leach_code.shtml
  [3] Marc Greis' Tutorial for the UCB/LBNL/VINT Network Simulator "ns"
      http://www.isi.edu/nsnam/ns/tutorial/


Future Work
           Create a complete setup script for performing this installation to make this
           exceptionally easy. There are a lot of people out there who have tried to do this
           and even more who want too. It would be good publicity for the school.

More Related Content

What's hot

Kernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
Kernel Recipes 2017 - Modern Key Management with GPG - Werner KochKernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
Kernel Recipes 2017 - Modern Key Management with GPG - Werner KochAnne Nicolas
 
Introduction to firewalls through Iptables
Introduction to firewalls through IptablesIntroduction to firewalls through Iptables
Introduction to firewalls through IptablesBud Siddhisena
 
Building Scalable Data Center Networks
Building Scalable Data Center NetworksBuilding Scalable Data Center Networks
Building Scalable Data Center NetworksCumulus Networks
 
ProstgreSQLFailoverConfiguration
ProstgreSQLFailoverConfigurationProstgreSQLFailoverConfiguration
ProstgreSQLFailoverConfigurationSuyog Shirgaonkar
 
12c Flex ASM: Moving to Flex ASM
12c Flex ASM: Moving to Flex ASM12c Flex ASM: Moving to Flex ASM
12c Flex ASM: Moving to Flex ASMMonowar Mukul
 
Tungsten University: MySQL Multi-Master Operations Made Simple With Tungsten ...
Tungsten University: MySQL Multi-Master Operations Made Simple With Tungsten ...Tungsten University: MySQL Multi-Master Operations Made Simple With Tungsten ...
Tungsten University: MySQL Multi-Master Operations Made Simple With Tungsten ...Continuent
 
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...Andrey Karpov
 
Packet Tracer: Routing protocols EIGRP and OSPF
Packet Tracer: Routing protocols EIGRP and OSPFPacket Tracer: Routing protocols EIGRP and OSPF
Packet Tracer: Routing protocols EIGRP and OSPFRafat Khandaker
 
Plmce2k15 15 tips galera cluster
Plmce2k15   15 tips galera clusterPlmce2k15   15 tips galera cluster
Plmce2k15 15 tips galera clusterFrederic Descamps
 
A Feature-Complete Petri Net Semantics for WS-BPEL 2.0
A Feature-Complete Petri Net Semantics for WS-BPEL 2.0A Feature-Complete Petri Net Semantics for WS-BPEL 2.0
A Feature-Complete Petri Net Semantics for WS-BPEL 2.0Universität Rostock
 
How deep is your buffer – Demystifying buffers and application performance
How deep is your buffer – Demystifying buffers and application performanceHow deep is your buffer – Demystifying buffers and application performance
How deep is your buffer – Demystifying buffers and application performanceCumulus Networks
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF AbyssSasha Goldshtein
 
nftables - the evolution of Linux Firewall
nftables - the evolution of Linux Firewallnftables - the evolution of Linux Firewall
nftables - the evolution of Linux FirewallMarian Marinov
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machineAlexei Starovoitov
 
How to Troubleshoot OpenStack Without Losing Sleep
How to Troubleshoot OpenStack Without Losing SleepHow to Troubleshoot OpenStack Without Losing Sleep
How to Troubleshoot OpenStack Without Losing SleepSadique Puthen
 

What's hot (20)

Kernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
Kernel Recipes 2017 - Modern Key Management with GPG - Werner KochKernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
Kernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
 
Introduction to firewalls through Iptables
Introduction to firewalls through IptablesIntroduction to firewalls through Iptables
Introduction to firewalls through Iptables
 
Building Scalable Data Center Networks
Building Scalable Data Center NetworksBuilding Scalable Data Center Networks
Building Scalable Data Center Networks
 
ProstgreSQLFailoverConfiguration
ProstgreSQLFailoverConfigurationProstgreSQLFailoverConfiguration
ProstgreSQLFailoverConfiguration
 
Iptables in linux
Iptables in linuxIptables in linux
Iptables in linux
 
12c Flex ASM: Moving to Flex ASM
12c Flex ASM: Moving to Flex ASM12c Flex ASM: Moving to Flex ASM
12c Flex ASM: Moving to Flex ASM
 
Iptables
IptablesIptables
Iptables
 
Tungsten University: MySQL Multi-Master Operations Made Simple With Tungsten ...
Tungsten University: MySQL Multi-Master Operations Made Simple With Tungsten ...Tungsten University: MySQL Multi-Master Operations Made Simple With Tungsten ...
Tungsten University: MySQL Multi-Master Operations Made Simple With Tungsten ...
 
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...
Analysis of commits and pull requests in Travis CI, Buddy and AppVeyor using ...
 
Packet Tracer: Routing protocols EIGRP and OSPF
Packet Tracer: Routing protocols EIGRP and OSPFPacket Tracer: Routing protocols EIGRP and OSPF
Packet Tracer: Routing protocols EIGRP and OSPF
 
Plmce2k15 15 tips galera cluster
Plmce2k15   15 tips galera clusterPlmce2k15   15 tips galera cluster
Plmce2k15 15 tips galera cluster
 
Getting modern with my sql
Getting modern with my sqlGetting modern with my sql
Getting modern with my sql
 
A Feature-Complete Petri Net Semantics for WS-BPEL 2.0
A Feature-Complete Petri Net Semantics for WS-BPEL 2.0A Feature-Complete Petri Net Semantics for WS-BPEL 2.0
A Feature-Complete Petri Net Semantics for WS-BPEL 2.0
 
How deep is your buffer – Demystifying buffers and application performance
How deep is your buffer – Demystifying buffers and application performanceHow deep is your buffer – Demystifying buffers and application performance
How deep is your buffer – Demystifying buffers and application performance
 
Understanding iptables
Understanding iptablesUnderstanding iptables
Understanding iptables
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF Abyss
 
nftables - the evolution of Linux Firewall
nftables - the evolution of Linux Firewallnftables - the evolution of Linux Firewall
nftables - the evolution of Linux Firewall
 
BGP zombie routes
BGP zombie routesBGP zombie routes
BGP zombie routes
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
 
How to Troubleshoot OpenStack Without Losing Sleep
How to Troubleshoot OpenStack Without Losing SleepHow to Troubleshoot OpenStack Without Losing Sleep
How to Troubleshoot OpenStack Without Losing Sleep
 

Similar to Ns2leach

Direction of building ns2 using cygwin under windows system
Direction of building ns2 using cygwin under windows systemDirection of building ns2 using cygwin under windows system
Direction of building ns2 using cygwin under windows systemyahyaoui hamdi
 
Linux Kernel, tested by the Linux-version of PVS-Studio
Linux Kernel, tested by the Linux-version of PVS-StudioLinux Kernel, tested by the Linux-version of PVS-Studio
Linux Kernel, tested by the Linux-version of PVS-StudioPVS-Studio
 
DPDK Integration: A Product's Journey - Roger B. Melton
DPDK Integration: A Product's Journey - Roger B. MeltonDPDK Integration: A Product's Journey - Roger B. Melton
DPDK Integration: A Product's Journey - Roger B. Meltonharryvanhaaren
 
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...Qualcomm Developer Network
 
LAS16-TR03: Upstreaming 201
LAS16-TR03: Upstreaming 201LAS16-TR03: Upstreaming 201
LAS16-TR03: Upstreaming 201Linaro
 
Lab3 testbench tutorial (1)
Lab3 testbench tutorial (1)Lab3 testbench tutorial (1)
Lab3 testbench tutorial (1)Abhishek Bose
 
Parallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMPParallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMPAnil Bohare
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabMichelle Holley
 
Network simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxNetwork simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxPratik Joshi
 
OpenPOWER Application Optimization
OpenPOWER Application Optimization OpenPOWER Application Optimization
OpenPOWER Application Optimization Ganesan Narayanasamy
 
Black hat 2010-bannedit-advanced-command-injection-exploitation-1-wp
Black hat 2010-bannedit-advanced-command-injection-exploitation-1-wpBlack hat 2010-bannedit-advanced-command-injection-exploitation-1-wp
Black hat 2010-bannedit-advanced-command-injection-exploitation-1-wprgster
 
Introduction to LAVA Workload Scheduler
Introduction to LAVA Workload SchedulerIntroduction to LAVA Workload Scheduler
Introduction to LAVA Workload SchedulerNopparat Nopkuat
 
Network Automation Tools
Network Automation ToolsNetwork Automation Tools
Network Automation ToolsEdwin Beekman
 

Similar to Ns2leach (20)

Open Dayligth usando SDN-NFV
Open Dayligth usando SDN-NFVOpen Dayligth usando SDN-NFV
Open Dayligth usando SDN-NFV
 
HPC_MPI_CICID_OA.pptx
HPC_MPI_CICID_OA.pptxHPC_MPI_CICID_OA.pptx
HPC_MPI_CICID_OA.pptx
 
Direction of building ns2 using cygwin under windows system
Direction of building ns2 using cygwin under windows systemDirection of building ns2 using cygwin under windows system
Direction of building ns2 using cygwin under windows system
 
HPC_MPI_CICD.pptx
HPC_MPI_CICD.pptxHPC_MPI_CICD.pptx
HPC_MPI_CICD.pptx
 
Linux Kernel, tested by the Linux-version of PVS-Studio
Linux Kernel, tested by the Linux-version of PVS-StudioLinux Kernel, tested by the Linux-version of PVS-Studio
Linux Kernel, tested by the Linux-version of PVS-Studio
 
DPDK Integration: A Product's Journey - Roger B. Melton
DPDK Integration: A Product's Journey - Roger B. MeltonDPDK Integration: A Product's Journey - Roger B. Melton
DPDK Integration: A Product's Journey - Roger B. Melton
 
Readme
ReadmeReadme
Readme
 
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
 
LAS16-TR03: Upstreaming 201
LAS16-TR03: Upstreaming 201LAS16-TR03: Upstreaming 201
LAS16-TR03: Upstreaming 201
 
Lab3 testbench tutorial (1)
Lab3 testbench tutorial (1)Lab3 testbench tutorial (1)
Lab3 testbench tutorial (1)
 
Parallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMPParallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMP
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 
Chapter 6 notes
Chapter 6 notesChapter 6 notes
Chapter 6 notes
 
Chapter 5 notes new
Chapter 5 notes newChapter 5 notes new
Chapter 5 notes new
 
Network simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxNetwork simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linux
 
Report_Ines_Swayam
Report_Ines_SwayamReport_Ines_Swayam
Report_Ines_Swayam
 
OpenPOWER Application Optimization
OpenPOWER Application Optimization OpenPOWER Application Optimization
OpenPOWER Application Optimization
 
Black hat 2010-bannedit-advanced-command-injection-exploitation-1-wp
Black hat 2010-bannedit-advanced-command-injection-exploitation-1-wpBlack hat 2010-bannedit-advanced-command-injection-exploitation-1-wp
Black hat 2010-bannedit-advanced-command-injection-exploitation-1-wp
 
Introduction to LAVA Workload Scheduler
Introduction to LAVA Workload SchedulerIntroduction to LAVA Workload Scheduler
Introduction to LAVA Workload Scheduler
 
Network Automation Tools
Network Automation ToolsNetwork Automation Tools
Network Automation Tools
 

More from ambitlick

DCIM: Distributed Cache Invalidation Method for Maintaining Cache Consistency...
DCIM: Distributed Cache Invalidation Method for Maintaining Cache Consistency...DCIM: Distributed Cache Invalidation Method for Maintaining Cache Consistency...
DCIM: Distributed Cache Invalidation Method for Maintaining Cache Consistency...ambitlick
 
Low cost Java 2013 IEEE projects
Low cost Java 2013 IEEE projectsLow cost Java 2013 IEEE projects
Low cost Java 2013 IEEE projectsambitlick
 
Ambitlick ns2 2013
Ambitlick ns2 2013Ambitlick ns2 2013
Ambitlick ns2 2013ambitlick
 
Low cost Java IEEE Projects 2013
Low cost Java IEEE Projects 2013Low cost Java IEEE Projects 2013
Low cost Java IEEE Projects 2013ambitlick
 
Handling selfishness in replica allocation
Handling selfishness in replica allocationHandling selfishness in replica allocation
Handling selfishness in replica allocationambitlick
 
Mutual distance bounding protocols
Mutual distance bounding protocolsMutual distance bounding protocols
Mutual distance bounding protocolsambitlick
 
Moderated group authoring system for campus wide workgroups
Moderated group authoring system for campus wide workgroupsModerated group authoring system for campus wide workgroups
Moderated group authoring system for campus wide workgroupsambitlick
 
Efficient spread spectrum communication without pre shared secrets
Efficient spread spectrum communication without pre shared secretsEfficient spread spectrum communication without pre shared secrets
Efficient spread spectrum communication without pre shared secretsambitlick
 
IEEE -2012-13 Projects IN NS2
IEEE -2012-13 Projects IN NS2  IEEE -2012-13 Projects IN NS2
IEEE -2012-13 Projects IN NS2 ambitlick
 
Adaptive weight factor estimation from user review 1
Adaptive weight factor estimation from user   review 1Adaptive weight factor estimation from user   review 1
Adaptive weight factor estimation from user review 1ambitlick
 
Integrated institutional portal
Integrated institutional portalIntegrated institutional portal
Integrated institutional portalambitlick
 
Mutual distance bounding protocols
Mutual distance bounding protocolsMutual distance bounding protocols
Mutual distance bounding protocolsambitlick
 
Moderated group authoring system for campus wide workgroups
Moderated group authoring system for campus wide workgroupsModerated group authoring system for campus wide workgroups
Moderated group authoring system for campus wide workgroupsambitlick
 
Efficient spread spectrum communication without pre shared secrets
Efficient spread spectrum communication without pre shared secretsEfficient spread spectrum communication without pre shared secrets
Efficient spread spectrum communication without pre shared secretsambitlick
 
Comments on “mabs multicast authentication based on batch signature”
Comments on “mabs multicast authentication based on batch signature”Comments on “mabs multicast authentication based on batch signature”
Comments on “mabs multicast authentication based on batch signature”ambitlick
 
Energy-Efficient Protocol for Deterministic and Probabilistic Coverage In Sen...
Energy-Efficient Protocol for Deterministic and Probabilistic Coverage In Sen...Energy-Efficient Protocol for Deterministic and Probabilistic Coverage In Sen...
Energy-Efficient Protocol for Deterministic and Probabilistic Coverage In Sen...ambitlick
 
Energy efficient protocol for deterministic
Energy efficient protocol for deterministicEnergy efficient protocol for deterministic
Energy efficient protocol for deterministicambitlick
 
Estimating Parameters of Multiple Heterogeneous Target Objects Using Composit...
Estimating Parameters of Multiple Heterogeneous Target Objects Using Composit...Estimating Parameters of Multiple Heterogeneous Target Objects Using Composit...
Estimating Parameters of Multiple Heterogeneous Target Objects Using Composit...ambitlick
 

More from ambitlick (20)

DCIM: Distributed Cache Invalidation Method for Maintaining Cache Consistency...
DCIM: Distributed Cache Invalidation Method for Maintaining Cache Consistency...DCIM: Distributed Cache Invalidation Method for Maintaining Cache Consistency...
DCIM: Distributed Cache Invalidation Method for Maintaining Cache Consistency...
 
Low cost Java 2013 IEEE projects
Low cost Java 2013 IEEE projectsLow cost Java 2013 IEEE projects
Low cost Java 2013 IEEE projects
 
Ambitlick ns2 2013
Ambitlick ns2 2013Ambitlick ns2 2013
Ambitlick ns2 2013
 
Low cost Java IEEE Projects 2013
Low cost Java IEEE Projects 2013Low cost Java IEEE Projects 2013
Low cost Java IEEE Projects 2013
 
Handling selfishness in replica allocation
Handling selfishness in replica allocationHandling selfishness in replica allocation
Handling selfishness in replica allocation
 
Mutual distance bounding protocols
Mutual distance bounding protocolsMutual distance bounding protocols
Mutual distance bounding protocols
 
Moderated group authoring system for campus wide workgroups
Moderated group authoring system for campus wide workgroupsModerated group authoring system for campus wide workgroups
Moderated group authoring system for campus wide workgroups
 
Efficient spread spectrum communication without pre shared secrets
Efficient spread spectrum communication without pre shared secretsEfficient spread spectrum communication without pre shared secrets
Efficient spread spectrum communication without pre shared secrets
 
IEEE -2012-13 Projects IN NS2
IEEE -2012-13 Projects IN NS2  IEEE -2012-13 Projects IN NS2
IEEE -2012-13 Projects IN NS2
 
Adaptive weight factor estimation from user review 1
Adaptive weight factor estimation from user   review 1Adaptive weight factor estimation from user   review 1
Adaptive weight factor estimation from user review 1
 
Integrated institutional portal
Integrated institutional portalIntegrated institutional portal
Integrated institutional portal
 
Embassy
EmbassyEmbassy
Embassy
 
Crm
Crm Crm
Crm
 
Mutual distance bounding protocols
Mutual distance bounding protocolsMutual distance bounding protocols
Mutual distance bounding protocols
 
Moderated group authoring system for campus wide workgroups
Moderated group authoring system for campus wide workgroupsModerated group authoring system for campus wide workgroups
Moderated group authoring system for campus wide workgroups
 
Efficient spread spectrum communication without pre shared secrets
Efficient spread spectrum communication without pre shared secretsEfficient spread spectrum communication without pre shared secrets
Efficient spread spectrum communication without pre shared secrets
 
Comments on “mabs multicast authentication based on batch signature”
Comments on “mabs multicast authentication based on batch signature”Comments on “mabs multicast authentication based on batch signature”
Comments on “mabs multicast authentication based on batch signature”
 
Energy-Efficient Protocol for Deterministic and Probabilistic Coverage In Sen...
Energy-Efficient Protocol for Deterministic and Probabilistic Coverage In Sen...Energy-Efficient Protocol for Deterministic and Probabilistic Coverage In Sen...
Energy-Efficient Protocol for Deterministic and Probabilistic Coverage In Sen...
 
Energy efficient protocol for deterministic
Energy efficient protocol for deterministicEnergy efficient protocol for deterministic
Energy efficient protocol for deterministic
 
Estimating Parameters of Multiple Heterogeneous Target Objects Using Composit...
Estimating Parameters of Multiple Heterogeneous Target Objects Using Composit...Estimating Parameters of Multiple Heterogeneous Target Objects Using Composit...
Estimating Parameters of Multiple Heterogeneous Target Objects Using Composit...
 

Recently uploaded

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 

Recently uploaded (20)

LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 

Ns2leach

  • 1. NS2 Leach Implementation Jason A. Pamplin Purpose This document outlines what is necessary to install and run the LEACH protocol on version 2.27 of ns2. At the time of this writing, this is the newest version of ns2. The LEACH implementation was written as a stand-alone application. Thus, in the past a version compiled for LEACH may or may not work for other protocols. In addition, the original version of LEACH was compiled for version 2.5b which is an outdated version of ns2. The following goals have been achieved: merged and compiled ns2.27 to support LEACH protocol. modified code to allow for support of all protocols including LEACH without recompilation. validated running of all demos using the ns2.27 validation script. Executed LEACH simulation included in the uAMPS changes package (tcl/ex/wireless.tcl) Methodology The basic method for integration of the leach code was to make all of the changes as specified in the uAMPS changes package to the ns-allinone-2.27.tar.gz package. This consisted of using grep to find all the code segments marked with #ifdef MIT_uAMPS and including them in the proper place in the most ns codebase. This was done incrementally with compilation and testing done after individual segments were converted. This was a very manual process by necessity. In some places the code had to be modified significantly due to changes in the way the latest version 2.27 of ns2 works verses 2.5b of which the original implementation of LEACH was built for. My test cases during conversion were the wireless.tcl and wireless-demo-csci694.tcl. Both of these simulations are in the tcl/ex directory located in the ns-2.27 base directory. This allowed me to test effects on other wireless implementations as well as the LEACH implementation. Surprisingly, the uAMPS changes assume that you will not be running any other wireless protocols. Thus, straight implementation of the LEACH changes results in Segmentation Faults for other wireless simulations. This has been fixed. Changes Adding LEACH support Below is a list of all the line numbers that were changed in existing ns2-27 code. This does not include the addition of the mit directory with additional code. apps/app.cc:53:#ifdef MIT_uAMPS apps/app.cc:126:#ifdef MIT_uAMPS apps/app.h:53:#ifdef MIT_uAMPS common/mobilenode.cc:341:#ifdef MIT_uAMPS common/packet.cc:49:#ifdef MIT_uAMPS common/packet.cc:127:#ifdef MIT_uAMPS common/packet.h:63:#ifdef MIT_uAMPS common/packet.h:167:#ifdef MIT_uAMPS common/packet.h:223:#ifdef MIT_uAMPS common/packet.h:404:#ifdef MIT_uAMPS common/packet.h:515:#ifdef MIT_uAMPS common/packet.h:587:#ifdef MIT_uAMPS
  • 2. common/packet.h:610:#ifdef MIT_uAMPS common/packet.h:677:#ifdef MIT_uAMPS mac/channel.cc:117:#ifdef MIT_uAMPS mac/ll.h:55:#ifdef MIT_uAMPS mac/ll.h:110:#ifdef MIT_uAMPS mac/mac-sensor-timers.cc:5:#ifdef MIT_uAMPS mac/mac-sensor-timers.h:5:#ifdef MIT_uAMPS mac/mac-sensor.cc:5:#ifdef MIT_uAMPS mac/mac-sensor.h:5:#ifdef MIT_uAMPS mac/mac.cc:95:#ifdef MIT_uAMPS mac/phy.cc:60:#ifdef MIT_uAMPS mac/phy.h:93:#ifdef MIT_uAMPS mac/phy.h:146:#ifdef MIT_uAMPS mac/wireless-phy.cc:94:#ifdef MIT_uAMPS mac/wireless-phy.cc:114:#ifdef MIT_uAMPS mac/wireless-phy.cc:133:#ifdef MIT_uAMPS mac/wireless-phy.cc:220:#ifdef MIT_uAMPS mac/wireless-phy.cc:237:#ifdef MIT_uAMPS mac/wireless-phy.cc:373:#ifdef MIT_uAMPS mac/wireless-phy.cc:433:#ifdef MIT_uAMPS mac/wireless-phy.cc:593:#ifdef MIT_uAMPS mac/wireless-phy.h:52:#ifdef MIT_uAMPS mac/wireless-phy.h:116:#ifdef MIT_uAMPS mit/rca/rca-ll.cc:7:#ifdef MIT_uAMPS mit/rca/rcagent.cc:7:#ifdef MIT_uAMPS mit/uAMPS/bsagent.cc:8:#ifdef MIT_uAMPS mit/uAMPS/bsagent.h:8:#ifdef MIT_uAMPS trace/cmu-trace.cc:59:#ifdef MIT_uAMPS trace/cmu-trace.cc:1026:#ifdef MIT_uAMPS trace/cmu-trace.cc:1063:#ifdef MIT_uAMPS trace/cmu-trace.cc:1171:#ifdef MIT_uAMPS trace/cmu-trace.h:60:#ifdef MIT_uAMPS trace/cmu-trace.h:132:#ifdef MIT_uAMPS All of the code blocks added is marked with the #ifdef MIT_uAMPS preprocessor directive. Thus, compilation with LEACH support can be done by adding the DMIT_uAMPS flag to the Makefile. These code segments are not necessarily exactly as they appear in the original LEACH implementation. Some of them have been modified significantly to account for changes in the underlying ns2 code for such services as logging and tracefiles. The changes to the code blocks from the original are too numerous to list in the document. The reader may compare each code block with its corresponding file in the uAMPS_changes package. It is important to note that not all code blocks have a one-to-one correlation with the original as some were merged and deleted during the conversion process. Special Changes Some changes are significant enough in nature to list explicitly. This does not mean that you need to make these changes if you follow the procedure listed below. These changes could, however, affect the performance or results of the program and are thus listed here so that you can be aware of them when you run your simulations. add-interface The method for implementation of the add-interface method of the TCL object library was extended in the latest version of ns2. This resulted in requiring 3 additional parameters whenever a
  • 3. node wished to add an interface. The following code was added at line 207 of the mit/uAMPS/sims/uamps.tcl file. $node topography $topo if ![info exist inerrProc_] { set inerrProc_ "" } if ![info exist outerrProc_] { set outerrProc_ "" } if ![info exist FECProc_] { set FECProc_ "" } # Connect the node to the channel. $node add-interface $chan $prop $opt(ll) $opt(mac) $opt(ifq) $opt(ifqlen) $opt(netif) $opt(ant) $topo $inerrProc_ $outerrProc_ $FECProc_ This basically initializes these new required variables to an empty string and calls the add- interface method to meet the requirement for addition of inerrProc, outerrProc and FECProc variables in the function call. This was deemed to be easier to implement than adding an overloaded function to the actual C library. In addition, such overloading would not be in keeping with the intent of the ns2 developers to require these parameters. TDMASchedule deletions At the beginning of the simulation, the mit/uAMPS/sims/uamps.tcl attempts to clean up previous simulation results. One of these files is the TDMA schedules. This is done in line 243 with: catch "eval exec rm [glob $opt(dirname)/TDMAschedule.*.txt]" Unfortunately, this line will fail if there are not matching TDMAschedule.*.txt files in that directory. The following change corrects the problem: catch "eval exec rm [glob -nocomplain $opt(dirname)/TDMAschedule.*.txt]" Energy Check In mac/wireless-phy.cc a new object is created explicitly for the LEACH protocol. This is basically the energy aware node. However, if other wireless implementations do not call the attach- energy function for a given node, the energy_ object is never initialized. This is not a problem except that the sendUp and sendDown functions attempt to adjust the nodes energy value. This results in an access violation. At line 108, the energy_ variable is initialized to 0 and any place this variable is accessed a check of if (energy_) is used to be sure that the energy_ variable is not access unless the energy_ object has indeed been created. Setup Procedure 1. Obtain the ns-allinone-2.27.tar.gz package. This can be found at: http://www.internetworkflow.com/downloads/ns2leach/ns-allinone-2.27.tar.gz 2. Unpackage the archive gunzip ns-allinone-2.27.tar.gz tar xvf ns-allinone-2.27.tar 3. Change directory to ns-allinone-2.27 cd ns-allinone-2.27
  • 4. 4. run the install script ./install 5. Add the appropriate environment variables as specified at the end of installation. 6. Obtain the mit.tar.gz package at http://www.internetworkflow.com/downloads/ns2leach/mit.tar.gz . 7. Place the mit.tar.gz package into the ns-allinone-2.27/ns-2.27 directory. 8. Change directory to ns-allinone-2.27/ns-2.27 9. Unpackage the archive which will overwrite all appropriate files and set up symbolic links. gunzip mit.tar.gz tar xvf mit.tar 10. A sample make file can be found at http://www.internetworkflow.com/downloads/ns2leach/Makefile. Edit the Makefile as follows: Add DMIT_uAMPS to the DEFINE list Add I./mit/rca I./mit/uAMPS to the INCLUDE list Add the following just prior to the line gaf/gaf.o mit/rca/energy.o mit/rca/rcagent.o mit/rca/rca-ll.o mit/rca/resource.o mac/mac-sensor-timers.o mac/mac-sensor.o mit/uAMPS/bsagent.o 11. Clean up previous build make clean 12. Rebuild ns2 this can take a while so I recommend redirecting output, running in background and going to lunch. nohup make 2>error.log >make.log & 13. Test default wireless demo and LEACH ./test 14. Validate the full installation this takes a while too so take a break nohup ./validate-full 2>validate.error >validate.log & References [1] Wendi Heinzelm an, Anant ha Chandrakasan, and Hari Balakrishnan. Energy- Efficient Com m unicat ion Prot ocol for Wireless Microsensor Net works. Proceedings of the Hawaii International Conference on System Sciences, January 4- 7, 2000 © 2000 IEEE. [2] MIT µAMPS project ns2 code extensions. http://www- mtl.mit.edu/research/icsystems/uamps/research/leach/leach_code.shtml [3] Marc Greis' Tutorial for the UCB/LBNL/VINT Network Simulator "ns" http://www.isi.edu/nsnam/ns/tutorial/ Future Work Create a complete setup script for performing this installation to make this exceptionally easy. There are a lot of people out there who have tried to do this and even more who want too. It would be good publicity for the school.