author | Pedro Silva <pmms@inesctec.pt> |
Wed, 29 Oct 2014 10:12:53 -0700 | |
changeset 11040 | cd2eda848730 |
parent 10872 | 0d7c9bf5f537 |
child 11045 | 6024c150e4c8 |
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 |
||
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
37 |
const uint32_t SPF_INFINITY = 0xffffffff; //!< "infinite" distance between nodes |
1111 | 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 |
/** |
|
10158
971f362648c3
Link to RFC num with \RFC{num}
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9870
diff
changeset
|
43 |
* @brief Vertex used in shortest path first (SPF) computations. See \RFC{2328}, |
1111 | 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 |
* @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
|
260 |
* 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
|
261 |
* @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
|
262 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
263 |
* 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
|
264 |
* 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
|
265 |
* "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
|
266 |
* 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
|
267 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
268 |
* 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
|
269 |
* 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
|
270 |
* 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
|
271 |
* 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
|
272 |
* 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
|
273 |
* 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
|
274 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
275 |
* 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
|
276 |
* 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
|
277 |
* 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
|
278 |
* 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
|
279 |
* 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
|
280 |
* 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
|
281 |
* 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
|
282 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
283 |
* 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
|
284 |
* 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
|
285 |
* 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
|
286 |
* 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
|
287 |
* 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
|
288 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
289 |
* 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
|
290 |
* 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
|
291 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
292 |
* @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
|
293 |
* @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
|
294 |
* @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
|
295 |
* @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
|
296 |
* 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
|
297 |
* @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
|
298 |
* 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
|
299 |
*/ |
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 |
void SetRootExitDirection (Ipv4Address nextHop, int32_t id = SPF_INFINITY); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
301 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
302 |
typedef std::pair<Ipv4Address, int32_t> NodeExit_t; //!< IPv4 / interface container for exit nodes. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
303 |
|
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
|
304 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
305 |
* @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
|
306 |
* 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
|
307 |
* @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
|
308 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
309 |
* 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
|
310 |
* 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
|
311 |
* "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
|
312 |
* 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
|
313 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
314 |
* 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
|
315 |
* 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
|
316 |
* 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
|
317 |
* 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
|
318 |
* 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
|
319 |
* 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
|
320 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
321 |
* 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
|
322 |
* 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
|
323 |
* 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
|
324 |
* 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
|
325 |
* 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
|
326 |
* 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
|
327 |
* 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
|
328 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
329 |
* 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
|
330 |
* 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
|
331 |
* 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
|
332 |
* 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
|
333 |
* 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
|
334 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
335 |
* 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
|
336 |
* 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
|
337 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
338 |
* @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
|
339 |
* @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
|
340 |
* @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
|
341 |
* @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
|
342 |
* 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
|
343 |
*/ |
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 SetRootExitDirection (SPFVertex::NodeExit_t exit); |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
345 |
/** |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
346 |
* \brief Obtain a pair indicating the exit direction from the root |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
347 |
* |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
348 |
* \param i An index to a pair |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
349 |
* \return A pair of next-hop-IP and outgoing-interface-index for |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
350 |
* indicating an exit direction from the root. It is 0 if the index 'i' |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
351 |
* is out-of-range |
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
352 |
*/ |
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
|
353 |
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
|
354 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
355 |
* \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
|
356 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
357 |
* 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
|
358 |
* 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
|
359 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
360 |
* \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
|
361 |
* '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
|
362 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
363 |
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
|
364 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
365 |
* \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
|
366 |
* 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
|
367 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
368 |
* 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
|
369 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
370 |
* \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
|
371 |
* 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
|
372 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
373 |
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
|
374 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
375 |
* \brief Inherit all root exit directions from a given vertex to 'this' vertex |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
5935
diff
changeset
|
376 |
* \param vertex The vertex from which all root exit directions are to be inherited |
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
|
377 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
378 |
* 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
|
379 |
* 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
|
380 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
381 |
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
|
382 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
383 |
* \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
|
384 |
* \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
|
385 |
*/ |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
386 |
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
|
387 |
|
1111 | 388 |
/** |
389 |
* @brief Get a pointer to the SPFVector that is the parent of "this" |
|
390 |
* SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
391 |
* @internal |
1111 | 392 |
* |
393 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
394 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
395 |
* "root" of the calculation and routes to all of the other routers are |
|
396 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
397 |
* |
|
398 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
399 |
* having its routing tables set and is the root of the SPF tree. |
|
400 |
* |
|
401 |
* This method returns a pointer to the parent node of "this" SPFVertex |
|
402 |
* (both of which reside in that SPF tree). |
|
403 |
* |
|
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
|
404 |
* @param i The index to one of the parents |
1111 | 405 |
* @returns A pointer to the SPFVertex that is the parent of "this" SPFVertex |
406 |
* in the SPF tree. |
|
407 |
*/ |
|
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
|
408 |
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
|
409 |
|
1111 | 410 |
/** |
411 |
* @brief Set the pointer to the SPFVector that is the parent of "this" |
|
412 |
* SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
413 |
* @internal |
1111 | 414 |
* |
415 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
416 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
417 |
* "root" of the calculation and routes to all of the other routers are |
|
418 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
419 |
* |
|
420 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
421 |
* having its routing tables set and is the root of the SPF tree. |
|
422 |
* |
|
423 |
* This method sets the parent pointer of "this" SPFVertex (both of which |
|
424 |
* reside in that SPF tree). |
|
425 |
* |
|
426 |
* @param parent A pointer to the SPFVertex that is the parent of "this" |
|
427 |
* SPFVertex* in the SPF tree. |
|
428 |
*/ |
|
429 |
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
|
430 |
/** |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
431 |
* \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
|
432 |
* |
afb51c7f34c2
bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
4745
diff
changeset
|
433 |
* \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
|
434 |
* 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
|
435 |
* 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
|
436 |
*/ |
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 |
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
|
438 |
|
1111 | 439 |
/** |
440 |
* @brief Get the number of children of "this" SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
441 |
* @internal |
1111 | 442 |
* |
443 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
444 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
445 |
* "root" of the calculation and routes to all of the other routers are |
|
446 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
447 |
* |
|
448 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
449 |
* having its routing tables set and is the root of the SPF tree. Each vertex |
|
450 |
* in the SPF tree can have a number of children that represent host or |
|
451 |
* network routes available via that vertex. |
|
452 |
* |
|
453 |
* This method returns the number of children of "this" SPFVertex (which |
|
454 |
* reside in the SPF tree). |
|
455 |
* |
|
456 |
* @returns The number of children of "this" SPFVertex (which reside in the |
|
457 |
* SPF tree). |
|
458 |
*/ |
|
459 |
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
|
460 |
|
1111 | 461 |
/** |
462 |
* @brief Get a borrowed SPFVertex pointer to the specified child of "this" |
|
463 |
* SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
464 |
* @internal |
1111 | 465 |
* |
466 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
467 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
468 |
* "root" of the calculation and routes to all of the other routers are |
|
469 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
470 |
* |
|
471 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
472 |
* having its routing tables set and is the root of the SPF tree. Each vertex |
|
473 |
* in the SPF tree can have a number of children that represent host or |
|
474 |
* network routes available via that vertex. |
|
475 |
* |
|
476 |
* This method the number of children of "this" SPFVertex (which reside in |
|
477 |
* the SPF tree. |
|
478 |
* |
|
479 |
* @see SPFVertex::GetNChildren |
|
480 |
* @param n The index (from 0 to the number of children minus 1) of the |
|
481 |
* child SPFVertex to return. |
|
482 |
* @warning The pointer returned by GetChild () is a borrowed pointer. You |
|
483 |
* do not have any ownership of the underlying object and must not delete |
|
484 |
* that object. |
|
485 |
* @returns A pointer to the specified child SPFVertex (which resides in the |
|
486 |
* SPF tree). |
|
487 |
*/ |
|
488 |
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
|
489 |
|
1111 | 490 |
/** |
491 |
* @brief Get a borrowed SPFVertex pointer to the specified child of "this" |
|
492 |
* SPFVertex. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
493 |
* @internal |
1111 | 494 |
* |
495 |
* Each router node in the simulation is associated with an SPFVertex object. |
|
496 |
* When calculating routes, each of these routers is, in turn, chosen as the |
|
497 |
* "root" of the calculation and routes to all of the other routers are |
|
498 |
* eventually saved in the routing tables of each of the chosen nodes. |
|
499 |
* |
|
500 |
* The "Root" vertex is then the SPFVertex representing the router that is |
|
501 |
* having its routing tables set and is the root of the SPF tree. Each vertex |
|
502 |
* in the SPF tree can have a number of children that represent host or |
|
503 |
* network routes available via that vertex. |
|
504 |
* |
|
505 |
* This method the number of children of "this" SPFVertex (which reside in |
|
506 |
* the SPF tree. |
|
507 |
* |
|
508 |
* @see SPFVertex::GetNChildren |
|
509 |
* @warning Ownership of the pointer added to the children of "this" |
|
510 |
* SPFVertex is transferred to the "this" SPFVertex. You must not delete the |
|
511 |
* (now) child SPFVertex after calling this method. |
|
512 |
* @param child A pointer to the SPFVertex (which resides in the SPF tree) to |
|
513 |
* be added to the list of children of "this" SPFVertex. |
|
514 |
* @returns The number of children of "this" SPFVertex after the addition of |
|
515 |
* the new child. |
|
516 |
*/ |
|
517 |
uint32_t AddChild (SPFVertex* child); |
|
518 |
||
3960
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
519 |
/** |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
520 |
* @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
|
521 |
* |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
522 |
* 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
|
523 |
* SPF computation |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
524 |
* @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
|
525 |
*/ |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
526 |
void SetVertexProcessed (bool value); |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
527 |
|
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
528 |
/** |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
529 |
* @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
|
530 |
* |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
531 |
* 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
|
532 |
* SPF computation |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
533 |
* @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
|
534 |
*/ |
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
535 |
bool IsVertexProcessed (void) const; |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
536 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
537 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
538 |
* @brief Clear the value of the VertexProcessed flag |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
539 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
540 |
* Flag to note whether vertex has been processed in stage two of |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
541 |
* SPF computation |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
542 |
*/ |
4745
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
543 |
void ClearVertexProcessed (void); |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
544 |
|
1111 | 545 |
private: |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
546 |
VertexType m_vertexType; //!< Vertex type |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
547 |
Ipv4Address m_vertexId; //!< Vertex ID |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
548 |
GlobalRoutingLSA* m_lsa; //!< Link State Advertisement |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
549 |
uint32_t m_distanceFromRoot; //!< Distance from root node |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
550 |
int32_t m_rootOif; //!< root Output Interface |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
551 |
Ipv4Address m_nextHop; //!< next hop |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
552 |
typedef std::list< NodeExit_t > ListOfNodeExit_t; //!< container of Exit nodes |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
553 |
ListOfNodeExit_t m_ecmpRootExits; //!< store the multiple root's exits for supporting ECMP |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
554 |
typedef std::list<SPFVertex*> ListOfSPFVertex_t; //!< container of SPFVertexes |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
555 |
ListOfSPFVertex_t m_parents; //!< parent list |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
556 |
ListOfSPFVertex_t m_children; //!< Children list |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
557 |
bool m_vertexProcessed; //!< Flag to note whether vertex has been processed in stage two of SPF computation |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
558 |
|
1111 | 559 |
/** |
560 |
* @brief The SPFVertex copy construction is disallowed. There's no need for |
|
561 |
* it and a compiler provided shallow copy would be wrong. |
|
10872
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
562 |
* @param v object to copy from |
1111 | 563 |
*/ |
564 |
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
|
565 |
|
1111 | 566 |
/** |
567 |
* @brief The SPFVertex copy assignment operator is disallowed. There's no |
|
568 |
* need for it and a compiler provided shallow copy would be wrong. |
|
10872
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
569 |
* @param v object to copy from |
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
570 |
* @returns the copied object |
1111 | 571 |
*/ |
572 |
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
|
573 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
574 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
575 |
* \brief Stream insertion operator. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
576 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
577 |
* \param os the reference to the output stream |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
578 |
* \param vs a list of SPFVertexes |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
579 |
* \returns the reference to the output stream |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
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 |
friend std::ostream& operator<< (std::ostream& os, const SPFVertex::ListOfSPFVertex_t& vs); |
1111 | 582 |
}; |
583 |
||
584 |
/** |
|
585 |
* @brief The Link State DataBase (LSDB) of the Global Route Manager. |
|
586 |
* |
|
587 |
* Each node in the simulation participating in global routing has a |
|
588 |
* GlobalRouter interface. The primary job of this interface is to export |
|
589 |
* Global Router Link State Advertisements (LSAs). These advertisements in |
|
590 |
* turn contain a number of Global Router Link Records that describe the |
|
591 |
* point to point links from the underlying node to other nodes (that will |
|
592 |
* also export their own LSAs. |
|
593 |
* |
|
594 |
* This class implements a searchable database of LSAs gathered from every |
|
595 |
* router in the simulation. |
|
596 |
*/ |
|
597 |
class GlobalRouteManagerLSDB |
|
598 |
{ |
|
599 |
public: |
|
600 |
/** |
|
601 |
* @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
|
602 |
* @internal |
1111 | 603 |
* |
604 |
* The database map composing the Link State Database is initialized in |
|
605 |
* this constructor. |
|
606 |
*/ |
|
607 |
GlobalRouteManagerLSDB (); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
608 |
|
1111 | 609 |
/** |
610 |
* @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
|
611 |
* @internal |
1111 | 612 |
* |
613 |
* The database map is walked and all of the Link State Advertisements stored |
|
614 |
* in the database are freed; then the database map itself is clear ()ed to |
|
615 |
* release any remaining resources. |
|
616 |
*/ |
|
617 |
~GlobalRouteManagerLSDB (); |
|
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
618 |
|
1111 | 619 |
/** |
620 |
* @brief Insert an IP address / Link State Advertisement pair into the Link |
|
621 |
* State Database. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
622 |
* @internal |
1111 | 623 |
* |
1278 | 624 |
* The IPV4 address and the GlobalRoutingLSA given as parameters are converted |
1111 | 625 |
* to an STL pair and are inserted into the database map. |
626 |
* |
|
1278 | 627 |
* @see GlobalRoutingLSA |
1111 | 628 |
* @see Ipv4Address |
629 |
* @param addr The IP address associated with the LSA. Typically the Router |
|
630 |
* ID. |
|
631 |
* @param lsa A pointer to the Link State Advertisement for the router. |
|
632 |
*/ |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
633 |
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
|
634 |
|
1111 | 635 |
/** |
636 |
* @brief Look up the Link State Advertisement associated with the given |
|
1278 | 637 |
* link state ID (address). |
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
638 |
* @internal |
1111 | 639 |
* |
640 |
* The database map is searched for the given IPV4 address and corresponding |
|
1278 | 641 |
* GlobalRoutingLSA is returned. |
1111 | 642 |
* |
1278 | 643 |
* @see GlobalRoutingLSA |
1111 | 644 |
* @see Ipv4Address |
645 |
* @param addr The IP address associated with the LSA. Typically the Router |
|
646 |
* ID. |
|
647 |
* @returns A pointer to the Link State Advertisement for the router specified |
|
648 |
* by the IP address addr. |
|
649 |
*/ |
|
1278 | 650 |
GlobalRoutingLSA* GetLSA (Ipv4Address addr) const; |
651 |
/** |
|
652 |
* @brief Look up the Link State Advertisement associated with the given |
|
653 |
* link state ID (address). This is a variation of the GetLSA call |
|
654 |
* to allow the LSA to be found by matching addr with the LinkData field |
|
655 |
* of the TransitNetwork link record. |
|
656 |
* @internal |
|
657 |
* |
|
658 |
* @see GetLSA |
|
659 |
* @param addr The IP address associated with the LSA. Typically the Router |
|
660 |
* @returns A pointer to the Link State Advertisement for the router specified |
|
661 |
* by the IP address addr. |
|
662 |
* ID. |
|
663 |
*/ |
|
664 |
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
|
665 |
|
1111 | 666 |
/** |
667 |
* @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
|
668 |
* @internal |
1111 | 669 |
* |
670 |
* This function walks the database and resets the status flags of all of the |
|
671 |
* contained Link State Advertisements to LSA_SPF_NOT_EXPLORED. This is done |
|
672 |
* prior to each SPF calculation to reset the state of the SPFVertex structures |
|
673 |
* that will reference the LSAs during the calculation. |
|
674 |
* |
|
1278 | 675 |
* @see GlobalRoutingLSA |
1111 | 676 |
* @see SPFVertex |
677 |
*/ |
|
678 |
void Initialize (); |
|
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
679 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
680 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
681 |
* @brief Look up the External Link State Advertisement associated with the given |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
682 |
* index. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
683 |
* @internal |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
684 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
685 |
* The external database map is searched for the given index and corresponding |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
686 |
* GlobalRoutingLSA is returned. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
687 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
688 |
* @see GlobalRoutingLSA |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
689 |
* @param index the index associated with the LSA. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
690 |
* @returns A pointer to the Link State Advertisement. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
691 |
*/ |
4745
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
692 |
GlobalRoutingLSA* GetExtLSA (uint32_t index) const; |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
693 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
694 |
* @brief Get the number of External Link State Advertisements. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
695 |
* @internal |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
696 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
697 |
* @see GlobalRoutingLSA |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
698 |
* @returns the number of External Link State Advertisements. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
699 |
*/ |
4745
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
700 |
uint32_t GetNumExtLSAs () const; |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
701 |
|
1111 | 702 |
|
703 |
private: |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
704 |
typedef std::map<Ipv4Address, GlobalRoutingLSA*> LSDBMap_t; //!< container of IPv4 addresses / Link State Advertisements |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
705 |
typedef std::pair<Ipv4Address, GlobalRoutingLSA*> LSDBPair_t; //!< pair of IPv4 addresses / Link State Advertisements |
1111 | 706 |
|
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
707 |
LSDBMap_t m_database; //!< database of IPv4 addresses / Link State Advertisements |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
708 |
std::vector<GlobalRoutingLSA*> m_extdatabase; //!< database of External Link State Advertisements |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
709 |
|
1111 | 710 |
/** |
711 |
* @brief GlobalRouteManagerLSDB copy construction is disallowed. There's no |
|
712 |
* need for it and a compiler provided shallow copy would be wrong. |
|
10872
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
713 |
* @param lsdb object to copy from |
1111 | 714 |
*/ |
715 |
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
|
716 |
|
1111 | 717 |
/** |
718 |
* @brief The SPFVertex copy assignment operator is disallowed. There's no |
|
719 |
* need for it and a compiler provided shallow copy would be wrong. |
|
10872
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
720 |
* @param lsdb object to copy from |
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
721 |
* @returns the copied object |
1111 | 722 |
*/ |
723 |
GlobalRouteManagerLSDB& operator= (GlobalRouteManagerLSDB& lsdb); |
|
724 |
}; |
|
725 |
||
726 |
/** |
|
727 |
* @brief A global router implementation. |
|
728 |
* |
|
729 |
* This singleton object can query interface each node in the system |
|
730 |
* for a GlobalRouter interface. For those nodes, it fetches one or |
|
731 |
* more Link State Advertisements and stores them in a local database. |
|
732 |
* Then, it can compute shortest paths on a per-node basis to all routers, |
|
733 |
* and finally configure each of the node's forwarding tables. |
|
734 |
* |
|
10158
971f362648c3
Link to RFC num with \RFC{num}
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9870
diff
changeset
|
735 |
* The design is guided by OSPFv2 \RFC{2328} section 16.1.1 and quagga ospfd. |
1111 | 736 |
*/ |
737 |
class GlobalRouteManagerImpl |
|
738 |
{ |
|
739 |
public: |
|
740 |
GlobalRouteManagerImpl (); |
|
741 |
virtual ~GlobalRouteManagerImpl (); |
|
742 |
/** |
|
3959
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
743 |
* @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
|
744 |
* GlobalRouterInterface |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
745 |
* |
9870
6543f3876ff5
[Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8866
diff
changeset
|
746 |
* \todo separate manually assigned static routes from static routes that |
3959
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
747 |
* 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
|
748 |
* @internal |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
749 |
* |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
750 |
*/ |
ec65107df095
Segregate Ipv4GlobalRouting from Ipv4StaticRouting; add API for deleting and recomputing global routes
Tom Henderson <tomh@tomh.org>
parents:
3937
diff
changeset
|
751 |
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
|
752 |
|
04f9377661b8
convince global routing not to crash in the presence of bridges
Craig Dowell <craigdo@ee.washington.edu>
parents:
2250
diff
changeset
|
753 |
/** |
1111 | 754 |
* @brief Build the routing database by gathering Link State Advertisements |
755 |
* from each node exporting a GlobalRouter interface. |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
756 |
* @internal |
1111 | 757 |
*/ |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
758 |
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
|
759 |
|
1111 | 760 |
/** |
761 |
* @brief Compute routes using a Dijkstra SPF computation and populate |
|
762 |
* per-node forwarding tables |
|
1114
4bf5d1262aae
doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents:
1113
diff
changeset
|
763 |
* @internal |
1111 | 764 |
*/ |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
765 |
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
|
766 |
|
1111 | 767 |
/** |
768 |
* @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
|
769 |
* @internal |
1111 | 770 |
*/ |
771 |
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
|
772 |
|
1111 | 773 |
/** |
774 |
* @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
|
775 |
* @internal |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
776 |
* @param root the root node to start calculations |
1111 | 777 |
*/ |
778 |
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
|
779 |
|
1111 | 780 |
private: |
781 |
/** |
|
782 |
* @brief GlobalRouteManagerImpl copy construction is disallowed. |
|
783 |
* There's no need for it and a compiler provided shallow copy would be |
|
784 |
* wrong. |
|
10872
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
785 |
* |
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
786 |
* @param srmi object to copy from |
1111 | 787 |
*/ |
788 |
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
|
789 |
|
1111 | 790 |
/** |
791 |
* @brief Global Route Manager Implementation assignment operator is |
|
792 |
* disallowed. There's no need for it and a compiler provided shallow copy |
|
793 |
* would be hopelessly wrong. |
|
10872
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
794 |
* |
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
795 |
* @param srmi object to copy from |
0d7c9bf5f537
[Doxygen] internet module fixes
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10440
diff
changeset
|
796 |
* @returns the copied object |
1111 | 797 |
*/ |
798 |
GlobalRouteManagerImpl& operator= (GlobalRouteManagerImpl& srmi); |
|
799 |
||
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
800 |
SPFVertex* m_spfroot; //!< the root node |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
801 |
GlobalRouteManagerLSDB* m_lsdb; //!< the Link State DataBase (LSDB) of the Global Route Manager |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
802 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
803 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
804 |
* \brief Test if a node is a stub, from an OSPF sense. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
805 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
806 |
* If there is only one link of type 1 or 2, then a default route |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
807 |
* can safely be added to the next-hop router and SPF does not need |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
808 |
* to be run |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
809 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
810 |
* \param root the root node |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
811 |
* \returns true if the node is a stub |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
812 |
*/ |
4628
a5a8c44e4240
bug 521. Ipv4 global routing inefficient. Updated Tom's patch
Craig Dowell <craigdo@ee.washington.edu>
parents:
4616
diff
changeset
|
813 |
bool CheckForStubNode (Ipv4Address root); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
814 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
815 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
816 |
* \brief Calculate the shortest path first (SPF) tree |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
817 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
818 |
* Equivalent to quagga ospf_spf_calculate |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
819 |
* \param root the root node |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
820 |
*/ |
1111 | 821 |
void SPFCalculate (Ipv4Address root); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
822 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
823 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
824 |
* \brief Process Stub nodes |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
825 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
826 |
* Processing logic from RFC 2328, page 166 and quagga ospf_spf_process_stubs () |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
827 |
* stub link records will exist for point-to-point interfaces and for |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
828 |
* broadcast interfaces for which no neighboring router can be found |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
829 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
830 |
* \param v vertex to be processed |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
831 |
*/ |
3960
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
832 |
void SPFProcessStubs (SPFVertex* v); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
833 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
834 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
835 |
* \brief Process Autonomous Systems (AS) External LSA |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
836 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
837 |
* \param v vertex to be processed |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
838 |
* \param extlsa external LSA |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
839 |
*/ |
4745
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
840 |
void ProcessASExternals (SPFVertex* v, GlobalRoutingLSA* extlsa); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
841 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
842 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
843 |
* \brief Examine the links in v's LSA and update the list of candidates with any |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
844 |
* vertices not already on the list |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
845 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
846 |
* \internal |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
847 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
848 |
* This method is derived from quagga ospf_spf_next (). See RFC2328 Section |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
849 |
* 16.1 (2) for further details. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
850 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
851 |
* We're passed a parameter \a v that is a vertex which is already in the SPF |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
852 |
* tree. A vertex represents a router node. We also get a reference to the |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
853 |
* SPF candidate queue, which is a priority queue containing the shortest paths |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
854 |
* to the networks we know about. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
855 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
856 |
* We examine the links in v's LSA and update the list of candidates with any |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
857 |
* vertices not already on the list. If a lower-cost path is found to a |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
858 |
* vertex already on the candidate list, store the new (lower) cost. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
859 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
860 |
* \param v the vertex |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
861 |
* \param candidate the SPF candidate queue |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
862 |
*/ |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
863 |
void SPFNext (SPFVertex* v, CandidateQueue& candidate); |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
864 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
865 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
866 |
* \brief Calculate nexthop from root through V (parent) to vertex W (destination) |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
867 |
* with given distance from root->W. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
868 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
869 |
* This method is derived from quagga ospf_nexthop_calculation() 16.1.1. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
870 |
* For now, this is greatly simplified from the quagga code |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
871 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
872 |
* \param v the parent |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
873 |
* \param w the destination |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
874 |
* \param l the link record |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
875 |
* \param distance the target distance |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
876 |
* \returns 1 on success |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
877 |
*/ |
1111 | 878 |
int SPFNexthopCalculation (SPFVertex* v, SPFVertex* w, |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
879 |
GlobalRoutingLinkRecord* l, uint32_t distance); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
880 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
881 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
882 |
* \brief Adds a vertex to the list of children *in* each of its parents |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
883 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
884 |
* Derived from quagga ospf_vertex_add_parents () |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
885 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
886 |
* This is a somewhat oddly named method (blame quagga). Although you might |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
887 |
* expect it to add a parent *to* something, it actually adds a vertex |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
888 |
* to the list of children *in* each of its parents. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
889 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
890 |
* Given a pointer to a vertex, it links back to the vertex's parent that it |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
891 |
* already has set and adds itself to that vertex's list of children. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
892 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
893 |
* \param v the vertex |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
894 |
*/ |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
895 |
void SPFVertexAddParent (SPFVertex* v); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
896 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
897 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
898 |
* \brief Search for a link between two vertexes. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
899 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
900 |
* This method is derived from quagga ospf_get_next_link () |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
901 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
902 |
* First search the Global Router Link Records of vertex \a v for one |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
903 |
* representing a point-to point link to vertex \a w. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
904 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
905 |
* What is done depends on prev_link. Contrary to appearances, prev_link just |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
906 |
* acts as a flag here. If prev_link is NULL, we return the first Global |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
907 |
* Router Link Record we find that describes a point-to-point link from \a v |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
908 |
* to \a w. If prev_link is not NULL, we return a Global Router Link Record |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
909 |
* representing a possible *second* link from \a v to \a w. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
910 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
911 |
* \param v first vertex |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
912 |
* \param w second vertex |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
913 |
* \param prev_link the previous link in the list |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
914 |
* \returns the link's record |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
915 |
*/ |
1278 | 916 |
GlobalRoutingLinkRecord* SPFGetNextLink (SPFVertex* v, SPFVertex* w, |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
917 |
GlobalRoutingLinkRecord* prev_link); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
918 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
919 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
920 |
* \brief Add a host route to the routing tables |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
921 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
922 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
923 |
* This method is derived from quagga ospf_intra_add_router () |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
924 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
925 |
* This is where we are actually going to add the host routes to the routing |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
926 |
* tables of the individual nodes. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
927 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
928 |
* The vertex passed as a parameter has just been added to the SPF tree. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
929 |
* This vertex must have a valid m_root_oid, corresponding to the outgoing |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
930 |
* interface on the root router of the tree that is the first hop on the path |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
931 |
* to the vertex. The vertex must also have a next hop address, corresponding |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
932 |
* to the next hop on the path to the vertex. The vertex has an m_lsa field |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
933 |
* that has some number of link records. For each point to point link record, |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
934 |
* the m_linkData is the local IP address of the link. This corresponds to |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
935 |
* a destination IP address, reachable from the root, to which we add a host |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
936 |
* route. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
937 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
938 |
* \param v the vertex |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
939 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
940 |
*/ |
1113
5b63b39161e7
remove routing environment, move router interface creation to global-route-manager
Craig Dowell <craigdo@ee.washington.edu>
parents:
1112
diff
changeset
|
941 |
void SPFIntraAddRouter (SPFVertex* v); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
942 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
943 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
944 |
* \brief Add a transit to the routing tables |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
945 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
946 |
* \param v the vertex |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
947 |
*/ |
1278 | 948 |
void SPFIntraAddTransit (SPFVertex* v); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
949 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
950 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
951 |
* \brief Add a stub to the routing tables |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
952 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
953 |
* \param l the global routing link record |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
954 |
* \param v the vertex |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
955 |
*/ |
3960
34908804c029
Add processing logic for stub links in global routing code
Tom Henderson <tomh@tomh.org>
parents:
3959
diff
changeset
|
956 |
void SPFIntraAddStub (GlobalRoutingLinkRecord *l, SPFVertex* v); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
957 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
958 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
959 |
* \brief Add an external route to the routing tables |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
960 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
961 |
* \param extlsa the external LSA |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
962 |
* \param v the vertex |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
963 |
*/ |
4745
a0e27af57c8d
Allow injection of routes to Ipv4GlobalRouting
Antti Makela <zarhan@cc.hut.fi>
parents:
4628
diff
changeset
|
964 |
void SPFAddASExternal (GlobalRoutingLSA *extlsa, SPFVertex *v); |
10440
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
965 |
|
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
966 |
/** |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
967 |
* \brief Return the interface number corresponding to a given IP address and mask |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
968 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
969 |
* This is a wrapper around GetInterfaceForPrefix(), but we first |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
970 |
* have to find the right node pointer to pass to that function. |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
971 |
* If no such interface is found, return -1 (note: unit test framework |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
972 |
* for routing assumes -1 to be a legal return value) |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
973 |
* |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
974 |
* \param a the target IP address |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
975 |
* \param amask the target subnet mask |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
976 |
* \return the outgoing interface number |
1e48ff9185f1
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10158
diff
changeset
|
977 |
*/ |
4476 | 978 |
int32_t FindOutgoingInterfaceId (Ipv4Address a, |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7176
diff
changeset
|
979 |
Ipv4Mask amask = Ipv4Mask ("255.255.255.255")); |
1111 | 980 |
}; |
981 |
||
982 |
} // namespace ns3 |
|
983 |
||
984 |
#endif /* GLOBAL_ROUTE_MANAGER_IMPL_H */ |