LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 03-06-2024, 03:28 AM   #1
fahmida
LQ Newbie
 
Registered: Feb 2024
Posts: 6

Rep: Reputation: 0
NS2/SUMO


$] netconvert --osm-files guindy.osm -o guindy.net.xml

Now, copy the osmPolyconvert.typ.xml from the $SUMO_HOME/data/typemap/ and copy it to the folder where you put all the files.*


$] polyconvert --osm-files*guindy.osm*--net-file*guindy.net.xml --type-file osmPolyconvert.typ.xml -o*guindy.poly.xml



$] python $SUMO_HOME/tools/randomTrips.

Now, create a new file (to be named as guindy.sumo.cfg) and paste the following lines*

*<configuration>
* * *<input>
* * * * *<net-file value="guindy.net.xml"/>
<route-files value="guindy.rou.xml"/>
* * * * *<additional-files value="guindy.poly.xml"/>
* * *</input>
<time>
<begin value="0"/>
<end value="100"/>
<step-length value="0.1"/>
</time>
*</configuration>



Step 3: Exporting to NS2
from sumo trace to ns2, here is the step to do
Open terminal and type the following commands,
$] sumo -c guindy.sumo.cfg --fcd-output guindy.sumo.xml


$] python3 /home/pradeepkumar/sumo-0.26.

This will generate three tcl files (guindy.tcl, activity.tcl and mobility.tcl). Among this activity.tcl might not be needed, but mobility.tcl file is mandatory)

here i replace the guindy with ect and get all these files
activity.tcl
ect.nam
ect.net.xml
ect.osm
ect.poly.xml
ect.rou.xml
ect.sumo.cfg
ect.sumo.xml
ect.tcl
ect.tr
mobility.tcl
osmPolyconvert.typ.xml
test.nam
test.tcl
test.tr
trips.trips.xml


and i get this error

maisha@maisha-ASUS:~/ect$ ns ect.tcl
num_nodes is set 41
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
couldn't read file "mobility.tcl": no such file or directory
while executing
"source.orig mobility.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mobility.tcl"
(file "ect.tcl" line 63)
how to solve it?
 
Old 03-06-2024, 05:11 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.
Quote:
couldn't read file "mobility.tcl": no such file or directory
while executing
"source.orig mobility.tcl"
Your command is $ ns ect.tcl
... then the file mobility.tcl must be present in the same folder as ect.tcl

guindy examples are included in Vanet-ex-0822.tar.xz
https://drive.google.com/file/d/1Klp...usp=drive_link

Sumo ex urban-VANET-scenario-U1-2-3/
https://drive.google.com/drive/folde...hX?usp=sharing

Vanet info https://www.linuxquestions.org/questions/tags/vanet/
and https://groups.google.com/g/ns-users/search?q=vanet

-

Last edited by knudfl; 03-06-2024 at 05:22 AM.
 
Old 03-06-2024, 12:41 PM   #3
fahmida
LQ Newbie
 
Registered: Feb 2024
Posts: 6

Original Poster
Rep: Reputation: 0
Angry NS2/SUMO

thanks for your reply but unfortunately, it still showing the same error even though the mobility.tcl file is in the same directiory as the ect.tcl, i also checked the r/w option for the mobility.tcl file and reading is enabled for the file so there shouldn't be any read issue with the file.

this is the error

maisha@maisha-ASUS:~/ect$ ns ect.tcl
num_nodes is set 41
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
couldn't read file "mobility.tcl": no such file or directory
while executing
"source.orig mobility.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mobility.tcl"
(file "ect.tcl" line 63)



and this is some part of my mobility file,

$node_(0) set X_ 1507.27
$node_(0) set Y_ 1276.56
$node_(0) set Z_ 0
$ns_ at 1.0 "$node_(0) setdest 1507.27 1276.56 0.00"
$ns_ at 1.5 "$node_(0) setdest 1507.01 1276.99 0.99"
$ns_ at 2.0 "$node_(0) setdest 1506.49 1277.87 2.05"
$ns_ at 2.5 "$node_(0) setdest 1505.77 1279.09 2.85"
$ns_ at 3.0 "$node_(0) setdest 1504.8 1280.71 3.78"
$node_(1) set X_ 1652.38
$node_(1) set Y_ 1974.91
$node_(1) set Z_ 0
$ns_ at 3.0 "$node_(1) setdest 1652.38 1974.91 0.00"
$ns_ at 3.5 "$node_(0) setdest 1503.51 1282.88 5.04"
$ns_ at 3.5 "$node_(1) setdest 1652.28 1974.39 1.04"
$ns_ at 4.0 "$node_(0) setdest 1502.0 1285.43 5.92"
$ns_ at 4.0 "$node_(1) setdest 1652.07 1973.29 2.24"
$node_(2) set X_ 1675.8
$node_(2) set Y_ 2061.05
$node_(2) set Z_ 0
$ns_ at 4.0 "$node_(2) setdest 1675.8 2061.05 0.00"
$ns_ at 4.5 "$node_(0) setdest 1500.26 1288.35 6.81"
$ns_ at 4.5 "$node_(1) setdest 1651.78 1971.79 3.05"
$ns_ at 4.5 "$node_(2) setdest 1675.8 2060.51 1.08"
$ns_ at 5.0 "$node_(0) setdest 1498.29 1291.68 7.74"
$ns_ at 5.0 "$node_(1) setdest 1651.39 1969.74 4.17"
$ns_ at 5.0 "$node_(2) setdest 1675.81 2059.57 1.88"




