LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-11-2017, 01:15 PM   #1
lemowa
LQ Newbie
 
Registered: Sep 2017
Posts: 16

Rep: Reputation: Disabled
Installation BMAC on NS2


Hi,i need your help please ,i'm working on BMAC protocol
I tried add new mac protocol B-MAC from this source but when i try in ns-2.34 it still does not work
https://code.google.com/archive/p/wsn-bmac/

I tried to follow the instructions of this link but still error
http://itantenna.blogspot.co.id/2013...ol-in-ns2.html
.Thank you
 
Old 09-11-2017, 02:43 PM   #2
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 lemowa View Post
Hi,i need your help please ,i'm working on BMAC protocol
I tried add new mac protocol B-MAC from this source but when i try in ns-2.34 it still does not work
https://code.google.com/archive/p/wsn-bmac/

I tried to follow the instructions of this link but still error
http://itantenna.blogspot.co.id/2013...ol-in-ns2.html
.Thank you
And since you don't actually tell us what error(s)/message(s) you're getting, what version/distro of Linux you're using, or provide ANY useful details, there is nothing we can tell you.

Read the "Question Guidelines" link in my posting signature.
 
2 members found this post helpful.
Old 09-11-2017, 10:30 PM   #3
lemowa
LQ Newbie
 
Registered: Sep 2017
Posts: 16

Original Poster
Rep: Reputation: Disabled
Eror when create bmac.o

Error obtained when ns2 create a b-mac.o file. I try in Ubuntu 12.04 with ns-2.34
Attached Thumbnails
Click image for larger version

Name:	Screenshot (8).jpg
Views:	19
Size:	151.5 KB
ID:	25851   Click image for larger version

Name:	Screenshot (9).jpg
Views:	10
Size:	151.0 KB
ID:	25852  
 
Old 09-12-2017, 07:45 AM   #4
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 lemowa View Post
Error obtained when ns2 create a b-mac.o file. I try in Ubuntu 12.04 with ns-2.34
Post the error messages, please...those screen shots are hard/impossible to read. And both Ubuntu 12.04 and NS2 are VERY old....
 
1 members found this post helpful.
Old 09-14-2017, 09:47 AM   #5
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
@lemowa : Welcome to LQ.

The file ``bmac.h´´ is incomplete.
Missing parts can be copied from smac.h to bmac.h, line 310 ...
Code:
// -----------------------------------------------------
// Used by bmac when in sync mode
struct SchedTable { 
  int txSync;  // flag indicating need to send sync 
  int txData;  // flag indicating need to send data 
  int numPeriods; // count for number of periods 
#ifdef JOURNAL_PAPER
  int numNodes;  // number of nodes on this schedule
  int syncNode;  // the node who initialized this schedule
  int chkSched; // flag indicating need to check numNodes
#endif
};

struct NeighbList { 
  int nodeId; 
  int schedId;
#ifdef JOURNAL_PAPER
  int active; //flag indicating the node is active recently
  int state; // flag indicating the node has changed schedule
#endif 
};

// ------------------------------------------------------
The new bmac.h https://www.dropbox.com/s/yw1pfsdvgyisgdj/bmac.h?dl=0

The complete changes : bmac_ns235.patch
The BMAC example ns-2.35/2-wireless-demo-csci694-bmac.tcl is included in the patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
and https://www.dropbox.com/s/fvaro80fqh...235.patch?dl=0

Build example ...
Code:
tar xvf ns-allinone-2.35_gcc5.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
cd ns-allinone-2.35/
patch -p0 < bmac_ns235.patch
./install
cd ns-2.35/
cp ns ns235-bmac
sudo cp ns235-bmac /usr/local/bin/

-------------- Simulation ---------------
ns235-bmac 2-wireless-demo-csci694-bmac.tcl

Last edited by knudfl; 09-14-2017 at 11:51 AM.
 
1 members found this post helpful.
Old 09-18-2017, 02:00 PM   #6
lemowa
LQ Newbie
 
Registered: Sep 2017
Posts: 16

Original Poster
Rep: Reputation: Disabled
Difference Smac and Bmac

Quote:
Originally Posted by knudfl View Post
@lemowa : Welcome to LQ.

The file ``bmac.h´´ is incomplete.
Missing parts can be copied from smac.h to bmac.h, line 310 ...
Code:
// -----------------------------------------------------
// Used by bmac when in sync mode
struct SchedTable { 
  int txSync;  // flag indicating need to send sync 
  int txData;  // flag indicating need to send data 
  int numPeriods; // count for number of periods 
#ifdef JOURNAL_PAPER
  int numNodes;  // number of nodes on this schedule
  int syncNode;  // the node who initialized this schedule
  int chkSched; // flag indicating need to check numNodes
#endif
};

struct NeighbList { 
  int nodeId; 
  int schedId;
#ifdef JOURNAL_PAPER
  int active; //flag indicating the node is active recently
  int state; // flag indicating the node has changed schedule
#endif 
};

// ------------------------------------------------------
The new bmac.h https://www.dropbox.com/s/yw1pfsdvgyisgdj/bmac.h?dl=0

The complete changes : bmac_ns235.patch
The BMAC example ns-2.35/2-wireless-demo-csci694-bmac.tcl is included in the patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
and https://www.dropbox.com/s/fvaro80fqh...235.patch?dl=0

