[ns] AODV, mobile nodes
Hi everybody, I need a help. I've created a simulation and it is quite simple: I have one mobile node and 10 BaseStation(BS) nodes. Mobile node goes through by BSs, each BS sends packets to mobile node. The problem is - connection is not continuous. When mobile node goes through BSs num. 4 and num.6 there are some breaks? Could somebody explain to me this strangeness? Thank you in advance :) Darya
[ns] function rt_resolve(Packet *p)
Hi in aodv.cc The function rt_resolve(Packet *p) is to find a route for data packet or for any packet? thanks
Re: [ns] Routing table NS2
Alexandre, This TCL might help you. Thanks to Priscila Doria @ UFCG (who give me this TCL). Sidney Doria UFCG / BRAZIL --- # Create six nodes set x [$ns node] set y [$ns node] set z [$ns node] set w [$ns node] set r1 [$ns node] set r2 [$ns node] set r3 [$ns node] set r4 [$ns node] set a [$ns node] set b [$ns node] set c [$ns node] set d [$ns node] # Define NAM node colors $x color green $y color red $z color purple $w color white $r1 shape box $r2 shape box $r3 shape box $r4 shape box $a color green $b color red $c color purple $d color white # Links $ns duplex-link $r1 $x 10Mb 1ms DropTail $ns duplex-link $r1 $c 10Mb 1ms DropTail $ns duplex-link $r1 $r2 2Mb 20ms DropTail $ns duplex-link $r2 $y 10Mb 1ms DropTail $ns duplex-link $r2 $d 10Mb 1ms DropTail $ns duplex-link $r2 $r3 10Mb 40ms DropTail $ns duplex-link $r3 $z 10Mb 1ms DropTail $ns duplex-link $r3 $a 10Mb 1ms DropTail $ns duplex-link $r3 $r4 2Mb 20ms DropTail $ns duplex-link $r4 $w 10Mb 1ms DropTail $ns duplex-link $r4 $b 10Mb 1ms DropTail $ns duplex-link $r4 $r1 10Mb 40ms DropTail # Orientation (NAM) $ns duplex-link-op $r1 $x orient up $ns duplex-link-op $r1 $c orient left $ns duplex-link-op $r1 $r2 orient right $ns duplex-link-op $r2 $y orient right $ns duplex-link-op $r2 $d orient up $ns duplex-link-op $r2 $r3 orient down $ns duplex-link-op $r3 $z orient right $ns duplex-link-op $r3 $a orient down $ns duplex-link-op $r3 $r4 orient left $ns duplex-link-op $r4 $w orient left $ns duplex-link-op $r4 $b orient down $ns duplex-link-op $r4 $r1 orient up # Returns the local link that leads to # the next hop node with the passed # node address parameter. If no link to # the given node exists, the procedure # returns -1. Node instproc nexthop2link { nexthop } { #$self instvar link_ set ns_ [Simulator instance] foreach {index link} [$ns_ array get link_] { set L [split $index :] set src [lindex $L 0] if {$src == [$self id]} { set dst [lindex $L 1] if {$dst == $nexthop} { # Cost Debug #puts "Src:$src Dst:$dst Link:$link" #puts "[$link info class]" # End Cost Debug return $link } } } return -1 } # # This procedure is used to add explicitly # routes to a node, overriding the routing # policy used (e.g. shortest path routing). # Tested currently with static ns2 routing. # Essentially, it is used to add policy-routing # entries in realistic network topologies. # # Parameters: # # node: the ns2 node, to which the route # entry is added to. This parameter # is of type Node. # dst: the destination, to which the route #entry refers to. This parameter # is of type Node. # via: the next hope node, that the local node #will use to access the destination node. #This parameter is of type Node. # ## proc addExplicitRoute {node dst via } { set link2via [$node nexthop2link [$via node-addr]] if {$link2via != -1} { $node add-route [$dst node-addr] [$link2via head] } else { puts "Warning: No link exists between node [$node node-addr] and [$via node-addr]. Explicit route not added." } } # Now the Routing Table $ns at 0 "addExplicitRoute $r1 $z $r4" $ns at 0 "addExplicitRoute $r1 $a $r2" $ns at 0 "addExplicitRoute $r1 $w $r4" $ns at 0 "addExplicitRoute $r2 $w $r1" $ns at 0 "addExplicitRoute $r2 $b $r3" $ns at 0 "addExplicitRoute $r2 $x $r1" $ns at 0 "addExplicitRoute $r3 $x $r2" $ns at 0 "addExplicitRoute $r3 $c $r4" $ns at 0 "addExplicitRoute $r3 $y $r2" $ns at 0 "addExplicitRoute $r4 $y $r3" $ns at 0 "addExplicitRoute $r4 $d $r1" $ns at 0 "addExplicitRoute $r4 $z $r3" -- 2010/5/18 Alexandre Jaron : > > Hello, > > I am a King's College student in London. I am encountering difficulties with > my project. > I am working on a wired scenario for now, and I need to add a kind of > routing table on certain nodes. Basically, I want to tell one node: 'every > packet coming from this node, forward them to that node'. > Is it doable in NS2 ? > > I found something, to add static routes : *[$node set ragent_] > addstaticroute* > But I don't know how to use it. > > May somebody help me? > Kind regards, > > Alexandre Jaron. > MSc student. > -- Sidney Doria Redes ad hoc móveis Doutorado em Computação UFCG Brasil "Nessa jornada, o conhecimento será o seu escudo..." (Mestre dos Magos no episódio do grimoire de ouro)
Re: [ns] finding location of noodes
Hello, Will you be able to share the ns code for DV-Hop? I am working on simulating an improvement for DV-Hop, so it would be very helpful if I had this basic code to start with. Thanks fawzi wrote: > > > > > Hello, > > I am implementing a localization protocol that is very similar to > Dv-Hop. I attached the abstract of the ensuing paper. > The WSN localization algorithm i am doing is very promising [as you > can tell from the abstract!], but it can be very much improved upon > simulation, therefore, i'd rather spend time on enhancing the > algorithm through > simulations rather than implementing the localization simulation > framework [module] in ns2 from scratch. > > I was wondering if you have or can help me get such simulation code in > ns2. > > Please help, i am desperate for it because many authors used it in > their papers, but they don't reply when i as them for simulation code. > > regards, > > > > > > > > > > > > > > -- View this message in context: http://old.nabble.com/finding-location-of-noodes-tp24460705p28588249.html Sent from the ns-users mailing list archive at Nabble.com.
[ns] Routing table NS2
Hello, I am a King's College student in London. I am encountering difficulties with my project. I am working on a wired scenario for now, and I need to add a kind of routing table on certain nodes. Basically, I want to tell one node: 'every packet coming from this node, forward them to that node'. Is it doable in NS2 ? I found something, to add static routes : *[$node set ragent_] addstaticroute* But I don't know how to use it. May somebody help me? Kind regards, Alexandre Jaron. MSc student.
[ns] Jitter1 and Jitter2 ??
Please what does Jitter1 and Jitter two mean in this script i did use it its working but confusing Jitter1 ?? Jitter2 BEGIN { num_recv=0 } { # Trace line format: normal if ($2 != "-t") { event = $1 time = $2 if (event == "+" || event == "-") node_id = $3 if (event == "r" || event == "d") node_id = $4 flow_id = $8 pkt_id = $12 pkt_size = $6 flow_t = $5 level = "AGT" } # Trace line format: new if ($2 == "-t") { event = $1 time = $3 node_id = $5 flow_id = $39 pkt_id = $41 pkt_size = $37 flow_t = $45 level = $19 } # Store packets send time if (level == "AGT" && sendTime[pkt_id] == 0 && (event == "+" || event == "s") && pkt_size >= 512) { sendTime[pkt_id] = time } # Store packets arrival time if (level == "AGT" && event == "r" && pkt_size >= 512) { recvTime[pkt_id] = time num_recv++ } } END { # Compute average jitter jitter1 = jitter2 = tmp_recv = 0 prev_time = delay = prev_delay = processed = 0 prev_delay = -1 for (i=0; processed
Re: [ns] TCL script stopped with KILL message
HI, I am facing the same problem. I am running 100 nodes, after created a new agent. And when I run the TCl i get a KILLED message on the command prompt. Do you have a solution? Thanks, Joe manoop talasila wrote: > > > Hello NS Users, > > I am executing a TCL script for my new protocol agent for time duration: > 10800 seconds (3hrs). The process stopped after a while and showed message > "[Kill]" in the terminal. By seeing this, I understood the TCL process is > Killed. > When I checked the trace I found that it stopped nearly after 7300 sec. > > Please help me, if have any idea why we get this message "[Kill]". Is the > computer RAM not sufficient? or any wrong handling of memory thru my C > program of new protocol agent is causing this? > I am running this TCl script using NS-allinone-2.34 on Ubuntu 9 (Linux) > with > 1GB RAM. Thanks in advance for any help. > > -- > Regards, > Manoop Talasila > Ph.D. student > CS Dept, NJIT > Email: m...@njit.edu > > -- View this message in context: http://old.nabble.com/TCL-script-stopped-with-KILL-message-tp27951955p28597251.html Sent from the ns-users mailing list archive at Nabble.com.
[ns] How to find and put files in OBJ_CC file
Dear Friends, I want to edit the OBJ_CC file as follows: Put *mympeg/mytraffictrace.o* and *mympeg/myudpsink.o* in the *OBJ_CC* list How to do this? Please explain in detail as i am a newbie. Thanks and Regards, Sumit Maheshwari IIT Kharagpur
[ns] Multiple Interface
Hi, Other routing protocol which uses the multiple interface as well as the documentation of the protocols. Regards, Nirmala
[ns] Leach Energy of Nodes
Hi friends, I need to find the current energy of every node in Leach protocol. for that I need your help.. Please help...
Re: [ns] energy model in ns-2.34
i have installed ns-2.34 using ns-allinone-package . i have problem simulating energy model in existing code. have attached the code : # A 10-node example for ad-hoc simulation with DSDV # 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) DSDV ;# routing protocol set val(x) 500 ;# X dimension of topography set val(y) 400 ;# Y dimension of topography set val(stop)150 ;# time of simulation end set opt(energymodel)EnergyModel; set opt(radiomodel)RadioModel ; set opt(initialenergy) 1000 ;# Initial energy in Joules set ns [new Simulator] set tracefd [open milind.tr w] set windowVsTime2 [open win.tr w] set namtrace [open milind.nam w] $ns trace-all $tracefd #$ns use-newtrace $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) # # Create nn mobilenodes [$val(nn)] and attach them to the channel. # # 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 -energyModel $opt(energymodel) \ -idlePower 1.0 \ -rxPower 1.0 \ -txPower 2.0 \ -sleepPower 0.001 \ -transitionPower 0.2 \ -transitionTime 0.005 \ -initialEnergy $opt(initialenergy) for {set i 0} {$i < $val(nn) } { incr i } { set node_($i) [$ns node] } # Provide initial location of mobilenodes $node_(0) set X_ 5.0 $node_(0) set Y_ 5.0 $node_(0) set Z_ 0.0 $node_(1) set X_ 50.0 $node_(1) set Y_ 200.0 $node_(1) set Z_ 0.0 $node_(2) set X_ 150.0 $node_(2) set Y_ 200.0 $node_(2) set Z_ 0.0 $node_(3) set X_ 300.0 $node_(3) set Y_ 150.0 $node_(3) set Z_ 0.0 $node_(4) set X_ 30.0 $node_(4) set Y_ 100.0 $node_(4) set Z_ 0.0 $node_(5) set X_ 400.0 $node_(5) set Y_ 150.0 $node_(5) set Z_ 0.0 $node_(6) set X_ 400.0 $node_(6) set Y_ 200.0 $node_(6) set Z_ 0.0 $node_(7) set X_ 250.0 $node_(7) set Y_ 200.0 $node_(7) set Z_ 0.0 $node_(8) set X_ 300.0 $node_(8) set Y_ 240.0 $node_(8) set Z_ 0.0 $node_(9) set X_ 250.0 $node_(9) set Y_ 350.0 $node_(9) set Z_ 0.0 # Generation of movements $ns at 10.0 "$node_(0) setdest 480.0 50.0 10.0" $ns at 30.0 "$node_(0) setdest 230.0 55.0 5.0" $ns at 70.0 "$node_(0) setdest 480.0 300.0 5.0" # Set a TCP connection between node_(0) and node_(1) set tcp [new Agent/TCP/Newreno] $tcp set class_ 2 set sink [new Agent/TCPSink] $ns attach-agent $node_(0) $tcp $ns attach-agent $node_(1) $sink $ns connect $tcp $sink set ftp [new Application/FTP] $ftp attach-agent $tcp $ns at 10.0 "$ftp start" # Printing the window size proc plotWindow {tcpSource file} { global ns set time 0.01 set now [$ns now] set cwnd [$tcpSource set cwnd_] puts $file "$now $cwnd" $ns at [expr $now+$time] "plotWindow $tcpSource $file" } $ns at 10.1 "plotWindow $tcp $windowVsTime2" # Define node initial position in nam for {set i 0} {$i < $val(nn)} { incr i } { # 30 defines the node size for nam $ns initial_node_pos $node_($i) 30 } # Telling nodes when the simulation ends for {set i 0} {$i < $val(nn) } { incr i } { $ns at $val(stop) "$node_($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 } $ns run but there is error while running .. invalid command name "-energyModel" while executing "-energyModel $opt(energymodel) \ -idlePower 1.0 \ -rxPower 1.0 \ -txPower 2.0 \ -sleepPower 0.001 \ -transitionP..." (file "milindenergy.tcl" line 57) O
[ns] RTP/RTCP implementations??
hi every one, anyone can recommend a good RTP/RTCP implementation to use over ns-2?? thanks -- Pedro Alonso Chaparro Valero R&D Engineer Ciudad Politecnica de la Innovación iTEAM - Mobile Communications Group Polytechnic University of Valencia C\ Camino de Vera S/N, Edificio 8G 46022 Valencia, Spain