i have seen many mobility.tcl files in the drive that you given to me they are colorfull like green, red ,purple but mine is not do you think that cause any problem?
 
Old 03-06-2024, 03:01 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #3

ect.tcl + mobility.tcl : Well, then please attach / upload the files
→ Go Advanced → "the paperclip tool"
Text files must be uploaded as file.txt → ect.tcl.txt, mobility.tcl.txt

Not finding 'mobility.tcl' : May be an invisible wrong file name?
E.g. a space before or/and after the file name: <space>mobility.tcl<space>
Example edit : $ mv mobility.tcl\ mobility.tcl

If the files have been handled by a ©Windows OS, please convert with dos2unix
Code:
$ sudo apt install dos2unix
$ dos2unix ect.tcl
$ dos2unix mobility.tcl
 
Old 03-07-2024, 03:18 AM   #5
fahmida
LQ Newbie
 
Registered: Feb 2024
Posts: 6

Original Poster
Rep: Reputation: 0
as the site has a file upload limit of max 500kb, i've shared a drive link with the files (main tcl file + mobility.tcl file) and additionally i've included the Open-street map file (.osm) from which i generated the sumo scenario and the mobility file.

Files

will this be enough?
 
Old 03-07-2024, 08:10 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #5

Perfect. But I cannot see which invisible something was added to mobility.tcl .

Convert problematic "mobility.tcl" to mobility.tcl :
Code:
$ cp mo<TAB> mobility.tcl     ## i.e. "tab completion" will read `invisible´
           ## and when you type mobility.tcl as destination, the copy is usable

$ file mo*
mobility.tcl: ASCII text
mobility.tcl​: ASCII text
... but "mouse over" (Dolphin, Konqueror, Thunar file managers) shows a difference: Your file→ Tcl script. The new file→ plain text document.

Your azimpur.tcl was edited to 50 nodes required for mobility.tcl - 50 nodes, new name = azimpur-1.tcl
Edited files https://drive.google.com/drive/folde...usp=drive_link

Code:
$ ns azimpur-1.tcl
$ nam azimpur &      ## shows traffic / a nice animation

Last edited by knudfl; 03-07-2024 at 09:09 AM.
 
Old 03-08-2024, 09:38 AM   #7
fahmida
LQ Newbie
 
Registered: Feb 2024
Posts: 6

Original Poster
Rep: Reputation: 0
thank you so much for your help. when i was running the azimpur-1.tcl file i get this segmentation fault .
ns azimpur-1.tcl
num_nodes is set 50
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Starting Simulation...
SORTING LISTS ...DONE!
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
Segmentation fault (core dumped)
does this cause any probblem ? as it occurs only for first time running , if i run next time it does not occurs.

and also please help me if i work for 100 nodes where i should change previous files that you sent to me (azimpur-1.tcl,mobility.tcl, they are for 50 nodes).
 
