merge
authorCraig Dowell <craigdo@ee.washington.edu>
Fri, 13 Jul 2007 14:37:00 -0700
changeset 1093 752cc0969180
parent 1092 a5d807363dec (current diff)
parent 1091 bda11910b22c (diff)
child 1094 6ca9a72ff445
merge
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.routing	Fri Jul 13 14:37:00 2007 -0700
@@ -0,0 +1,93 @@
+Routing overview, mid-July
+
+This is a proposal to add global static routing to ns-3
+
+The previously announced roadmap:
+* July 15: Support IPv4 static routing with PointToPoint numbered links
+* August 15: Extend IPv4 static routing to Ethernet (shared links), add static multicast forwarding over Ethernet and PointToPoint
+* Sept 15: Add static multicast forwarding over wireless interface 
+
+This would provide the first bullet above.
+
+Note:  This is orthogonal to Gustavo's OLSR code, but could also exist
+as a static routing protocol in the framework that he proposes; right now,
+this just writes directly into the existing Ipv4 routing API 
+
+1.  Code:
+
+- source code is in a routing module src/routing/
+- an example script is in examples/simple-static-routing.cc
+- StaticRouteManager is added in the run-tests unit tests
+
+2.  Approach
+
+Static routing is used to automatically populate the forwarding tables
+in a topology without running a dynamic routing protocol or asking
+the user to manually enter routes themselves.  
+
+A single object (StaticRouteManager) is responsible for populating
+the static routes on each node, using the public Ipv4 API of that node.
+It queries each node in the topology for a "staticRouter" interface.
+If found, it uses the API of that interface to obtain a "link state
+advertisement (LSA)" for the router.  Link State Advertisements
+are used in OSPF routing, and we follow their formatting.  
+
+The StaticRouteManager populates a link state database with LSAs
+gathered from the entire topology.  Then, for each router in the topology,
+the StaticRouteManager executes the OSPF shortest path first (SPF) 
+computation on the database, and populates the routing tables on each
+node.
+
+This computation is initiated during the pre-simulation phase (after
+topology and IP addressing has been done) with the following lines of code, 
+presently:
+      Ptr<StaticRouteManager> routeManager = Create<StaticRouteManager> ();
+      routeManager->BuildStaticRoutingDatabase ();
+      routeManager->InitializeRoutes ();
+
+The quagga (http://www.quagga.net) OSPF implementation was used as the
+basis for the routing computation logic.
+One benefit of following an existing OSPF SPF implementation is that
+OSPF already has defined link state advertisements for all common
+types of network links:
+- point-to-point (serial links)
+- point-to-multipoint (Frame Relay, ad hoc wireless)
+- non-broadcast multiple access (ATM)
+- broadcast (Ethernet)
+Therefore, we think that enabling these other link types will be more
+straightforward now that the underlying OSPF SPF framework is in place.
+
+Presently, we can handle IPv4 point-to-point, numbered links, and we do
+not do equal-cost multipath.
+
+3.  Bootstrapping
+
+Static routing can be enabled using a DoStaticRouting flag in the
+default value system:
+  Bind ("DoStaticRouting", "true");
+This bind tells the system to use global static routing.  It results in
+a StaticRouter interface being aggregated to the internet nodes and the
+creation of a Route Manager component to oversee the route generation.
+
+If this flag is true, when an InternetNode is created, it will aggregate
+a routing interface to it.
+  if (RoutingEnvironment::StaticRoutingEnabled())
+    {
+      Ptr<StaticRouter> staticRouter = Create<StaticRouter> (this);
+      Object::AddInterface (staticRouter);
+    }
+this flag is also tested before creating a StaticRouteManager object.
+
+4.  Some open issues
+
+- how transparent vs. explicit the enabling of static routing should be
+(e.g., if we have a higher layer Inversion-of-Control framework, do these
+static routing functions exist in some kind of Init() or Presimulate() 
+method?)
+- whether to add some kind of flag in an InternetNode that is equivalent
+to /proc/sys/net/ipv4/ip_forward , so that every InternetNode is not
+necessarily a router.
+- whether to continue to write to the existing IPv4 API or load a static
+router component into the node like Gustavo's OLSR
+- whether to make a single global forwarding table instead of distributing
+it among all the routers
--- a/examples/simple-static-routing.cc	Fri Jul 13 14:35:24 2007 -0700
+++ b/examples/simple-static-routing.cc	Fri Jul 13 14:37:00 2007 -0700
@@ -140,12 +140,12 @@
       channel2, n2, Ipv4Address("10.1.3.1"),
       n3, Ipv4Address("10.1.3.2"));
 
-  // Here, we will use the StaticRoutingManager to build routes
-  Ptr<StaticRouteManager> routeManager = Create<StaticRouteManager> ();
-  // The below functions might better be placed in some kind of
-  // Simulator::Initialization function (for further study)
-  routeManager->BuildStaticRoutingDatabase ();
-  routeManager->InitializeRoutes ();
+  if (RoutingEnvironment::StaticRoutingEnabled())
+    {
+      Ptr<StaticRouteManager> routeManager = Create<StaticRouteManager> ();
+      routeManager->BuildStaticRoutingDatabase ();
+      routeManager->InitializeRoutes ();
+    }
 
   // Create the OnOff application to send UDP datagrams of size
   // 210 bytes at a rate of 448 Kb/s