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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 */
18
19/**
20 * \ingroup ipv4Routing
21 * \defgroup globalrouting Global Routing.
22 *
23 * Performs pre-simulation static route computation
24 * on a layer-3 IPv4 topology.
25 *
26 * \section model Model
27 *
28 * ns-3 global routing performs pre-simulation static route computation
29 * on a layer-3 IPv4 topology. The user API from the script level is
30 * fairly minimal; once a topology has been constructed and addresses
31 * assigned, the user may call ns3::GlobalRouteManager::PopulateRoutingTables()
32 * and the simulator will initialize the routing database and set up
33 * static unicast forwarding tables for each node.
34 *
35 * The model assumes that all nodes on an ns-3 channel are reachable to
36 * one another, regardless of whether the nodes can use the channel
37 * successfully (in the case of wireless). Therefore, this model
38 * should typically be used only on wired topologies. Layer-2 bridge
39 * devices are supported. API does not yet exist to control the subset
40 * of a topology to which this global static routing is applied.
41 *
42 * If the topology changes during the simulation, by default, routing
43 * will not adjust. There are two ways to make it adjust.
44 * - Set the attribute Ipv4GlobalRouting::RespondToInterfaceEvents to true
45 * - Manually call the sequence of GlobalRouteManager methods to delete global
46 * routes, build global routing database, and initialize routes.
47 * There is a helper method that encapsulates this
48 * (Ipv4GlobalRoutingHelper::RecomputeRoutingTables())
49 *
50 * \section api API and Usage
51 *
52 * Users must include ns3/global-route-manager.h header file. After the
53 * IPv4 topology has been built and addresses assigned, users call
54 * ns3::GlobalRouteManager::PopulateRoutingTables (), prior to the
55 * ns3::Simulator::Run() call.
56 *
57 * There are two attributes of Ipv4GlobalRouting that govern behavior.
58 * - Ipv4GlobalRouting::RandomEcmpRouting
59 * - Ipv4GlobalRouting::RespondToInterfaceEvents
60 *
61 * \section impl Implementation
62 *
63 * A singleton object, ns3::GlobalRouteManager, builds a global routing
64 * database of information about the topology, and executes a Dijkstra
65 * Shortest Path First (SPF) algorithm on the topology for each node, and
66 * stores the computed routes in each node's IPv4 forwarding table by
67 * making use of the routing API in class ns3::Ipv4.
68 *
69 * The nodes that export data are those that have had an ns3::GlobalRouter
70 * object aggregated to them. The ns3::GlobalRouter can be thought of
71 * as a per-node agent that exports topology information to the
72 * ns3::GlobalRouteManager. When it comes time to build the global
73 * routing database, the list of nodes is iterated and each node with
74 * an ns3::GlobalRouter object is asked to export routing information
75 * concerning the links to which it is attached.
76 *
77 * The format of the data exported conforms to the OSPFv2 standard
78 * \RFC{2328}. In particular, the
79 * information is exported in the form of ns3::GlobalLSA objects that
80 * semantically match the Link State Advertisements of OSPF.
81 *
82 * By using a standard data format for reporting topology, existing
83 * OSPF route computation code can be reused, and that is what is done
84 * by the ns3::GlobalRouteManager. The main computation functions are
85 * ported from the quagga routing suite (https://www.nongnu.org/quagga/).
86 *
87 */