A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
global-routing.h
Go to the documentation of this file.
1/*
2 * Copyright 2008 University of Washington
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8/**
9 * \ingroup ipv4Routing
10 * \defgroup globalrouting Global Routing.
11 *
12 * Performs pre-simulation static route computation
13 * on a layer-3 IPv4 topology.
14 *
15 * \section model Model
16 *
17 * ns-3 global routing performs pre-simulation static route computation
18 * on a layer-3 IPv4 topology. The user API from the script level is
19 * fairly minimal; once a topology has been constructed and addresses
20 * assigned, the user may call ns3::GlobalRouteManager::PopulateRoutingTables()
21 * and the simulator will initialize the routing database and set up
22 * static unicast forwarding tables for each node.
23 *
24 * The model assumes that all nodes on an ns-3 channel are reachable to
25 * one another, regardless of whether the nodes can use the channel
26 * successfully (in the case of wireless). Therefore, this model
27 * should typically be used only on wired topologies. Layer-2 bridge
28 * devices are supported. API does not yet exist to control the subset
29 * of a topology to which this global static routing is applied.
30 *
31 * If the topology changes during the simulation, by default, routing
32 * will not adjust. There are two ways to make it adjust.
33 * - Set the attribute Ipv4GlobalRouting::RespondToInterfaceEvents to true
34 * - Manually call the sequence of GlobalRouteManager methods to delete global
35 * routes, build global routing database, and initialize routes.
36 * There is a helper method that encapsulates this
37 * (Ipv4GlobalRoutingHelper::RecomputeRoutingTables())
38 *
39 * \section api API and Usage
40 *
41 * Users must include ns3/global-route-manager.h header file. After the
42 * IPv4 topology has been built and addresses assigned, users call
43 * ns3::GlobalRouteManager::PopulateRoutingTables (), prior to the
44 * ns3::Simulator::Run() call.
45 *
46 * There are two attributes of Ipv4GlobalRouting that govern behavior.
47 * - Ipv4GlobalRouting::RandomEcmpRouting
48 * - Ipv4GlobalRouting::RespondToInterfaceEvents
49 *
50 * \section impl Implementation
51 *
52 * A singleton object, ns3::GlobalRouteManager, builds a global routing
53 * database of information about the topology, and executes a Dijkstra
54 * Shortest Path First (SPF) algorithm on the topology for each node, and
55 * stores the computed routes in each node's IPv4 forwarding table by
56 * making use of the routing API in class ns3::Ipv4.
57 *
58 * The nodes that export data are those that have had an ns3::GlobalRouter
59 * object aggregated to them. The ns3::GlobalRouter can be thought of
60 * as a per-node agent that exports topology information to the
61 * ns3::GlobalRouteManager. When it comes time to build the global
62 * routing database, the list of nodes is iterated and each node with
63 * an ns3::GlobalRouter object is asked to export routing information
64 * concerning the links to which it is attached.
65 *
66 * The format of the data exported conforms to the OSPFv2 standard
67 * \RFC{2328}. In particular, the
68 * information is exported in the form of ns3::GlobalLSA objects that
69 * semantically match the Link State Advertisements of OSPF.
70 *
71 * By using a standard data format for reporting topology, existing
72 * OSPF route computation code can be reused, and that is what is done
73 * by the ns3::GlobalRouteManager. The main computation functions are
74 * ported from the quagga routing suite (https://www.nongnu.org/quagga/).
75 *
76 */