XINDI LI
XINDI LI

Reputation: 675

Does ns3 support 3d topology?

I'm using ns3 to simulate a wireless data center. I started it with 2d topology using "GridPositionAllocator".

    MobilityHelper mobility;
    mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
    "MinX", DoubleValue (0.0),
    "MinY", DoubleValue (0.0),
    "DeltaX", DoubleValue (1.0),
    "DeltaY", DoubleValue (1.0),
    "GridWidth", UintegerValue (8),
    "LayoutType", StringValue ("ColumnFirst"));
    mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
    mobility.Install (wifiNodes);

How could I change it to 3d to place several servers in a rack?

Upvotes: 0

Views: 302

Answers (3)

Sailesh Sridhar
Sailesh Sridhar

Reputation: 29

Yes, but adding a 3d topology with grid position allocator is not possible. You could use a ListPostionAllocator to manually specify the positions of all the nodes.

You could use the following:

Ptr<ListPostionAllocator> lp =CreateObject<ListPostionAllocator>();
//Adding locations of 2 nodes 
lp->ADD(Vector (10.0,10.0,10.0);
lp->ADD(Vector (20.0,20.0,20.0);  //Add locations of all the nodes 
mobHelper.SetpostionAllocator(lp);

Upvotes: 0

Konstantinos
Konstantinos

Reputation: 556

In principle, ns-3 does support 3D mobility since the mobility vectors are 3D (X, Y, Z), however there is no 'PositionAllocator' implemented for that. Contributions are welcome.

A simple solution is to extend this GridPositionAllocator which assumes Z=0 and add the 3rd dimension with corresponding MinZ, DeltaZ.

Upvotes: 0

Related Questions