104 @end itemize |
104 @end itemize |
105 |
105 |
106 Presently, global centralized IPv4 unicast routing over both |
106 Presently, global centralized IPv4 unicast routing over both |
107 point-to-point and shared (CSMA) links is supported. |
107 point-to-point and shared (CSMA) links is supported. |
108 |
108 |
|
109 By default, when using the ns-3 helper API and the default InternetStackHelper, |
|
110 global routing capability will be added to the node, and global routing |
|
111 will be inserted as a routing protocol with lower priority than the |
|
112 static routes (i.e., users can insert routes via Ipv4StaticRouting API |
|
113 and they will take precedence over routes found by global routing). |
|
114 |
109 @subsection Global Unicast Routing API |
115 @subsection Global Unicast Routing API |
110 |
116 |
111 The public API is very minimal. User scripts include the following: |
117 The public API is very minimal. User scripts include the following: |
112 @verbatim |
118 @verbatim |
113 #include "ns3/global-route-manager.h" |
119 #include "ns3/helper-module.h" |
114 @end verbatim |
120 @end verbatim |
115 |
121 |
|
122 If the default InternetStackHelper is used, then an instance of |
|
123 global routing will be aggregated to each node. |
116 After IP addresses are configured, the following function call will |
124 After IP addresses are configured, the following function call will |
117 cause all of the nodes that have an Ipv4 interface to receive |
125 cause all of the nodes that have an Ipv4 interface to receive |
118 forwarding tables entered automatically by the GlobalRouteManager: |
126 forwarding tables entered automatically by the GlobalRouteManager: |
119 @verbatim |
127 @verbatim |
120 GlobalRouteManager::PopulateRoutingTables (); |
128 Ipv4GlobalRoutingHelper::PopulateRoutingTables (); |
121 @end verbatim |
129 @end verbatim |
122 |
130 |
123 @emph{Note:} A reminder that the wifi NetDevice will work but does not |
131 @emph{Note:} A reminder that the wifi NetDevice will work but does not |
124 take any wireless effects into account. For wireless, we recommend |
132 take any wireless effects into account. For wireless, we recommend |
125 OLSR dynamic routing described below. |
133 OLSR dynamic routing described below. |
126 |
134 |
127 It is possible to call this function again in the midst of a simulation |
135 It is possible to call this function again in the midst of a simulation |
128 using the following additional public function: |
136 using the following additional public function: |
129 @verbatim |
137 @verbatim |
130 GlobalRouteManager::RecomputeRoutingTables (); |
138 Ipv4GlobalRoutingHelper::RecomputeRoutingTables (); |
131 @end verbatim |
139 @end verbatim |
132 which flushes the old tables, queries the nodes for new interface information, |
140 which flushes the old tables, queries the nodes for new interface information, |
133 and rebuilds the routes. |
141 and rebuilds the routes. |
134 |
142 |
135 For instance, this scheduling call will cause the tables to be rebuilt |
143 For instance, this scheduling call will cause the tables to be rebuilt |
136 at time 5 seconds: |
144 at time 5 seconds: |
137 @verbatim |
145 @verbatim |
138 Simulator::Schedule (Seconds (5),&GlobalRouteManager::RecomputeRoutingTables); |
146 Simulator::Schedule (Seconds (5),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables); |
139 @end verbatim |
147 @end verbatim |
140 |
148 |
141 @subsection Global Routing Implementation |
149 @subsection Global Routing Implementation |
142 |
150 |
143 This section is for those readers who care about how this is implemented. |
151 This section is for those readers who care about how this is implemented. |