32. Topology Input Readers¶
The topology modules aim at reading a topology file generated by an automatic topology generator.
The process is divided in two steps:
running a topology generator to build a topology file
reading the topology file and build a ns-3 simulation
Hence, model is focused on being able to read correctly the various topology formats.
Currently there are three models:
ns3::OrbisTopologyReader
for Orbis 0.7 tracesns3::InetTopologyReader
for Inet 3.0 tracesns3::RocketfuelTopologyReader
for Rocketfuel traces
An helper ns3::TopologyReaderHelper
is provided to assist on trivial tasks.
In some cases it might not be simple to identify which ns-3 node corresponds to a given node in the
topology file. To simplify this task, each node created by ns3::TopologyReaderHelper
has a name.
The name format is “<TopologyReader>/NodeName/<label>” where “<TopologyReader>” is either
“InetTopology”, “OrbisTopology”, or “RocketFuelTopology”, and “<label>” is the identifier of the
node in the topology file (can be either a number or a string, depending on the file type).
Assuming that there are 10 nodes, labeled with number starting from 0, the code could be:
for (uint32_t nodeNumber = 0; nodeNumber < 10; nodeNumber++)
{
Ptr<Node> node = Names::Find<Node>("InetTopology/NodeName/" + std::to_string(nodeNumber));
if (node)
{
// Do something
}
}
A good source for topology data is also Archipelago.
The current Archipelago Measurements, monthly updated, are stored in the CAIDA website using a complete notation and triple data source, one for each working group.
A different and more compact notation reporting only the AS-relationships (a sort of more Orbis-like format) is here: as-relationships.
The compact notation can be easily stripped down to a pure Orbis format, just removing the double relationships (the compact format use one-way links, while Orbis use two-way links) and pruning the 3rd parameter. Note that with the compact data Orbis can then be used create a rescaled version of the topology, thus being the most effective way (to my best knowledge) to make an internet-like topology.
Examples can be found in the directory src/topology-read/examples/