implementing grid topology

44 views
Skip to first unread message

Atul Chavan

unread,
Feb 17, 2015, 11:51:26 PM2/17/15
to ns-3-...@googlegroups.com

Note :
Before you update your responses let me clarify you few things..

i went through point-to-point-grid helper ...
went through point-to-point-grid.cc..
as well as tutorials.....
but here as a beginner i dont want to use any ready made classes though it would make my job easy..
simple approach i am looking for...

responses apart to those ready made classes would be appreciated.

As its obvious " Community Will Never Work For you It Will Just Help You" here at my level i wrote few lines.

Please have a look over my attachment !

Code description :

i simply created 16 nodes so they will be getting arranged like 4 by 4 matrix.
& simply assigned x,y coordinates  & showing them using NetAnim.

i did not install yet any application neither assigned them addresses to each of the node.

My questions :

1] how will you manipulate my code to form a grid topology ?
2] how will you establish point to point link in between them ?
3] how will you assign addresses to each of those nodes?


This might be just 15th time i'm sitting for writing few ns3 basic codes ( with C++ knowledge ) so please be simple & be descriptive !

Thank you !!
try.cc

Tommaso Pecorella

unread,
Feb 18, 2015, 2:59:23 AM2/18/15
to ns-3-...@googlegroups.com
Hi,

first and foremost, thanks for the message. Finally I see a proper request, stating where you start from and where you want to go.
Second, I'd suggest to not avoid the "pre-made" classes altogether, otherwise you'll end up re-writing everything. The whole ns-3 is a collection of pre-made classes after all.

About your code, I'd not use AnimationInterface::SetConstantPosition. It will work for NetAnim, but it doesn't install a proper mobility helper in the node. This is not an issue for wired topologies, but it is important for wireless ones.
Use SetPositionAllocator and use one of the available allocators. You can use the GridPositionAllocator or the ListPositionAllocator (if your nodes are not on a regular grid, as in your case).

I assume in the following you want to use PointToPoint NetDevices.
After that you have to group the nodes in couples and place the couple in a NodeContainer. You pass the NodeContainer to the PointToPointHelper and it will install a network between the two nodes.
Since you're at it and since the previous operation gave you the newly created devices in a NetDeviceContainer, you may want to just install the proper Internet addresses on them. However, you should have installed the internet stack in the nodes before.
In order to avoid headaches (you can't install Internet on a node twice), do it just after the nodes creation, it's ok.

After all this you should have a grid topology. However there are still one thing: you have to decide (and install) the routing (before installing the Internet on the nodes).
After the routing is set, you'll have a fully functional grid topology.

Hope this helps,

Atul Chavan

unread,
Feb 18, 2015, 2:18:31 PM2/18/15
to ns-3-...@googlegroups.com
Ha ha ha lolzz....

Tommasso credit goes to you infact...

before i post here i explored your profile & followed just your one post which talks about "how a certain post can be sensible " :-D

anyways thank you !

and yeah special thanks for descriptive reply....many things yet to be learn will keep disturbing you !
Reply all
Reply to author
Forward
0 new messages