author | Wilson Thong <wilsonwk@ee.cityu.edu.hk> |
Tue, 15 Dec 2009 21:52:50 -0800 | |
changeset 5858 | afb51c7f34c2 |
parent 4745 | a0e27af57c8d |
child 5935 | f89e4d1715b1 |
permissions | -rw-r--r-- |
1111 | 1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
1457
562a7017ed93
Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents:
1316
diff
changeset
|
3 |
* Copyright 2007 University of Washington |
562a7017ed93
Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents:
1316
diff
changeset
|
4 |
* |
1111 | 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 |
|
1457
562a7017ed93
Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents:
1316
diff
changeset
|
17 |
* |
562a7017ed93
Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents:
1316
diff
changeset
|
18 |
* Authors: Craig Dowell (craigdo@ee.washington.edu) |
562a7017ed93
Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents:
1316
diff
changeset
|
19 |
* Tom Henderson (tomhend@u.washington.edu) |
1111 | 20 |
*/ |
1112 | 21 |
|
1111 | 22 |
#ifndef GLOBAL_ROUTE_MANAGER_IMPL_H |
23 |
#define GLOBAL_ROUTE_MANAGER_IMPL_H |
|
24 |
||
25 |
#include <stdint.h> |
|
26 |
#include <list> |
|
27 |
#include <queue> |
|
28 |
#include <map> |
|
4745
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
29 |
#include <vector> |
1111 | 30 |
#include "ns3/object.h" |
31 |
#include "ns3/ptr.h" |
|
32 |
#include "ns3/ipv4-address.h" |
|
33 |
#include "global-router-interface.h" |
|
34 |
||
35 |
namespace ns3 { |
|
36 |
||
37 |
const uint32_t SPF_INFINITY = 0xffffffff; |
|
38 |
||
39 |
class CandidateQueue; |
|
3959
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
40 |
class Ipv4GlobalRouting; |
1111 | 41 |
|
42 |
/** |
|
43 |
* @brief Vertex used in shortest path first (SPF) computations. See RFC 2328, |
|
44 |
* Section 16. |
|
45 |
* |
|
46 |
* Each router in the simulation is associated with an SPFVertex object. When |
|
47 |
* calculating routes, each of these routers is, in turn, chosen as the "root" |
|
48 |
* of the calculation and routes to all of the other routers are eventually |
|
49 |
* saved in the routing tables of each of the chosen nodes. Each of these |
|
50 |
* routers in the calculation has an associated SPFVertex. |
|
51 |
* |
|
52 |
* The "Root" vertex is the SPFVertex representing the router that is having |
|
53 |
* its routing tables set. The SPFVertex objects representing other routers |
|
54 |
* or networks in the simulation are arranged in the SPF tree. It is this |
|
55 |
* tree that represents the Shortest Paths to the other networks. |
|
56 |
* |
|
57 |
* Each SPFVertex has a pointer to the Global Router Link State Advertisement |
|
58 |
* (LSA) that its underlying router has exported. Within these LSAs are |
|
59 |
* Global Router Link Records that describe the point to point links from the |
|
60 |
* underlying router to other nodes (represented by other SPFVertex objects) |
|
61 |
* in the simulation topology. The combination of the arrangement of the |
|
62 |
* SPFVertex objects in the SPF tree, along with the details of the link |
|
63 |
* records that connect them provide the information required to construct the |
|
64 |
* required routes. |
|
65 |
*/ |
|
66 |
class SPFVertex |
|
67 |
{ |
|
68 |
public: |
|
69 |
/** |
|
70 |
* @brief Enumeration of the possible types of SPFVertex objects. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
71 |
* @internal |
1111 | 72 |
* |
73 |
* Currently we use VertexRouter to identify objects that represent a router |
|
74 |
* in the simulation topology, and VertexNetwork to identify objects that |
|
75 |
* represent a network. |
|
76 |
*/ |
|
77 |
enum VertexType { |
|
78 |
VertexUnknown = 0, /**< Uninitialized Link Record */ |
|
79 |
VertexRouter, /**< Vertex representing a router in the topology */ |
|
80 |
VertexNetwork /**< Vertex representing a network in the topology */ |
|
81 |
}; |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
82 |
|
1111 | 83 |
/** |
84 |
* @brief Construct an empty ("uninitialized") SPFVertex (Shortest Path First |
|
85 |
* Vertex). |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
86 |
* @internal |
1111 | 87 |
* |
88 |
* The Vertex Type is set to VertexUnknown, the Vertex ID is set to |
|
89 |
* 255.255.255.255, and the distance from root is set to infinity |
|
90 |
* (UINT32_MAX). The referenced Link State Advertisement (LSA) is set to |
|
91 |
* null as is the parent SPFVertex. The outgoing interface index is set to |
|
92 |
* infinity, the next hop address is set to 0.0.0.0 and the list of children |
|
93 |
* of the SPFVertex is initialized to empty. |
|
94 |
* |
|
95 |
* @see VertexType |
|
96 |
*/ |
|
97 |
SPFVertex(); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
98 |
|
1111 | 99 |
/** |
100 |
* @brief Construct an initialized SPFVertex (Shortest Path First Vertex). |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
101 |
* @internal |
1111 | 102 |
* |
103 |
* The Vertex Type is initialized to VertexRouter and the Vertex ID is found |
|
104 |
* from the Link State ID of the Link State Advertisement (LSA) passed as a |
|
105 |
* parameter. The Link State ID is set to the Router ID of the advertising |
|
106 |
* router. The referenced LSA (m_lsa) is set to the given LSA. Other than |
|
107 |
* these members, initialization is as in the default constructor. |
|
108 |
* of the SPFVertex is initialized to empty. |
|
109 |
* |
|
110 |
* @see SPFVertex::SPFVertex () |
|
111 |
* @see VertexType |
|
1278 | 112 |
* @see GlobalRoutingLSA |
1111 | 113 |
* @param lsa The Link State Advertisement used for finding initial values. |
114 |
*/ |
|
1278 | 115 |
SPFVertex(GlobalRoutingLSA* lsa); |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
116 |
|
1111 | 117 |
/** |
118 |
* @brief Destroy an SPFVertex (Shortest Path First Vertex). |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
119 |
* @internal |
1111 | 120 |
* |
121 |
* The children vertices of the SPFVertex are recursively deleted. |
|
122 |
* |
|
123 |
* @see SPFVertex::SPFVertex () |
|
124 |
*/ |
|
125 |
~SPFVertex(); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
126 |
|
1111 | 127 |
/** |
128 |
* @brief Get the Vertex Type field of a SPFVertex object. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
129 |
* @internal |
1111 | 130 |
* |
131 |
* The Vertex Type describes the kind of simulation object a given SPFVertex |
|
132 |
* represents. |
|
133 |
* |
|
134 |
* @see VertexType |
|
135 |
* @returns The VertexType of the current SPFVertex object. |
|
136 |
*/ |
|
137 |
VertexType GetVertexType (void) const; |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
138 |
|
1111 | 139 |
/** |
140 |
* @brief Set the Vertex Type field of a SPFVertex object. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
141 |
* @internal |
1111 | 142 |
* |
143 |
* The Vertex Type describes the kind of simulation object a given SPFVertex |
|
144 |
* represents. |
|
145 |
* |
|
146 |
* @see VertexType |
|
147 |
* @param type The new VertexType for the current SPFVertex object. |
|
148 |
*/ |
|
149 |
void SetVertexType (VertexType type); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
150 |
|
1111 | 151 |
/** |
152 |
* @brief Get the Vertex ID field of a SPFVertex object. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
153 |
* @internal |
1111 | 154 |
* |
155 |
* The Vertex ID uniquely identifies the simulation object a given SPFVertex |
|
156 |
* represents. Typically, this is the Router ID for SPFVertex objects |
|
157 |
* representing routers, and comes from the Link State Advertisement of a |
|
158 |
* router aggregated to a node in the simulation. These IDs are allocated |
|
159 |
* automatically by the routing environment and look like IP addresses |
|
160 |
* beginning at 0.0.0.0 and monotonically increasing as new routers are |
|
161 |
* instantiated. |
|
162 |
* |
|
163 |
* @returns The Ipv4Address Vertex ID of the current SPFVertex object. |
|
164 |
*/ |
|
165 |
Ipv4Address GetVertexId (void) const; |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
166 |
|
1111 | 167 |
/** |
168 |
* @brief Set the Vertex ID field of a SPFVertex object. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
169 |
* @internal |
1111 | 170 |
* |
171 |
* The Vertex ID uniquely identifies the simulation object a given SPFVertex |
|
172 |
* represents. Typically, this is the Router ID for SPFVertex objects |
|
173 |
* representing routers, and comes from the Link State Advertisement of a |
|
174 |
* router aggregated to a node in the simulation. These IDs are allocated |
|
175 |
* automatically by the routing environment and look like IP addresses |
|
176 |
* beginning at 0.0.0.0 and monotonically increase as new routers are |
|
177 |
* instantiated. This method is an explicit override of the automatically |
|
178 |
* generated value. |
|
179 |
* |
|
180 |
* @param id The new Ipv4Address Vertex ID for the current SPFVertex object. |
|
181 |
*/ |
|
182 |
void SetVertexId (Ipv4Address id); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
183 |
|
1111 | 184 |
/** |
185 |
* @brief Get the Global Router Link State Advertisement returned by the |
|
186 |
* Global Router represented by this SPFVertex during the route discovery |
|
187 |
* process. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
188 |
* @internal |
1111 | 189 |
* |
190 |
* @see GlobalRouter |
|
1278 | 191 |
* @see GlobalRoutingLSA |
1111 | 192 |
* @see GlobalRouter::DiscoverLSAs () |
1278 | 193 |
* @returns A pointer to the GlobalRoutingLSA found by the router represented |
1111 | 194 |
* by this SPFVertex object. |
195 |
*/ |
|
1278 | 196 |
GlobalRoutingLSA* GetLSA (void) const; |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
197 |
|
1111 | 198 |
/** |
199 |
* @brief Set the Global Router Link State Advertisement returned by the |
|
200 |
* Global Router represented by this SPFVertex during the route discovery |
|
201 |
* process. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
202 |
* @internal |
1111 | 203 |
* |
204 |
* @see SPFVertex::GetLSA () |
|
205 |
* @see GlobalRouter |
|
1278 | 206 |
* @see GlobalRoutingLSA |
1111 | 207 |
* @see GlobalRouter::DiscoverLSAs () |
208 |
* @warning Ownership of the LSA is transferred to the "this" SPFVertex. You |
|
209 |
* must not delete the LSA after calling this method. |
|
1278 | 210 |
* @param lsa A pointer to the GlobalRoutingLSA. |
1111 | 211 |
*/ |
1278 | 212 |
void SetLSA (GlobalRoutingLSA* lsa); |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
213 |
|
1111 | 214 |
/** |
215 |
* @brief Get the distance from the root vertex to "this" SPFVertex object. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
216 |
* @internal |
1111 | 217 |
* |
218 |
* Each router in the simulation is associated with an SPFVertex object. When |
|
219 |
* calculating routes, each of these routers is, in turn, chosen as the "root" |
|
220 |
* of the calculation and routes to all of the other routers are eventually |
|
221 |
* saved in the routing tables of each of the chosen nodes. Each of these |
|
222 |
* routers in the calculation has an associated SPFVertex. |
|
223 |
* |
|
224 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
225 |
* having its routing tables set. The "this" SPFVertex is the vertex to which |
|
226 |
* a route is being calculated from the root. The distance from the root that |
|
227 |
* we're asking for is the number of hops from the root vertex to the vertex |
|
228 |
* in question. |
|
229 |
* |
|
230 |
* The distance is calculated during route discovery and is stored in a |
|
231 |
* member variable. This method simply fetches that value. |
|
232 |
* |
|
233 |
* @returns The distance, in hops, from the root SPFVertex to "this" SPFVertex. |
|
234 |
*/ |
|
235 |
uint32_t GetDistanceFromRoot (void) const; |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
236 |
|
1111 | 237 |
/** |
238 |
* @brief Set the distance from the root vertex to "this" SPFVertex object. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
239 |
* @internal |
1111 | 240 |
* |
241 |
* Each router in the simulation is associated with an SPFVertex object. When |
|
242 |
* calculating routes, each of these routers is, in turn, chosen as the "root" |
|
243 |
* of the calculation and routes to all of the other routers are eventually |
|
244 |
* saved in the routing tables of each of the chosen nodes. Each of these |
|
245 |
* routers in the calculation has an associated SPFVertex. |
|
246 |
* |
|
247 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
248 |
* having its routing tables set. The "this" SPFVertex is the vertex to which |
|
249 |
* a route is being calculated from the root. The distance from the root that |
|
250 |
* we're asking for is the number of hops from the root vertex to the vertex |
|
251 |
* in question. |
|
252 |
* |
|
253 |
* @param distance The distance, in hops, from the root SPFVertex to "this" |
|
254 |
* SPFVertex. |
|
255 |
*/ |
|
256 |
void SetDistanceFromRoot (uint32_t distance); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
257 |
|
1111 | 258 |
/** |
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
259 |
* \deprecated Use GetRootExitDirection instead |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
260 |
* |
1111 | 261 |
* @brief Get the interface ID that should be used to begin forwarding packets |
262 |
* from the root SPFVertex to "this" SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
263 |
* @internal |
1111 | 264 |
* |
265 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
266 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
267 |
* "root" of the calculation and routes to all of the other routers are |
|
268 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
269 |
* |
|
270 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
271 |
* having its routing tables set. The "this" SPFVertex is the vertex that |
|
272 |
* represents the host or network to which a route is being calculated from |
|
273 |
* the root. The outgoing interface that we're asking for is the interface |
|
274 |
* index on the root node that should be used to start packets along the |
|
275 |
* path to "this" vertex. |
|
276 |
* |
|
277 |
* When initializing the root SPFVertex, the interface ID is determined by |
|
278 |
* examining the Global Router Link Records of the Link State Advertisement |
|
279 |
* generated by the root node's GlobalRouter. These interfaces are used to |
|
280 |
* forward packets off of the root's network down those links. As other |
|
281 |
* vertices are discovered which are further away from the root, they will |
|
282 |
* be accessible down one of the paths begun by a Global Router Link Record. |
|
283 |
* |
|
284 |
* To forward packets to these hosts or networks, the root node must begin |
|
285 |
* the forwarding process by sending the packets to the interface of that |
|
286 |
* first hop. This means that the first hop address and interface ID must |
|
287 |
* be the same for all downstream SPFVertices. We call this "inheriting" |
|
288 |
* the interface and next hop. |
|
289 |
* |
|
290 |
* In this method, the root node is asking, "which of my local interfaces |
|
291 |
* should I use to get a packet to the network or host represented by 'this' |
|
292 |
* SPFVertex." |
|
293 |
* |
|
294 |
* @see GlobalRouter |
|
1278 | 295 |
* @see GlobalRoutingLSA |
296 |
* @see GlobalRoutingLinkRecord |
|
1111 | 297 |
* @returns The interface index to use when forwarding packets to the host |
298 |
* or network represented by "this" SPFVertex. |
|
299 |
*/ |
|
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
300 |
uint32_t GetOutgoingInterfaceId (void) const NS_DEPRECATED; |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
301 |
|
1111 | 302 |
/** |
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
303 |
* \deprecated Use SetRootExitDirection instead |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
304 |
* |
1111 | 305 |
* @brief Set the interface ID that should be used to begin forwarding packets |
306 |
* from the root SPFVertex to "this" SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
307 |
* @internal |
1111 | 308 |
* |
309 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
310 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
311 |
* "root" of the calculation and routes to all of the other routers are |
|
312 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
313 |
* |
|
314 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
315 |
* having its routing tables set. The "this" SPFVertex is the vertex that |
|
316 |
* represents the host or network to which a route is being calculated from |
|
317 |
* the root. The outgoing interface that we're asking for is the interface |
|
318 |
* index on the root node that should be used to start packets along the |
|
319 |
* path to "this" vertex. |
|
320 |
* |
|
321 |
* When initializing the root SPFVertex, the interface ID is determined by |
|
322 |
* examining the Global Router Link Records of the Link State Advertisement |
|
323 |
* generated by the root node's GlobalRouter. These interfaces are used to |
|
324 |
* forward packets off of the root's network down those links. As other |
|
325 |
* vertices are discovered which are further away from the root, they will |
|
326 |
* be accessible down one of the paths begun by a Global Router Link Record. |
|
327 |
* |
|
328 |
* To forward packets to these hosts or networks, the root node must begin |
|
329 |
* the forwarding process by sending the packets to the interface of that |
|
330 |
* first hop. This means that the first hop address and interface ID must |
|
331 |
* be the same for all downstream SPFVertices. We call this "inheriting" |
|
332 |
* the interface and next hop. |
|
333 |
* |
|
334 |
* In this method, we are letting the root node know which of its local |
|
335 |
* interfaces it should use to get a packet to the network or host represented |
|
336 |
* by "this" SPFVertex. |
|
337 |
* |
|
338 |
* @see GlobalRouter |
|
1278 | 339 |
* @see GlobalRoutingLSA |
340 |
* @see GlobalRoutingLinkRecord |
|
1111 | 341 |
* @param id The interface index to use when forwarding packets to the host or |
342 |
* network represented by "this" SPFVertex. |
|
343 |
*/ |
|
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
344 |
void SetOutgoingInterfaceId (int32_t id) NS_DEPRECATED; |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
345 |
|
1111 | 346 |
/** |
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
347 |
* \deprecated Use GetRootExitDirection instead |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
348 |
* |
1111 | 349 |
* @brief Get the IP address that should be used to begin forwarding packets |
350 |
* from the root SPFVertex to "this" SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
351 |
* @internal |
1111 | 352 |
* |
353 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
354 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
355 |
* "root" of the calculation and routes to all of the other routers are |
|
356 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
357 |
* |
|
358 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
359 |
* having its routing tables set. The "this" SPFVertex is the vertex that |
|
360 |
* represents the host or network to which a route is being calculated from |
|
361 |
* the root. The IP address that we're asking for is the address on the |
|
362 |
* remote side of a link off of the root node that should be used as the |
|
363 |
* destination for packets along the path to "this" vertex. |
|
364 |
* |
|
365 |
* When initializing the root SPFVertex, the IP address used when forwarding |
|
366 |
* packets is determined by examining the Global Router Link Records of the |
|
367 |
* Link State Advertisement generated by the root node's GlobalRouter. This |
|
368 |
* address is used to forward packets off of the root's network down those |
|
369 |
* links. As other vertices / nodes are discovered which are further away |
|
370 |
* from the root, they will be accessible down one of the paths via a link |
|
371 |
* described by one of these Global Router Link Records. |
|
372 |
* |
|
373 |
* To forward packets to these hosts or networks, the root node must begin |
|
374 |
* the forwarding process by sending the packets to a first hop router down |
|
375 |
* an interface. This means that the first hop address and interface ID must |
|
376 |
* be the same for all downstream SPFVertices. We call this "inheriting" |
|
377 |
* the interface and next hop. |
|
378 |
* |
|
379 |
* In this method, the root node is asking, "which router should I send a |
|
380 |
* packet to in order to get that packet to the network or host represented |
|
381 |
* by 'this' SPFVertex." |
|
382 |
* |
|
383 |
* @see GlobalRouter |
|
1278 | 384 |
* @see GlobalRoutingLSA |
385 |
* @see GlobalRoutingLinkRecord |
|
1111 | 386 |
* @returns The IP address to use when forwarding packets to the host |
387 |
* or network represented by "this" SPFVertex. |
|
388 |
*/ |
|
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
389 |
Ipv4Address GetNextHop (void) const NS_DEPRECATED; |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
390 |
|
1111 | 391 |
/** |
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
392 |
* \deprecated Use SetRootExitDirection instead |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
393 |
* |
1111 | 394 |
* @brief Set the IP address that should be used to begin forwarding packets |
395 |
* from the root SPFVertex to "this" SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
396 |
* @internal |
1111 | 397 |
* |
398 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
399 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
400 |
* "root" of the calculation and routes to all of the other routers are |
|
401 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
402 |
* |
|
403 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
404 |
* having its routing tables set. The "this" SPFVertex is the vertex that |
|
405 |
* represents the host or network to which a route is being calculated from |
|
406 |
* the root. The IP address that we're asking for is the address on the |
|
407 |
* remote side of a link off of the root node that should be used as the |
|
408 |
* destination for packets along the path to "this" vertex. |
|
409 |
* |
|
410 |
* When initializing the root SPFVertex, the IP address used when forwarding |
|
411 |
* packets is determined by examining the Global Router Link Records of the |
|
412 |
* Link State Advertisement generated by the root node's GlobalRouter. This |
|
413 |
* address is used to forward packets off of the root's network down those |
|
414 |
* links. As other vertices / nodes are discovered which are further away |
|
415 |
* from the root, they will be accessible down one of the paths via a link |
|
416 |
* described by one of these Global Router Link Records. |
|
417 |
* |
|
418 |
* To forward packets to these hosts or networks, the root node must begin |
|
419 |
* the forwarding process by sending the packets to a first hop router down |
|
420 |
* an interface. This means that the first hop address and interface ID must |
|
421 |
* be the same for all downstream SPFVertices. We call this "inheriting" |
|
422 |
* the interface and next hop. |
|
423 |
* |
|
424 |
* In this method we are telling the root node which router it should send |
|
425 |
* should I send a packet to in order to get that packet to the network or |
|
426 |
* host represented by 'this' SPFVertex." |
|
427 |
* |
|
428 |
* @see GlobalRouter |
|
1278 | 429 |
* @see GlobalRoutingLSA |
430 |
* @see GlobalRoutingLinkRecord |
|
1111 | 431 |
* @param nextHop The IP address to use when forwarding packets to the host |
432 |
* or network represented by "this" SPFVertex. |
|
433 |
*/ |
|
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
434 |
void SetNextHop (Ipv4Address nextHop) NS_DEPRECATED; |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
435 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
436 |
* @brief Set the IP address and outgoing interface index that should be used |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
437 |
* to begin forwarding packets from the root SPFVertex to "this" SPFVertex. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
438 |
* @internal |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
439 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
440 |
* Each router node in the simulation is associated with an SPFVertex object. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
441 |
* When calculating routes, each of these routers is, in turn, chosen as the |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
442 |
* "root" of the calculation and routes to all of the other routers are |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
443 |
* eventually saved in the routing tables of each of the chosen nodes. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
444 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
445 |
* The "Root" vertex is then the SPFVertex representing the router that is |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
446 |
* having its routing tables set. The "this" SPFVertex is the vertex that |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
447 |
* represents the host or network to which a route is being calculated from |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
448 |
* the root. The IP address that we're asking for is the address on the |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
449 |
* remote side of a link off of the root node that should be used as the |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
450 |
* destination for packets along the path to "this" vertex. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
451 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
452 |
* When initializing the root SPFVertex, the IP address used when forwarding |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
453 |
* packets is determined by examining the Global Router Link Records of the |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
454 |
* Link State Advertisement generated by the root node's GlobalRouter. This |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
455 |
* address is used to forward packets off of the root's network down those |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
456 |
* links. As other vertices / nodes are discovered which are further away |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
457 |
* from the root, they will be accessible down one of the paths via a link |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
458 |
* described by one of these Global Router Link Records. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
459 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
460 |
* To forward packets to these hosts or networks, the root node must begin |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
461 |
* the forwarding process by sending the packets to a first hop router down |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
462 |
* an interface. This means that the first hop address and interface ID must |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
463 |
* be the same for all downstream SPFVertices. We call this "inheriting" |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
464 |
* the interface and next hop. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
465 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
466 |
* In this method we are telling the root node which exit direction it should send |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
467 |
* should I send a packet to the network or host represented by 'this' SPFVertex. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
468 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
469 |
* @see GlobalRouter |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
470 |
* @see GlobalRoutingLSA |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
471 |
* @see GlobalRoutingLinkRecord |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
472 |
* @param nextHop The IP address to use when forwarding packets to the host |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
473 |
* or network represented by "this" SPFVertex. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
474 |
* @param id The interface index to use when forwarding packets to the host or |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
475 |
* network represented by "this" SPFVertex. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
476 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
477 |
void SetRootExitDirection (Ipv4Address nextHop, int32_t id = SPF_INFINITY); |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
478 |
typedef std::pair<Ipv4Address, int32_t> NodeExit_t; |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
479 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
480 |
* @brief Set the IP address and outgoing interface index that should be used |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
481 |
* to begin forwarding packets from the root SPFVertex to "this" SPFVertex. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
482 |
* @internal |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
483 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
484 |
* Each router node in the simulation is associated with an SPFVertex object. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
485 |
* When calculating routes, each of these routers is, in turn, chosen as the |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
486 |
* "root" of the calculation and routes to all of the other routers are |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
487 |
* eventually saved in the routing tables of each of the chosen nodes. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
488 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
489 |
* The "Root" vertex is then the SPFVertex representing the router that is |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
490 |
* having its routing tables set. The "this" SPFVertex is the vertex that |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
491 |
* represents the host or network to which a route is being calculated from |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
492 |
* the root. The IP address that we're asking for is the address on the |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
493 |
* remote side of a link off of the root node that should be used as the |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
494 |
* destination for packets along the path to "this" vertex. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
495 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
496 |
* When initializing the root SPFVertex, the IP address used when forwarding |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
497 |
* packets is determined by examining the Global Router Link Records of the |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
498 |
* Link State Advertisement generated by the root node's GlobalRouter. This |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
499 |
* address is used to forward packets off of the root's network down those |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
500 |
* links. As other vertices / nodes are discovered which are further away |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
501 |
* from the root, they will be accessible down one of the paths via a link |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
502 |
* described by one of these Global Router Link Records. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
503 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
504 |
* To forward packets to these hosts or networks, the root node must begin |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
505 |
* the forwarding process by sending the packets to a first hop router down |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
506 |
* an interface. This means that the first hop address and interface ID must |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
507 |
* be the same for all downstream SPFVertices. We call this "inheriting" |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
508 |
* the interface and next hop. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
509 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
510 |
* In this method we are telling the root node which exit direction it should send |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
511 |
* should I send a packet to the network or host represented by 'this' SPFVertex. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
512 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
513 |
* @see GlobalRouter |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
514 |
* @see GlobalRoutingLSA |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
515 |
* @see GlobalRoutingLinkRecord |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
516 |
* @param nextHop The IP address to use when forwarding packets to the host |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
517 |
* or network represented by "this" SPFVertex. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
518 |
* @param exit The pair of next-hop-IP and outgoing-interface-index to use when |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
519 |
* forwarding packets to the host or network represented by "this" SPFVertex. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
520 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
521 |
void SetRootExitDirection (SPFVertex::NodeExit_t exit); |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
522 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
523 |
* \brief Obtain a pair indicating the exit direction from the root |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
524 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
525 |
* \param i An index to a pair |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
526 |
* \return A pair of next-hop-IP and outgoing-interface-index for |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
527 |
* indicating an exit direction from the root. It is 0 if the index 'i' |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
528 |
* is out-of-range |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
529 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
530 |
NodeExit_t GetRootExitDirection (uint32_t i) const; |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
531 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
532 |
* \brief Obtain a pair indicating the exit direction from the root |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
533 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
534 |
* This method assumes there is only a single exit direction from the root. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
535 |
* Error occur if this assumption is invalid. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
536 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
537 |
* \return The pair of next-hop-IP and outgoing-interface-index for reaching |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
538 |
* 'this' vertex from the root |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
539 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
540 |
NodeExit_t GetRootExitDirection () const; |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
541 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
542 |
* \brief Merge into 'this' vertex the list of exit directions from |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
543 |
* another vertex |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
544 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
545 |
* This merge is necessary when ECMP are found. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
546 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
547 |
* \param vertex From which the list of exit directions are obtain |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
548 |
* and are merged into 'this' vertex |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
549 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
550 |
void MergeRootExitDirections (const SPFVertex* vertex); |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
551 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
552 |
* \brief Inherit all root exit directions from a given vertex to 'this' vertex |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
553 |
* \param vertex The vertex from which all root exit directions are to be inherrited |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
554 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
555 |
* After the call of this method, the original root exit directions |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
556 |
* in 'this' vertex are all lost. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
557 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
558 |
void InheritAllRootExitDirections (const SPFVertex* vertex); |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
559 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
560 |
* \brief Get the number of exit directions from root for reaching 'this' vertex |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
561 |
* \return The number of exit directions from root |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
562 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
563 |
uint32_t GetNRootExitDirections () const; |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
564 |
|
1111 | 565 |
/** |
566 |
* @brief Get a pointer to the SPFVector that is the parent of "this" |
|
567 |
* SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
568 |
* @internal |
1111 | 569 |
* |
570 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
571 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
572 |
* "root" of the calculation and routes to all of the other routers are |
|
573 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
574 |
* |
|
575 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
576 |
* having its routing tables set and is the root of the SPF tree. |
|
577 |
* |
|
578 |
* This method returns a pointer to the parent node of "this" SPFVertex |
|
579 |
* (both of which reside in that SPF tree). |
|
580 |
* |
|
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
581 |
* @param i The index to one of the parents |
1111 | 582 |
* @returns A pointer to the SPFVertex that is the parent of "this" SPFVertex |
583 |
* in the SPF tree. |
|
584 |
*/ |
|
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
585 |
SPFVertex* GetParent (uint32_t i = 0) const; |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
586 |
|
1111 | 587 |
/** |
588 |
* @brief Set the pointer to the SPFVector that is the parent of "this" |
|
589 |
* SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
590 |
* @internal |
1111 | 591 |
* |
592 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
593 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
594 |
* "root" of the calculation and routes to all of the other routers are |
|
595 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
596 |
* |
|
597 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
598 |
* having its routing tables set and is the root of the SPF tree. |
|
599 |
* |
|
600 |
* This method sets the parent pointer of "this" SPFVertex (both of which |
|
601 |
* reside in that SPF tree). |
|
602 |
* |
|
603 |
* @param parent A pointer to the SPFVertex that is the parent of "this" |
|
604 |
* SPFVertex* in the SPF tree. |
|
605 |
*/ |
|
606 |
void SetParent (SPFVertex* parent); |
|
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
607 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
608 |
* \brief Merge the Parent list from the v into this vertex |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
609 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
610 |
* \param v The vertex from which its list of Parent is read |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
611 |
* and then merged into the list of Parent of *this* vertex. |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
612 |
* Note that the list in v remains intact |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
613 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
614 |
void MergeParent (const SPFVertex* v); |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
615 |
|
1111 | 616 |
/** |
617 |
* @brief Get the number of children of "this" SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
618 |
* @internal |
1111 | 619 |
* |
620 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
621 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
622 |
* "root" of the calculation and routes to all of the other routers are |
|
623 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
624 |
* |
|
625 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
626 |
* having its routing tables set and is the root of the SPF tree. Each vertex |
|
627 |
* in the SPF tree can have a number of children that represent host or |
|
628 |
* network routes available via that vertex. |
|
629 |
* |
|
630 |
* This method returns the number of children of "this" SPFVertex (which |
|
631 |
* reside in the SPF tree). |
|
632 |
* |
|
633 |
* @returns The number of children of "this" SPFVertex (which reside in the |
|
634 |
* SPF tree). |
|
635 |
*/ |
|
636 |
uint32_t GetNChildren (void) const; |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
637 |
|
1111 | 638 |
/** |
639 |
* @brief Get a borrowed SPFVertex pointer to the specified child of "this" |
|
640 |
* SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
641 |
* @internal |
1111 | 642 |
* |
643 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
644 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
645 |
* "root" of the calculation and routes to all of the other routers are |
|
646 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
647 |
* |
|
648 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
649 |
* having its routing tables set and is the root of the SPF tree. Each vertex |
|
650 |
* in the SPF tree can have a number of children that represent host or |
|
651 |
* network routes available via that vertex. |
|
652 |
* |
|
653 |
* This method the number of children of "this" SPFVertex (which reside in |
|
654 |
* the SPF tree. |
|
655 |
* |
|
656 |
* @see SPFVertex::GetNChildren |
|
657 |
* @param n The index (from 0 to the number of children minus 1) of the |
|
658 |
* child SPFVertex to return. |
|
659 |
* @warning The pointer returned by GetChild () is a borrowed pointer. You |
|
660 |
* do not have any ownership of the underlying object and must not delete |
|
661 |
* that object. |
|
662 |
* @returns A pointer to the specified child SPFVertex (which resides in the |
|
663 |
* SPF tree). |
|
664 |
*/ |
|
665 |
SPFVertex* GetChild (uint32_t n) const; |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
666 |
|
1111 | 667 |
/** |
668 |
* @brief Get a borrowed SPFVertex pointer to the specified child of "this" |
|
669 |
* SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
670 |
* @internal |
1111 | 671 |
* |
672 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
673 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
674 |
* "root" of the calculation and routes to all of the other routers are |
|
675 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
676 |
* |
|
677 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
678 |
* having its routing tables set and is the root of the SPF tree. Each vertex |
|
679 |
* in the SPF tree can have a number of children that represent host or |
|
680 |
* network routes available via that vertex. |
|
681 |
* |
|
682 |
* This method the number of children of "this" SPFVertex (which reside in |
|
683 |
* the SPF tree. |
|
684 |
* |
|
685 |
* @see SPFVertex::GetNChildren |
|
686 |
* @warning Ownership of the pointer added to the children of "this" |
|
687 |
* SPFVertex is transferred to the "this" SPFVertex. You must not delete the |
|
688 |
* (now) child SPFVertex after calling this method. |
|
689 |
* @param child A pointer to the SPFVertex (which resides in the SPF tree) to |
|
690 |
* be added to the list of children of "this" SPFVertex. |
|
691 |
* @returns The number of children of "this" SPFVertex after the addition of |
|
692 |
* the new child. |
|
693 |
*/ |
|
694 |
uint32_t AddChild (SPFVertex* child); |
|
695 |
||
3960
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
696 |
/** |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
697 |
* @brief Set the value of the VertexProcessed flag |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
698 |
* |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
699 |
* Flag to note whether vertex has been processed in stage two of |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
700 |
* SPF computation |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
701 |
* @param value boolean value to set the flag |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
702 |
*/ |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
703 |
void SetVertexProcessed (bool value); |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
704 |
|
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
705 |
/** |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
706 |
* @brief Check the value of the VertexProcessed flag |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
707 |
* |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
708 |
* Flag to note whether vertex has been processed in stage two of |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
709 |
* SPF computation |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
710 |
* @returns value of underlying flag |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
711 |
*/ |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
712 |
bool IsVertexProcessed (void) const; |
4745
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
713 |
|
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
714 |
void ClearVertexProcessed (void); |
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
715 |
|
1111 | 716 |
private: |
717 |
VertexType m_vertexType; |
|
718 |
Ipv4Address m_vertexId; |
|
1278 | 719 |
GlobalRoutingLSA* m_lsa; |
1111 | 720 |
uint32_t m_distanceFromRoot; |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4297
diff
changeset
|
721 |
int32_t m_rootOif; |
1111 | 722 |
Ipv4Address m_nextHop; |
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
723 |
typedef std::list< NodeExit_t > ListOfNodeExit_t; |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
724 |
/// store the multiple root's exits for supporting ECMP |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
725 |
ListOfNodeExit_t m_ecmpRootExits; |
1111 | 726 |
typedef std::list<SPFVertex*> ListOfSPFVertex_t; |
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
727 |
ListOfSPFVertex_t m_parents; |
1111 | 728 |
ListOfSPFVertex_t m_children; |
3960
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
729 |
bool m_vertexProcessed; |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
730 |
|
1111 | 731 |
/** |
732 |
* @brief The SPFVertex copy construction is disallowed. There's no need for |
|
733 |
* it and a compiler provided shallow copy would be wrong. |
|
734 |
*/ |
|
735 |
SPFVertex (SPFVertex& v); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
736 |
|
1111 | 737 |
/** |
738 |
* @brief The SPFVertex copy assignment operator is disallowed. There's no |
|
739 |
* need for it and a compiler provided shallow copy would be wrong. |
|
740 |
*/ |
|
741 |
SPFVertex& operator= (SPFVertex& v); |
|
5858
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
742 |
|
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
743 |
//friend std::ostream& operator<< (std::ostream& os, const ListOfIf_t& ifs); |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
744 |
//friend std::ostream& operator<< (std::ostream& os, const ListOfAddr_t& addrs); |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
745 |
friend std::ostream& operator<< (std::ostream& os, const SPFVertex::ListOfSPFVertex_t& vs); |
1111 | 746 |
}; |
747 |
||
748 |
/** |
|
749 |
* @brief The Link State DataBase (LSDB) of the Global Route Manager. |
|
750 |
* |
|
751 |
* Each node in the simulation participating in global routing has a |
|
752 |
* GlobalRouter interface. The primary job of this interface is to export |
|
753 |
* Global Router Link State Advertisements (LSAs). These advertisements in |
|
754 |
* turn contain a number of Global Router Link Records that describe the |
|
755 |
* point to point links from the underlying node to other nodes (that will |
|
756 |
* also export their own LSAs. |
|
757 |
* |
|
758 |
* This class implements a searchable database of LSAs gathered from every |
|
759 |
* router in the simulation. |
|
760 |
*/ |
|
761 |
class GlobalRouteManagerLSDB |
|
762 |
{ |
|
763 |
public: |
|
764 |
/** |
|
765 |
* @brief Construct an empty Global Router Manager Link State Database. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
766 |
* @internal |
1111 | 767 |
* |
768 |
* The database map composing the Link State Database is initialized in |
|
769 |
* this constructor. |
|
770 |
*/ |
|
771 |
GlobalRouteManagerLSDB (); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
772 |
|
1111 | 773 |
/** |
774 |
* @brief Destroy an empty Global Router Manager Link State Database. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
775 |
* @internal |
1111 | 776 |
* |
777 |
* The database map is walked and all of the Link State Advertisements stored |
|
778 |
* in the database are freed; then the database map itself is clear ()ed to |
|
779 |
* release any remaining resources. |
|
780 |
*/ |
|
781 |
~GlobalRouteManagerLSDB (); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
782 |
|
1111 | 783 |
/** |
784 |
* @brief Insert an IP address / Link State Advertisement pair into the Link |
|
785 |
* State Database. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
786 |
* @internal |
1111 | 787 |
* |
1278 | 788 |
* The IPV4 address and the GlobalRoutingLSA given as parameters are converted |
1111 | 789 |
* to an STL pair and are inserted into the database map. |
790 |
* |
|
1278 | 791 |
* @see GlobalRoutingLSA |
1111 | 792 |
* @see Ipv4Address |
793 |
* @param addr The IP address associated with the LSA. Typically the Router |
|
794 |
* ID. |
|
795 |
* @param lsa A pointer to the Link State Advertisement for the router. |
|
796 |
*/ |
|
1278 | 797 |
void Insert(Ipv4Address addr, GlobalRoutingLSA* lsa); |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
798 |
|
1111 | 799 |
/** |
800 |
* @brief Look up the Link State Advertisement associated with the given |
|
1278 | 801 |
* link state ID (address). |
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
802 |
* @internal |
1111 | 803 |
* |
804 |
* The database map is searched for the given IPV4 address and corresponding |
|
1278 | 805 |
* GlobalRoutingLSA is returned. |
1111 | 806 |
* |
1278 | 807 |
* @see GlobalRoutingLSA |
1111 | 808 |
* @see Ipv4Address |
809 |
* @param addr The IP address associated with the LSA. Typically the Router |
|
810 |
* ID. |
|
811 |
* @returns A pointer to the Link State Advertisement for the router specified |
|
812 |
* by the IP address addr. |
|
813 |
*/ |
|
1278 | 814 |
GlobalRoutingLSA* GetLSA (Ipv4Address addr) const; |
815 |
/** |
|
816 |
* @brief Look up the Link State Advertisement associated with the given |
|
817 |
* link state ID (address). This is a variation of the GetLSA call |
|
818 |
* to allow the LSA to be found by matching addr with the LinkData field |
|
819 |
* of the TransitNetwork link record. |
|
820 |
* @internal |
|
821 |
* |
|
822 |
* @see GetLSA |
|
823 |
* @param addr The IP address associated with the LSA. Typically the Router |
|
824 |
* @returns A pointer to the Link State Advertisement for the router specified |
|
825 |
* by the IP address addr. |
|
826 |
* ID. |
|
827 |
*/ |
|
828 |
GlobalRoutingLSA* GetLSAByLinkData (Ipv4Address addr) const; |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
829 |
|
1111 | 830 |
/** |
831 |
* @brief Set all LSA flags to an initialized state, for SPF computation |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
832 |
* @internal |
1111 | 833 |
* |
834 |
* This function walks the database and resets the status flags of all of the |
|
835 |
* contained Link State Advertisements to LSA_SPF_NOT_EXPLORED. This is done |
|
836 |
* prior to each SPF calculation to reset the state of the SPFVertex structures |
|
837 |
* that will reference the LSAs during the calculation. |
|
838 |
* |
|
1278 | 839 |
* @see GlobalRoutingLSA |
1111 | 840 |
* @see SPFVertex |
841 |
*/ |
|
842 |
void Initialize (); |
|
4745
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
843 |
|
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
844 |
GlobalRoutingLSA* GetExtLSA (uint32_t index) const; |
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
845 |
uint32_t GetNumExtLSAs () const; |
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
846 |
|
1111 | 847 |
|
848 |
private: |
|
1278 | 849 |
typedef std::map<Ipv4Address, GlobalRoutingLSA*> LSDBMap_t; |
850 |
typedef std::pair<Ipv4Address, GlobalRoutingLSA*> LSDBPair_t; |
|
1111 | 851 |
|
852 |
LSDBMap_t m_database; |
|
4745
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
853 |
std::vector<GlobalRoutingLSA*> m_extdatabase; |
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
854 |
|
1111 | 855 |
/** |
856 |
* @brief GlobalRouteManagerLSDB copy construction is disallowed. There's no |
|
857 |
* need for it and a compiler provided shallow copy would be wrong. |
|
858 |
*/ |
|
859 |
GlobalRouteManagerLSDB (GlobalRouteManagerLSDB& lsdb); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
860 |
|
1111 | 861 |
/** |
862 |
* @brief The SPFVertex copy assignment operator is disallowed. There's no |
|
863 |
* need for it and a compiler provided shallow copy would be wrong. |
|
864 |
*/ |
|
865 |
GlobalRouteManagerLSDB& operator= (GlobalRouteManagerLSDB& lsdb); |
|
866 |
}; |
|
867 |
||
868 |
/** |
|
869 |
* @brief A global router implementation. |
|
870 |
* |
|
871 |
* This singleton object can query interface each node in the system |
|
872 |
* for a GlobalRouter interface. For those nodes, it fetches one or |
|
873 |
* more Link State Advertisements and stores them in a local database. |
|
874 |
* Then, it can compute shortest paths on a per-node basis to all routers, |
|
875 |
* and finally configure each of the node's forwarding tables. |
|
876 |
* |
|
877 |
* The design is guided by OSPFv2 RFC 2328 section 16.1.1 and quagga ospfd. |
|
878 |
*/ |
|
879 |
class GlobalRouteManagerImpl |
|
880 |
{ |
|
881 |
public: |
|
882 |
GlobalRouteManagerImpl (); |
|
883 |
virtual ~GlobalRouteManagerImpl (); |
|
884 |
/** |
|
3959
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
885 |
* @brief Delete all static routes on all nodes that have a |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
886 |
* GlobalRouterInterface |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
887 |
* |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
888 |
* TODO: separate manually assigned static routes from static routes that |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
889 |
* the global routing code injects, and only delete the latter |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
890 |
* @internal |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
891 |
* |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
892 |
*/ |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
893 |
virtual void DeleteGlobalRoutes (); |
3937
04f9377661b8
convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents:
2250
diff
changeset
|
894 |
|
04f9377661b8
convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents:
2250
diff
changeset
|
895 |
/** |
1111 | 896 |
* @brief Build the routing database by gathering Link State Advertisements |
897 |
* from each node exporting a GlobalRouter interface. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
898 |
* @internal |
1111 | 899 |
*/ |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
900 |
virtual void BuildGlobalRoutingDatabase (); |
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
901 |
|
1111 | 902 |
/** |
903 |
* @brief Compute routes using a Dijkstra SPF computation and populate |
|
904 |
* per-node forwarding tables |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
905 |
* @internal |
1111 | 906 |
*/ |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
907 |
virtual void InitializeRoutes (); |
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
908 |
|
1111 | 909 |
/** |
910 |
* @brief Debugging routine; allow client code to supply a pre-built LSDB |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
911 |
* @internal |
1111 | 912 |
*/ |
913 |
void DebugUseLsdb (GlobalRouteManagerLSDB*); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
914 |
|
1111 | 915 |
/** |
916 |
* @brief Debugging routine; call the core SPF from the unit tests |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
917 |
* @internal |
1111 | 918 |
*/ |
919 |
void DebugSPFCalculate (Ipv4Address root); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
920 |
|
1111 | 921 |
private: |
922 |
/** |
|
923 |
* @brief GlobalRouteManagerImpl copy construction is disallowed. |
|
924 |
* There's no need for it and a compiler provided shallow copy would be |
|
925 |
* wrong. |
|
926 |
*/ |
|
927 |
GlobalRouteManagerImpl (GlobalRouteManagerImpl& srmi); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
928 |
|
1111 | 929 |
/** |
930 |
* @brief Global Route Manager Implementation assignment operator is |
|
931 |
* disallowed. There's no need for it and a compiler provided shallow copy |
|
932 |
* would be hopelessly wrong. |
|
933 |
*/ |
|
934 |
GlobalRouteManagerImpl& operator= (GlobalRouteManagerImpl& srmi); |
|
935 |
||
936 |
SPFVertex* m_spfroot; |
|
937 |
GlobalRouteManagerLSDB* m_lsdb; |
|
4628
a5a8c44e4240
bug 521. Ipv4 global routing inefficient. Updated Tom's patch
Craig Dowell <craigdo@ee.washington.edu>
parents:
4616
diff
changeset
|
938 |
bool CheckForStubNode (Ipv4Address root); |
1111 | 939 |
void SPFCalculate (Ipv4Address root); |
3960
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
940 |
void SPFProcessStubs (SPFVertex* v); |
4745
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
941 |
void ProcessASExternals (SPFVertex* v, GlobalRoutingLSA* extlsa); |
1111 | 942 |
void SPFNext (SPFVertex*, CandidateQueue&); |
943 |
int SPFNexthopCalculation (SPFVertex* v, SPFVertex* w, |
|
1278 | 944 |
GlobalRoutingLinkRecord* l, uint32_t distance); |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
945 |
void SPFVertexAddParent (SPFVertex* v); |
1278 | 946 |
GlobalRoutingLinkRecord* SPFGetNextLink (SPFVertex* v, SPFVertex* w, |
947 |
GlobalRoutingLinkRecord* prev_link); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
948 |
void SPFIntraAddRouter (SPFVertex* v); |
1278 | 949 |
void SPFIntraAddTransit (SPFVertex* v); |
3960
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
950 |
void SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex* v); |
4745
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
951 |
void SPFAddASExternal (GlobalRoutingLSA *extlsa, SPFVertex *v); |
4476 | 952 |
int32_t FindOutgoingInterfaceId (Ipv4Address a, |
1316
f357c6a2bb37
Provide two new Ipv4 convenience functions: GetIfIndexByIpv4Address() and GetIpv4RouteToDestination (), and align global routing code to use the first function
Tom Henderson <tomh@tomh.org>
parents:
1278
diff
changeset
|
953 |
Ipv4Mask amask = Ipv4Mask("255.255.255.255")); |
1111 | 954 |
}; |
955 |
||
956 |
} // namespace ns3 |
|
957 |
||
958 |
#endif /* GLOBAL_ROUTE_MANAGER_IMPL_H */ |