ns3 code to establish connection among nodes

1,322 views
Skip to first unread message

Sabitha K

unread,
Apr 10, 2017, 3:25:44 AM4/10/17
to ns-3-users
point to point creates a connection between two nodes. can you suggest me a function in ns3 which would develop a connection among three or four nodes.

Konstantinos

unread,
Apr 10, 2017, 4:51:48 AM4/10/17
to ns-3-users
Hi,

Point-to-point is a wired link among two nodes; hence the name point to point. 
There are other wired or wireless NetDevices that create multiple access networks.

Regards,
K

Sabitha K

unread,
Apr 10, 2017, 5:02:24 AM4/10/17
to ns-3-users


thanks you so much. i need the function name which can create link among nodes like point to point. please suggest that

Konstantinos

unread,
Apr 10, 2017, 5:09:53 AM4/10/17
to ns-3-users
What type of network do you want to create? How does it look like? Just having 3 nodes instead of 2 isn't much of help.
If you study the tutorial or experiment with the examples you can find different ways to implement that.
It's what system you want to evaluate. For example, you can do it even with a p2p link, creating 3 such links among your 3 nodes, or 2 p2p links. 

Sabitha K

unread,
Apr 10, 2017, 5:10:26 AM4/10/17
to ns-3-users

Sabitha K

unread,
Apr 10, 2017, 5:18:01 AM4/10/17
to ns-3-users


i want to create 5 nodes. one node connected to second, second to third, third to fourth, fourth to fifth. i tried point to point. but while passing packet it's been overlapping. i need a link similar to point to point to connect these nodes in a manner i mentioned above.. i'm totally new to ns3...

Konstantinos

unread,
Apr 10, 2017, 5:31:13 AM4/10/17
to ns-3-users
What you described, can be implemented with 4 p2p links. 
Node_1 --- p2p --- Node_2 --- p2p --- Node_3 .... (and so forth).

Then configure the networks (sub-nets). Each p2p link should be an independent sub-net.
Finally, you need to setup the routing. 

I don't understand what you mean that the packets get overlapped. 

Sabitha K

unread,
Apr 10, 2017, 5:54:14 AM4/10/17
to ns-3-users


i have attached my document and also the terminal which shown the output. can you please help me to fix that issue
Screenshot from 2017-04-10 15-20-14.png
trial.cc

Konstantinos

unread,
Apr 10, 2017, 6:30:57 AM4/10/17
to ns-3-users
Please follow the posting guidelines:
https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting

The compiler gives you a hint what is the problem, search the list and documentation and you can solve it. 

A comment on your code... what you have created DOES not do what you explained in the previous post.
There are several logical errors in your code, so I would suggest to study the tutorials once more.
You only need to create 5 nodes. You are creating 6.
And then you create p2p links just by copying/paste the complete block of code, without understanding what you are doing.
Reply all
Reply to author
Forward
0 new messages