Topology
[Official Mobility Introduction]
Official page, I think it helpless for a newbie in ns3.
There are two modules inside.
- PositionAllocator
- This is for still.
- MobilityHelper
- This is for moving.
Your scenario must exist the Node, Mobility and NetDevice.
Below is something necessary in a topology.
Node
Most of time I use NodeContainer to manipulate the nodes.
Create 30 nodes and do nothing.
NodeContainer nodes; nodes.Create (30);
The nodes without position assignment will be gray in pyviz.
- Get the 5th node.
nodes.Get (4);
- Get the nodes number of NodeContainer
nodes.GetN ();
- Add another node to the NodeContainer
Ptr<Node> another_node; nodes.Add (another_node);
Mobility
The space coordinate of NS3 is x, y, and z axis. Unit is meter and variable type is double.
Most of time I use MobiliityHelper and distinct PositionAllocator to help me place the node in the right place. but not all of the node needs a specific position to perch, Like in LTE, PDN Gateway, the example code from official didn't give it a position.
For mobility, I use position allocator and mobility helper to decide nodes where and how to move.