Build example ...
Code:
tar xvf ns-allinone-2.35_gcc5.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
cd ns-allinone-2.35/
patch -p0 < bmac_ns235.patch
./install
cd ns-2.35/
cp ns ns235-bmac
sudo cp ns235-bmac /usr/local/bin/

-------------- Simulation ---------------
ns235-bmac 2-wireless-demo-csci694-bmac.tcl
Thanks knudfl patch already works well, but what makes the difference between smac and bmac if bmac.h copied from smac.h?
 
Old 09-18-2017, 05:10 PM   #7
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 #6.

smac.h is different from bmac.h ,
and smac.cc is different from bmac.cc

C++ files are text files. Please read the files.
And you can run the 'diff' command to know the differences :
Code:
diff -dbBwaur smac.h bmac.h

diff -dbBwaur smac.cc bmac.cc
... The thing is that some of the definitions are general.
Hence the re-use of the `SchedTable´ and `NeighbList´ definitions.


P.S. : Please do not quote entire posts. A "one word reference" will do.

-
 
1 members found this post helpful.
Old 09-18-2017, 11:12 PM   #8
lemowa
LQ Newbie
 
Registered: Sep 2017
Posts: 16

Original Poster
Rep: Reputation: Disabled
EnergyModel

@knudfl i think it's same, because when i run simulation for search energy with same scenario the result it's same for smac and bmac
 
Old 09-19-2017, 05:34 AM   #9
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 #8.

The `Energy model´ simulation examples : EnergyModel-examples.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing

All ~2500 examples https://drive.google.com/drive/folde...Ws?usp=sharing
 
Old 10-17-2017, 10:54 AM   #10
lemowa
LQ Newbie
 
Registered: Sep 2017
Posts: 16

Original Poster
Rep: Reputation: Disabled
Another Protocol MAC For NS2

is there any other mac protocol for ns2? like X-MAC and C-MAC?
Thanks
 
Old 10-17-2017, 02:30 PM   #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 #10, Mac protocols.

List of "Mac" in my archive : The list is attached → mac.txt
Attached Files
File Type: txt mac.txt (266 Bytes, 22 views)

Last edited by knudfl; 10-17-2017 at 02:33 PM.
 
1 members found this post helpful.
Old 10-17-2017, 09:25 PM   #12
lemowa
LQ Newbie
 
Registered: Sep 2017
Posts: 16

Original Poster
Rep: Reputation: Disabled
MAC

Quote:
Originally Posted by knudfl View Post
Re #10, Mac protocols.

List of "Mac" in my archive : The list is attached → mac.txt
Can i have for RIMAC and Wisemac patches?
Please
 
Old 10-18-2017, 01:49 AM   #13
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.

RIMAC-0.0.2_ns229.patch :
https://drive.google.com/file/d/0B7S...ew?usp=sharing
Links and comments : Please see the attached _rimac__tmac.txt

Wisemac http://ethesis.nitrkl.ac.in/5634/1/E-67.pdf
... Sorry, that's all I have for Wisemac.
-
Attached Files
File Type: txt _rimac__tmac.txt (956 Bytes, 10 views)

Last edited by knudfl; 10-18-2017 at 01:51 AM.
 
1 members found this post helpful.
Old 10-18-2017, 07:02 AM   #14
lemowa
LQ Newbie
 
Registered: Sep 2017
Posts: 16

Original Poster
Rep: Reputation: Disabled
Rimac

it's still no patch RIMAC for NS2.35?, because it's hard for install ns2.29
but thanks knudfl i will try it
 
Old 10-18-2017, 09:12 AM   #15
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 #14.

Ubuntu, e.g. 12.04 - amd64 :
ns-allinone-2.29.3.tar.gz → The "5 minutes" build →

compat-gcc34-3.4.6-ubuntu1204-1_amd64.deb (Ubuntu 12* ... 17.04 - 64)
https://drive.google.com/file/d/0B7S...ew?usp=sharing
compat-gcc-34-c++_3.4.6-20_amd64.deb ( All 64bit Ubuntu versions )
https://drive.google.com/file/d/0B7S...ew?usp=sharing

Download, and install the compilers :
Code:
sudo gdebi compat-gcc34-3.4.6-ubuntu1204-1_amd64.deb
sudo gdebi compat-gcc-34-c++_3.4.6-20_amd64.deb
The build
Code:
tar xvf ns-allinone-2.29.3.tar.gz
cd ns-allinone-2.29/
patch -p0 < RIMAC-0.0.2_ns229.patch

export CC=gcc34 CXX=g++34
./install
cd ns-2.29/
cp ns ns-rimac
sudo cp ns-rimac /usr/local/bin/

Last edited by knudfl; 10-18-2017 at 09:14 AM.
 
1 members found this post helpful.
  


Reply

Tags
bmac, ns2



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
ns2 installation jaff Linux - Newbie 2 09-09-2012 08:48 AM
Need help regarding NS2.28 installation ketandas LinuxQuestions.org Member Intro 0 02-21-2012 01:50 PM
ns2.29.3 installation on fedora 15 , nam installation problem Narges Linux - Networking 5 10-31-2011 11:09 AM
NS2 installation ds_priyaa Fedora 2 05-28-2008 02:23 AM
ns2 installation pranoti Linux - Software 2 06-11-2007 12:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:13 PM.

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