00001 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * Copyright 2008 University of Washington 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation; 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 */ 00019 00020 /** 00021 * \ingroup routing 00022 * \defgroup globalrouting Global Routing 00023 * 00024 * \section model Model 00025 * 00026 * ns-3 global routing performs pre-simulation static route computation 00027 * on a layer-3 Ipv4 topology. The user API from the script level is 00028 * fairly minimal; once a topology has been constructed and addresses 00029 * assigned, the user may call ns3::GlobalRouteManager::PopulateRoutingTables() 00030 * and the simulator will initialize the routing database and set up 00031 * static unicast forwarding tables for each node. 00032 * 00033 * The model assumes that all nodes on an ns-3 channel are reachable to 00034 * one another, regardless of whether the nodes can use the channel 00035 * successfully (in the case of wireless). Therefore, this model 00036 * should typically be used only on wired topologies. API does not 00037 * yet exist to control the subset of a topology to which this global 00038 * static routing is applied. 00039 * 00040 * This model also does not yet deal with the possible presence of 00041 * layer-2 relays such as switches, bridges, and hubs, although ns-3 does 00042 * not have such devices yet. 00043 * 00044 * \section api API and Usage 00045 * 00046 * Users must include ns3/global-route-manager.h header file. After the 00047 * IPv4 topology has been built and addresses assigned, users call 00048 * ns3::GlobalRouteManager::PopulateRoutingTables (), prior to the 00049 * ns3::Simulator::Run() call. There are no other attributes or 00050 * public methods that are typically called, or ways to parameterize 00051 * the behavior. 00052 * 00053 * \section impl Implementation 00054 * 00055 * A singleton object, ns3::GlobalRouteManager, builds a global routing 00056 * database of information about the topology, and executes a Dijkstra 00057 * Shortest Path First (SPF) algorithm on the topology for each node, and 00058 * stores the computed routes in each node's IPv4 forwarding table by 00059 * making use of the routing API in class ns3::Ipv4. 00060 * 00061 * The nodes that export data are those that have had an ns3::GlobalRouter 00062 * object aggregated to them. The ns3::GlobalRouter can be thought of 00063 * as a per-node agent that exports topology information to the 00064 * ns3::GlobalRouteManager. When it comes time to build the global 00065 * routing database, the list of nodes is iterated and each node with 00066 * an ns3::GlobalRouter object is asked to export routing information 00067 * concerning the links to which it is attached. 00068 * 00069 * The format of the data exported conforms to the OSPFv2 standard 00070 * (http://www.ietf.org/rfc/rfc2328.txt). In particular, the 00071 * information is exported in the form of ns3::GlobalLSA objects that 00072 * semantically match the Link State Advertisements of OSPF. 00073 * 00074 * By using a standard data format for reporting topology, existing 00075 * OSPF route computation code can be reused, and that is what is done 00076 * by the ns3::GlobalRouteManager. The main computation functions are 00077 * ported from the quagga routing suite (http://www.quagga.net). 00078 * 00079 */