Old 03-08-2024, 02:34 PM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
guindy.tcl origins from http://www.nsnam.com/2016/06/sumo-op...-ns2-real.html
http://www.nsnam.com/ is a private log / student notes by @pradeepkumar
.... Sometimes there was some usable info, not always.
( ns2 was http://www.nsnam.org )
"azimpur.tcl" is mostly a copy of guindy.tcl : Problematic traffic settings: Works with older OS only. Contemporary OS's may do Segmentation fault.
Other guindy issues: The line "$ns_ initial_node_pos $node_($i) 20" must appear after the traffic settings. See section " # Define initial node position in nam" in the new files.

Fairly easy to create azimpur-xx.tcl examples with proper traffic.
Just delete the traffic lines (78 - 86), and "source some-OK-traffic".
Please see the new examples azimpur-2.tcl .. azimpur-5.tcl → with ~100 nodes
https://drive.google.com/drive/folde...usp=drive_link

Scene files movement-files-1.tar.xz, traffic-files_cbr-tcp-vbr.tar.xz
https://drive.google.com/drive/folde...usp=drive_link

-

Last edited by knudfl; 03-10-2024 at 04:24 AM.
 
Old 03-09-2024, 09:51 PM   #9
fahmida
LQ Newbie
 
Registered: Feb 2024
Posts: 6

Original Poster
Rep: Reputation: 0
hello sir, i was working with the tcl file and added wormhole attack to it can you please check me the file if the wormhole attack added properly or not?

here im providing a drive link with that wormhole file.


wormhole files
 
Old 03-10-2024, 04:46 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #9

wormhole-ex-2.tar.gz
https://drive.google.com/file/d/1Rxg...ew?usp=sharing

wormhole_ns235.patch
https://drive.google.com/file/d/1YEr...ew?usp=sharing

The examples with "wormhole-peer" can check if wormhole attack was added to ns2
Code:
$ cd ex-wormhole-2/
[ex-wormhole-2]$ grep -n peer *
15worm-16.tcl:170:              [$n14 set ll_(0)] wormhole-peer [$n15 set ll_(0)]
15worm-16.tcl:171:              [$n15 set ll_(0)] wormhole-peer [$n14 set ll_(0)]
2worm14.tcl:173:                [$n14 set ll_(0)] wormhole-peer [$n15 set ll_(0)]
2worm14.tcl:174:                [$n15 set ll_(0)] wormhole-peer [$n14 set ll_(0)]
L_node11-2.tcl:109:[$node_(7) set ll_(0)] wormhole-peer [$node_(8) set ll_(0)]
L_node11-2.tcl:110:[$node_(8) set ll_(0)] wormhole-peer [$node_(7) set ll_(0)]
worm-16.tcl:170:                [$n14 set ll_(0)] wormhole-peer [$n15 set ll_(0)]
worm-16.tcl:171:                [$n15 set ll_(0)] wormhole-peer [$n14 set ll_(0)]
.
wormhole-CA.tcl:140:[$n5 set ll_(0)] wormhole-peer [$n8 set ll_(0)]
.
wormhole-Mellia.tcl:133:[$n2 set ll_(0)] wormhole-peer [$n5 set ll_(0)]
 
Old 03-10-2024, 06:43 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #9
Code:
ns235-wormhole64 azimpur_worm.tcl 
num_nodes is set 50
.
INITIALIZE THE LIST xListHead
(000) - LL::command - added 50 to wormhole peer list
(050) - LL::command - added 0 to wormhole peer list
(051) - LL::command - added 1 to wormhole peer list
(001) - LL::command - added 51 to wormhole peer list
Starting Simulation...
.
.
So far OK what concerns wormhole. But still as bad as the azimpur.tcl with the "guindy errors".

-
 
Old 03-11-2024, 10:47 AM   #12
fahmida
LQ Newbie
 
Registered: Feb 2024
Posts: 6

Original Poster
Rep: Reputation: 0
hello sir i was trying to make this file that you gave me which i added below for 150 nodes, but im not able to do that furthermore i dont understand how to generate this traffic.tcl file .
and is it possible to add wormhole attack for this 150 nodes?

this is the file which i want to convert into for 150 nodes.

files i want to convert
 
Old 03-11-2024, 11:35 AM   #13
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by fahmida View Post
hello sir i was trying to make this file that you gave me which i added below for 150 nodes, but im not able to do that furthermore i dont understand how to generate this traffic.tcl file .
and is it possible to add wormhole attack for this 150 nodes?

this is the file which i want to convert into for 150 nodes.
Is there some point where you'll be able to do research for yourself, and do your own homework?? You've been given files, links, advice, how-tos...yet can't seem to make ANY modifications for yourself???
 
Old 03-11-2024, 12:45 PM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #12

Please read traffic-files_cbr-tcp-vbr.tar.xz linked in post #8.
The file README shows e.g. how the file cbr99 was created :
Code:
$ ns cbrgen.tcl -type cbr -nn 99 -seed 1 -mc 30 -rate 1 > cbr99
... then cbr99 line 2 says
          # nodes: 99, max conn: 30, send rate: 1, seed: 1
An example with 150 nodes {azimpur-22.tcl cbr99 mobility150}
https://drive.google.com/drive/folde...usp=drive_link
... if you want a new "mobility - 150 nodes" you know SUMO.

Wormhole nodes can be added, it's do and try.

-
 
  


Reply

Tags
ns2, sumo



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
erro make[3]***[sumo-gui] install sumo 0.12.3 on ubuntu 14.04 Nguyễn ngọc khánh Linux - Newbie 4 04-07-2016 11:50 AM
sumo-gui file is not created after installation of sumo-0.22.0 on ubuntu 14.04 muratc Linux - Newbie 15 10-23-2015 02:53 AM
How to Install MOVE and SUMO on ubuntu 12.10 with ns2.35 sumegha13 Linux - Software 11 03-21-2014 01:35 AM
integration of SUMO and NS2 sims2801 Linux - Newbie 1 12-06-2012 03:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 08:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration