Debian Codegraph @

rfc1583.html

raw
1 <pre>Network Working Group J. Moy
2 Request for Comments: 1583 Proteon, Inc.
3 Obsoletes: <a href="./rfc1247">1247</a> March 1994
4 Category: Standards Track
5
6
7 <span class="h1">OSPF Version 2</span>
8
9
10
11 Status of this Memo
12
13 This document specifies an Internet standards track protocol for the
14 Internet community, and requests discussion and suggestions for
15 improvements. Please refer to the current edition of the "Internet
16 Official Protocol Standards" (STD 1) for the standardization state
17 and status of this protocol. Distribution of this memo is
18 unlimited.
19
20 Abstract
21
22 This memo documents version 2 of the OSPF protocol. OSPF is a
23 link-state routing protocol. It is designed to be run internal to a
24 single Autonomous System. Each OSPF router maintains an identical
25 database describing the Autonomous System's topology. From this
26 database, a routing table is calculated by constructing a shortest-
27 path tree.
28
29 OSPF recalculates routes quickly in the face of topological changes,
30 utilizing a minimum of routing protocol traffic. OSPF provides
31 support for equal-cost multipath. Separate routes can be calculated
32 for each IP Type of Service. An area routing capability is
33 provided, enabling an additional level of routing protection and a
34 reduction in routing protocol traffic. In addition, all OSPF
35 routing protocol exchanges are authenticated.
36
37 OSPF Version 2 was originally documented in <a href="./rfc1247">RFC 1247</a>. The
38 differences between <a href="./rfc1247">RFC 1247</a> and this memo are explained in <a href="#appendix-E">Appendix</a>
39 <a href="#appendix-E">E</a>. The differences consist of bug fixes and clarifications, and are
40 backward-compatible in nature. Implementations of <a href="./rfc1247">RFC 1247</a> and of
41 this memo will interoperate.
42
43 Please send comments to [email protected].
44
45
46
47
48
49
50
51
52 <span class="grey">Moy [Page 1]</span></pre>
53 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
54 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
55
56
57 Table of Contents
58
59 <a href="#section-1">1</a> Introduction ........................................... <a href="#page-5">5</a>
60 <a href="#section-1.1">1.1</a> Protocol Overview ...................................... <a href="#page-5">5</a>
61 <a href="#section-1.2">1.2</a> Definitions of commonly used terms ..................... <a href="#page-6">6</a>
62 <a href="#section-1.3">1.3</a> Brief history of link-state routing technology ......... <a href="#page-9">9</a>
63 <a href="#section-1.4">1.4</a> Organization of this document .......................... <a href="#page-9">9</a>
64 <a href="#section-2">2</a> The Topological Database .............................. <a href="#page-10">10</a>
65 <a href="#section-2.1">2.1</a> The shortest-path tree ................................ <a href="#page-13">13</a>
66 <a href="#section-2.2">2.2</a> Use of external routing information ................... <a href="#page-16">16</a>
67 <a href="#section-2.3">2.3</a> Equal-cost multipath .................................. <a href="#page-20">20</a>
68 <a href="#section-2.4">2.4</a> TOS-based routing ..................................... <a href="#page-20">20</a>
69 <a href="#section-3">3</a> Splitting the AS into Areas ........................... <a href="#page-21">21</a>
70 <a href="#section-3.1">3.1</a> The backbone of the Autonomous System ................. <a href="#page-22">22</a>
71 <a href="#section-3.2">3.2</a> Inter-area routing .................................... <a href="#page-22">22</a>
72 <a href="#section-3.3">3.3</a> Classification of routers ............................. <a href="#page-23">23</a>
73 <a href="#section-3.4">3.4</a> A sample area configuration ........................... <a href="#page-24">24</a>
74 <a href="#section-3.5">3.5</a> IP subnetting support ................................. <a href="#page-30">30</a>
75 <a href="#section-3.6">3.6</a> Supporting stub areas ................................. <a href="#page-31">31</a>
76 <a href="#section-3.7">3.7</a> Partitions of areas ................................... <a href="#page-32">32</a>
77 <a href="#section-4">4</a> Functional Summary .................................... <a href="#page-34">34</a>
78 <a href="#section-4.1">4.1</a> Inter-area routing .................................... <a href="#page-35">35</a>
79 <a href="#section-4.2">4.2</a> AS external routes .................................... <a href="#page-35">35</a>
80 <a href="#section-4.3">4.3</a> Routing protocol packets .............................. <a href="#page-35">35</a>
81 <a href="#section-4.4">4.4</a> Basic implementation requirements ..................... <a href="#page-38">38</a>
82 <a href="#section-4.5">4.5</a> Optional OSPF capabilities ............................ <a href="#page-39">39</a>
83 <a href="#section-5">5</a> Protocol data structures .............................. <a href="#page-41">41</a>
84 <a href="#section-6">6</a> The Area Data Structure ............................... <a href="#page-42">42</a>
85 <a href="#section-7">7</a> Bringing Up Adjacencies ............................... <a href="#page-45">45</a>
86 <a href="#section-7.1">7.1</a> The Hello Protocol .................................... <a href="#page-45">45</a>
87 <a href="#section-7.2">7.2</a> The Synchronization of Databases ...................... <a href="#page-46">46</a>
88 <a href="#section-7.3">7.3</a> The Designated Router ................................. <a href="#page-47">47</a>
89 <a href="#section-7.4">7.4</a> The Backup Designated Router .......................... <a href="#page-48">48</a>
90 <a href="#section-7.5">7.5</a> The graph of adjacencies .............................. <a href="#page-49">49</a>
91 <a href="#section-8">8</a> Protocol Packet Processing ............................ <a href="#page-50">50</a>
92 <a href="#section-8.1">8.1</a> Sending protocol packets .............................. <a href="#page-51">51</a>
93 <a href="#section-8.2">8.2</a> Receiving protocol packets ............................ <a href="#page-53">53</a>
94 <a href="#section-9">9</a> The Interface Data Structure .......................... <a href="#page-55">55</a>
95 <a href="#section-9.1">9.1</a> Interface states ...................................... <a href="#page-58">58</a>
96 <a href="#section-9.2">9.2</a> Events causing interface state changes ................ <a href="#page-61">61</a>
97 <a href="#section-9.3">9.3</a> The Interface state machine ........................... <a href="#page-62">62</a>
98 <a href="#section-9.4">9.4</a> Electing the Designated Router ........................ <a href="#page-65">65</a>
99 <a href="#section-9.5">9.5</a> Sending Hello packets ................................. <a href="#page-67">67</a>
100 <a href="#section-9.5.1">9.5.1</a> Sending Hello packets on non-broadcast networks ....... <a href="#page-68">68</a>
101 <a href="#section-10">10</a> The Neighbor Data Structure ........................... <a href="#page-69">69</a>
102 <a href="#section-10.1">10.1</a> Neighbor states ....................................... <a href="#page-72">72</a>
103 <a href="#section-10.2">10.2</a> Events causing neighbor state changes ................. <a href="#page-75">75</a>
104 <a href="#section-10.3">10.3</a> The Neighbor state machine ............................ <a href="#page-77">77</a>
105
106
107
108 <span class="grey">Moy [Page 2]</span></pre>
109 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
110 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
111
112
113 <a href="#section-10.4">10.4</a> Whether to become adjacent ............................ <a href="#page-83">83</a>
114 <a href="#section-10.5">10.5</a> Receiving Hello Packets ............................... <a href="#page-83">83</a>
115 <a href="#section-10.6">10.6</a> Receiving Database Description Packets ................ <a href="#page-86">86</a>
116 <a href="#section-10.7">10.7</a> Receiving Link State Request Packets .................. <a href="#page-89">89</a>
117 <a href="#section-10.8">10.8</a> Sending Database Description Packets .................. <a href="#page-89">89</a>
118 <a href="#section-10.9">10.9</a> Sending Link State Request Packets .................... <a href="#page-90">90</a>
119 <a href="#section-10.10">10.10</a> An Example ............................................ <a href="#page-91">91</a>
120 <a href="#section-11">11</a> The Routing Table Structure ........................... <a href="#page-93">93</a>
121 <a href="#section-11.1">11.1</a> Routing table lookup .................................. <a href="#page-96">96</a>
122 <a href="#section-11.2">11.2</a> Sample routing table, without areas ................... <a href="#page-97">97</a>
123 <a href="#section-11.3">11.3</a> Sample routing table, with areas ...................... <a href="#page-98">98</a>
124 <a href="#section-12">12</a> Link State Advertisements ............................ <a href="#page-100">100</a>
125 <a href="#section-12.1">12.1</a> The Link State Advertisement Header .................. <a href="#page-101">101</a>
126 <a href="#section-12.1.1">12.1.1</a> LS age ............................................... <a href="#page-102">102</a>
127 <a href="#section-12.1.2">12.1.2</a> Options .............................................. <a href="#page-102">102</a>
128 <a href="#section-12.1.3">12.1.3</a> LS type .............................................. <a href="#page-103">103</a>
129 <a href="#section-12.1.4">12.1.4</a> Link State ID ........................................ <a href="#page-103">103</a>
130 <a href="#section-12.1.5">12.1.5</a> Advertising Router ................................... <a href="#page-105">105</a>
131 <a href="#section-12.1.6">12.1.6</a> LS sequence number ................................... <a href="#page-105">105</a>
132 <a href="#section-12.1.7">12.1.7</a> LS checksum .......................................... <a href="#page-106">106</a>
133 <a href="#section-12.2">12.2</a> The link state database .............................. <a href="#page-107">107</a>
134 <a href="#section-12.3">12.3</a> Representation of TOS ................................ <a href="#page-108">108</a>
135 <a href="#section-12.4">12.4</a> Originating link state advertisements ................ <a href="#page-109">109</a>
136 <a href="#section-12.4.1">12.4.1</a> Router links ......................................... <a href="#page-112">112</a>
137 <a href="#section-12.4.2">12.4.2</a> Network links ........................................ <a href="#page-118">118</a>
138 <a href="#section-12.4.3">12.4.3</a> Summary links ........................................ <a href="#page-120">120</a>
139 <a href="#section-12.4.4">12.4.4</a> Originating summary links into stub areas ............ <a href="#page-123">123</a>
140 <a href="#section-12.4.5">12.4.5</a> AS external links .................................... <a href="#page-124">124</a>
141 <a href="#section-13">13</a> The Flooding Procedure ............................... <a href="#page-126">126</a>
142 <a href="#section-13.1">13.1</a> Determining which link state is newer ................ <a href="#page-130">130</a>
143 13.2 Installing link state advertisements in the database . 130
144 <a href="#section-13.3">13.3</a> Next step in the flooding procedure .................. <a href="#page-131">131</a>
145 <a href="#section-13.4">13.4</a> Receiving self-originated link state ................. <a href="#page-134">134</a>
146 <a href="#section-13.5">13.5</a> Sending Link State Acknowledgment packets ............ <a href="#page-135">135</a>
147 <a href="#section-13.6">13.6</a> Retransmitting link state advertisements ............. <a href="#page-136">136</a>
148 <a href="#section-13.7">13.7</a> Receiving link state acknowledgments ................. <a href="#page-138">138</a>
149 <a href="#section-14">14</a> Aging The Link State Database ........................ <a href="#page-139">139</a>
150 <a href="#section-14.1">14.1</a> Premature aging of advertisements .................... <a href="#page-139">139</a>
151 <a href="#section-15">15</a> Virtual Links ........................................ <a href="#page-140">140</a>
152 <a href="#section-16">16</a> Calculation Of The Routing Table ..................... <a href="#page-142">142</a>
153 <a href="#section-16.1">16.1</a> Calculating the shortest-path tree for an area ....... <a href="#page-143">143</a>
154 <a href="#section-16.1.1">16.1.1</a> The next hop calculation ............................. <a href="#page-149">149</a>
155 <a href="#section-16.2">16.2</a> Calculating the inter-area routes .................... <a href="#page-150">150</a>
156 <a href="#section-16.3">16.3</a> Examining transit areas' summary links ............... <a href="#page-152">152</a>
157 <a href="#section-16.4">16.4</a> Calculating AS external routes ....................... <a href="#page-154">154</a>
158 <a href="#section-16.5">16.5</a> Incremental updates -- summary link advertisements ... <a href="#page-156">156</a>
159 16.6 Incremental updates -- AS external link advertisements 157
160 16.7 Events generated as a result of routing table changes 157
161
162
163
164 <span class="grey">Moy [Page 3]</span></pre>
165 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
166 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
167
168
169 <a href="#section-16.8">16.8</a> Equal-cost multipath ................................. <a href="#page-158">158</a>
170 16.9 Building the non-zero-TOS portion of the routing table 158
171 Footnotes ............................................ <a href="#page-161">161</a>
172 References ........................................... <a href="#page-164">164</a>
173 <a href="#appendix-A">A</a> OSPF data formats .................................... <a href="#page-166">166</a>
174 <a href="#appendix-A.1">A.1</a> Encapsulation of OSPF packets ........................ <a href="#page-166">166</a>
175 <a href="#appendix-A.2">A.2</a> The Options field .................................... <a href="#page-168">168</a>
176 <a href="#appendix-A.3">A.3</a> OSPF Packet Formats .................................. <a href="#page-170">170</a>
177 <a href="#appendix-A.3.1">A.3.1</a> The OSPF packet header ............................... <a href="#page-171">171</a>
178 <a href="#appendix-A.3.2">A.3.2</a> The Hello packet ..................................... <a href="#page-173">173</a>
179 <a href="#appendix-A.3.3">A.3.3</a> The Database Description packet ...................... <a href="#page-175">175</a>
180 <a href="#appendix-A.3.4">A.3.4</a> The Link State Request packet ........................ <a href="#page-177">177</a>
181 <a href="#appendix-A.3.5">A.3.5</a> The Link State Update packet ......................... <a href="#page-179">179</a>
182 <a href="#appendix-A.3.6">A.3.6</a> The Link State Acknowledgment packet ................. <a href="#page-181">181</a>
183 <a href="#appendix-A.4">A.4</a> Link state advertisement formats ..................... <a href="#page-183">183</a>
184 <a href="#appendix-A.4.1">A.4.1</a> The Link State Advertisement header .................. <a href="#page-184">184</a>
185 <a href="#appendix-A.4.2">A.4.2</a> Router links advertisements .......................... <a href="#page-186">186</a>
186 <a href="#appendix-A.4.3">A.4.3</a> Network links advertisements ......................... <a href="#page-190">190</a>
187 <a href="#appendix-A.4.4">A.4.4</a> Summary link advertisements .......................... <a href="#page-192">192</a>
188 <a href="#appendix-A.4.5">A.4.5</a> AS external link advertisements ...................... <a href="#page-194">194</a>
189 <a href="#appendix-B">B</a> Architectural Constants .............................. <a href="#page-196">196</a>
190 <a href="#appendix-C">C</a> Configurable Constants ............................... <a href="#page-198">198</a>
191 <a href="#appendix-C.1">C.1</a> Global parameters .................................... <a href="#page-198">198</a>
192 <a href="#appendix-C.2">C.2</a> Area parameters ...................................... <a href="#page-198">198</a>
193 <a href="#appendix-C.3">C.3</a> Router interface parameters .......................... <a href="#page-200">200</a>
194 <a href="#appendix-C.4">C.4</a> Virtual link parameters .............................. <a href="#page-202">202</a>
195 <a href="#appendix-C.5">C.5</a> Non-broadcast, multi-access network parameters ....... <a href="#page-203">203</a>
196 <a href="#appendix-C.6">C.6</a> Host route parameters ................................ <a href="#page-203">203</a>
197 <a href="#appendix-D">D</a> Authentication ....................................... <a href="#page-205">205</a>
198 <a href="#appendix-D.1">D.1</a> AuType 0 -- No authentication ........................ <a href="#page-205">205</a>
199 <a href="#appendix-D.2">D.2</a> AuType 1 -- Simple password .......................... <a href="#page-205">205</a>
200 <a href="#appendix-E">E</a> Differences from <a href="./rfc1247">RFC 1247</a> ............................ <a href="#page-207">207</a>
201 <a href="#appendix-E.1">E.1</a> A fix for a problem with OSPF Virtual links .......... <a href="#page-207">207</a>
202 <a href="#appendix-E.2">E.2</a> Supporting supernetting and subnet 0 ................. <a href="#page-208">208</a>
203 E.3 Obsoleting LSInfinity in router links advertisements . 209
204 <a href="#appendix-E.4">E.4</a> TOS encoding updated ................................. <a href="#page-209">209</a>
205 <a href="#appendix-E.5">E.5</a> Summarizing routes into transit areas ................ <a href="#page-210">210</a>
206 <a href="#appendix-E.6">E.6</a> Summarizing routes into stub areas ................... <a href="#page-210">210</a>
207 <a href="#appendix-E.7">E.7</a> Flushing anomalous network links advertisements ...... <a href="#page-210">210</a>
208 <a href="#appendix-E.8">E.8</a> Required Statistics appendix deleted ................. <a href="#page-211">211</a>
209 <a href="#appendix-E.9">E.9</a> Other changes ........................................ <a href="#page-211">211</a>
210 <a href="#appendix-F">F</a>. An algorithm for assigning Link State IDs ............ <a href="#page-213">213</a>
211 Security Considerations .............................. <a href="#page-216">216</a>
212 Author's Address ..................................... <a href="#page-216">216</a>
213
214
215
216
217
218
219
220 <span class="grey">Moy [Page 4]</span></pre>
221 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
222 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
223
224
225 <span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
226
227 This document is a specification of the Open Shortest Path First
228 (OSPF) TCP/IP internet routing protocol. OSPF is classified as an
229 Interior Gateway Protocol (IGP). This means that it distributes
230 routing information between routers belonging to a single Autonomous
231 System. The OSPF protocol is based on link-state or SPF technology.
232 This is a departure from the Bellman-Ford base used by traditional
233 TCP/IP internet routing protocols.
234
235 The OSPF protocol was developed by the OSPF working group of the
236 Internet Engineering Task Force. It has been designed expressly for
237 the TCP/IP internet environment, including explicit support for IP
238 subnetting, TOS-based routing and the tagging of externally-derived
239 routing information. OSPF also provides for the authentication of
240 routing updates, and utilizes IP multicast when sending/receiving
241 the updates. In addition, much work has been done to produce a
242 protocol that responds quickly to topology changes, yet involves
243 small amounts of routing protocol traffic.
244
245 The author would like to thank Fred Baker, Jeffrey Burgan, Rob
246 Coltun, Dino Farinacci, Vince Fuller, Phanindra Jujjavarapu, Milo
247 Medin, Kannan Varadhan and the rest of the OSPF working group for
248 the ideas and support they have given to this project.
249
250 1.1. Protocol overview
251
252 OSPF routes IP packets based solely on the destination IP
253 address and IP Type of Service found in the IP packet header.
254 IP packets are routed "as is" -- they are not encapsulated in
255 any further protocol headers as they transit the Autonomous
256 System. OSPF is a dynamic routing protocol. It quickly detects
257 topological changes in the AS (such as router interface
258 failures) and calculates new loop-free routes after a period of
259 convergence. This period of convergence is short and involves a
260 minimum of routing traffic.
261
262 In a link-state routing protocol, each router maintains a
263 database describing the Autonomous System's topology. Each
264 participating router has an identical database. Each individual
265 piece of this database is a particular router's local state
266 (e.g., the router's usable interfaces and reachable neighbors).
267 The router distributes its local state throughout the Autonomous
268 System by flooding.
269
270 All routers run the exact same algorithm, in parallel. From the
271 topological database, each router constructs a tree of shortest
272 paths with itself as root. This shortest-path tree gives the
273
274
275
276 <span class="grey">Moy [Page 5]</span></pre>
277 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
278 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
279
280
281 route to each destination in the Autonomous System. Externally
282 derived routing information appears on the tree as leaves.
283
284 OSPF calculates separate routes for each Type of Service (TOS).
285 When several equal-cost routes to a destination exist, traffic
286 is distributed equally among them. The cost of a route is
287 described by a single dimensionless metric.
288
289 OSPF allows sets of networks to be grouped together. Such a
290 grouping is called an area. The topology of an area is hidden
291 from the rest of the Autonomous System. This information hiding
292 enables a significant reduction in routing traffic. Also,
293 routing within the area is determined only by the area's own
294 topology, lending the area protection from bad routing data. An
295 area is a generalization of an IP subnetted network.
296
297 OSPF enables the flexible configuration of IP subnets. Each
298 route distributed by OSPF has a destination and mask. Two
299 different subnets of the same IP network number may have
300 different sizes (i.e., different masks). This is commonly
301 referred to as variable length subnetting. A packet is routed
302 to the best (i.e., longest or most specific) match. Host routes
303 are considered to be subnets whose masks are "all ones"
304 (0xffffffff).
305
306 All OSPF protocol exchanges are authenticated. This means that
307 only trusted routers can participate in the Autonomous System's
308 routing. A variety of authentication schemes can be used; a
309 single authentication scheme is configured for each area. This
310 enables some areas to use much stricter authentication than
311 others.
312
313 Externally derived routing data (e.g., routes learned from the
314 Exterior Gateway Protocol (EGP)) is passed transparently
315 throughout the Autonomous System. This externally derived data
316 is kept separate from the OSPF protocol's link state data. Each
317 external route can also be tagged by the advertising router,
318 enabling the passing of additional information between routers
319 on the boundaries of the Autonomous System.
320
321
322 1.2. Definitions of commonly used terms
323
324 This section provides definitions for terms that have a specific
325 meaning to the OSPF protocol and that are used throughout the
326 text. The reader unfamiliar with the Internet Protocol Suite is
327 referred to [<a href="#ref-RS-85-153" title="&quot;The DARPA Internet Protocol Suite&quot;">RS-85-153</a>] for an introduction to IP.
328
329
330
331
332 <span class="grey">Moy [Page 6]</span></pre>
333 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
334 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
335
336
337 Router
338 A level three Internet Protocol packet switch. Formerly
339 called a gateway in much of the IP literature.
340
341 Autonomous System
342 A group of routers exchanging routing information via a
343 common routing protocol. Abbreviated as AS.
344
345 Interior Gateway Protocol
346 The routing protocol spoken by the routers belonging to an
347 Autonomous system. Abbreviated as IGP. Each Autonomous
348 System has a single IGP. Separate Autonomous Systems may be
349 running different IGPs.
350
351 Router ID
352 A 32-bit number assigned to each router running the OSPF
353 protocol. This number uniquely identifies the router within
354 an Autonomous System.
355
356 Network
357 In this memo, an IP network/subnet/supernet. It is possible
358 for one physical network to be assigned multiple IP
359 network/subnet numbers. We consider these to be separate
360 networks. Point-to-point physical networks are an exception
361 - they are considered a single network no matter how many
362 (if any at all) IP network/subnet numbers are assigned to
363 them.
364
365 Network mask
366 A 32-bit number indicating the range of IP addresses
367 residing on a single IP network/subnet/supernet. This
368 specification displays network masks as hexadecimal numbers.
369 For example, the network mask for a class C IP network is
370 displayed as 0xffffff00. Such a mask is often displayed
371 elsewhere in the literature as 255.255.255.0.
372
373 Multi-access networks
374 Those physical networks that support the attachment of
375 multiple (more than two) routers. Each pair of routers on
376 such a network is assumed to be able to communicate directly
377 (e.g., multi-drop networks are excluded).
378
379 Interface
380 The connection between a router and one of its attached
381 networks. An interface has state information associated
382 with it, which is obtained from the underlying lower level
383 protocols and the routing protocol itself. An interface to
384 a network has associated with it a single IP address and
385
386
387
388 <span class="grey">Moy [Page 7]</span></pre>
389 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
390 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
391
392
393 mask (unless the network is an unnumbered point-to-point
394 network). An interface is sometimes also referred to as a
395 link.
396
397 Neighboring routers
398 Two routers that have interfaces to a common network. On
399 multi-access networks, neighbors are dynamically discovered
400 by OSPF's Hello Protocol.
401
402 Adjacency
403 A relationship formed between selected neighboring routers
404 for the purpose of exchanging routing information. Not
405 every pair of neighboring routers become adjacent.
406
407 Link state advertisement
408 Describes the local state of a router or network. This
409 includes the state of the router's interfaces and
410 adjacencies. Each link state advertisement is flooded
411 throughout the routing domain. The collected link state
412 advertisements of all routers and networks forms the
413 protocol's topological database.
414
415 Hello Protocol
416 The part of the OSPF protocol used to establish and maintain
417 neighbor relationships. On multi-access networks the Hello
418 Protocol can also dynamically discover neighboring routers.
419
420 Designated Router
421 Each multi-access network that has at least two attached
422 routers has a Designated Router. The Designated Router
423 generates a link state advertisement for the multi-access
424 network and has other special responsibilities in the
425 running of the protocol. The Designated Router is elected
426 by the Hello Protocol.
427
428 The Designated Router concept enables a reduction in the
429 number of adjacencies required on a multi-access network.
430 This in turn reduces the amount of routing protocol traffic
431 and the size of the topological database.
432
433 Lower-level protocols
434 The underlying network access protocols that provide
435 services to the Internet Protocol and in turn the OSPF
436 protocol. Examples of these are the X.25 packet and frame
437 levels for X.25 PDNs, and the ethernet data link layer for
438 ethernets.
439
440
441
442
443
444 <span class="grey">Moy [Page 8]</span></pre>
445 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
446 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
447
448
449 1.3. Brief history of link-state routing technology
450
451 OSPF is a link state routing protocol. Such protocols are also
452 referred to in the literature as SPF-based or distributed-
453 database protocols. This section gives a brief description of
454 the developments in link-state technology that have influenced
455 the OSPF protocol.
456
457 The first link-state routing protocol was developed for use in
458 the ARPANET packet switching network. This protocol is
459 described in [<a href="#ref-McQuillan" title="&quot;The New Routing Algorithm for the Arpanet&quot;">McQuillan</a>]. It has formed the starting point for
460 all other link-state protocols. The homogeneous Arpanet
461 environment, i.e., single-vendor packet switches connected by
462 synchronous serial lines, simplified the design and
463 implementation of the original protocol.
464
465 Modifications to this protocol were proposed in [<a href="#ref-Perlman" title="&quot;Fault-Tolerant Broadcast of Routing Information&quot;">Perlman</a>].
466 These modifications dealt with increasing the fault tolerance of
467 the routing protocol through, among other things, adding a
468 checksum to the link state advertisements (thereby detecting
469 database corruption). The paper also included means for
470 reducing the routing traffic overhead in a link-state protocol.
471 This was accomplished by introducing mechanisms which enabled
472 the interval between link state advertisement originations to be
473 increased by an order of magnitude.
474
475 A link-state algorithm has also been proposed for use as an ISO
476 IS-IS routing protocol. This protocol is described in [<a href="#ref-DEC" title="&quot;Information processing systems -- Data communications -- Intermediate System to Intermediate System Intra- Domain Routing Protocol&quot;">DEC</a>].
477 The protocol includes methods for data and routing traffic
478 reduction when operating over broadcast networks. This is
479 accomplished by election of a Designated Router for each
480 broadcast network, which then originates a link state
481 advertisement for the network.
482
483 The OSPF subcommittee of the IETF has extended this work in
484 developing the OSPF protocol. The Designated Router concept has
485 been greatly enhanced to further reduce the amount of routing
486 traffic required. Multicast capabilities are utilized for
487 additional routing bandwidth reduction. An area routing scheme
488 has been developed enabling information
489 hiding/protection/reduction. Finally, the algorithm has been
490 modified for efficient operation in TCP/IP internets.
491
492
493 1.4. Organization of this document
494
495 The first three sections of this specification give a general
496 overview of the protocol's capabilities and functions. Sections
497
498
499
500 <span class="grey">Moy [Page 9]</span></pre>
501 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
502 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
503
504
505 4-16 explain the protocol's mechanisms in detail. Packet
506 formats, protocol constants and configuration items are
507 specified in the appendices.
508
509 Labels such as HelloInterval encountered in the text refer to
510 protocol constants. They may or may not be configurable. The
511 architectural constants are explained in <a href="#appendix-B">Appendix B</a>. The
512 configurable constants are explained in <a href="#appendix-C">Appendix C</a>.
513
514 The detailed specification of the protocol is presented in terms
515 of data structures. This is done in order to make the
516 explanation more precise. Implementations of the protocol are
517 required to support the functionality described, but need not
518 use the precise data structures that appear in this memo.
519
520
521 <span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. The Topological Database</span>
522
523 The Autonomous System's topological database describes a directed
524 graph. The vertices of the graph consist of routers and networks.
525 A graph edge connects two routers when they are attached via a
526 physical point-to-point network. An edge connecting a router to a
527 network indicates that the router has an interface on the network.
528
529 The vertices of the graph can be further typed according to
530 function. Only some of these types carry transit data traffic; that
531 is, traffic that is neither locally originated nor locally destined.
532 Vertices that can carry transit traffic are indicated on the graph
533 by having both incoming and outgoing edges.
534
535
536
537 Vertex type Vertex name Transit?
538 _____________________________________
539 1 Router yes
540 2 Network yes
541 3 Stub network no
542
543
544 Table 1: OSPF vertex types.
545
546
547 OSPF supports the following types of physical networks:
548
549
550 Point-to-point networks
551 A network that joins a single pair of routers. A 56Kb serial
552 line is an example of a point-to-point network.
553
554
555
556 <span class="grey">Moy [Page 10]</span></pre>
557 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
558 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
559
560
561 Broadcast networks
562 Networks supporting many (more than two) attached routers,
563 together with the capability to address a single physical
564 message to all of the attached routers (broadcast). Neighboring
565 routers are discovered dynamically on these nets using OSPF's
566 Hello Protocol. The Hello Protocol itself takes advantage of
567 the broadcast capability. The protocol makes further use of
568 multicast capabilities, if they exist. An ethernet is an
569 example of a broadcast network.
570
571 Non-broadcast networks
572 Networks supporting many (more than two) routers, but having no
573 broadcast capability. Neighboring routers are also discovered
574 on these nets using OSPF's Hello Protocol. However, due to the
575 lack of broadcast capability, some configuration information is
576 necessary for the correct operation of the Hello Protocol. On
577 these networks, OSPF protocol packets that are normally
578 multicast need to be sent to each neighboring router, in turn.
579 An X.25 Public Data Network (PDN) is an example of a non-
580 broadcast network.
581
582
583 The neighborhood of each network node in the graph depends on
584 whether the network has multi-access capabilities (either broadcast
585 or non-broadcast) and, if so, the number of routers having an
586 interface to the network. The three cases are depicted in Figure 1.
587 Rectangles indicate routers. Circles and oblongs indicate multi-
588 access networks. Router names are prefixed with the letters RT and
589 network names with the letter N. Router interface names are
590 prefixed by the letter I. Lines between routers indicate point-to-
591 point networks. The left side of the figure shows a network with
592 its connected routers, with the resulting graph shown on the right.
593
594 Two routers joined by a point-to-point network are represented in
595 the directed graph as being directly connected by a pair of edges,
596 one in each direction. Interfaces to physical point-to-point
597 networks need not be assigned IP addresses. Such a point-to-point
598 network is called unnumbered. The graphical representation of
599 point-to-point networks is designed so that unnumbered networks can
600 be supported naturally. When interface addresses exist, they are
601 modelled as stub routes. Note that each router would then have a
602 stub connection to the other router's interface address (see Figure
603 1).
604
605 When multiple routers are attached to a multi-access network, the
606 directed graph shows all routers bidirectionally connected to the
607 network vertex (again, see Figure 1). If only a single router is
608 attached to a multi-access network, the network will appear in the
609
610
611
612 <span class="grey">Moy [Page 11]</span></pre>
613 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
614 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
615
616
617
618
619
620 **FROM**
621
622 * |RT1|RT2|
623 +---+Ia +---+ * ------------
624 |RT1|------|RT2| T RT1| | X |
625 +---+ Ib+---+ O RT2| X | |
626 * Ia| | X |
627 * Ib| X | |
628
629 Physical point-to-point networks
630
631 **FROM**
632 +---+ +---+
633 |RT3| |RT4| |RT3|RT4|RT5|RT6|N2 |
634 +---+ +---+ * ------------------------
635 | N2 | * RT3| | | | | X |
636 +----------------------+ T RT4| | | | | X |
637 | | O RT5| | | | | X |
638 +---+ +---+ * RT6| | | | | X |
639 |RT5| |RT6| * N2| X | X | X | X | |
640 +---+ +---+
641
642 Multi-access networks
643
644 **FROM**
645 +---+ *
646 |RT7| * |RT7| N3|
647 +---+ T ------------
648 | O RT7| | |
649 +----------------------+ * N3| X | |
650 N3 *
651
652 Stub multi-access networks
653
654
655
656 Figure 1: Network map components
657
658 Networks and routers are represented by vertices.
659 An edge connects Vertex A to Vertex B iff the
660 intersection of Column A and Row B is marked with
661 an X.
662
663
664
665
666
667
668 <span class="grey">Moy [Page 12]</span></pre>
669 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
670 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
671
672
673 directed graph as a stub connection.
674
675 Each network (stub or transit) in the graph has an IP address and
676 associated network mask. The mask indicates the number of nodes on
677 the network. Hosts attached directly to routers (referred to as
678 host routes) appear on the graph as stub networks. The network mask
679 for a host route is always 0xffffffff, which indicates the presence
680 of a single node.
681
682 Figure 2 shows a sample map of an Autonomous System. The rectangle
683 labelled H1 indicates a host, which has a SLIP connection to Router
684 RT12. Router RT12 is therefore advertising a host route. Lines
685 between routers indicate physical point-to-point networks. The only
686 point-to-point network that has been assigned interface addresses is
687 the one joining Routers RT6 and RT10. Routers RT5 and RT7 have EGP
688 connections to other Autonomous Systems. A set of EGP-learned
689 routes have been displayed for both of these routers.
690
691 A cost is associated with the output side of each router interface.
692 This cost is configurable by the system administrator. The lower
693 the cost, the more likely the interface is to be used to forward
694 data traffic. Costs are also associated with the externally derived
695 routing data (e.g., the EGP-learned routes).
696
697 The directed graph resulting from the map in Figure 2 is depicted in
698 Figure 3. Arcs are labelled with the cost of the corresponding
699 router output interface. Arcs having no labelled cost have a cost
700 of 0. Note that arcs leading from networks to routers always have
701 cost 0; they are significant nonetheless. Note also that the
702 externally derived routing data appears on the graph as stubs.
703
704 The topological database (or what has been referred to above as the
705 directed graph) is pieced together from link state advertisements
706 generated by the routers. The neighborhood of each transit vertex
707 is represented in a single, separate link state advertisement.
708 Figure 4 shows graphically the link state representation of the two
709 kinds of transit vertices: routers and multi-access networks.
710 Router RT12 has an interface to two broadcast networks and a SLIP
711 line to a host. Network N6 is a broadcast network with three
712 attached routers. The cost of all links from Network N6 to its
713 attached routers is 0. Note that the link state advertisement for
714 Network N6 is actually generated by one of the attached routers: the
715 router that has been elected Designated Router for the network.
716
717 2.1. The shortest-path tree
718
719 When no OSPF areas are configured, each router in the Autonomous
720 System has an identical topological database, leading to an
721
722
723
724 <span class="grey">Moy [Page 13]</span></pre>
725 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
726 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
727
728
729
730 +
731 | 3+---+ N12 N14
732 N1|--|RT1|\ 1 \ N13 /
733 | +---+ \ 8\ |8/8
734 + \ ____ \|/
735 / \ 1+---+8 8+---+6
736 * N3 *---|RT4|------|RT5|--------+
737 \____/ +---+ +---+ |
738 + / | |7 |
739 | 3+---+ / | | |
740 N2|--|RT2|/1 |1 |6 |
741 | +---+ +---+8 6+---+ |
742 + |RT3|--------------|RT6| |
743 +---+ +---+ |
744 |2 Ia|7 |
745 | | |
746 +---------+ | |
747 N4 | |
748 | |
749 | |
750 N11 | |
751 +---------+ | |
752 | | | N12
753 |3 | |6 2/
754 +---+ | +---+/
755 |RT9| | |RT7|---N15
756 +---+ | +---+ 9
757 |1 + | |1
758 _|__ | Ib|5 __|_
759 / \ 1+----+2 | 3+----+1 / \
760 * N9 *------|RT11|----|---|RT10|---* N6 *
761 \____/ +----+ | +----+ \____/
762 | | |
763 |1 + |1
764 +--+ 10+----+ N8 +---+
765 |H1|-----|RT12| |RT8|
766 +--+SLIP +----+ +---+
767 |2 |4
768 | |
769 +---------+ +--------+
770 N10 N7
771
772 Figure 2: A sample Autonomous System
773
774
775
776
777
778
779
780 <span class="grey">Moy [Page 14]</span></pre>
781 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
782 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
783
784
785 **FROM**
786
787 |RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|
788 |1 |2 |3 |4 |5 |6 |7 |8 |9 |10|11|12|N3|N6|N8|N9|
789 ----- ---------------------------------------------
790 RT1| | | | | | | | | | | | |0 | | | |
791 RT2| | | | | | | | | | | | |0 | | | |
792 RT3| | | | | |6 | | | | | | |0 | | | |
793 RT4| | | | |8 | | | | | | | |0 | | | |
794 RT5| | | |8 | |6 |6 | | | | | | | | | |
795 RT6| | |8 | |7 | | | | |5 | | | | | | |
796 RT7| | | | |6 | | | | | | | | |0 | | |
797 * RT8| | | | | | | | | | | | | |0 | | |
798 * RT9| | | | | | | | | | | | | | | |0 |
799 T RT10| | | | | |7 | | | | | | | |0 |0 | |
800 O RT11| | | | | | | | | | | | | | |0 |0 |
801 * RT12| | | | | | | | | | | | | | | |0 |
802 * N1|3 | | | | | | | | | | | | | | | |
803 N2| |3 | | | | | | | | | | | | | | |
804 N3|1 |1 |1 |1 | | | | | | | | | | | | |
805 N4| | |2 | | | | | | | | | | | | | |
806 N6| | | | | | |1 |1 | |1 | | | | | | |
807 N7| | | | | | | |4 | | | | | | | | |
808 N8| | | | | | | | | |3 |2 | | | | | |
809 N9| | | | | | | | |1 | |1 |1 | | | | |
810 N10| | | | | | | | | | | |2 | | | | |
811 N11| | | | | | | | |3 | | | | | | | |
812 N12| | | | |8 | |2 | | | | | | | | | |
813 N13| | | | |8 | | | | | | | | | | | |
814 N14| | | | |8 | | | | | | | | | | | |
815 N15| | | | | | |9 | | | | | | | | | |
816 H1| | | | | | | | | | | |10| | | | |
817
818
819 Figure 3: The resulting directed graph
820
821 Networks and routers are represented by vertices.
822 An edge of cost X connects Vertex A to Vertex B iff
823 the intersection of Column A and Row B is marked
824 with an X.
825
826
827
828
829
830
831
832
833
834
835
836 <span class="grey">Moy [Page 15]</span></pre>
837 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
838 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
839
840
841 **FROM** **FROM**
842
843 |RT12|N9|N10|H1| |RT9|RT11|RT12|N9|
844 * -------------------- * ----------------------
845 * RT12| | | | | * RT9| | | |0 |
846 T N9|1 | | | | T RT11| | | |0 |
847 O N10|2 | | | | O RT12| | | |0 |
848 * H1|10 | | | | * N9| | | | |
849 * *
850 RT12's router links N9's network links
851 advertisement advertisement
852
853 Figure 4: Individual link state components
854
855 Networks and routers are represented by vertices.
856 An edge of cost X connects Vertex A to Vertex B iff
857 the intersection of Column A and Row B is marked
858 with an X.
859
860 identical graphical representation. A router generates its
861 routing table from this graph by calculating a tree of shortest
862 paths with the router itself as root. Obviously, the shortest-
863 path tree depends on the router doing the calculation. The
864 shortest-path tree for Router RT6 in our example is depicted in
865 Figure 5.
866
867 The tree gives the entire route to any destination network or
868 host. However, only the next hop to the destination is used in
869 the forwarding process. Note also that the best route to any
870 router has also been calculated. For the processing of external
871 data, we note the next hop and distance to any router
872 advertising external routes. The resulting routing table for
873 Router RT6 is pictured in Table 2. Note that there is a
874 separate route for each end of a numbered serial line (in this
875 case, the serial line between Routers RT6 and RT10).
876
877
878 Routes to networks belonging to other AS'es (such as N12) appear
879 as dashed lines on the shortest path tree in Figure 5. Use of
880 this externally derived routing information is considered in the
881 next section.
882
883
884 2.2. Use of external routing information
885
886 After the tree is created the external routing information is
887 examined. This external routing information may originate from
888 another routing protocol such as EGP, or be statically
889
890
891
892 <span class="grey">Moy [Page 16]</span></pre>
893 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
894 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
895
896
897
898 RT6(origin)
899 RT5 o------------o-----------o Ib
900 /|\ 6 |\ 7
901 8/8|8\ | \
902 / | \ | \
903 o | o | \7
904 N12 o N14 | \
905 N13 2 | \
906 N4 o-----o RT3 \
907 / \ 5
908 1/ RT10 o-------o Ia
909 / |\
910 RT4 o-----o N3 3| \1
911 /| | \ N6 RT7
912 / | N8 o o---------o
913 / | | | /|
914 RT2 o o RT1 | | 2/ |9
915 / | | |RT8 / |
916 /3 |3 RT11 o o o o
917 / | | | N12 N15
918 N2 o o N1 1| |4
919 | |
920 N9 o o N7
921 /|
922 / |
923 N11 RT9 / |RT12
924 o--------o-------o o--------o H1
925 3 | 10
926 |2
927 |
928 o N10
929
930
931 Figure 5: The SPF tree for Router RT6
932
933 Edges that are not marked with a cost have a cost of
934 of zero (these are network-to-router links). Routes
935 to networks N12-N15 are external information that is
936 considered in <a href="#section-2.2">Section 2.2</a>
937
938
939
940
941
942
943
944
945
946
947
948 <span class="grey">Moy [Page 17]</span></pre>
949 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
950 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
951
952
953 Destination Next Hop Distance
954 __________________________________
955 N1 RT3 10
956 N2 RT3 10
957 N3 RT3 7
958 N4 RT3 8
959 Ib * 7
960 Ia RT10 12
961 N6 RT10 8
962 N7 RT10 12
963 N8 RT10 10
964 N9 RT10 11
965 N10 RT10 13
966 N11 RT10 14
967 H1 RT10 21
968 __________________________________
969 RT5 RT5 6
970 RT7 RT10 8
971
972
973 Table 2: The portion of Router RT6's routing table listing local
974 destinations.
975
976 configured (static routes). Default routes can also be included
977 as part of the Autonomous System's external routing information.
978
979 External routing information is flooded unaltered throughout the
980 AS. In our example, all the routers in the Autonomous System
981 know that Router RT7 has two external routes, with metrics 2 and
982 9.
983
984 OSPF supports two types of external metrics. Type 1 external
985 metrics are equivalent to the link state metric. Type 2
986 external metrics are greater than the cost of any path internal
987 to the AS. Use of Type 2 external metrics assumes that routing
988 between AS'es is the major cost of routing a packet, and
989 eliminates the need for conversion of external costs to internal
990 link state metrics.
991
992 As an example of Type 1 external metric processing, suppose that
993 the Routers RT7 and RT5 in Figure 2 are advertising Type 1
994 external metrics. For each external route, the distance from
995 Router RT6 is calculated as the sum of the external route's cost
996 and the distance from Router RT6 to the advertising router. For
997 every external destination, the router advertising the shortest
998 route is discovered, and the next hop to the advertising router
999 becomes the next hop to the destination.
1000
1001
1002
1003
1004 <span class="grey">Moy [Page 18]</span></pre>
1005 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
1006 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1007
1008
1009 Both Router RT5 and RT7 are advertising an external route to
1010 destination Network N12. Router RT7 is preferred since it is
1011 advertising N12 at a distance of 10 (8+2) to Router RT6, which
1012 is better than Router RT5's 14 (6+8). Table 3 shows the entries
1013 that are added to the routing table when external routes are
1014 examined:
1015
1016
1017
1018 Destination Next Hop Distance
1019 __________________________________
1020 N12 RT10 10
1021 N13 RT5 14
1022 N14 RT5 14
1023 N15 RT10 17
1024
1025
1026 Table 3: The portion of Router RT6's routing table
1027 listing external destinations.
1028
1029
1030 Processing of Type 2 external metrics is simpler. The AS
1031 boundary router advertising the smallest external metric is
1032 chosen, regardless of the internal distance to the AS boundary
1033 router. Suppose in our example both Router RT5 and Router RT7
1034 were advertising Type 2 external routes. Then all traffic
1035 destined for Network N12 would be forwarded to Router RT7, since
1036 2 &lt; 8. When several equal-cost Type 2 routes exist, the
1037 internal distance to the advertising routers is used to break
1038 the tie.
1039
1040 Both Type 1 and Type 2 external metrics can be present in the AS
1041 at the same time. In that event, Type 1 external metrics always
1042 take precedence.
1043
1044 This section has assumed that packets destined for external
1045 destinations are always routed through the advertising AS
1046 boundary router. This is not always desirable. For example,
1047 suppose in Figure 2 there is an additional router attached to
1048 Network N6, called Router RTX. Suppose further that RTX does
1049 not participate in OSPF routing, but does exchange EGP
1050 information with the AS boundary router RT7. Then, Router RT7
1051 would end up advertising OSPF external routes for all
1052 destinations that should be routed to RTX. An extra hop will
1053 sometimes be introduced if packets for these destinations need
1054 always be routed first to Router RT7 (the advertising router).
1055
1056 To deal with this situation, the OSPF protocol allows an AS
1057
1058
1059
1060 <span class="grey">Moy [Page 19]</span></pre>
1061 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
1062 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1063
1064
1065 boundary router to specify a "forwarding address" in its
1066 external advertisements. In the above example, Router RT7 would
1067 specify RTX's IP address as the "forwarding address" for all
1068 those destinations whose packets should be routed directly to
1069 RTX.
1070
1071 The "forwarding address" has one other application. It enables
1072 routers in the Autonomous System's interior to function as
1073 "route servers". For example, in Figure 2 the router RT6 could
1074 become a route server, gaining external routing information
1075 through a combination of static configuration and external
1076 routing protocols. RT6 would then start advertising itself as
1077 an AS boundary router, and would originate a collection of OSPF
1078 external advertisements. In each external advertisement, Router
1079 RT6 would specify the correct Autonomous System exit point to
1080 use for the destination through appropriate setting of the
1081 advertisement's "forwarding address" field.
1082
1083
1084 2.3. Equal-cost multipath
1085
1086 The above discussion has been simplified by considering only a
1087 single route to any destination. In reality, if multiple
1088 equal-cost routes to a destination exist, they are all
1089 discovered and used. This requires no conceptual changes to the
1090 algorithm, and its discussion is postponed until we consider the
1091 tree-building process in more detail.
1092
1093 With equal cost multipath, a router potentially has several
1094 available next hops towards any given destination.
1095
1096
1097 2.4. TOS-based routing
1098
1099 OSPF can calculate a separate set of routes for each IP Type of
1100 Service. This means that, for any destination, there can
1101 potentially be multiple routing table entries, one for each IP
1102 TOS. The IP TOS values are represented in OSPF exactly as they
1103 appear in the IP packet header.
1104
1105 Up to this point, all examples shown have assumed that routes do
1106 not vary on TOS. In order to differentiate routes based on TOS,
1107 separate interface costs can be configured for each TOS. For
1108 example, in Figure 2 there could be multiple costs (one for each
1109 TOS) listed for each interface. A cost for TOS 0 must always be
1110 specified.
1111
1112 When interface costs vary based on TOS, a separate shortest path
1113
1114
1115
1116 <span class="grey">Moy [Page 20]</span></pre>
1117 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
1118 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1119
1120
1121 tree is calculated for each TOS (see <a href="#section-2.1">Section 2.1</a>). In addition,
1122 external costs can vary based on TOS. For example, in Figure 2
1123 Router RT7 could advertise a separate type 1 external metric for
1124 each TOS. Then, when calculating the TOS X distance to Network
1125 N15 the cost of the shortest TOS X path to RT7 would be added to
1126 the TOS X cost advertised by RT7 for Network N15 (see <a href="#section-2.2">Section</a>
1127 <a href="#section-2.2">2.2</a>).
1128
1129 All OSPF implementations must be capable of calculating routes
1130 based on TOS. However, OSPF routers can be configured to route
1131 all packets on the TOS 0 path (see <a href="#appendix-C">Appendix C</a>), eliminating the
1132 need to calculate non-zero TOS paths. This can be used to
1133 conserve routing table space and processing resources in the
1134 router. These TOS-0-only routers can be mixed with routers that
1135 do route based on TOS. TOS-0-only routers will be avoided as
1136 much as possible when forwarding traffic requesting a non-zero
1137 TOS.
1138
1139 It may be the case that no path exists for some non-zero TOS,
1140 even if the router is calculating non-zero TOS paths. In that
1141 case, packets requesting that non-zero TOS are routed along the
1142 TOS 0 path (see <a href="#section-11.1">Section 11.1</a>).
1143
1144
1145 <span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Splitting the AS into Areas</span>
1146
1147 OSPF allows collections of contiguous networks and hosts to be
1148 grouped together. Such a group, together with the routers having
1149 interfaces to any one of the included networks, is called an area.
1150 Each area runs a separate copy of the basic link-state routing
1151 algorithm. This means that each area has its own topological
1152 database and corresponding graph, as explained in the previous
1153 section.
1154
1155 The topology of an area is invisible from the outside of the area.
1156 Conversely, routers internal to a given area know nothing of the
1157 detailed topology external to the area. This isolation of knowledge
1158 enables the protocol to effect a marked reduction in routing traffic
1159 as compared to treating the entire Autonomous System as a single
1160 link-state domain.
1161
1162 With the introduction of areas, it is no longer true that all
1163 routers in the AS have an identical topological database. A router
1164 actually has a separate topological database for each area it is
1165 connected to. (Routers connected to multiple areas are called area
1166 border routers). Two routers belonging to the same area have, for
1167 that area, identical area topological databases.
1168
1169
1170
1171
1172 <span class="grey">Moy [Page 21]</span></pre>
1173 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
1174 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1175
1176
1177 Routing in the Autonomous System takes place on two levels,
1178 depending on whether the source and destination of a packet reside
1179 in the same area (intra-area routing is used) or different areas
1180 (inter-area routing is used). In intra-area routing, the packet is
1181 routed solely on information obtained within the area; no routing
1182 information obtained from outside the area can be used. This
1183 protects intra-area routing from the injection of bad routing
1184 information. We discuss inter-area routing in <a href="#section-3.2">Section 3.2</a>.
1185
1186
1187 3.1. The backbone of the Autonomous System
1188
1189 The backbone consists of those networks not contained in any
1190 area, their attached routers, and those routers that belong to
1191 multiple areas. The backbone must be contiguous.
1192
1193 It is possible to define areas in such a way that the backbone
1194 is no longer contiguous. In this case the system administrator
1195 must restore backbone connectivity by configuring virtual links.
1196
1197 Virtual links can be configured between any two backbone routers
1198 that have an interface to a common non-backbone area. Virtual
1199 links belong to the backbone. The protocol treats two routers
1200 joined by a virtual link as if they were connected by an
1201 unnumbered point-to-point network. On the graph of the
1202 backbone, two such routers are joined by arcs whose costs are
1203 the intra-area distances between the two routers. The routing
1204 protocol traffic that flows along the virtual link uses intra-
1205 area routing only.
1206
1207 The backbone is responsible for distributing routing information
1208 between areas. The backbone itself has all of the properties of
1209 an area. The topology of the backbone is invisible to each of
1210 the areas, while the backbone itself knows nothing of the
1211 topology of the areas.
1212
1213
1214 3.2. Inter-area routing
1215
1216 When routing a packet between two areas the backbone is used.
1217 The path that the packet will travel can be broken up into three
1218 contiguous pieces: an intra-area path from the source to an area
1219 border router, a backbone path between the source and
1220 destination areas, and then another intra-area path to the
1221 destination. The algorithm finds the set of such paths that
1222 have the smallest cost.
1223
1224 Looking at this another way, inter-area routing can be pictured
1225
1226
1227
1228 <span class="grey">Moy [Page 22]</span></pre>
1229 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
1230 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1231
1232
1233 as forcing a star configuration on the Autonomous System, with
1234 the backbone as hub and each of the areas as spokes.
1235
1236 The topology of the backbone dictates the backbone paths used
1237 between areas. The topology of the backbone can be enhanced by
1238 adding virtual links. This gives the system administrator some
1239 control over the routes taken by inter-area traffic.
1240
1241 The correct area border router to use as the packet exits the
1242 source area is chosen in exactly the same way routers
1243 advertising external routes are chosen. Each area border router
1244 in an area summarizes for the area its cost to all networks
1245 external to the area. After the SPF tree is calculated for the
1246 area, routes to all other networks are calculated by examining
1247 the summaries of the area border routers.
1248
1249
1250 3.3. Classification of routers
1251
1252 Before the introduction of areas, the only OSPF routers having a
1253 specialized function were those advertising external routing
1254 information, such as Router RT5 in Figure 2. When the AS is
1255 split into OSPF areas, the routers are further divided according
1256 to function into the following four overlapping categories:
1257
1258
1259 Internal routers
1260 A router with all directly connected networks belonging to
1261 the same area. Routers with only backbone interfaces also
1262 belong to this category. These routers run a single copy of
1263 the basic routing algorithm.
1264
1265 Area border routers
1266 A router that attaches to multiple areas. Area border
1267 routers run multiple copies of the basic algorithm, one copy
1268 for each attached area and an additional copy for the
1269 backbone. Area border routers condense the topological
1270 information of their attached areas for distribution to the
1271 backbone. The backbone in turn distributes the information
1272 to the other areas.
1273
1274 Backbone routers
1275 A router that has an interface to the backbone. This
1276 includes all routers that interface to more than one area
1277 (i.e., area border routers). However, backbone routers do
1278 not have to be area border routers. Routers with all
1279 interfaces connected to the backbone are considered to be
1280 internal routers.
1281
1282
1283
1284 <span class="grey">Moy [Page 23]</span></pre>
1285 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
1286 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1287
1288
1289 AS boundary routers
1290 A router that exchanges routing information with routers
1291 belonging to other Autonomous Systems. Such a router has AS
1292 external routes that are advertised throughout the
1293 Autonomous System. The path to each AS boundary router is
1294 known by every router in the AS. This classification is
1295 completely independent of the previous classifications: AS
1296 boundary routers may be internal or area border routers, and
1297 may or may not participate in the backbone.
1298
1299
1300 3.4. A sample area configuration
1301
1302 Figure 6 shows a sample area configuration. The first area
1303 consists of networks N1-N4, along with their attached routers
1304 RT1-RT4. The second area consists of networks N6-N8, along with
1305 their attached routers RT7, RT8, RT10 and RT11. The third area
1306 consists of networks N9-N11 and Host H1, along with their
1307 attached routers RT9, RT11 and RT12. The third area has been
1308 configured so that networks N9-N11 and Host H1 will all be
1309 grouped into a single route, when advertised external to the
1310 area (see <a href="#section-3.5">Section 3.5</a> for more details).
1311
1312 In Figure 6, Routers RT1, RT2, RT5, RT6, RT8, RT9 and RT12 are
1313 internal routers. Routers RT3, RT4, RT7, RT10 and RT11 are area
1314 border routers. Finally, as before, Routers RT5 and RT7 are AS
1315 boundary routers.
1316
1317 Figure 7 shows the resulting topological database for the Area
1318 1. The figure completely describes that area's intra-area
1319 routing. It also shows the complete view of the internet for
1320 the two internal routers RT1 and RT2. It is the job of the area
1321 border routers, RT3 and RT4, to advertise into Area 1 the
1322 distances to all destinations external to the area. These are
1323 indicated in Figure 7 by the dashed stub routes. Also, RT3 and
1324 RT4 must advertise into Area 1 the location of the AS boundary
1325 routers RT5 and RT7. Finally, external advertisements from RT5
1326 and RT7 are flooded throughout the entire AS, and in particular
1327 throughout Area 1. These advertisements are included in Area
1328 1's database, and yield routes to Networks N12-N15.
1329
1330 Routers RT3 and RT4 must also summarize Area 1's topology for
1331 distribution to the backbone. Their backbone advertisements are
1332 shown in Table 4. These summaries show which networks are
1333 contained in Area 1 (i.e., Networks N1-N4), and the distance to
1334 these networks from the routers RT3 and RT4 respectively.
1335
1336
1337
1338
1339
1340 <span class="grey">Moy [Page 24]</span></pre>
1341 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
1342 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1343
1344
1345
1346 ...........................
1347 . + .
1348 . | 3+---+ . N12 N14
1349 . N1|--|RT1|\ 1 . \ N13 /
1350 . | +---+ \ . 8\ |8/8
1351 . + \ ____ . \|/
1352 . / \ 1+---+8 8+---+6
1353 . * N3 *---|RT4|------|RT5|--------+
1354 . \____/ +---+ +---+ |
1355 . + / \ . |7 |
1356 . | 3+---+ / \ . | |
1357 . N2|--|RT2|/1 1\ . |6 |
1358 . | +---+ +---+8 6+---+ |
1359 . + |RT3|------|RT6| |
1360 . +---+ +---+ |
1361 . 2/ . Ia|7 |
1362 . / . | |
1363 . +---------+ . | |
1364 .Area 1 N4 . | |
1365 ........................... | |
1366 .......................... | |
1367 . N11 . | |
1368 . +---------+ . | |
1369 . | . | | N12
1370 . |3 . Ib|5 |6 2/
1371 . +---+ . +----+ +---+/
1372 . |RT9| . .........|RT10|.....|RT7|---N15.
1373 . +---+ . . +----+ +---+ 9 .
1374 . |1 . . + /3 1\ |1 .
1375 . _|__ . . | / \ __|_ .
1376 . / \ 1+----+2 |/ \ / \ .
1377 . * N9 *------|RT11|----| * N6 * .
1378 . \____/ +----+ | \____/ .
1379 . | . . | | .
1380 . |1 . . + |1 .
1381 . +--+ 10+----+ . . N8 +---+ .
1382 . |H1|-----|RT12| . . |RT8| .
1383 . +--+SLIP +----+ . . +---+ .
1384 . |2 . . |4 .
1385 . | . . | .
1386 . +---------+ . . +--------+ .
1387 . N10 . . N7 .
1388 . . .Area 2 .
1389 .Area 3 . ................................
1390 ..........................
1391
1392 Figure 6: A sample OSPF area configuration
1393
1394
1395
1396 <span class="grey">Moy [Page 25]</span></pre>
1397 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
1398 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1399
1400
1401 Network RT3 adv. RT4 adv.
1402 _____________________________
1403 N1 4 4
1404 N2 4 4
1405 N3 1 1
1406 N4 2 3
1407
1408
1409 Table 4: Networks advertised to the backbone
1410 by Routers RT3 and RT4.
1411
1412 The topological database for the backbone is shown in Figure 8.
1413 The set of routers pictured are the backbone routers. Router
1414 RT11 is a backbone router because it belongs to two areas. In
1415 order to make the backbone connected, a virtual link has been
1416 configured between Routers R10 and R11.
1417
1418 Again, Routers RT3, RT4, RT7, RT10 and RT11 are area border
1419 routers. As Routers RT3 and RT4 did above, they have condensed
1420 the routing information of their attached areas for distribution
1421 via the backbone; these are the dashed stubs that appear in
1422 Figure 8. Remember that the third area has been configured to
1423 condense Networks N9-N11 and Host H1 into a single route. This
1424 yields a single dashed line for networks N9-N11 and Host H1 in
1425 Figure 8. Routers RT5 and RT7 are AS boundary routers; their
1426 externally derived information also appears on the graph in
1427 Figure 8 as stubs.
1428
1429 The backbone enables the exchange of summary information between
1430 area border routers. Every area border router hears the area
1431 summaries from all other area border routers. It then forms a
1432 picture of the distance to all networks outside of its area by
1433 examining the collected advertisements, and adding in the
1434 backbone distance to each advertising router.
1435
1436 Again using Routers RT3 and RT4 as an example, the procedure
1437 goes as follows: They first calculate the SPF tree for the
1438 backbone. This gives the distances to all other area border
1439 routers. Also noted are the distances to networks (Ia and Ib)
1440 and AS boundary routers (RT5 and RT7) that belong to the
1441 backbone. This calculation is shown in Table 5.
1442
1443
1444 Next, by looking at the area summaries from these area border
1445 routers, RT3 and RT4 can determine the distance to all networks
1446 outside their area. These distances are then advertised
1447 internally to the area by RT3 and RT4. The advertisements that
1448 Router RT3 and RT4 will make into Area 1 are shown in Table 6.
1449
1450
1451
1452 <span class="grey">Moy [Page 26]</span></pre>
1453 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
1454 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1455
1456
1457
1458 **FROM**
1459
1460 |RT|RT|RT|RT|RT|RT|
1461 |1 |2 |3 |4 |5 |7 |N3|
1462 ----- -------------------
1463 RT1| | | | | | |0 |
1464 RT2| | | | | | |0 |
1465 RT3| | | | | | |0 |
1466 * RT4| | | | | | |0 |
1467 * RT5| | |14|8 | | | |
1468 T RT7| | |20|14| | | |
1469 O N1|3 | | | | | | |
1470 * N2| |3 | | | | | |
1471 * N3|1 |1 |1 |1 | | | |
1472 N4| | |2 | | | | |
1473 Ia,Ib| | |15|22| | | |
1474 N6| | |16|15| | | |
1475 N7| | |20|19| | | |
1476 N8| | |18|18| | | |
1477 N9-N11,H1| | |19|16| | | |
1478 N12| | | | |8 |2 | |
1479 N13| | | | |8 | | |
1480 N14| | | | |8 | | |
1481 N15| | | | | |9 | |
1482
1483 Figure 7: Area 1's Database.
1484
1485 Networks and routers are represented by vertices.
1486 An edge of cost X connects Vertex A to Vertex B iff
1487 the intersection of Column A and Row B is marked
1488 with an X.
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508 <span class="grey">Moy [Page 27]</span></pre>
1509 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
1510 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1511
1512
1513 **FROM**
1514
1515 |RT|RT|RT|RT|RT|RT|RT
1516 |3 |4 |5 |6 |7 |10|11|
1517 ------------------------
1518 RT3| | | |6 | | | |
1519 RT4| | |8 | | | | |
1520 RT5| |8 | |6 |6 | | |
1521 RT6|8 | |7 | | |5 | |
1522 RT7| | |6 | | | | |
1523 * RT10| | | |7 | | |2 |
1524 * RT11| | | | | |3 | |
1525 T N1|4 |4 | | | | | |
1526 O N2|4 |4 | | | | | |
1527 * N3|1 |1 | | | | | |
1528 * N4|2 |3 | | | | | |
1529 Ia| | | | | |5 | |
1530 Ib| | | |7 | | | |
1531 N6| | | | |1 |1 |3 |
1532 N7| | | | |5 |5 |7 |
1533 N8| | | | |4 |3 |2 |
1534 N9-N11,H1| | | | | | |1 |
1535 N12| | |8 | |2 | | |
1536 N13| | |8 | | | | |
1537 N14| | |8 | | | | |
1538 N15| | | | |9 | | |
1539
1540
1541 Figure 8: The backbone's database.
1542
1543 Networks and routers are represented by vertices.
1544 An edge of cost X connects Vertex A to Vertex B iff
1545 the intersection of Column A and Row B is marked
1546 with an X.
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564 <span class="grey">Moy [Page 28]</span></pre>
1565 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
1566 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1567
1568
1569 Area border dist from dist from
1570 router RT3 RT4
1571 ______________________________________
1572 to RT3 * 21
1573 to RT4 22 *
1574 to RT7 20 14
1575 to RT10 15 22
1576 to RT11 18 25
1577 ______________________________________
1578 to Ia 20 27
1579 to Ib 15 22
1580 ______________________________________
1581 to RT5 14 8
1582 to RT7 20 14
1583
1584
1585 Table 5: Backbone distances calculated
1586 by Routers RT3 and RT4.
1587
1588 Note that Table 6 assumes that an area range has been configured
1589 for the backbone which groups Ia and Ib into a single
1590 advertisement.
1591
1592
1593 The information imported into Area 1 by Routers RT3 and RT4
1594 enables an internal router, such as RT1, to choose an area
1595 border router intelligently. Router RT1 would use RT4 for
1596 traffic to Network N6, RT3 for traffic to Network N10, and would
1597 load share between the two for traffic to Network N8.
1598
1599
1600
1601 Destination RT3 adv. RT4 adv.
1602 _________________________________
1603 Ia,Ib 15 22
1604 N6 16 15
1605 N7 20 19
1606 N8 18 18
1607 N9-N11,H1 19 26
1608 _________________________________
1609 RT5 14 8
1610 RT7 20 14
1611
1612
1613 Table 6: Destinations advertised into Area 1
1614 by Routers RT3 and RT4.
1615
1616
1617
1618
1619
1620 <span class="grey">Moy [Page 29]</span></pre>
1621 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span>
1622 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1623
1624
1625 Router RT1 can also determine in this manner the shortest path
1626 to the AS boundary routers RT5 and RT7. Then, by looking at RT5
1627 and RT7's external advertisements, Router RT1 can decide between
1628 RT5 or RT7 when sending to a destination in another Autonomous
1629 System (one of the networks N12-N15).
1630
1631 Note that a failure of the line between Routers RT6 and RT10
1632 will cause the backbone to become disconnected. Configuring a
1633 virtual link between Routers RT7 and RT10 will give the backbone
1634 more connectivity and more resistance to such failures. Also, a
1635 virtual link between RT7 and RT10 would allow a much shorter
1636 path between the third area (containing N9) and the router RT7,
1637 which is advertising a good route to external network N12.
1638
1639
1640 3.5. IP subnetting support
1641
1642 OSPF attaches an IP address mask to each advertised route. The
1643 mask indicates the range of addresses being described by the
1644 particular route. For example, a summary advertisement for the
1645 destination 128.185.0.0 with a mask of 0xffff0000 actually is
1646 describing a single route to the collection of destinations
1647 128.185.0.0 - 128.185.255.255. Similarly, host routes are
1648 always advertised with a mask of 0xffffffff, indicating the
1649 presence of only a single destination.
1650
1651 Including the mask with each advertised destination enables the
1652 implementation of what is commonly referred to as variable-
1653 length subnetting. This means that a single IP class A, B, or C
1654 network number can be broken up into many subnets of various
1655 sizes. For example, the network 128.185.0.0 could be broken up
1656 into 62 variable-sized subnets: 15 subnets of size 4K, 15
1657 subnets of size 256, and 32 subnets of size 8. Table 7 shows
1658 some of the resulting network addresses together with their
1659 masks:
1660
1661
1662
1663 Network address IP address mask Subnet size
1664 _______________________________________________
1665 128.185.16.0 0xfffff000 4K
1666 128.185.1.0 0xffffff00 256
1667 128.185.0.8 0xfffffff8 8
1668
1669
1670 Table 7: Some sample subnet sizes.
1671
1672
1673
1674
1675
1676 <span class="grey">Moy [Page 30]</span></pre>
1677 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span>
1678 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1679
1680
1681 There are many possible ways of dividing up a class A, B, and C
1682 network into variable sized subnets. The precise procedure for
1683 doing so is beyond the scope of this specification. This
1684 specification however establishes the following guideline: When
1685 an IP packet is forwarded, it is always forwarded to the network
1686 that is the best match for the packet's destination. Here best
1687 match is synonymous with the longest or most specific match.
1688 For example, the default route with destination of 0.0.0.0 and
1689 mask 0x00000000 is always a match for every IP destination. Yet
1690 it is always less specific than any other match. Subnet masks
1691 must be assigned so that the best match for any IP destination
1692 is unambiguous.
1693
1694 The OSPF area concept is modelled after an IP subnetted network.
1695 OSPF areas have been loosely defined to be a collection of
1696 networks. In actuality, an OSPF area is specified to be a list
1697 of address ranges (see Section C.2 for more details). Each
1698 address range is defined as an [address,mask] pair. Many
1699 separate networks may then be contained in a single address
1700 range, just as a subnetted network is composed of many separate
1701 subnets. Area border routers then summarize the area contents
1702 (for distribution to the backbone) by advertising a single route
1703 for each address range. The cost of the route is the minimum
1704 cost to any of the networks falling in the specified range.
1705
1706 For example, an IP subnetted network can be configured as a
1707 single OSPF area. In that case, the area would be defined as a
1708 single address range: a class A, B, or C network number along
1709 with its natural IP mask. Inside the area, any number of
1710 variable sized subnets could be defined. External to the area,
1711 a single route for the entire subnetted network would be
1712 distributed, hiding even the fact that the network is subnetted
1713 at all. The cost of this route is the minimum of the set of
1714 costs to the component subnets.
1715
1716
1717 3.6. Supporting stub areas
1718
1719 In some Autonomous Systems, the majority of the topological
1720 database may consist of AS external advertisements. An OSPF AS
1721 external advertisement is usually flooded throughout the entire
1722 AS. However, OSPF allows certain areas to be configured as
1723 "stub areas". AS external advertisements are not flooded
1724 into/throughout stub areas; routing to AS external destinations
1725 in these areas is based on a (per-area) default only. This
1726 reduces the topological database size, and therefore the memory
1727 requirements, for a stub area's internal routers.
1728
1729
1730
1731
1732 <span class="grey">Moy [Page 31]</span></pre>
1733 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span>
1734 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1735
1736
1737 In order to take advantage of the OSPF stub area support,
1738 default routing must be used in the stub area. This is
1739 accomplished as follows. One or more of the stub area's area
1740 border routers must advertise a default route into the stub area
1741 via summary link advertisements. These summary defaults are
1742 flooded throughout the stub area, but no further. (For this
1743 reason these defaults pertain only to the particular stub area).
1744 These summary default routes will match any destination that is
1745 not explicitly reachable by an intra-area or inter-area path
1746 (i.e., AS external destinations).
1747
1748 An area can be configured as stub when there is a single exit
1749 point from the area, or when the choice of exit point need not
1750 be made on a per-external-destination basis. For example, Area
1751 3 in Figure 6 could be configured as a stub area, because all
1752 external traffic must travel though its single area border
1753 router RT11. If Area 3 were configured as a stub, Router RT11
1754 would advertise a default route for distribution inside Area 3
1755 (in a summary link advertisement), instead of flooding the AS
1756 external advertisements for Networks N12-N15 into/throughout the
1757 area.
1758
1759 The OSPF protocol ensures that all routers belonging to an area
1760 agree on whether the area has been configured as a stub. This
1761 guarantees that no confusion will arise in the flooding of AS
1762 external advertisements.
1763
1764 There are a couple of restrictions on the use of stub areas.
1765 Virtual links cannot be configured through stub areas. In
1766 addition, AS boundary routers cannot be placed internal to stub
1767 areas.
1768
1769
1770 3.7. Partitions of areas
1771
1772 OSPF does not actively attempt to repair area partitions. When
1773 an area becomes partitioned, each component simply becomes a
1774 separate area. The backbone then performs routing between the
1775 new areas. Some destinations reachable via intra-area routing
1776 before the partition will now require inter-area routing.
1777
1778 In the previous section, an area was described as a list of
1779 address ranges. Any particular address range must still be
1780 completely contained in a single component of the area
1781 partition. This has to do with the way the area contents are
1782 summarized to the backbone. Also, the backbone itself must not
1783 partition. If it does, parts of the Autonomous System will
1784 become unreachable. Backbone partitions can be repaired by
1785
1786
1787
1788 <span class="grey">Moy [Page 32]</span></pre>
1789 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-33" ></span>
1790 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1791
1792
1793 configuring virtual links (see <a href="#section-15">Section 15</a>).
1794
1795 Another way to think about area partitions is to look at the
1796 Autonomous System graph that was introduced in <a href="#section-2">Section 2</a>. Area
1797 IDs can be viewed as colors for the graph's edges.[1] Each edge
1798 of the graph connects to a network, or is itself a point-to-
1799 point network. In either case, the edge is colored with the
1800 network's Area ID.
1801
1802 A group of edges, all having the same color, and interconnected
1803 by vertices, represents an area. If the topology of the
1804 Autonomous System is intact, the graph will have several regions
1805 of color, each color being a distinct Area ID.
1806
1807 When the AS topology changes, one of the areas may become
1808 partitioned. The graph of the AS will then have multiple
1809 regions of the same color (Area ID). The routing in the
1810 Autonomous System will continue to function as long as these
1811 regions of same color are connected by the single backbone
1812 region.
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844 <span class="grey">Moy [Page 33]</span></pre>
1845 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-34" ></span>
1846 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1847
1848
1849 <span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Functional Summary</span>
1850
1851 A separate copy of OSPF's basic routing algorithm runs in each area.
1852 Routers having interfaces to multiple areas run multiple copies of
1853 the algorithm. A brief summary of the routing algorithm follows.
1854
1855 When a router starts, it first initializes the routing protocol data
1856 structures. The router then waits for indications from the lower-
1857 level protocols that its interfaces are functional.
1858
1859 A router then uses the OSPF's Hello Protocol to acquire neighbors.
1860 The router sends Hello packets to its neighbors, and in turn
1861 receives their Hello packets. On broadcast and point-to-point
1862 networks, the router dynamically detects its neighboring routers by
1863 sending its Hello packets to the multicast address AllSPFRouters.
1864 On non-broadcast networks, some configuration information is
1865 necessary in order to discover neighbors. On all multi-access
1866 networks (broadcast or non-broadcast), the Hello Protocol also
1867 elects a Designated router for the network.
1868
1869 The router will attempt to form adjacencies with some of its newly
1870 acquired neighbors. Topological databases are synchronized between
1871 pairs of adjacent routers. On multi-access networks, the Designated
1872 Router determines which routers should become adjacent.
1873
1874 Adjacencies control the distribution of routing protocol packets.
1875 Routing protocol packets are sent and received only on adjacencies.
1876 In particular, distribution of topological database updates proceeds
1877 along adjacencies.
1878
1879 A router periodically advertises its state, which is also called
1880 link state. Link state is also advertised when a router's state
1881 changes. A router's adjacencies are reflected in the contents of
1882 its link state advertisements. This relationship between
1883 adjacencies and link state allows the protocol to detect dead
1884 routers in a timely fashion.
1885
1886 Link state advertisements are flooded throughout the area. The
1887 flooding algorithm is reliable, ensuring that all routers in an area
1888 have exactly the same topological database. This database consists
1889 of the collection of link state advertisements received from each
1890 router belonging to the area. From this database each router
1891 calculates a shortest-path tree, with itself as root. This
1892 shortest-path tree in turn yields a routing table for the protocol.
1893
1894
1895
1896
1897
1898
1899
1900 <span class="grey">Moy [Page 34]</span></pre>
1901 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-35" ></span>
1902 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1903
1904
1905 4.1. Inter-area routing
1906
1907 The previous section described the operation of the protocol
1908 within a single area. For intra-area routing, no other routing
1909 information is pertinent. In order to be able to route to
1910 destinations outside of the area, the area border routers inject
1911 additional routing information into the area. This additional
1912 information is a distillation of the rest of the Autonomous
1913 System's topology.
1914
1915 This distillation is accomplished as follows: Each area border
1916 router is by definition connected to the backbone. Each area
1917 border router summarizes the topology of its attached areas for
1918 transmission on the backbone, and hence to all other area border
1919 routers. An area border router then has complete topological
1920 information concerning the backbone, and the area summaries from
1921 each of the other area border routers. From this information,
1922 the router calculates paths to all destinations not contained in
1923 its attached areas. The router then advertises these paths into
1924 its attached areas. This enables the area's internal routers to
1925 pick the best exit router when forwarding traffic to
1926 destinations in other areas.
1927
1928
1929 4.2. AS external routes
1930
1931 Routers that have information regarding other Autonomous Systems
1932 can flood this information throughout the AS. This external
1933 routing information is distributed verbatim to every
1934 participating router. There is one exception: external routing
1935 information is not flooded into "stub" areas (see <a href="#section-3.6">Section 3.6</a>).
1936
1937 To utilize external routing information, the path to all routers
1938 advertising external information must be known throughout the AS
1939 (excepting the stub areas). For that reason, the locations of
1940 these AS boundary routers are summarized by the (non-stub) area
1941 border routers.
1942
1943
1944 4.3. Routing protocol packets
1945
1946 The OSPF protocol runs directly over IP, using IP protocol 89.
1947 OSPF does not provide any explicit fragmentation/reassembly
1948 support. When fragmentation is necessary, IP
1949 fragmentation/reassembly is used. OSPF protocol packets have
1950 been designed so that large protocol packets can generally be
1951 split into several smaller protocol packets. This practice is
1952 recommended; IP fragmentation should be avoided whenever
1953
1954
1955
1956 <span class="grey">Moy [Page 35]</span></pre>
1957 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-36" ></span>
1958 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
1959
1960
1961 possible.
1962
1963 Routing protocol packets should always be sent with the IP TOS
1964 field set to 0. If at all possible, routing protocol packets
1965 should be given preference over regular IP data traffic, both
1966 when being sent and received. As an aid to accomplishing this,
1967 OSPF protocol packets should have their IP precedence field set
1968 to the value Internetwork Control (see [<a href="./rfc791">RFC 791</a>]).
1969
1970 All OSPF protocol packets share a common protocol header that is
1971 described in <a href="#appendix-A">Appendix A</a>. The OSPF packet types are listed below
1972 in Table 8. Their formats are also described in <a href="#appendix-A">Appendix A</a>.
1973
1974
1975
1976 Type Packet name Protocol function
1977 __________________________________________________________
1978 1 Hello Discover/maintain neighbors
1979 2 Database Description Summarize database contents
1980 3 Link State Request Database download
1981 4 Link State Update Database update
1982 5 Link State Ack Flooding acknowledgment
1983
1984
1985 Table 8: OSPF packet types.
1986
1987
1988 OSPF's Hello protocol uses Hello packets to discover and
1989 maintain neighbor relationships. The Database Description and
1990 Link State Request packets are used in the forming of
1991 adjacencies. OSPF's reliable update mechanism is implemented by
1992 the Link State Update and Link State Acknowledgment packets.
1993
1994 Each Link State Update packet carries a set of new link state
1995 advertisements one hop further away from their point of
1996 origination. A single Link State Update packet may contain the
1997 link state advertisements of several routers. Each
1998 advertisement is tagged with the ID of the originating router
1999 and a checksum of its link state contents. The five different
2000 types of OSPF link state advertisements are listed below in
2001 Table 9.
2002
2003 As mentioned above, OSPF routing packets (with the exception of
2004 Hellos) are sent only over adjacencies. Note that this means
2005 that all OSPF protocol packets travel a single IP hop, except
2006 those that are sent over virtual adjacencies. The IP source
2007 address of an OSPF protocol packet is one end of a router
2008 adjacency, and the IP destination address is either the other
2009
2010
2011
2012 <span class="grey">Moy [Page 36]</span></pre>
2013 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-37" ></span>
2014 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2015
2016
2017
2018
2019 LS Advertisement Advertisement description
2020 type name
2021 _________________________________________________________
2022 1 Router links Originated by all routers.
2023 advertisements This advertisement describes
2024 the collected states of the
2025 router's interfaces to an
2026 area. Flooded throughout a
2027 single area only.
2028 _________________________________________________________
2029 2 Network links Originated for multi-access
2030 advertisements networks by the Designated
2031 Router. This advertisement
2032 contains the list of routers
2033 connected to the network.
2034 Flooded throughout a single
2035 area only.
2036 _________________________________________________________
2037 3,4 Summary link Originated by area border
2038 advertisements routers, and flooded through-
2039 out the advertisement's
2040 associated area. Each summary
2041 link advertisement describes
2042 a route to a destination out-
2043 side the area, yet still inside
2044 the AS (i.e., an inter-area
2045 route). Type 3 advertisements
2046 describe routes to networks.
2047 Type 4 advertisements describe
2048 routes to AS boundary routers.
2049 _________________________________________________________
2050 5 AS external link Originated by AS boundary
2051 advertisements routers, and flooded through-
2052 out the AS. Each AS external
2053 link advertisement describes
2054 a route to a destination in
2055 another Autonomous System.
2056 Default routes for the AS can
2057 also be described by AS
2058 external link advertisements.
2059
2060
2061 Table 9: OSPF link state advertisements.
2062
2063
2064
2065
2066
2067
2068 <span class="grey">Moy [Page 37]</span></pre>
2069 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-38" ></span>
2070 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2071
2072
2073 end of the adjacency or an IP multicast address.
2074
2075
2076 4.4. Basic implementation requirements
2077
2078 An implementation of OSPF requires the following pieces of
2079 system support:
2080
2081
2082 Timers
2083 Two different kind of timers are required. The first kind,
2084 called single shot timers, fire once and cause a protocol
2085 event to be processed. The second kind, called interval
2086 timers, fire at continuous intervals. These are used for
2087 the sending of packets at regular intervals. A good example
2088 of this is the regular broadcast of Hello packets (on
2089 broadcast networks). The granularity of both kinds of
2090 timers is one second.
2091
2092 Interval timers should be implemented to avoid drift. In
2093 some router implementations, packet processing can affect
2094 timer execution. When multiple routers are attached to a
2095 single network, all doing broadcasts, this can lead to the
2096 synchronization of routing packets (which should be
2097 avoided). If timers cannot be implemented to avoid drift,
2098 small random amounts should be added to/subtracted from the
2099 timer interval at each firing.
2100
2101 IP multicast
2102 Certain OSPF packets take the form of IP multicast
2103 datagrams. Support for receiving and sending IP multicast
2104 datagrams, along with the appropriate lower-level protocol
2105 support, is required. The IP multicast datagrams used by
2106 OSPF never travel more than one hop. For this reason, the
2107 ability to forward IP multicast datagrams is not required.
2108 For information on IP multicast, see [<a href="./rfc1112">RFC 1112</a>].
2109
2110 Variable-length subnet support
2111 The router's IP protocol support must include the ability to
2112 divide a single IP class A, B, or C network number into many
2113 subnets of various sizes. This is commonly called
2114 variable-length subnetting; see <a href="#section-3.5">Section 3.5</a> for details.
2115
2116 IP supernetting support
2117 The router's IP protocol support must include the ability to
2118 aggregate contiguous collections of IP class A, B, and C
2119 networks into larger quantities called supernets.
2120 Supernetting has been proposed as one way to improve the
2121
2122
2123
2124 <span class="grey">Moy [Page 38]</span></pre>
2125 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-39" ></span>
2126 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2127
2128
2129 scaling of IP routing in the worldwide Internet. For more
2130 information on IP supernetting, see [<a href="./rfc1519">RFC 1519</a>].
2131
2132 Lower-level protocol support
2133 The lower level protocols referred to here are the network
2134 access protocols, such as the Ethernet data link layer.
2135 Indications must be passed from these protocols to OSPF as
2136 the network interface goes up and down. For example, on an
2137 ethernet it would be valuable to know when the ethernet
2138 transceiver cable becomes unplugged.
2139
2140 Non-broadcast lower-level protocol support
2141 Remember that non-broadcast networks are multi-access
2142 networks such as a X.25 PDN. On these networks, the Hello
2143 Protocol can be aided by providing an indication to OSPF
2144 when an attempt is made to send a packet to a dead or non-
2145 existent router. For example, on an X.25 PDN a dead
2146 neighboring router may be indicated by the reception of a
2147 X.25 clear with an appropriate cause and diagnostic, and
2148 this information would be passed to OSPF.
2149
2150 List manipulation primitives
2151 Much of the OSPF functionality is described in terms of its
2152 operation on lists of link state advertisements. For
2153 example, the collection of advertisements that will be
2154 retransmitted to an adjacent router until acknowledged are
2155 described as a list. Any particular advertisement may be on
2156 many such lists. An OSPF implementation needs to be able to
2157 manipulate these lists, adding and deleting constituent
2158 advertisements as necessary.
2159
2160 Tasking support
2161 Certain procedures described in this specification invoke
2162 other procedures. At times, these other procedures should
2163 be executed in-line, that is, before the current procedure
2164 is finished. This is indicated in the text by instructions
2165 to execute a procedure. At other times, the other
2166 procedures are to be executed only when the current
2167 procedure has finished. This is indicated by instructions
2168 to schedule a task.
2169
2170
2171 4.5. Optional OSPF capabilities
2172
2173 The OSPF protocol defines several optional capabilities. A
2174 router indicates the optional capabilities that it supports in
2175 its OSPF Hello packets, Database Description packets and in its
2176 link state advertisements. This enables routers supporting a
2177
2178
2179
2180 <span class="grey">Moy [Page 39]</span></pre>
2181 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-40" ></span>
2182 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2183
2184
2185 mix of optional capabilities to coexist in a single Autonomous
2186 System.
2187
2188 Some capabilities must be supported by all routers attached to a
2189 specific area. In this case, a router will not accept a
2190 neighbor's Hello Packet unless there is a match in reported
2191 capabilities (i.e., a capability mismatch prevents a neighbor
2192 relationship from forming). An example of this is the
2193 ExternalRoutingCapability (see below).
2194
2195 Other capabilities can be negotiated during the Database
2196 Exchange process. This is accomplished by specifying the
2197 optional capabilities in Database Description packets. A
2198 capability mismatch with a neighbor in this case will result in
2199 only a subset of link state advertisements being exchanged
2200 between the two neighbors.
2201
2202 The routing table build process can also be affected by the
2203 presence/absence of optional capabilities. For example, since
2204 the optional capabilities are reported in link state
2205 advertisements, routers incapable of certain functions can be
2206 avoided when building the shortest path tree. An example of
2207 this is the TOS routing capability (see below).
2208
2209 The current OSPF optional capabilities are listed below. See
2210 Section A.2 for more information.
2211
2212
2213 ExternalRoutingCapability
2214 Entire OSPF areas can be configured as "stubs" (see <a href="#section-3.6">Section</a>
2215 <a href="#section-3.6">3.6</a>). AS external advertisements will not be flooded into
2216 stub areas. This capability is represented by the E-bit in
2217 the OSPF options field (see Section A.2). In order to
2218 ensure consistent configuration of stub areas, all routers
2219 interfacing to such an area must have the E-bit clear in
2220 their Hello packets (see Sections <a href="#section-9.5">9.5</a> and <a href="#section-10.5">10.5</a>).
2221
2222 TOS capability
2223 All OSPF implementations must be able to calculate separate
2224 routes based on IP Type of Service. However, to save
2225 routing table space and processing resources, an OSPF router
2226 can be configured to ignore TOS when forwarding packets. In
2227 this case, the router calculates routes for TOS 0 only.
2228 This capability is represented by the T-bit in the OSPF
2229 options field (see Section A.2). TOS-capable routers will
2230 attempt to avoid non-TOS-capable routers when calculating
2231 non-zero TOS paths.
2232
2233
2234
2235
2236 <span class="grey">Moy [Page 40]</span></pre>
2237 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-41" ></span>
2238 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2239
2240
2241 <span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Protocol Data Structures</span>
2242
2243 The OSPF protocol is described in this specification in terms of its
2244 operation on various protocol data structures. The following list
2245 comprises the top-level OSPF data structures. Any initialization
2246 that needs to be done is noted. OSPF areas, interfaces and
2247 neighbors also have associated data structures that are described
2248 later in this specification.
2249
2250
2251 Router ID
2252 A 32-bit number that uniquely identifies this router in the AS.
2253 One possible implementation strategy would be to use the
2254 smallest IP interface address belonging to the router. If a
2255 router's OSPF Router ID is changed, the router's OSPF software
2256 should be restarted before the new Router ID takes effect.
2257 Before restarting in order to change its Router ID, the router
2258 should flush its self-originated link state advertisements from
2259 the routing domain (see <a href="#section-14.1">Section 14.1</a>), or they will persist for
2260 up to MaxAge minutes.
2261
2262 Area structures
2263 Each one of the areas to which the router is connected has its
2264 own data structure. This data structure describes the working
2265 of the basic algorithm. Remember that each area runs a separate
2266 copy of the basic algorithm.
2267
2268 Backbone (area) structure
2269 The basic algorithm operates on the backbone as if it were an
2270 area. For this reason the backbone is represented as an area
2271 structure.
2272
2273 Virtual links configured
2274 The virtual links configured with this router as one endpoint.
2275 In order to have configured virtual links, the router itself
2276 must be an area border router. Virtual links are identified by
2277 the Router ID of the other endpoint -- which is another area
2278 border router. These two endpoint routers must be attached to a
2279 common area, called the virtual link's Transit area. Virtual
2280 links are part of the backbone, and behave as if they were
2281 unnumbered point-to-point networks between the two routers. A
2282 virtual link uses the intra-area routing of its Transit area to
2283 forward packets. Virtual links are brought up and down through
2284 the building of the shortest-path trees for the Transit area.
2285
2286 List of external routes
2287 These are routes to destinations external to the Autonomous
2288 System, that have been gained either through direct experience
2289
2290
2291
2292 <span class="grey">Moy [Page 41]</span></pre>
2293 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-42" ></span>
2294 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2295
2296
2297 with another routing protocol (such as EGP), or through
2298 configuration information, or through a combination of the two
2299 (e.g., dynamic external information to be advertised by OSPF
2300 with configured metric). Any router having these external routes
2301 is called an AS boundary router. These routes are advertised by
2302 the router into the OSPF routing domain via AS external link
2303 advertisements.
2304
2305 List of AS external link advertisements
2306 Part of the topological database. These have originated from
2307 the AS boundary routers. They comprise routes to destinations
2308 external to the Autonomous System. Note that, if the router is
2309 itself an AS boundary router, some of these AS external link
2310 advertisements have been self-originated.
2311
2312 The routing table
2313 Derived from the topological database. Each destination that
2314 the router can forward to is represented by a cost and a set of
2315 paths. A path is described by its type and next hop. For more
2316 information, see <a href="#section-11">Section 11</a>.
2317
2318 TOS capability
2319 This item indicates whether the router will calculate separate
2320 routes based on TOS. This is a configurable parameter. For
2321 more information, see Sections <a href="#section-4.5">4.5</a> and <a href="#section-16.9">16.9</a>.
2322
2323
2324 Figure 9 shows the collection of data structures present in a
2325 typical router. The router pictured is RT10, from the map in Figure
2326 6. Note that Router RT10 has a virtual link configured to Router
2327 RT11, with Area 2 as the link's Transit area. This is indicated by
2328 the dashed line in Figure 9. When the virtual link becomes active,
2329 through the building of the shortest path tree for Area 2, it
2330 becomes an interface to the backbone (see the two backbone
2331 interfaces depicted in Figure 9).
2332
2333 <span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. The Area Data Structure</span>
2334
2335 The area data structure contains all the information used to run the
2336 basic routing algorithm. Each area maintains its own topological
2337 database. A network belongs to a single area, and a router interface
2338 connects to a single area. Each router adjacency also belongs to a
2339 single area.
2340
2341 The OSPF backbone has all the properties of an area. For that
2342 reason it is also represented by an area data structure. Note that
2343 some items in the structure apply differently to the backbone than
2344 to non-backbone areas.
2345
2346
2347
2348 <span class="grey">Moy [Page 42]</span></pre>
2349 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-43" ></span>
2350 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2351
2352
2353
2354
2355
2356 +----+
2357 |RT10|------+
2358 +----+ \+-------------+
2359 / \ |Routing Table|
2360 / \ +-------------+
2361 / \
2362 +------+ / \ +--------+
2363 |Area 2|---+ +---|Backbone|
2364 +------+***********+ +--------+
2365 / \ * / \
2366 / \ * / \
2367 +---------+ +---------+ +------------+ +------------+
2368 |Interface| |Interface| |Virtual Link| |Interface Ib|
2369 | to N6 | | to N8 | | to RT11 | +------------+
2370 +---------+ +---------+ +------------+ |
2371 / \ | | |
2372 / \ | | |
2373 +--------+ +--------+ | +-------------+ +------------+
2374 |Neighbor| |Neighbor| | |Neighbor RT11| |Neighbor RT6|
2375 | RT8 | | RT7 | | +-------------+ +------------+
2376 +--------+ +--------+ |
2377 |
2378 +-------------+
2379 |Neighbor RT11|
2380 +-------------+
2381
2382
2383 Figure 9: Router RT10's Data structures
2384
2385 The area topological (or link state) database consists of the
2386 collection of router links, network links and summary link
2387 advertisements that have originated from the area's routers. This
2388 information is flooded throughout a single area only. The list of
2389 AS external link advertisements (see <a href="#section-5">Section 5</a>) is also considered
2390 to be part of each area's topological database.
2391
2392
2393 Area ID
2394 A 32-bit number identifying the area. 0.0.0.0 is reserved for
2395 the Area ID of the backbone. If assigning subnetted networks as
2396 separate areas, the IP network number could be used as the Area
2397 ID.
2398
2399 List of component address ranges
2400 The address ranges that define the area. Each address range is
2401
2402
2403
2404 <span class="grey">Moy [Page 43]</span></pre>
2405 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-44" ></span>
2406 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2407
2408
2409 specified by an [address,mask] pair and a status indication of
2410 either Advertise or DoNotAdvertise (see <a href="#section-12.4.3">Section 12.4.3</a>). Each
2411 network is then assigned to an area depending on the address
2412 range that it falls into (specified address ranges are not
2413 allowed to overlap). As an example, if an IP subnetted network
2414 is to be its own separate OSPF area, the area is defined to
2415 consist of a single address range - an IP network number with
2416 its natural (class A, B or C) mask.
2417
2418 Associated router interfaces
2419 This router's interfaces connecting to the area. A router
2420 interface belongs to one and only one area (or the backbone).
2421 For the backbone structure this list includes all the virtual
2422 links. A virtual link is identified by the Router ID of its
2423 other endpoint; its cost is the cost of the shortest intra-area
2424 path through the Transit area that exists between the two
2425 routers.
2426
2427 List of router links advertisements
2428 A router links advertisement is generated by each router in the
2429 area. It describes the state of the router's interfaces to the
2430 area.
2431
2432 List of network links advertisements
2433 One network links advertisement is generated for each transit
2434 multi-access network in the area. A network links advertisement
2435 describes the set of routers currently connected to the network.
2436
2437 List of summary link advertisements
2438 Summary link advertisements originate from the area's area
2439 border routers. They describe routes to destinations internal
2440 to the Autonomous System, yet external to the area.
2441
2442 Shortest-path tree
2443 The shortest-path tree for the area, with this router itself as
2444 root. Derived from the collected router links and network links
2445 advertisements by the Dijkstra algorithm (see <a href="#section-16.1">Section 16.1</a>).
2446
2447 AuType
2448 The type of authentication used for this area. Authentication
2449 types are defined in <a href="#appendix-D">Appendix D</a>. All OSPF packet exchanges are
2450 authenticated. Different authentication schemes may be used in
2451 different areas.
2452
2453 TransitCapability
2454 Set to TRUE if and only if there are one or more active virtual
2455 links using the area as a Transit area. Equivalently, this
2456 parameter indicates whether the area can carry data traffic that
2457
2458
2459
2460 <span class="grey">Moy [Page 44]</span></pre>
2461 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-45" ></span>
2462 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2463
2464
2465 neither originates nor terminates in the area itself. This
2466 parameter is calculated when the area's shortest-path tree is
2467 built (see <a href="#section-16.1">Section 16.1</a>, and is used as an input to a subsequent
2468 step of the routing table build process (see <a href="#section-16.3">Section 16.3</a>).
2469
2470 ExternalRoutingCapability
2471 Whether AS external advertisements will be flooded
2472 into/throughout the area. This is a configurable parameter. If
2473 AS external advertisements are excluded from the area, the area
2474 is called a "stub". Internal to stub areas, routing to AS
2475 external destinations will be based solely on a default summary
2476 route. The backbone cannot be configured as a stub area. Also,
2477 virtual links cannot be configured through stub areas. For more
2478 information, see <a href="#section-3.6">Section 3.6</a>.
2479
2480 StubDefaultCost
2481 If the area has been configured as a stub area, and the router
2482 itself is an area border router, then the StubDefaultCost
2483 indicates the cost of the default summary link that the router
2484 should advertise into the area. There can be a separate cost
2485 configured for each IP TOS. See <a href="#section-12.4.3">Section 12.4.3</a> for more
2486 information.
2487
2488
2489 Unless otherwise specified, the remaining sections of this document
2490 refer to the operation of the protocol in a single area.
2491
2492
2493 <span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Bringing Up Adjacencies</span>
2494
2495 OSPF creates adjacencies between neighboring routers for the purpose
2496 of exchanging routing information. Not every two neighboring
2497 routers will become adjacent. This section covers the generalities
2498 involved in creating adjacencies. For further details consult
2499 <a href="#section-10">Section 10</a>.
2500
2501
2502 7.1. The Hello Protocol
2503
2504 The Hello Protocol is responsible for establishing and
2505 maintaining neighbor relationships. It also ensures that
2506 communication between neighbors is bidirectional. Hello packets
2507 are sent periodically out all router interfaces. Bidirectional
2508 communication is indicated when the router sees itself listed in
2509 the neighbor's Hello Packet.
2510
2511 On multi-access networks, the Hello Protocol elects a Designated
2512 Router for the network. Among other things, the Designated
2513
2514
2515
2516 <span class="grey">Moy [Page 45]</span></pre>
2517 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-46" ></span>
2518 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2519
2520
2521 Router controls what adjacencies will be formed over the network
2522 (see below).
2523
2524 The Hello Protocol works differently on broadcast networks, as
2525 compared to non-broadcast networks. On broadcast networks, each
2526 router advertises itself by periodically multicasting Hello
2527 Packets. This allows neighbors to be discovered dynamically.
2528 These Hello Packets contain the router's view of the Designated
2529 Router's identity, and the list of routers whose Hello Packets
2530 have been seen recently.
2531
2532 On non-broadcast networks some configuration information is
2533 necessary for the operation of the Hello Protocol. Each router
2534 that may potentially become Designated Router has a list of all
2535 other routers attached to the network. A router, having
2536 Designated Router potential, sends Hello Packets to all other
2537 potential Designated Routers when its interface to the non-
2538 broadcast network first becomes operational. This is an attempt
2539 to find the Designated Router for the network. If the router
2540 itself is elected Designated Router, it begins sending Hello
2541 Packets to all other routers attached to the network.
2542
2543 After a neighbor has been discovered, bidirectional
2544 communication ensured, and (if on a multi-access network) a
2545 Designated Router elected, a decision is made regarding whether
2546 or not an adjacency should be formed with the neighbor (see
2547 <a href="#section-10.4">Section 10.4</a>). An attempt is always made to establish
2548 adjacencies over point-to-point networks and virtual links. The
2549 first step in bringing up an adjacency is to synchronize the
2550 neighbors' topological databases. This is covered in the next
2551 section.
2552
2553
2554 7.2. The Synchronization of Databases
2555
2556 In a link-state routing algorithm, it is very important for all
2557 routers' topological databases to stay synchronized. OSPF
2558 simplifies this by requiring only adjacent routers to remain
2559 synchronized. The synchronization process begins as soon as the
2560 routers attempt to bring up the adjacency. Each router
2561 describes its database by sending a sequence of Database
2562 Description packets to its neighbor. Each Database Description
2563 Packet describes a set of link state advertisements belonging to
2564 the router's database. When the neighbor sees a link state
2565 advertisement that is more recent than its own database copy, it
2566 makes a note that this newer advertisement should be requested.
2567
2568 This sending and receiving of Database Description packets is
2569
2570
2571
2572 <span class="grey">Moy [Page 46]</span></pre>
2573 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-47" ></span>
2574 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2575
2576
2577 called the "Database Exchange Process". During this process,
2578 the two routers form a master/slave relationship. Each Database
2579 Description Packet has a sequence number. Database Description
2580 Packets sent by the master (polls) are acknowledged by the slave
2581 through echoing of the sequence number. Both polls and their
2582 responses contain summaries of link state data. The master is
2583 the only one allowed to retransmit Database Description Packets.
2584 It does so only at fixed intervals, the length of which is the
2585 configured constant RxmtInterval.
2586
2587 Each Database Description contains an indication that there are
2588 more packets to follow --- the M-bit. The Database Exchange
2589 Process is over when a router has received and sent Database
2590 Description Packets with the M-bit off.
2591
2592 During and after the Database Exchange Process, each router has
2593 a list of those link state advertisements for which the neighbor
2594 has more up-to-date instances. These advertisements are
2595 requested in Link State Request Packets. Link State Request
2596 packets that are not satisfied are retransmitted at fixed
2597 intervals of time RxmtInterval. When the Database Description
2598 Process has completed and all Link State Requests have been
2599 satisfied, the databases are deemed synchronized and the routers
2600 are marked fully adjacent. At this time the adjacency is fully
2601 functional and is advertised in the two routers' link state
2602 advertisements.
2603
2604 The adjacency is used by the flooding procedure as soon as the
2605 Database Exchange Process begins. This simplifies database
2606 synchronization, and guarantees that it finishes in a
2607 predictable period of time.
2608
2609
2610 7.3. The Designated Router
2611
2612 Every multi-access network has a Designated Router. The
2613 Designated Router performs two main functions for the routing
2614 protocol:
2615
2616 o The Designated Router originates a network links
2617 advertisement on behalf of the network. This advertisement
2618 lists the set of routers (including the Designated Router
2619 itself) currently attached to the network. The Link State
2620 ID for this advertisement (see <a href="#section-12.1.4">Section 12.1.4</a>) is the IP
2621 interface address of the Designated Router. The IP network
2622 number can then be obtained by using the subnet/network
2623 mask.
2624
2625
2626
2627
2628 <span class="grey">Moy [Page 47]</span></pre>
2629 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-48" ></span>
2630 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2631
2632
2633 o The Designated Router becomes adjacent to all other routers
2634 on the network. Since the link state databases are
2635 synchronized across adjacencies (through adjacency bring-up
2636 and then the flooding procedure), the Designated Router
2637 plays a central part in the synchronization process.
2638
2639
2640 The Designated Router is elected by the Hello Protocol. A
2641 router's Hello Packet contains its Router Priority, which is
2642 configurable on a per-interface basis. In general, when a
2643 router's interface to a network first becomes functional, it
2644 checks to see whether there is currently a Designated Router for
2645 the network. If there is, it accepts that Designated Router,
2646 regardless of its Router Priority. (This makes it harder to
2647 predict the identity of the Designated Router, but ensures that
2648 the Designated Router changes less often. See below.)
2649 Otherwise, the router itself becomes Designated Router if it has
2650 the highest Router Priority on the network. A more detailed
2651 (and more accurate) description of Designated Router election is
2652 presented in <a href="#section-9.4">Section 9.4</a>.
2653
2654 The Designated Router is the endpoint of many adjacencies. In
2655 order to optimize the flooding procedure on broadcast networks,
2656 the Designated Router multicasts its Link State Update Packets
2657 to the address AllSPFRouters, rather than sending separate
2658 packets over each adjacency.
2659
2660 <a href="#section-2">Section 2</a> of this document discusses the directed graph
2661 representation of an area. Router nodes are labelled with their
2662 Router ID. Multi-access network nodes are actually labelled
2663 with the IP address of their Designated Router. It follows that
2664 when the Designated Router changes, it appears as if the network
2665 node on the graph is replaced by an entirely new node. This
2666 will cause the network and all its attached routers to originate
2667 new link state advertisements. Until the topological databases
2668 again converge, some temporary loss of connectivity may result.
2669 This may result in ICMP unreachable messages being sent in
2670 response to data traffic. For that reason, the Designated
2671 Router should change only infrequently. Router Priorities
2672 should be configured so that the most dependable router on a
2673 network eventually becomes Designated Router.
2674
2675
2676 7.4. The Backup Designated Router
2677
2678 In order to make the transition to a new Designated Router
2679 smoother, there is a Backup Designated Router for each multi-
2680 access network. The Backup Designated Router is also adjacent
2681
2682
2683
2684 <span class="grey">Moy [Page 48]</span></pre>
2685 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-49" ></span>
2686 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2687
2688
2689 to all routers on the network, and becomes Designated Router
2690 when the previous Designated Router fails. If there were no
2691 Backup Designated Router, when a new Designated Router became
2692 necessary, new adjacencies would have to be formed between the
2693 new Designated Router and all other routers attached to the
2694 network. Part of the adjacency forming process is the
2695 synchronizing of topological databases, which can potentially
2696 take quite a long time. During this time, the network would not
2697 be available for transit data traffic. The Backup Designated
2698 obviates the need to form these adjacencies, since they already
2699 exist. This means the period of disruption in transit traffic
2700 lasts only as long as it takes to flood the new link state
2701 advertisements (which announce the new Designated Router).
2702
2703 The Backup Designated Router does not generate a network links
2704 advertisement for the network. (If it did, the transition to a
2705 new Designated Router would be even faster. However, this is a
2706 tradeoff between database size and speed of convergence when the
2707 Designated Router disappears.)
2708
2709 The Backup Designated Router is also elected by the Hello
2710 Protocol. Each Hello Packet has a field that specifies the
2711 Backup Designated Router for the network.
2712
2713 In some steps of the flooding procedure, the Backup Designated
2714 Router plays a passive role, letting the Designated Router do
2715 more of the work. This cuts down on the amount of local routing
2716 traffic. See <a href="#section-13.3">Section 13.3</a> for more information.
2717
2718
2719 7.5. The graph of adjacencies
2720
2721 An adjacency is bound to the network that the two routers have
2722 in common. If two routers have multiple networks in common,
2723 they may have multiple adjacencies between them.
2724
2725 One can picture the collection of adjacencies on a network as
2726 forming an undirected graph. The vertices consist of routers,
2727 with an edge joining two routers if they are adjacent. The
2728 graph of adjacencies describes the flow of routing protocol
2729 packets, and in particular Link State Update Packets, through
2730 the Autonomous System.
2731
2732 Two graphs are possible, depending on whether the common network
2733 is multi-access. On physical point-to-point networks (and
2734 virtual links), the two routers joined by the network will be
2735 adjacent after their databases have been synchronized. On
2736 multi-access networks, both the Designated Router and the Backup
2737
2738
2739
2740 <span class="grey">Moy [Page 49]</span></pre>
2741 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-50" ></span>
2742 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2743
2744
2745 Designated Router are adjacent to all other routers attached to
2746 the network, and these account for all adjacencies.
2747
2748 These graphs are shown in Figure 10. It is assumed that Router
2749 RT7 has become the Designated Router, and Router RT3 the Backup
2750 Designated Router, for the Network N2. The Backup Designated
2751 Router performs a lesser function during the flooding procedure
2752 than the Designated Router (see <a href="#section-13.3">Section 13.3</a>). This is the
2753 reason for the dashed lines connecting the Backup Designated
2754 Router RT3.
2755
2756
2757 <span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Protocol Packet Processing</span>
2758
2759 This section discusses the general processing of OSPF routing
2760 protocol packets. It is very important that the router topological
2761 databases remain synchronized. For this reason, routing protocol
2762 packets should get preferential treatment over ordinary data
2763 packets, both in sending and receiving.
2764
2765 Routing protocol packets are sent along adjacencies only (with the
2766
2767
2768
2769 +---+ +---+
2770 |RT1|------------|RT2| o---------------o
2771 +---+ N1 +---+ RT1 RT2
2772
2773
2774
2775 RT7
2776 o---------+
2777 +---+ +---+ +---+ /|\ |
2778 |RT7| |RT3| |RT4| / | \ |
2779 +---+ +---+ +---+ / | \ |
2780 | | | / | \ |
2781 +-----------------------+ RT5o RT6o oRT4 |
2782 | | N2 * * * |
2783 +---+ +---+ * * * |
2784 |RT5| |RT6| * * * |
2785 +---+ +---+ *** |
2786 o---------+
2787 RT3
2788
2789
2790 Figure 10: The graph of adjacencies
2791
2792
2793
2794
2795
2796 <span class="grey">Moy [Page 50]</span></pre>
2797 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-51" ></span>
2798 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2799
2800
2801 exception of Hello packets, which are used to discover the
2802 adjacencies). This means that all routing protocol packets travel a
2803 single IP hop, except those sent over virtual links.
2804
2805 All routing protocol packets begin with a standard header. The
2806 sections below give the details on how to fill in and verify this
2807 standard header. Then, for each packet type, the section is listed
2808 that gives more details on that particular packet type's processing.
2809
2810 8.1. Sending protocol packets
2811
2812 When a router sends a routing protocol packet, it fills in the
2813 fields of the standard OSPF packet header as follows. For more
2814 details on the header format consult Section A.3.1:
2815
2816
2817 Version #
2818 Set to 2, the version number of the protocol as documented
2819 in this specification.
2820
2821 Packet type
2822 The type of OSPF packet, such as Link state Update or Hello
2823 Packet.
2824
2825 Packet length
2826 The length of the entire OSPF packet in bytes, including the
2827 standard OSPF packet header.
2828
2829 Router ID
2830 The identity of the router itself (who is originating the
2831 packet).
2832
2833 Area ID
2834 The OSPF area that the packet is being sent into.
2835
2836 Checksum
2837 The standard IP 16-bit one's complement checksum of the
2838 entire OSPF packet, excluding the 64-bit authentication
2839 field. This checksum should be calculated before handing
2840 the packet to the appropriate authentication procedure.
2841
2842 AuType and Authentication
2843 Each OSPF packet exchange is authenticated. Authentication
2844 types are assigned by the protocol and documented in
2845 <a href="#appendix-D">Appendix D</a>. A different authentication scheme can be used
2846 for each OSPF area. The 64-bit authentication field is set
2847 by the appropriate authentication procedure (determined by
2848 AuType). This procedure should be the last called when
2849
2850
2851
2852 <span class="grey">Moy [Page 51]</span></pre>
2853 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-52" ></span>
2854 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2855
2856
2857 forming the packet to be sent. The setting of the
2858 authentication field is determined by the packet contents
2859 and the authentication key (which is configurable on a per-
2860 interface basis).
2861
2862
2863 The IP destination address for the packet is selected as
2864 follows. On physical point-to-point networks, the IP
2865 destination is always set to the address AllSPFRouters. On all
2866 other network types (including virtual links), the majority of
2867 OSPF packets are sent as unicasts, i.e., sent directly to the
2868 other end of the adjacency. In this case, the IP destination is
2869 just the Neighbor IP address associated with the other end of
2870 the adjacency (see <a href="#section-10">Section 10</a>). The only packets not sent as
2871 unicasts are on broadcast networks; on these networks Hello
2872 packets are sent to the multicast destination AllSPFRouters, the
2873 Designated Router and its Backup send both Link State Update
2874 Packets and Link State Acknowledgment Packets to the multicast
2875 address AllSPFRouters, while all other routers send both their
2876 Link State Update and Link State Acknowledgment Packets to the
2877 multicast address AllDRouters.
2878
2879 Retransmissions of Link State Update packets are ALWAYS sent as
2880 unicasts.
2881
2882 The IP source address should be set to the IP address of the
2883 sending interface. Interfaces to unnumbered point-to-point
2884 networks have no associated IP address. On these interfaces,
2885 the IP source should be set to any of the other IP addresses
2886 belonging to the router. For this reason, there must be at
2887 least one IP address assigned to the router.[2] Note that, for
2888 most purposes, virtual links act precisely the same as
2889 unnumbered point-to-point networks. However, each virtual link
2890 does have an IP interface address (discovered during the routing
2891 table build process) which is used as the IP source when sending
2892 packets over the virtual link.
2893
2894 For more information on the format of specific OSPF packet
2895 types, consult the sections listed in Table 10.
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908 <span class="grey">Moy [Page 52]</span></pre>
2909 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-53" ></span>
2910 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2911
2912
2913
2914 Type Packet name detailed section (transmit)
2915 _________________________________________________________
2916 1 Hello Section 9.5
2917 2 Database description <a href="#section-10.8">Section 10.8</a>
2918 3 Link state request <a href="#section-10.9">Section 10.9</a>
2919 4 Link state update <a href="#section-13.3">Section 13.3</a>
2920 5 Link state ack <a href="#section-13.5">Section 13.5</a>
2921
2922
2923 Table 10: Sections describing OSPF protocol packet transmission.
2924
2925
2926
2927 8.2. Receiving protocol packets
2928
2929 Whenever a protocol packet is received by the router it is
2930 marked with the interface it was received on. For routers that
2931 have virtual links configured, it may not be immediately obvious
2932 which interface to associate the packet with. For example,
2933 consider the Router RT11 depicted in Figure 6. If RT11 receives
2934 an OSPF protocol packet on its interface to Network N8, it may
2935 want to associate the packet with the interface to Area 2, or
2936 with the virtual link to Router RT10 (which is part of the
2937 backbone). In the following, we assume that the packet is
2938 initially associated with the non-virtual link.[3]
2939
2940 In order for the packet to be accepted at the IP level, it must
2941 pass a number of tests, even before the packet is passed to OSPF
2942 for processing:
2943
2944
2945 o The IP checksum must be correct.
2946
2947 o The packet's IP destination address must be the IP address
2948 of the receiving interface, or one of the IP multicast
2949 addresses AllSPFRouters or AllDRouters.
2950
2951 o The IP protocol specified must be OSPF (89).
2952
2953 o Locally originated packets should not be passed on to OSPF.
2954 That is, the source IP address should be examined to make
2955 sure this is not a multicast packet that the router itself
2956 generated.
2957
2958
2959 Next, the OSPF packet header is verified. The fields specified
2960 in the header must match those configured for the receiving
2961
2962
2963
2964 <span class="grey">Moy [Page 53]</span></pre>
2965 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-54" ></span>
2966 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
2967
2968
2969 interface. If they do not, the packet should be discarded:
2970
2971
2972 o The version number field must specify protocol version 2.
2973
2974 o The 16-bit one's complement checksum of the OSPF packet's
2975 contents must be verified. Remember that the 64-bit
2976 authentication field must be excluded from the checksum
2977 calculation.
2978
2979 o The Area ID found in the OSPF header must be verified. If
2980 both of the following cases fail, the packet should be
2981 discarded. The Area ID specified in the header must either:
2982
2983 (1) Match the Area ID of the receiving interface. In this
2984 case, the packet has been sent over a single hop.
2985 Therefore, the packet's IP source address must be on the
2986 same network as the receiving interface. This can be
2987 determined by comparing the packet's IP source address
2988 to the interface's IP address, after masking both
2989 addresses with the interface mask. This comparison
2990 should not be performed on point-to-point networks. On
2991 point-to-point networks, the interface addresses of each
2992 end of the link are assigned independently, if they are
2993 assigned at all.
2994
2995 (2) Indicate the backbone. In this case, the packet has
2996 been sent over a virtual link. The receiving router
2997 must be an area border router, and the Router ID
2998 specified in the packet (the source router) must be the
2999 other end of a configured virtual link. The receiving
3000 interface must also attach to the virtual link's
3001 configured Transit area. If all of these checks
3002 succeed, the packet is accepted and is from now on
3003 associated with the virtual link (and the backbone
3004 area).
3005
3006 o Packets whose IP destination is AllDRouters should only be
3007 accepted if the state of the receiving interface is DR or
3008 Backup (see <a href="#section-9.1">Section 9.1</a>).
3009
3010 o The AuType specified in the packet must match the AuType
3011 specified for the associated area.
3012
3013
3014 Next, the packet must be authenticated. This depends on the
3015 AuType specified (see <a href="#appendix-D">Appendix D</a>). The authentication procedure
3016 may use an Authentication key, which can be configured on a
3017
3018
3019
3020 <span class="grey">Moy [Page 54]</span></pre>
3021 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-55" ></span>
3022 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3023
3024
3025 per-interface basis. If the authentication fails, the packet
3026 should be discarded.
3027
3028 If the packet type is Hello, it should then be further processed
3029 by the Hello Protocol (see <a href="#section-10.5">Section 10.5</a>). All other packet
3030 types are sent/received only on adjacencies. This means that
3031 the packet must have been sent by one of the router's active
3032 neighbors. If the receiving interface is a multi-access network
3033 (either broadcast or non-broadcast) the sender is identified by
3034 the IP source address found in the packet's IP header. If the
3035 receiving interface is a point-to-point link or a virtual link,
3036 the sender is identified by the Router ID (source router) found
3037 in the packet's OSPF header. The data structure associated with
3038 the receiving interface contains the list of active neighbors.
3039 Packets not matching any active neighbor are discarded.
3040
3041 At this point all received protocol packets are associated with
3042 an active neighbor. For the further input processing of
3043 specific packet types, consult the sections listed in Table 11.
3044
3045
3046
3047 Type Packet name detailed section (receive)
3048 ________________________________________________________
3049 1 Hello <a href="#section-10.5">Section 10.5</a>
3050 2 Database description <a href="#section-10.6">Section 10.6</a>
3051 3 Link state request <a href="#section-10.7">Section 10.7</a>
3052 4 Link state update <a href="#section-13">Section 13</a>
3053 5 Link state ack <a href="#section-13.7">Section 13.7</a>
3054
3055
3056 Table 11: Sections describing OSPF protocol packet reception.
3057
3058
3059
3060 <span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. The Interface Data Structure</span>
3061
3062 An OSPF interface is the connection between a router and a network.
3063 There is a single OSPF interface structure for each attached
3064 network; each interface structure has at most one IP interface
3065 address (see below). The support for multiple addresses on a single
3066 network is a matter for future consideration.
3067
3068 An OSPF interface can be considered to belong to the area that
3069 contains the attached network. All routing protocol packets
3070 originated by the router over this interface are labelled with the
3071 interface's Area ID. One or more router adjacencies may develop
3072 over an interface. A router's link state advertisements reflect the
3073
3074
3075
3076 <span class="grey">Moy [Page 55]</span></pre>
3077 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-56" ></span>
3078 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3079
3080
3081 state of its interfaces and their associated adjacencies.
3082
3083 The following data items are associated with an interface. Note
3084 that a number of these items are actually configuration for the
3085 attached network; those items must be the same for all routers
3086 connected to the network.
3087
3088
3089 Type
3090 The kind of network to which the interface attaches. Its value
3091 is either broadcast, non-broadcast yet still multi-access,
3092 point-to-point or virtual link.
3093
3094 State
3095 The functional level of an interface. State determines whether
3096 or not full adjacencies are allowed to form over the interface.
3097 State is also reflected in the router's link state
3098 advertisements.
3099
3100 IP interface address
3101 The IP address associated with the interface. This appears as
3102 the IP source address in all routing protocol packets originated
3103 over this interface. Interfaces to unnumbered point-to-point
3104 networks do not have an associated IP address.
3105
3106 IP interface mask
3107 Also referred to as the subnet mask, this indicates the portion
3108 of the IP interface address that identifies the attached
3109 network. Masking the IP interface address with the IP interface
3110 mask yields the IP network number of the attached network. On
3111 point-to-point networks and virtual links, the IP interface mask
3112 is not defined. On these networks, the link itself is not
3113 assigned an IP network number, and so the addresses of each side
3114 of the link are assigned independently, if they are assigned at
3115 all.
3116
3117 Area ID
3118 The Area ID of the area to which the attached network belongs.
3119 All routing protocol packets originating from the interface are
3120 labelled with this Area ID.
3121
3122 HelloInterval
3123 The length of time, in seconds, between the Hello packets that
3124 the router sends on the interface. Advertised in Hello packets
3125 sent out this interface.
3126
3127 RouterDeadInterval
3128 The number of seconds before the router's neighbors will declare
3129
3130
3131
3132 <span class="grey">Moy [Page 56]</span></pre>
3133 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-57" ></span>
3134 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3135
3136
3137 it down, when they stop hearing the router's Hello Packets.
3138 Advertised in Hello packets sent out this interface.
3139
3140 InfTransDelay
3141 The estimated number of seconds it takes to transmit a Link
3142 State Update Packet over this interface. Link state
3143 advertisements contained in the Link State Update packet will
3144 have their age incremented by this amount before transmission.
3145 This value should take into account transmission and propagation
3146 delays; it must be greater than zero.
3147
3148 Router Priority
3149 An 8-bit unsigned integer. When two routers attached to a
3150 network both attempt to become Designated Router, the one with
3151 the highest Router Priority takes precedence. A router whose
3152 Router Priority is set to 0 is ineligible to become Designated
3153 Router on the attached network. Advertised in Hello packets
3154 sent out this interface.
3155
3156 Hello Timer
3157 An interval timer that causes the interface to send a Hello
3158 packet. This timer fires every HelloInterval seconds. Note
3159 that on non-broadcast networks a separate Hello packet is sent
3160 to each qualified neighbor.
3161
3162 Wait Timer
3163 A single shot timer that causes the interface to exit the
3164 Waiting state, and as a consequence select a Designated Router
3165 on the network. The length of the timer is RouterDeadInterval
3166 seconds.
3167
3168 List of neighboring routers
3169 The other routers attached to this network. On multi-access
3170 networks, this list is formed by the Hello Protocol.
3171 Adjacencies will be formed to some of these neighbors. The set
3172 of adjacent neighbors can be determined by an examination of all
3173 of the neighbors' states.
3174
3175 Designated Router
3176 The Designated Router selected for the attached network. The
3177 Designated Router is selected on all multi-access networks by
3178 the Hello Protocol. Two pieces of identification are kept for
3179 the Designated Router: its Router ID and its IP interface
3180 address on the network. The Designated Router advertises link
3181 state for the network; this network link state advertisement is
3182 labelled with the Designated Router's IP address. The
3183 Designated Router is initialized to 0.0.0.0, which indicates the
3184 lack of a Designated Router.
3185
3186
3187
3188 <span class="grey">Moy [Page 57]</span></pre>
3189 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-58" ></span>
3190 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3191
3192
3193 Backup Designated Router
3194 The Backup Designated Router is also selected on all multi-
3195 access networks by the Hello Protocol. All routers on the
3196 attached network become adjacent to both the Designated Router
3197 and the Backup Designated Router. The Backup Designated Router
3198 becomes Designated Router when the current Designated Router
3199 fails. The Backup Designated Router is initialized to 0.0.0.0,
3200 indicating the lack of a Backup Designated Router.
3201
3202 Interface output cost(s)
3203 The cost of sending a data packet on the interface, expressed in
3204 the link state metric. This is advertised as the link cost for
3205 this interface in the router links advertisement. There may be
3206 a separate cost for each IP Type of Service. The cost of an
3207 interface must be greater than zero.
3208
3209 RxmtInterval
3210 The number of seconds between link state advertisement
3211 retransmissions, for adjacencies belonging to this interface.
3212 Also used when retransmitting Database Description and Link
3213 State Request Packets.
3214
3215 Authentication key
3216 This configured data allows the authentication procedure to
3217 generate and/or verify the Authentication field in the OSPF
3218 header. The Authentication key can be configured on a per-
3219 interface basis. For example, if the AuType indicates simple
3220 password, the Authentication key would be a 64-bit password.
3221 This key would be inserted directly into the OSPF header when
3222 originating routing protocol packets, and there could be a
3223 separate password for each network.
3224
3225
3226 9.1. Interface states
3227
3228 The various states that router interfaces may attain is
3229 documented in this section. The states are listed in order of
3230 progressing functionality. For example, the inoperative state
3231 is listed first, followed by a list of intermediate states
3232 before the final, fully functional state is achieved. The
3233 specification makes use of this ordering by sometimes making
3234 references such as "those interfaces in state greater than X".
3235 Figure 11 shows the graph of interface state changes. The arcs
3236 of the graph are labelled with the event causing the state
3237 change. These events are documented in <a href="#section-9.2">Section 9.2</a>. The
3238 interface state machine is described in more detail in <a href="#section-9.3">Section</a>
3239 <a href="#section-9.3">9.3</a>.
3240
3241
3242
3243
3244 <span class="grey">Moy [Page 58]</span></pre>
3245 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-59" ></span>
3246 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3247
3248
3249
3250 +----+ UnloopInd +--------+
3251 |Down|&lt;--------------|Loopback|
3252 +----+ +--------+
3253 |
3254 |InterfaceUp
3255 +-------+ | +--------------+
3256 |Waiting|&lt;-+--------------&gt;|Point-to-point|
3257 +-------+ +--------------+
3258 |
3259 WaitTimer|BackupSeen
3260 |
3261 |
3262 | NeighborChange
3263 +------+ +-+&lt;---------------- +-------+
3264 |Backup|&lt;----------|?|-----------------&gt;|DROther|
3265 +------+----------&gt;+-+&lt;-----+ +-------+
3266 Neighbor | |
3267 Change | |Neighbor
3268 | |Change
3269 | +--+
3270 +----&gt;|DR|
3271 +--+
3272
3273 Figure 11: Interface State changes
3274
3275 In addition to the state transitions pictured,
3276 Event InterfaceDown always forces Down State, and
3277 Event LoopInd always forces Loopback State
3278
3279
3280 Down
3281 This is the initial interface state. In this state, the
3282 lower-level protocols have indicated that the interface is
3283 unusable. No protocol traffic at all will be sent or
3284 received on such a interface. In this state, interface
3285 parameters should be set to their initial values. All
3286 interface timers should be disabled, and there should be no
3287 adjacencies associated with the interface.
3288
3289 Loopback
3290 In this state, the router's interface to the network is
3291 looped back. The interface may be looped back in hardware
3292 or software. The interface will be unavailable for regular
3293 data traffic. However, it may still be desirable to gain
3294 information on the quality of this interface, either through
3295 sending ICMP pings to the interface or through something
3296 like a bit error test. For this reason, IP packets may
3297
3298
3299
3300 <span class="grey">Moy [Page 59]</span></pre>
3301 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-60" ></span>
3302 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3303
3304
3305 still be addressed to an interface in Loopback state. To
3306 facilitate this, such interfaces are advertised in router
3307 links advertisements as single host routes, whose
3308 destination is the IP interface address.[4]
3309
3310 Waiting
3311 In this state, the router is trying to determine the
3312 identity of the (Backup) Designated Router for the network.
3313 To do this, the router monitors the Hello Packets it
3314 receives. The router is not allowed to elect a Backup
3315 Designated Router nor a Designated Router until it
3316 transitions out of Waiting state. This prevents unnecessary
3317 changes of (Backup) Designated Router.
3318
3319 Point-to-point
3320 In this state, the interface is operational, and connects
3321 either to a physical point-to-point network or to a virtual
3322 link. Upon entering this state, the router attempts to form
3323 an adjacency with the neighboring router. Hello Packets are
3324 sent to the neighbor every HelloInterval seconds.
3325
3326 DR Other
3327 The interface is to a multi-access network on which another
3328 router has been selected to be the Designated Router. In
3329 this state, the router itself has not been selected Backup
3330 Designated Router either. The router forms adjacencies to
3331 both the Designated Router and the Backup Designated Router
3332 (if they exist).
3333
3334 Backup
3335 In this state, the router itself is the Backup Designated
3336 Router on the attached network. It will be promoted to
3337 Designated Router when the present Designated Router fails.
3338 The router establishes adjacencies to all other routers
3339 attached to the network. The Backup Designated Router
3340 performs slightly different functions during the Flooding
3341 Procedure, as compared to the Designated Router (see <a href="#section-13.3">Section</a>
3342 <a href="#section-13.3">13.3</a>). See <a href="#section-7.4">Section 7.4</a> for more details on the functions
3343 performed by the Backup Designated Router.
3344
3345 DR In this state, this router itself is the Designated Router
3346 on the attached network. Adjacencies are established to all
3347 other routers attached to the network. The router must also
3348 originate a network links advertisement for the network
3349 node. The advertisement will contain links to all routers
3350 (including the Designated Router itself) attached to the
3351 network. See <a href="#section-7.3">Section 7.3</a> for more details on the functions
3352 performed by the Designated Router.
3353
3354
3355
3356 <span class="grey">Moy [Page 60]</span></pre>
3357 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-61" ></span>
3358 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3359
3360
3361 9.2. Events causing interface state changes
3362
3363 State changes can be effected by a number of events. These
3364 events are pictured as the labelled arcs in Figure 11. The
3365 label definitions are listed below. For a detailed explanation
3366 of the effect of these events on OSPF protocol operation,
3367 consult <a href="#section-9.3">Section 9.3</a>.
3368
3369
3370 InterfaceUp
3371 Lower-level protocols have indicated that the network
3372 interface is operational. This enables the interface to
3373 transition out of Down state. On virtual links, the
3374 interface operational indication is actually a result of the
3375 shortest path calculation (see <a href="#section-16.7">Section 16.7</a>).
3376
3377 WaitTimer
3378 The Wait Timer has fired, indicating the end of the waiting
3379 period that is required before electing a (Backup)
3380 Designated Router.
3381
3382 BackupSeen
3383 The router has detected the existence or non-existence of a
3384 Backup Designated Router for the network. This is done in
3385 one of two ways. First, an Hello Packet may be received
3386 from a neighbor claiming to be itself the Backup Designated
3387 Router. Alternatively, an Hello Packet may be received from
3388 a neighbor claiming to be itself the Designated Router, and
3389 indicating that there is no Backup Designated Router. In
3390 either case there must be bidirectional communication with
3391 the neighbor, i.e., the router must also appear in the
3392 neighbor's Hello Packet. This event signals an end to the
3393 Waiting state.
3394
3395 NeighborChange
3396 There has been a change in the set of bidirectional
3397 neighbors associated with the interface. The (Backup)
3398 Designated Router needs to be recalculated. The following
3399 neighbor changes lead to the NeighborChange event. For an
3400 explanation of neighbor states, see <a href="#section-10.1">Section 10.1</a>.
3401
3402 o Bidirectional communication has been established to a
3403 neighbor. In other words, the state of the neighbor has
3404 transitioned to 2-Way or higher.
3405
3406 o There is no longer bidirectional communication with a
3407 neighbor. In other words, the state of the neighbor has
3408 transitioned to Init or lower.
3409
3410
3411
3412 <span class="grey">Moy [Page 61]</span></pre>
3413 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-62" ></span>
3414 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3415
3416
3417 o One of the bidirectional neighbors is newly declaring
3418 itself as either Designated Router or Backup Designated
3419 Router. This is detected through examination of that
3420 neighbor's Hello Packets.
3421
3422 o One of the bidirectional neighbors is no longer
3423 declaring itself as Designated Router, or is no longer
3424 declaring itself as Backup Designated Router. This is
3425 again detected through examination of that neighbor's
3426 Hello Packets.
3427
3428 o The advertised Router Priority for a bidirectional
3429 neighbor has changed. This is again detected through
3430 examination of that neighbor's Hello Packets.
3431
3432 LoopInd
3433 An indication has been received that the interface is now
3434 looped back to itself. This indication can be received
3435 either from network management or from the lower level
3436 protocols.
3437
3438 UnloopInd
3439 An indication has been received that the interface is no
3440 longer looped back. As with the LoopInd event, this
3441 indication can be received either from network management or
3442 from the lower level protocols.
3443
3444 InterfaceDown
3445 Lower-level protocols indicate that this interface is no
3446 longer functional. No matter what the current interface
3447 state is, the new interface state will be Down.
3448
3449
3450 9.3. The Interface state machine
3451
3452 A detailed description of the interface state changes follows.
3453 Each state change is invoked by an event (<a href="#section-9.2">Section 9.2</a>). This
3454 event may produce different effects, depending on the current
3455 state of the interface. For this reason, the state machine
3456 below is organized by current interface state and received
3457 event. Each entry in the state machine describes the resulting
3458 new interface state and the required set of additional actions.
3459
3460 When an interface's state changes, it may be necessary to
3461 originate a new router links advertisement. See <a href="#section-12.4">Section 12.4</a>
3462 for more details.
3463
3464 Some of the required actions below involve generating events for
3465
3466
3467
3468 <span class="grey">Moy [Page 62]</span></pre>
3469 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-63" ></span>
3470 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3471
3472
3473 the neighbor state machine. For example, when an interface
3474 becomes inoperative, all neighbor connections associated with
3475 the interface must be destroyed. For more information on the
3476 neighbor state machine, see <a href="#section-10.3">Section 10.3</a>.
3477
3478
3479 State(s): Down
3480
3481 Event: InterfaceUp
3482
3483 New state: Depends upon action routine
3484
3485 Action: Start the interval Hello Timer, enabling the
3486 periodic sending of Hello packets out the interface.
3487 If the attached network is a physical point-to-point
3488 network or virtual link, the interface state
3489 transitions to Point-to-Point. Else, if the router
3490 is not eligible to become Designated Router the
3491 interface state transitions to DR Other.
3492
3493 Otherwise, the attached network is multi-access and
3494 the router is eligible to become Designated Router.
3495 In this case, in an attempt to discover the attached
3496 network's Designated Router the interface state is
3497 set to Waiting and the single shot Wait Timer is
3498 started. If in addition the attached network is
3499 non-broadcast, examine the configured list of
3500 neighbors for this interface and generate the
3501 neighbor event Start for each neighbor that is also
3502 eligible to become Designated Router.
3503
3504
3505 State(s): Waiting
3506
3507 Event: BackupSeen
3508
3509 New state: Depends upon action routine.
3510
3511 Action: Calculate the attached network's Backup Designated
3512 Router and Designated Router, as shown in <a href="#section-9.4">Section</a>
3513 <a href="#section-9.4">9.4</a>. As a result of this calculation, the new state
3514 of the interface will be either DR Other, Backup or
3515 DR.
3516
3517
3518 State(s): Waiting
3519
3520
3521
3522
3523
3524 <span class="grey">Moy [Page 63]</span></pre>
3525 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-64" ></span>
3526 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3527
3528
3529 Event: WaitTimer
3530
3531 New state: Depends upon action routine.
3532
3533 Action: Calculate the attached network's Backup Designated
3534 Router and Designated Router, as shown in <a href="#section-9.4">Section</a>
3535 <a href="#section-9.4">9.4</a>. As a result of this calculation, the new state
3536 of the interface will be either DR Other, Backup or
3537 DR.
3538
3539
3540 State(s): DR Other, Backup or DR
3541
3542 Event: NeighborChange
3543
3544 New state: Depends upon action routine.
3545
3546 Action: Recalculate the attached network's Backup Designated
3547 Router and Designated Router, as shown in <a href="#section-9.4">Section</a>
3548 <a href="#section-9.4">9.4</a>. As a result of this calculation, the new state
3549 of the interface will be either DR Other, Backup or
3550 DR.
3551
3552
3553 State(s): Any State
3554
3555 Event: InterfaceDown
3556
3557 New state: Down
3558
3559 Action: All interface variables are reset, and interface
3560 timers disabled. Also, all neighbor connections
3561 associated with the interface are destroyed. This
3562 is done by generating the event KillNbr on all
3563 associated neighbors (see <a href="#section-10.2">Section 10.2</a>).
3564
3565
3566 State(s): Any State
3567
3568 Event: LoopInd
3569
3570 New state: Loopback
3571
3572 Action: Since this interface is no longer connected to the
3573 attached network the actions associated with the
3574 above InterfaceDown event are executed.
3575
3576
3577
3578
3579
3580 <span class="grey">Moy [Page 64]</span></pre>
3581 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-65" ></span>
3582 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3583
3584
3585 State(s): Loopback
3586
3587 Event: UnloopInd
3588
3589 New state: Down
3590
3591 Action: No actions are necessary. For example, the
3592 interface variables have already been reset upon
3593 entering the Loopback state. Note that reception of
3594 an InterfaceUp event is necessary before the
3595 interface again becomes fully functional.
3596
3597
3598 9.4. Electing the Designated Router
3599
3600 This section describes the algorithm used for calculating a
3601 network's Designated Router and Backup Designated Router. This
3602 algorithm is invoked by the Interface state machine. The
3603 initial time a router runs the election algorithm for a network,
3604 the network's Designated Router and Backup Designated Router are
3605 initialized to 0.0.0.0. This indicates the lack of both a
3606 Designated Router and a Backup Designated Router.
3607
3608 The Designated Router election algorithm proceeds as follows:
3609 Call the router doing the calculation Router X. The list of
3610 neighbors attached to the network and having established
3611 bidirectional communication with Router X is examined. This
3612 list is precisely the collection of Router X's neighbors (on
3613 this network) whose state is greater than or equal to 2-Way (see
3614 <a href="#section-10.1">Section 10.1</a>). Router X itself is also considered to be on the
3615 list. Discard all routers from the list that are ineligible to
3616 become Designated Router. (Routers having Router Priority of 0
3617 are ineligible to become Designated Router.) The following
3618 steps are then executed, considering only those routers that
3619 remain on the list:
3620
3621
3622 (1) Note the current values for the network's Designated Router
3623 and Backup Designated Router. This is used later for
3624 comparison purposes.
3625
3626 (2) Calculate the new Backup Designated Router for the network
3627 as follows. Only those routers on the list that have not
3628 declared themselves to be Designated Router are eligible to
3629 become Backup Designated Router. If one or more of these
3630 routers have declared themselves Backup Designated Router
3631 (i.e., they are currently listing themselves as Backup
3632 Designated Router, but not as Designated Router, in their
3633
3634
3635
3636 <span class="grey">Moy [Page 65]</span></pre>
3637 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-66" ></span>
3638 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3639
3640
3641 Hello Packets) the one having highest Router Priority is
3642 declared to be Backup Designated Router. In case of a tie,
3643 the one having the highest Router ID is chosen. If no
3644 routers have declared themselves Backup Designated Router,
3645 choose the router having highest Router Priority, (again
3646 excluding those routers who have declared themselves
3647 Designated Router), and again use the Router ID to break
3648 ties.
3649
3650 (3) Calculate the new Designated Router for the network as
3651 follows. If one or more of the routers have declared
3652 themselves Designated Router (i.e., they are currently
3653 listing themselves as Designated Router in their Hello
3654 Packets) the one having highest Router Priority is declared
3655 to be Designated Router. In case of a tie, the one having
3656 the highest Router ID is chosen. If no routers have
3657 declared themselves Designated Router, assign the Designated
3658 Router to be the same as the newly elected Backup Designated
3659 Router.
3660
3661 (4) If Router X is now newly the Designated Router or newly the
3662 Backup Designated Router, or is now no longer the Designated
3663 Router or no longer the Backup Designated Router, repeat
3664 steps 2 and 3, and then proceed to step 5. For example, if
3665 Router X is now the Designated Router, when step 2 is
3666 repeated X will no longer be eligible for Backup Designated
3667 Router election. Among other things, this will ensure that
3668 no router will declare itself both Backup Designated Router
3669 and Designated Router.[5]
3670
3671 (5) As a result of these calculations, the router itself may now
3672 be Designated Router or Backup Designated Router. See
3673 Sections <a href="#section-7.3">7.3</a> and <a href="#section-7.4">7.4</a> for the additional duties this would
3674 entail. The router's interface state should be set
3675 accordingly. If the router itself is now Designated Router,
3676 the new interface state is DR. If the router itself is now
3677 Backup Designated Router, the new interface state is Backup.
3678 Otherwise, the new interface state is DR Other.
3679
3680 (6) If the attached network is non-broadcast, and the router
3681 itself has just become either Designated Router or Backup
3682 Designated Router, it must start sending Hello Packets to
3683 those neighbors that are not eligible to become Designated
3684 Router (see <a href="#section-9.5.1">Section 9.5.1</a>). This is done by invoking the
3685 neighbor event Start for each neighbor having a Router
3686 Priority of 0.
3687
3688
3689
3690
3691
3692 <span class="grey">Moy [Page 66]</span></pre>
3693 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-67" ></span>
3694 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3695
3696
3697 (7) If the above calculations have caused the identity of either
3698 the Designated Router or Backup Designated Router to change,
3699 the set of adjacencies associated with this interface will
3700 need to be modified. Some adjacencies may need to be
3701 formed, and others may need to be broken. To accomplish
3702 this, invoke the event AdjOK? on all neighbors whose state
3703 is at least 2-Way. This will cause their eligibility for
3704 adjacency to be reexamined (see Sections <a href="#section-10.3">10.3</a> and <a href="#section-10.4">10.4</a>).
3705
3706
3707 The reason behind the election algorithm's complexity is the
3708 desire for an orderly transition from Backup Designated Router
3709 to Designated Router, when the current Designated Router fails.
3710 This orderly transition is ensured through the introduction of
3711 hysteresis: no new Backup Designated Router can be chosen until
3712 the old Backup accepts its new Designated Router
3713 responsibilities.
3714
3715 The above procedure may elect the same router to be both
3716 Designated Router and Backup Designated Router, although that
3717 router will never be the calculating router (Router X) itself.
3718 The elected Designated Router may not be the router having the
3719 highest Router Priority, nor will the Backup Designated Router
3720 necessarily have the second highest Router Priority. If Router
3721 X is not itself eligible to become Designated Router, it is
3722 possible that neither a Backup Designated Router nor a
3723 Designated Router will be selected in the above procedure. Note
3724 also that if Router X is the only attached router that is
3725 eligible to become Designated Router, it will select itself as
3726 Designated Router and there will be no Backup Designated Router
3727 for the network.
3728
3729
3730 9.5. Sending Hello packets
3731
3732 Hello packets are sent out each functioning router interface.
3733 They are used to discover and maintain neighbor
3734 relationships.[6] On multi-access networks, Hello Packets are
3735 also used to elect the Designated Router and Backup Designated
3736 Router, and in that way determine what adjacencies should be
3737 formed.
3738
3739 The format of an Hello packet is detailed in Section A.3.2. The
3740 Hello Packet contains the router's Router Priority (used in
3741 choosing the Designated Router), and the interval between Hello
3742 Packets sent out the interface (HelloInterval). The Hello
3743 Packet also indicates how often a neighbor must be heard from to
3744 remain active (RouterDeadInterval). Both HelloInterval and
3745
3746
3747
3748 <span class="grey">Moy [Page 67]</span></pre>
3749 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-68" ></span>
3750 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3751
3752
3753 RouterDeadInterval must be the same for all routers attached to
3754 a common network. The Hello packet also contains the IP address
3755 mask of the attached network (Network Mask). On unnumbered
3756 point-to-point networks and on virtual links this field should
3757 be set to 0.0.0.0.
3758
3759 The Hello packet's Options field describes the router's optional
3760 OSPF capabilities. There are currently two optional
3761 capabilities defined (see Sections <a href="#section-4.5">4.5</a> and A.2). The T-bit of
3762 the Options field should be set if the router is capable of
3763 calculating separate routes for each IP TOS. The E-bit should
3764 be set if and only if the attached area is capable of processing
3765 AS external advertisements (i.e., it is not a stub area). If
3766 the E-bit is set incorrectly the neighboring routers will refuse
3767 to accept the Hello Packet (see <a href="#section-10.5">Section 10.5</a>). The rest of the
3768 Hello Packet's Options field should be set to zero.
3769
3770 In order to ensure two-way communication between adjacent
3771 routers, the Hello packet contains the list of all routers from
3772 which Hello Packets have been seen recently. The Hello packet
3773 also contains the router's current choice for Designated Router
3774 and Backup Designated Router. A value of 0.0.0.0 in these
3775 fields means that one has not yet been selected.
3776
3777 On broadcast networks and physical point-to-point networks,
3778 Hello packets are sent every HelloInterval seconds to the IP
3779 multicast address AllSPFRouters. On virtual links, Hello
3780 packets are sent as unicasts (addressed directly to the other
3781 end of the virtual link) every HelloInterval seconds. On non-
3782 broadcast networks, the sending of Hello packets is more
3783 complicated. This will be covered in the next section.
3784
3785
3786 9.5.1. Sending Hello packets on non-broadcast networks
3787
3788 Static configuration information is necessary in order for
3789 the Hello Protocol to function on non-broadcast networks
3790 (see Section C.5). Every attached router which is eligible
3791 to become Designated Router has a configured list of all of
3792 its neighbors on the network. Each listed neighbor is
3793 labelled with its Designated Router eligibility.
3794
3795 The interface state must be at least Waiting for any Hello
3796 Packets to be sent. Hello Packets are then sent directly
3797 (as unicasts) to some subset of a router's neighbors.
3798 Sometimes an Hello Packet is sent periodically on a timer;
3799 at other times it is sent as a response to a received Hello
3800 Packet. A router's hello-sending behavior varies depending
3801
3802
3803
3804 <span class="grey">Moy [Page 68]</span></pre>
3805 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-69" ></span>
3806 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3807
3808
3809 on whether the router itself is eligible to become
3810 Designated Router.
3811
3812 If the router is eligible to become Designated Router, it
3813 must periodically send Hello Packets to all neighbors that
3814 are also eligible. In addition, if the router is itself the
3815 Designated Router or Backup Designated Router, it must also
3816 send periodic Hello Packets to all other neighbors. This
3817 means that any two eligible routers are always exchanging
3818 Hello Packets, which is necessary for the correct operation
3819 of the Designated Router election algorithm. To minimize
3820 the number of Hello Packets sent, the number of eligible
3821 routers on a non-broadcast network should be kept small.
3822
3823 If the router is not eligible to become Designated Router,
3824 it must periodically send Hello Packets to both the
3825 Designated Router and the Backup Designated Router (if they
3826 exist). It must also send an Hello Packet in reply to an
3827 Hello Packet received from any eligible neighbor (other than
3828 the current Designated Router and Backup Designated Router).
3829 This is needed to establish an initial bidirectional
3830 relationship with any potential Designated Router.
3831
3832 When sending Hello packets periodically to any neighbor, the
3833 interval between Hello Packets is determined by the
3834 neighbor's state. If the neighbor is in state Down, Hello
3835 Packets are sent every PollInterval seconds. Otherwise,
3836 Hello Packets are sent every HelloInterval seconds.
3837
3838
3839 <span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a>. The Neighbor Data Structure</span>
3840
3841 An OSPF router converses with its neighboring routers. Each
3842 separate conversation is described by a "neighbor data structure".
3843 Each conversation is bound to a particular OSPF router interface,
3844 and is identified either by the neighboring router's OSPF Router ID
3845 or by its Neighbor IP address (see below). Thus if the OSPF router
3846 and another router have multiple attached networks in common,
3847 multiple conversations ensue, each described by a unique neighbor
3848 data structure. Each separate conversation is loosely referred to
3849 in the text as being a separate "neighbor".
3850
3851 The neighbor data structure contains all information pertinent to
3852 the forming or formed adjacency between the two neighbors.
3853 (However, remember that not all neighbors become adjacent.) An
3854 adjacency can be viewed as a highly developed conversation between
3855 two routers.
3856
3857
3858
3859
3860 <span class="grey">Moy [Page 69]</span></pre>
3861 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-70" ></span>
3862 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3863
3864
3865 State
3866 The functional level of the neighbor conversation. This is
3867 described in more detail in <a href="#section-10.1">Section 10.1</a>.
3868
3869 Inactivity Timer
3870 A single shot timer whose firing indicates that no Hello Packet
3871 has been seen from this neighbor recently. The length of the
3872 timer is RouterDeadInterval seconds.
3873
3874 Master/Slave
3875 When the two neighbors are exchanging databases, they form a
3876 master/slave relationship. The master sends the first Database
3877 Description Packet, and is the only part that is allowed to
3878 retransmit. The slave can only respond to the master's Database
3879 Description Packets. The master/slave relationship is
3880 negotiated in state ExStart.
3881
3882 DD Sequence Number
3883 A 32-bit number identifying individual Database Description
3884 packets. When the neighbor state ExStart is entered, the DD
3885 sequence number should be set to a value not previously seen by
3886 the neighboring router. One possible scheme is to use the
3887 machine's time of day counter. The DD sequence number is then
3888 incremented by the master with each new Database Description
3889 packet sent. The slave's DD sequence number indicates the last
3890 packet received from the master. Only one packet is allowed
3891 outstanding at a time.
3892
3893 Neighbor ID
3894 The OSPF Router ID of the neighboring router. The Neighbor ID
3895 is learned when Hello packets are received from the neighbor, or
3896 is configured if this is a virtual adjacency (see Section C.4).
3897
3898 Neighbor Priority
3899 The Router Priority of the neighboring router. Contained in the
3900 neighbor's Hello packets, this item is used when selecting the
3901 Designated Router for the attached network.
3902
3903 Neighbor IP address
3904 The IP address of the neighboring router's interface to the
3905 attached network. Used as the Destination IP address when
3906 protocol packets are sent as unicasts along this adjacency.
3907 Also used in router links advertisements as the Link ID for the
3908 attached network if the neighboring router is selected to be
3909 Designated Router (see <a href="#section-12.4.1">Section 12.4.1</a>). The Neighbor IP address
3910 is learned when Hello packets are received from the neighbor.
3911 For virtual links, the Neighbor IP address is learned during the
3912 routing table build process (see <a href="#section-15">Section 15</a>).
3913
3914
3915
3916 <span class="grey">Moy [Page 70]</span></pre>
3917 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-71" ></span>
3918 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3919
3920
3921 Neighbor Options
3922 The optional OSPF capabilities supported by the neighbor.
3923 Learned during the Database Exchange process (see <a href="#section-10.6">Section 10.6</a>).
3924 The neighbor's optional OSPF capabilities are also listed in its
3925 Hello packets. This enables received Hello Packets to be
3926 rejected (i.e., neighbor relationships will not even start to
3927 form) if there is a mismatch in certain crucial OSPF
3928 capabilities (see <a href="#section-10.5">Section 10.5</a>). The optional OSPF capabilities
3929 are documented in <a href="#section-4.5">Section 4.5</a>.
3930
3931 Neighbor's Designated Router
3932 The neighbor's idea of the Designated Router. If this is the
3933 neighbor itself, this is important in the local calculation of
3934 the Designated Router. Defined only on multi-access networks.
3935
3936 Neighbor's Backup Designated Router
3937 The neighbor's idea of the Backup Designated Router. If this is
3938 the neighbor itself, this is important in the local calculation
3939 of the Backup Designated Router. Defined only on multi-access
3940 networks.
3941
3942
3943 The next set of variables are lists of link state advertisements.
3944 These lists describe subsets of the area topological database.
3945 There can be five distinct types of link state advertisements in an
3946 area topological database: router links, network links, and Type 3
3947 and 4 summary links (all stored in the area data structure), and AS
3948 external links (stored in the global data structure).
3949
3950
3951 Link state retransmission list
3952 The list of link state advertisements that have been flooded but
3953 not acknowledged on this adjacency. These will be retransmitted
3954 at intervals until they are acknowledged, or until the adjacency
3955 is destroyed.
3956
3957 Database summary list
3958 The complete list of link state advertisements that make up the
3959 area topological database, at the moment the neighbor goes into
3960 Database Exchange state. This list is sent to the neighbor in
3961 Database Description packets.
3962
3963 Link state request list
3964 The list of link state advertisements that need to be received
3965 from this neighbor in order to synchronize the two neighbors'
3966 topological databases. This list is created as Database
3967 Description packets are received, and is then sent to the
3968 neighbor in Link State Request packets. The list is depleted as
3969
3970
3971
3972 <span class="grey">Moy [Page 71]</span></pre>
3973 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-72" ></span>
3974 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
3975
3976
3977 appropriate Link State Update packets are received.
3978
3979
3980 10.1. Neighbor states
3981
3982 The state of a neighbor (really, the state of a conversation
3983 being held with a neighboring router) is documented in the
3984 following sections. The states are listed in order of
3985 progressing functionality. For example, the inoperative state
3986 is listed first, followed by a list of intermediate states
3987 before the final, fully functional state is achieved. The
3988 specification makes use of this ordering by sometimes making
3989 references such as "those neighbors/adjacencies in state greater
3990 than X". Figures 12 and 13 show the graph of neighbor state
3991 changes. The arcs of the graphs are labelled with the event
3992 causing the state change. The neighbor events are documented in
3993 <a href="#section-10.2">Section 10.2</a>.
3994
3995 The graph in Figure 12 shows the state changes effected by the
3996 Hello Protocol. The Hello Protocol is responsible for neighbor
3997
3998 +----+
3999 |Down|
4000 +----+
4001 | | Start
4002 | +-------+
4003 Hello | +----&gt;|Attempt|
4004 Received | +-------+
4005 | |
4006 +----+&lt;-+ |HelloReceived
4007 |Init|&lt;---------------+
4008 +----+&lt;--------+
4009 | |
4010 |2-Way |1-Way
4011 |Received |Received
4012 | |
4013 +-------+ | +-----+
4014 |ExStart|&lt;--------+-------&gt;|2-Way|
4015 +-------+ +-----+
4016
4017 Figure 12: Neighbor state changes (Hello Protocol)
4018
4019 In addition to the state transitions pictured,
4020 Event KillNbr always forces Down State,
4021 Event InactivityTimer always forces Down State,
4022 Event LLDown always forces Down State
4023
4024
4025
4026
4027
4028 <span class="grey">Moy [Page 72]</span></pre>
4029 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-73" ></span>
4030 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4031
4032
4033 acquisition and maintenance, and for ensuring two way
4034 communication between neighbors.
4035
4036 The graph in Figure 13 shows the forming of an adjacency. Not
4037 every two neighboring routers become adjacent (see <a href="#section-10.4">Section</a>
4038 <a href="#section-10.4">10.4</a>). The adjacency starts to form when the neighbor is in
4039 state ExStart. After the two routers discover their
4040 master/slave status, the state transitions to Exchange. At this
4041 point the neighbor starts to be used in the flooding procedure,
4042 and the two neighboring routers begin synchronizing their
4043 databases. When this synchronization is finished, the neighbor
4044 is in state Full and we say that the two routers are fully
4045 adjacent. At this point the adjacency is listed in link state
4046 advertisements.
4047
4048 For a more detailed description of neighbor state changes,
4049 together with the additional actions involved in each change,
4050 see <a href="#section-10.3">Section 10.3</a>.
4051
4052 +-------+
4053 |ExStart|
4054 +-------+
4055 |
4056 NegotiationDone|
4057 +-&gt;+--------+
4058 |Exchange|
4059 +--+--------+
4060 |
4061 Exchange|
4062 Done |
4063 +----+ | +-------+
4064 |Full|&lt;---------+-----&gt;|Loading|
4065 +----+&lt;-+ +-------+
4066 | LoadingDone |
4067 +------------------+
4068
4069 Figure 13: Neighbor state changes (Database Exchange)
4070
4071 In addition to the state transitions pictured,
4072 Event SeqNumberMismatch forces ExStart state,
4073 Event BadLSReq forces ExStart state,
4074 Event 1-Way forces Init state,
4075 Event KillNbr always forces Down State,
4076 Event InactivityTimer always forces Down State,
4077 Event LLDown always forces Down State,
4078 Event AdjOK? leads to adjacency forming/breaking
4079
4080
4081
4082
4083
4084 <span class="grey">Moy [Page 73]</span></pre>
4085 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-74" ></span>
4086 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4087
4088
4089 Down
4090 This is the initial state of a neighbor conversation. It
4091 indicates that there has been no recent information received
4092 from the neighbor. On non-broadcast networks, Hello packets
4093 may still be sent to "Down" neighbors, although at a reduced
4094 frequency (see <a href="#section-9.5.1">Section 9.5.1</a>).
4095
4096 Attempt
4097 This state is only valid for neighbors attached to non-
4098 broadcast networks. It indicates that no recent information
4099 has been received from the neighbor, but that a more
4100 concerted effort should be made to contact the neighbor.
4101 This is done by sending the neighbor Hello packets at
4102 intervals of HelloInterval (see <a href="#section-9.5.1">Section 9.5.1</a>).
4103
4104 Init
4105 In this state, an Hello packet has recently been seen from
4106 the neighbor. However, bidirectional communication has not
4107 yet been established with the neighbor (i.e., the router
4108 itself did not appear in the neighbor's Hello packet). All
4109 neighbors in this state (or higher) are listed in the Hello
4110 packets sent from the associated interface.
4111
4112 2-Way
4113 In this state, communication between the two routers is
4114 bidirectional. This has been assured by the operation of
4115 the Hello Protocol. This is the most advanced state short
4116 of beginning adjacency establishment. The (Backup)
4117 Designated Router is selected from the set of neighbors in
4118 state 2-Way or greater.
4119
4120 ExStart
4121 This is the first step in creating an adjacency between the
4122 two neighboring routers. The goal of this step is to decide
4123 which router is the master, and to decide upon the initial
4124 DD sequence number. Neighbor conversations in this state or
4125 greater are called adjacencies.
4126
4127 Exchange
4128 In this state the router is describing its entire link state
4129 database by sending Database Description packets to the
4130 neighbor. Each Database Description Packet has a DD
4131 sequence number, and is explicitly acknowledged. Only one
4132 Database Description Packet is allowed outstanding at any
4133 one time. In this state, Link State Request Packets may
4134 also be sent asking for the neighbor's more recent
4135 advertisements. All adjacencies in Exchange state or
4136 greater are used by the flooding procedure. In fact, these
4137
4138
4139
4140 <span class="grey">Moy [Page 74]</span></pre>
4141 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-75" ></span>
4142 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4143
4144
4145 adjacencies are fully capable of transmitting and receiving
4146 all types of OSPF routing protocol packets.
4147
4148 Loading
4149 In this state, Link State Request packets are sent to the
4150 neighbor asking for the more recent advertisements that have
4151 been discovered (but not yet received) in the Exchange
4152 state.
4153
4154 Full
4155 In this state, the neighboring routers are fully adjacent.
4156 These adjacencies will now appear in router links and
4157 network links advertisements.
4158
4159
4160 10.2. Events causing neighbor state changes
4161
4162 State changes can be effected by a number of events. These
4163 events are shown in the labels of the arcs in Figures 12 and 13.
4164 The label definitions are as follows:
4165
4166
4167 HelloReceived
4168 A Hello packet has been received from a neighbor.
4169
4170 Start
4171 This is an indication that Hello Packets should now be sent
4172 to the neighbor at intervals of HelloInterval seconds. This
4173 event is generated only for neighbors associated with non-
4174 broadcast networks.
4175
4176 2-WayReceived
4177 Bidirectional communication has been realized between the
4178 two neighboring routers. This is indicated by this router
4179 seeing itself in the other's Hello packet.
4180
4181 NegotiationDone
4182 The Master/Slave relationship has been negotiated, and DD
4183 sequence numbers have been exchanged. This signals the
4184 start of the sending/receiving of Database Description
4185 packets. For more information on the generation of this
4186 event, consult <a href="#section-10.8">Section 10.8</a>.
4187
4188 ExchangeDone
4189 Both routers have successfully transmitted a full sequence
4190 of Database Description packets. Each router now knows what
4191 parts of its link state database are out of date. For more
4192 information on the generation of this event, consult Section
4193
4194
4195
4196 <span class="grey">Moy [Page 75]</span></pre>
4197 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-76" ></span>
4198 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4199
4200
4201 10.8.
4202
4203 BadLSReq
4204 A Link State Request has been received for a link state
4205 advertisement not contained in the database. This indicates
4206 an error in the Database Exchange process.
4207
4208 Loading Done
4209 Link State Updates have been received for all out-of-date
4210 portions of the database. This is indicated by the Link
4211 state request list becoming empty after the Database
4212 Exchange process has completed.
4213
4214 AdjOK?
4215 A decision must be made (again) as to whether an adjacency
4216 should be established/maintained with the neighbor. This
4217 event will start some adjacencies forming, and destroy
4218 others.
4219
4220
4221 The following events cause well developed neighbors to revert to
4222 lesser states. Unlike the above events, these events may occur
4223 when the neighbor conversation is in any of a number of states.
4224
4225
4226 SeqNumberMismatch
4227 A Database Description packet has been received that either
4228 a) has an unexpected DD sequence number, b) unexpectedly has
4229 the Init bit set or c) has an Options field differing from
4230 the last Options field received in a Database Description
4231 packet. Any of these conditions indicate that some error
4232 has occurred during adjacency establishment.
4233
4234 1-Way
4235 An Hello packet has been received from the neighbor, in
4236 which this router is not mentioned. This indicates that
4237 communication with the neighbor is not bidirectional.
4238
4239 KillNbr
4240 This is an indication that all communication with the
4241 neighbor is now impossible, forcing the neighbor to
4242 revert to Down state.
4243
4244 InactivityTimer
4245 The inactivity Timer has fired. This means that no Hello
4246 packets have been seen recently from the neighbor. The
4247 neighbor reverts to Down state.
4248
4249
4250
4251
4252 <span class="grey">Moy [Page 76]</span></pre>
4253 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-77" ></span>
4254 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4255
4256
4257 LLDown
4258 This is an indication from the lower level protocols that
4259 the neighbor is now unreachable. For example, on an X.25
4260 network this could be indicated by an X.25 clear indication
4261 with appropriate cause and diagnostic fields. This event
4262 forces the neighbor into Down state.
4263
4264
4265 10.3. The Neighbor state machine
4266
4267 A detailed description of the neighbor state changes follows.
4268 Each state change is invoked by an event (<a href="#section-10.2">Section 10.2</a>). This
4269 event may produce different effects, depending on the current
4270 state of the neighbor. For this reason, the state machine below
4271 is organized by current neighbor state and received event. Each
4272 entry in the state machine describes the resulting new neighbor
4273 state and the required set of additional actions.
4274
4275 When a neighbor's state changes, it may be necessary to rerun
4276 the Designated Router election algorithm. This is determined by
4277 whether the interface NeighborChange event is generated (see
4278 <a href="#section-9.2">Section 9.2</a>). Also, if the Interface is in DR state (the router
4279 is itself Designated Router), changes in neighbor state may
4280 cause a new network links advertisement to be originated (see
4281 <a href="#section-12.4">Section 12.4</a>).
4282
4283 When the neighbor state machine needs to invoke the interface
4284 state machine, it should be done as a scheduled task (see
4285 <a href="#section-4.4">Section 4.4</a>). This simplifies things, by ensuring that neither
4286 state machine will be executed recursively.
4287
4288
4289 State(s): Down
4290
4291 Event: Start
4292
4293 New state: Attempt
4294
4295 Action: Send an Hello Packet to the neighbor (this neighbor
4296 is always associated with a non-broadcast network)
4297 and start the Inactivity Timer for the neighbor.
4298 The timer's later firing would indicate that
4299 communication with the neighbor was not attained.
4300
4301
4302 State(s): Attempt
4303
4304
4305
4306
4307
4308 <span class="grey">Moy [Page 77]</span></pre>
4309 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-78" ></span>
4310 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4311
4312
4313 Event: HelloReceived
4314
4315 New state: Init
4316
4317 Action: Restart the Inactivity Timer for the neighbor, since
4318 the neighbor has now been heard from.
4319
4320
4321 State(s): Down
4322
4323 Event: HelloReceived
4324
4325 New state: Init
4326
4327 Action: Start the Inactivity Timer for the neighbor. The
4328 timer's later firing would indicate that the
4329 neighbor is dead.
4330
4331
4332 State(s): Init or greater
4333
4334 Event: HelloReceived
4335
4336 New state: No state change.
4337
4338 Action: Restart the Inactivity Timer for the neighbor, since
4339 the neighbor has again been heard from.
4340
4341
4342 State(s): Init
4343
4344 Event: 2-WayReceived
4345
4346 New state: Depends upon action routine.
4347
4348 Action: Determine whether an adjacency should be established
4349 with the neighbor (see <a href="#section-10.4">Section 10.4</a>). If not, the
4350 new neighbor state is 2-Way.
4351
4352 Otherwise (an adjacency should be established) the
4353 neighbor state transitions to ExStart. Upon
4354 entering this state, the router increments the DD
4355 sequence number for this neighbor. If this is the
4356 first time that an adjacency has been attempted, the
4357 DD sequence number should be assigned some unique
4358 value (like the time of day clock). It then
4359 declares itself master (sets the master/slave bit to
4360 master), and starts sending Database Description
4361
4362
4363
4364 <span class="grey">Moy [Page 78]</span></pre>
4365 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-79" ></span>
4366 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4367
4368
4369 Packets, with the initialize (I), more (M) and
4370 master (MS) bits set. This Database Description
4371 Packet should be otherwise empty. This Database
4372 Description Packet should be retransmitted at
4373 intervals of RxmtInterval until the next state is
4374 entered (see <a href="#section-10.8">Section 10.8</a>).
4375
4376
4377 State(s): ExStart
4378
4379 Event: NegotiationDone
4380
4381 New state: Exchange
4382
4383 Action: The router must list the contents of its entire area
4384 link state database in the neighbor Database summary
4385 list. The area link state database consists of the
4386 router links, network links and summary links
4387 contained in the area structure, along with the AS
4388 external links contained in the global structure.
4389 AS external link advertisements are omitted from a
4390 virtual neighbor's Database summary list. AS
4391 external advertisements are omitted from the
4392 Database summary list if the area has been
4393 configured as a stub (see <a href="#section-3.6">Section 3.6</a>).
4394 Advertisements whose age is equal to MaxAge are
4395 instead added to the neighbor's Link state
4396 retransmission list. A summary of the Database
4397 summary list will be sent to the neighbor in
4398 Database Description packets. Each Database
4399 Description Packet has a DD sequence number, and is
4400 explicitly acknowledged. Only one Database
4401 Description Packet is allowed outstanding at any one
4402 time. For more detail on the sending and receiving
4403 of Database Description packets, see Sections <a href="#section-10.8">10.8</a>
4404 and 10.6.
4405
4406
4407 State(s): Exchange
4408
4409 Event: ExchangeDone
4410
4411 New state: Depends upon action routine.
4412
4413 Action: If the neighbor Link state request list is empty,
4414 the new neighbor state is Full. No other action is
4415 required. This is an adjacency's final state.
4416
4417
4418
4419
4420 <span class="grey">Moy [Page 79]</span></pre>
4421 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-80" ></span>
4422 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4423
4424
4425 Otherwise, the new neighbor state is Loading. Start
4426 (or continue) sending Link State Request packets to
4427 the neighbor (see <a href="#section-10.9">Section 10.9</a>). These are requests
4428 for the neighbor's more recent advertisements (which
4429 were discovered but not yet received in the Exchange
4430 state). These advertisements are listed in the Link
4431 state request list associated with the neighbor.
4432
4433
4434 State(s): Loading
4435
4436 Event: Loading Done
4437
4438 New state: Full
4439
4440 Action: No action required. This is an adjacency's final
4441 state.
4442
4443
4444 State(s): 2-Way
4445
4446 Event: AdjOK?
4447
4448 New state: Depends upon action routine.
4449
4450 Action: Determine whether an adjacency should be formed with
4451 the neighboring router (see <a href="#section-10.4">Section 10.4</a>). If not,
4452 the neighbor state remains at 2-Way. Otherwise,
4453 transition the neighbor state to ExStart and perform
4454 the actions associated with the above state machine
4455 entry for state Init and event 2-WayReceived.
4456
4457
4458 State(s): ExStart or greater
4459
4460 Event: AdjOK?
4461
4462 New state: Depends upon action routine.
4463
4464 Action: Determine whether the neighboring router should
4465 still be adjacent. If yes, there is no state change
4466 and no further action is necessary.
4467
4468 Otherwise, the (possibly partially formed) adjacency
4469 must be destroyed. The neighbor state transitions
4470 to 2-Way. The Link state retransmission list,
4471 Database summary list and Link state request list
4472 are cleared of link state advertisements.
4473
4474
4475
4476 <span class="grey">Moy [Page 80]</span></pre>
4477 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-81" ></span>
4478 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4479
4480
4481 State(s): Exchange or greater
4482
4483 Event: SeqNumberMismatch
4484
4485 New state: ExStart
4486
4487 Action: The (possibly partially formed) adjacency is torn
4488 down, and then an attempt is made at
4489 reestablishment. The neighbor state first
4490 transitions to ExStart. The Link state
4491 retransmission list, Database summary list and Link
4492 state request list are cleared of link state
4493 advertisements. Then the router increments the DD
4494 sequence number for this neighbor, declares itself
4495 master (sets the master/slave bit to master), and
4496 starts sending Database Description Packets, with
4497 the initialize (I), more (M) and master (MS) bits
4498 set. This Database Description Packet should be
4499 otherwise empty (see <a href="#section-10.8">Section 10.8</a>).
4500
4501
4502 State(s): Exchange or greater
4503
4504 Event: BadLSReq
4505
4506 New state: ExStart
4507
4508 Action: The action for event BadLSReq is exactly the same as
4509 for the neighbor event SeqNumberMismatch. The
4510 (possibly partially formed) adjacency is torn down,
4511 and then an attempt is made at reestablishment. For
4512 more information, see the neighbor state machine
4513 entry that is invoked when event SeqNumberMismatch
4514 is generated in state Exchange or greater.
4515
4516
4517 State(s): Any state
4518
4519 Event: KillNbr
4520
4521 New state: Down
4522
4523 Action: The Link state retransmission list, Database summary
4524 list and Link state request list are cleared of link
4525 state advertisements. Also, the Inactivity Timer is
4526 disabled.
4527
4528
4529
4530
4531
4532 <span class="grey">Moy [Page 81]</span></pre>
4533 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-82" ></span>
4534 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4535
4536
4537 State(s): Any state
4538
4539 Event: LLDown
4540
4541 New state: Down
4542
4543 Action: The Link state retransmission list, Database summary
4544 list and Link state request list are cleared of link
4545 state advertisements. Also, the Inactivity Timer is
4546 disabled.
4547
4548
4549 State(s): Any state
4550
4551 Event: InactivityTimer
4552
4553 New state: Down
4554
4555 Action: The Link state retransmission list, Database summary
4556 list and Link state request list are cleared of link
4557 state advertisements.
4558
4559
4560 State(s): 2-Way or greater
4561
4562 Event: 1-WayReceived
4563
4564 New state: Init
4565
4566 Action: The Link state retransmission list, Database summary
4567 list and Link state request list are cleared of link
4568 state advertisements.
4569
4570
4571 State(s): 2-Way or greater
4572
4573 Event: 2-WayReceived
4574
4575 New state: No state change.
4576
4577 Action: No action required.
4578
4579
4580 State(s): Init
4581
4582 Event: 1-WayReceived
4583
4584
4585
4586
4587
4588 <span class="grey">Moy [Page 82]</span></pre>
4589 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-83" ></span>
4590 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4591
4592
4593 New state: No state change.
4594
4595 Action: No action required.
4596
4597
4598 10.4. Whether to become adjacent
4599
4600 Adjacencies are established with some subset of the router's
4601 neighbors. Routers connected by point-to-point networks and
4602 virtual links always become adjacent. On multi-access networks,
4603 all routers become adjacent to both the Designated Router and
4604 the Backup Designated Router.
4605
4606 The adjacency-forming decision occurs in two places in the
4607 neighbor state machine. First, when bidirectional communication
4608 is initially established with the neighbor, and secondly, when
4609 the identity of the attached network's (Backup) Designated
4610 Router changes. If the decision is made to not attempt an
4611 adjacency, the state of the neighbor communication stops at 2-
4612 Way.
4613
4614 An adjacency should be established with a bidirectional neighbor
4615 when at least one of the following conditions holds:
4616
4617
4618 o The underlying network type is point-to-point
4619
4620 o The underlying network type is virtual link
4621
4622 o The router itself is the Designated Router
4623
4624 o The router itself is the Backup Designated Router
4625
4626 o The neighboring router is the Designated Router
4627
4628 o The neighboring router is the Backup Designated Router
4629
4630
4631 10.5. Receiving Hello Packets
4632
4633 This section explains the detailed processing of a received
4634 Hello Packet. (See Section A.3.2 for the format of Hello
4635 packets.) The generic input processing of OSPF packets will
4636 have checked the validity of the IP header and the OSPF packet
4637 header. Next, the values of the Network Mask, HelloInterval,
4638 and RouterDeadInterval fields in the received Hello packet must
4639 be checked against the values configured for the receiving
4640 interface. Any mismatch causes processing to stop and the
4641
4642
4643
4644 <span class="grey">Moy [Page 83]</span></pre>
4645 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-84" ></span>
4646 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4647
4648
4649 packet to be dropped. In other words, the above fields are
4650 really describing the attached network's configuration. However,
4651 there is one exception to the above rule: on point-to-point
4652 networks and on virtual links, the Network Mask in the received
4653 Hello Packet should be ignored.
4654
4655 The receiving interface attaches to a single OSPF area (this
4656 could be the backbone). The setting of the E-bit found in the
4657 Hello Packet's Options field must match this area's
4658 ExternalRoutingCapability. If AS external advertisements are
4659 not flooded into/throughout the area (i.e, the area is a "stub")
4660 the E-bit must be clear in received Hello Packets, otherwise the
4661 E-bit must be set. A mismatch causes processing to stop and the
4662 packet to be dropped. The setting of the rest of the bits in
4663 the Hello Packet's Options field should be ignored.
4664
4665 At this point, an attempt is made to match the source of the
4666 Hello Packet to one of the receiving interface's neighbors. If
4667 the receiving interface is a multi-access network (either
4668 broadcast or non-broadcast) the source is identified by the IP
4669 source address found in the Hello's IP header. If the receiving
4670 interface is a point-to-point link or a virtual link, the source
4671 is identified by the Router ID found in the Hello's OSPF packet
4672 header. The interface's current list of neighbors is contained
4673 in the interface's data structure. If a matching neighbor
4674 structure cannot be found, (i.e., this is the first time the
4675 neighbor has been detected), one is created. The initial state
4676 of a newly created neighbor is set to Down.
4677
4678 When receiving an Hello Packet from a neighbor on a multi-access
4679 network (broadcast or non-broadcast), set the neighbor
4680 structure's Neighbor ID equal to the Router ID found in the
4681 packet's OSPF header. When receiving an Hello on a point-to-
4682 point network (but not on a virtual link) set the neighbor
4683 structure's Neighbor IP address to the packet's IP source
4684 address.
4685
4686 Now the rest of the Hello Packet is examined, generating events
4687 to be given to the neighbor and interface state machines. These
4688 state machines are specified either to be executed or scheduled
4689 (see <a href="#section-4.4">Section 4.4</a>). For example, by specifying below that the
4690 neighbor state machine be executed in line, several neighbor
4691 state transitions may be effected by a single received Hello:
4692
4693
4694 o Each Hello Packet causes the neighbor state machine to be
4695 executed with the event HelloReceived.
4696
4697
4698
4699
4700 <span class="grey">Moy [Page 84]</span></pre>
4701 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-85" ></span>
4702 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4703
4704
4705 o Then the list of neighbors contained in the Hello Packet is
4706 examined. If the router itself appears in this list, the
4707 neighbor state machine should be executed with the event 2-
4708 WayReceived. Otherwise, the neighbor state machine should
4709 be executed with the event 1-WayReceived, and the processing
4710 of the packet stops.
4711
4712 o Next, the Hello Packet's Router Priority field is examined.
4713 If this field is different than the one previously received
4714 from the neighbor, the receiving interface's state machine
4715 is scheduled with the event NeighborChange. In any case,
4716 the Router Priority field in the neighbor data structure
4717 should be updated accordingly.
4718
4719 o Next the Designated Router field in the Hello Packet is
4720 examined. If the neighbor is both declaring itself to be
4721 Designated Router (Designated Router field = Neighbor IP
4722 address) and the Backup Designated Router field in the
4723 packet is equal to 0.0.0.0 and the receiving interface is in
4724 state Waiting, the receiving interface's state machine is
4725 scheduled with the event BackupSeen. Otherwise, if the
4726 neighbor is declaring itself to be Designated Router and it
4727 had not previously, or the neighbor is not declaring itself
4728 Designated Router where it had previously, the receiving
4729 interface's state machine is scheduled with the event
4730 NeighborChange. In any case, the Neighbors' Designated
4731 Router item in the neighbor structure is updated
4732 accordingly.
4733
4734 o Finally, the Backup Designated Router field in the Hello
4735 Packet is examined. If the neighbor is declaring itself to
4736 be Backup Designated Router (Backup Designated Router field
4737 = Neighbor IP address) and the receiving interface is in
4738 state Waiting, the receiving interface's state machine is
4739 scheduled with the event BackupSeen. Otherwise, if the
4740 neighbor is declaring itself to be Backup Designated Router
4741 and it had not previously, or the neighbor is not declaring
4742 itself Backup Designated Router where it had previously, the
4743 receiving interface's state machine is scheduled with the
4744 event NeighborChange. In any case, the Neighbor's Backup
4745 Designated Router item in the neighbor structure is updated
4746 accordingly.
4747
4748 On non-broadcast multi-access networks, receipt of an Hello
4749 Packet may also cause an Hello Packet to be sent back to the
4750 neighbor in response. See <a href="#section-9.5.1">Section 9.5.1</a> for more details.
4751
4752
4753
4754
4755
4756 <span class="grey">Moy [Page 85]</span></pre>
4757 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-86" ></span>
4758 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4759
4760
4761 10.6. Receiving Database Description Packets
4762
4763 This section explains the detailed processing of a received
4764 Database Description Packet. The incoming Database Description
4765 Packet has already been associated with a neighbor and receiving
4766 interface by the generic input packet processing (<a href="#section-8.2">Section 8.2</a>).
4767 The further processing of the Database Description Packet
4768 depends on the neighbor state. If the neighbor's state is Down
4769 or Attempt the packet should be ignored. Otherwise, if the
4770 state is:
4771
4772
4773 Init
4774 The neighbor state machine should be executed with the event
4775 2-WayReceived. This causes an immediate state change to
4776 either state 2-Way or state ExStart. If the new state is
4777 ExStart, the processing of the current packet should then
4778 continue in this new state by falling through to case
4779 ExStart below.
4780
4781 2-Way
4782 The packet should be ignored. Database Description Packets
4783 are used only for the purpose of bringing up adjacencies.[7]
4784
4785 ExStart
4786 If the received packet matches one of the following cases,
4787 then the neighbor state machine should be executed with the
4788 event NegotiationDone (causing the state to transition to
4789 Exchange), the packet's Options field should be recorded in
4790 the neighbor structure's Neighbor Options field and the
4791 packet should be accepted as next in sequence and processed
4792 further (see below). Otherwise, the packet should be
4793 ignored.
4794
4795 o The initialize(I), more (M) and master(MS) bits are set,
4796 the contents of the packet are empty, and the neighbor's
4797 Router ID is larger than the router's own. In this case
4798 the router is now Slave. Set the master/slave bit to
4799 slave, and set the DD sequence number to that specified
4800 by the master.
4801
4802 o The initialize(I) and master(MS) bits are off, the
4803 packet's DD sequence number equals the router's own DD
4804 sequence number (indicating acknowledgment) and the
4805 neighbor's Router ID is smaller than the router's own.
4806 In this case the router is Master.
4807
4808
4809
4810
4811
4812 <span class="grey">Moy [Page 86]</span></pre>
4813 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-87" ></span>
4814 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4815
4816
4817 Exchange
4818 If the state of the MS-bit is inconsistent with the
4819 master/slave state of the connection, generate the neighbor
4820 event SeqNumberMismatch and stop processing the packet.
4821 Otherwise:
4822
4823 o If the initialize(I) bit is set, generate the neighbor
4824 event SeqNumberMismatch and stop processing the packet.
4825
4826 o If the packet's Options field indicates a different set
4827 of optional OSPF capabilities than were previously
4828 received from the neighbor (recorded in the Neighbor
4829 Options field of the neighbor structure), generate the
4830 neighbor event SeqNumberMismatch and stop processing the
4831 packet.
4832
4833 o If the router is master, and the packet's DD sequence
4834 number equals the router's own DD sequence number (this
4835 packet is the next in sequence) the packet should be
4836 accepted and its contents processed (below).
4837
4838 o If the router is master, and the packet's DD sequence
4839 number is one less than the router's DD sequence number,
4840 the packet is a duplicate. Duplicates should be
4841 discarded by the master.
4842
4843 o If the router is slave, and the packet's DD sequence
4844 number is one more than the router's own DD sequence
4845 number (this packet is the next in sequence) the packet
4846 should be accepted and its contents processed (below).
4847
4848 o If the router is slave, and the packet's DD sequence
4849 number is equal to the router's DD sequence number, the
4850 packet is a duplicate. The slave must respond to
4851 duplicates by repeating the last Database Description
4852 packet that it had sent.
4853
4854 o Else, generate the neighbor event SeqNumberMismatch and
4855 stop processing the packet.
4856
4857 Loading or Full
4858 In this state, the router has sent and received an entire
4859 sequence of Database Description Packets. The only packets
4860 received should be duplicates (see above). In particular,
4861 the packet's Options field should match the set of optional
4862 OSPF capabilities previously indicated by the neighbor
4863 (stored in the neighbor structure's Neighbor Options field).
4864 Any other packets received, including the reception of a
4865
4866
4867
4868 <span class="grey">Moy [Page 87]</span></pre>
4869 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-88" ></span>
4870 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4871
4872
4873 packet with the Initialize(I) bit set, should generate the
4874 neighbor event SeqNumberMismatch.[8] Duplicates should be
4875 discarded by the master. The slave must respond to
4876 duplicates by repeating the last Database Description packet
4877 that it had sent.
4878
4879
4880 When the router accepts a received Database Description Packet
4881 as the next in sequence the packet contents are processed as
4882 follows. For each link state advertisement listed, the
4883 advertisement's LS type is checked for validity. If the LS type
4884 is unknown (e.g., not one of the LS types 1-5 defined by this
4885 specification), or if this is a AS external advertisement (LS
4886 type = 5) and the neighbor is associated with a stub area,
4887 generate the neighbor event SeqNumberMismatch and stop
4888 processing the packet. Otherwise, the router looks up the
4889 advertisement in its database to see whether it also has an
4890 instance of the link state advertisement. If it does not, or if
4891 the database copy is less recent (see <a href="#section-13.1">Section 13.1</a>), the link
4892 state advertisement is put on the Link state request list so
4893 that it can be requested (immediately or at some later time) in
4894 Link State Request Packets.
4895
4896 When the router accepts a received Database Description Packet
4897 as the next in sequence, it also performs the following actions,
4898 depending on whether it is master or slave:
4899
4900
4901 Master
4902 Increments the DD sequence number. If the router has
4903 already sent its entire sequence of Database Description
4904 Packets, and the just accepted packet has the more bit (M)
4905 set to 0, the neighbor event ExchangeDone is generated.
4906 Otherwise, it should send a new Database Description to the
4907 slave.
4908
4909 Slave
4910 Sets the DD sequence number to the DD sequence number
4911 appearing in the received packet. The slave must send a
4912 Database Description Packet in reply. If the received
4913 packet has the more bit (M) set to 0, and the packet to be
4914 sent by the slave will also have the M-bit set to 0, the
4915 neighbor event ExchangeDone is generated. Note that the
4916 slave always generates this event before the master.
4917
4918
4919
4920
4921
4922
4923
4924 <span class="grey">Moy [Page 88]</span></pre>
4925 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-89" ></span>
4926 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4927
4928
4929 10.7. Receiving Link State Request Packets
4930
4931 This section explains the detailed processing of received Link
4932 State Request packets. Received Link State Request Packets
4933 specify a list of link state advertisements that the neighbor
4934 wishes to receive. Link State Request Packets should be
4935 accepted when the neighbor is in states Exchange, Loading, or
4936 Full. In all other states Link State Request Packets should be
4937 ignored.
4938
4939 Each link state advertisement specified in the Link State
4940 Request packet should be located in the router's database, and
4941 copied into Link State Update packets for transmission to the
4942 neighbor. These link state advertisements should NOT be placed
4943 on the Link state retransmission list for the neighbor. If a
4944 link state advertisement cannot be found in the database,
4945 something has gone wrong with the Database Exchange process, and
4946 neighbor event BadLSReq should be generated.
4947
4948
4949 10.8. Sending Database Description Packets
4950
4951 This section describes how Database Description Packets are sent
4952 to a neighbor. The router's optional OSPF capabilities (see
4953 <a href="#section-4.5">Section 4.5</a>) are transmitted to the neighbor in the Options
4954 field of the Database Description packet. The router should
4955 maintain the same set of optional capabilities throughout the
4956 Database Exchange and flooding procedures. If for some reason
4957 the router's optional capabilities change, the Database Exchange
4958 procedure should be restarted by reverting to neighbor state
4959 ExStart. There are currently two optional capabilities defined.
4960 The T-bit should be set if and only if the router is capable of
4961 calculating separate routes for each IP TOS. The E-bit should
4962 be set if and only if the attached network belongs to a non-stub
4963 area. The rest of the Options field should be set to zero.
4964
4965 The sending of Database Description packets depends on the
4966 neighbor's state. In state ExStart the router sends empty
4967 Database Description packets, with the initialize (I), more (M)
4968 and master (MS) bits set. These packets are retransmitted every
4969 RxmtInterval seconds.
4970
4971 In state Exchange the Database Description Packets actually
4972 contain summaries of the link state information contained in the
4973 router's database. Each link state advertisement in the area's
4974 topological database (at the time the neighbor transitions into
4975 Exchange state) is listed in the neighbor Database summary list.
4976 When a new Database Description Packet is to be sent, the
4977
4978
4979
4980 <span class="grey">Moy [Page 89]</span></pre>
4981 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-90" ></span>
4982 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
4983
4984
4985 packet's DD sequence number is incremented, and the (new) top of
4986 the Database summary list is described by the packet. Items are
4987 removed from the Database summary list when the previous packet
4988 is acknowledged.
4989
4990 In state Exchange, the determination of when to send a Database
4991 Description packet depends on whether the router is master or
4992 slave:
4993
4994
4995 Master
4996 Database Description packets are sent when either a) the
4997 slave acknowledges the previous Database Description packet
4998 by echoing the DD sequence number or b) RxmtInterval seconds
4999 elapse without an acknowledgment, in which case the previous
5000 Database Description packet is retransmitted.
5001
5002 Slave
5003 Database Description packets are sent only in response to
5004 Database Description packets received from the master. If
5005 the Database Description packet received from the master is
5006 new, a new Database Description packet is sent, otherwise
5007 the previous Database Description packet is resent.
5008
5009
5010 In states Loading and Full the slave must resend its last
5011 Database Description packet in response to duplicate Database
5012 Description packets received from the master. For this reason
5013 the slave must wait RouterDeadInterval seconds before freeing
5014 the last Database Description packet. Reception of a Database
5015 Description packet from the master after this interval will
5016 generate a SeqNumberMismatch neighbor event.
5017
5018
5019 10.9. Sending Link State Request Packets
5020
5021 In neighbor states Exchange or Loading, the Link state request
5022 list contains a list of those link state advertisements that
5023 need to be obtained from the neighbor. To request these
5024 advertisements, a router sends the neighbor the beginning of the
5025 Link state request list, packaged in a Link State Request
5026 packet.
5027
5028 When the neighbor responds to these requests with the proper
5029 Link State Update packet(s), the Link state request list is
5030 truncated and a new Link State Request packet is sent. This
5031 process continues until the Link state request list becomes
5032 empty. Unsatisfied Link State Request packets are retransmitted
5033
5034
5035
5036 <span class="grey">Moy [Page 90]</span></pre>
5037 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-91" ></span>
5038 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5039
5040
5041 at intervals of RxmtInterval. There should be at most one Link
5042 State Request packet outstanding at any one time.
5043
5044 When the Link state request list becomes empty, and the neighbor
5045 state is Loading (i.e., a complete sequence of Database
5046 Description packets has been sent to and received from the
5047 neighbor), the Loading Done neighbor event is generated.
5048
5049
5050 10.10. An Example
5051
5052 Figure 14 shows an example of an adjacency forming. Routers RT1
5053 and RT2 are both connected to a broadcast network. It is
5054 assumed that RT2 is the Designated Router for the network, and
5055 that RT2 has a higher Router ID than Router RT1.
5056
5057 The neighbor state changes realized by each router are listed on
5058 the sides of the figure.
5059
5060 At the beginning of Figure 14, Router RT1's interface to the
5061 network becomes operational. It begins sending Hello Packets,
5062 although it doesn't know the identity of the Designated Router
5063 or of any other neighboring routers. Router RT2 hears this
5064 hello (moving the neighbor to Init state), and in its next Hello
5065 Packet indicates that it is itself the Designated Router and
5066 that it has heard Hello Packets from RT1. This in turn causes
5067 RT1 to go to state ExStart, as it starts to bring up the
5068 adjacency.
5069
5070 RT1 begins by asserting itself as the master. When it sees that
5071 RT2 is indeed the master (because of RT2's higher Router ID),
5072 RT1 transitions to slave state and adopts its neighbor's DD
5073 sequence number. Database Description packets are then
5074 exchanged, with polls coming from the master (RT2) and responses
5075 from the slave (RT1). This sequence of Database Description
5076 Packets ends when both the poll and associated response has the
5077 M-bit off.
5078
5079 In this example, it is assumed that RT2 has a completely up to
5080 date database. In that case, RT2 goes immediately into Full
5081 state. RT1 will go into Full state after updating the necessary
5082 parts of its database. This is done by sending Link State
5083 Request Packets, and receiving Link State Update Packets in
5084 response. Note that, while RT1 has waited until a complete set
5085 of Database Description Packets has been received (from RT2)
5086 before sending any Link State Request Packets, this need not be
5087 the case. RT1 could have interleaved the sending of Link State
5088 Request Packets with the reception of Database Description
5089
5090
5091
5092 <span class="grey">Moy [Page 91]</span></pre>
5093 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-92" ></span>
5094 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5095
5096
5097
5098
5099
5100
5101
5102 +---+ +---+
5103 |RT1| |RT2|
5104 +---+ +---+
5105
5106 Down Down
5107 Hello(DR=0,seen=0)
5108 ------------------------------&gt;
5109 Hello (DR=RT2,seen=RT1,...) Init
5110 &lt;------------------------------
5111 ExStart D-D (Seq=x,I,M,Master)
5112 ------------------------------&gt;
5113 D-D (Seq=y,I,M,Master) ExStart
5114 &lt;------------------------------
5115 Exchange D-D (Seq=y,M,Slave)
5116 ------------------------------&gt;
5117 D-D (Seq=y+1,M,Master) Exchange
5118 &lt;------------------------------
5119 D-D (Seq=y+1,M,Slave)
5120 ------------------------------&gt;
5121 ...
5122 ...
5123 ...
5124 D-D (Seq=y+n, Master)
5125 &lt;------------------------------
5126 D-D (Seq=y+n, Slave)
5127 Loading ------------------------------&gt;
5128 LS Request Full
5129 ------------------------------&gt;
5130 LS Update
5131 &lt;------------------------------
5132 LS Request
5133 ------------------------------&gt;
5134 LS Update
5135 &lt;------------------------------
5136 Full
5137
5138
5139 Figure 14: An adjacency bring-up example
5140
5141
5142
5143
5144
5145
5146
5147
5148 <span class="grey">Moy [Page 92]</span></pre>
5149 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-93" ></span>
5150 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5151
5152
5153 Packets.
5154
5155
5156 <span class="h2"><a class="selflink" id="section-11" href="#section-11">11</a>. The Routing Table Structure</span>
5157
5158 The routing table data structure contains all the information
5159 necessary to forward an IP data packet toward its destination. Each
5160 routing table entry describes the collection of best paths to a
5161 particular destination. When forwarding an IP data packet, the
5162 routing table entry providing the best match for the packet's IP
5163 destination is located. The matching routing table entry then
5164 provides the next hop towards the packet's destination. OSPF also
5165 provides for the existence of a default route (Destination ID =
5166 DefaultDestination, Address Mask = 0x00000000). When the default
5167 route exists, it matches all IP destinations (although any other
5168 matching entry is a better match). Finding the routing table entry
5169 that best matches an IP destination is further described in <a href="#section-11.1">Section</a>
5170 <a href="#section-11.1">11.1</a>.
5171
5172 There is a single routing table in each router. Two sample routing
5173 tables are described in Sections <a href="#section-11.2">11.2</a> and <a href="#section-11.3">11.3</a>. The building of the
5174 routing table is discussed in <a href="#section-16">Section 16</a>.
5175
5176 The rest of this section defines the fields found in a routing table
5177 entry. The first set of fields describes the routing table entry's
5178 destination.
5179
5180
5181 Destination Type
5182 The destination can be one of three types. Only the first type,
5183 Network, is actually used when forwarding IP data traffic. The
5184 other destinations are used solely as intermediate steps in the
5185 routing table build process.
5186
5187 Network
5188 A range of IP addresses, to which IP data traffic may be
5189 forwarded. This includes IP networks (class A, B, or C), IP
5190 subnets, IP supernets and single IP hosts. The default
5191 route also falls in this category.
5192
5193 Area border router
5194 Routers that are connected to multiple OSPF areas. Such
5195 routers originate summary link advertisements. These
5196 routing table entries are used when calculating the inter-
5197 area routes (see <a href="#section-16.2">Section 16.2</a>). These routing table entries
5198 may also be associated with configured virtual links.
5199
5200
5201
5202
5203
5204 <span class="grey">Moy [Page 93]</span></pre>
5205 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-94" ></span>
5206 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5207
5208
5209 AS boundary router
5210 Routers that originate AS external link advertisements.
5211 These routing table entries are used when calculating the AS
5212 external routes (see <a href="#section-16.4">Section 16.4</a>).
5213
5214 Destination ID
5215 The destination's identifier or name. This depends on the
5216 Destination Type. For networks, the identifier is their
5217 associated IP address. For all other types, the identifier is
5218 the OSPF Router ID.[9]
5219
5220 Address Mask
5221 Only defined for networks. The network's IP address together
5222 with its address mask defines a range of IP addresses. For IP
5223 subnets, the address mask is referred to as the subnet mask.
5224 For host routes, the mask is "all ones" (0xffffffff).
5225
5226 Optional Capabilities
5227 When the destination is a router (either an area border router
5228 or an AS boundary router) this field indicates the optional OSPF
5229 capabilities supported by the destination router. The two
5230 optional capabilities currently defined by this specification
5231 are the ability to route based on IP TOS and the ability to
5232 process AS external link advertisements. For a further
5233 discussion of OSPF's optional capabilities, see <a href="#section-4.5">Section 4.5</a>.
5234
5235
5236 The set of paths to use for a destination may vary based on IP Type
5237 of Service and the OSPF area to which the paths belong. This means
5238 that there may be multiple routing table entries for the same
5239 destination, depending on the values of the next two fields.
5240
5241
5242 Type of Service
5243 There can be a separate set of routes for each IP Type of
5244 Service. The encoding of TOS in OSPF link state advertisements
5245 is described in <a href="#section-12.3">Section 12.3</a>.
5246
5247 Area
5248 This field indicates the area whose link state information has
5249 led to the routing table entry's collection of paths. This is
5250 called the entry's associated area. For sets of AS external
5251 paths, this field is not defined. For destinations of type
5252 "area border router", there may be separate sets of paths (and
5253 therefore separate routing table entries) associated with each
5254 of several areas. This will happen when two area border routers
5255 share multiple areas in common. For all other destination
5256 types, only the set of paths associated with the best area (the
5257
5258
5259
5260 <span class="grey">Moy [Page 94]</span></pre>
5261 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-95" ></span>
5262 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5263
5264
5265 one providing the shortest route) is kept.
5266
5267
5268 The rest of the routing table entry describes the set of paths to
5269 the destination. The following fields pertain to the set of paths
5270 as a whole. In other words, each one of the paths contained in a
5271 routing table entry is of the same path-type and cost (see below).
5272
5273
5274 Path-type
5275 There are four possible types of paths used to route traffic to
5276 the destination, listed here in order of preference: intra-area,
5277 inter-area, type 1 external or type 2 external. Intra-area
5278 paths indicate destinations belonging to one of the router's
5279 attached areas. Inter-area paths are paths to destinations in
5280 other OSPF areas. These are discovered through the examination
5281 of received summary link advertisements. AS external paths are
5282 paths to destinations external to the AS. These are detected
5283 through the examination of received AS external link
5284 advertisements.
5285
5286 Cost
5287 The link state cost of the path to the destination. For all
5288 paths except type 2 external paths this describes the entire
5289 path's cost. For Type 2 external paths, this field describes
5290 the cost of the portion of the path internal to the AS. This
5291 cost is calculated as the sum of the costs of the path's
5292 constituent links.
5293
5294 Type 2 cost
5295 Only valid for type 2 external paths. For these paths, this
5296 field indicates the cost of the path's external portion. This
5297 cost has been advertised by an AS boundary router, and is the
5298 most significant part of the total path cost. For example, a
5299 type 2 external path with type 2 cost of 5 is always preferred
5300 over a path with type 2 cost of 10, regardless of the cost of
5301 the two paths' internal components.
5302
5303 Link State Origin
5304 Valid only for intra-area paths, this field indicates the link
5305 state advertisement (router links or network links) that
5306 directly references the destination. For example, if the
5307 destination is a transit network, this is the transit network's
5308 network links advertisement. If the destination is a stub
5309 network, this is the router links advertisement for the attached
5310 router. The advertisement is discovered during the shortest-
5311 path tree calculation (see <a href="#section-16.1">Section 16.1</a>). Multiple
5312 advertisements may reference the destination, however a tie-
5313
5314
5315
5316 <span class="grey">Moy [Page 95]</span></pre>
5317 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-96" ></span>
5318 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5319
5320
5321 breaking scheme always reduces the choice to a single
5322 advertisement. The Link State Origin field is not used by the
5323 OSPF protocol, but it is used by the routing table calculation
5324 in OSPF's Multicast routing extensions (MOSPF).
5325
5326 When multiple paths of equal path-type and cost exist to a
5327 destination (called elsewhere "equal-cost" paths), they are stored
5328 in a single routing table entry. Each one of the "equal-cost" paths
5329 is distinguished by the following fields:
5330
5331
5332 Next hop
5333 The outgoing router interface to use when forwarding traffic to
5334 the destination. On multi-access networks, the next hop also
5335 includes the IP address of the next router (if any) in the path
5336 towards the destination. This next router will always be one of
5337 the adjacent neighbors.
5338
5339 Advertising router
5340 Valid only for inter-area and AS external paths. This field
5341 indicates the Router ID of the router advertising the summary
5342 link or AS external link that led to this path.
5343
5344
5345 11.1. Routing table lookup
5346
5347 When an IP data packet is received, an OSPF router finds the
5348 routing table entry that best matches the packet's destination.
5349 This routing table entry then provides the outgoing interface
5350 and next hop router to use in forwarding the packet. This
5351 section describes the process of finding the best matching
5352 routing table entry. The process consists of a number of steps,
5353 wherein the collection of routing table entries is progressively
5354 pruned. In the end, the single routing table entry remaining is
5355 the called best match.
5356
5357 Note that the steps described below may fail to produce a best
5358 match routing table entry (i.e., all existing routing table
5359 entries are pruned for some reason or another). In this case,
5360 the packet's IP destination is considered unreachable. Instead
5361 of being forwarded, the packet should be dropped and an ICMP
5362 destination unreachable message should be returned to the
5363 packet's source.
5364
5365
5366 (1) Select the complete set of "matching" routing table entries
5367 from the routing table. Each routing table entry describes
5368 a (set of) path(s) to a range of IP addresses. If the data
5369
5370
5371
5372 <span class="grey">Moy [Page 96]</span></pre>
5373 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-97" ></span>
5374 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5375
5376
5377 packet's IP destination falls into an entry's range of IP
5378 addresses, the routing table entry is called a match. (It is
5379 quite likely that multiple entries will match the data
5380 packet. For example, a default route will match all
5381 packets.)
5382
5383 (2) Suppose that the packet's IP destination falls into one of
5384 the router's configured area address ranges (see <a href="#section-3.5">Section</a>
5385 <a href="#section-3.5">3.5</a>), and that the particular area address range is active.
5386 This means that there are one or more reachable (by intra-
5387 area paths) networks contained in the area address range.
5388 The packet's IP destination is then required to belong to
5389 one of these constituent networks. For this reason, only
5390 matching routing table entries with path-type of intra-area
5391 are considered (all others are pruned). If no such matching
5392 entries exist, the destination is unreachable (see above).
5393 Otherwise, skip to step 4.
5394
5395 (3) Reduce the set of matching entries to those having the most
5396 preferential path-type (see <a href="#section-11">Section 11</a>). OSPF has a four
5397 level hierarchy of paths. Intra-area paths are the most
5398 preferred, followed in order by inter-area, type 1 external
5399 and type 2 external paths.
5400
5401 (4) Select the remaining routing table entry that provides the
5402 longest (most specific) match. Another way of saying this is
5403 to choose the remaining entry that specifies the narrowest
5404 range of IP addresses.[10] For example, the entry for the
5405 address/mask pair of (128.185.1.0, 0xffffff00) is more
5406 specific than an entry for the pair (128.185.0.0,
5407 0xffff0000). The default route is the least specific match,
5408 since it matches all destinations.
5409
5410 (5) At this point, there may still be multiple routing table
5411 entries remaining. Each routing entry will specify the same
5412 range of IP addresses, but a different IP Type of Service.
5413 Select the routing table entry whose TOS value matches the
5414 TOS found in the packet header. If there is no routing table
5415 entry for this TOS, select the routing table entry for TOS
5416 0. In other words, packets requesting TOS X are routed along
5417 the TOS 0 path if a TOS X path does not exist.
5418
5419
5420 11.2. Sample routing table, without areas
5421
5422 Consider the Autonomous System pictured in Figure 2. No OSPF
5423 areas have been configured. A single metric is shown per
5424 outbound interface, indicating that routes will not vary based
5425
5426
5427
5428 <span class="grey">Moy [Page 97]</span></pre>
5429 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-98" ></span>
5430 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5431
5432
5433 on TOS. The calculation of Router RT6's routing table proceeds
5434 as described in <a href="#section-2.1">Section 2.1</a>. The resulting routing table is
5435 shown in Table 12. Destination types are abbreviated: Network
5436 as "N", area border router as "BR" and AS boundary router as
5437 "ASBR".
5438
5439 There are no instances of multiple equal-cost shortest paths in
5440 this example. Also, since there are no areas, there are no
5441 inter-area paths.
5442
5443 Routers RT5 and RT7 are AS boundary routers. Intra-area routes
5444 have been calculated to Routers RT5 and RT7. This allows
5445 external routes to be calculated to the destinations advertised
5446 by RT5 and RT7 (i.e., Networks N12, N13, N14 and N15). It is
5447 assumed all AS external advertisements originated by RT5 and RT7
5448 are advertising type 1 external metrics. This results in type 1
5449 external paths being calculated to destinations N12-N15.
5450
5451
5452
5453 11.3. Sample routing table, with areas
5454
5455 Consider the previous example, this time split into OSPF areas.
5456 An OSPF area configuration is pictured in Figure 6. Router
5457 RT4's routing table will be described for this area
5458 configuration. Router RT4 has a connection to Area 1 and a
5459 backbone connection. This causes Router RT4 to view the AS as
5460 the concatenation of the two graphs shown in Figures 7 and 8.
5461 The resulting routing table is displayed in Table 13.
5462
5463 Again, Routers RT5 and RT7 are AS boundary routers. Routers
5464 RT3, RT4, RT7, RT10 and RT11 are area border routers. Note that
5465 there are two routing table entries (in this case having
5466 identical paths) for Router RT7, in its dual capacities as an
5467 area border router and an AS boundary router. Note also that
5468 there are two routing entries for the area border router RT3,
5469 since it has two areas in common with RT4 (Area 1 and the
5470 backbone).
5471
5472 Backbone paths have been calculated to all area border routers
5473 (BR). These are used when determining the inter-area routes.
5474 Note that all of the inter-area routes are associated with the
5475 backbone; this is always the case when the calculating router is
5476 itself an area border router. Routing information is condensed
5477 at area boundaries. In this example, we assume that Area 3 has
5478 been defined so that networks N9-N11 and the host route to H1
5479 are all condensed to a single route when advertised into the
5480 backbone (by Router RT11). Note that the cost of this route is
5481
5482
5483
5484 <span class="grey">Moy [Page 98]</span></pre>
5485 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-99" ></span>
5486 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5487
5488
5489
5490
5491 Type Dest Area Path Type Cost Next Adv.
5492 Hop(s) Router(s)
5493 ____________________________________________________________
5494 N N1 0 intra-area 10 RT3 *
5495 N N2 0 intra-area 10 RT3 *
5496 N N3 0 intra-area 7 RT3 *
5497 N N4 0 intra-area 8 RT3 *
5498 N Ib 0 intra-area 7 * *
5499 N Ia 0 intra-area 12 RT10 *
5500 N N6 0 intra-area 8 RT10 *
5501 N N7 0 intra-area 12 RT10 *
5502 N N8 0 intra-area 10 RT10 *
5503 N N9 0 intra-area 11 RT10 *
5504 N N10 0 intra-area 13 RT10 *
5505 N N11 0 intra-area 14 RT10 *
5506 N H1 0 intra-area 21 RT10 *
5507 ASBR RT5 0 intra-area 6 RT5 *
5508 ASBR RT7 0 intra-area 8 RT10 *
5509 ____________________________________________________________
5510 N N12 * type 1 ext. 10 RT10 RT7
5511 N N13 * type 1 ext. 14 RT5 RT5
5512 N N14 * type 1 ext. 14 RT5 RT5
5513 N N15 * type 1 ext. 17 RT10 RT7
5514
5515
5516 Table 12: The routing table for Router RT6
5517 (no configured areas).
5518
5519 the minimum of the set of costs to its individual components.
5520
5521 There is a virtual link configured between Routers RT10 and
5522 RT11. Without this configured virtual link, RT11 would be
5523 unable to advertise a route for networks N9-N11 and Host H1 into
5524 the backbone, and there would not be an entry for these networks
5525 in Router RT4's routing table.
5526
5527 In this example there are two equal-cost paths to Network N12.
5528 However, they both use the same next hop (Router RT5).
5529
5530
5531
5532 Router RT4's routing table would improve (i.e., some of the
5533 paths in the routing table would become shorter) if an
5534 additional virtual link were configured between Router RT4 and
5535 Router RT3. The new virtual link would itself be associated
5536 with the first entry for area border router RT3 in Table 13 (an
5537
5538
5539
5540 <span class="grey">Moy [Page 99]</span></pre>
5541 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-100" ></span>
5542 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5543
5544
5545
5546
5547 Type Dest Area Path Type Cost Next Adv.
5548 Hops(s) Router(s)
5549 __________________________________________________________________
5550 N N1 1 intra-area 4 RT1 *
5551 N N2 1 intra-area 4 RT2 *
5552 N N3 1 intra-area 1 * *
5553 N N4 1 intra-area 3 RT3 *
5554 BR RT3 1 intra-area 1 * *
5555 __________________________________________________________________
5556 N Ib 0 intra-area 22 RT5 *
5557 N Ia 0 intra-area 27 RT5 *
5558 BR RT3 0 intra-area 21 RT5 *
5559 BR RT7 0 intra-area 14 RT5 *
5560 BR RT10 0 intra-area 22 RT5 *
5561 BR RT11 0 intra-area 25 RT5 *
5562 ASBR RT5 0 intra-area 8 * *
5563 ASBR RT7 0 intra-area 14 RT5 *
5564 __________________________________________________________________
5565 N N6 0 inter-area 15 RT5 RT7
5566 N N7 0 inter-area 19 RT5 RT7
5567 N N8 0 inter-area 18 RT5 RT7
5568 N N9-N11,H1 0 inter-area 26 RT5 RT11
5569 __________________________________________________________________
5570 N N12 * type 1 ext. 16 RT5 RT5,RT7
5571 N N13 * type 1 ext. 16 RT5 RT5
5572 N N14 * type 1 ext. 16 RT5 RT5
5573 N N15 * type 1 ext. 23 RT5 RT7
5574
5575
5576 Table 13: Router RT4's routing table
5577 in the presence of areas.
5578
5579 intra-area path through Area 1). This would yield a cost of 1
5580 for the virtual link. The routing table entries changes that
5581 would be caused by the addition of this virtual link are shown
5582 in Table 14.
5583
5584
5585
5586 <span class="h2"><a class="selflink" id="section-12" href="#section-12">12</a>. Link State Advertisements</span>
5587
5588 Each router in the Autonomous System originates one or more link
5589 state advertisements. There are five distinct types of link state
5590 advertisements, which are described in <a href="#section-4.3">Section 4.3</a>. The collection
5591 of link state advertisements forms the link state or topological
5592 database. Each separate type of advertisement has a separate
5593
5594
5595
5596 <span class="grey">Moy [Page 100]</span></pre>
5597 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-101" ></span>
5598 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5599
5600
5601
5602
5603 Type Dest Area Path Type Cost Next Adv.
5604 Hop(s) Router(s)
5605 ________________________________________________________________
5606 N Ib 0 intra-area 16 RT3 *
5607 N Ia 0 intra-area 21 RT3 *
5608 BR RT3 0 intra-area 1 * *
5609 BR RT10 0 intra-area 16 RT3 *
5610 BR RT11 0 intra-area 19 RT3 *
5611 ________________________________________________________________
5612 N N9-N11,H1 0 inter-area 20 RT3 RT11
5613
5614
5615 Table 14: Changes resulting from an
5616 additional virtual link.
5617
5618 function. Router links and network links advertisements describe
5619 how an area's routers and networks are interconnected. Summary link
5620 advertisements provide a way of condensing an area's routing
5621 information. AS external advertisements provide a way of
5622 transparently advertising externally-derived routing information
5623 throughout the Autonomous System.
5624
5625 Each link state advertisement begins with a standard 20-byte header.
5626 This link state advertisement header is discussed below.
5627
5628
5629 12.1. The Link State Advertisement Header
5630
5631 The link state advertisement header contains the LS type, Link
5632 State ID and Advertising Router fields. The combination of
5633 these three fields uniquely identifies the link state
5634 advertisement.
5635
5636 There may be several instances of an advertisement present in
5637 the Autonomous System, all at the same time. It must then be
5638 determined which instance is more recent. This determination is
5639 made by examining the LS sequence, LS checksum and LS age
5640 fields. These fields are also contained in the 20-byte link
5641 state advertisement header.
5642
5643 Several of the OSPF packet types list link state advertisements.
5644 When the instance is not important, an advertisement is referred
5645 to by its LS type, Link State ID and Advertising Router (see
5646 Link State Request Packets). Otherwise, the LS sequence number,
5647 LS age and LS checksum fields must also be referenced.
5648
5649
5650
5651
5652 <span class="grey">Moy [Page 101]</span></pre>
5653 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-102" ></span>
5654 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5655
5656
5657 A detailed explanation of the fields contained in the link state
5658 advertisement header follows.
5659
5660
5661 12.1.1. LS age
5662
5663 This field is the age of the link state advertisement in
5664 seconds. It should be processed as an unsigned 16-bit
5665 integer. It is set to 0 when the link state advertisement
5666 is originated. It must be incremented by InfTransDelay on
5667 every hop of the flooding procedure. Link state
5668 advertisements are also aged as they are held in each
5669 router's database.
5670
5671 The age of a link state advertisement is never incremented
5672 past MaxAge. Advertisements having age MaxAge are not used
5673 in the routing table calculation. When an advertisement's
5674 age first reaches MaxAge, it is reflooded. A link state
5675 advertisement of age MaxAge is finally flushed from the
5676 database when it is no longer needed to ensure database
5677 synchronization. For more information on the aging of link
5678 state advertisements, consult <a href="#section-14">Section 14</a>.
5679
5680 The LS age field is examined when a router receives two
5681 instances of a link state advertisement, both having
5682 identical LS sequence numbers and LS checksums. An instance
5683 of age MaxAge is then always accepted as most recent; this
5684 allows old advertisements to be flushed quickly from the
5685 routing domain. Otherwise, if the ages differ by more than
5686 MaxAgeDiff, the instance having the smaller age is accepted
5687 as most recent.[11] See <a href="#section-13.1">Section 13.1</a> for more details.
5688
5689
5690 12.1.2. Options
5691
5692 The Options field in the link state advertisement header
5693 indicates which optional capabilities are associated with
5694 the advertisement. OSPF's optional capabilities are
5695 described in <a href="#section-4.5">Section 4.5</a>. There are currently two optional
5696 capabilities defined; they are represented by the T-bit and
5697 E-bit found in the Options field. The rest of the Options
5698 field should be set to zero.
5699
5700 The E-bit represents OSPF's ExternalRoutingCapability. This
5701 bit should be set in all advertisements associated with the
5702 backbone, and all advertisements associated with non-stub
5703 areas (see <a href="#section-3.6">Section 3.6</a>). It should also be set in all AS
5704 external link advertisements. It should be reset in all
5705
5706
5707
5708 <span class="grey">Moy [Page 102]</span></pre>
5709 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-103" ></span>
5710 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5711
5712
5713 router links, network links and summary link advertisements
5714 associated with a stub area. For all link state
5715 advertisements, the setting of the E-bit is for
5716 informational purposes only; it does not affect the routing
5717 table calculation.
5718
5719 The T-bit represents OSPF's TOS routing capability. This
5720 bit should be set in a router links advertisement if and
5721 only if the router is capable of calculating separate routes
5722 for each IP TOS (see <a href="#section-2.4">Section 2.4</a>). The T-bit should always
5723 be set in network links advertisements. It should be set in
5724 summary link and AS external link advertisements if and only
5725 if the advertisement describes paths for all TOS values,
5726 instead of just the TOS 0 path. Note that, with the T-bit
5727 set, there may still be only a single metric in the
5728 advertisement (the TOS 0 metric). This would mean that
5729 paths for non-zero TOS exist, but are equivalent to the TOS
5730 0 path. A link state advertisement's T-bit is examined when
5731 calculating the routing table's non-zero TOS paths (see
5732 <a href="#section-16.9">Section 16.9</a>).
5733
5734
5735 12.1.3. LS type
5736
5737 The LS type field dictates the format and function of the
5738 link state advertisement. Advertisements of different types
5739 have different names (e.g., router links or network links).
5740 All advertisement types, except the AS external link
5741 advertisements (LS type = 5), are flooded throughout a
5742 single area only. AS external link advertisements are
5743 flooded throughout the entire Autonomous System, excepting
5744 stub areas (see <a href="#section-3.6">Section 3.6</a>). Each separate advertisement
5745 type is briefly described below in Table 15.
5746
5747 12.1.4. Link State ID
5748
5749 This field identifies the piece of the routing domain that
5750 is being described by the advertisement. Depending on the
5751 advertisement's LS type, the Link State ID takes on the
5752 values listed in Table 16.
5753
5754
5755 Actually, for Type 3 summary link (LS type = 3)
5756 advertisements and AS external link (LS type = 5)
5757 advertisements, the Link State ID may additionally have one
5758 or more of the destination network's "host" bits set. For
5759 example, when originating an AS external link for the
5760 network 10.0.0.0 with mask of 255.0.0.0, the Link State ID
5761
5762
5763
5764 <span class="grey">Moy [Page 103]</span></pre>
5765 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-104" ></span>
5766 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5767
5768
5769
5770
5771 LS Type Advertisement description
5772 __________________________________________________
5773 1 These are the router links
5774 advertisements. They describe the
5775 collected states of the router's
5776 interfaces. For more information,
5777 consult <a href="#section-12.4.1">Section 12.4.1</a>.
5778 __________________________________________________
5779 2 These are the network links
5780 advertisements. They describe the set
5781 of routers attached to the network. For
5782 more information, consult
5783 <a href="#section-12.4.2">Section 12.4.2</a>.
5784 __________________________________________________
5785 3 or 4 These are the summary link
5786 advertisements. They describe
5787 inter-area routes, and enable the
5788 condensation of routing information at
5789 area borders. Originated by area border
5790 routers, the Type 3 advertisements
5791 describe routes to networks while the
5792 Type 4 advertisements describe routes to
5793 AS boundary routers.
5794 __________________________________________________
5795 5 These are the AS external link
5796 advertisements. Originated by AS
5797 boundary routers, they describe routes
5798 to destinations external to the
5799 Autonomous System. A default route for
5800 the Autonomous System can also be
5801 described by an AS external link
5802 advertisement.
5803
5804
5805 Table 15: OSPF link state advertisements.
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820 <span class="grey">Moy [Page 104]</span></pre>
5821 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-105" ></span>
5822 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5823
5824
5825 LS Type Link State ID
5826 _______________________________________________
5827 1 The originating router's Router ID.
5828 2 The IP interface address of the
5829 network's Designated Router.
5830 3 The destination network's IP address.
5831 4 The Router ID of the described AS
5832 boundary router.
5833 5 The destination network's IP address.
5834
5835
5836 Table 16: The advertisement's Link State ID.
5837
5838 can be set to anything in the range 10.0.0.0 through
5839 10.255.255.255 inclusive (although 10.0.0.0 should be used
5840 whenever possible). The freedom to set certain host bits
5841 allows a router to originate separate advertisements for two
5842 networks having the same address but different masks. See
5843 <a href="#appendix-F">Appendix F</a> for details.
5844
5845 When the link state advertisement is describing a network
5846 (LS type = 2, 3 or 5), the network's IP address is easily
5847 derived by masking the Link State ID with the network/subnet
5848 mask contained in the body of the link state advertisement.
5849 When the link state advertisement is describing a router (LS
5850 type = 1 or 4), the Link State ID is always the described
5851 router's OSPF Router ID.
5852
5853 When an AS external advertisement (LS Type = 5) is
5854 describing a default route, its Link State ID is set to
5855 DefaultDestination (0.0.0.0).
5856
5857
5858 12.1.5. Advertising Router
5859
5860 This field specifies the OSPF Router ID of the
5861 advertisement's originator. For router links
5862 advertisements, this field is identical to the Link State ID
5863 field. Network link advertisements are originated by the
5864 network's Designated Router. Summary link advertisements
5865 are originated by area border routers. AS external link
5866 advertisements are originated by AS boundary routers.
5867
5868
5869 12.1.6. LS sequence number
5870
5871 The sequence number field is a signed 32-bit integer. It is
5872 used to detect old and duplicate link state advertisements.
5873
5874
5875
5876 <span class="grey">Moy [Page 105]</span></pre>
5877 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-106" ></span>
5878 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5879
5880
5881 The space of sequence numbers is linearly ordered. The
5882 larger the sequence number (when compared as signed 32-bit
5883 integers) the more recent the advertisement. To describe to
5884 sequence number space more precisely, let N refer in the
5885 discussion below to the constant 2**31.
5886
5887 The sequence number -N (0x80000000) is reserved (and
5888 unused). This leaves -N + 1 (0x80000001) as the smallest
5889 (and therefore oldest) sequence number. A router uses this
5890 sequence number the first time it originates any link state
5891 advertisement. Afterwards, the advertisement's sequence
5892 number is incremented each time the router originates a new
5893 instance of the advertisement. When an attempt is made to
5894 increment the sequence number past the maximum value of N -
5895 1 (0x7fffffff), the current instance of the advertisement
5896 must first be flushed from the routing domain. This is done
5897 by prematurely aging the advertisement (see <a href="#section-14.1">Section 14.1</a>)
5898 and reflooding it. As soon as this flood has been
5899 acknowledged by all adjacent neighbors, a new instance can
5900 be originated with sequence number of -N + 1 (0x80000001).
5901
5902 The router may be forced to promote the sequence number of
5903 one of its advertisements when a more recent instance of the
5904 advertisement is unexpectedly received during the flooding
5905 process. This should be a rare event. This may indicate
5906 that an out-of-date advertisement, originated by the router
5907 itself before its last restart/reload, still exists in the
5908 Autonomous System. For more information see <a href="#section-13.4">Section 13.4</a>.
5909
5910
5911 12.1.7. LS checksum
5912
5913 This field is the checksum of the complete contents of the
5914 advertisement, excepting the LS age field. The LS age field
5915 is excepted so that an advertisement's age can be
5916 incremented without updating the checksum. The checksum
5917 used is the same that is used for ISO connectionless
5918 datagrams; it is commonly referred to as the Fletcher
5919 checksum. It is documented in Annex B of [<a href="./rfc905">RFC 905</a>]. The
5920 link state advertisement header also contains the length of
5921 the advertisement in bytes; subtracting the size of the LS
5922 age field (two bytes) yields the amount of data to checksum.
5923
5924 The checksum is used to detect data corruption of an
5925 advertisement. This corruption can occur while an
5926 advertisement is being flooded, or while it is being held in
5927 a router's memory. The LS checksum field cannot take on the
5928 value of zero; the occurrence of such a value should be
5929
5930
5931
5932 <span class="grey">Moy [Page 106]</span></pre>
5933 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-107" ></span>
5934 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5935
5936
5937 considered a checksum failure. In other words, calculation
5938 of the checksum is not optional.
5939
5940 The checksum of a link state advertisement is verified in
5941 two cases: a) when it is received in a Link State Update
5942 Packet and b) at times during the aging of the link state
5943 database. The detection of a checksum failure leads to
5944 separate actions in each case. See Sections <a href="#section-13">13</a> and <a href="#section-14">14</a> for
5945 more details.
5946
5947 Whenever the LS sequence number field indicates that two
5948 instances of an advertisement are the same, the LS checksum
5949 field is examined. If there is a difference, the instance
5950 with the larger LS checksum is considered to be most
5951 recent.[12] See <a href="#section-13.1">Section 13.1</a> for more details.
5952
5953
5954 12.2. The link state database
5955
5956 A router has a separate link state database for every area to
5957 which it belongs. The link state database has been referred to
5958 elsewhere in the text as the topological database. All routers
5959 belonging to the same area have identical topological databases
5960 for the area.
5961
5962 The databases for each individual area are always dealt with
5963 separately. The shortest path calculation is performed
5964 separately for each area (see <a href="#section-16">Section 16</a>). Components of the
5965 area topological database are flooded throughout the area only.
5966 Finally, when an adjacency (belonging to Area A) is being
5967 brought up, only the database for Area A is synchronized between
5968 the two routers.
5969
5970 The area database is composed of router links advertisements,
5971 network links advertisements, and summary link advertisements
5972 (all listed in the area data structure). In addition, external
5973 routes (AS external advertisements) are included in all non-stub
5974 area databases (see <a href="#section-3.6">Section 3.6</a>).
5975
5976 An implementation of OSPF must be able to access individual
5977 pieces of an area database. This lookup function is based on an
5978 advertisement's LS type, Link State ID and Advertising
5979 Router.[13] There will be a single instance (the most up-to-
5980 date) of each link state advertisement in the database. The
5981 database lookup function is invoked during the link state
5982 flooding procedure (<a href="#section-13">Section 13</a>) and the routing table
5983 calculation (<a href="#section-16">Section 16</a>). In addition, using this lookup
5984 function the router can determine whether it has itself ever
5985
5986
5987
5988 <span class="grey">Moy [Page 107]</span></pre>
5989 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-108" ></span>
5990 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
5991
5992
5993 originated a particular link state advertisement, and if so,
5994 with what LS sequence number.
5995
5996 A link state advertisement is added to a router's database when
5997 either a) it is received during the flooding process (<a href="#section-13">Section</a>
5998 <a href="#section-13">13</a>) or b) it is originated by the router itself (<a href="#section-12.4">Section 12.4</a>).
5999 A link state advertisement is deleted from a router's database
6000 when either a) it has been overwritten by a newer instance
6001 during the flooding process (<a href="#section-13">Section 13</a>) or b) the router
6002 originates a newer instance of one of its self-originated
6003 advertisements (<a href="#section-12.4">Section 12.4</a>) or c) the advertisement ages out
6004 and is flushed from the routing domain (<a href="#section-14">Section 14</a>). Whenever a
6005 link state advertisement is deleted from the database it must
6006 also be removed from all neighbors' Link state retransmission
6007 lists (see <a href="#section-10">Section 10</a>).
6008
6009
6010 12.3. Representation of TOS
6011
6012 All OSPF link state advertisements (with the exception of
6013 network links advertisements) specify metrics. In router links
6014 advertisements, the metrics indicate the costs of the described
6015 interfaces. In summary link and AS external link
6016 advertisements, the metric indicates the cost of the described
6017 path. In all of these advertisements, a separate metric can be
6018 specified for each IP TOS. The encoding of TOS in OSPF link
6019 state advertisements is specified in Table 17. That table
6020 relates the OSPF encoding to the IP packet header's TOS field
6021 (defined in [<a href="./rfc1349">RFC 1349</a>]). The OSPF encoding is expressed as a
6022 decimal integer, and the IP packet header's TOS field is
6023 expressed in the binary TOS values used in [<a href="./rfc1349">RFC 1349</a>].
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044 <span class="grey">Moy [Page 108]</span></pre>
6045 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-109" ></span>
6046 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6047
6048
6049
6050 OSPF encoding <a href="./rfc1349">RFC 1349</a> TOS values
6051 ___________________________________________
6052 0 0000 normal service
6053 2 0001 minimize monetary cost
6054 4 0010 maximize reliability
6055 6 0011
6056 8 0100 maximize throughput
6057 10 0101
6058 12 0110
6059 14 0111
6060 16 1000 minimize delay
6061 18 1001
6062 20 1010
6063 22 1011
6064 24 1100
6065 26 1101
6066 28 1110
6067 30 1111
6068
6069
6070 Table 17: Representing TOS in OSPF.
6071
6072
6073 Each OSPF link state advertisement must specify the TOS 0
6074 metric. Other TOS metrics, if they appear, must appear in order
6075 of increasing TOS encoding. For example, the TOS 8 (maximize
6076 throughput) metric must always appear before the TOS 16
6077 (minimize delay) metric when both are specified. If a metric
6078 for some non-zero TOS is not specified, its cost defaults to the
6079 cost for TOS 0, unless the T-bit is reset in the advertisement's
6080 Options field (see <a href="#section-12.1.2">Section 12.1.2</a> for more details).
6081
6082
6083 12.4. Originating link state advertisements
6084
6085 Into any given OSPF area, a router will originate several link
6086 state advertisements. Each router originates a router links
6087 advertisement. If the router is also the Designated Router for
6088 any of the area's networks, it will originate network links
6089 advertisements for those networks.
6090
6091 Area border routers originate a single summary link
6092 advertisement for each known inter-area destination. AS
6093 boundary routers originate a single AS external link
6094 advertisement for each known AS external destination.
6095 Destinations are advertised one at a time so that the change in
6096 any single route can be flooded without reflooding the entire
6097
6098
6099
6100 <span class="grey">Moy [Page 109]</span></pre>
6101 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-110" ></span>
6102 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6103
6104
6105 collection of routes. During the flooding procedure, many link
6106 state advertisements can be carried by a single Link State
6107 Update packet.
6108
6109 As an example, consider Router RT4 in Figure 6. It is an area
6110 border router, having a connection to Area 1 and the backbone.
6111 Router RT4 originates 5 distinct link state advertisements into
6112 the backbone (one router links, and one summary link for each of
6113 the networks N1-N4). Router RT4 will also originate 8 distinct
6114 link state advertisements into Area 1 (one router links and
6115 seven summary link advertisements as pictured in Figure 7). If
6116 RT4 has been selected as Designated Router for Network N3, it
6117 will also originate a network links advertisement for N3 into
6118 Area 1.
6119
6120 In this same figure, Router RT5 will be originating 3 distinct
6121 AS external link advertisements (one for each of the networks
6122 N12-N14). These will be flooded throughout the entire AS,
6123 assuming that none of the areas have been configured as stubs.
6124 However, if area 3 has been configured as a stub area, the
6125 external advertisements for networks N12-N14 will not be flooded
6126 into area 3 (see <a href="#section-3.6">Section 3.6</a>). Instead, Router RT11 would
6127 originate a default summary link advertisement that would be
6128 flooded throughout area 3 (see <a href="#section-12.4.3">Section 12.4.3</a>). This instructs
6129 all of area 3's internal routers to send their AS external
6130 traffic to RT11.
6131
6132 Whenever a new instance of a link state advertisement is
6133 originated, its LS sequence number is incremented, its LS age is
6134 set to 0, its LS checksum is calculated, and the advertisement
6135 is added to the link state database and flooded out the
6136 appropriate interfaces. See <a href="#section-13.2">Section 13.2</a> for details concerning
6137 the installation of the advertisement into the link state
6138 database. See <a href="#section-13.3">Section 13.3</a> for details concerning the flooding
6139 of newly originated advertisements.
6140
6141
6142 The ten events that can cause a new instance of a link state
6143 advertisement to be originated are:
6144
6145
6146 (1) The LS age field of one of the router's self-originated
6147 advertisements reaches the value LSRefreshTime. In this
6148 case, a new instance of the link state advertisement is
6149 originated, even though the contents of the advertisement
6150 (apart from the link state advertisement header) will be the
6151 same. This guarantees periodic originations of all link
6152 state advertisements. This periodic updating of link state
6153
6154
6155
6156 <span class="grey">Moy [Page 110]</span></pre>
6157 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-111" ></span>
6158 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6159
6160
6161 advertisements adds robustness to the link state algorithm.
6162 Link state advertisements that solely describe unreachable
6163 destinations should not be refreshed, but should instead be
6164 flushed from the routing domain (see <a href="#section-14.1">Section 14.1</a>).
6165
6166
6167 When whatever is being described by a link state advertisement
6168 changes, a new advertisement is originated. However, two
6169 instances of the same link state advertisement may not be
6170 originated within the time period MinLSInterval. This may
6171 require that the generation of the next instance be delayed by
6172 up to MinLSInterval. The following events may cause the
6173 contents of a link state advertisement to change. These events
6174 should cause new originations if and only if the contents of the
6175 new advertisement would be different:
6176
6177
6178 (2) An interface's state changes (see <a href="#section-9.1">Section 9.1</a>). This may
6179 mean that it is necessary to produce a new instance of the
6180 router links advertisement.
6181
6182 (3) An attached network's Designated Router changes. A new
6183 router links advertisement should be originated. Also, if
6184 the router itself is now the Designated Router, a new
6185 network links advertisement should be produced. If the
6186 router itself is no longer the Designated Router, any
6187 network links advertisement that it might have originated
6188 for the network should be flushed from the routing domain
6189 (see <a href="#section-14.1">Section 14.1</a>).
6190
6191 (4) One of the neighboring routers changes to/from the FULL
6192 state. This may mean that it is necessary to produce a new
6193 instance of the router links advertisement. Also, if the
6194 router is itself the Designated Router for the attached
6195 network, a new network links advertisement should be
6196 produced.
6197
6198
6199 The next four events concern area border routers only:
6200
6201
6202 (5) An intra-area route has been added/deleted/modified in the
6203 routing table. This may cause a new instance of a summary
6204 links advertisement (for this route) to be originated in
6205 each attached area (possibly including the backbone).
6206
6207 (6) An inter-area route has been added/deleted/modified in the
6208 routing table. This may cause a new instance of a summary
6209
6210
6211
6212 <span class="grey">Moy [Page 111]</span></pre>
6213 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-112" ></span>
6214 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6215
6216
6217 links advertisement (for this route) to be originated in
6218 each attached area (but NEVER for the backbone).
6219
6220 (7) The router becomes newly attached to an area. The router
6221 must then originate summary link advertisements into the
6222 newly attached area for all pertinent intra-area and inter-
6223 area routes in the router's routing table. See <a href="#section-12.4.3">Section</a>
6224 <a href="#section-12.4.3">12.4.3</a> for more details.
6225
6226 (8) When the state of one of the router's configured virtual
6227 links changes, it may be necessary to originate a new router
6228 links advertisement into the virtual link's transit area
6229 (see the discussion of the router links advertisement's bit
6230 V in <a href="#section-12.4.1">Section 12.4.1</a>), as well as originating a new router
6231 links advertisement into the backbone.
6232
6233
6234 The last two events concern AS boundary routers (and former AS
6235 boundary routers) only:
6236
6237
6238 (9) An external route gained through direct experience with an
6239 external routing protocol (like EGP) changes. This will
6240 cause an AS boundary router to originate a new instance of
6241 an AS external link advertisement.
6242
6243 (10)
6244 A router ceases to be an AS boundary router, perhaps after
6245 restarting. In this situation the router should flush all AS
6246 external link advertisements that it had previously
6247 originated. These advertisements can be flushed via the
6248 premature aging procedure specified in <a href="#section-14.1">Section 14.1</a>.
6249
6250
6251 The construction of each type of link state advertisement is
6252 explained in detail below. In general, these sections describe
6253 the contents of the advertisement body (i.e., the part coming
6254 after the 20-byte advertisement header). For information
6255 concerning the building of the link state advertisement header,
6256 see <a href="#section-12.1">Section 12.1</a>.
6257
6258 12.4.1. Router links
6259
6260 A router originates a router links advertisement for each
6261 area that it belongs to. Such an advertisement describes
6262 the collected states of the router's links to the area. The
6263 advertisement is flooded throughout the particular area, and
6264 no further.
6265
6266
6267
6268 <span class="grey">Moy [Page 112]</span></pre>
6269 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-113" ></span>
6270 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6271
6272
6273
6274 ....................................
6275 . 192.1.2 Area 1 .
6276 . + .
6277 . | .
6278 . | 3+---+1 .
6279 . N1 |--|RT1|-----+ .
6280 . | +---+ .
6281 . | _______N3 .
6282 . + / . 1+---+
6283 . * 192.1.1 *------|RT4|
6284 . + /_______/ . +---+
6285 . | / | .
6286 . | 3+---+1 / | .
6287 . N2 |--|RT2|-----+ 1| .
6288 . | +---+ +---+8 . 6+---+
6289 . | |RT3|----------------|RT6|
6290 . + +---+ . +---+
6291 . 192.1.3 |2 . 18.10.0.6|7
6292 . | . |
6293 . +------------+ .
6294 . 192.1.4 (N4) .
6295 ....................................
6296
6297
6298 Figure 15: Area 1 with IP addresses shown
6299
6300 The format of a router links advertisement is shown in
6301 <a href="#appendix-A">Appendix A</a> (Section A.4.2). The first 20 bytes of the
6302 advertisement consist of the generic link state
6303 advertisement header that was discussed in <a href="#section-12.1">Section 12.1</a>.
6304 Router links advertisements have LS type = 1. The router
6305 indicates whether it is willing to calculate separate routes
6306 for each IP TOS by setting (or resetting) the T-bit of the
6307 link state advertisement's Options field.
6308
6309 A router also indicates whether it is an area border router,
6310 or an AS boundary router, by setting the appropriate bits
6311 (bit B and bit E, respectively) in its router links
6312 advertisements. This enables paths to those types of routers
6313 to be saved in the routing table, for later processing of
6314 summary link advertisements and AS external link
6315 advertisements. Bit B should be set whenever the router is
6316 actively attached to two or more areas, even if the router
6317 is not currently attached to the OSPF backbone area. Bit E
6318 should never be set in a router links advertisement for a
6319 stub area (stub areas cannot contain AS boundary routers).
6320 In addition, the router sets bit V in its router links
6321
6322
6323
6324 <span class="grey">Moy [Page 113]</span></pre>
6325 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-114" ></span>
6326 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6327
6328
6329 advertisement for Area A if and only if it is the endpoint
6330 of an active virtual link using Area A as its Transit area.
6331 This enables the other routers attached to Area A to
6332 discover whether the area supports any virtual links (i.e.,
6333 is a transit area).
6334
6335 The router links advertisement then describes the router's
6336 working connections (i.e., interfaces or links) to the area.
6337 Each link is typed according to the kind of attached
6338 network. Each link is also labelled with its Link ID. This
6339 Link ID gives a name to the entity that is on the other end
6340 of the link. Table 18 summarizes the values used for the
6341 Type and Link ID fields.
6342
6343
6344
6345 Link type Description Link ID
6346 __________________________________________________
6347 1 Point-to-point Neighbor Router ID
6348 link
6349 2 Link to transit Interface address of
6350 network Designated Router
6351 3 Link to stub IP network number
6352 network
6353 4 Virtual link Neighbor Router ID
6354
6355
6356 Table 18: Link descriptions in the
6357 router links advertisement.
6358
6359
6360 In addition, the Link Data field is specified for each link.
6361 This field gives 32 bits of extra information for the link.
6362 For links to transit networks, numbered links to routers and
6363 virtual links, this field specifies the IP interface address
6364 of the associated router interface (this is needed by the
6365 routing table calculation, see <a href="#section-16.1.1">Section 16.1.1</a>). For links
6366 to stub networks, this field specifies the network's IP
6367 address mask. For unnumbered point-to-point networks, the
6368 Link Data field should be set to the unnumbered interface's
6369 MIB-II [<a href="./rfc1213">RFC 1213</a>] ifIndex value.
6370
6371 Finally, the cost of using the link for output (possibly
6372 specifying a different cost for each Type of Service) is
6373 specified. The output cost of a link is configurable. It
6374 must always be non-zero.
6375
6376 To further describe the process of building the list of link
6377
6378
6379
6380 <span class="grey">Moy [Page 114]</span></pre>
6381 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-115" ></span>
6382 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6383
6384
6385 descriptions, suppose a router wishes to build a router
6386 links advertisement for Area A. The router examines its
6387 collection of interface data structures. For each
6388 interface, the following steps are taken:
6389
6390
6391 o If the attached network does not belong to Area A, no
6392 links are added to the advertisement, and the next
6393 interface should be examined.
6394
6395 o Else, if the state of the interface is Down, no links
6396 are added.
6397
6398 o Else, if the state of the interface is Point-to-Point,
6399 then add links according to the following:
6400
6401 - If the neighboring router is fully adjacent, add a
6402 Type 1 link (point-to-point) if this is an interface
6403 to a point-to-point network, or add a Type 4 link
6404 (virtual link) if this is a virtual link. The Link
6405 ID should be set to the Router ID of the neighboring
6406 router. For virtual links and numbered point-to-
6407 point networks, the Link Data should specify the IP
6408 interface address. For unnumbered point-to-point
6409 networks, the Link Data field should specify the
6410 interface's MIB-II [<a href="./rfc1213">RFC 1213</a>] ifIndex value.
6411
6412 - If this is a numbered point-to-point network (i.e,
6413 not a virtual link and not an unnumbered point-to-
6414 point network) and the neighboring router's IP
6415 address is known, add a Type 3 link (stub network)
6416 whose Link ID is the neighbor's IP address, whose
6417 Link Data is the mask 0xffffffff indicating a host
6418 route, and whose cost is the interface's configured
6419 output cost.
6420
6421 o Else if the state of the interface is Loopback, add a
6422 Type 3 link (stub network) as long as this is not an
6423 interface to an unnumbered serial line. The Link ID
6424 should be set to the IP interface address, the Link Data
6425 set to the mask 0xffffffff (indicating a host route),
6426 and the cost set to 0.
6427
6428 o Else if the state of the interface is Waiting, add a
6429 Type 3 link (stub network) whose Link ID is the IP
6430 network number of the attached network and whose Link
6431 Data is the attached network's address mask.
6432
6433
6434
6435
6436 <span class="grey">Moy [Page 115]</span></pre>
6437 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-116" ></span>
6438 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6439
6440
6441 o Else, there has been a Designated Router selected for
6442 the attached network. If the router is fully adjacent
6443 to the Designated Router, or if the router itself is
6444 Designated Router and is fully adjacent to at least one
6445 other router, add a single Type 2 link (transit network)
6446 whose Link ID is the IP interface address of the
6447 attached network's Designated Router (which may be the
6448 router itself) and whose Link Data is the router's own
6449 IP interface address. Otherwise, add a link as if the
6450 interface state were Waiting (see above).
6451
6452
6453 Unless otherwise specified, the cost of each link generated
6454 by the above procedure is equal to the output cost of the
6455 associated interface. Note that in the case of serial
6456 lines, multiple links may be generated by a single
6457 interface.
6458
6459 After consideration of all the router interfaces, host links
6460 are added to the advertisement by examining the list of
6461 attached hosts. A host route is represented as a Type 3
6462 link (stub network) whose Link ID is the host's IP address
6463 and whose Link Data is the mask of all ones (0xffffffff).
6464
6465 As an example, consider the router links advertisements
6466 generated by Router RT3, as pictured in Figure 6. The area
6467 containing Router RT3 (Area 1) has been redrawn, with actual
6468 network addresses, in Figure 15. Assume that the last byte
6469 of all of RT3's interface addresses is 3, giving it the
6470 interface addresses 192.1.1.3 and 192.1.4.3, and that the
6471 other routers have similar addressing schemes. In addition,
6472 assume that all links are functional, and that Router IDs
6473 are assigned as the smallest IP interface address.
6474
6475 RT3 originates two router links advertisements, one for Area
6476 1 and one for the backbone. Assume that Router RT4 has been
6477 selected as the Designated router for network 192.1.1.0.
6478 RT3's router links advertisement for Area 1 is then shown
6479 below. It indicates that RT3 has two connections to Area 1,
6480 the first a link to the transit network 192.1.1.0 and the
6481 second a link to the stub network 192.1.4.0. Note that the
6482 transit network is identified by the IP interface of its
6483 Designated Router (i.e., the Link ID = 192.1.1.4 which is
6484 the Designated Router RT4's IP interface to 192.1.1.0).
6485 Note also that RT3 has indicated that it is capable of
6486 calculating separate routes based on IP TOS, through setting
6487 the T-bit in the Options field. It has also indicated that
6488 it is an area border router.
6489
6490
6491
6492 <span class="grey">Moy [Page 116]</span></pre>
6493 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-117" ></span>
6494 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6495
6496
6497 ; RT3's router links advertisement for Area 1
6498
6499 LS age = 0 ;always true on origination
6500 Options = (T-bit|E-bit) ;TOS-capable
6501 LS type = 1 ;indicates router links
6502 Link State ID = 192.1.1.3 ;RT3's Router ID
6503 Advertising Router = 192.1.1.3 ;RT3's Router ID
6504 bit E = 0 ;not an AS boundary router
6505 bit B = 1 ;area border router
6506 #links = 2
6507 Link ID = 192.1.1.4 ;IP address of Desig. Rtr.
6508 Link Data = 192.1.1.3 ;RT3's IP interface to net
6509 Type = 2 ;connects to transit network
6510 # other metrics = 0
6511 TOS 0 metric = 1
6512
6513 Link ID = 192.1.4.0 ;IP Network number
6514 Link Data = 0xffffff00 ;Network mask
6515 Type = 3 ;connects to stub network
6516 # other metrics = 0
6517 TOS 0 metric = 2
6518
6519 Next RT3's router links advertisement for the backbone is
6520 shown. It indicates that RT3 has a single attachment to the
6521 backbone. This attachment is via an unnumbered point-to-
6522 point link to Router RT6. RT3 has again indicated that it
6523 is TOS-capable, and that it is an area border router.
6524
6525 ; RT3's router links advertisement for the backbone
6526
6527 LS age = 0 ;always true on origination
6528 Options = (T-bit|E-bit) ;TOS-capable
6529 LS type = 1 ;indicates router links
6530 Link State ID = 192.1.1.3 ;RT3's router ID
6531 Advertising Router = 192.1.1.3 ;RT3's router ID
6532 bit E = 0 ;not an AS boundary router
6533 bit B = 1 ;area border router
6534 #links = 1
6535 Link ID = 18.10.0.6 ;Neighbor's Router ID
6536 Link Data = 0.0.0.3 ;MIB-II ifIndex of P-P link
6537 Type = 1 ;connects to router
6538 # other metrics = 0
6539 TOS 0 metric = 8
6540
6541 Even though Router RT3 has indicated that it is TOS-capable
6542 in the above examples, only a single metric (the TOS 0
6543 metric) has been specified for each interface. Different
6544 metrics can be specified for each TOS. The encoding of TOS
6545
6546
6547
6548 <span class="grey">Moy [Page 117]</span></pre>
6549 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-118" ></span>
6550 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6551
6552
6553 in OSPF link state advertisements is described in <a href="#section-12.3">Section</a>
6554 <a href="#section-12.3">12.3</a>.
6555
6556 As an example, suppose the point-to-point link between
6557 Routers RT3 and RT6 in Figure 15 is a satellite link. The
6558 AS administrator may want to encourage the use of the line
6559 for high bandwidth traffic. This would be done by setting
6560 the metric artificially low for the appropriate TOS value.
6561 Router RT3 would then originate the following router links
6562 advertisement for the backbone (TOS 8 = maximize
6563 throughput):
6564
6565 ; RT3's router links advertisement for the backbone
6566
6567 LS age = 0 ;always true on origination
6568 Options = (T-bit|E-bit) ;TOS-capable
6569 LS type = 1 ;indicates router links
6570 Link State ID = 192.1.1.3 ;RT3's Router ID
6571 Advertising Router = 192.1.1.3
6572 bit E = 0 ;not an AS boundary router
6573 bit B = 1 ;area border router
6574 #links = 1
6575 Link ID = 18.10.0.6 ;Neighbor's Router ID
6576 Link Data = 0.0.0.3 ;MIB-II ifIndex of P-P link
6577 Type = 1 ;connects to router
6578 # other metrics = 1
6579 TOS 0 metric = 8
6580 TOS = 8 ;maximize throughput
6581 metric = 1 ;traffic preferred
6582
6583
6584 12.4.2. Network links
6585
6586 A network links advertisement is generated for every transit
6587 multi-access network. (A transit network is a network
6588 having two or more attached routers). The network links
6589 advertisement describes all the routers that are attached to
6590 the network.
6591
6592 The Designated Router for the network originates the
6593 advertisement. The Designated Router originates the
6594 advertisement only if it is fully adjacent to at least one
6595 other router on the network. The network links
6596 advertisement is flooded throughout the area that contains
6597 the transit network, and no further. The networks links
6598 advertisement lists those routers that are fully adjacent to
6599 the Designated Router; each fully adjacent router is
6600 identified by its OSPF Router ID. The Designated Router
6601
6602
6603
6604 <span class="grey">Moy [Page 118]</span></pre>
6605 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-119" ></span>
6606 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6607
6608
6609 includes itself in this list.
6610
6611 The Link State ID for a network links advertisement is the
6612 IP interface address of the Designated Router. This value,
6613 masked by the network's address mask (which is also
6614 contained in the network links advertisement) yields the
6615 network's IP address.
6616
6617 A router that has formerly been the Designated Router for a
6618 network, but is no longer, should flush the network links
6619 advertisement that it had previously originated. This
6620 advertisement is no longer used in the routing table
6621 calculation. It is flushed by prematurely incrementing the
6622 advertisement's age to MaxAge and reflooding (see <a href="#section-14.1">Section</a>
6623 <a href="#section-14.1">14.1</a>). In addition, in those rare cases where a router's
6624 Router ID has changed, any network links advertisements that
6625 were originated with the router's previous Router ID must be
6626 flushed. Since the router may have no idea what it's
6627 previous Router ID might have been, these network links
6628 advertisements are indicated by having their Link State ID
6629 equal to one of the router's IP interface addresses and
6630 their Advertising Router not equal to the router's current
6631 Router ID (see <a href="#section-13.4">Section 13.4</a> for more details).
6632
6633 As an example of a network links advertisement, again
6634 consider the area configuration in Figure 6. Network links
6635 advertisements are originated for Network N3 in Area 1,
6636 Networks N6 and N8 in Area 2, and Network N9 in Area 3.
6637 Assuming that Router RT4 has been selected as the Designated
6638 Router for Network N3, the following network links
6639 advertisement is generated by RT4 on behalf of Network N3
6640 (see Figure 15 for the address assignments):
6641
6642 ; network links advertisement for Network N3
6643
6644 LS age = 0 ;always true on origination
6645 Options = (T-bit|E-bit) ;TOS-capable
6646 LS type = 2 ;indicates network links
6647 Link State ID = 192.1.1.4 ;IP address of Desig. Rtr.
6648 Advertising Router = 192.1.1.4 ;RT4's Router ID
6649 Network Mask = 0xffffff00
6650 Attached Router = 192.1.1.4 ;Router ID
6651 Attached Router = 192.1.1.1 ;Router ID
6652 Attached Router = 192.1.1.2 ;Router ID
6653 Attached Router = 192.1.1.3 ;Router ID
6654
6655
6656
6657
6658
6659
6660 <span class="grey">Moy [Page 119]</span></pre>
6661 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-120" ></span>
6662 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6663
6664
6665 12.4.3. Summary links
6666
6667 Each summary link advertisement describes a route to a
6668 single destination. Summary link advertisements are flooded
6669 throughout a single area only. The destination described is
6670 one that is external to the area, yet still belonging to the
6671 Autonomous System.
6672
6673 Summary link advertisements are originated by area border
6674 routers. The precise summary routes to advertise into an
6675 area are determined by examining the routing table structure
6676 (see <a href="#section-11">Section 11</a>) in accordance with the algorithm described
6677 below. Note that only intra-area routes are advertised into
6678 the backbone, while both intra-area and inter-area routes
6679 are advertised into the other areas.
6680
6681 To determine which routes to advertise into an attached Area
6682 A, each routing table entry is processed as follows.
6683 Remember that each routing table entry describes a set of
6684 equal-cost best paths to a particular destination:
6685
6686
6687 o Only Destination Types of network and AS boundary router
6688 are advertised in summary link advertisements. If the
6689 routing table entry's Destination Type is area border
6690 router, examine the next routing table entry.
6691
6692 o AS external routes are never advertised in summary link
6693 advertisements. If the routing table entry has Path-
6694 type of type 1 external or type 2 external, examine the
6695 next routing table entry.
6696
6697 o Else, if the area associated with this set of paths is
6698 the Area A itself, do not generate a summary link
6699 advertisement for the route.[14]
6700
6701 o Else, if the next hops associated with this set of paths
6702 belong to Area A itself, do not generate a summary link
6703 advertisement for the route.[15] This is the logical
6704 equivalent of a Distance Vector protocol's split horizon
6705 logic.
6706
6707 o Else, if the routing table cost equals or exceeds the
6708 value LSInfinity, a summary link advertisement cannot be
6709 generated for this route.
6710
6711 o Else, if the destination of this route is an AS boundary
6712 router, generate a Type 4 link state advertisement for
6713
6714
6715
6716 <span class="grey">Moy [Page 120]</span></pre>
6717 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-121" ></span>
6718 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6719
6720
6721 the destination, with Link State ID equal to the AS
6722 boundary router's Router ID and metric equal to the
6723 routing table entry's cost. These advertisements should
6724 not be generated if Area A has been configured as a stub
6725 area.
6726
6727 o Else, the Destination type is network. If this is an
6728 inter-area route, generate a Type 3 advertisement for
6729 the destination, with Link State ID equal to the
6730 network's address (if necessary, the Link State ID can
6731 also have one or more of the network's host bits set;
6732 see <a href="#appendix-F">Appendix F</a> for details) and metric equal to the
6733 routing table cost.
6734
6735 o The one remaining case is an intra-area route to a
6736 network. This means that the network is contained in
6737 one of the router's directly attached areas. In
6738 general, this information must be condensed before
6739 appearing in summary link advertisements. Remember that
6740 an area has been defined as a list of address ranges,
6741 each range consisting of an [address,mask] pair and a
6742 status indication of either Advertise or DoNotAdvertise.
6743 At most a single Type 3 advertisement is made for each
6744 range. When the range's status indicates Advertise, a
6745 Type 3 advertisement is generated with Link State ID
6746 equal to the range's address (if necessary, the Link
6747 State ID can also have one or more of the range's "host"
6748 bits set; see <a href="#appendix-F">Appendix F</a> for details) and cost equal to
6749 the smallest cost of any of the component networks. When
6750 the range's status indicates DoNotAdvertise, the Type 3
6751 advertisement is suppressed and the component networks
6752 remain hidden from other areas.
6753
6754 By default, if a network is not contained in any
6755 explicitly configured address range, a Type 3
6756 advertisement is generated with Link State ID equal to
6757 the network's address (if necessary, the Link State ID
6758 can also have one or more of the network's "host" bits
6759 set; see <a href="#appendix-F">Appendix F</a> for details) and metric equal to the
6760 network's routing table cost.
6761
6762 If virtual links are being used to provide/increase
6763 connectivity of the backbone, routing information
6764 concerning the backbone networks should not be condensed
6765 before being summarized into the virtual links' Transit
6766 areas. Nor should the advertisement of backbone networks
6767 into Transit areas be suppressed. In other words, the
6768 backbone's configured ranges should be ignored when
6769
6770
6771
6772 <span class="grey">Moy [Page 121]</span></pre>
6773 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-122" ></span>
6774 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6775
6776
6777 originating summary links into Transit areas. The
6778 existence of virtual links is determined during the
6779 shortest path calculation for the Transit areas (see
6780 <a href="#section-16.1">Section 16.1</a>).
6781
6782 If a router advertises a summary advertisement for a
6783 destination which then becomes unreachable, the router must
6784 then flush the advertisement from the routing domain by
6785 setting its age to MaxAge and reflooding (see <a href="#section-14.1">Section 14.1</a>).
6786 Also, if the destination is still reachable, yet can no
6787 longer be advertised according to the above procedure (e.g.,
6788 it is now an inter-area route, when it used to be an intra-
6789 area route associated with some non-backbone area; it would
6790 thus no longer be advertisable to the backbone), the
6791 advertisement should also be flushed from the routing
6792 domain.
6793
6794 For an example of summary link advertisements, consider
6795 again the area configuration in Figure 6. Routers RT3, RT4,
6796 RT7, RT10 and RT11 are all area border routers, and
6797 therefore are originating summary link advertisements.
6798 Consider in particular Router RT4. Its routing table was
6799 calculated as the example in <a href="#section-11.3">Section 11.3</a>. RT4 originates
6800 summary link advertisements into both the backbone and Area
6801 1. Into the backbone, Router RT4 originates separate
6802 advertisements for each of the networks N1-N4. Into Area 1,
6803 Router RT4 originates separate advertisements for networks
6804 N6-N8 and the AS boundary routers RT5,RT7. It also
6805 condenses host routes Ia and Ib into a single summary link
6806 advertisement. Finally, the routes to networks N9,N10,N11
6807 and Host H1 are advertised by a single summary link
6808 advertisement. This condensation was originally performed
6809 by the router RT11.
6810
6811 These advertisements are illustrated graphically in Figures
6812 7 and 8. Two of the summary link advertisements originated
6813 by Router RT4 follow. The actual IP addresses for the
6814 networks and routers in question have been assigned in
6815 Figure 15.
6816
6817 ; summary link advertisement for Network N1,
6818 ; originated by Router RT4 into the backbone
6819
6820 LS age = 0 ;always true on origination
6821 Options = (T-bit|E-bit) ;TOS-capable
6822 LS type = 3 ;summary link to IP net
6823 Link State ID = 192.1.2.0 ;N1's IP network number
6824 Advertising Router = 192.1.1.4 ;RT4's ID
6825
6826
6827
6828 <span class="grey">Moy [Page 122]</span></pre>
6829 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-123" ></span>
6830 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6831
6832
6833 TOS = 0
6834 metric = 4
6835
6836 ; summary link advertisement for AS boundary router RT7
6837 ; originated by Router RT4 into Area 1
6838
6839 LS age = 0 ;always true on origination
6840 Options = (T-bit|E-bit) ;TOS-capable
6841 LS type = 4 ;summary link to ASBR
6842 Link State ID = Router RT7's ID
6843 Advertising Router = 192.1.1.4 ;RT4's ID
6844 TOS = 0
6845 metric = 14
6846
6847 Summary link advertisements pertain to a single destination
6848 (IP network or AS boundary router). However, for a single
6849 destination there may be separate sets of paths, and
6850 therefore separate routing table entries, for each Type of
6851 Service. All these entries must be considered when building
6852 the summary link advertisement for the destination; a single
6853 advertisement must specify the separate costs (if they
6854 exist) for each TOS. The encoding of TOS in OSPF link state
6855 advertisements is described in <a href="#section-12.3">Section 12.3</a>.
6856
6857 Clearing the T-bit in the Options field of a summary link
6858 advertisement indicates that there is a TOS 0 path to the
6859 destination, but no paths for non-zero TOS. This can happen
6860 when non-TOS-capable routers exist in the routing domain
6861 (see <a href="#section-2.4">Section 2.4</a>).
6862
6863 12.4.4. Originating summary links into stub areas
6864
6865 The algorithm in <a href="#section-12.4.3">Section 12.4.3</a> is optional when Area A is
6866 an OSPF stub area. Area border routers connecting to a stub
6867 area can originate summary link advertisements into the area
6868 according to the above Section's algorithm, or can choose to
6869 originate only a subset of the advertisements, possibly
6870 under configuration control. The fewer advertisements
6871 originated, the smaller the stub area's link state database,
6872 further reducing the demands on its routers' resources.
6873 However, omitting advertisements may also lead to sub-
6874 optimal inter-area routing, although routing will continue
6875 to function.
6876
6877 As specified in <a href="#section-12.4.3">Section 12.4.3</a>, Type 4 link state
6878 advertisements (ASBR summary links) are never originated
6879 into stub areas.
6880
6881
6882
6883
6884 <span class="grey">Moy [Page 123]</span></pre>
6885 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-124" ></span>
6886 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6887
6888
6889 In a stub area, instead of importing external routes each
6890 area border router originates a "default summary link" into
6891 the area. The Link State ID for the default summary link is
6892 set to DefaultDestination, and the metric set to the (per-
6893 area) configurable parameter StubDefaultCost. Note that
6894 StubDefaultCost need not be configured identically in all of
6895 the stub area's area border routers.
6896
6897 12.4.5. AS external links
6898
6899 AS external link advertisements describe routes to
6900 destinations external to the Autonomous System. Most AS
6901 external link advertisements describe routes to specific
6902 external destinations; in these cases the advertisement's
6903 Link State ID is set to the destination network's IP address
6904 (if necessary, the Link State ID can also have one or more
6905 of the network's "host" bits set; see <a href="#appendix-F">Appendix F</a> for
6906 details). However, a default route for the Autonomous
6907 System can be described in an AS external link advertisement
6908 by setting the advertisement's Link State ID to
6909 DefaultDestination (0.0.0.0). AS external link
6910 advertisements are originated by AS boundary routers. An AS
6911 boundary router originates a single AS external link
6912 advertisement for each external route that it has learned,
6913 either through another routing protocol (such as EGP), or
6914 through configuration information.
6915
6916 In general, AS external link advertisements are the only
6917 type of link state advertisements that are flooded
6918 throughout the entire Autonomous System; all other types of
6919 link state advertisements are specific to a single area.
6920 However, AS external link advertisements are not flooded
6921 into/throughout stub areas (see <a href="#section-3.6">Section 3.6</a>). This enables
6922 a reduction in link state database size for routers internal
6923 to stub areas.
6924
6925 The metric that is advertised for an external route can be
6926 one of two types. Type 1 metrics are comparable to the link
6927 state metric. Type 2 metrics are assumed to be larger than
6928 the cost of any intra-AS path. As with summary link
6929 advertisements, if separate paths exist based on TOS,
6930 separate TOS costs can be included in the AS external link
6931 advertisement. The encoding of TOS in OSPF link state
6932 advertisements is described in <a href="#section-12.3">Section 12.3</a>. If the T-bit
6933 of the advertisement's Options field is clear, no non-zero
6934 TOS paths to the destination exist.
6935
6936 If a router advertises an AS external link advertisement for
6937
6938
6939
6940 <span class="grey">Moy [Page 124]</span></pre>
6941 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-125" ></span>
6942 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6943
6944
6945 a destination which then becomes unreachable, the router
6946 must then flush the advertisement from the routing domain by
6947 setting its age to MaxAge and reflooding (see <a href="#section-14.1">Section 14.1</a>).
6948
6949 For an example of AS external link advertisements, consider
6950 once again the AS pictured in Figure 6. There are two AS
6951 boundary routers: RT5 and RT7. Router RT5 originates three
6952 external link advertisements, for networks N12-N14. Router
6953 RT7 originates two external link advertisements, for
6954 networks N12 and N15. Assume that RT7 has learned its route
6955 to N12 via EGP, and that it wishes to advertise a Type 2
6956 metric to the AS. RT7 would then originate the following
6957 advertisement for N12:
6958
6959 ; AS external link advertisement for Network N12,
6960 ; originated by Router RT7
6961
6962 LS age = 0 ;always true on origination
6963 Options = (T-bit|E-bit) ;TOS-capable
6964 LS type = 5 ;indicates AS external link
6965 Link State ID = N12's IP network number
6966 Advertising Router = Router RT7's ID
6967 bit E = 1 ;Type 2 metric
6968 TOS = 0
6969 metric = 2
6970 Forwarding address = 0.0.0.0
6971
6972 In the above example, the forwarding address field has been
6973 set to 0.0.0.0, indicating that packets for the external
6974 destination should be forwarded to the advertising OSPF
6975 router (RT7). This is not always desirable. Consider the
6976 example pictured in Figure 16. There are three OSPF routers
6977 (RTA, RTB and RTC) connected to a common network. Only one
6978 of these routers, RTA, is exchanging EGP information with
6979 the non-OSPF router RTX. RTA must then originate AS
6980 external link advertisements for those destinations it has
6981 learned from RTX. By using the AS external link
6982 advertisement's forwarding address field, RTA can specify
6983 that packets for these destinations be forwarded directly to
6984 RTX. Without this feature, Routers RTB and RTC would take
6985 an extra hop to get to these destinations.
6986
6987 Note that when the forwarding address field is non-zero, it
6988 should point to a router belonging to another Autonomous
6989 System.
6990
6991 A forwarding address can also be specified for the default
6992 route. For example, in figure 16 RTA may want to specify
6993
6994
6995
6996 <span class="grey">Moy [Page 125]</span></pre>
6997 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-126" ></span>
6998 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
6999
7000
7001 that all externally-destined packets should by default be
7002 forwarded to its EGP peer RTX. The resulting AS external
7003 link advertisement is pictured below. Note that the Link
7004 State ID is set to DefaultDestination.
7005
7006 ; Default route, originated by Router RTA
7007 ; Packets forwarded through RTX
7008
7009 LS age = 0 ;always true on origination
7010 Options = (T-bit|E-bit) ;TOS-capable
7011 LS type = 5 ;indicates AS external link
7012 Link State ID = DefaultDestination ; default route
7013 Advertising Router = Router RTA's ID
7014 bit E = 1 ;Type 2 metric
7015 TOS = 0
7016 metric = 1
7017 Forwarding address = RTX's IP address
7018
7019 In figure 16, suppose instead that both RTA and RTB exchange
7020 EGP information with RTX. In this case, RTA and RTB would
7021 originate the same set of AS external link advertisements.
7022 These advertisements, if they specify the same metric, would
7023 be functionally equivalent since they would specify the same
7024 destination and forwarding address (RTX). This leads to a
7025 clear duplication of effort. If only one of RTA or RTB
7026 originated the set of external advertisements, the routing
7027 would remain the same, and the size of the link state
7028 database would decrease. However, it must be unambiguously
7029 defined as to which router originates the advertisements
7030 (otherwise neither may, or the identity of the originator
7031 may oscillate). The following rule is thereby established:
7032 if two routers, both reachable from one another, originate
7033 functionally equivalent AS external advertisements (i.e.,
7034 same destination, cost and non-zero forwarding address),
7035 then the advertisement originated by the router having the
7036 highest OSPF Router ID is used. The router having the lower
7037 OSPF Router ID can then flush its advertisement. Flushing a
7038 link state advertisement is discussed in <a href="#section-14.1">Section 14.1</a>.
7039
7040 <span class="h2"><a class="selflink" id="section-13" href="#section-13">13</a>. The Flooding Procedure</span>
7041
7042 Link State Update packets provide the mechanism for flooding link
7043 state advertisements. A Link State Update packet may contain
7044 several distinct advertisements, and floods each advertisement one
7045 hop further from its point of origination. To make the flooding
7046 procedure reliable, each advertisement must be acknowledged
7047 separately. Acknowledgments are transmitted in Link State
7048 Acknowledgment packets. Many separate acknowledgments can also be
7049
7050
7051
7052 <span class="grey">Moy [Page 126]</span></pre>
7053 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-127" ></span>
7054 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7055
7056
7057
7058 +
7059 |
7060 +---+.....|.EGP
7061 |RTA|-----|.....+---+
7062 +---+ |-----|RTX|
7063 | +---+
7064 +---+ |
7065 |RTB|-----|
7066 +---+ |
7067 |
7068 +---+ |
7069 |RTC|-----|
7070 +---+ |
7071 |
7072 +
7073
7074
7075 Figure 16: Forwarding address example
7076
7077 grouped together into a single packet.
7078
7079 The flooding procedure starts when a Link State Update packet has
7080 been received. Many consistency checks have been made on the
7081 received packet before being handed to the flooding procedure (see
7082 <a href="#section-8.2">Section 8.2</a>). In particular, the Link State Update packet has been
7083 associated with a particular neighbor, and a particular area. If
7084 the neighbor is in a lesser state than Exchange, the packet should
7085 be dropped without further processing.
7086
7087 All types of link state advertisements, other than AS external link
7088 advertisements, are associated with a specific area. However, link
7089 state advertisements do not contain an area field. A link state
7090 advertisement's area must be deduced from the Link State Update
7091 packet header.
7092
7093 For each link state advertisement contained in the packet, the
7094 following steps are taken:
7095
7096
7097 (1) Validate the advertisement's LS checksum. If the checksum turns
7098 out to be invalid, discard the advertisement and get the next
7099 one from the Link State Update packet.
7100
7101 (2) Examine the link state advertisement's LS type. If the LS type
7102 is unknown, discard the advertisement and get the next one from
7103 the Link State Update Packet. This specification defines LS
7104 types 1-5 (see <a href="#section-4.3">Section 4.3</a>).
7105
7106
7107
7108 <span class="grey">Moy [Page 127]</span></pre>
7109 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-128" ></span>
7110 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7111
7112
7113 (3) Else if this is a AS external link advertisement (LS type = 5),
7114 and the area has been configured as a stub area, discard the
7115 advertisement and get the next one from the Link State Update
7116 Packet. AS external link advertisements are not flooded
7117 into/throughout stub areas (see <a href="#section-3.6">Section 3.6</a>).
7118
7119 (4) Else if the advertisement's LS age is equal to MaxAge, and there
7120 is currently no instance of the advertisement in the router's
7121 link state database, then take the following actions:
7122
7123 (a) Acknowledge the receipt of the advertisement by sending a
7124 Link State Acknowledgment packet back to the sending
7125 neighbor (see <a href="#section-13.5">Section 13.5</a>).
7126
7127 (b) Purge all outstanding requests for equal or previous
7128 instances of the advertisement from the sending neighbor's
7129 Link State Request list (see <a href="#section-10">Section 10</a>).
7130
7131 (c) If the sending neighbor is in state Exchange or in state
7132 Loading, then install the MaxAge advertisement in the link
7133 state database. Otherwise, simply discard the
7134 advertisement. In either case, examine the next
7135 advertisement (if any) listed in the Link State Update
7136 packet.
7137
7138 (5) Otherwise, find the instance of this advertisement that is
7139 currently contained in the router's link state database. If
7140 there is no database copy, or the received advertisement is more
7141 recent than the database copy (see <a href="#section-13.1">Section 13.1</a> below for the
7142 determination of which advertisement is more recent) the
7143 following steps must be performed:
7144
7145 (a) If there is already a database copy, and if the database
7146 copy was installed less than MinLSInterval seconds ago,
7147 discard the new advertisement (without acknowledging it) and
7148 examine the next advertisement (if any) listed in the Link
7149 State Update packet.
7150
7151 (b) Otherwise immediately flood the new advertisement out some
7152 subset of the router's interfaces (see <a href="#section-13.3">Section 13.3</a>). In
7153 some cases (e.g., the state of the receiving interface is DR
7154 and the advertisement was received from a router other than
7155 the Backup DR) the advertisement will be flooded back out
7156 the receiving interface. This occurrence should be noted
7157 for later use by the acknowledgment process (<a href="#section-13.5">Section 13.5</a>).
7158
7159 (c) Remove the current database copy from all neighbors' Link
7160 state retransmission lists.
7161
7162
7163
7164 <span class="grey">Moy [Page 128]</span></pre>
7165 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-129" ></span>
7166 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7167
7168
7169 (d) Install the new advertisement in the link state database
7170 (replacing the current database copy). This may cause the
7171 routing table calculation to be scheduled. In addition,
7172 timestamp the new advertisement with the current time (i.e.,
7173 the time it was received). The flooding procedure cannot
7174 overwrite the newly installed advertisement until
7175 MinLSInterval seconds have elapsed. The advertisement
7176 installation process is discussed further in <a href="#section-13.2">Section 13.2</a>.
7177
7178 (e) Possibly acknowledge the receipt of the advertisement by
7179 sending a Link State Acknowledgment packet back out the
7180 receiving interface. This is explained below in <a href="#section-13.5">Section</a>
7181 <a href="#section-13.5">13.5</a>.
7182
7183 (f) If this new link state advertisement indicates that it was
7184 originated by the receiving router itself (i.e., is
7185 considered a self-originated advertisement), the router must
7186 take special action, either updating the advertisement or in
7187 some cases flushing it from the routing domain. For a
7188 description of how self-originated advertisements are
7189 detected and subsequently handled, see <a href="#section-13.4">Section 13.4</a>.
7190
7191 (6) Else, if there is an instance of the advertisement on the
7192 sending neighbor's Link state request list, an error has
7193 occurred in the Database Exchange process. In this case,
7194 restart the Database Exchange process by generating the neighbor
7195 event BadLSReq for the sending neighbor and stop processing the
7196 Link State Update packet.
7197
7198 (7) Else, if the received advertisement is the same instance as the
7199 database copy (i.e., neither one is more recent) the following
7200 two steps should be performed:
7201
7202 (a) If the advertisement is listed in the Link state
7203 retransmission list for the receiving adjacency, the router
7204 itself is expecting an acknowledgment for this
7205 advertisement. The router should treat the received
7206 advertisement as an acknowledgment, by removing the
7207 advertisement from the Link state retransmission list. This
7208 is termed an "implied acknowledgment". Its occurrence
7209 should be noted for later use by the acknowledgment process
7210 (<a href="#section-13.5">Section 13.5</a>).
7211
7212 (b) Possibly acknowledge the receipt of the advertisement by
7213 sending a Link State Acknowledgment packet back out the
7214 receiving interface. This is explained below in <a href="#section-13.5">Section</a>
7215 <a href="#section-13.5">13.5</a>.
7216
7217
7218
7219
7220 <span class="grey">Moy [Page 129]</span></pre>
7221 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-130" ></span>
7222 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7223
7224
7225 (8) Else, the database copy is more recent. Note an unusual event
7226 to network management, discard the advertisement and process the
7227 next link state advertisement contained in the Link State Update
7228 packet.
7229
7230
7231 13.1. Determining which link state is newer
7232
7233 When a router encounters two instances of a link state
7234 advertisement, it must determine which is more recent. This
7235 occurred above when comparing a received advertisement to its
7236 database copy. This comparison must also be done during the
7237 Database Exchange procedure which occurs during adjacency
7238 bring-up.
7239
7240 A link state advertisement is identified by its LS type, Link
7241 State ID and Advertising Router. For two instances of the same
7242 advertisement, the LS sequence number, LS age, and LS checksum
7243 fields are used to determine which instance is more recent:
7244
7245
7246 o The advertisement having the newer LS sequence number is
7247 more recent. See <a href="#section-12.1.6">Section 12.1.6</a> for an explanation of the
7248 LS sequence number space. If both instances have the same
7249 LS sequence number, then:
7250
7251 o If the two instances have different LS checksums, then the
7252 instance having the larger LS checksum (when considered as a
7253 16-bit unsigned integer) is considered more recent.
7254
7255 o Else, if only one of the instances has its LS age field set
7256 to MaxAge, the instance of age MaxAge is considered to be
7257 more recent.
7258
7259 o Else, if the LS age fields of the two instances differ by
7260 more than MaxAgeDiff, the instance having the smaller
7261 (younger) LS age is considered to be more recent.
7262
7263 o Else, the two instances are considered to be identical.
7264
7265
7266 13.2. Installing link state advertisements in the database
7267
7268 Installing a new link state advertisement in the database,
7269 either as the result of flooding or a newly self-originated
7270 advertisement, may cause the OSPF routing table structure to be
7271 recalculated. The contents of the new advertisement should be
7272 compared to the old instance, if present. If there is no
7273
7274
7275
7276 <span class="grey">Moy [Page 130]</span></pre>
7277 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-131" ></span>
7278 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7279
7280
7281 difference, there is no need to recalculate the routing table.
7282 (Note that even if the contents are the same, the LS checksum
7283 will probably be different, since the checksum covers the LS
7284 sequence number.)
7285
7286 If the contents are different, the following pieces of the
7287 routing table must be recalculated, depending on the new
7288 advertisement's LS type field:
7289
7290
7291 Router links and network links advertisements
7292 The entire routing table must be recalculated, starting with
7293 the shortest path calculations for each area (not just the
7294 area whose topological database has changed). The reason
7295 that the shortest path calculation cannot be restricted to
7296 the single changed area has to do with the fact that AS
7297 boundary routers may belong to multiple areas. A change in
7298 the area currently providing the best route may force the
7299 router to use an intra-area route provided by a different
7300 area.[16]
7301
7302 Summary link advertisements
7303 The best route to the destination described by the summary
7304 link advertisement must be recalculated (see <a href="#section-16.5">Section 16.5</a>).
7305 If this destination is an AS boundary router, it may also be
7306 necessary to re-examine all the AS external link
7307 advertisements.
7308
7309 AS external link advertisements
7310 The best route to the destination described by the AS
7311 external link advertisement must be recalculated (see
7312 <a href="#section-16.6">Section 16.6</a>).
7313
7314
7315 Also, any old instance of the advertisement must be removed from
7316 the database when the new advertisement is installed. This old
7317 instance must also be removed from all neighbors' Link state
7318 retransmission lists (see <a href="#section-10">Section 10</a>).
7319
7320
7321 13.3. Next step in the flooding procedure
7322
7323 When a new (and more recent) advertisement has been received, it
7324 must be flooded out some set of the router's interfaces. This
7325 section describes the second part of flooding procedure (the
7326 first part being the processing that occurred in <a href="#section-13">Section 13</a>),
7327 namely, selecting the outgoing interfaces and adding the
7328 advertisement to the appropriate neighbors' Link state
7329
7330
7331
7332 <span class="grey">Moy [Page 131]</span></pre>
7333 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-132" ></span>
7334 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7335
7336
7337 retransmission lists. Also included in this part of the
7338 flooding procedure is the maintenance of the neighbors' Link
7339 state request lists.
7340
7341 This section is equally applicable to the flooding of an
7342 advertisement that the router itself has just originated (see
7343 <a href="#section-12.4">Section 12.4</a>). For these advertisements, this section provides
7344 the entirety of the flooding procedure (i.e., the processing of
7345 <a href="#section-13">Section 13</a> is not performed, since, for example, the
7346 advertisement has not been received from a neighbor and
7347 therefore does not need to be acknowledged).
7348
7349 Depending upon the advertisement's LS type, the advertisement
7350 can be flooded out only certain interfaces. These interfaces,
7351 defined by the following, are called the eligible interfaces:
7352
7353
7354 AS external link advertisements (LS Type = 5)
7355 AS external link advertisements are flooded throughout the
7356 entire AS, with the exception of stub areas (see <a href="#section-3.6">Section</a>
7357 <a href="#section-3.6">3.6</a>). The eligible interfaces are all the router's
7358 interfaces, excluding virtual links and those interfaces
7359 attaching to stub areas.
7360
7361 All other LS types
7362 All other types are specific to a single area (Area A). The
7363 eligible interfaces are all those interfaces attaching to
7364 the Area A. If Area A is the backbone, this includes all
7365 the virtual links.
7366
7367
7368 Link state databases must remain synchronized over all
7369 adjacencies associated with the above eligible interfaces. This
7370 is accomplished by executing the following steps on each
7371 eligible interface. It should be noted that this procedure may
7372 decide not to flood a link state advertisement out a particular
7373 interface, if there is a high probability that the attached
7374 neighbors have already received the advertisement. However, in
7375 these cases the flooding procedure must be absolutely sure that
7376 the neighbors eventually do receive the advertisement, so the
7377 advertisement is still added to each adjacency's Link state
7378 retransmission list. For each eligible interface:
7379
7380
7381 (1) Each of the neighbors attached to this interface are
7382 examined, to determine whether they must receive the new
7383 advertisement. The following steps are executed for each
7384 neighbor:
7385
7386
7387
7388 <span class="grey">Moy [Page 132]</span></pre>
7389 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-133" ></span>
7390 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7391
7392
7393 (a) If the neighbor is in a lesser state than Exchange, it
7394 does not participate in flooding, and the next neighbor
7395 should be examined.
7396
7397 (b) Else, if the adjacency is not yet full (neighbor state
7398 is Exchange or Loading), examine the Link state request
7399 list associated with this adjacency. If there is an
7400 instance of the new advertisement on the list, it
7401 indicates that the neighboring router has an instance of
7402 the advertisement already. Compare the new
7403 advertisement to the neighbor's copy:
7404
7405 o If the new advertisement is less recent, then
7406 examine the next neighbor.
7407
7408 o If the two copies are the same instance, then delete
7409 the advertisement from the Link state request list,
7410 and examine the next neighbor.[17]
7411
7412 o Else, the new advertisement is more recent. Delete
7413 the advertisement from the Link state request list.
7414
7415 (c) If the new advertisement was received from this
7416 neighbor, examine the next neighbor.
7417
7418 (d) At this point we are not positive that the neighbor has
7419 an up-to-date instance of this new advertisement. Add
7420 the new advertisement to the Link state retransmission
7421 list for the adjacency. This ensures that the flooding
7422 procedure is reliable; the advertisement will be
7423 retransmitted at intervals until an acknowledgment is
7424 seen from the neighbor.
7425
7426 (2) The router must now decide whether to flood the new link
7427 state advertisement out this interface. If in the previous
7428 step, the link state advertisement was NOT added to any of
7429 the Link state retransmission lists, there is no need to
7430 flood the advertisement out the interface and the next
7431 interface should be examined.
7432
7433 (3) If the new advertisement was received on this interface, and
7434 it was received from either the Designated Router or the
7435 Backup Designated Router, chances are that all the neighbors
7436 have received the advertisement already. Therefore, examine
7437 the next interface.
7438
7439 (4) If the new advertisement was received on this interface, and
7440 the interface state is Backup (i.e., the router itself is
7441
7442
7443
7444 <span class="grey">Moy [Page 133]</span></pre>
7445 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-134" ></span>
7446 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7447
7448
7449 the Backup Designated Router), examine the next interface.
7450 The Designated Router will do the flooding on this
7451 interface. If the Designated Router fails, this router will
7452 end up retransmitting the updates.
7453
7454 (5) If this step is reached, the advertisement must be flooded
7455 out the interface. Send a Link State Update packet (with
7456 the new advertisement as contents) out the interface. The
7457 advertisement's LS age must be incremented by InfTransDelay
7458 (which must be &gt; 0) when copied into the outgoing Link State
7459 Update packet (until the LS age field reaches its maximum
7460 value of MaxAge).
7461
7462 On broadcast networks, the Link State Update packets are
7463 multicast. The destination IP address specified for the
7464 Link State Update Packet depends on the state of the
7465 interface. If the interface state is DR or Backup, the
7466 address AllSPFRouters should be used. Otherwise, the
7467 address AllDRouters should be used.
7468
7469 On non-broadcast, multi-access networks, separate Link State
7470 Update packets must be sent, as unicasts, to each adjacent
7471 neighbor (i.e., those in state Exchange or greater). The
7472 destination IP addresses for these packets are the
7473 neighbors' IP addresses.
7474
7475
7476 13.4. Receiving self-originated link state
7477
7478 It is a common occurrence for a router to receive self-
7479 originated link state advertisements via the flooding procedure.
7480 A self-originated advertisement is detected when either 1) the
7481 advertisement's Advertising Router is equal to the router's own
7482 Router ID or 2) the advertisement is a network links
7483 advertisement and its Link State ID is equal to one of the
7484 router's own IP interface addresses.
7485
7486 However, if the received self-originated advertisement is newer
7487 than the last instance that the router actually originated, the
7488 router must take special action. The reception of such an
7489 advertisement indicates that there are link state advertisements
7490 in the routing domain that were originated before the last time
7491 the router was restarted. In most cases, the router must then
7492 advance the advertisement's LS sequence number one past the
7493 received LS sequence number, and originate a new instance of the
7494 advertisement.
7495
7496 It may be the case the router no longer wishes to originate the
7497
7498
7499
7500 <span class="grey">Moy [Page 134]</span></pre>
7501 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-135" ></span>
7502 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7503
7504
7505 received advertisement. Possible examples include: 1) the
7506 advertisement is a summary link or AS external link and the
7507 router no longer has an (advertisable) route to the destination,
7508 2) the advertisement is a network links advertisement but the
7509 router is no longer Designated Router for the network or 3) the
7510 advertisement is a network links advertisement whose Link State
7511 ID is one of the router's own IP interface addresses but whose
7512 Advertising Router is not equal to the router's own Router ID
7513 (this latter case should be rare, and it indicates that the
7514 router's Router ID has changed since originating the
7515 advertisement). In all these cases, instead of updating the
7516 advertisement, the advertisement should be flushed from the
7517 routing domain by incrementing the received advertisement's LS
7518 age to MaxAge and reflooding (see <a href="#section-14.1">Section 14.1</a>).
7519
7520
7521 13.5. Sending Link State Acknowledgment packets
7522
7523 Each newly received link state advertisement must be
7524 acknowledged. This is usually done by sending Link State
7525 Acknowledgment packets. However, acknowledgments can also be
7526 accomplished implicitly by sending Link State Update packets
7527 (see step 7a of <a href="#section-13">Section 13</a>).
7528
7529 Many acknowledgments may be grouped together into a single Link
7530 State Acknowledgment packet. Such a packet is sent back out the
7531 interface that has received the advertisements. The packet can
7532 be sent in one of two ways: delayed and sent on an interval
7533 timer, or sent directly (as a unicast) to a particular neighbor.
7534 The particular acknowledgment strategy used depends on the
7535 circumstances surrounding the receipt of the advertisement.
7536
7537 Sending delayed acknowledgments accomplishes several things: it
7538 facilitates the packaging of multiple acknowledgments in a
7539 single Link State Acknowledgment packet; it enables a single
7540 Link State Acknowledgment packet to indicate acknowledgments to
7541 several neighbors at once (through multicasting); and it
7542 randomizes the Link State Acknowledgment packets sent by the
7543 various routers attached to a multi-access network. The fixed
7544 interval between a router's delayed transmissions must be short
7545 (less than RxmtInterval) or needless retransmissions will ensue.
7546
7547 Direct acknowledgments are sent to a particular neighbor in
7548 response to the receipt of duplicate link state advertisements.
7549 These acknowledgments are sent as unicasts, and are sent
7550 immediately when the duplicate is received.
7551
7552 The precise procedure for sending Link State Acknowledgment
7553
7554
7555
7556 <span class="grey">Moy [Page 135]</span></pre>
7557 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-136" ></span>
7558 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7559
7560
7561 packets is described in Table 19. The circumstances surrounding
7562 the receipt of the advertisement are listed in the left column.
7563 The acknowledgment action then taken is listed in one of the two
7564 right columns. This action depends on the state of the
7565 concerned interface; interfaces in state Backup behave
7566 differently from interfaces in all other states. Delayed
7567 acknowledgments must be delivered to all adjacent routers
7568 associated with the interface. On broadcast networks, this is
7569 accomplished by sending the delayed Link State Acknowledgment
7570 packets as multicasts. The Destination IP address used depends
7571 on the state of the interface. If the state is DR or Backup,
7572 the destination AllSPFRouters is used. In other states, the
7573 destination AllDRouters is used. On non-broadcast networks,
7574 delayed Link State Acknowledgment packets must be unicast
7575 separately over each adjacency (i.e., neighbor whose state is &gt;=
7576 Exchange).
7577
7578 The reasoning behind sending the above packets as multicasts is
7579 best explained by an example. Consider the network
7580 configuration depicted in Figure 15. Suppose RT4 has been
7581 elected as Designated Router, and RT3 as Backup Designated
7582 Router for the network N3. When Router RT4 floods a new
7583 advertisement to Network N3, it is received by routers RT1, RT2,
7584 and RT3. These routers will not flood the advertisement back
7585 onto net N3, but they still must ensure that their topological
7586 databases remain synchronized with their adjacent neighbors. So
7587 RT1, RT2, and RT4 are waiting to see an acknowledgment from RT3.
7588 Likewise, RT4 and RT3 are both waiting to see acknowledgments
7589 from RT1 and RT2. This is best achieved by sending the
7590 acknowledgments as multicasts.
7591
7592 The reason that the acknowledgment logic for Backup DRs is
7593 slightly different is because they perform differently during
7594 the flooding of link state advertisements (see <a href="#section-13.3">Section 13.3</a>,
7595 step 4).
7596
7597
7598
7599 13.6. Retransmitting link state advertisements
7600
7601 Advertisements flooded out an adjacency are placed on the
7602 adjacency's Link state retransmission list. In order to ensure
7603 that flooding is reliable, these advertisements are
7604 retransmitted until they are acknowledged. The length of time
7605 between retransmissions is a configurable per-interface value,
7606 RxmtInterval. If this is set too low for an interface, needless
7607 retransmissions will ensue. If the value is set too high, the
7608 speed of the flooding, in the face of lost packets, may be
7609
7610
7611
7612 <span class="grey">Moy [Page 136]</span></pre>
7613 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-137" ></span>
7614 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7615
7616
7617
7618
7619
7620
7621 Action taken in state
7622 Circumstances Backup All other states
7623 _______________________________________________________________
7624 Advertisement has No acknowledgment No acknowledgment
7625 been flooded back sent. sent.
7626 out receiving in-
7627 terface (see Sec-
7628 tion 13, step 5b).
7629 _______________________________________________________________
7630 Advertisement is Delayed acknowledg- Delayed ack-
7631 more recent than ment sent if adver- nowledgment sent.
7632 database copy, but tisement received
7633 was not flooded from Designated
7634 back out receiving Router, otherwise
7635 interface do nothing
7636 _______________________________________________________________
7637 Advertisement is a Delayed acknowledg- No acknowledgment
7638 duplicate, and was ment sent if adver- sent.
7639 treated as an im- tisement received
7640 plied acknowledg- from Designated
7641 ment (see Section Router, otherwise
7642 13, step 7a). do nothing
7643 _______________________________________________________________
7644 Advertisement is a Direct acknowledg- Direct acknowledg-
7645 duplicate, and was ment sent. ment sent.
7646 not treated as an
7647 implied ack-
7648 nowledgment.
7649 _______________________________________________________________
7650 Advertisement's LS Direct acknowledg- Direct acknowledg-
7651 age is equal to ment sent. ment sent.
7652 MaxAge, and there is
7653 no current instance
7654 of the advertisement
7655 in the link state
7656 database (see
7657 <a href="#section-13">Section 13</a>, step 4).
7658
7659
7660 Table 19: Sending link state acknowledgements.
7661
7662
7663
7664
7665
7666
7667
7668 <span class="grey">Moy [Page 137]</span></pre>
7669 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-138" ></span>
7670 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7671
7672
7673 affected.
7674
7675 Several retransmitted advertisements may fit into a single Link
7676 State Update packet. When advertisements are to be
7677 retransmitted, only the number fitting in a single Link State
7678 Update packet should be transmitted. Another packet of
7679 retransmissions can be sent when some of the advertisements are
7680 acknowledged, or on the next firing of the retransmission timer.
7681
7682 Link State Update Packets carrying retransmissions are always
7683 sent as unicasts (directly to the physical address of the
7684 neighbor). They are never sent as multicasts. Each
7685 advertisement's LS age must be incremented by InfTransDelay
7686 (which must be &gt; 0) when copied into the outgoing Link State
7687 Update packet (until the LS age field reaches its maximum value
7688 of MaxAge).
7689
7690 If the adjacent router goes down, retransmissions may occur
7691 until the adjacency is destroyed by OSPF's Hello Protocol. When
7692 the adjacency is destroyed, the Link state retransmission list
7693 is cleared.
7694
7695
7696 13.7. Receiving link state acknowledgments
7697
7698 Many consistency checks have been made on a received Link State
7699 Acknowledgment packet before it is handed to the flooding
7700 procedure. In particular, it has been associated with a
7701 particular neighbor. If this neighbor is in a lesser state than
7702 Exchange, the Link State Acknowledgment packet is discarded.
7703
7704 Otherwise, for each acknowledgment in the Link State
7705 Acknowledgment packet, the following steps are performed:
7706
7707
7708 o Does the advertisement acknowledged have an instance on the
7709 Link state retransmission list for the neighbor? If not,
7710 examine the next acknowledgment. Otherwise:
7711
7712 o If the acknowledgment is for the same instance that is
7713 contained on the list, remove the item from the list and
7714 examine the next acknowledgment. Otherwise:
7715
7716 o Log the questionable acknowledgment, and examine the next
7717 one.
7718
7719
7720
7721
7722
7723
7724 <span class="grey">Moy [Page 138]</span></pre>
7725 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-139" ></span>
7726 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7727
7728
7729 <span class="h2"><a class="selflink" id="section-14" href="#section-14">14</a>. Aging The Link State Database</span>
7730
7731 Each link state advertisement has an LS age field. The LS age is
7732 expressed in seconds. An advertisement's LS age field is
7733 incremented while it is contained in a router's database. Also,
7734 when copied into a Link State Update Packet for flooding out a
7735 particular interface, the advertisement's LS age is incremented by
7736 InfTransDelay.
7737
7738 An advertisement's LS age is never incremented past the value
7739 MaxAge. Advertisements having age MaxAge are not used in the
7740 routing table calculation. As a router ages its link state
7741 database, an advertisement's LS age may reach MaxAge.[18] At this
7742 time, the router must attempt to flush the advertisement from the
7743 routing domain. This is done simply by reflooding the MaxAge
7744 advertisement just as if it was a newly originated advertisement
7745 (see <a href="#section-13.3">Section 13.3</a>).
7746
7747 When creating a Database summary list for a newly forming adjacency,
7748 any MaxAge advertisements present in the link state database are
7749 added to the neighbor's Link state retransmission list instead of
7750 the neighbor's Database summary list. See <a href="#section-10.3">Section 10.3</a> for more
7751 details.
7752
7753 A MaxAge advertisement must be removed immediately from the router's
7754 link state database as soon as both a) it is no longer contained on
7755 any neighbor Link state retransmission lists and b) none of the
7756 router's neighbors are in states Exchange or Loading.
7757
7758 When, in the process of aging the link state database, an
7759 advertisement's LS age hits a multiple of CheckAge, its LS checksum
7760 should be verified. If the LS checksum is incorrect, a program or
7761 memory error has been detected, and at the very least the router
7762 itself should be restarted.
7763
7764
7765 14.1. Premature aging of advertisements
7766
7767 A link state advertisement can be flushed from the routing
7768 domain by setting its LS age to MaxAge and reflooding the
7769 advertisement. This procedure follows the same course as
7770 flushing an advertisement whose LS age has naturally reached the
7771 value MaxAge (see <a href="#section-14">Section 14</a>). In particular, the MaxAge
7772 advertisement is removed from the router's link state database
7773 as soon as a) it is no longer contained on any neighbor Link
7774 state retransmission lists and b) none of the router's neighbors
7775 are in states Exchange or Loading. We call the setting of an
7776 advertisement's LS age to MaxAge premature aging.
7777
7778
7779
7780 <span class="grey">Moy [Page 139]</span></pre>
7781 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-140" ></span>
7782 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7783
7784
7785 Premature aging is used when it is time for a self-originated
7786 advertisement's sequence number field to wrap. At this point,
7787 the current advertisement instance (having LS sequence number of
7788 0x7fffffff) must be prematurely aged and flushed from the
7789 routing domain before a new instance with sequence number
7790 0x80000001 can be originated. See <a href="#section-12.1.6">Section 12.1.6</a> for more
7791 information.
7792
7793 Premature aging can also be used when, for example, one of the
7794 router's previously advertised external routes is no longer
7795 reachable. In this circumstance, the router can flush its
7796 external advertisement from the routing domain via premature
7797 aging. This procedure is preferable to the alternative, which is
7798 to originate a new advertisement for the destination specifying
7799 a metric of LSInfinity. Premature aging is also be used when
7800 unexpectedly receiving self-originated advertisements during the
7801 flooding procedure (see <a href="#section-13.4">Section 13.4</a>).
7802
7803 A router may only prematurely age its own self-originated link
7804 state advertisements. The router may not prematurely age
7805 advertisements that have been originated by other routers. An
7806 advertisement is considered self-originated when either 1) the
7807 advertisement's Advertising Router is equal to the router's own
7808 Router ID or 2) the advertisement is a network links
7809 advertisement and its Link State ID is equal to one of the
7810 router's own IP interface addresses.
7811
7812
7813 <span class="h2"><a class="selflink" id="section-15" href="#section-15">15</a>. Virtual Links</span>
7814
7815 The single backbone area (Area ID = 0.0.0.0) cannot be disconnected,
7816 or some areas of the Autonomous System will become unreachable. To
7817 establish/maintain connectivity of the backbone, virtual links can
7818 be configured through non-backbone areas. Virtual links serve to
7819 connect physically separate components of the backbone. The two
7820 endpoints of a virtual link are area border routers. The virtual
7821 link must be configured in both routers. The configuration
7822 information in each router consists of the other virtual endpoint
7823 (the other area border router), and the non-backbone area the two
7824 routers have in common (called the transit area). Virtual links
7825 cannot be configured through stub areas (see <a href="#section-3.6">Section 3.6</a>).
7826
7827 The virtual link is treated as if it were an unnumbered point-to-
7828 point network (belonging to the backbone) joining the two area
7829 border routers. An attempt is made to establish an adjacency over
7830 the virtual link. When this adjacency is established, the virtual
7831 link will be included in backbone router links advertisements, and
7832 OSPF packets pertaining to the backbone area will flow over the
7833
7834
7835
7836 <span class="grey">Moy [Page 140]</span></pre>
7837 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-141" ></span>
7838 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7839
7840
7841 adjacency. Such an adjacency has been referred to in this document
7842 as a "virtual adjacency".
7843
7844 In each endpoint router, the cost and viability of the virtual link
7845 is discovered by examining the routing table entry for the other
7846 endpoint router. (The entry's associated area must be the
7847 configured transit area). Actually, there may be a separate routing
7848 table entry for each Type of Service. These are called the virtual
7849 link's corresponding routing table entries. The InterfaceUp event
7850 occurs for a virtual link when its corresponding TOS 0 routing table
7851 entry becomes reachable. Conversely, the InterfaceDown event occurs
7852 when its TOS 0 routing table entry becomes unreachable.[19] In other
7853 words, the virtual link's viability is determined by the existence
7854 of an intra-area path, through the transit area, between the two
7855 endpoints. Note that a virtual link whose underlying path has cost
7856 greater than hexadecimal 0xffff (the maximum size of an interface
7857 cost in a router links advertisement) should be considered
7858 inoperational (i.e., treated the same as if the path did not exist).
7859
7860 The other details concerning virtual links are as follows:
7861
7862 o AS external links are NEVER flooded over virtual adjacencies.
7863 This would be duplication of effort, since the same AS external
7864 links are already flooded throughout the virtual link's transit
7865 area. For this same reason, AS external link advertisements are
7866 not summarized over virtual adjacencies during the Database
7867 Exchange process.
7868
7869 o The cost of a virtual link is NOT configured. It is defined to
7870 be the cost of the intra-area path between the two defining area
7871 border routers. This cost appears in the virtual link's
7872 corresponding routing table entry. When the cost of a virtual
7873 link changes, a new router links advertisement should be
7874 originated for the backbone area.
7875
7876 o Just as the virtual link's cost and viability are determined by
7877 the routing table build process (through construction of the
7878 routing table entry for the other endpoint), so are the IP
7879 interface address for the virtual interface and the virtual
7880 neighbor's IP address. These are used when sending OSPF
7881 protocol packets over the virtual link. Note that when one (or
7882 both) of the virtual link endpoints connect to the transit area
7883 via an unnumbered point-to-point link, it may be impossible to
7884 calculate either the virtual interface's IP address and/or the
7885 virtual neighbor's IP address, thereby causing the virtual link
7886 to fail.
7887
7888
7889
7890
7891
7892 <span class="grey">Moy [Page 141]</span></pre>
7893 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-142" ></span>
7894 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7895
7896
7897 o In each endpoint's router links advertisement for the backbone,
7898 the virtual link is represented as a Type 4 link whose Link ID
7899 is set to the virtual neighbor's OSPF Router ID and whose Link
7900 Data is set to the virtual interface's IP address. See <a href="#section-12.4.1">Section</a>
7901 <a href="#section-12.4.1">12.4.1</a> for more information. Note that it may be the case that
7902 there is a TOS 0 path, but no non-zero TOS paths, between the
7903 two endpoint routers. In this case, both routers must revert to
7904 being non-TOS-capable, clearing the T-bit in the Options field
7905 of their backbone router links advertisements.
7906
7907 o When virtual links are configured for the backbone, information
7908 concerning backbone networks should not be condensed before
7909 being summarized for the transit areas. In other words, each
7910 backbone network should be advertised into the transit areas in
7911 a separate summary link advertisement, regardless of the
7912 backbone's configured area address ranges. See <a href="#section-12.4.3">Section 12.4.3</a>
7913 for more information.
7914
7915 o The time between link state retransmissions, RxmtInterval, is
7916 configured for a virtual link. This should be well over the
7917 expected round-trip delay between the two routers. This may be
7918 hard to estimate for a virtual link; it is better to err on the
7919 side of making it too large.
7920
7921
7922 <span class="h2"><a class="selflink" id="section-16" href="#section-16">16</a>. Calculation Of The Routing Table</span>
7923
7924 This section details the OSPF routing table calculation. Using its
7925 attached areas' link state databases as input, a router runs the
7926 following algorithm, building its routing table step by step. At
7927 each step, the router must access individual pieces of the link
7928 state databases (e.g., a router links advertisement originated by a
7929 certain router). This access is performed by the lookup function
7930 discussed in <a href="#section-12.2">Section 12.2</a>. The lookup process may return a link
7931 state advertisement whose LS age is equal to MaxAge. Such an
7932 advertisement should not be used in the routing table calculation,
7933 and is treated just as if the lookup process had failed.
7934
7935 The OSPF routing table's organization is explained in <a href="#section-11">Section 11</a>.
7936 Two examples of the routing table build process are presented in
7937 Sections <a href="#section-11.2">11.2</a> and <a href="#section-11.3">11.3</a>. This process can be broken into the
7938 following steps:
7939
7940
7941 (1) The present routing table is invalidated. The routing table is
7942 built again from scratch. The old routing table is saved so
7943 that changes in routing table entries can be identified.
7944
7945
7946
7947
7948 <span class="grey">Moy [Page 142]</span></pre>
7949 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-143" ></span>
7950 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
7951
7952
7953 (2) The intra-area routes are calculated by building the shortest-
7954 path tree for each attached area. In particular, all routing
7955 table entries whose Destination Type is "area border router" are
7956 calculated in this step. This step is described in two parts.
7957 At first the tree is constructed by only considering those links
7958 between routers and transit networks. Then the stub networks
7959 are incorporated into the tree. During the area's shortest-path
7960 tree calculation, the area's TransitCapability is also
7961 calculated for later use in Step 4.
7962
7963 (3) The inter-area routes are calculated, through examination of
7964 summary link advertisements. If the router is attached to
7965 multiple areas (i.e., it is an area border router), only
7966 backbone summary link advertisements are examined.
7967
7968 (4) In area border routers connecting to one or more transit areas
7969 (i.e, non-backbone areas whose TransitCapability is found to be
7970 TRUE), the transit areas' summary link advertisements are
7971 examined to see whether better paths exist using the transit
7972 areas than were found in Steps 2-3 above.
7973
7974 (5) Routes to external destinations are calculated, through
7975 examination of AS external link advertisements. The locations
7976 of the AS boundary routers (which originate the AS external link
7977 advertisements) have been determined in steps 2-4.
7978
7979
7980 Steps 2-5 are explained in further detail below. The explanations
7981 describe the calculations for TOS 0 only. It may also be necessary
7982 to perform each step (separately) for each of the non-zero TOS
7983 values.[20] For more information concerning the building of non-zero
7984 TOS routes see <a href="#section-16.9">Section 16.9</a>.
7985
7986 Changes made to routing table entries as a result of these
7987 calculations can cause the OSPF protocol to take further actions.
7988 For example, a change to an intra-area route will cause an area
7989 border router to originate new summary link advertisements (see
7990 <a href="#section-12.4">Section 12.4</a>). See <a href="#section-16.7">Section 16.7</a> for a complete list of the OSPF
7991 protocol actions resulting from routing table changes.
7992
7993
7994 16.1. Calculating the shortest-path tree for an area
7995
7996 This calculation yields the set of intra-area routes associated
7997 with an area (called hereafter Area A). A router calculates the
7998 shortest-path tree using itself as the root.[21] The formation
7999 of the shortest path tree is done here in two stages. In the
8000 first stage, only links between routers and transit networks are
8001
8002
8003
8004 <span class="grey">Moy [Page 143]</span></pre>
8005 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-144" ></span>
8006 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8007
8008
8009 considered. Using the Dijkstra algorithm, a tree is formed from
8010 this subset of the link state database. In the second stage,
8011 leaves are added to the tree by considering the links to stub
8012 networks.
8013
8014 The procedure will be explained using the graph terminology that
8015 was introduced in <a href="#section-2">Section 2</a>. The area's link state database is
8016 represented as a directed graph. The graph's vertices are
8017 routers, transit networks and stub networks. The first stage of
8018 the procedure concerns only the transit vertices (routers and
8019 transit networks) and their connecting links. Throughout the
8020 shortest path calculation, the following data is also associated
8021 with each transit vertex:
8022
8023
8024 Vertex (node) ID
8025 A 32-bit number uniquely identifying the vertex. For router
8026 vertices this is the router's OSPF Router ID. For network
8027 vertices, this is the IP address of the network's Designated
8028 Router.
8029
8030 A link state advertisement
8031 Each transit vertex has an associated link state
8032 advertisement. For router vertices, this is a router links
8033 advertisement. For transit networks, this is a network
8034 links advertisement (which is actually originated by the
8035 network's Designated Router). In any case, the
8036 advertisement's Link State ID is always equal to the above
8037 Vertex ID.
8038
8039 List of next hops
8040 The list of next hops for the current set of shortest paths
8041 from the root to this vertex. There can be multiple
8042 shortest paths due to the equal-cost multipath capability.
8043 Each next hop indicates the outgoing router interface to use
8044 when forwarding traffic to the destination. On multi-access
8045 networks, the next hop also includes the IP address of the
8046 next router (if any) in the path towards the destination.
8047
8048 Distance from root
8049 The link state cost of the current set of shortest paths
8050 from the root to the vertex. The link state cost of a path
8051 is calculated as the sum of the costs of the path's
8052 constituent links (as advertised in router links and network
8053 links advertisements). One path is said to be "shorter"
8054 than another if it has a smaller link state cost.
8055
8056
8057
8058
8059
8060 <span class="grey">Moy [Page 144]</span></pre>
8061 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-145" ></span>
8062 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8063
8064
8065 The first stage of the procedure (i.e., the Dijkstra algorithm)
8066 can now be summarized as follows. At each iteration of the
8067 algorithm, there is a list of candidate vertices. Paths from
8068 the root to these vertices have been found, but not necessarily
8069 the shortest ones. However, the paths to the candidate vertex
8070 that is closest to the root are guaranteed to be shortest; this
8071 vertex is added to the shortest-path tree, removed from the
8072 candidate list, and its adjacent vertices are examined for
8073 possible addition to/modification of the candidate list. The
8074 algorithm then iterates again. It terminates when the candidate
8075 list becomes empty.
8076
8077 The following steps describe the algorithm in detail. Remember
8078 that we are computing the shortest path tree for Area A. All
8079 references to link state database lookup below are from Area A's
8080 database.
8081
8082
8083 (1) Initialize the algorithm's data structures. Clear the list
8084 of candidate vertices. Initialize the shortest-path tree to
8085 only the root (which is the router doing the calculation).
8086 Set Area A's TransitCapability to FALSE.
8087
8088 (2) Call the vertex just added to the tree vertex V. Examine
8089 the link state advertisement associated with vertex V. This
8090 is a lookup in the Area A's link state database based on the
8091 Vertex ID. If this is a router links advertisement, and bit
8092 V of the router links advertisement (see Section A.4.2) is
8093 set, set Area A's TransitCapability to TRUE. In any case,
8094 each link described by the advertisement gives the cost to
8095 an adjacent vertex. For each described link, (say it joins
8096 vertex V to vertex W):
8097
8098 (a) If this is a link to a stub network, examine the next
8099 link in V's advertisement. Links to stub networks will
8100 be considered in the second stage of the shortest path
8101 calculation.
8102
8103 (b) Otherwise, W is a transit vertex (router or transit
8104 network). Look up the vertex W's link state
8105 advertisement (router links or network links) in Area
8106 A's link state database. If the advertisement does not
8107 exist, or its LS age is equal to MaxAge, or it does not
8108 have a link back to vertex V, examine the next link in
8109 V's advertisement.[22]
8110
8111 (c) If vertex W is already on the shortest-path tree,
8112 examine the next link in the advertisement.
8113
8114
8115
8116 <span class="grey">Moy [Page 145]</span></pre>
8117 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-146" ></span>
8118 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8119
8120
8121 (d) Calculate the link state cost D of the resulting path
8122 from the root to vertex W. D is equal to the sum of the
8123 link state cost of the (already calculated) shortest
8124 path to vertex V and the advertised cost of the link
8125 between vertices V and W. If D is:
8126
8127 o Greater than the value that already appears for
8128 vertex W on the candidate list, then examine the
8129 next link.
8130
8131 o Equal to the value that appears for vertex W on the
8132 candidate list, calculate the set of next hops that
8133 result from using the advertised link. Input to
8134 this calculation is the destination (W), and its
8135 parent (V). This calculation is shown in <a href="#section-16.1.1">Section</a>
8136 <a href="#section-16.1.1">16.1.1</a>. This set of hops should be added to the
8137 next hop values that appear for W on the candidate
8138 list.
8139
8140 o Less than the value that appears for vertex W on the
8141 candidate list, or if W does not yet appear on the
8142 candidate list, then set the entry for W on the
8143 candidate list to indicate a distance of D from the
8144 root. Also calculate the list of next hops that
8145 result from using the advertised link, setting the
8146 next hop values for W accordingly. The next hop
8147 calculation is described in <a href="#section-16.1.1">Section 16.1.1</a>; it takes
8148 as input the destination (W) and its parent (V).
8149
8150 (3) If at this step the candidate list is empty, the shortest-
8151 path tree (of transit vertices) has been completely built
8152 and this stage of the procedure terminates. Otherwise,
8153 choose the vertex belonging to the candidate list that is
8154 closest to the root, and add it to the shortest-path tree
8155 (removing it from the candidate list in the process). Note
8156 that when there is a choice of vertices closest to the root,
8157 network vertices must be chosen before router vertices in
8158 order to necessarily find all equal-cost paths. This is
8159 consistent with the tie-breakers that were introduced in the
8160 modified Dijkstra algorithm used by OSPF's Multicast routing
8161 extensions (MOSPF).
8162
8163 (4) Possibly modify the routing table. For those routing table
8164 entries modified, the associated area will be set to Area A,
8165 the path type will be set to intra-area, and the cost will
8166 be set to the newly discovered shortest path's calculated
8167 distance.
8168
8169
8170
8171
8172 <span class="grey">Moy [Page 146]</span></pre>
8173 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-147" ></span>
8174 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8175
8176
8177 If the newly added vertex is an area border router (call it
8178 ABR), a routing table entry is added whose destination type
8179 is "area border router". The Options field found in the
8180 associated router links advertisement is copied into the
8181 routing table entry's Optional capabilities field. If in
8182 addition ABR is the endpoint of one of the calculating
8183 router's configured virtual links that uses Area A as its
8184 Transit area: the virtual link is declared up, the IP
8185 address of the virtual interface is set to the IP address of
8186 the outgoing interface calculated above for ABR, and the
8187 virtual neighbor's IP address is set to the ABR interface
8188 address (contained in ABR's router links advertisement) that
8189 points back to the root of the shortest-path tree;
8190 equivalently, this is the interface that points back to
8191 ABR's parent vertex on the shortest-path tree (similar to
8192 the calculation in <a href="#section-16.1.1">Section 16.1.1</a>).
8193
8194 If the newly added vertex is an AS boundary router, the
8195 routing table entry of type "AS boundary router" for the
8196 destination is located. Since routers can belong to more
8197 than one area, it is possible that several sets of intra-
8198 area paths exist to the AS boundary router, each set using a
8199 different area. However, the AS boundary router's routing
8200 table entry must indicate a set of paths which utilize a
8201 single area. The area leading to the routing table entry is
8202 selected as follows: The area providing the shortest path is
8203 always chosen; if more than one area provides paths with the
8204 same minimum cost, the area with the largest OSPF Area ID
8205 (when considered as an unsigned 32-bit integer) is chosen.
8206 Note that whenever an AS boundary router's routing table
8207 entry is added/modified, the Options found in the associated
8208 router links advertisement is copied into the routing table
8209 entry's Optional capabilities field.
8210
8211 If the newly added vertex is a transit network, the routing
8212 table entry for the network is located. The entry's
8213 Destination ID is the IP network number, which can be
8214 obtained by masking the Vertex ID (Link State ID) with its
8215 associated subnet mask (found in the body of the associated
8216 network links advertisement). If the routing table entry
8217 already exists (i.e., there is already an intra-area route
8218 to the destination installed in the routing table), multiple
8219 vertices have mapped to the same IP network. For example,
8220 this can occur when a new Designated Router is being
8221 established. In this case, the current routing table entry
8222 should be overwritten if and only if the newly found path is
8223 just as short and the current routing table entry's Link
8224 State Origin has a smaller Link State ID than the newly
8225
8226
8227
8228 <span class="grey">Moy [Page 147]</span></pre>
8229 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-148" ></span>
8230 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8231
8232
8233 added vertex' link state advertisement.
8234
8235 If there is no routing table entry for the network (the
8236 usual case), a routing table entry for the IP network should
8237 be added. The routing table entry's Link State Origin
8238 should be set to the newly added vertex' link state
8239 advertisement.
8240
8241 (5) Iterate the algorithm by returning to Step 2.
8242
8243
8244 The stub networks are added to the tree in the procedure's
8245 second stage. In this stage, all router vertices are again
8246 examined. Those that have been determined to be unreachable in
8247 the above first phase are discarded. For each reachable router
8248 vertex (call it V), the associated router links advertisement is
8249 found in the link state database. Each stub network link
8250 appearing in the advertisement is then examined, and the
8251 following steps are executed:
8252
8253
8254 (1) Calculate the distance D of stub network from the root. D
8255 is equal to the distance from the root to the router vertex
8256 (calculated in stage 1), plus the stub network link's
8257 advertised cost. Compare this distance to the current best
8258 cost to the stub network. This is done by looking up the
8259 stub network's current routing table entry. If the
8260 calculated distance D is larger, go on to examine the next
8261 stub network link in the advertisement.
8262
8263 (2) If this step is reached, the stub network's routing table
8264 entry must be updated. Calculate the set of next hops that
8265 would result from using the stub network link. This
8266 calculation is shown in <a href="#section-16.1.1">Section 16.1.1</a>; input to this
8267 calculation is the destination (the stub network) and the
8268 parent vertex (the router vertex). If the distance D is the
8269 same as the current routing table cost, simply add this set
8270 of next hops to the routing table entry's list of next hops.
8271 In this case, the routing table already has a Link State
8272 Origin. If this Link State Origin is a router links
8273 advertisement whose Link State ID is smaller than V's Router
8274 ID, reset the Link State Origin to V's router links
8275 advertisement.
8276
8277 Otherwise D is smaller than the routing table cost.
8278 Overwrite the current routing table entry by setting the
8279 routing table entry's cost to D, and by setting the entry's
8280 list of next hops to the newly calculated set. Set the
8281
8282
8283
8284 <span class="grey">Moy [Page 148]</span></pre>
8285 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-149" ></span>
8286 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8287
8288
8289 routing table entry's Link State Origin to V's router links
8290 advertisement. Then go on to examine the next stub network
8291 link.
8292
8293
8294 For all routing table entries added/modified in the second
8295 stage, the associated area will be set to Area A and the path
8296 type will be set to intra-area. When the list of reachable
8297 router links is exhausted, the second stage is completed. At
8298 this time, all intra-area routes associated with Area A have
8299 been determined.
8300
8301 The specification does not require that the above two stage
8302 method be used to calculate the shortest path tree. However, if
8303 another algorithm is used, an identical tree must be produced.
8304 For this reason, it is important to note that links between
8305 transit vertices must be bidirectional in ordered to be included
8306 in the above tree. It should also be mentioned that more
8307 efficient algorithms exist for calculating the tree; for
8308 example, the incremental SPF algorithm described in [<a href="#ref-BBN" title="&quot;ARPANET Routing Algorithm Improvements&quot;">BBN</a>].
8309
8310
8311 16.1.1. The next hop calculation
8312
8313 This section explains how to calculate the current set of
8314 next hops to use for a destination. Each next hop consists
8315 of the outgoing interface to use in forwarding packets to
8316 the destination together with the next hop router (if any).
8317 The next hop calculation is invoked each time a shorter path
8318 to the destination is discovered. This can happen in either
8319 stage of the shortest-path tree calculation (see <a href="#section-16.1">Section</a>
8320 <a href="#section-16.1">16.1</a>). In stage 1 of the shortest-path tree calculation a
8321 shorter path is found as the destination is added to the
8322 candidate list, or when the destination's entry on the
8323 candidate list is modified (Step 2d of Stage 1). In stage 2
8324 a shorter path is discovered each time the destination's
8325 routing table entry is modified (Step 2 of Stage 2).
8326
8327 The set of next hops to use for the destination may be
8328 recalculated several times during the shortest-path tree
8329 calculation, as shorter and shorter paths are discovered.
8330 In the end, the destination's routing table entry will
8331 always reflect the next hops resulting from the absolute
8332 shortest path(s).
8333
8334 Input to the next hop calculation is a) the destination and
8335 b) its parent in the current shortest path between the root
8336 (the calculating router) and the destination. The parent is
8337
8338
8339
8340 <span class="grey">Moy [Page 149]</span></pre>
8341 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-150" ></span>
8342 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8343
8344
8345 always a transit vertex (i.e., always a router or a transit
8346 network).
8347
8348 If there is at least one intervening router in the current
8349 shortest path between the destination and the root, the
8350 destination simply inherits the set of next hops from the
8351 parent. Otherwise, there are two cases. In the first case,
8352 the parent vertex is the root (the calculating router
8353 itself). This means that the destination is either a
8354 directly connected network or directly connected router.
8355 The next hop in this case is simply the OSPF interface
8356 connecting to the network/router; no next hop router is
8357 required. If the connecting OSPF interface in this case is a
8358 virtual link, the setting of the next hop should be deferred
8359 until the calculation in <a href="#section-16.3">Section 16.3</a>.
8360
8361 In the second case, the parent vertex is a network that
8362 directly connects the calculating router to the destination
8363 router. The list of next hops is then determined by
8364 examining the destination's router links advertisement. For
8365 each link in the advertisement that points back to the
8366 parent network, the link's Link Data field provides the IP
8367 address of a next hop router. The outgoing interface to use
8368 can then be derived from the next hop IP address (or it can
8369 be inherited from the parent network).
8370
8371
8372 16.2. Calculating the inter-area routes
8373
8374 The inter-area routes are calculated by examining summary link
8375 advertisements. If the router has active attachments to
8376 multiple areas, only backbone summary link advertisements are
8377 examined. Routers attached to a single area examine that area's
8378 summary links. In either case, the summary links examined below
8379 are all part of a single area's link state database (call it
8380 Area A).
8381
8382 Summary link advertisements are originated by the area border
8383 routers. Each summary link advertisement in Area A is
8384 considered in turn. Remember that the destination described by
8385 a summary link advertisement is either a network (Type 3 summary
8386 link advertisements) or an AS boundary router (Type 4 summary
8387 link advertisements). For each summary link advertisement:
8388
8389
8390 (1) If the cost specified by the advertisement is LSInfinity, or
8391 if the advertisement's LS age is equal to MaxAge, then
8392 examine the the next advertisement.
8393
8394
8395
8396 <span class="grey">Moy [Page 150]</span></pre>
8397 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-151" ></span>
8398 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8399
8400
8401 (2) If the advertisement was originated by the calculating
8402 router itself, examine the next advertisement.
8403
8404 (3) If the collection of destinations described by the summary
8405 link advertisement falls into one of the router's configured
8406 area address ranges (see <a href="#section-3.5">Section 3.5</a>) and the particular
8407 area address range is active, the summary link advertisement
8408 should be ignored. Active means that there are one or more
8409 reachable (by intra-area paths) networks contained in the
8410 area range. In this case, all addresses in the area range
8411 are assumed to be either reachable via intra-area paths, or
8412 else to be unreachable by any other means.
8413
8414 (4) Else, call the destination described by the advertisement N
8415 (for Type 3 summary links, N's address is obtained by
8416 masking the advertisement's Link State ID with the
8417 network/subnet mask contained in the body of the
8418 advertisement), and the area border originating the
8419 advertisement BR. Look up the routing table entry for BR
8420 having Area A as its associated area. If no such entry
8421 exists for router BR (i.e., BR is unreachable in Area A), do
8422 nothing with this advertisement and consider the next in the
8423 list. Else, this advertisement describes an inter-area path
8424 to destination N, whose cost is the distance to BR plus the
8425 cost specified in the advertisement. Call the cost of this
8426 inter-area path IAC.
8427
8428 (5) Next, look up the routing table entry for the destination N.
8429 (The entry's Destination Type is either Network or AS
8430 boundary router.) If no entry exists for N or if the
8431 entry's path type is "type 1 external" or "type 2 external",
8432 then install the inter-area path to N, with associated area
8433 Area A, cost IAC, next hop equal to the list of next hops to
8434 router BR, and Advertising router equal to BR.
8435
8436 (6) Else, if the paths present in the table are intra-area
8437 paths, do nothing with the advertisement (intra-area paths
8438 are always preferred).
8439
8440 (7) Else, the paths present in the routing table are also
8441 inter-area paths. Install the new path through BR if it is
8442 cheaper, overriding the paths in the routing table.
8443 Otherwise, if the new path is the same cost, add it to the
8444 list of paths that appear in the routing table entry.
8445
8446
8447
8448
8449
8450
8451
8452 <span class="grey">Moy [Page 151]</span></pre>
8453 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-152" ></span>
8454 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8455
8456
8457 16.3. Examining transit areas' summary links
8458
8459 This step is only performed by area border routers attached to
8460 one or more transit areas. Transit areas are those areas
8461 supporting one or more virtual links; their TransitCapability
8462 parameter has been set to TRUE in Step 2 of the Dijkstra
8463 algorithm (see <a href="#section-16.1">Section 16.1</a>). They are the only non-backbone
8464 areas that can carry data traffic that neither originates nor
8465 terminates in the area itself.
8466
8467 The purpose of the calculation below is to examine the transit
8468 areas to see whether they provide any better (shorter) paths
8469 than the paths previously calculated in Sections <a href="#section-16.1">16.1</a> and <a href="#section-16.2">16.2</a>.
8470 Any paths found that are better than or equal to previously
8471 discovered paths are installed in the routing table.
8472
8473 The calculation proceeds as follows. All the transit areas'
8474 summary link advertisements are examined in turn. Each such
8475 summary link advertisement describes a route through a transit
8476 area Area A to a Network N (N's address is obtained by masking
8477 the advertisement's Link State ID with the network/subnet mask
8478 contained in the body of the advertisement) or in the case of a
8479 Type 4 summary link advertisement, to an AS boundary router N.
8480 Suppose also that the summary link advertisement was originated
8481 by an area border router BR.
8482
8483 (1) If the cost advertised by the summary link advertisement is
8484 LSInfinity, or if the advertisement's LS age is equal to
8485 MaxAge, then examine the next advertisement.
8486
8487 (2) If the summary link advertisement was originated by the
8488 calculating router itself, examine the next advertisement.
8489
8490 (3) Look up the routing table entry for N. If it does not exist,
8491 or if the route type is other than intra-area or inter-area,
8492 or if the area associated with the routing table entry is
8493 not the backbone area, then examine the next advertisement.
8494 In other words, this calculation only updates backbone
8495 intra-area routes found in <a href="#section-16.1">Section 16.1</a> and inter-area
8496 routes found in <a href="#section-16.2">Section 16.2</a>.
8497
8498 (4) Look up the routing table entry for the advertising router
8499 BR associated with the Area A. If it is unreachable, examine
8500 the next advertisement. Otherwise, the cost to destination N
8501 is the sum of the cost in BR's Area A routing table entry
8502 and the cost advertised in the advertisement. Call this cost
8503 IAC.
8504
8505
8506
8507
8508 <span class="grey">Moy [Page 152]</span></pre>
8509 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-153" ></span>
8510 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8511
8512
8513 (5) If this cost is less than the cost occurring in N's routing
8514 table entry, overwrite N's list of next hops with those used
8515 for BR, and set N's routing table cost to IAC. Else, if IAC
8516 is the same as N's current cost, add BR's list of next hops
8517 to N's list of next hops. In any case, the area associated
8518 with N's routing table entry must remain the backbone area,
8519 and the path type (either intra-area or inter-area) must
8520 also remain the same.
8521
8522 It is important to note that the above calculation never makes
8523 unreachable destinations reachable, but instead just potentially
8524 finds better paths to already reachable destinations. Also,
8525 unlike <a href="./rfc1247#section-16.3">Section&nbsp;16.3 of [RFC 1247]</a>, the above calculation
8526 installs any better cost found into the routing table entry,
8527 from which it may be readvertised in summary link advertisements
8528 to other areas.
8529
8530 As an example of the calculation, consider the Autonomous System
8531 pictured in Figure 17. There is a single non-backbone area
8532 (Area 1) that physically divides the backbone into two separate
8533 pieces. To maintain connectivity of the backbone, a virtual link
8534 has been configured between routers RT1 and RT4. On the right
8535 side of the figure, Network N1 belongs to the backbone. The
8536 dotted lines indicate that there is a much shorter intra-area
8537
8538 ........................
8539 . Area 1 (transit) . +
8540 . . |
8541 . +---+1 1+---+100 |
8542 . |RT2|----------|RT4|=========|
8543 . 1/+---+********* +---+ |
8544 . /******* . |
8545 . 1/*Virtual . |
8546 1+---+/* Link . Net|work
8547 =======|RT1|* . | N1
8548 +---+\ . |
8549 . \ . |
8550 . \ . |
8551 . 1\+---+1 1+---+20 |
8552 . |RT3|----------|RT5|=========|
8553 . +---+ +---+ |
8554 . . |
8555 ........................ +
8556
8557
8558 Figure 17: Routing through transit areas
8559
8560
8561
8562
8563
8564 <span class="grey">Moy [Page 153]</span></pre>
8565 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-154" ></span>
8566 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8567
8568
8569 backbone path between router RT5 and Network N1 (cost 20) than
8570 there is between Router RT4 and Network N1 (cost 100). Both
8571 Router RT4 and Router RT5 will inject summary link
8572 advertisements for Network N1 into Area 1.
8573
8574 After the shortest-path tree has been calculated for the
8575 backbone in <a href="#section-16.1">Section 16.1</a>, Router RT1 (left end of the virtual
8576 link) will have calculated a path through Router RT4 for all
8577 data traffic destined for Network N1. However, since Router RT5
8578 is so much closer to Network N1, all routers internal to Area 1
8579 (e.g., Routers RT2 and RT3) will forward their Network N1
8580 traffic towards Router RT5, instead of RT4. And indeed, after
8581 examining Area 1's summary link advertisements by the above
8582 calculation, Router RT1 will also forward Network N1 traffic
8583 towards RT5. Note that in this example the virtual link enables
8584 Network N1 traffic to be forwarded through the transit area Area
8585 1, but the actual path the data traffic takes does not follow
8586 the virtual link. In other words, virtual links allow transit
8587 traffic to be forwarded through an area, but do not dictate the
8588 precise path that the traffic will take.
8589
8590 16.4. Calculating AS external routes
8591
8592 AS external routes are calculated by examining AS external link
8593 advertisements. Each of the AS external link advertisements is
8594 considered in turn. Most AS external link advertisements
8595 describe routes to specific IP destinations. An AS external
8596 link advertisement can also describe a default route for the
8597 Autonomous System (Destination ID = DefaultDestination,
8598 network/subnet mask = 0x00000000). For each AS external link
8599 advertisement:
8600
8601
8602 (1) If the cost specified by the advertisement is LSInfinity, or
8603 if the advertisement's LS age is equal to MaxAge, then
8604 examine the next advertisement.
8605
8606 (2) If the advertisement was originated by the calculating
8607 router itself, examine the next advertisement.
8608
8609 (3) Call the destination described by the advertisement N. N's
8610 address is obtained by masking the advertisement's Link
8611 State ID with the network/subnet mask contained in the body
8612 of the advertisement. Look up the routing table entry for
8613 the AS boundary router (ASBR) that originated the
8614 advertisement. If no entry exists for router ASBR (i.e.,
8615 ASBR is unreachable), do nothing with this advertisement and
8616 consider the next in the list.
8617
8618
8619
8620 <span class="grey">Moy [Page 154]</span></pre>
8621 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-155" ></span>
8622 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8623
8624
8625 Else, this advertisement describes an AS external path to
8626 destination N. Examine the forwarding address specified in
8627 the AS external link advertisement. This indicates the IP
8628 address to which packets for the destination should be
8629 forwarded. If the forwarding address is set to 0.0.0.0,
8630 packets should be sent to the ASBR itself. Otherwise, look
8631 up the forwarding address in the routing table.[23] An
8632 intra-area or inter-area path must exist to the forwarding
8633 address. If no such path exists, do nothing with the
8634 advertisement and consider the next in the list.
8635
8636 Call the routing table distance to the forwarding address X
8637 (when the forwarding address is set to 0.0.0.0, this is the
8638 distance to the ASBR itself), and the cost specified in the
8639 advertisement Y. X is in terms of the link state metric,
8640 and Y is a type 1 or 2 external metric.
8641
8642 (4) Next, look up the routing table entry for the destination N.
8643 If no entry exists for N, install the AS external path to N,
8644 with next hop equal to the list of next hops to the
8645 forwarding address, and advertising router equal to ASBR.
8646 If the external metric type is 1, then the path-type is set
8647 to type 1 external and the cost is equal to X+Y. If the
8648 external metric type is 2, the path-type is set to type 2
8649 external, the link state component of the route's cost is X,
8650 and the type 2 cost is Y.
8651
8652 (5) Else, if the paths present in the table are not type 1 or
8653 type 2 external paths, do nothing (AS external paths have
8654 the lowest priority).
8655
8656 (6) Otherwise, compare the cost of this new AS external path to
8657 the ones present in the table. Type 1 external paths are
8658 always shorter than type 2 external paths. Type 1 external
8659 paths are compared by looking at the sum of the distance to
8660 the forwarding address and the advertised type 1 metric
8661 (X+Y). Type 2 external paths are compared by looking at the
8662 advertised type 2 metrics, and then if necessary, the
8663 distance to the forwarding addresses.
8664
8665 If the new path is shorter, it replaces the present paths in
8666 the routing table entry. If the new path is the same cost,
8667 it is added to the routing table entry's list of paths.
8668
8669
8670
8671
8672
8673
8674
8675
8676 <span class="grey">Moy [Page 155]</span></pre>
8677 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-156" ></span>
8678 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8679
8680
8681 16.5. Incremental updates -- summary link advertisements
8682
8683 When a new summary link advertisement is received, it is not
8684 necessary to recalculate the entire routing table. Call the
8685 destination described by the summary link advertisement N (N's
8686 address is obtained by masking the advertisement's Link State ID
8687 with the network/subnet mask contained in the body of the
8688 advertisement), and let Area A be the area to which the
8689 advertisement belongs. There are then two separate cases:
8690
8691 Case 1: Area A is the backbone and/or the router is not an area
8692 border router.
8693 In this case, the following calculations must be performed.
8694 First, if there is presently an inter-area route to the
8695 destination N, N's routing table entry is invalidated,
8696 saving the entry's values for later comparisons. Then the
8697 calculation in <a href="#section-16.2">Section 16.2</a> is run again for the single
8698 destination N. In this calculation, all of Area A's summary
8699 link advertisements that describe a route to N are examined.
8700 In addition, if the router is an area border router attached
8701 to one or more transit areas, the calculation in <a href="#section-16.3">Section</a>
8702 <a href="#section-16.3">16.3</a> must be run again for the single destination. If the
8703 results of these calculations have changed the cost/path to
8704 an AS boundary router (as would be the case for a Type 4
8705 summary link advertisement) or to any forwarding addresses,
8706 all AS external link advertisements will have to be
8707 reexamined by rerunning the calculation in <a href="#section-16.4">Section 16.4</a>.
8708 Otherwise, if N is now newly unreachable, the calculation in
8709 <a href="#section-16.4">Section 16.4</a> must be rerun for the single destination N, in
8710 case an alternate external route to N exists.
8711
8712 Case 2: Area A is a transit area and the router is an area
8713 border router.
8714 In this case, the following calculations must be performed.
8715 First, if N's routing table entry presently contains one or
8716 more inter-area paths that utilize the transit area Area A,
8717 these paths should be removed. If this removes all paths
8718 from the routing table entry, the entry should be
8719 invalidated. The entry's old values should be saved for
8720 later comparisons. Next the calculation in <a href="#section-16.3">Section 16.3</a> must
8721 be run again for the single destination N. If the results of
8722 this calculation have caused the cost to N to increase, the
8723 complete routing table calculation must be rerun starting
8724 with the Dijkstra algorithm specified in <a href="#section-16.1">Section 16.1</a>.
8725 Otherwise, if the cost/path to an AS boundary router (as
8726 would be the case for a Type 4 summary link advertisement)
8727 or to any forwarding addresses has changed, all AS external
8728 link advertisements will have to be reexamined by rerunning
8729
8730
8731
8732 <span class="grey">Moy [Page 156]</span></pre>
8733 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-157" ></span>
8734 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8735
8736
8737 the calculation in <a href="#section-16.4">Section 16.4</a>. Otherwise, if N is now
8738 newly unreachable, the calculation in <a href="#section-16.4">Section 16.4</a> must be
8739 rerun for the single destination N, in case an alternate
8740 external route to N exists.
8741
8742 16.6. Incremental updates -- AS external link advertisements
8743
8744 When a new AS external link advertisement is received, it is not
8745 necessary to recalculate the entire routing table. Call the
8746 destination described by the AS external link advertisement N.
8747 N's address is obtained by masking the advertisement's Link
8748 State ID with the network/subnet mask contained in the body of
8749 the advertisement. If there is already an intra-area or inter-
8750 area route to the destination, no recalculation is necessary
8751 (internal routes take precedence).
8752
8753 Otherwise, the procedure in <a href="#section-16.4">Section 16.4</a> will have to be
8754 performed, but only for those AS external link advertisements
8755 whose destination is N. Before this procedure is performed, the
8756 present routing table entry for N should be invalidated.
8757
8758
8759 16.7. Events generated as a result of routing table changes
8760
8761 Changes to routing table entries sometimes cause the OSPF area
8762 border routers to take additional actions. These routers need
8763 to act on the following routing table changes:
8764
8765
8766 o The cost or path type of a routing table entry has changed.
8767 If the destination described by this entry is a Network or
8768 AS boundary router, and this is not simply a change of AS
8769 external routes, new summary link advertisements may have to
8770 be generated (potentially one for each attached area,
8771 including the backbone). See <a href="#section-12.4.3">Section 12.4.3</a> for more
8772 information. If a previously advertised entry has been
8773 deleted, or is no longer advertisable to a particular area,
8774 the advertisement must be flushed from the routing domain by
8775 setting its LS age to MaxAge and reflooding (see <a href="#section-14.1">Section</a>
8776 <a href="#section-14.1">14.1</a>).
8777
8778 o A routing table entry associated with a configured virtual
8779 link has changed. The destination of such a routing table
8780 entry is an area border router. The change indicates a
8781 modification to the virtual link's cost or viability.
8782
8783 If the entry indicates that the area border router is newly
8784 reachable (via TOS 0), the corresponding virtual link is now
8785
8786
8787
8788 <span class="grey">Moy [Page 157]</span></pre>
8789 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-158" ></span>
8790 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8791
8792
8793 operational. An InterfaceUp event should be generated for
8794 the virtual link, which will cause a virtual adjacency to
8795 begin to form (see <a href="#section-10.3">Section 10.3</a>). At this time the virtual
8796 link's IP interface address and the virtual neighbor's
8797 Neighbor IP address are also calculated.
8798
8799 If the entry indicates that the area border router is no
8800 longer reachable (via TOS 0), the virtual link and its
8801 associated adjacency should be destroyed. This means an
8802 InterfaceDown event should be generated for the associated
8803 virtual link.
8804
8805 If the cost of the entry has changed, and there is a fully
8806 established virtual adjacency, a new router links
8807 advertisement for the backbone must be originated. This in
8808 turn may cause further routing table changes.
8809
8810
8811 16.8. Equal-cost multipath
8812
8813 The OSPF protocol maintains multiple equal-cost routes to all
8814 destinations. This can be seen in the steps used above to
8815 calculate the routing table, and in the definition of the
8816 routing table structure.
8817
8818 Each one of the multiple routes will be of the same type
8819 (intra-area, inter-area, type 1 external or type 2 external),
8820 cost, and will have the same associated area. However, each
8821 route specifies a separate next hop and Advertising router.
8822
8823 There is no requirement that a router running OSPF keep track of
8824 all possible equal-cost routes to a destination. An
8825 implementation may choose to keep only a fixed number of routes
8826 to any given destination. This does not affect any of the
8827 algorithms presented in this specification.
8828
8829
8830 16.9. Building the non-zero-TOS portion of the routing table
8831
8832 The OSPF protocol can calculate a different set of routes for
8833 each IP TOS (see <a href="#section-2.4">Section 2.4</a>). Support for TOS-based routing is
8834 optional. TOS-capable and non-TOS-capable routers can be mixed
8835 in an OSPF routing domain. Routers not supporting TOS calculate
8836 only the TOS 0 route to each destination. These routes are then
8837 used to forward all data traffic, regardless of the TOS
8838 indications in the data packet's IP header. A router that does
8839 not support TOS indicates this fact to the other OSPF routers by
8840 clearing the T-bit in the Options field of its router links
8841
8842
8843
8844 <span class="grey">Moy [Page 158]</span></pre>
8845 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-159" ></span>
8846 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8847
8848
8849 advertisement.
8850
8851 The above sections detailing the routing table calculations
8852 handle the TOS 0 case only. In general, for routers supporting
8853 TOS-based routing, each piece of the routing table calculation
8854 must be rerun separately for the non-zero TOS values. When
8855 calculating routes for TOS X, only TOS X metrics can be used.
8856 Any link state advertisement may specify a separate cost for
8857 each TOS (a cost for TOS 0 must always be specified). The
8858 encoding of TOS in OSPF link state advertisements is described
8859 in <a href="#section-12.3">Section 12.3</a>.
8860
8861 An advertisement can specify that it is restricted to TOS 0
8862 (i.e., non-zero TOS is not handled) by clearing the T-bit in the
8863 link state advertisement's Option field. Such advertisements
8864 are not used when calculating routes for non-zero TOS. For this
8865 reason, it is possible that a destination is unreachable for
8866 some non-zero TOS. In this case, the TOS 0 path is used when
8867 forwarding packets (see <a href="#section-11.1">Section 11.1</a>).
8868
8869 The following lists the modifications needed when running the
8870 routing table calculation for a non-zero TOS value (called TOS
8871 X). In general, routers and advertisements that do not support
8872 TOS are omitted from the calculation.
8873
8874
8875 Calculating the shortest-path tree (Section 16.1).
8876 Routers that do not support TOS-based routing should be
8877 omitted from the shortest-path tree calculation. These
8878 routers are identified as those having the T-bit reset in
8879 the Options field of their router links advertisements.
8880 Such routers should never be added to the Dijktra
8881 algorithm's candidate list, nor should their router links
8882 advertisements be examined when adding the stub networks to
8883 the tree. In particular, if the T-bit is reset in the
8884 calculating router's own router links advertisement, it does
8885 not run the shortest-path tree calculation for non-zero TOS
8886 values.
8887
8888 Calculating the inter-area routes (Section 16.2).
8889 Inter-area paths are the concatenation of a path to an area
8890 border router with a summary link. When calculating TOS X
8891 routes, both path components must also specify TOS X. In
8892 other words, only TOS X paths to the area border router are
8893 examined, and the area border router must be advertising a
8894 TOS X route to the destination. Note that this means that
8895 summary link advertisements having the T-bit reset in their
8896 Options field are not considered.
8897
8898
8899
8900 <span class="grey">Moy [Page 159]</span></pre>
8901 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-160" ></span>
8902 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8903
8904
8905 Examining transit areas' summary links (<a href="#section-16.3">Section 16.3</a>).
8906 This calculation again considers the concatenation of a path
8907 to an area border router with a summary link. As with
8908 inter-area routes, only TOS X paths to the area border
8909 router are examined, and the area border router must be
8910 advertising a TOS X route to the destination.
8911
8912 Calculating AS external routes (<a href="#section-16.4">Section 16.4</a>).
8913 This calculation considers the concatenation of a path to a
8914 forwarding address with an AS external link. Only TOS X
8915 paths to the forwarding address are examined, and the AS
8916 boundary router must be advertising a TOS X route to the
8917 destination. Note that this means that AS external link
8918 advertisements having the T-bit reset in their Options field
8919 are not considered.
8920
8921 In addition, the advertising AS boundary router must also be
8922 reachable for its advertisements to be considered (see
8923 <a href="#section-16.4">Section 16.4</a>). However, if the advertising router and the
8924 forwarding address are not one in the same, the advertising
8925 router need only be reachable via TOS 0.
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956 <span class="grey">Moy [Page 160]</span></pre>
8957 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-161" ></span>
8958 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
8959
8960
8961 Footnotes
8962
8963
8964 [1]The graph's vertices represent either routers, transit networks,
8965 or stub networks. Since routers may belong to multiple areas, it is
8966 not possible to color the graph's vertices.
8967
8968 [2]It is possible for all of a router's interfaces to be unnumbered
8969 point-to-point links. In this case, an IP address must be assigned
8970 to the router. This address will then be advertised in the router's
8971 router links advertisement as a host route.
8972
8973 [3]Note that in these cases both interfaces, the non-virtual and the
8974 virtual, would have the same IP address.
8975
8976 [4]Note that no host route is generated for, and no IP packets can
8977 be addressed to, interfaces to unnumbered point-to-point networks.
8978 This is regardless of such an interface's state.
8979
8980 [5]It is instructive to see what happens when the Designated Router
8981 for the network crashes. Call the Designated Router for the network
8982 RT1, and the Backup Designated Router RT2. If Router RT1 crashes
8983 (or maybe its interface to the network dies), the other routers on
8984 the network will detect RT1's absence within RouterDeadInterval
8985 seconds. All routers may not detect this at precisely the same
8986 time; the routers that detect RT1's absence before RT2 does will,
8987 for a time, select RT2 to be both Designated Router and Backup
8988 Designated Router. When RT2 detects that RT1 is gone it will move
8989 itself to Designated Router. At this time, the remaining router
8990 having highest Router Priority will be selected as Backup Designated
8991 Router.
8992
8993 [6]On point-to-point networks, the lower level protocols indicate
8994 whether the neighbor is up and running. Likewise, existence of the
8995 neighbor on virtual links is indicated by the routing table
8996 calculation. However, in both these cases, the Hello Protocol is
8997 still used. This ensures that communication between the neighbors
8998 is bidirectional, and that each of the neighbors has a functioning
8999 routing protocol layer.
9000
9001 [7]When the identity of the Designated Router is changing, it may be
9002 quite common for a neighbor in this state to send the router a
9003 Database Description packet; this means that there is some momentary
9004 disagreement on the Designated Router's identity.
9005
9006 [8]Note that it is possible for a router to resynchronize any of its
9007 fully established adjacencies by setting the adjacency's state back
9008 to ExStart. This will cause the other end of the adjacency to
9009
9010
9011
9012 <span class="grey">Moy [Page 161]</span></pre>
9013 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-162" ></span>
9014 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9015
9016
9017 process a SeqNumberMismatch event, and therefore to also go back to
9018 ExStart state.
9019
9020 [9]The address space of IP networks and the address space of OSPF
9021 Router IDs may overlap. That is, a network may have an IP address
9022 which is identical (when considered as a 32-bit number) to some
9023 router's Router ID.
9024
9025 [10]It is assumed that, for two different address ranges matching
9026 the destination, one range is more specific than the other. Non-
9027 contiguous subnet masks can be configured to violate this
9028 assumption. Such subnet mask configurations cannot be handled by the
9029 OSPF protocol.
9030
9031 [11]MaxAgeDiff is an architectural constant. It indicates the
9032 maximum dispersion of ages, in seconds, that can occur for a single
9033 link state instance as it is flooded throughout the routing domain.
9034 If two advertisements differ by more than this, they are assumed to
9035 be different instances of the same advertisement. This can occur
9036 when a router restarts and loses track of the advertisement's
9037 previous LS sequence number. See <a href="#section-13.4">Section 13.4</a> for more details.
9038
9039 [12]When two advertisements have different LS checksums, they are
9040 assumed to be separate instances. This can occur when a router
9041 restarts, and loses track of the advertisement's previous LS
9042 sequence number. In the case where the two advertisements have the
9043 same LS sequence number, it is not possible to determine which link
9044 state is actually newer. If the wrong advertisement is accepted as
9045 newer, the originating router will originate another instance. See
9046 <a href="#section-13.4">Section 13.4</a> for further details.
9047
9048 [13]There is one instance where a lookup must be done based on
9049 partial information. This is during the routing table calculation,
9050 when a network links advertisement must be found based solely on its
9051 Link State ID. The lookup in this case is still well defined, since
9052 no two network links advertisements can have the same Link State ID.
9053
9054 [14]This clause covers the case: Inter-area routes are not
9055 summarized to the backbone. This is because inter-area routes are
9056 always associated with the backbone area.
9057
9058 [15]This clause is only invoked when Area A is a Transit area
9059 supporting one or more virtual links. For example, in the area
9060 configuration of Figure 6, Router RT11 need only originate a single
9061 summary link having the (collapsed) destination N9-N11,H1 into its
9062 connected Transit area Area 2, since all of its other eligible
9063 routes have next hops belonging to Area 2 (and as such only need be
9064 advertised by other area border routers; in this case, Routers RT10
9065
9066
9067
9068 <span class="grey">Moy [Page 162]</span></pre>
9069 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-163" ></span>
9070 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9071
9072
9073 and RT7).
9074
9075 [16]By keeping more information in the routing table, it is possible
9076 for an implementation to recalculate the shortest path tree only for
9077 a single area. In fact, there are incremental algorithms that allow
9078 an implementation to recalculate only a portion of a single area's
9079 shortest path tree [<a href="#ref-BBN" title="&quot;ARPANET Routing Algorithm Improvements&quot;">BBN</a>]. However, these algorithms are beyond the
9080 scope of this specification.
9081
9082 [17]This is how the Link state request list is emptied, which
9083 eventually causes the neighbor state to transition to Full. See
9084 <a href="#section-10.9">Section 10.9</a> for more details.
9085
9086 [18]It should be a relatively rare occurrence for an advertisement's
9087 LS age to reach MaxAge in this fashion. Usually, the advertisement
9088 will be replaced by a more recent instance before it ages out.
9089
9090 [19]Only the TOS 0 routes are important here because all OSPF
9091 protocol packets are sent with TOS = 0. See <a href="#appendix-A">Appendix A</a>.
9092
9093 [20]It may be the case that paths to certain destinations do not
9094 vary based on TOS. For these destinations, the routing calculation
9095 need not be repeated for each TOS value. In addition, there need
9096 only be a single routing table entry for these destinations (instead
9097 of a separate entry for each TOS value).
9098
9099 [21]Strictly speaking, because of equal-cost multipath, the
9100 algorithm does not create a tree. We continue to use the "tree"
9101 terminology because that is what occurs most often in the existing
9102 literature.
9103
9104 [22]Note that the presence of any link back to V is sufficient; it
9105 need not be the matching half of the link under consideration from V
9106 to W. This is enough to ensure that, before data traffic flows
9107 between a pair of neighboring routers, their link state databases
9108 will be synchronized.
9109
9110 [23]When the forwarding address is non-zero, it should point to a
9111 router belonging to another Autonomous System. See <a href="#section-12.4.5">Section 12.4.5</a>
9112 for more details.
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124 <span class="grey">Moy [Page 163]</span></pre>
9125 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-164" ></span>
9126 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9127
9128
9129 References
9130
9131 [<a id="ref-BBN">BBN</a>] McQuillan, J., I. Richer and E. Rosen, "ARPANET
9132 Routing Algorithm Improvements", BBN Technical
9133 Report 3803, April 1978.
9134
9135 [<a id="ref-DEC">DEC</a>] Digital Equipment Corporation, "Information
9136 processing systems -- Data communications --
9137 Intermediate System to Intermediate System Intra-
9138 Domain Routing Protocol", October 1987.
9139
9140 [<a id="ref-McQuillan">McQuillan</a>] McQuillan, J. et.al., "The New Routing Algorithm for
9141 the Arpanet", IEEE Transactions on Communications,
9142 May 1980.
9143
9144 [<a id="ref-Perlman">Perlman</a>] Perlman, R., "Fault-Tolerant Broadcast of Routing
9145 Information", Computer Networks, December 1983.
9146
9147 [<a id="ref-RFC 791">RFC 791</a>] Postel, J., "Internet Protocol", STD 5, <a href="./rfc791">RFC 791</a>,
9148 USC/Information Sciences Institute, September 1981.
9149
9150 [<a id="ref-RFC 905">RFC 905</a>] McKenzie, A., "ISO Transport Protocol specification
9151 ISO DP 8073", <a href="./rfc905">RFC 905</a>, ISO, April 1984.
9152
9153 [<a id="ref-RFC 1112">RFC 1112</a>] Deering, S., "Host extensions for IP multicasting",
9154 STD 5, <a href="./rfc1112">RFC 1112</a>, Stanford University, May 1988.
9155
9156 [<a id="ref-RFC 1213">RFC 1213</a>] McCloghrie, K., and M. Rose, "Management Information
9157 Base for network management of TCP/IP-based
9158 internets: MIB-II", STD 17, <a href="./rfc1213">RFC 1213</a>, Hughes LAN
9159 Systems, Performance Systems International, March
9160 1991.
9161
9162 [<a id="ref-RFC 1247">RFC 1247</a>] Moy, J., "OSPF Version 2", <a href="./rfc1247">RFC 1247</a>, Proteon, Inc.,
9163 July 1991.
9164
9165 [<a id="ref-RFC 1519">RFC 1519</a>] Fuller, V., T. Li, J. Yu, and K. Varadhan,
9166 "Classless Inter-Domain Routing (CIDR): an Address
9167 Assignment and Aggregation Strategy", <a href="./rfc1519">RFC1519</a>,
9168 BARRNet, cisco, MERIT, OARnet, September 1993.
9169
9170 [<a id="ref-RFC 1340">RFC 1340</a>] Reynolds, J., and J. Postel, "Assigned Numbers", STD
9171 2, <a href="./rfc1340">RFC 1340</a>, USC/Information Sciences Institute,
9172 July 1992.
9173
9174 [<a id="ref-RFC 1349">RFC 1349</a>] Almquist, P., "Type of Service in the Internet
9175 Protocol Suite", <a href="./rfc1349">RFC 1349</a>, July 1992.
9176
9177
9178
9179
9180 <span class="grey">Moy [Page 164]</span></pre>
9181 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-165" ></span>
9182 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9183
9184
9185 [<a id="ref-RS-85-153">RS-85-153</a>] Leiner, B., et.al., "The DARPA Internet Protocol
9186 Suite", DDN Protocol Handbook, April 1985.
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236 <span class="grey">Moy [Page 165]</span></pre>
9237 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-166" ></span>
9238 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9239
9240
9241 <span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">A</a>. OSPF data formats</span>
9242
9243 This appendix describes the format of OSPF protocol packets and OSPF
9244 link state advertisements. The OSPF protocol runs directly over the
9245 IP network layer. Before any data formats are described, the
9246 details of the OSPF encapsulation are explained.
9247
9248 Next the OSPF Options field is described. This field describes
9249 various capabilities that may or may not be supported by pieces of
9250 the OSPF routing domain. The OSPF Options field is contained in OSPF
9251 Hello packets, Database Description packets and in OSPF link state
9252 advertisements.
9253
9254 OSPF packet formats are detailed in Section A.3. A description of
9255 OSPF link state advertisements appears in Section A.4.
9256
9257 <span class="h3"><a class="selflink" id="appendix-A.1" href="#appendix-A.1">A.1</a> Encapsulation of OSPF packets</span>
9258
9259 OSPF runs directly over the Internet Protocol's network layer. OSPF
9260 packets are therefore encapsulated solely by IP and local data-link
9261 headers.
9262
9263 OSPF does not define a way to fragment its protocol packets, and
9264 depends on IP fragmentation when transmitting packets larger than
9265 the network MTU. The OSPF packet types that are likely to be large
9266 (Database Description Packets, Link State Request, Link State
9267 Update, and Link State Acknowledgment packets) can usually be split
9268 into several separate protocol packets, without loss of
9269 functionality. This is recommended; IP fragmentation should be
9270 avoided whenever possible. Using this reasoning, an attempt should
9271 be made to limit the sizes of packets sent over virtual links to 576
9272 bytes. However, if necessary, the length of OSPF packets can be up
9273 to 65,535 bytes (including the IP header).
9274
9275 The other important features of OSPF's IP encapsulation are:
9276
9277 o Use of IP multicast. Some OSPF messages are multicast, when
9278 sent over multi-access networks. Two distinct IP multicast
9279 addresses are used. Packets sent to these multicast addresses
9280 should never be forwarded; they are meant to travel a single hop
9281 only. To ensure that these packets will not travel multiple
9282 hops, their IP TTL must be set to 1.
9283
9284 AllSPFRouters
9285 This multicast address has been assigned the value
9286 224.0.0.5. All routers running OSPF should be prepared to
9287 receive packets sent to this address. Hello packets are
9288 always sent to this destination. Also, certain OSPF
9289
9290
9291
9292 <span class="grey">Moy [Page 166]</span></pre>
9293 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-167" ></span>
9294 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9295
9296
9297 protocol packets are sent to this address during the
9298 flooding procedure.
9299
9300 AllDRouters
9301 This multicast address has been assigned the value
9302 224.0.0.6. Both the Designated Router and Backup Designated
9303 Router must be prepared to receive packets destined to this
9304 address. Certain OSPF protocol packets are sent to this
9305 address during the flooding procedure.
9306
9307 o OSPF is IP protocol number 89. This number has been registered
9308 with the Network Information Center. IP protocol number
9309 assignments are documented in [<a href="./rfc1340">RFC 1340</a>].
9310
9311 o Routing protocol packets are sent with IP TOS of 0. The OSPF
9312 protocol supports TOS-based routing. Routes to any particular
9313 destination may vary based on TOS. However, all OSPF routing
9314 protocol packets are sent using the normal service TOS value of
9315 binary 0000 defined in [<a href="./rfc1349">RFC 1349</a>].
9316
9317 o Routing protocol packets are sent with IP precedence set to
9318 Internetwork Control. OSPF protocol packets should be given
9319 precedence over regular IP data traffic, in both sending and
9320 receiving. Setting the IP precedence field in the IP header to
9321 Internetwork Control [<a href="./rfc791">RFC 791</a>] may help implement this
9322 objective.
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348 <span class="grey">Moy [Page 167]</span></pre>
9349 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-168" ></span>
9350 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9351
9352
9353 <span class="h3"><a class="selflink" id="appendix-A.2" href="#appendix-A.2">A.2</a> The Options field</span>
9354
9355 The OSPF Options field is present in OSPF Hello packets, Database
9356 Description packets and all link state advertisements. The Options
9357 field enables OSPF routers to support (or not support) optional
9358 capabilities, and to communicate their capability level to other
9359 OSPF routers. Through this mechanism routers of differing
9360 capabilities can be mixed within an OSPF routing domain.
9361
9362 When used in Hello packets, the Options field allows a router to
9363 reject a neighbor because of a capability mismatch. Alternatively,
9364 when capabilities are exchanged in Database Description packets a
9365 router can choose not to forward certain link state advertisements
9366 to a neighbor because of its reduced functionality. Lastly, listing
9367 capabilities in link state advertisements allows routers to route
9368 traffic around reduced functionality routers, by excluding them from
9369 parts of the routing table calculation.
9370
9371 Two capabilities are currently defined. For each capability, the
9372 effect of the capability's appearance (or lack of appearance) in
9373 Hello packets, Database Description packets and link state
9374 advertisements is specified below. For example, the
9375 ExternalRoutingCapability (below called the E-bit) has meaning only
9376 in OSPF Hello Packets. Routers should reset (i.e. clear) the
9377 unassigned part of the capability field when sending Hello packets
9378 or Database Description packets and when originating link state
9379 advertisements.
9380
9381 Additional capabilities may be assigned in the future. Routers
9382 encountering unrecognized capabilities in received Hello Packets,
9383 Database Description packets or link state advertisements should
9384 ignore the capability and process the packet/advertisement normally.
9385
9386 +-+-+-+-+-+-+-+-+
9387 | | | | | | |E|T|
9388 +-+-+-+-+-+-+-+-+
9389
9390 The Options field
9391
9392
9393 T-bit
9394 This describes the router's TOS capability. If the T-bit is
9395 reset, then the router supports only a single TOS (TOS 0). Such
9396 a router is also said to be incapable of TOS-routing, and
9397 elsewhere in this document referred to as a TOS-0-only router.
9398 The absence of the T-bit in a router links advertisement causes
9399 the router to be skipped when building a non-zero TOS shortest-
9400 path tree (see <a href="#section-16.9">Section 16.9</a>). In other words, routers incapable
9401
9402
9403
9404 <span class="grey">Moy [Page 168]</span></pre>
9405 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-169" ></span>
9406 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9407
9408
9409 of TOS routing will be avoided as much as possible when
9410 forwarding data traffic requesting a non-zero TOS. The absence
9411 of the T-bit in a summary link advertisement or an AS external
9412 link advertisement indicates that the advertisement is
9413 describing a TOS 0 route only (and not routes for non-zero TOS).
9414
9415 E-bit
9416 This bit reflects the associated area's
9417 ExternalRoutingCapability. AS external link advertisements are
9418 not flooded into/through OSPF stub areas (see <a href="#section-3.6">Section 3.6</a>). The
9419 E-bit ensures that all members of a stub area agree on that
9420 area's configuration. The E-bit is meaningful only in OSPF
9421 Hello packets. When the E-bit is reset in the Hello packet sent
9422 out a particular interface, it means that the router will
9423 neither send nor receive AS external link state advertisements
9424 on that interface (in other words, the interface connects to a
9425 stub area). Two routers will not become neighbors unless they
9426 agree on the state of the E-bit.
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460 <span class="grey">Moy [Page 169]</span></pre>
9461 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-170" ></span>
9462 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9463
9464
9465 <span class="h3"><a class="selflink" id="appendix-A.3" href="#appendix-A.3">A.3</a> OSPF Packet Formats</span>
9466
9467 There are five distinct OSPF packet types. All OSPF packet types
9468 begin with a standard 24 byte header. This header is described
9469 first. Each packet type is then described in a succeeding section.
9470 In these sections each packet's division into fields is displayed,
9471 and then the field definitions are enumerated.
9472
9473 All OSPF packet types (other than the OSPF Hello packets) deal with
9474 lists of link state advertisements. For example, Link State Update
9475 packets implement the flooding of advertisements throughout the OSPF
9476 routing domain. Because of this, OSPF protocol packets cannot be
9477 parsed unless the format of link state advertisements is also
9478 understood. The format of Link state advertisements is described in
9479 Section A.4.
9480
9481 The receive processing of OSPF packets is detailed in <a href="#section-8.2">Section 8.2</a>.
9482 The sending of OSPF packets is explained in <a href="#section-8.1">Section 8.1</a>.
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516 <span class="grey">Moy [Page 170]</span></pre>
9517 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-171" ></span>
9518 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9519
9520
9521 <span class="h4"><a class="selflink" id="appendix-A.3.1" href="#appendix-A.3.1">A.3.1</a> The OSPF packet header</span>
9522
9523 Every OSPF packet starts with a common 24 byte header. This header
9524 contains all the necessary information to determine whether the
9525 packet should be accepted for further processing. This
9526 determination is described in <a href="#section-8.2">Section 8.2</a> of the specification.
9527
9528
9529 0 1 2 3
9530 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
9531 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9532 | Version # | Type | Packet length |
9533 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9534 | Router ID |
9535 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9536 | Area ID |
9537 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9538 | Checksum | AuType |
9539 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9540 | Authentication |
9541 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9542 | Authentication |
9543 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9544
9545
9546
9547 Version #
9548 The OSPF version number. This specification documents version 2
9549 of the protocol.
9550
9551 Type
9552 The OSPF packet types are as follows. The format of each of
9553 these packet types is described in a succeeding section.
9554
9555
9556
9557 Type Description
9558 ________________________________
9559 1 Hello
9560 2 Database Description
9561 3 Link State Request
9562 4 Link State Update
9563 5 Link State Acknowledgment
9564
9565
9566
9567
9568
9569
9570
9571
9572 <span class="grey">Moy [Page 171]</span></pre>
9573 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-172" ></span>
9574 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9575
9576
9577 Packet length
9578 The length of the protocol packet in bytes. This length
9579 includes the standard OSPF header.
9580
9581 Router ID
9582 The Router ID of the packet's source. In OSPF, the source and
9583 destination of a routing protocol packet are the two ends of an
9584 (potential) adjacency.
9585
9586 Area ID
9587 A 32 bit number identifying the area that this packet belongs
9588 to. All OSPF packets are associated with a single area. Most
9589 travel a single hop only. Packets travelling over a virtual
9590 link are labelled with the backbone Area ID of 0.0.0.0.
9591
9592 Checksum
9593 The standard IP checksum of the entire contents of the packet,
9594 starting with the OSPF packet header but excluding the 64-bit
9595 authentication field. This checksum is calculated as the 16-bit
9596 one's complement of the one's complement sum of all the 16-bit
9597 words in the packet, excepting the authentication field. If the
9598 packet's length is not an integral number of 16-bit words, the
9599 packet is padded with a byte of zero before checksumming.
9600
9601 AuType
9602 Identifies the authentication scheme to be used for the packet.
9603 Authentication is discussed in <a href="#appendix-D">Appendix D</a> of the specification.
9604 Consult <a href="#appendix-D">Appendix D</a> for a list of the currently defined
9605 authentication types.
9606
9607 Authentication
9608 A 64-bit field for use by the authentication scheme.
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628 <span class="grey">Moy [Page 172]</span></pre>
9629 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-173" ></span>
9630 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9631
9632
9633 <span class="h4"><a class="selflink" id="appendix-A.3.2" href="#appendix-A.3.2">A.3.2</a> The Hello packet</span>
9634
9635 Hello packets are OSPF packet type 1. These packets are sent
9636 periodically on all interfaces (including virtual links) in order to
9637 establish and maintain neighbor relationships. In addition, Hello
9638 Packets are multicast on those physical networks having a multicast
9639 or broadcast capability, enabling dynamic discovery of neighboring
9640 routers.
9641
9642 All routers connected to a common network must agree on certain
9643 parameters (Network mask, HelloInterval and RouterDeadInterval).
9644 These parameters are included in Hello packets, so that differences
9645 can inhibit the forming of neighbor relationships. A detailed
9646 explanation of the receive processing for Hello packets is presented
9647 in <a href="#section-10.5">Section 10.5</a>. The sending of Hello packets is covered in <a href="#section-9.5">Section</a>
9648 <a href="#section-9.5">9.5</a>.
9649
9650
9651 0 1 2 3
9652 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
9653 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9654 | Version # | 1 | Packet length |
9655 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9656 | Router ID |
9657 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9658 | Area ID |
9659 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9660 | Checksum | AuType |
9661 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9662 | Authentication |
9663 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9664 | Authentication |
9665 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9666 | Network Mask |
9667 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9668 | HelloInterval | Options | Rtr Pri |
9669 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9670 | RouterDeadInterval |
9671 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9672 | Designated Router |
9673 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9674 | Backup Designated Router |
9675 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9676 | Neighbor |
9677 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9678 | ... |
9679
9680
9681
9682
9683
9684 <span class="grey">Moy [Page 173]</span></pre>
9685 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-174" ></span>
9686 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9687
9688
9689 Network mask
9690 The network mask associated with this interface. For example,
9691 if the interface is to a class B network whose third byte is
9692 used for subnetting, the network mask is 0xffffff00.
9693
9694 Options
9695 The optional capabilities supported by the router, as documented
9696 in Section A.2.
9697
9698 HelloInterval
9699 The number of seconds between this router's Hello packets.
9700
9701 Rtr Pri
9702 This router's Router Priority. Used in (Backup) Designated
9703 Router election. If set to 0, the router will be ineligible to
9704 become (Backup) Designated Router.
9705
9706 RouterDeadInterval
9707 The number of seconds before declaring a silent router down.
9708
9709 Designated Router
9710 The identity of the Designated Router for this network, in the
9711 view of the advertising router. The Designated Router is
9712 identified here by its IP interface address on the network. Set
9713 to 0.0.0.0 if there is no Designated Router.
9714
9715 Backup Designated Router
9716 The identity of the Backup Designated Router for this network,
9717 in the view of the advertising router. The Backup Designated
9718 Router is identified here by its IP interface address on the
9719 network. Set to 0.0.0.0 if there is no Backup Designated
9720 Router.
9721
9722 Neighbor
9723 The Router IDs of each router from whom valid Hello packets have
9724 been seen recently on the network. Recently means in the last
9725 RouterDeadInterval seconds.
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740 <span class="grey">Moy [Page 174]</span></pre>
9741 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-175" ></span>
9742 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9743
9744
9745 <span class="h4"><a class="selflink" id="appendix-A.3.3" href="#appendix-A.3.3">A.3.3</a> The Database Description packet</span>
9746
9747 Database Description packets are OSPF packet type 2. These packets
9748 are exchanged when an adjacency is being initialized. They describe
9749 the contents of the topological database. Multiple packets may be
9750 used to describe the database. For this purpose a poll-response
9751 procedure is used. One of the routers is designated to be master,
9752 the other a slave. The master sends Database Description packets
9753 (polls) which are acknowledged by Database Description packets sent
9754 by the slave (responses). The responses are linked to the polls via
9755 the packets' DD sequence numbers.
9756
9757
9758 0 1 2 3
9759 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
9760 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9761 | Version # | 2 | Packet length |
9762 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9763 | Router ID |
9764 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9765 | Area ID |
9766 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9767 | Checksum | AuType |
9768 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9769 | Authentication |
9770 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9771 | Authentication |
9772 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9773 | 0 | 0 | Options |0|0|0|0|0|I|M|MS
9774 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9775 | DD sequence number |
9776 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9777 | |
9778 +- -+
9779 | A |
9780 +- Link State Advertisement -+
9781 | Header |
9782 +- -+
9783 | |
9784 +- -+
9785 | |
9786 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9787 | ... |
9788
9789
9790 The format of the Database Description packet is very similar to
9791 both the Link State Request and Link State Acknowledgment packets.
9792 The main part of all three is a list of items, each item describing
9793
9794
9795
9796 <span class="grey">Moy [Page 175]</span></pre>
9797 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-176" ></span>
9798 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9799
9800
9801 a piece of the topological database. The sending of Database
9802 Description Packets is documented in <a href="#section-10.8">Section 10.8</a>. The reception of
9803 Database Description packets is documented in <a href="#section-10.6">Section 10.6</a>.
9804
9805 0 These fields are reserved. They must be 0.
9806
9807 Options
9808 The optional capabilities supported by the router, as documented
9809 in Section A.2.
9810
9811 I-bit
9812 The Init bit. When set to 1, this packet is the first in the
9813 sequence of Database Description Packets.
9814
9815 M-bit
9816 The More bit. When set to 1, it indicates that more Database
9817 Description Packets are to follow.
9818
9819 MS-bit
9820 The Master/Slave bit. When set to 1, it indicates that the
9821 router is the master during the Database Exchange process.
9822 Otherwise, the router is the slave.
9823
9824 DD sequence number
9825 Used to sequence the collection of Database Description Packets.
9826 The initial value (indicated by the Init bit being set) should
9827 be unique. The DD sequence number then increments until the
9828 complete database description has been sent.
9829
9830
9831 The rest of the packet consists of a (possibly partial) list of the
9832 topological database's pieces. Each link state advertisement in the
9833 database is described by its link state advertisement header. The
9834 link state advertisement header is documented in Section A.4.1. It
9835 contains all the information required to uniquely identify both the
9836 advertisement and the advertisement's current instance.
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852 <span class="grey">Moy [Page 176]</span></pre>
9853 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-177" ></span>
9854 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9855
9856
9857 <span class="h4"><a class="selflink" id="appendix-A.3.4" href="#appendix-A.3.4">A.3.4</a> The Link State Request packet</span>
9858
9859 Link State Request packets are OSPF packet type 3. After exchanging
9860 Database Description packets with a neighboring router, a router may
9861 find that parts of its topological database are out of date. The
9862 Link State Request packet is used to request the pieces of the
9863 neighbor's database that are more up to date. Multiple Link State
9864 Request packets may need to be used. The sending of Link State
9865 Request packets is the last step in bringing up an adjacency.
9866
9867 A router that sends a Link State Request packet has in mind the
9868 precise instance of the database pieces it is requesting, defined by
9869 LS sequence number, LS checksum, and LS age, although these fields
9870 are not specified in the Link State Request Packet itself. The
9871 router may receive even more recent instances in response.
9872
9873 The sending of Link State Request packets is documented in <a href="#section-10.9">Section</a>
9874 <a href="#section-10.9">10.9</a>. The reception of Link State Request packets is documented in
9875 <a href="#section-10.7">Section 10.7</a>.
9876
9877
9878 0 1 2 3
9879 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
9880 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9881 | Version # | 3 | Packet length |
9882 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9883 | Router ID |
9884 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9885 | Area ID |
9886 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9887 | Checksum | AuType |
9888 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9889 | Authentication |
9890 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9891 | Authentication |
9892 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9893 | LS type |
9894 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9895 | Link State ID |
9896 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9897 | Advertising Router |
9898 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9899 | ... |
9900
9901
9902 Each advertisement requested is specified by its LS type, Link State
9903 ID, and Advertising Router. This uniquely identifies the
9904 advertisement, but not its instance. Link State Request packets are
9905
9906
9907
9908 <span class="grey">Moy [Page 177]</span></pre>
9909 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-178" ></span>
9910 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9911
9912
9913 understood to be requests for the most recent instance (whatever
9914 that might be).
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964 <span class="grey">Moy [Page 178]</span></pre>
9965 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-179" ></span>
9966 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
9967
9968
9969 <span class="h4"><a class="selflink" id="appendix-A.3.5" href="#appendix-A.3.5">A.3.5</a> The Link State Update packet</span>
9970
9971 Link State Update packets are OSPF packet type 4. These packets
9972 implement the flooding of link state advertisements. Each Link
9973 State Update packet carries a collection of link state
9974 advertisements one hop further from its origin. Several link state
9975 advertisements may be included in a single packet.
9976
9977 Link State Update packets are multicast on those physical networks
9978 that support multicast/broadcast. In order to make the flooding
9979 procedure reliable, flooded advertisements are acknowledged in Link
9980 State Acknowledgment packets. If retransmission of certain
9981 advertisements is necessary, the retransmitted advertisements are
9982 always carried by unicast Link State Update packets. For more
9983 information on the reliable flooding of link state advertisements,
9984 consult <a href="#section-13">Section 13</a>.
9985
9986
9987 0 1 2 3
9988 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
9989 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9990 | Version # | 4 | Packet length |
9991 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9992 | Router ID |
9993 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9994 | Area ID |
9995 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9996 | Checksum | AuType |
9997 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
9998 | Authentication |
9999 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10000 | Authentication |
10001 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10002 | # advertisements |
10003 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10004 | |
10005 +- +-+
10006 | Link state advertisements |
10007 +- +-+
10008 | ... |
10009
10010
10011
10012 # advertisements
10013 The number of link state advertisements included in this update.
10014
10015
10016
10017
10018
10019
10020 <span class="grey">Moy [Page 179]</span></pre>
10021 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-180" ></span>
10022 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10023
10024
10025 The body of the Link State Update packet consists of a list of link
10026 state advertisements. Each advertisement begins with a common 20
10027 byte header, the link state advertisement header. This header is
10028 described in Section A.4.1. Otherwise, the format of each of the
10029 five types of link state advertisements is different. Their formats
10030 are described in Section A.4.
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076 <span class="grey">Moy [Page 180]</span></pre>
10077 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-181" ></span>
10078 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10079
10080
10081 <span class="h4"><a class="selflink" id="appendix-A.3.6" href="#appendix-A.3.6">A.3.6</a> The Link State Acknowledgment packet</span>
10082
10083 Link State Acknowledgment Packets are OSPF packet type 5. To make
10084 the flooding of link state advertisements reliable, flooded
10085 advertisements are explicitly acknowledged. This acknowledgment is
10086 accomplished through the sending and receiving of Link State
10087 Acknowledgment packets. Multiple link state advertisements can be
10088 acknowledged in a single Link State Acknowledgment packet.
10089
10090 Depending on the state of the sending interface and the source of
10091 the advertisements being acknowledged, a Link State Acknowledgment
10092 packet is sent either to the multicast address AllSPFRouters, to the
10093 multicast address AllDRouters, or as a unicast. The sending of Link
10094 State Acknowledgement packets is documented in <a href="#section-13.5">Section 13.5</a>. The
10095 reception of Link State Acknowledgement packets is documented in
10096 <a href="#section-13.7">Section 13.7</a>.
10097
10098 The format of this packet is similar to that of the Data Description
10099 packet. The body of both packets is simply a list of link state
10100 advertisement headers.
10101
10102
10103 0 1 2 3
10104 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
10105 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10106 | Version # | 5 | Packet length |
10107 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10108 | Router ID |
10109 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10110 | Area ID |
10111 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10112 | Checksum | AuType |
10113 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10114 | Authentication |
10115 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10116 | Authentication |
10117 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10118 | |
10119 +- -+
10120 | A |
10121 +- Link State Advertisement -+
10122 | Header |
10123 +- -+
10124 | |
10125 +- -+
10126 | |
10127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10128 | ... |
10129
10130
10131
10132 <span class="grey">Moy [Page 181]</span></pre>
10133 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-182" ></span>
10134 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10135
10136
10137 Each acknowledged link state advertisement is described by its link
10138 state advertisement header. The link state advertisement header is
10139 documented in Section A.4.1. It contains all the information
10140 required to uniquely identify both the advertisement and the
10141 advertisement's current instance.
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188 <span class="grey">Moy [Page 182]</span></pre>
10189 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-183" ></span>
10190 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10191
10192
10193 <span class="h3"><a class="selflink" id="appendix-A.4" href="#appendix-A.4">A.4</a> Link state advertisement formats</span>
10194
10195 There are five distinct types of link state advertisements. Each
10196 link state advertisement begins with a standard 20-byte link state
10197 advertisement header. This header is explained in Section A.4.1.
10198 Succeeding sections then diagram the separate link state
10199 advertisement types.
10200
10201 Each link state advertisement describes a piece of the OSPF routing
10202 domain. Every router originates a router links advertisement. In
10203 addition, whenever the router is elected Designated Router, it
10204 originates a network links advertisement. Other types of link state
10205 advertisements may also be originated (see <a href="#section-12.4">Section 12.4</a>). All link
10206 state advertisements are then flooded throughout the OSPF routing
10207 domain. The flooding algorithm is reliable, ensuring that all
10208 routers have the same collection of link state advertisements. (See
10209 <a href="#section-13">Section 13</a> for more information concerning the flooding algorithm).
10210 This collection of advertisements is called the link state (or
10211 topological) database.
10212
10213 From the link state database, each router constructs a shortest path
10214 tree with itself as root. This yields a routing table (see <a href="#section-11">Section</a>
10215 <a href="#section-11">11</a>). For the details of the routing table build process, see
10216 <a href="#section-16">Section 16</a>.
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244 <span class="grey">Moy [Page 183]</span></pre>
10245 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-184" ></span>
10246 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10247
10248
10249 <span class="h4"><a class="selflink" id="appendix-A.4.1" href="#appendix-A.4.1">A.4.1</a> The Link State Advertisement header</span>
10250
10251 All link state advertisements begin with a common 20 byte header.
10252 This header contains enough information to uniquely identify the
10253 advertisement (LS type, Link State ID, and Advertising Router).
10254 Multiple instances of the link state advertisement may exist in the
10255 routing domain at the same time. It is then necessary to determine
10256 which instance is more recent. This is accomplished by examining
10257 the LS age, LS sequence number and LS checksum fields that are also
10258 contained in the link state advertisement header.
10259
10260
10261 0 1 2 3
10262 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
10263 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10264 | LS age | Options | LS type |
10265 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10266 | Link State ID |
10267 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10268 | Advertising Router |
10269 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10270 | LS sequence number |
10271 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10272 | LS checksum | length |
10273 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10274
10275
10276
10277 LS age
10278 The time in seconds since the link state advertisement was
10279 originated.
10280
10281 Options
10282 The optional capabilities supported by the described portion of
10283 the routing domain. OSPF's optional capabilities are documented
10284 in Section A.2.
10285
10286 LS type
10287 The type of the link state advertisement. Each link state type
10288 has a separate advertisement format. The link state types are
10289 as follows (see <a href="#section-12.1.3">Section 12.1.3</a> for further explanation):
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300 <span class="grey">Moy [Page 184]</span></pre>
10301 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-185" ></span>
10302 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10303
10304
10305
10306 LS Type Description
10307 ___________________________________
10308 1 Router links
10309 2 Network links
10310 3 Summary link (IP network)
10311 4 Summary link (ASBR)
10312 5 AS external link
10313
10314
10315
10316
10317 Link State ID
10318 This field identifies the portion of the internet environment
10319 that is being described by the advertisement. The contents of
10320 this field depend on the advertisement's LS type. For example,
10321 in network links advertisements the Link State ID is set to the
10322 IP interface address of the network's Designated Router (from
10323 which the network's IP address can be derived). The Link State
10324 ID is further discussed in <a href="#section-12.1.4">Section 12.1.4</a>.
10325
10326 Advertising Router
10327 The Router ID of the router that originated the link state
10328 advertisement. For example, in network links advertisements
10329 this field is set to the Router ID of the network's Designated
10330 Router.
10331
10332 LS sequence number
10333 Detects old or duplicate link state advertisements. Successive
10334 instances of a link state advertisement are given successive LS
10335 sequence numbers. See <a href="#section-12.1.6">Section 12.1.6</a> for more details.
10336
10337 LS checksum
10338 The Fletcher checksum of the complete contents of the link state
10339 advertisement, including the link state advertisement header but
10340 excepting the LS age field. See <a href="#section-12.1.7">Section 12.1.7</a> for more details.
10341
10342 length
10343 The length in bytes of the link state advertisement. This
10344 includes the 20 byte link state advertisement header.
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356 <span class="grey">Moy [Page 185]</span></pre>
10357 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-186" ></span>
10358 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10359
10360
10361 <span class="h4"><a class="selflink" id="appendix-A.4.2" href="#appendix-A.4.2">A.4.2</a> Router links advertisements</span>
10362
10363 Router links advertisements are the Type 1 link state
10364 advertisements. Each router in an area originates a router links
10365 advertisement. The advertisement describes the state and cost of
10366 the router's links (i.e., interfaces) to the area. All of the
10367 router's links to the area must be described in a single router
10368 links advertisement. For details concerning the construction of
10369 router links advertisements, see <a href="#section-12.4.1">Section 12.4.1</a>.
10370
10371
10372 0 1 2 3
10373 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
10374 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10375 | LS age | Options | 1 |
10376 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10377 | Link State ID |
10378 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10379 | Advertising Router |
10380 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10381 | LS sequence number |
10382 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10383 | LS checksum | length |
10384 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10385 | 0 |V|E|B| 0 | # links |
10386 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10387 | Link ID |
10388 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10389 | Link Data |
10390 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10391 | Type | # TOS | TOS 0 metric |
10392 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10393 | TOS | 0 | metric |
10394 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10395 | ... |
10396 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10397 | TOS | 0 | metric |
10398 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10399 | Link ID |
10400 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10401 | Link Data |
10402 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10403 | ... |
10404
10405
10406 In router links advertisements, the Link State ID field is set to
10407 the router's OSPF Router ID. The T-bit is set in the
10408 advertisement's Option field if and only if the router is able to
10409
10410
10411
10412 <span class="grey">Moy [Page 186]</span></pre>
10413 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-187" ></span>
10414 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10415
10416
10417 calculate a separate set of routes for each IP TOS. Router links
10418 advertisements are flooded throughout a single area only.
10419
10420 bit V
10421 When set, the router is an endpoint of an active virtual link
10422 that is using the described area as a Transit area (V is for
10423 virtual link endpoint).
10424
10425 bit E
10426 When set, the router is an AS boundary router (E is for
10427 external)
10428
10429 bit B
10430 When set, the router is an area border router (B is for border)
10431
10432 # links
10433 The number of router links described by this advertisement.
10434 This must be the total collection of router links (i.e.,
10435 interfaces) to the area.
10436
10437
10438 The following fields are used to describe each router link (i.e.,
10439 interface). Each router link is typed (see the below Type field).
10440 The Type field indicates the kind of link being described. It may
10441 be a link to a transit network, to another router or to a stub
10442 network. The values of all the other fields describing a router
10443 link depend on the link's Type. For example, each link has an
10444 associated 32-bit data field. For links to stub networks this field
10445 specifies the network's IP address mask. For other link types the
10446 Link Data specifies the router's associated IP interface address.
10447
10448
10449 Type
10450 A quick description of the router link. One of the following.
10451 Note that host routes are classified as links to stub networks
10452 whose network mask is 0xffffffff.
10453
10454
10455
10456 Type Description
10457 __________________________________________________
10458 1 Point-to-point connection to another router
10459 2 Connection to a transit network
10460 3 Connection to a stub network
10461 4 Virtual link
10462
10463
10464
10465
10466
10467
10468 <span class="grey">Moy [Page 187]</span></pre>
10469 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-188" ></span>
10470 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10471
10472
10473 Link ID
10474 Identifies the object that this router link connects to. Value
10475 depends on the link's Type. When connecting to an object that
10476 also originates a link state advertisement (i.e., another router
10477 or a transit network) the Link ID is equal to the neighboring
10478 advertisement's Link State ID. This provides the key for
10479 looking up said advertisement in the link state database. See
10480 <a href="#section-12.2">Section 12.2</a> for more details.
10481
10482
10483
10484 Type Link ID
10485 ______________________________________
10486 1 Neighboring router's Router ID
10487 2 IP address of Designated Router
10488 3 IP network/subnet number
10489 4 Neighboring router's Router ID
10490
10491
10492
10493
10494 Link Data
10495 Contents again depend on the link's Type field. For connections
10496 to stub networks, it specifies the network's IP address mask.
10497 For unnumbered point-to-point connections, it specifies the
10498 interface's MIB-II [<a href="./rfc1213">RFC 1213</a>] ifIndex value. For the other link
10499 types it specifies the router's associated IP interface address.
10500 This latter piece of information is needed during the routing
10501 table build process, when calculating the IP address of the next
10502 hop. See <a href="#section-16.1.1">Section 16.1.1</a> for more details.
10503
10504 # TOS
10505 The number of different TOS metrics given for this link, not
10506 counting the required metric for TOS 0. For example, if no
10507 additional TOS metrics are given, this field should be set to 0.
10508
10509 TOS 0 metric
10510 The cost of using this router link for TOS 0.
10511
10512
10513 For each link, separate metrics may be specified for each Type of
10514 Service (TOS). The metric for TOS 0 must always be included, and
10515 was discussed above. Metrics for non-zero TOS are described below.
10516 The encoding of TOS in OSPF link state advertisements is described
10517 in <a href="#section-12.3">Section 12.3</a>. Note that the cost for non-zero TOS values that
10518 are not specified defaults to the TOS 0 cost. Metrics must be
10519 listed in order of increasing TOS encoding. For example, the metric
10520 for TOS 16 must always follow the metric for TOS 8 when both are
10521
10522
10523
10524 <span class="grey">Moy [Page 188]</span></pre>
10525 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-189" ></span>
10526 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10527
10528
10529 specified.
10530
10531
10532 TOS IP Type of Service that this metric refers to. The encoding of
10533 TOS in OSPF link state advertisements is described in <a href="#section-12.3">Section</a>
10534 <a href="#section-12.3">12.3</a>.
10535
10536 metric
10537 The cost of using this outbound router link, for traffic of the
10538 specified TOS.
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580 <span class="grey">Moy [Page 189]</span></pre>
10581 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-190" ></span>
10582 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10583
10584
10585 <span class="h4"><a class="selflink" id="appendix-A.4.3" href="#appendix-A.4.3">A.4.3</a> Network links advertisements</span>
10586
10587 Network links advertisements are the Type 2 link state
10588 advertisements. A network links advertisement is originated for
10589 each transit network in the area. A transit network is a multi-
10590 access network that has more than one attached router. The network
10591 links advertisement is originated by the network's Designated
10592 Router. The advertisement describes all routers attached to the
10593 network, including the Designated Router itself. The
10594 advertisement's Link State ID field lists the IP interface address
10595 of the Designated Router.
10596
10597 The distance from the network to all attached routers is zero, for
10598 all Types of Service. This is why the TOS and metric fields need
10599 not be specified in the network links advertisement. For details
10600 concerning the construction of network links advertisements, see
10601 <a href="#section-12.4.2">Section 12.4.2</a>.
10602
10603
10604 0 1 2 3
10605 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
10606 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10607 | LS age | Options | 2 |
10608 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10609 | Link State ID |
10610 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10611 | Advertising Router |
10612 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10613 | LS sequence number |
10614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10615 | LS checksum | length |
10616 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10617 | Network Mask |
10618 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10619 | Attached Router |
10620 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10621 | ... |
10622
10623
10624
10625 Network Mask
10626 The IP address mask for the network. For example, a class A
10627 network would have the mask 0xff000000.
10628
10629 Attached Router
10630 The Router IDs of each of the routers attached to the network.
10631 Actually, only those routers that are fully adjacent to the
10632 Designated Router are listed. The Designated Router includes
10633
10634
10635
10636 <span class="grey">Moy [Page 190]</span></pre>
10637 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-191" ></span>
10638 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10639
10640
10641 itself in this list. The number of routers included can be
10642 deduced from the link state advertisement header's length field.
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692 <span class="grey">Moy [Page 191]</span></pre>
10693 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-192" ></span>
10694 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10695
10696
10697 <span class="h4"><a class="selflink" id="appendix-A.4.4" href="#appendix-A.4.4">A.4.4</a> Summary link advertisements</span>
10698
10699 Summary link advertisements are the Type 3 and 4 link state
10700 advertisements. These advertisements are originated by area border
10701 routers. A separate summary link advertisement is made for each
10702 destination (known to the router) which belongs to the AS, yet is
10703 outside the area. For details concerning the construction of
10704 summary link advertisements, see <a href="#section-12.4.3">Section 12.4.3</a>.
10705
10706 Type 3 link state advertisements are used when the destination is an
10707 IP network. In this case the advertisement's Link State ID field is
10708 an IP network number (if necessary, the Link State ID can also have
10709 one or more of the network's "host" bits set; see <a href="#appendix-F">Appendix F</a> for
10710 details). When the destination is an AS boundary router, a Type 4
10711 advertisement is used, and the Link State ID field is the AS
10712 boundary router's OSPF Router ID. (To see why it is necessary to
10713 advertise the location of each ASBR, consult <a href="#section-16.4">Section 16.4</a>.) Other
10714 than the difference in the Link State ID field, the format of Type 3
10715 and 4 link state advertisements is identical.
10716
10717
10718 0 1 2 3
10719 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
10720 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10721 | LS age | Options | 3 or 4 |
10722 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10723 | Link State ID |
10724 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10725 | Advertising Router |
10726 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10727 | LS sequence number |
10728 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10729 | LS checksum | length |
10730 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10731 | Network Mask |
10732 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10733 | TOS | metric |
10734 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10735 | ... |
10736
10737
10738 For stub areas, Type 3 summary link advertisements can also be used
10739 to describe a (per-area) default route. Default summary routes are
10740 used in stub areas instead of flooding a complete set of external
10741 routes. When describing a default summary route, the
10742 advertisement's Link State ID is always set to DefaultDestination
10743 (0.0.0.0) and the Network Mask is set to 0.0.0.0.
10744
10745
10746
10747
10748 <span class="grey">Moy [Page 192]</span></pre>
10749 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-193" ></span>
10750 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10751
10752
10753 Separate costs may be advertised for each IP Type of Service. The
10754 encoding of TOS in OSPF link state advertisements is described in
10755 <a href="#section-12.3">Section 12.3</a>. Note that the cost for TOS 0 must be included, and is
10756 always listed first. If the T-bit is reset in the advertisement's
10757 Option field, only a route for TOS 0 is described by the
10758 advertisement. Otherwise, routes for the other TOS values are also
10759 described; if a cost for a certain TOS is not included, its cost
10760 defaults to that specified for TOS 0.
10761
10762 Network Mask
10763 For Type 3 link state advertisements, this indicates the
10764 destination network's IP address mask. For example, when
10765 advertising the location of a class A network the value
10766 0xff000000 would be used. This field is not meaningful and must
10767 be zero for Type 4 link state advertisements.
10768
10769
10770 For each specified Type of Service, the following fields are
10771 defined. The number of TOS routes included can be calculated from
10772 the link state advertisement header's length field. Values for TOS
10773 0 must be specified; they are listed first. Other values must be
10774 listed in order of increasing TOS encoding. For example, the cost
10775 for TOS 16 must always follow the cost for TOS 8 when both are
10776 specified.
10777
10778
10779 TOS The Type of Service that the following cost concerns. The
10780 encoding of TOS in OSPF link state advertisements is described
10781 in <a href="#section-12.3">Section 12.3</a>.
10782
10783 metric
10784 The cost of this route. Expressed in the same units as the
10785 interface costs in the router links advertisements.
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804 <span class="grey">Moy [Page 193]</span></pre>
10805 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-194" ></span>
10806 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10807
10808
10809 <span class="h4"><a class="selflink" id="appendix-A.4.5" href="#appendix-A.4.5">A.4.5</a> AS external link advertisements</span>
10810
10811 AS external link advertisements are the Type 5 link state
10812 advertisements. These advertisements are originated by AS boundary
10813 routers. A separate advertisement is made for each destination
10814 (known to the router) which is external to the AS. For details
10815 concerning the construction of AS external link advertisements, see
10816 <a href="#section-12.4.3">Section 12.4.3</a>.
10817
10818 AS external link advertisements usually describe a particular
10819 external destination. For these advertisements the Link State ID
10820 field specifies an IP network number (if necessary, the Link State
10821 ID can also have one or more of the network's "host" bits set; see
10822 <a href="#appendix-F">Appendix F</a> for details). AS external link advertisements are also
10823 used to describe a default route. Default routes are used when no
10824 specific route exists to the destination. When describing a default
10825 route, the Link State ID is always set to DefaultDestination
10826 (0.0.0.0) and the Network Mask is set to 0.0.0.0.
10827
10828
10829 0 1 2 3
10830 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
10831 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10832 | LS age | Options | 5 |
10833 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10834 | Link State ID |
10835 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10836 | Advertising Router |
10837 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10838 | LS sequence number |
10839 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10840 | LS checksum | length |
10841 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10842 | Network Mask |
10843 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10844 |E| TOS | metric |
10845 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10846 | Forwarding address |
10847 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10848 | External Route Tag |
10849 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10850 | ... |
10851
10852
10853
10854 Separate costs may be advertised for each IP Type of Service. The
10855 encoding of TOS in OSPF link state advertisements is described in
10856 <a href="#section-12.3">Section 12.3</a>. Note that the cost for TOS 0 must be included, and is
10857
10858
10859
10860 <span class="grey">Moy [Page 194]</span></pre>
10861 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-195" ></span>
10862 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10863
10864
10865 always listed first. If the T-bit is reset in the advertisement's
10866 Option field, only a route for TOS 0 is described by the
10867 advertisement. Otherwise, routes for the other TOS values are also
10868 described; if a cost for a certain TOS is not included, its cost
10869 defaults to that specified for TOS 0.
10870
10871 Network Mask
10872 The IP address mask for the advertised destination. For
10873 example, when advertising a class A network the mask 0xff000000
10874 would be used.
10875
10876
10877 For each specified Type of Service, the following fields are
10878 defined. The number of TOS routes included can be calculated from
10879 the link state advertisement header's length field. Values for TOS
10880 0 must be specified; they are listed first. Other values must be
10881 listed in order of increasing TOS encoding. For example, the cost
10882 for TOS 16 must always follow the cost for TOS 8 when both are
10883 specified.
10884
10885
10886 bit E
10887 The type of external metric. If bit E is set, the metric
10888 specified is a Type 2 external metric. This means the metric is
10889 considered larger than any link state path. If bit E is zero,
10890 the specified metric is a Type 1 external metric. This means
10891 that is is comparable directly (without translation) to the link
10892 state metric.
10893
10894 Forwarding address
10895 Data traffic for the advertised destination will be forwarded to
10896 this address. If the Forwarding address is set to 0.0.0.0, data
10897 traffic will be forwarded instead to the advertisement's
10898 originator (i.e., the responsible AS boundary router).
10899
10900 TOS The Type of Service that the following cost concerns. The
10901 encoding of TOS in OSPF link state advertisements is described
10902 in <a href="#section-12.3">Section 12.3</a>.
10903
10904 metric
10905 The cost of this route. Interpretation depends on the external
10906 type indication (bit E above).
10907
10908 External Route Tag
10909 A 32-bit field attached to each external route. This is not
10910 used by the OSPF protocol itself. It may be used to communicate
10911 information between AS boundary routers; the precise nature of
10912 such information is outside the scope of this specification.
10913
10914
10915
10916 <span class="grey">Moy [Page 195]</span></pre>
10917 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-196" ></span>
10918 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10919
10920
10921 <span class="h2"><a class="selflink" id="appendix-B" href="#appendix-B">B</a>. Architectural Constants</span>
10922
10923 Several OSPF protocol parameters have fixed architectural values.
10924 These parameters have been referred to in the text by names such as
10925 LSRefreshTime. The same naming convention is used for the
10926 configurable protocol parameters. They are defined in <a href="#appendix-C">Appendix C</a>.
10927
10928 The name of each architectural constant follows, together with its
10929 value and a short description of its function.
10930
10931
10932 LSRefreshTime
10933 The maximum time between distinct originations of any particular
10934 link state advertisement. When the LS age field of one of the
10935 router's self-originated advertisements reaches the value
10936 LSRefreshTime, a new instance of the link state advertisement is
10937 originated, even though the contents of the advertisement (apart
10938 from the link state header) will be the same. The value of
10939 LSRefreshTime is set to 30 minutes.
10940
10941 MinLSInterval
10942 The minimum time between distinct originations of any particular
10943 link state advertisement. The value of MinLSInterval is set to
10944 5 seconds.
10945
10946 MaxAge
10947 The maximum age that a link state advertisement can attain. When
10948 an advertisement's LS age field reaches MaxAge, it is reflooded
10949 in an attempt to flush the advertisement from the routing domain
10950 (See <a href="#section-14">Section 14</a>). Advertisements of age MaxAge are not used in
10951 the routing table calculation. The value of MaxAge must be
10952 greater than LSRefreshTime. The value of MaxAge is set to 1
10953 hour.
10954
10955 CheckAge
10956 When the age of a link state advertisement (that is contained in
10957 the link state database) hits a multiple of CheckAge, the
10958 advertisement's checksum is verified. An incorrect checksum at
10959 this time indicates a serious error. The value of CheckAge is
10960 set to 5 minutes.
10961
10962 MaxAgeDiff
10963 The maximum time dispersion that can occur, as a link state
10964 advertisement is flooded throughout the AS. Most of this time
10965 is accounted for by the link state advertisements sitting on
10966 router output queues (and therefore not aging) during the
10967 flooding process. The value of MaxAgeDiff is set to 15 minutes.
10968
10969
10970
10971
10972 <span class="grey">Moy [Page 196]</span></pre>
10973 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-197" ></span>
10974 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
10975
10976
10977 LSInfinity
10978 The metric value indicating that the destination described by a
10979 link state advertisement is unreachable. Used in summary link
10980 advertisements and AS external link advertisements as an
10981 alternative to premature aging (see <a href="#section-14.1">Section 14.1</a>). It is defined
10982 to be the 24-bit binary value of all ones: 0xffffff.
10983
10984 DefaultDestination
10985 The Destination ID that indicates the default route. This route
10986 is used when no other matching routing table entry can be found.
10987 The default destination can only be advertised in AS external
10988 link advertisements and in stub areas' type 3 summary link
10989 advertisements. Its value is the IP address 0.0.0.0.
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028 <span class="grey">Moy [Page 197]</span></pre>
11029 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-198" ></span>
11030 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11031
11032
11033 <span class="h2"><a class="selflink" id="appendix-C" href="#appendix-C">C</a>. Configurable Constants</span>
11034
11035 The OSPF protocol has quite a few configurable parameters. These
11036 parameters are listed below. They are grouped into general
11037 functional categories (area parameters, interface parameters, etc.).
11038 Sample values are given for some of the parameters.
11039
11040 Some parameter settings need to be consistent among groups of
11041 routers. For example, all routers in an area must agree on that
11042 area's parameters, and all routers attached to a network must agree
11043 on that network's IP network number and mask.
11044
11045 Some parameters may be determined by router algorithms outside of
11046 this specification (e.g., the address of a host connected to the
11047 router via a SLIP line). From OSPF's point of view, these items are
11048 still configurable.
11049
11050 C.1 Global parameters
11051
11052 In general, a separate copy of the OSPF protocol is run for each
11053 area. Because of this, most configuration parameters are
11054 defined on a per-area basis. The few global configuration
11055 parameters are listed below.
11056
11057
11058 Router ID
11059 This is a 32-bit number that uniquely identifies the router
11060 in the Autonomous System. One algorithm for Router ID
11061 assignment is to choose the largest or smallest IP address
11062 assigned to the router. If a router's OSPF Router ID is
11063 changed, the router's OSPF software should be restarted
11064 before the new Router ID takes effect. Before restarting in
11065 order to change its Router ID, the router should flush its
11066 self-originated link state advertisements from the routing
11067 domain (see <a href="#section-14.1">Section 14.1</a>), or they will persist for up to
11068 MaxAge minutes.
11069
11070 TOS capability
11071 This item indicates whether the router will calculate
11072 separate routes based on TOS. For more information, see
11073 Sections <a href="#section-4.5">4.5</a> and <a href="#section-16.9">16.9</a>.
11074
11075 C.2 Area parameters
11076
11077 All routers belonging to an area must agree on that area's
11078 configuration. Disagreements between two routers will lead to
11079 an inability for adjacencies to form between them, with a
11080 resulting hindrance to the flow of routing protocol and data
11081
11082
11083
11084 <span class="grey">Moy [Page 198]</span></pre>
11085 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-199" ></span>
11086 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11087
11088
11089 traffic. The following items must be configured for an area:
11090
11091
11092 Area ID
11093 This is a 32-bit number that identifies the area. The Area
11094 ID of 0.0.0.0 is reserved for the backbone. If the area
11095 represents a subnetted network, the IP network number of the
11096 subnetted network may be used for the Area ID.
11097
11098 List of address ranges
11099 An OSPF area is defined as a list of address ranges. Each
11100 address range consists of the following items:
11101
11102 [IP address, mask]
11103 Describes the collection of IP addresses contained
11104 in the address range. Networks and hosts are
11105 assigned to an area depending on whether their
11106 addresses fall into one of the area's defining
11107 address ranges. Routers are viewed as belonging to
11108 multiple areas, depending on their attached
11109 networks' area membership.
11110
11111 Status Set to either Advertise or DoNotAdvertise. Routing
11112 information is condensed at area boundaries.
11113 External to the area, at most a single route is
11114 advertised (via a summary link advertisement) for
11115 each address range. The route is advertised if and
11116 only if the address range's Status is set to
11117 Advertise. Unadvertised ranges allow the existence
11118 of certain networks to be intentionally hidden from
11119 other areas. Status is set to Advertise by default.
11120
11121 As an example, suppose an IP subnetted network is to be its
11122 own OSPF area. The area would be configured as a single
11123 address range, whose IP address is the address of the
11124 subnetted network, and whose mask is the natural class A, B,
11125 or C address mask. A single route would be advertised
11126 external to the area, describing the entire subnetted
11127 network.
11128
11129 AuType
11130 Each area can be configured for a separate type of
11131 authentication. See <a href="#appendix-D">Appendix D</a> for a discussion of the
11132 defined authentication types.
11133
11134 ExternalRoutingCapability
11135 Whether AS external advertisements will be flooded
11136 into/throughout the area. If AS external advertisements are
11137
11138
11139
11140 <span class="grey">Moy [Page 199]</span></pre>
11141 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-200" ></span>
11142 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11143
11144
11145 excluded from the area, the area is called a "stub".
11146 Internal to stub areas, routing to external destinations
11147 will be based solely on a default summary route. The
11148 backbone cannot be configured as a stub area. Also, virtual
11149 links cannot be configured through stub areas. For more
11150 information, see <a href="#section-3.6">Section 3.6</a>.
11151
11152 StubDefaultCost
11153 If the area has been configured as a stub area, and the
11154 router itself is an area border router, then the
11155 StubDefaultCost indicates the cost of the default summary
11156 link that the router should advertise into the area. There
11157 can be a separate cost configured for each IP TOS. See
11158 <a href="#section-12.4.3">Section 12.4.3</a> for more information.
11159
11160 C.3 Router interface parameters
11161
11162 Some of the configurable router interface parameters (such as IP
11163 interface address and subnet mask) actually imply properties of
11164 the attached networks, and therefore must be consistent across
11165 all the routers attached to that network. The parameters that
11166 must be configured for a router interface are:
11167
11168
11169 IP interface address
11170 The IP protocol address for this interface. This uniquely
11171 identifies the router over the entire internet. An IP
11172 address is not required on serial lines. Such a serial line
11173 is called "unnumbered".
11174
11175 IP interface mask
11176 Also referred to as the subnet mask, this indicates the
11177 portion of the IP interface address that identifies the
11178 attached network. Masking the IP interface address with the
11179 IP interface mask yields the IP network number of the
11180 attached network. On point-to-point networks and virtual
11181 links, the IP interface mask is not defined. On these
11182 networks, the link itself is not assigned an IP network
11183 number, and so the addresses of each side of the link are
11184 assigned independently, if they are assigned at all.
11185
11186 Interface output cost(s)
11187 The cost of sending a packet on the interface, expressed in
11188 the link state metric. This is advertised as the link cost
11189 for this interface in the router's router links
11190 advertisement. There may be a separate cost for each IP
11191 Type of Service. The interface output cost(s) must always
11192 be greater than 0.
11193
11194
11195
11196 <span class="grey">Moy [Page 200]</span></pre>
11197 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-201" ></span>
11198 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11199
11200
11201 RxmtInterval
11202 The number of seconds between link state advertisement
11203 retransmissions, for adjacencies belonging to this
11204 interface. Also used when retransmitting Database
11205 Description and Link State Request Packets. This should be
11206 well over the expected round-trip delay between any two
11207 routers on the attached network. The setting of this value
11208 should be conservative or needless retransmissions will
11209 result. It will need to be larger on low speed serial lines
11210 and virtual links. Sample value for a local area network: 5
11211 seconds.
11212
11213 InfTransDelay
11214 The estimated number of seconds it takes to transmit a Link
11215 State Update Packet over this interface. Link state
11216 advertisements contained in the update packet must have
11217 their age incremented by this amount before transmission.
11218 This value should take into account the transmission and
11219 propagation delays of the interface. It must be greater
11220 than 0. Sample value for a local area network: 1 second.
11221
11222 Router Priority
11223 An 8-bit unsigned integer. When two routers attached to a
11224 network both attempt to become Designated Router, the one
11225 with the highest Router Priority takes precedence. If there
11226 is still a tie, the router with the highest Router ID takes
11227 precedence. A router whose Router Priority is set to 0 is
11228 ineligible to become Designated Router on the attached
11229 network. Router Priority is only configured for interfaces
11230 to multi-access networks.
11231
11232 HelloInterval
11233 The length of time, in seconds, between the Hello Packets
11234 that the router sends on the interface. This value is
11235 advertised in the router's Hello Packets. It must be the
11236 same for all routers attached to a common network. The
11237 smaller the HelloInterval, the faster topological changes
11238 will be detected, but more OSPF routing protocol traffic
11239 will ensue. Sample value for a X.25 PDN network: 30
11240 seconds. Sample value for a local area network: 10 seconds.
11241
11242 RouterDeadInterval
11243 After ceasing to hear a router's Hello Packets, the number
11244 of seconds before its neighbors declare the router down.
11245 This is also advertised in the router's Hello Packets in
11246 their RouterDeadInterval field. This should be some
11247 multiple of the HelloInterval (say 4). This value again
11248 must be the same for all routers attached to a common
11249
11250
11251
11252 <span class="grey">Moy [Page 201]</span></pre>
11253 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-202" ></span>
11254 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11255
11256
11257 network.
11258
11259 Authentication key
11260 This configured data allows the authentication procedure to
11261 generate and/or verify the authentication field in the OSPF
11262 header. This value again must be the same for all routers
11263 attached to a common network. For example, if the AuType
11264 indicates simple password, the Authentication key would be a
11265 64-bit password. This key would be inserted directly into
11266 the OSPF header when originating routing protocol packets.
11267 There could be a separate password for each network.
11268
11269 C.4 Virtual link parameters
11270
11271 Virtual links are used to restore/increase connectivity of the
11272 backbone. Virtual links may be configured between any pair of
11273 area border routers having interfaces to a common (non-backbone)
11274 area. The virtual link appears as an unnumbered point-to-point
11275 link in the graph for the backbone. The virtual link must be
11276 configured in both of the area border routers.
11277
11278 A virtual link appears in router links advertisements (for the
11279 backbone) as if it were a separate router interface to the
11280 backbone. As such, it has all of the parameters associated with
11281 a router interface (see Section C.3). Although a virtual link
11282 acts like an unnumbered point-to-point link, it does have an
11283 associated IP interface address. This address is used as the IP
11284 source in OSPF protocol packets it sends along the virtual link,
11285 and is set dynamically during the routing table build process.
11286 Interface output cost is also set dynamically on virtual links
11287 to be the cost of the intra-area path between the two routers.
11288 The parameter RxmtInterval must be configured, and should be
11289 well over the expected round-trip delay between the two routers.
11290 This may be hard to estimate for a virtual link; it is better to
11291 err on the side of making it too large. Router Priority is not
11292 used on virtual links.
11293
11294 A virtual link is defined by the following two configurable
11295 parameters: the Router ID of the virtual link's other endpoint,
11296 and the (non-backbone) area through which the virtual link runs
11297 (referred to as the virtual link's Transit area). Virtual links
11298 cannot be configured through stub areas.
11299
11300 C.5 Non-broadcast, multi-access network parameters
11301
11302 OSPF treats a non-broadcast, multi-access network much like it
11303 treats a broadcast network. Since there may be many routers
11304 attached to the network, a Designated Router is selected for the
11305
11306
11307
11308 <span class="grey">Moy [Page 202]</span></pre>
11309 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-203" ></span>
11310 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11311
11312
11313 network. This Designated Router then originates a networks
11314 links advertisement, which lists all routers attached to the
11315 non-broadcast network.
11316
11317 However, due to the lack of broadcast capabilities, it is
11318 necessary to use configuration parameters in the Designated
11319 Router selection. These parameters need only be configured in
11320 those routers that are themselves eligible to become Designated
11321 Router (i.e., those router's whose Router Priority for the
11322 network is non-zero):
11323
11324
11325 List of all other attached routers
11326 The list of all other routers attached to the non-broadcast
11327 network. Each router is listed by its IP interface address
11328 on the network. Also, for each router listed, that router's
11329 eligibility to become Designated Router must be defined.
11330 When an interface to a non-broadcast network comes up, the
11331 router sends Hello Packets only to those neighbors eligible
11332 to become Designated Router, until the identity of the
11333 Designated Router is discovered.
11334
11335 PollInterval
11336 If a neighboring router has become inactive (Hello Packets
11337 have not been seen for RouterDeadInterval seconds), it may
11338 still be necessary to send Hello Packets to the dead
11339 neighbor. These Hello Packets will be sent at the reduced
11340 rate PollInterval, which should be much larger than
11341 HelloInterval. Sample value for a PDN X.25 network: 2
11342 minutes.
11343
11344 C.6 Host route parameters
11345
11346 Host routes are advertised in router links advertisements as
11347 stub networks with mask 0xffffffff. They indicate either router
11348 interfaces to point-to-point networks, looped router interfaces,
11349 or IP hosts that are directly connected to the router (e.g., via
11350 a SLIP line). For each host directly connected to the router,
11351 the following items must be configured:
11352
11353
11354 Host IP address
11355 The IP address of the host.
11356
11357 Cost of link to host
11358 The cost of sending a packet to the host, in terms of the
11359 link state metric. There may be multiple costs configured,
11360 one for each IP TOS. However, since the host probably has
11361
11362
11363
11364 <span class="grey">Moy [Page 203]</span></pre>
11365 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-204" ></span>
11366 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11367
11368
11369 only a single connection to the internet, the actual
11370 configured cost(s) in many cases is unimportant (i.e., will
11371 have no effect on routing).
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420 <span class="grey">Moy [Page 204]</span></pre>
11421 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-205" ></span>
11422 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11423
11424
11425 <span class="h2"><a class="selflink" id="appendix-D" href="#appendix-D">D</a>. Authentication</span>
11426
11427 All OSPF protocol exchanges are authenticated. The OSPF packet
11428 header (see Section A.3.1) includes an authentication type field,
11429 and 64-bits of data for use by the appropriate authentication scheme
11430 (determined by the type field).
11431
11432 The authentication type is configurable on a per-area basis.
11433 Additional authentication data is configurable on a per-interface
11434 basis. For example, if an area uses a simple password scheme for
11435 authentication, a separate password may be configured for each
11436 network contained in the area.
11437
11438 Authentication types 0 and 1 are defined by this specification. All
11439 other authentication types are reserved for definition by the IANA
11440 ([email protected]). The current list of authentication types is
11441 described below in Table 20.
11442
11443
11444
11445 AuType Description
11446 ___________________________________________
11447 0 No authentication
11448 1 Simple password
11449 All others Reserved for assignment by the
11450 IANA ([email protected])
11451
11452
11453 Table 20: OSPF authentication types.
11454
11455
11456
11457 D.1 AuType 0 -- No authentication
11458
11459 Use of this authentication type means that routing exchanges in
11460 the area are not authenticated. The 64-bit field in the OSPF
11461 header can contain anything; it is not examined on packet
11462 reception.
11463
11464 D.2 AuType 1 -- Simple password
11465
11466 Using this authentication type, a 64-bit field is configured on
11467 a per-network basis. All packets sent on a particular network
11468 must have this configured value in their OSPF header 64-bit
11469 authentication field. This essentially serves as a "clear" 64-
11470 bit password.
11471
11472
11473
11474
11475
11476 <span class="grey">Moy [Page 205]</span></pre>
11477 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-206" ></span>
11478 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11479
11480
11481 This guards against routers inadvertently joining the area.
11482 They must first be configured with their attached networks'
11483 passwords before they can participate in the routing domain.
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532 <span class="grey">Moy [Page 206]</span></pre>
11533 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-207" ></span>
11534 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11535
11536
11537 <span class="h2"><a class="selflink" id="appendix-E" href="#appendix-E">E</a>. Differences from <a href="./rfc1247">RFC 1247</a></span>
11538
11539 This section documents the differences between this memo and <a href="./rfc1247">RFC</a>
11540 <a href="./rfc1247">1247</a>. These differences include a fix for a problem involving OSPF
11541 virtual links, together with minor enhancements and clarifications
11542 to the protocol. All differences are backward-compatible.
11543 Implementations of this memo and of <a href="./rfc1247">RFC 1247</a> will interoperate.
11544
11545 E.1 A fix for a problem with OSPF Virtual links
11546
11547 In <a href="./rfc1247">RFC 1247</a>, certain configurations of OSPF virtual links can
11548 cause routing loops. The root of the problem is that while there
11549 is an information mismatch at the boundary of any virtual link's
11550 Transit area, a backbone path can still cross the boundary. <a href="./rfc1247">RFC</a>
11551 <a href="./rfc1247">1247</a> attempted to compensate for this information mismatch by
11552 adjusting any backbone path as it enters the transit area (see
11553 <a href="./rfc1247#section-16.3">Section&nbsp;16.3 in RFC 1247</a>). However, this proved not to be
11554 enough. This memo fixes the problem by having all area border
11555 routers determine, by looking at summary links, whether better
11556 backbone paths can be found through the transit areas.
11557
11558 This fix simplifies the OSPF virtual link logic, and consists of
11559 the following components:
11560
11561 o A new bit has been defined in the router links
11562 advertisement, called bit V. Bit V is set in a router's
11563 router links advertisement for Area A if and only if the
11564 router is an endpoint of an active virtual link that uses
11565 Area A as its Transit area (see Sections <a href="#section-12.4.1">12.4.1</a> and A.4.2).
11566 This enables the other routers attached to Area A to
11567 discover whether the area supports any virtual links (i.e.,
11568 is a transit area). This discovery is done during the
11569 calculation of Area A's shortest-path tree (see <a href="#section-16.1">Section</a>
11570 <a href="#section-16.1">16.1</a>).
11571
11572 o To aid in the description of the algorithm, a new parameter
11573 has been added to the OSPF area structure:
11574 TransitCapability. This parameter indicates whether the area
11575 supports any active virtual links. Equivalently, it
11576 indicates whether the area can carry traffic that neither
11577 originates nor terminates in the area itself.
11578
11579 o The calculation in <a href="./rfc1247#section-16.3">Section&nbsp;16.3 of RFC 1247</a> has been
11580 replaced. The new calculation, performed by area border
11581 routers only, examines the summary links belonging to all
11582 attached transit areas to see whether the transit areas can
11583 provide better paths than those already found in Sections
11584 16.1 and 16.2.
11585
11586
11587
11588 <span class="grey">Moy [Page 207]</span></pre>
11589 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-208" ></span>
11590 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11591
11592
11593 o The incremental calculations in <a href="#section-16.5">Section 16.5</a> have been
11594 updated as a result of the new calculations in <a href="#section-16.3">Section 16.3</a>.
11595
11596 E.2 Supporting supernetting and subnet 0
11597
11598 In <a href="./rfc1247">RFC 1247</a>, an OSPF router cannot originate separate AS
11599 external link advertisements (or separate summary link
11600 advertisements) for two networks that have the same address but
11601 different masks. This situation can arise when subnet 0 of a
11602 network has been assigned (a practice that is generally
11603 discouraged), or when using supernetting as described in [RFC
11604 1519] (a practice that is generally encouraged to reduce the
11605 size of routing tables), or even when in transition from one
11606 mask to another on a subnet. Using supernetting as an example,
11607 you might want to aggregate the four class C networks
11608 192.9.4.0-192.9.7.0, advertising one route for the aggregation
11609 and another for the single class C network 192.9.4.0.
11610
11611 The reason behind this limitation is that in <a href="./rfc1247">RFC 1247</a>, the Link
11612 State ID of AS external link advertisements and summary link
11613 advertisements is set equal to the described network's IP
11614 address. In the above example, <a href="./rfc1247">RFC 1247</a> would assign both
11615 advertisements the Link State ID of 192.9.4.0, making them in
11616 essence the same advertisement. This memo fixes the problem by
11617 relaxing the setting of the Link State ID so that any of the
11618 "host" bits of the network address can also be set. This allows
11619 you to disambiguate advertisements for networks having the same
11620 address but different masks. Given an AS external link
11621 advertisement (or a summary link advertisement), the described
11622 network's address can now be obtained by masking the Link State
11623 ID with the network mask carried in the body of the
11624 advertisement. Again using the above example, the aggregate can
11625 now be advertised using a Link State ID of 192.9.4.0 and the
11626 single class C network advertised simultaneously using the Link
11627 State ID of 192.9.4.255.
11628
11629 <a href="#appendix-F">Appendix F</a> gives one possible algorithm for setting one or more
11630 "host" bits in the Link State ID in order to disambiguate
11631 advertisements. It should be noted that this is a local
11632 decision. Each router in an OSPF system is free to use its own
11633 algorithm, since only those advertisements originated by the
11634 router itself are affected.
11635
11636 It is believed that this change will be more or less compatible
11637 with implementations of <a href="./rfc1247">RFC 1247</a>. Implementations of <a href="./rfc1247">RFC 1247</a>
11638 will probably either a) install routing table entries that won't
11639 be used or b) do the correct processing as outlined in this memo
11640 or c) mark the advertisement as unusable when presented with a
11641
11642
11643
11644 <span class="grey">Moy [Page 208]</span></pre>
11645 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-209" ></span>
11646 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11647
11648
11649 Link State ID that has one or more of the host bits set.
11650 However, in the interest of interoperability, implementations of
11651 this memo should only set the host bits in Link State IDs when
11652 absolutely necessary.
11653
11654 The change affects Sections <a href="#section-12.1.4">12.1.4</a>, <a href="#section-12.4.3">12.4.3</a>, <a href="#section-12.4.5">12.4.5</a>, <a href="#section-16.2">16.2</a>, <a href="#section-16.3">16.3</a>,
11655 16.4, 16.5, 16.6, A.4.4 and A.4.5.
11656
11657 E.3 Obsoleting LSInfinity in router links advertisements
11658
11659 The metric of LSInfinity can no longer be used in router links
11660 advertisements to indicate unusable links. This is being done
11661 for several reasons:
11662
11663 o It removes any possible confusion in an OSPF area as to just
11664 which routers/networks are reachable in the area. For
11665 example, the above virtual link fix relies on detecting the
11666 existence of virtual links when running the Dijkstra.
11667 However, when one-directional links (i.e., cost of
11668 LSInfinity in one direction, but not the other) are
11669 possible, some routers may detect the existence of virtual
11670 links while others may not. This may defeat the fix for the
11671 virtual link problem.
11672
11673 o It also helps OSPF's Multicast routing extensions (MOSPF),
11674 because one-way reachability can lead to places that are
11675 reachable via unicast but not multicast, or vice versa.
11676
11677 The two prior justifications for using LSInfinity in router
11678 links advertisements were 1) it was a way to not support TOS
11679 before TOS was optional and 2) it went along with strong TOS
11680 interpretations. These justifications are no longer valid.
11681 However, LSInfinity will continue to mean "unreachable" in
11682 summary link advertisements and AS external link advertisements,
11683 as some implementations use this as an alternative to the
11684 premature aging procedure specified in <a href="#section-14.1">Section 14.1</a>.
11685
11686 This change has one other side effect. When two routers are
11687 connected via a virtual link whose underlying path is non-TOS-
11688 capable, they must now revert to being non-TOS-capable routers
11689 themselves, instead of the previous behavior of advertising the
11690 non-zero TOS costs of the virtual link as LSInfinity. See
11691 <a href="#section-15">Section 15</a> for details.
11692
11693 E.4 TOS encoding updated
11694
11695 The encoding of TOS in OSPF link state advertisements has been
11696 updated to reflect the new TOS value (minimize monetary cost)
11697
11698
11699
11700 <span class="grey">Moy [Page 209]</span></pre>
11701 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-210" ></span>
11702 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11703
11704
11705 defined by [<a href="./rfc1349">RFC 1349</a>]. The OSPF encoding is defined in <a href="#section-12.3">Section</a>
11706 <a href="#section-12.3">12.3</a>, which is identical in content to Section A.5 of [RFC
11707 1349].
11708
11709 E.5 Summarizing routes into transit areas
11710
11711 <a href="./rfc1247">RFC 1247</a> mandated that routes associated with Area A are never
11712 summarized back into Area A. However, this memo further reduces
11713 the number of summary links originated by refusing to summarize
11714 into Area A those routes having next hops belonging to Area A.
11715 This is an optimization over <a href="./rfc1247">RFC 1247</a> behavior when virtual
11716 links are present. For example, in the area configuration of
11717 Figure 6, Router RT11 need only originate a single summary link
11718 having the (collapsed) destination N9-N11,H1 into its connected
11719 transit area Area 2, since all of its other eligible routes have
11720 next hops belonging to Area 2 (and as such only need be
11721 advertised by other area border routers; in this case, Routers
11722 RT10 and RT7). This is the logical equivalent of a Distance
11723 Vector protocol's split horizon logic.
11724
11725 This change appears in <a href="#section-12.4.3">Section 12.4.3</a>.
11726
11727 E.6 Summarizing routes into stub areas
11728
11729 <a href="./rfc1247">RFC 1247</a> mandated that area border routers attached to stub
11730 areas must summarize all inter-area routes into the stub areas.
11731 However, while area border routers connected to OSPF stub areas
11732 must originate default summary links into the stub area, they
11733 need not summarize other routes into the stub area. The amount
11734 of summarization done into stub areas can instead be put under
11735 configuration control. The network administrator can then make
11736 the trade-off between optimal routing and database size.
11737
11738 This change appears in Sections <a href="#section-12.4.3">12.4.3</a> and <a href="#section-12.4.4">12.4.4</a>.
11739
11740 E.7 Flushing anomalous network links advertisements
11741
11742 Text was added indicating that a network links advertisement
11743 whose Link State ID is equal to one of the router's own IP
11744 interface addresses should be considered to be self-originated,
11745 regardless of the setting of the advertisement's Advertising
11746 Router. If the Advertising Router of such an advertisement is
11747 not equal to the router's own Router ID, the advertisement
11748 should be flushed from the routing domain using the premature
11749 aging procedure specified in <a href="#section-14.1">Section 14.1</a>. This case should be
11750 rare, and it indicates that the router's Router ID has changed
11751 since originating the advertisement.
11752
11753
11754
11755
11756 <span class="grey">Moy [Page 210]</span></pre>
11757 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-211" ></span>
11758 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11759
11760
11761 Failure to flush these anomalous advertisements could lead to
11762 multiple network links advertisements having the same Link State
11763 ID. This in turn could cause the Dijkstra calculation in <a href="#section-16.1">Section</a>
11764 <a href="#section-16.1">16.1</a> to fail, since it would be impossible to tell which network
11765 links advertisement is valid (i.e., more recent).
11766
11767 This change appears in Sections <a href="#section-13.4">13.4</a> and <a href="#section-14.1">14.1</a>.
11768
11769 E.8 Required Statistics appendix deleted
11770
11771 <a href="./rfc1247#appendix-D">Appendix&nbsp;D of RFC 1247</a>, which specified a list of required
11772 statistics for an OSPF implementation, has been deleted. That
11773 appendix has been superseded by the two documents: the OSPF
11774 Version 2 Management Information Base and the OSPF Version 2
11775 Traps.
11776
11777 E.9 Other changes
11778
11779 The following small changes were also made to <a href="./rfc1247">RFC 1247</a>:
11780
11781 o When representing unnumbered point-to-point networks in
11782 router links advertisements, the corresponding Link Data
11783 field should be set to the unnumbered interface's MIB-II
11784 [<a href="./rfc1213">RFC 1213</a>] ifIndex value.
11785
11786 o A comment was added to Step 3 of the Dijkstra algorithm in
11787 <a href="#section-16.1">Section 16.1</a>. When removing vertices from the candidate
11788 list, and when there is a choice of vertices closest to the
11789 root, network vertices must be chosen before router vertices
11790 in order to necessarily find all equal-cost paths.
11791
11792 o A comment was added to <a href="#section-12.4.3">Section 12.4.3</a> noting that a summary
11793 link advertisement cannot express a reachable destination
11794 whose path cost equals or exceeds LSInfinity.
11795
11796 o A comment was added to <a href="#section-15">Section 15</a> noting that a virtual link
11797 whose underlying path has cost greater than hexadecimal
11798 0xffff (the maximum size of an interface cost in a router
11799 links advertisement) should be considered inoperational.
11800
11801 o An option was added to the definition of area address
11802 ranges, allowing the network administrator to specify that a
11803 particular range should not be advertised to other OSPF
11804 areas. This enables the existence of certain networks to be
11805 hidden from other areas. This change appears in Sections
11806 12.4.3 and C.2.
11807
11808
11809
11810
11811
11812 <span class="grey">Moy [Page 211]</span></pre>
11813 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-212" ></span>
11814 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11815
11816
11817 o A note was added reminding implementors that bit E (the AS
11818 boundary router indication) should never be set in a router
11819 links advertisement for a stub area, since stub areas cannot
11820 contain AS boundary routers. This change appears in <a href="#section-12.4.1">Section</a>
11821 <a href="#section-12.4.1">12.4.1</a>.
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868 <span class="grey">Moy [Page 212]</span></pre>
11869 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-213" ></span>
11870 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11871
11872
11873 <span class="h2"><a class="selflink" id="appendix-F" href="#appendix-F">F</a>. An algorithm for assigning Link State IDs</span>
11874
11875 In <a href="./rfc1247">RFC 1247</a>, the Link State ID in AS external link advertisements
11876 and summary link advertisements is set to the described network's IP
11877 address. This memo relaxes that requirement, allowing one or more of
11878 the network's host bits to be set in the Link State ID. This allows
11879 the router to originate separate advertisements for networks having
11880 the same addresses, yet different masks. Such networks can occur in
11881 the presence of supernetting and subnet 0s (see Section E.2 for more
11882 information).
11883
11884 This appendix gives one possible algorithm for setting the host bits
11885 in Link State IDs. The choice of such an algorithm is a local
11886 decision. Separate routers are free to use different algorithms,
11887 since the only advertisements affected are the ones that the router
11888 itself originates. The only requirement on the algorithms used is
11889 that the network's IP address should be used as the Link State ID
11890 (the <a href="./rfc1247">RFC 1247</a> behavior) whenever possible.
11891
11892 The algorithm below is stated for AS external link advertisements.
11893 This is only for clarity; the exact same algorithm can be used for
11894 summary link advertisements. Suppose that the router wishes to
11895 originate an AS external link advertisement for a network having
11896 address NA and mask NM1. The following steps are then used to
11897 determine the advertisement's Link State ID:
11898
11899 (1) Determine whether the router is already originating an AS
11900 external link advertisement with Link State ID equal to NA (in
11901 such an advertisement the router itself will be listed as the
11902 advertisement's Advertising Router). If not, set the Link State
11903 ID equal to NA (the <a href="./rfc1247">RFC 1247</a> behavior) and the algorithm
11904 terminates. Otherwise,
11905
11906 (2) Obtain the network mask from the body of the already existing AS
11907 external link advertisement. Call this mask NM2. There are then
11908 two cases:
11909
11910 o NM1 is longer (i.e., more specific) than NM2. In this case,
11911 set the Link State ID in the new advertisement to be the
11912 network [NA,NM1] with all the host bits set (i.e., equal to
11913 NA or'ed together with all the bits that are not set in NM1,
11914 which is network [NA,NM1]'s broadcast address).
11915
11916 o NM2 is longer than NM1. In this case, change the existing
11917 advertisement (having Link State ID of NA) to reference the
11918 new network [NA,NM1] by incrementing the sequence number,
11919 changing the mask in the body to NM1 and using the cost for
11920 the new network. Then originate a new advertisement for the
11921
11922
11923
11924 <span class="grey">Moy [Page 213]</span></pre>
11925 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-214" ></span>
11926 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11927
11928
11929 old network [NA,NM2], with Link State ID equal to NA or'ed
11930 together with the bits that are not set in NM2 (i.e.,
11931 network [NA,NM2]'s broadcast address).
11932
11933 The above algorithm assumes that all masks are contiguous; this
11934 ensures that when two networks have the same address, one mask is
11935 more specific than the other. The algorithm also assumes that no
11936 network exists having an address equal to another network's
11937 broadcast address. Given these two assumptions, the above algorithm
11938 always produces unique Link State IDs. The above algorithm can also
11939 be reworded as follows: When originating an AS external link state
11940 advertisement, try to use the network number as the Link State ID.
11941 If that produces a conflict, examine the two networks in conflict.
11942 One will be a subset of the other. For the less specific network,
11943 use the network number as the Link State ID and for the more
11944 specific use the network's broadcast address instead (i.e., flip all
11945 the "host" bits to 1). If the most specific network was originated
11946 first, this will cause you to originate two link state
11947 advertisements at once.
11948
11949 As an example of the algorithm, consider its operation when the
11950 following sequence of events occurs in a single router (Router A).
11951
11952
11953 (1) Router A wants to originate an AS external link advertisement
11954 for [10.0.0.0,255.255.255.0]:
11955
11956 (a) A Link State ID of 10.0.0.0 is used.
11957
11958 (2) Router A then wants to originate an AS external link
11959 advertisement for [10.0.0.0,255.255.0.0]:
11960
11961 (a) The advertisement for [10.0.0,0,255.255.255.0] is
11962 reoriginated using a new Link State ID of 10.0.0.255.
11963
11964 (b) A Link State ID of 10.0.0.0 is used for
11965 [10.0.0.0,255.255.0.0].
11966
11967 (3) Router A then wants to originate an AS external link
11968 advertisement for [10.0.0.0,255.0.0.0]:
11969
11970 (a) The advertisement for [10.0.0.0,255.255.0.0] is reoriginated
11971 using a new Link State ID of 10.0.255.255.
11972
11973 (b) A Link State ID of 10.0.0.0 is used for
11974 [10.0.0.0,255.0.0.0].
11975
11976
11977
11978
11979
11980 <span class="grey">Moy [Page 214]</span></pre>
11981 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-215" ></span>
11982 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
11983
11984
11985 (c) The network [10.0.0.0,255.255.255.0] keeps its Link State ID
11986 of 10.0.0.255.
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036 <span class="grey">Moy [Page 215]</span></pre>
12037 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-216" ></span>
12038 <span class="grey"><a href="./rfc1583">RFC 1583</a> OSPF Version 2 March 1994</span>
12039
12040
12041 Security Considerations
12042
12043 All OSPF protocol exchanges are authenticated. This is accomplished
12044 through authentication fields contained in the OSPF packet header.
12045 For more information, see Sections <a href="#section-8.1">8.1</a>, <a href="#section-8.2">8.2</a>, and <a href="#appendix-D">Appendix D</a>.
12046
12047 Author's Address
12048
12049 John Moy
12050 Proteon, Inc.
12051 9 Technology Drive
12052 Westborough, MA 01581
12053
12054 Phone: 508-898-2800
12055 Fax: 508-898-3176
12056 Email: [email protected]
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092 Moy [Page 216]
12093 </pre>