.. include:: replace.txt

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 traces
* ``ns3::InetTopologyReader`` for Inet_ 3.0 traces
* ``ns3::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 |ns3| 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/``

.. _Orbis: https://web.archive.org/web/20181102004219/http://sysnet.ucsd.edu/~pmahadevan/topo_research/topo.html
.. _Inet: https://web.archive.org/web/20210308100536/http://topology.eecs.umich.edu/inet/
.. _RocketFuel: http://www.cs.washington.edu/research/networking/rocketfuel/
.. _Archipelago: http://www.caida.org/projects/ark/
.. _Measurements: http://data.caida.org/datasets/topology/ipv4.allpref24-aslinks/
.. _as-relationships: http://www.caida.org/data/active/as-relationships/index.xml

