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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
04-19-2017, 09:06 AM
|
#1
|
LQ Newbie
Registered: Apr 2017
Posts: 2
Rep: 
|
find neighbors list in wireless senror network with ns2 simulator
hi everyone,i'm working on mac protocol for wsn, and i have to modify the smac protocol which exists already in ns2, i have two problems:
1)how to find the neighboring list of 2 hops.
2)how to work with the fonctions in ns2, are they defined in the ns2 library or we have to define every fonction? like in the exemple below:
class MAC {
void send (Packet* p);
void recv(Packet*, Handler* h);
NsObject* target_
what packet and handler are??
plzz help me its really urgent.
thank you
|
|
|
04-19-2017, 09:13 AM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,780
|
Quote:
Originally Posted by asmab
hi everyone,i'm working on mac protocol for wsn, and i have to modify the smac protocol which exists already in ns2, i have two problems:
1)how to find the neighboring list of 2 hops.
2)how to work with the fonctions in ns2, are they defined in the ns2 library or we have to define every fonction? like in the exemple below:
class MAC {
void send (Packet* p);
void recv(Packet*, Handler* h);
NsObject* target_
what packet and handler are??
plzz help me its really urgent.
thank you
|
Read the LQ Rules and the "Question Guidelines". Do not use text-speak, and bear in mind that everyone here is a volunteer, so asking for/expecting 'urgent' help is fairly rude...especially with your homework.
You've posted a few lines of a script, but not told us where you got it, or what you've done/tried on your own to do your assignment. Can you show us your code, and tell us where you're stuck??
|
|
|
04-19-2017, 09:52 AM
|
#3
|
LQ Newbie
Registered: Apr 2017
Posts: 2
Original Poster
Rep: 
|
i got these lines from a pdf that learns ns2 but it was not halpful.
these are some lines of what i did by myself but it doesnt work
#include <iostream>
#include <string>
#include<queue>
using namespace std;
const int maxqueue = 7;
struct queuetype
{
string name[maxqueue];
int priority;
int t_max;
int t_used;
};
struct datatype
{
int trafic_type;
int addrsrc;
int addrdst;
int duation;
};
int main()
{
queuetype<datatype> RT ;
queuetype<datatype> NRT1 ;
queuetype<datatype> NRT2 ;
}
|
|
|
04-19-2017, 10:41 AM
|
#4
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,780
|
Quote:
Originally Posted by asmab
i got these lines from a pdf that learns ns2 but it was not halpful. these are some lines of what i did by myself but it doesnt work
Code:
#include <iostream>
#include <string>
#include<queue>
using namespace std;
const int maxqueue = 7;
struct queuetype
{
string name[maxqueue];
int priority;
int t_max;
int t_used;
};
struct datatype
{
int trafic_type;
int addrsrc;
int addrdst;
int duation;
};
int main()
{
queuetype<datatype> RT ;
queuetype<datatype> NRT1 ;
queuetype<datatype> NRT2 ;
}
|
Please put code into CODE tags, and again, posting a VERY small piece of code and only saying "it was not halpful", tells us nothing. Where did you get the PDF? The code? What do you not understand about the documentation/code???? Which line(s) above are what you did yourself, and if you did modify the code in some way, why did you do it if you didn't understand what you were doing?
We can try to help, but again, we need DETAILS before we can do it.
|
|
|
04-22-2017, 03:55 PM
|
#5
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,520
|
Last edited by knudfl; 04-22-2017 at 04:00 PM.
|
|
|
All times are GMT -5. The time now is 03:26 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|