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