LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-03-2019, 12:55 AM   #1
Asifkhan112
LQ Newbie
 
Registered: Nov 2019
Posts: 9

Rep: Reputation: Disabled
How to simulate SMAC on ns2


How can I simulate the S-MAC and then i want to change the code of S-MAC and to compare both of these how can i do it. where i can find the code of S-MAC to execute it on ns2? I tried to execute but i didn't find the file in the Folder S-MAC folder.
 
Old 12-03-2019, 05:01 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,311

Rep: Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574
There are a few simulation examples in ns2.xx/tcl/ex/*, no SMAC.
The other ~3000 examples https://drive.google.com/drive/folde...Ws?usp=sharing

How to write an SMAC example :
Simply edit a default example from e.g. Mac/802_11 to Mac/SMAC .
And run the example to test if it works with the new Mac protocol.
Code:
set val(mac)      Mac/SMAC         ;# MAC type
SMAC-examples-4.tar.gz
https://drive.google.com/file/d/1nO4...ew?usp=sharing


Quote:
.. I want to change the code of S-MAC
.. didn't find the file in the .. S-MAC folder
The C++ Mac code is mostly in ns-2.xx/mac/.
* smac C++ code : ns-2.35/mac/{ smac.cc, smac.h }.

-
 
Old 12-03-2019, 05:31 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,311

Rep: Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574
Modified S-MAC : See modification examples in "smac__All.tar.-gz"
https://www.dropbox.com/s/3ia0oaov67...ll.tar.gz?dl=0
 
Old 12-04-2019, 12:52 AM   #4
Asifkhan112
LQ Newbie
 
Registered: Nov 2019
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
There are a few simulation examples in ns2.xx/tcl/ex/*, no SMAC.
The other ~3000 examples https://drive.google.com/drive/folde...Ws?usp=sharing

How to write an SMAC example :
Simply edit a default example from e.g. Mac/802_11 to Mac/SMAC .
And run the example to test if it works with the new Mac protocol.
Code:
set val(mac)      Mac/SMAC         ;# MAC type
SMAC-examples-4.tar.gz
https://drive.google.com/file/d/1nO4...ew?usp=sharing



The C++ Mac code is mostly in ns-2.xx/mac/.
* smac C++ code : ns-2.35/mac/{ smac.cc, smac.h }.

-
sir i done it and now how to simulate it. and after simulation how can i find the values and then compare it
 
Old 12-04-2019, 12:55 AM   #5
Asifkhan112
LQ Newbie
 
Registered: Nov 2019
Posts: 9

Original Poster
Rep: Reputation: Disabled
this is the error which is generated after I make a change in the MAC to MAC/TMAC

num_nodes is set 10
invalid command name "Mac/TMAC"
while executing
"Mac/TMAC create _o19 "
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new $mactype"
(procedure "_o14" line 10)
(Node/MobileNode add-interface line 10)
invoked from within
"$node add-interface $chan $propInstance_ $llType_ $macType_ $ifqType_ $ifqlen_ $phyType_ $antType_ $topoInstance_ $inerrProc_ $outerrProc_ $FECProc_"
(procedure "_o3" line 83)
(Simulator create-wireless-node line 83)
invoked from within
"_o3 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o3" line 23)
(Simulator node line 23)
invoked from within
"$ns_ node"
("for" body line 2)
invoked from within
"for {set i 0} {$i < [expr $val(nn)]} {incr i} {
set node_($i) [$ns_ node]

$node_($i) random-motion 0 ..."
(file "tmac.tcl" line 55)
 
Old 12-04-2019, 06:20 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,311

Rep: Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574
Re #5.

Please edit post #5 to CODE Tags
http://www.linuxquestions.org/questi....php?do=bbcode
I.e. write [code]error text[/code]
Editing : That's the 'Edit' button in post #5.


Quote:
invalid command name "Mac/TMAC"
Please explain why you think Mac/TMac can be used.
? Did you add any Tmac c++ code? (common/packet.h), etc.?
? Otcl code? (tcl/lib/{ns-default.tcl, ns-lib.tcl, ns-packet.tcl})

-
 
  


Reply

Tags
ns2, smac


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Segmentation fault (core dumped)- SMAC on NS2 Emma112 Linux - Newbie 1 10-29-2017 11:23 AM
Detection of sybil attack in wireless sensor network in ns2. I need help to simulate it in ns2 Miralimk Linux - Software 1 02-22-2016 01:36 PM
Activating Sleep Cycles in SMAC disables sending data nencarnacion Linux - Newbie 0 12-06-2012 03:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 07:02 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration