]>
Commit | Line | Data |
---|---|---|
0efdf0fe | 1 | .. _ospf-fundamentals: |
42fc5d26 QY |
2 | |
3 | OSPF Fundamentals | |
4 | ================= | |
5 | ||
8ed09fbf QY |
6 | .. index:: |
7 | pair: Link-state routing protocol; OSPF | |
8 | pair: Distance-vector routing protocol; OSPF | |
9 | ||
42fc5d26 | 10 | |
62333307 QY |
11 | :abbr:`OSPF` is, mostly, a link-state routing protocol. In contrast to |
12 | :term:`distance-vector` protocols, such as :abbr:`RIP` or :abbr:`BGP`, where | |
13 | routers describe available `paths` (i.e. routes) to each other, in | |
14 | :term:`link-state` protocols routers instead describe the state of their links | |
15 | to their immediate neighbouring routers. | |
42fc5d26 | 16 | |
8ed09fbf QY |
17 | .. index:: |
18 | single: Link State Announcement | |
19 | single: Link State Advertisement | |
20 | single: LSA flooding | |
21 | single: Link State Database | |
22 | ||
42fc5d26 | 23 | |
62333307 | 24 | Each router describes their link-state information in a message known as an |
d1e7591e | 25 | :abbr:`LSA (Link State Advertisement)`, which is then propagated through to all |
62333307 QY |
26 | other routers in a link-state routing domain, by a process called `flooding`. |
27 | Each router thus builds up an :abbr:`LSDB (Link State Database)` of all the | |
28 | link-state messages. From this collection of LSAs in the LSDB, each router can | |
29 | then calculate the shortest path to any other router, based on some common | |
30 | metric, by using an algorithm such as | |
afb2a168 | 31 | `Edsger Dijkstra's <http://www.cs.utexas.edu/users/EWD/>`_ |
ec8404d8 | 32 | :abbr:`SPF (Shortest Path First)` algorithm. |
42fc5d26 | 33 | |
8ed09fbf QY |
34 | .. index:: |
35 | pair: Link-state routing protocol; advantages | |
42fc5d26 QY |
36 | |
37 | By describing connectivity of a network in this way, in terms of | |
38 | routers and links rather than in terms of the paths through a network, | |
39 | a link-state protocol can use less bandwidth and converge more quickly | |
40 | than other protocols. A link-state protocol need distribute only one | |
41 | link-state message throughout the link-state domain when a link on any | |
42 | single given router changes state, in order for all routers to | |
43 | reconverge on the best paths through the network. In contrast, distance | |
44 | vector protocols can require a progression of different path update | |
45 | messages from a series of different routers in order to converge. | |
46 | ||
8ed09fbf QY |
47 | .. index:: |
48 | pair: Link-state routing protocol; disadvantages | |
42fc5d26 QY |
49 | |
50 | The disadvantage to a link-state protocol is that the process of | |
51 | computing the best paths can be relatively intensive when compared to | |
52 | distance-vector protocols, in which near to no computation need be done | |
53 | other than (potentially) select between multiple routes. This overhead | |
54 | is mostly negligible for modern embedded CPUs, even for networks with | |
55 | thousands of nodes. The primary scaling overhead lies more in coping | |
56 | with the ever greater frequency of LSA updates as the size of a | |
d50b2aa0 | 57 | link-state area increases, in managing the :abbr:`LSDB` and required |
42fc5d26 QY |
58 | flooding. |
59 | ||
60 | This section aims to give a distilled, but accurate, description of the | |
ec8404d8 QY |
61 | more important workings of :abbr:`OSPF` which an administrator may need |
62 | to know to be able best configure and trouble-shoot :abbr:`OSPF`. | |
42fc5d26 QY |
63 | |
64 | OSPF Mechanisms | |
65 | --------------- | |
66 | ||
d50b2aa0 | 67 | :abbr:`OSPF` defines a range of mechanisms, concerned with detecting, |
d1e7591e | 68 | describing and propagating state through a network. These mechanisms |
42fc5d26 QY |
69 | will nearly all be covered in greater detail further on. They may be |
70 | broadly classed as: | |
71 | ||
72 | ||
8ed09fbf QY |
73 | .. index:: |
74 | pair: Hello protocol; OSPF | |
42fc5d26 | 75 | |
c1a54c05 QY |
76 | The Hello Protocol |
77 | ^^^^^^^^^^^^^^^^^^ | |
42fc5d26 | 78 | |
c1a54c05 QY |
79 | The OSPF Hello protocol allows OSPF to quickly detect changes in two-way |
80 | reachability between routers on a link. OSPF can additionally avail of other | |
81 | sources of reachability information, such as link-state information provided by | |
013f9762 QY |
82 | hardware, or through dedicated reachability protocols such as |
83 | :abbr:`BFD (Bidirectional Forwarding Detection)`. | |
42fc5d26 | 84 | |
c1a54c05 QY |
85 | OSPF also uses the Hello protocol to propagate certain state between routers |
86 | sharing a link, for example: | |
42fc5d26 | 87 | |
c1a54c05 QY |
88 | - Hello protocol configured state, such as the dead-interval. |
89 | - Router priority, for DR/BDR election. | |
90 | - DR/BDR election results. | |
91 | - Any optional capabilities supported by each router. | |
42fc5d26 | 92 | |
80746521 SR |
93 | The Hello protocol is comparatively trivial and will not be explored in more |
94 | detail. | |
42fc5d26 | 95 | |
8ed09fbf QY |
96 | |
97 | .. index:: | |
98 | pair: LSA; OSPF | |
99 | ||
c1a54c05 | 100 | .. _ospf-lsas: |
42fc5d26 | 101 | |
c1a54c05 QY |
102 | LSAs |
103 | ^^^^ | |
42fc5d26 | 104 | |
c1a54c05 QY |
105 | At the heart of :abbr:`OSPF` are :abbr:`LSA (Link State Advertisement)` |
106 | messages. Despite the name, some :abbr:`LSA` s do not, strictly speaking, | |
107 | describe link-state information. Common :abbr:`LSA` s describe information | |
108 | such as: | |
42fc5d26 | 109 | |
c1a54c05 QY |
110 | - Routers, in terms of their links. |
111 | - Networks, in terms of attached routers. | |
112 | - Routes, external to a link-state domain: | |
42fc5d26 | 113 | |
c1a54c05 QY |
114 | External Routes |
115 | Routes entirely external to :abbr:`OSPF`. Routers originating such | |
116 | routes are known as :abbr:`ASBR (Autonomous-System Border Router)` | |
117 | routers. | |
42fc5d26 | 118 | |
c1a54c05 QY |
119 | Summary Routes |
120 | Routes which summarise routing information relating to OSPF areas | |
121 | external to the OSPF link-state area at hand, originated by | |
122 | :abbr:`ABR (Area Boundary Router)` routers. | |
42fc5d26 | 123 | |
c1a54c05 | 124 | .. _ospf-lsa-flooding: |
42fc5d26 | 125 | |
c1a54c05 QY |
126 | LSA Flooding |
127 | """""""""""" | |
42fc5d26 | 128 | |
c1a54c05 | 129 | OSPF defines several related mechanisms, used to manage synchronisation of |
013f9762 | 130 | :abbr:`LSDB` s between neighbours as neighbours form adjacencies and the |
d1e7591e | 131 | propagation, or `flooding` of new or updated :abbr:`LSA` s. |
42fc5d26 | 132 | |
8ed09fbf QY |
133 | |
134 | .. index:: | |
135 | pair: Area; OSPF | |
6ee602cd | 136 | |
c1a54c05 | 137 | .. _ospf-areas: |
42fc5d26 | 138 | |
c1a54c05 QY |
139 | Areas |
140 | ^^^^^ | |
42fc5d26 | 141 | |
c1a54c05 QY |
142 | OSPF provides for the protocol to be broken up into multiple smaller and |
143 | independent link-state areas. Each area must be connected to a common backbone | |
144 | area by an :abbr:`ABR (Area Boundary Router)`. These :abbr:`ABR` routers are | |
145 | responsible for summarising the link-state routing information of an area into | |
62333307 | 146 | `Summary LSAs`, possibly in a condensed (i.e. aggregated) form, and then |
c1a54c05 QY |
147 | originating these summaries into all other areas the :abbr:`ABR` is connected |
148 | to. | |
42fc5d26 | 149 | |
c1a54c05 QY |
150 | Note that only summaries and external routes are passed between areas. As |
151 | these describe *paths*, rather than any router link-states, routing between | |
152 | areas hence is by :term:`distance-vector`, **not** link-state. | |
42fc5d26 QY |
153 | |
154 | OSPF LSAs | |
155 | --------- | |
156 | ||
c1a54c05 QY |
157 | The core objects in OSPF are :abbr:`LSA` s. Everything else in OSPF revolves |
158 | around detecting what to describe in LSAs, when to update them, how to flood | |
159 | them throughout a network and how to calculate routes from them. | |
42fc5d26 | 160 | |
c1a54c05 QY |
161 | There are a variety of different :abbr:`LSA` s, for purposes such as describing |
162 | actual link-state information, describing paths (i.e. routes), describing | |
163 | bandwidth usage of links for :abbr:`TE (Traffic Engineering)` purposes, and | |
164 | even arbitrary data by way of *Opaque* :abbr:`LSA` s. | |
42fc5d26 QY |
165 | |
166 | LSA Header | |
167 | ^^^^^^^^^^ | |
168 | ||
169 | All LSAs share a common header with the following information: | |
170 | ||
c1a54c05 | 171 | - Type |
42fc5d26 | 172 | |
c1a54c05 | 173 | Different types of :abbr:`LSA` s describe different things in |
ec8404d8 | 174 | :abbr:`OSPF`. Types include: |
42fc5d26 | 175 | |
c1a54c05 QY |
176 | - Router LSA |
177 | - Network LSA | |
178 | - Network Summary LSA | |
179 | - Router Summary LSA | |
180 | - AS-External LSA | |
42fc5d26 QY |
181 | |
182 | The specifics of the different types of LSA are examined below. | |
183 | ||
c1a54c05 | 184 | - Advertising Router |
42fc5d26 | 185 | |
6ee602cd QY |
186 | The Router ID of the router originating the LSA. |
187 | ||
188 | .. seealso:: | |
189 | ||
190 | :clicmd:`ospf router-id A.B.C.D`. | |
42fc5d26 | 191 | |
c1a54c05 | 192 | - LSA ID |
42fc5d26 QY |
193 | |
194 | The ID of the LSA, which is typically derived in some way from the | |
195 | information the LSA describes, e.g. a Router LSA uses the Router ID as | |
d50b2aa0 | 196 | the LSA ID, a Network LSA will have the IP address of the :abbr:`DR` |
ec8404d8 | 197 | as its LSA ID. |
42fc5d26 QY |
198 | |
199 | The combination of the Type, ID and Advertising Router ID must uniquely | |
ec8404d8 | 200 | identify the :abbr:`LSA`. There can however be multiple instances of |
42fc5d26 | 201 | an LSA with the same Type, LSA ID and Advertising Router ID, see |
11ab5329 | 202 | :ref:`sequence number <ospf-lsa-sequence-number>`. |
42fc5d26 | 203 | |
c1a54c05 | 204 | - Age |
42fc5d26 | 205 | |
c1a54c05 | 206 | A number to allow stale :abbr:`LSA` s to, eventually, be purged by routers |
013f9762 | 207 | from their :abbr:`LSDB` s. |
42fc5d26 QY |
208 | |
209 | The value nominally is one of seconds. An age of 3600, i.e. 1 hour, is | |
62333307 | 210 | called the `MaxAge`. MaxAge LSAs are ignored in routing |
42fc5d26 QY |
211 | calculations. LSAs must be periodically refreshed by their Advertising |
212 | Router before reaching MaxAge if they are to remain valid. | |
213 | ||
214 | Routers may deliberately flood LSAs with the age artificially set to | |
215 | 3600 to indicate an LSA is no longer valid. This is called | |
62333307 | 216 | `flushing` of an LSA. |
42fc5d26 QY |
217 | |
218 | It is not abnormal to see stale LSAs in the LSDB, this can occur where | |
219 | a router has shutdown without flushing its LSA(s), e.g. where it has | |
220 | become disconnected from the network. Such LSAs do little harm. | |
221 | ||
6ee602cd | 222 | .. _ospf-lsa-sequence-number: |
42fc5d26 | 223 | |
c1a54c05 | 224 | - Sequence Number |
42fc5d26 QY |
225 | |
226 | A number used to distinguish newer instances of an LSA from older instances. | |
227 | ||
228 | Link-State LSAs | |
229 | ^^^^^^^^^^^^^^^ | |
230 | ||
c1a54c05 QY |
231 | Of all the various kinds of :abbr:`LSA` s, just two types comprise the |
232 | actual link-state part of :abbr:`OSPF`, Router :abbr:`LSA` s and | |
233 | Network :abbr:`LSA` s. These LSA types are absolutely core to the | |
a8c90e15 | 234 | protocol. |
42fc5d26 QY |
235 | |
236 | Instances of these LSAs are specific to the link-state area in which | |
237 | they are originated. Routes calculated from these two LSA types are | |
62333307 | 238 | called `intra-area routes`. |
42fc5d26 | 239 | |
c1a54c05 | 240 | - Router LSA |
42fc5d26 | 241 | |
d50b2aa0 QY |
242 | Each OSPF Router must originate a router :abbr:`LSA` to describe |
243 | itself. In it, the router lists each of its :abbr:`OSPF` enabled | |
42fc5d26 QY |
244 | interfaces, for the given link-state area, in terms of: |
245 | ||
c1a54c05 QY |
246 | Cost |
247 | The output cost of that interface, scaled inversely to some commonly known | |
80746521 | 248 | reference value, :clicmd:`auto-cost reference-bandwidth (1-4294967)`. |
42fc5d26 | 249 | |
c1a54c05 QY |
250 | Link Type |
251 | Transit Network | |
42fc5d26 | 252 | |
c1a54c05 QY |
253 | A link to a multi-access network, on which the router has at least one |
254 | Full adjacency with another router. | |
42fc5d26 | 255 | |
c1a54c05 QY |
256 | :abbr:`PtP (Point-to-Point)` |
257 | A link to a single remote router, with a Full adjacency. No | |
258 | :abbr:`DR (Designated Router)` is elected on such links; no network | |
259 | LSA is originated for such a link. | |
42fc5d26 | 260 | |
c1a54c05 QY |
261 | Stub |
262 | A link with no adjacent neighbours, or a host route. | |
42fc5d26 | 263 | |
c1a54c05 | 264 | - Link ID and Data |
42fc5d26 QY |
265 | |
266 | These values depend on the Link Type: | |
267 | ||
c1a54c05 QY |
268 | +----------------+-----------------------------------+------------------------------------------+ |
269 | | Link Type | Link ID | Link Data | | |
270 | +================+===================================+==========================================+ | |
271 | | Transit | Link IP address of the :abbr:`DR` | Interface IP address | | |
272 | +----------------+-----------------------------------+------------------------------------------+ | |
273 | | Point-to-Point | Router ID of the remote router | Local interface IP address, or the | | |
f41ddc27 | 274 | | | | :abbr:`ifindex (MIB-II interface index)` | |
c1a54c05 QY |
275 | | | | for unnumbered links | |
276 | +----------------+-----------------------------------+------------------------------------------+ | |
277 | | Stub | IP address | Subnet Mask | | |
278 | +----------------+-----------------------------------+------------------------------------------+ | |
279 | ||
280 | Links on a router may be listed multiple times in the Router LSA, e.g. a | |
281 | :abbr:`PtP` interface on which OSPF is enabled must *always* be described | |
282 | by a Stub link in the Router :abbr:`LSA`, in addition to being listed as | |
283 | PtP link in the Router :abbr:`LSA` if the adjacency with the remote router | |
284 | is Full. | |
285 | ||
286 | Stub links may also be used as a way to describe links on which OSPF is | |
62333307 | 287 | *not* spoken, known as `passive interfaces`, see |
29ec6244 | 288 | :clicmd:`ip ospf passive [A.B.C.D]`. |
c1a54c05 QY |
289 | |
290 | - Network LSA | |
42fc5d26 | 291 | |
ec8404d8 QY |
292 | On multi-access links (e.g. ethernets, certain kinds of ATM and X.25 |
293 | configurations), routers elect a :abbr:`DR`. The :abbr:`DR` is | |
d50b2aa0 | 294 | responsible for originating a Network :abbr:`LSA`, which helps reduce |
42fc5d26 | 295 | the information needed to describe multi-access networks with multiple |
d50b2aa0 | 296 | routers attached. The :abbr:`DR` also acts as a hub for the flooding of |
c1a54c05 | 297 | :abbr:`LSA` s on that link, thus reducing flooding overheads. |
42fc5d26 QY |
298 | |
299 | The contents of the Network LSA describes the: | |
300 | ||
c1a54c05 | 301 | - Subnet Mask |
42fc5d26 | 302 | |
d50b2aa0 QY |
303 | As the :abbr:`LSA` ID of a Network LSA must be the IP address of the |
304 | :abbr:`DR`, the Subnet Mask together with the :abbr:`LSA` ID gives | |
42fc5d26 QY |
305 | you the network address. |
306 | ||
c1a54c05 | 307 | - Attached Routers |
42fc5d26 | 308 | |
d50b2aa0 | 309 | Each router fully-adjacent with the :abbr:`DR` is listed in the LSA, |
c1a54c05 | 310 | by their Router-ID. This allows the corresponding Router :abbr:`LSA` s to be |
ec8404d8 | 311 | easily retrieved from the :abbr:`LSDB`. |
42fc5d26 QY |
312 | |
313 | Summary of Link State LSAs: | |
314 | ||
ec8404d8 QY |
315 | +-------------+----------------------------+--------------------------------------------+ |
316 | | LSA Type | LSA ID | LSA Data Describes | | |
317 | +=============+============================+============================================+ | |
318 | | Router LSA | Router ID | The :abbr:`OSPF` enabled links of the | | |
319 | | | | router, within a specific link-state area. | | |
320 | +-------------+----------------------------+--------------------------------------------+ | |
d1e7591e | 321 | | Network LSA | The IP address of the | The subnet mask of the network and the | |
ec8404d8 QY |
322 | | | :abbr:`DR` for the network | Router IDs of all routers on the network | |
323 | +-------------+----------------------------+--------------------------------------------+ | |
42fc5d26 | 324 | |
d50b2aa0 | 325 | With an LSDB composed of just these two types of :abbr:`LSA`, it is |
42fc5d26 QY |
326 | possible to construct a directed graph of the connectivity between all |
327 | routers and networks in a given OSPF link-state area. So, not | |
328 | surprisingly, when OSPF routers build updated routing tables, the first | |
d50b2aa0 | 329 | stage of :abbr:`SPF` calculation concerns itself only with these two |
42fc5d26 QY |
330 | LSA types. |
331 | ||
c1a54c05 QY |
332 | .. _ospf-link-state-lsa-examples: |
333 | ||
42fc5d26 QY |
334 | Link-State LSA Examples |
335 | ^^^^^^^^^^^^^^^^^^^^^^^ | |
336 | ||
c1a54c05 QY |
337 | The example below shows two :abbr:`LSA` s, both originated by the same router |
338 | (Router ID 192.168.0.49) and with the same :abbr:`LSA` ID (192.168.0.49), but | |
339 | of different LSA types. | |
42fc5d26 QY |
340 | |
341 | The first LSA being the router LSA describing 192.168.0.49's links: 2 links | |
342 | to multi-access networks with fully-adjacent neighbours (i.e. Transit | |
343 | links) and 1 being a Stub link (no adjacent neighbours). | |
344 | ||
345 | The second LSA being a Network LSA, for which 192.168.0.49 is the | |
d50b2aa0 | 346 | :abbr:`DR`, listing the Router IDs of 4 routers on that network which |
42fc5d26 QY |
347 | are fully adjacent with 192.168.0.49. |
348 | ||
42fc5d26 QY |
349 | :: |
350 | ||
9eb95b3b QY |
351 | # show ip ospf database router 192.168.0.49 |
352 | ||
353 | OSPF Router with ID (192.168.0.53) | |
354 | ||
355 | Router Link States (Area 0.0.0.0) | |
356 | ||
357 | LS age: 38 | |
358 | Options: 0x2 : *|-|-|-|-|-|E|* | |
359 | LS Flags: 0x6 | |
360 | Flags: 0x2 : ASBR | |
361 | LS Type: router-LSA | |
362 | Link State ID: 192.168.0.49 | |
363 | Advertising Router: 192.168.0.49 | |
364 | LS Seq Number: 80000f90 | |
365 | Checksum: 0x518b | |
366 | Length: 60 | |
367 | Number of Links: 3 | |
368 | ||
369 | Link connected to: a Transit Network | |
370 | (Link ID) Designated Router address: 192.168.1.3 | |
371 | (Link Data) Router Interface address: 192.168.1.3 | |
372 | Number of TOS metrics: 0 | |
373 | TOS 0 Metric: 10 | |
374 | ||
375 | Link connected to: a Transit Network | |
376 | (Link ID) Designated Router address: 192.168.0.49 | |
377 | (Link Data) Router Interface address: 192.168.0.49 | |
378 | Number of TOS metrics: 0 | |
379 | TOS 0 Metric: 10 | |
380 | ||
381 | Link connected to: Stub Network | |
382 | (Link ID) Net: 192.168.3.190 | |
383 | (Link Data) Network Mask: 255.255.255.255 | |
384 | Number of TOS metrics: 0 | |
385 | TOS 0 Metric: 39063 | |
386 | # show ip ospf database network 192.168.0.49 | |
387 | ||
388 | OSPF Router with ID (192.168.0.53) | |
389 | ||
390 | Net Link States (Area 0.0.0.0) | |
391 | ||
392 | LS age: 285 | |
393 | Options: 0x2 : *|-|-|-|-|-|E|* | |
394 | LS Flags: 0x6 | |
395 | LS Type: network-LSA | |
396 | Link State ID: 192.168.0.49 (address of Designated Router) | |
397 | Advertising Router: 192.168.0.49 | |
398 | LS Seq Number: 80000074 | |
399 | Checksum: 0x0103 | |
400 | Length: 40 | |
401 | Network Mask: /29 | |
402 | Attached Router: 192.168.0.49 | |
403 | Attached Router: 192.168.0.52 | |
404 | Attached Router: 192.168.0.53 | |
405 | Attached Router: 192.168.0.54 | |
a8c90e15 | 406 | |
42fc5d26 QY |
407 | |
408 | Note that from one LSA, you can find the other. E.g. Given the | |
409 | Network-LSA you have a list of Router IDs on that network, from which | |
d50b2aa0 | 410 | you can then look up, in the local :abbr:`LSDB`, the matching Router |
ec8404d8 | 411 | LSA. From that Router-LSA you may (potentially) find links to other |
42fc5d26 | 412 | Transit networks and Routers IDs which can be used to lookup the |
ec8404d8 QY |
413 | corresponding Router or Network LSA. And in that fashion, one can find |
414 | all the Routers and Networks reachable from that starting :abbr:`LSA`. | |
42fc5d26 QY |
415 | |
416 | Given the Router LSA instead, you have the IP address of the | |
d50b2aa0 | 417 | :abbr:`DR` of any attached transit links. Network LSAs will have that IP |
42fc5d26 QY |
418 | as their LSA ID, so you can then look up that Network LSA and from that |
419 | find all the attached routers on that link, leading potentially to more | |
420 | links and Network and Router LSAs, etc. etc. | |
421 | ||
c1a54c05 | 422 | From just the above two :abbr:`LSA` s, one can already see the |
42fc5d26 | 423 | following partial topology: |
42fc5d26 | 424 | |
ec8404d8 | 425 | :: |
42fc5d26 | 426 | |
9eb95b3b QY |
427 | ------------------------ Network: ...... |
428 | | Designated Router IP: 192.168.1.3 | |
429 | | | |
430 | IP: 192.168.1.3 | |
431 | (transit link) | |
432 | (cost: 10) | |
433 | Router ID: 192.168.0.49(stub)---------- IP: 192.168.3.190/32 | |
434 | (cost: 10) (cost: 39063) | |
435 | (transit link) | |
436 | IP: 192.168.0.49 | |
437 | | | |
438 | | | |
439 | ------------------------------ Network: 192.168.0.48/29 | |
440 | | | | Designated Router IP: 192.168.0.49 | |
441 | | | | | |
442 | | | Router ID: 192.168.0.54 | |
443 | | | | |
444 | | Router ID: 192.168.0.53 | |
445 | | | |
446 | Router ID: 192.168.0.52 | |
a8c90e15 | 447 | |
42fc5d26 QY |
448 | |
449 | Note the Router IDs, though they look like IP addresses and often are | |
450 | IP addresses, are not strictly speaking IP addresses, nor need they be | |
451 | reachable addresses (though, OSPF will calculate routes to Router IDs). | |
452 | ||
453 | External LSAs | |
454 | ^^^^^^^^^^^^^ | |
455 | ||
c1a54c05 | 456 | External, or "Type 5", :abbr:`LSA` s describe routing information which is |
d50b2aa0 | 457 | entirely external to :abbr:`OSPF`, and is "injected" into |
ec8404d8 | 458 | :abbr:`OSPF`. Such routing information may have come from another |
42fc5d26 QY |
459 | routing protocol, such as RIP or BGP, they may represent static routes |
460 | or they may represent a default route. | |
461 | ||
c1a54c05 QY |
462 | An :abbr:`OSPF` router which originates External :abbr:`LSA` s is known as an |
463 | :abbr:`ASBR (AS Boundary Router)`. Unlike the link-state :abbr:`LSA` s, and | |
464 | most other :abbr:`LSA` s, which are flooded only within the area in | |
465 | which they originate, External :abbr:`LSA` s are flooded through-out | |
d50b2aa0 | 466 | the :abbr:`OSPF` network to all areas capable of carrying External |
0efdf0fe | 467 | :abbr:`LSA` s (:ref:`ospf-areas`). |
42fc5d26 QY |
468 | |
469 | Routes internal to OSPF (intra-area or inter-area) are always preferred | |
470 | over external routes. | |
471 | ||
d50b2aa0 | 472 | The External :abbr:`LSA` describes the following: |
42fc5d26 | 473 | |
c1a54c05 QY |
474 | IP Network number |
475 | The IP Network number of the route is described by the :abbr:`LSA` ID field. | |
42fc5d26 | 476 | |
c1a54c05 QY |
477 | IP Network Mask |
478 | The body of the External LSA describes the IP Network Mask of the route. | |
479 | This, together with the :abbr:`LSA` ID, describes the prefix of the IP route | |
480 | concerned. | |
42fc5d26 | 481 | |
c1a54c05 QY |
482 | Metric |
483 | The cost of the External Route. This cost may be an OSPF cost (also known as | |
484 | a "Type 1" metric), i.e. equivalent to the normal OSPF costs, or an | |
485 | externally derived cost ("Type 2" metric) which is not comparable to OSPF | |
486 | costs and always considered larger than any OSPF cost. Where there are both | |
487 | Type 1 and 2 External routes for a route, the Type 1 is always preferred. | |
42fc5d26 | 488 | |
c1a54c05 QY |
489 | Forwarding Address |
490 | The address of the router to forward packets to for the route. This may be, | |
491 | and usually is, left as 0 to specify that the ASBR originating the External | |
492 | :abbr:`LSA` should be used. There must be an internal OSPF route to the | |
d1e7591e | 493 | forwarding address, for the forwarding address to be usable. |
42fc5d26 | 494 | |
c1a54c05 QY |
495 | Tag |
496 | An arbitrary 4-bytes of data, not interpreted by OSPF, which may carry | |
497 | whatever information about the route which OSPF speakers desire. | |
42fc5d26 QY |
498 | |
499 | AS External LSA Example | |
500 | ^^^^^^^^^^^^^^^^^^^^^^^ | |
501 | ||
d50b2aa0 | 502 | To illustrate, below is an example of an External :abbr:`LSA` in the |
c1a54c05 QY |
503 | :abbr:`LSDB` of an OSPF router. It describes a route to the IP prefix of |
504 | 192.168.165.0/24, originated by the ASBR with Router-ID 192.168.0.49. The | |
505 | metric of 20 is external to OSPF. The forwarding address is 0, so the route | |
506 | should forward to the originating ASBR if selected. | |
42fc5d26 QY |
507 | |
508 | :: | |
509 | ||
9eb95b3b QY |
510 | # show ip ospf database external 192.168.165.0 |
511 | LS age: 995 | |
512 | Options: 0x2 : *|-|-|-|-|-|E|* | |
513 | LS Flags: 0x9 | |
514 | LS Type: AS-external-LSA | |
515 | Link State ID: 192.168.165.0 (External Network Number) | |
516 | Advertising Router: 192.168.0.49 | |
517 | LS Seq Number: 800001d8 | |
518 | Checksum: 0xea27 | |
519 | Length: 36 | |
520 | Network Mask: /24 | |
521 | Metric Type: 2 (Larger than any link state path) | |
522 | TOS: 0 | |
523 | Metric: 20 | |
524 | Forward Address: 0.0.0.0 | |
525 | External Route Tag: 0 | |
a8c90e15 | 526 | |
42fc5d26 QY |
527 | |
528 | We can add this to our partial topology from above, which now looks | |
c1a54c05 QY |
529 | like::: |
530 | ||
531 | --------------------- Network: ...... | |
532 | | Designated Router IP: 192.168.1.3 | |
533 | | | |
534 | IP: 192.168.1.3 /---- External route: 192.168.165.0/24 | |
535 | (transit link) / Cost: 20 (External metric) | |
536 | (cost: 10) / | |
537 | Router ID: 192.168.0.49(stub)---------- IP: 192.168.3.190/32 | |
538 | (cost: 10) (cost: 39063) | |
539 | (transit link) | |
540 | IP: 192.168.0.49 | |
541 | | | |
542 | | | |
543 | ------------------------------ Network: 192.168.0.48/29 | |
544 | | | | Designated Router IP: 192.168.0.49 | |
545 | | | | | |
546 | | | Router ID: 192.168.0.54 | |
547 | | | | |
548 | | Router ID: 192.168.0.53 | |
549 | | | |
550 | Router ID: 192.168.0.52 | |
a8c90e15 | 551 | |
42fc5d26 QY |
552 | |
553 | Summary LSAs | |
554 | ^^^^^^^^^^^^ | |
555 | ||
013f9762 | 556 | Summary LSAs are created by :abbr:`ABR` s to summarise the destinations |
c1a54c05 QY |
557 | available within one area to other areas. These LSAs may describe IP networks, |
558 | potentially in aggregated form, or :abbr:`ASBR` routers. |