Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
system descriptions: Aqua-Sim-1.0, ns-2.30, ubuntu 16.4 32 bits
I run vbf_example_5.tcl..It works ok. But in nam i cannot able to know which node is source and which node is destination.There is no clear distinction between source and destination node.Some circulation is showing which shows transmission is happening.Can you help me sir?
Thanks sir for providing me links. But again sir there is no label which tells which node is destination like in aodv protocol examples we can see label of both source and destination.I can see source node label from coding of vbf_example_3.tcl and 4vbf_example_4.tcl but please sir can you tell me destination node label?
Is below coding is for destination node?
#Set the Sink node
set node_(0) [ $ns_ node 0]
$node_(0) set sinkStatus_ 1
$god_ new_node $node_(0)
$node_(0) set X_ 500
$node_(0) set Y_ 0
$node_(0) set Z_ 0
$node_(0) set passive 1
set rt [$node_(0) set ragent_]
$rt set control_packet_size $opt(routing_control_packet_size)
Can you provide links for learning or understanding tcl programming so that i can understand how traffic is generated and flow of data taken place? As i am confused with agent and application i.e traffic source generator.And there is same agent which is used in tcl for aquasim like UWSink is attached to almost all nodes.How this work can take place?
Thanks sir for your help but these links are not besides to my work.If you found something related to communication set up between nodes kindly share with me. I Will be thankful to you!
In vbf_example_5.tcl I have increased a no.of nodes by 1 means total nodes are 7 in my modified tcl..but when i increase it gave me errors:
shaveta@shaveta-Aspire-4738Z:~/Aqua-Sim-1.0/ns-2.30/underwatersensor/uw_tcl$ ns-aquasim vbf_example_5.tcl
the file name is vbf_example_5.data
the sending interval is 10.0
num_nodes is set 7
Width=100
INITIALIZE THE LIST xListHead
can't read "a_(5)": no such element in array
while executing
"$a_($i) set data_rate_ [expr 1.0/$opt(interval)]"
("for" body line 2)
invoked from within
"for { set i 1 } { $i<$opt(nn) } {incr i } {
$a_($i) set data_rate_ [expr 1.0/$opt(interval)]
$ns_ at $start_time "$a_($i) cbr-start"
set start_time..."
(file "vbf_example_5.tcl" line 303)
Changes in code:
set opt(nn) 7 ;# number of nodes (change 7 from 6 in code)
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Re #11 : No automatic settings of nodes in vbf_example_4.tcl .. vbf_example_5.tcl .
Which means that the settings must be written for each node :
See vbf_example_5.tcl, lines 142 .. 272 : That's node 0 to node 4.
Easy : Copy "the node 4 section" to below "the node 4 section" and edit all 4 to 5. Set X,Y to your preferred location.
New file name : vbf_example_4-7n.tcl
Code:
271 $a_(4) cmd set-packetsize $opt(packet_size) ;# # of bytes
272
273 # ----------- Add node 5 --------------------------------
274
275 set node_(5) [ $ns_ node 5]
276 $node_(5) set sinkStatus_ 1
277 $node_(5) random-motion 1
278
279 $node_(5) set max_speed $opt(maxspeed)
280 $node_(5) set min_speed $opt(minspeed)
281 $node_(5) set position_update_interval_ $opt(position_update_interval)
282
283 $god_ new_node $node_(5)
284 $node_(5) set X_ 400
285 $node_(5) set Y_ 20
286 $node_(5) set Z_ 30
287 $node_(5) set passive 1
288
289 set rt [$node_(5) set ragent_]
290 $rt set control_packet_size $opt(routing_control_packet_size)
291
292 set a_(5) [new Agent/UWSink]
293 $ns_ attach-agent $node_(5) $a_(5)
294 $a_(5) attach-vectorbasedforward $opt(width)
295 $a_(5) cmd set-range $opt(range)
296 $a_(5) cmd set-target-x -20
297 $a_(5) cmd set-target-y -10
298 $a_(5) cmd set-target-z -20
299 $a_(5) cmd set-filename $opt(datafile)
300 $a_(5) cmd set-packetsize $opt(packet_size) ;# # of bytes
301
302 # -------------------------------------------------------
303
304 #Set the source node
Now I am running vbf_example_6.tcl..This tcl consists of 100 nodes and in this every node is not separately defined. One node define and other nodes are put in loops.Almost all coding is similar to vbf_example_5.tcl. But when i run vbf_example_6.tcl nam window just opens and nodes are moving only without doing any transmission. I am unable to know why transmission between nodes do not takes place?
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Re #14.
Quote:
why transmission between nodes do not takes place
The examples are not supposed to be perfect. But ... :
You can experiment with filters → vbf_example_7.tcl
Code:
#set opt(filters) GradientFilter ;# options can be one or more of
;# TPP/OPP/Gear/Rmst/SourceRoute/Log/TagFilter
# ----------------------------------------
#set opt(filters) TPP
#set opt(filters) SourceRoute
#set opt(filters) Gear
#set opt(filters) Log/TagFilter
set opt(filters) TPP/OPP/Gear/Rmst/SourceRoute/Log/TagFilter
# ----------------------------------------
And set the source node color
Code:
#Set the source node
set node_(1) [$ns_ node 1]
$god_ new_node $node_(1)
$node_(1) set sinkStatus_ 1
$node_(1) set max_speed $opt(maxspeed)
$node_(1) set min_speed $opt(minspeed)
$node_(1) set position_update_interval_ $opt(position_update_interval)
$node_(1) set X_ 100
$node_(1) set Y_ 300
$node_(1) set Z_ $opt(z)
$node_(1) set-cx 100
$node_(1) set-cy 300
$node_(1) set-cz $opt(z)
set rt [$node_(1) set ragent_]
#$rt set control_packet_size $opt(routing_control_packet_size)
# -------------- added label --------------------------------
$ns_ at 0.0 "$node_(2) label SOURCE"
$ns_ at 0.0 "$node_(2) add-mark m1 blue circle"
# -----------------------------------------------------------
$ns_ at 2.0 "$node_(1) move"
Extend the time
Code:
set opt(stop) 1000 ;# simulation time
set opt(prestop) 900 ;# time to prepare to stop
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.