energy efficiency tcl coding in ns2
#1

Hi am Mohamed i would like to get details on energy efficiency tcl coding in ns2 ..My friend Justin said energy efficiency tcl coding in ns2 will be available here and now i am living at ......... and i last studied in the college/school ......... and now am doing ....i need help on ......et
Reply
#2
Sample Coding in Wireless

Here Guys this is an sample tcl coding


# 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 ;# page link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 50 ;# number of mobilenodes
set val(rp) DSDV ;# routing protocol
set val(x) 1000 ;# X dimension of topography
set val(y) 1000 ;# Y dimension of topography
set val(stop) 150 ;# time of simulation end

set ns [new Simulator]
set tracefd [open simple.tr w]
set namtrace [open simwrls.nam w]

$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $val(x) $val(y)

# set up topography object
set topo [new Topography]

$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)



# 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 \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace ON

for {set i 0} {$i < $val(nn) } { incr i } {
set n($i) [$ns node]
}

# Provide initial location of mobilenodes
$n(0) set X_ 347.0
$n(0) set Y_ 3.0
$n(0) set Z_ 0.0

$n(1) set X_ 345.0
$n(1) set Y_ 36.0
$n(1) set Z_ 0.0

$n(2) set X_ 330.0
$n(2) set Y_ 121.0
$n(2) set Z_ 0.0

$n(3) set X_ 316.0
$n(3) set Y_ 152.0
$n(3) set Z_ 0.0

$n(4) set X_ 246.0
$n(4) set Y_ 90.0
$n(4) set Z_ 0.0

$n(5) set X_ 379.0
$n(5) set Y_ 6.0
$n(5) set Z_ 0.0



# Set a TCP connection between n(1) and n(31)
set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $n(1) $tcp
$ns attach-agent $n(31) $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 10.0 "$ftp start"

# Set a TCP connection between n(31) and n(43)
set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $n(31) $tcp
$ns attach-agent $n(43) $sink
$ns connect $tcp $sink

#defining heads
$ns at 0.0 "$n(0) label CH"
$ns at 0.0 "$n(1) label Source"
#$ns at 0.0 "$n(2) label N2"



$ns at 10.0 "$n(5) setdest 785.0 228.0 5.0"
$ns at 13.0 "$n(26) setdest 700.0 20.0 5.0"
$ns at 15.0 "$n(14) setdest 115.0 85.0 5.0"

#Color change while moving from one group to another
$ns at 73.0 "$n(2) delete-mark N2"
$ns at 73.0 "$n(2) add-mark N2 pink circle"
$ns at 124.0 "$n(11) delete-mark N11"
$ns at 124.0 "$n(11) add-mark N11 purple circle"
$ns at 103.0 "$n(5) delete-mark N5"
$ns at 103.0 "$n(5) add-mark N5 white circle"
$ns at 87.0 "$n(26) delete-mark N26"
$ns at 87.0 "$n(26) add-mark N26 yellow circle"
$ns at 92.0 "$n(14) delete-mark N14"
$ns at 92.0 "$n(14) add-mark N14 green circle"

# Define node initial position in nam
for {set i 0} {$i < $val(nn)} { incr i } {
# 20 defines the node size for nam
$ns initial_node_pos $n($i) 20
}

# Telling nodes when the simulation ends
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "$n($i) reset";
}

# ending nam and the simulation
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "stop"
$ns at 150.01 "puts \"end simulation\" ; $ns halt"
proc stop {} {
global ns tracefd namtrace
$ns flush-trace
close $tracefd
close $namtrace
exec nam simwrls.nam &
}
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: www val pepar com, aodv tcl file with energy model defines, nam sinh danh nhau, ns2 aodv with energy modelin html coding, code to introduce the threshold energy based energy efficiency in aodv files in tcl, val matic, energy efficiency in aodv protocol tcl script for ns2,

[-]
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
  Microgrid and energy management strategies 0 3,020 03-12-2021, 02:53 PM
Last Post:
  seekng ABF coding 0 578 30-01-2019, 07:42 PM
Last Post:
  ns2 source codes free download for hello flood attack 0 2,824 31-10-2018, 02:42 PM
Last Post: Guest
  wireless attack tcl code 0 514 31-10-2018, 01:58 AM
Last Post: Guest
  how to make node disjoint multipath in ns2 tcl code 0 576 25-09-2018, 11:06 AM
Last Post: Guest
  coding interview questions narasimha karumanchi pdf free download 0 572 20-06-2018, 11:46 PM
Last Post: Guest
  online aptitude test project in asp net with coding free download 1 819 20-05-2018, 02:32 PM
Last Post: kumarbinod21
  non conventional sources of energy by g s sawhney free pdf download 0 1,190 17-05-2018, 09:34 AM
Last Post: Guest
  coding for airline reservation system using rmi in java 0 537 08-05-2018, 04:39 PM
Last Post: Guest
  pdf of non conventional energy sources by r k rajput 0 1,133 20-04-2018, 11:16 AM
Last Post: Guest

Forum Jump: