author | Pedro Silva <pmms@inesctec.pt> |
Wed, 29 Oct 2014 10:12:53 -0700 | |
changeset 11040 | cd2eda848730 |
parent 10158 | 971f362648c3 |
permissions | -rw-r--r-- |
3262 | 1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright 2008 University of Washington |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License version 2 as |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
*/ |
|
19 |
||
20 |
/** |
|
7233
be0d7443b4ff
Updated the modules doxygen page
Mitch Watrous <watrous@u.washington.edu>
parents:
7176
diff
changeset
|
21 |
* \ingroup internet |
3262 | 22 |
* \defgroup globalrouting Global Routing |
23 |
* |
|
24 |
* \section model Model |
|
25 |
* |
|
26 |
* ns-3 global routing performs pre-simulation static route computation |
|
27 |
* on a layer-3 Ipv4 topology. The user API from the script level is |
|
28 |
* fairly minimal; once a topology has been constructed and addresses |
|
29 |
* assigned, the user may call ns3::GlobalRouteManager::PopulateRoutingTables() |
|
30 |
* and the simulator will initialize the routing database and set up |
|
31 |
* static unicast forwarding tables for each node. |
|
32 |
* |
|
33 |
* The model assumes that all nodes on an ns-3 channel are reachable to |
|
34 |
* one another, regardless of whether the nodes can use the channel |
|
35 |
* successfully (in the case of wireless). Therefore, this model |
|
6317
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
36 |
* should typically be used only on wired topologies. Layer-2 bridge |
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
37 |
* devices are supported. API does not yet exist to control the subset |
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
38 |
* of a topology to which this global static routing is applied. |
3262 | 39 |
* |
6317
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
40 |
* If the topology changes during the simulation, by default, routing |
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
41 |
* will not adjust. There are two ways to make it adjust. |
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
42 |
* - Set the attribute Ipv4GlobalRouting::RespondToInterfaceEvents to true |
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
43 |
* - Manually call the sequence of GlobalRouteManager methods to delte global |
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
44 |
* routes, build global routing database, and initialize routes. |
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
45 |
* There is a helper method that encapsulates this |
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
46 |
* (Ipv4GlobalRoutingHelper::RecomputeRoutingTables()) |
3262 | 47 |
* |
48 |
* \section api API and Usage |
|
49 |
* |
|
50 |
* Users must include ns3/global-route-manager.h header file. After the |
|
51 |
* IPv4 topology has been built and addresses assigned, users call |
|
52 |
* ns3::GlobalRouteManager::PopulateRoutingTables (), prior to the |
|
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
53 |
* ns3::Simulator::Run() call. |
6317
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
54 |
* |
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
55 |
* There are two attributes of Ipv4GlobalRouting that govern behavior. |
e4a750adf12c
bug 702: make global routing robust to link/device events
Tom Henderson <tomh@tomh.org>
parents:
3262
diff
changeset
|
56 |
* - Ipv4GlobalRouting::RandomEcmpRouting |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
57 |
* - Ipv4GlobalRouting::RespondToInterfaceEvents |
3262 | 58 |
* |
59 |
* \section impl Implementation |
|
60 |
* |
|
61 |
* A singleton object, ns3::GlobalRouteManager, builds a global routing |
|
62 |
* database of information about the topology, and executes a Dijkstra |
|
63 |
* Shortest Path First (SPF) algorithm on the topology for each node, and |
|
64 |
* stores the computed routes in each node's IPv4 forwarding table by |
|
65 |
* making use of the routing API in class ns3::Ipv4. |
|
66 |
* |
|
67 |
* The nodes that export data are those that have had an ns3::GlobalRouter |
|
68 |
* object aggregated to them. The ns3::GlobalRouter can be thought of |
|
69 |
* as a per-node agent that exports topology information to the |
|
70 |
* ns3::GlobalRouteManager. When it comes time to build the global |
|
71 |
* routing database, the list of nodes is iterated and each node with |
|
72 |
* an ns3::GlobalRouter object is asked to export routing information |
|
73 |
* concerning the links to which it is attached. |
|
74 |
* |
|
75 |
* The format of the data exported conforms to the OSPFv2 standard |
|
10158
971f362648c3
Link to RFC num with \RFC{num}
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7233
diff
changeset
|
76 |
* \RFC{2328}. In particular, the |
3262 | 77 |
* information is exported in the form of ns3::GlobalLSA objects that |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
78 |
* semantically match the Link State Advertisements of OSPF. |
3262 | 79 |
* |
80 |
* By using a standard data format for reporting topology, existing |
|
81 |
* OSPF route computation code can be reused, and that is what is done |
|
82 |
* by the ns3::GlobalRouteManager. The main computation functions are |
|
83 |
* ported from the quagga routing suite (http://www.quagga.net). |
|
84 |
* |
|
85 |
*/ |