Network Working Group J. Moy Request for Comments: 2328 Ascend Communications, Inc. STD: 54 April 1998 Obsoletes: 2178 Category: Standards Track
Network Working Group J. Moy Request for Comments: 2328 Ascend Communications, Inc. STD: 54 April 1998 Obsoletes: 2178 Category: Standards Track
OSPF Version 2
OSPF版本2
Status of this Memo
本备忘录的状况
This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.
本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。
Copyright Notice
版权公告
Copyright (C) The Internet Society (1998). All Rights Reserved.
版权所有(C)互联网协会(1998年)。版权所有。
Abstract
摘要
This memo documents version 2 of the OSPF protocol. OSPF is a link-state routing protocol. It is designed to be run internal to a single Autonomous System. Each OSPF router maintains an identical database describing the Autonomous System's topology. From this database, a routing table is calculated by constructing a shortest-path tree.
本备忘录记录了OSPF协议的第2版。OSPF是一种链路状态路由协议。它被设计为在单个自治系统内部运行。每个OSPF路由器维护一个描述自治系统拓扑的相同数据库。根据该数据库,通过构造最短路径树来计算路由表。
OSPF recalculates routes quickly in the face of topological changes, utilizing a minimum of routing protocol traffic. OSPF provides support for equal-cost multipath. An area routing capability is provided, enabling an additional level of routing protection and a reduction in routing protocol traffic. In addition, all OSPF routing protocol exchanges are authenticated.
面对拓扑变化,OSPF利用最小的路由协议流量快速重新计算路由。OSPF提供了对等成本多路径的支持。提供了区域路由功能,实现了额外级别的路由保护和路由协议流量的减少。此外,所有OSPF路由协议交换都经过身份验证。
The differences between this memo and RFC 2178 are explained in Appendix G. All differences are backward-compatible in nature.
附录G解释了本备忘录与RFC 2178之间的差异。所有差异本质上都是向后兼容的。
Implementations of this memo and of RFCs 2178, 1583, and 1247 will interoperate.
本备忘录和RFC 2178、1583和1247的实施将互操作。
Please send comments to ospf@gated.cornell.edu.
请将意见发送至ospf@gated.cornell.edu.
Table of Contents
目录
1 Introduction ........................................... 6 1.1 Protocol Overview ...................................... 6 1.2 Definitions of commonly used terms ..................... 8 1.3 Brief history of link-state routing technology ........ 11 1.4 Organization of this document ......................... 12 1.5 Acknowledgments ....................................... 12 2 The link-state database: organization and calculations 13 2.1 Representation of routers and networks ................ 13 2.1.1 Representation of non-broadcast networks .............. 15 2.1.2 An example link-state database ........................ 18 2.2 The shortest-path tree ................................ 21 2.3 Use of external routing information ................... 23 2.4 Equal-cost multipath .................................. 26 3 Splitting the AS into Areas ........................... 26 3.1 The backbone of the Autonomous System ................. 27 3.2 Inter-area routing .................................... 27 3.3 Classification of routers ............................. 28 3.4 A sample area configuration ........................... 29 3.5 IP subnetting support ................................. 35 3.6 Supporting stub areas ................................. 37 3.7 Partitions of areas ................................... 38 4 Functional Summary .................................... 40 4.1 Inter-area routing .................................... 41 4.2 AS external routes .................................... 41 4.3 Routing protocol packets .............................. 42 4.4 Basic implementation requirements ..................... 43 4.5 Optional OSPF capabilities ............................ 46 5 Protocol data structures .............................. 47 6 The Area Data Structure ............................... 49 7 Bringing Up Adjacencies ............................... 52 7.1 The Hello Protocol .................................... 52 7.2 The Synchronization of Databases ...................... 53 7.3 The Designated Router ................................. 54 7.4 The Backup Designated Router .......................... 56 7.5 The graph of adjacencies .............................. 56
1 Introduction ........................................... 6 1.1 Protocol Overview ...................................... 6 1.2 Definitions of commonly used terms ..................... 8 1.3 Brief history of link-state routing technology ........ 11 1.4 Organization of this document ......................... 12 1.5 Acknowledgments ....................................... 12 2 The link-state database: organization and calculations 13 2.1 Representation of routers and networks ................ 13 2.1.1 Representation of non-broadcast networks .............. 15 2.1.2 An example link-state database ........................ 18 2.2 The shortest-path tree ................................ 21 2.3 Use of external routing information ................... 23 2.4 Equal-cost multipath .................................. 26 3 Splitting the AS into Areas ........................... 26 3.1 The backbone of the Autonomous System ................. 27 3.2 Inter-area routing .................................... 27 3.3 Classification of routers ............................. 28 3.4 A sample area configuration ........................... 29 3.5 IP subnetting support ................................. 35 3.6 Supporting stub areas ................................. 37 3.7 Partitions of areas ................................... 38 4 Functional Summary .................................... 40 4.1 Inter-area routing .................................... 41 4.2 AS external routes .................................... 41 4.3 Routing protocol packets .............................. 42 4.4 Basic implementation requirements ..................... 43 4.5 Optional OSPF capabilities ............................ 46 5 Protocol data structures .............................. 47 6 The Area Data Structure ............................... 49 7 Bringing Up Adjacencies ............................... 52 7.1 The Hello Protocol .................................... 52 7.2 The Synchronization of Databases ...................... 53 7.3 The Designated Router ................................. 54 7.4 The Backup Designated Router .......................... 56 7.5 The graph of adjacencies .............................. 56
8 Protocol Packet Processing ............................ 58 8.1 Sending protocol packets .............................. 58 8.2 Receiving protocol packets ............................ 61 9 The Interface Data Structure .......................... 63 9.1 Interface states ...................................... 67 9.2 Events causing interface state changes ................ 70 9.3 The Interface state machine ........................... 72 9.4 Electing the Designated Router ........................ 75 9.5 Sending Hello packets ................................. 77 9.5.1 Sending Hello packets on NBMA networks ................ 79 10 The Neighbor Data Structure ........................... 80 10.1 Neighbor states ....................................... 83 10.2 Events causing neighbor state changes ................. 87 10.3 The Neighbor state machine ............................ 89 10.4 Whether to become adjacent ............................ 95 10.5 Receiving Hello Packets ............................... 96 10.6 Receiving Database Description Packets ................ 99 10.7 Receiving Link State Request Packets ................. 102 10.8 Sending Database Description Packets ................. 103 10.9 Sending Link State Request Packets ................... 104 10.10 An Example ........................................... 105 11 The Routing Table Structure .......................... 107 11.1 Routing table lookup ................................. 111 11.2 Sample routing table, without areas .................. 111 11.3 Sample routing table, with areas ..................... 112 12 Link State Advertisements (LSAs) ..................... 115 12.1 The LSA Header ....................................... 116 12.1.1 LS age ............................................... 116 12.1.2 Options .............................................. 117 12.1.3 LS type .............................................. 117 12.1.4 Link State ID ........................................ 117 12.1.5 Advertising Router ................................... 119 12.1.6 LS sequence number ................................... 120 12.1.7 LS checksum .......................................... 121 12.2 The link state database .............................. 121 12.3 Representation of TOS ................................ 122 12.4 Originating LSAs ..................................... 123 12.4.1 Router-LSAs .......................................... 126 12.4.1.1 Describing point-to-point interfaces ................. 130 12.4.1.2 Describing broadcast and NBMA interfaces ............. 130 12.4.1.3 Describing virtual links ............................. 131 12.4.1.4 Describing Point-to-MultiPoint interfaces ............ 131
8 Protocol Packet Processing ............................ 58 8.1 Sending protocol packets .............................. 58 8.2 Receiving protocol packets ............................ 61 9 The Interface Data Structure .......................... 63 9.1 Interface states ...................................... 67 9.2 Events causing interface state changes ................ 70 9.3 The Interface state machine ........................... 72 9.4 Electing the Designated Router ........................ 75 9.5 Sending Hello packets ................................. 77 9.5.1 Sending Hello packets on NBMA networks ................ 79 10 The Neighbor Data Structure ........................... 80 10.1 Neighbor states ....................................... 83 10.2 Events causing neighbor state changes ................. 87 10.3 The Neighbor state machine ............................ 89 10.4 Whether to become adjacent ............................ 95 10.5 Receiving Hello Packets ............................... 96 10.6 Receiving Database Description Packets ................ 99 10.7 Receiving Link State Request Packets ................. 102 10.8 Sending Database Description Packets ................. 103 10.9 Sending Link State Request Packets ................... 104 10.10 An Example ........................................... 105 11 The Routing Table Structure .......................... 107 11.1 Routing table lookup ................................. 111 11.2 Sample routing table, without areas .................. 111 11.3 Sample routing table, with areas ..................... 112 12 Link State Advertisements (LSAs) ..................... 115 12.1 The LSA Header ....................................... 116 12.1.1 LS age ............................................... 116 12.1.2 Options .............................................. 117 12.1.3 LS type .............................................. 117 12.1.4 Link State ID ........................................ 117 12.1.5 Advertising Router ................................... 119 12.1.6 LS sequence number ................................... 120 12.1.7 LS checksum .......................................... 121 12.2 The link state database .............................. 121 12.3 Representation of TOS ................................ 122 12.4 Originating LSAs ..................................... 123 12.4.1 Router-LSAs .......................................... 126 12.4.1.1 Describing point-to-point interfaces ................. 130 12.4.1.2 Describing broadcast and NBMA interfaces ............. 130 12.4.1.3 Describing virtual links ............................. 131 12.4.1.4 Describing Point-to-MultiPoint interfaces ............ 131
12.4.1.5 Examples of router-LSAs .............................. 132 12.4.2 Network-LSAs ......................................... 133 12.4.2.1 Examples of network-LSAs ............................. 134 12.4.3 Summary-LSAs ......................................... 135 12.4.3.1 Originating summary-LSAs into stub areas ............. 137 12.4.3.2 Examples of summary-LSAs ............................. 138 12.4.4 AS-external-LSAs ..................................... 139 12.4.4.1 Examples of AS-external-LSAs ......................... 140 13 The Flooding Procedure ............................... 143 13.1 Determining which LSA is newer ....................... 146 13.2 Installing LSAs in the database ...................... 147 13.3 Next step in the flooding procedure .................. 148 13.4 Receiving self-originated LSAs ....................... 151 13.5 Sending Link State Acknowledgment packets ............ 152 13.6 Retransmitting LSAs .................................. 154 13.7 Receiving link state acknowledgments ................. 155 14 Aging The Link State Database ........................ 156 14.1 Premature aging of LSAs .............................. 157 15 Virtual Links ........................................ 158 16 Calculation of the routing table ..................... 160 16.1 Calculating the shortest-path tree for an area ....... 161 16.1.1 The next hop calculation ............................. 167 16.2 Calculating the inter-area routes .................... 178 16.3 Examining transit areas' summary-LSAs ................ 170 16.4 Calculating AS external routes ....................... 173 16.4.1 External path preferences ............................ 175 16.5 Incremental updates -- summary-LSAs .................. 175 16.6 Incremental updates -- AS-external-LSAs .............. 177 16.7 Events generated as a result of routing table changes 177 16.8 Equal-cost multipath ................................. 178 Footnotes ............................................ 179 References ........................................... 183 A OSPF data formats .................................... 185 A.1 Encapsulation of OSPF packets ........................ 185 A.2 The Options field .................................... 187 A.3 OSPF Packet Formats .................................. 189 A.3.1 The OSPF packet header ............................... 190 A.3.2 The Hello packet ..................................... 193 A.3.3 The Database Description packet ...................... 195 A.3.4 The Link State Request packet ........................ 197 A.3.5 The Link State Update packet ......................... 199 A.3.6 The Link State Acknowledgment packet ................. 201
12.4.1.5 Examples of router-LSAs .............................. 132 12.4.2 Network-LSAs ......................................... 133 12.4.2.1 Examples of network-LSAs ............................. 134 12.4.3 Summary-LSAs ......................................... 135 12.4.3.1 Originating summary-LSAs into stub areas ............. 137 12.4.3.2 Examples of summary-LSAs ............................. 138 12.4.4 AS-external-LSAs ..................................... 139 12.4.4.1 Examples of AS-external-LSAs ......................... 140 13 The Flooding Procedure ............................... 143 13.1 Determining which LSA is newer ....................... 146 13.2 Installing LSAs in the database ...................... 147 13.3 Next step in the flooding procedure .................. 148 13.4 Receiving self-originated LSAs ....................... 151 13.5 Sending Link State Acknowledgment packets ............ 152 13.6 Retransmitting LSAs .................................. 154 13.7 Receiving link state acknowledgments ................. 155 14 Aging The Link State Database ........................ 156 14.1 Premature aging of LSAs .............................. 157 15 Virtual Links ........................................ 158 16 Calculation of the routing table ..................... 160 16.1 Calculating the shortest-path tree for an area ....... 161 16.1.1 The next hop calculation ............................. 167 16.2 Calculating the inter-area routes .................... 178 16.3 Examining transit areas' summary-LSAs ................ 170 16.4 Calculating AS external routes ....................... 173 16.4.1 External path preferences ............................ 175 16.5 Incremental updates -- summary-LSAs .................. 175 16.6 Incremental updates -- AS-external-LSAs .............. 177 16.7 Events generated as a result of routing table changes 177 16.8 Equal-cost multipath ................................. 178 Footnotes ............................................ 179 References ........................................... 183 A OSPF data formats .................................... 185 A.1 Encapsulation of OSPF packets ........................ 185 A.2 The Options field .................................... 187 A.3 OSPF Packet Formats .................................. 189 A.3.1 The OSPF packet header ............................... 190 A.3.2 The Hello packet ..................................... 193 A.3.3 The Database Description packet ...................... 195 A.3.4 The Link State Request packet ........................ 197 A.3.5 The Link State Update packet ......................... 199 A.3.6 The Link State Acknowledgment packet ................. 201
A.4 LSA formats .......................................... 203 A.4.1 The LSA header ....................................... 204 A.4.2 Router-LSAs .......................................... 206 A.4.3 Network-LSAs ......................................... 210 A.4.4 Summary-LSAs ......................................... 212 A.4.5 AS-external-LSAs ..................................... 214 B Architectural Constants .............................. 217 C Configurable Constants ............................... 219 C.1 Global parameters .................................... 219 C.2 Area parameters ...................................... 220 C.3 Router interface parameters .......................... 221 C.4 Virtual link parameters .............................. 224 C.5 NBMA network parameters .............................. 224 C.6 Point-to-MultiPoint network parameters ............... 225 C.7 Host route parameters ................................ 226 D Authentication ....................................... 227 D.1 Null authentication .................................. 227 D.2 Simple password authentication ....................... 228 D.3 Cryptographic authentication ......................... 228 D.4 Message generation ................................... 231 D.4.1 Generating Null authentication ....................... 231 D.4.2 Generating Simple password authentication ............ 232 D.4.3 Generating Cryptographic authentication .............. 232 D.5 Message verification ................................. 234 D.5.1 Verifying Null authentication ........................ 234 D.5.2 Verifying Simple password authentication ............. 234 D.5.3 Verifying Cryptographic authentication ............... 235 E An algorithm for assigning Link State IDs ............ 236 F Multiple interfaces to the same network/subnet ....... 239 G Differences from RFC 2178 ............................ 240 G.1 Flooding modifications ............................... 240 G.2 Changes to external path preferences ................. 241 G.3 Incomplete resolution of virtual next hops ........... 241 G.4 Routing table lookup ................................. 241 Security Considerations .............................. 243 Author's Address ..................................... 243 Full Copyright Statement ............................. 244
A.4 LSA formats .......................................... 203 A.4.1 The LSA header ....................................... 204 A.4.2 Router-LSAs .......................................... 206 A.4.3 Network-LSAs ......................................... 210 A.4.4 Summary-LSAs ......................................... 212 A.4.5 AS-external-LSAs ..................................... 214 B Architectural Constants .............................. 217 C Configurable Constants ............................... 219 C.1 Global parameters .................................... 219 C.2 Area parameters ...................................... 220 C.3 Router interface parameters .......................... 221 C.4 Virtual link parameters .............................. 224 C.5 NBMA network parameters .............................. 224 C.6 Point-to-MultiPoint network parameters ............... 225 C.7 Host route parameters ................................ 226 D Authentication ....................................... 227 D.1 Null authentication .................................. 227 D.2 Simple password authentication ....................... 228 D.3 Cryptographic authentication ......................... 228 D.4 Message generation ................................... 231 D.4.1 Generating Null authentication ....................... 231 D.4.2 Generating Simple password authentication ............ 232 D.4.3 Generating Cryptographic authentication .............. 232 D.5 Message verification ................................. 234 D.5.1 Verifying Null authentication ........................ 234 D.5.2 Verifying Simple password authentication ............. 234 D.5.3 Verifying Cryptographic authentication ............... 235 E An algorithm for assigning Link State IDs ............ 236 F Multiple interfaces to the same network/subnet ....... 239 G Differences from RFC 2178 ............................ 240 G.1 Flooding modifications ............................... 240 G.2 Changes to external path preferences ................. 241 G.3 Incomplete resolution of virtual next hops ........... 241 G.4 Routing table lookup ................................. 241 Security Considerations .............................. 243 Author's Address ..................................... 243 Full Copyright Statement ............................. 244
This document is a specification of the Open Shortest Path First (OSPF) TCP/IP internet routing protocol. OSPF is classified as an Interior Gateway Protocol (IGP). This means that it distributes routing information between routers belonging to a single Autonomous System. The OSPF protocol is based on link-state or SPF technology. This is a departure from the Bellman-Ford base used by traditional TCP/IP internet routing protocols.
本文档是开放最短路径优先(OSPF)TCP/IP internet路由协议的规范。OSPF被归类为内部网关协议(IGP)。这意味着它在属于单个自治系统的路由器之间分配路由信息。OSPF协议基于链路状态或SPF技术。这与传统TCP/IP internet路由协议使用的Bellman Ford base不同。
The OSPF protocol was developed by the OSPF working group of the Internet Engineering Task Force. It has been designed expressly for the TCP/IP internet environment, including explicit support for CIDR and the tagging of externally-derived routing information. OSPF also provides for the authentication of routing updates, and utilizes IP multicast when sending/receiving the updates. In addition, much work has been done to produce a protocol that responds quickly to topology changes, yet involves small amounts of routing protocol traffic.
OSPF协议由互联网工程任务组的OSPF工作组开发。它专为TCP/IP internet环境设计,包括对CIDR的明确支持和外部派生路由信息的标记。OSPF还提供路由更新的身份验证,并在发送/接收更新时利用IP多播。此外,已经做了大量工作来生成一个能够快速响应拓扑变化的协议,但只涉及少量路由协议流量。
1.1. Protocol overview
1.1. 协议概述
OSPF routes IP packets based solely on the destination IP address found in the IP packet header. IP packets are routed "as is" -- they are not encapsulated in any further protocol headers as they transit the Autonomous System. OSPF is a dynamic routing protocol. It quickly detects topological changes in the AS (such as router interface failures) and calculates new loop-free routes after a period of convergence. This period of convergence is short and involves a minimum of routing traffic.
OSPF仅根据IP数据包头中的目标IP地址路由IP数据包。IP数据包按“原样”路由——它们在传输自治系统时不会封装在任何进一步的协议头中。OSPF是一种动态路由协议。它可以快速检测AS中的拓扑变化(如路由器接口故障),并在一段时间的收敛后计算新的无环路路由。这一收敛期很短,涉及的路由流量最少。
In a link-state routing protocol, each router maintains a database describing the Autonomous System's topology. This database is referred to as the link-state database. Each participating router has an identical database. Each individual piece of this database is a particular router's local state (e.g., the router's usable interfaces and reachable neighbors). The router distributes its local state throughout the Autonomous System by flooding.
在链路状态路由协议中,每个路由器维护一个描述自治系统拓扑的数据库。此数据库称为链接状态数据库。每个参与路由器都有一个相同的数据库。该数据库的每个单独部分都是特定路由器的本地状态(例如,路由器的可用接口和可访问邻居)。路由器通过泛洪将其本地状态分布到整个自治系统中。
All routers run the exact same algorithm, in parallel. From the link-state database, each router constructs a tree of shortest paths with itself as root. This shortest-path tree gives the route to each destination in the Autonomous System. Externally derived routing information appears on the tree as leaves.
所有路由器并行运行完全相同的算法。从链路状态数据库中,每个路由器构建一个以自身为根的最短路径树。该最短路径树给出了到自治系统中每个目的地的路径。外部派生的路由信息在树上显示为叶子。
When several equal-cost routes to a destination exist, traffic is distributed equally among them. The cost of a route is described by a single dimensionless metric.
当存在多条到一个目的地的成本相等的路线时,流量在它们之间平均分配。一条路线的成本由一个单一的无量纲指标来描述。
OSPF allows sets of networks to be grouped together. Such a grouping is called an area. The topology of an area is hidden from the rest of the Autonomous System. This information hiding enables a significant reduction in routing traffic. Also, routing within the area is determined only by the area's own topology, lending the area protection from bad routing data. An area is a generalization of an IP subnetted network.
OSPF允许将多组网络分组在一起。这种分组称为区域。区域的拓扑结构对自治系统的其余部分隐藏。这种信息隐藏可以显著减少路由流量。此外,区域内的路由仅由区域自身的拓扑决定,从而使区域免受不良路由数据的影响。区域是IP子网网络的泛化。
OSPF enables the flexible configuration of IP subnets. Each route distributed by OSPF has a destination and mask. Two different subnets of the same IP network number may have different sizes (i.e., different masks). This is commonly referred to as variable length subnetting. A packet is routed to the best (i.e., longest or most specific) match. Host routes are considered to be subnets whose masks are "all ones" (0xffffffff).
OSPF支持灵活配置IP子网。OSPF分发的每个路由都有一个目的地和掩码。相同IP网络号的两个不同子网可能具有不同的大小(即,不同的掩码)。这通常称为可变长度子网。数据包被路由到最佳(即最长或最特定)匹配。主机路由被认为是其掩码为“所有”的子网(0xFFFFFF)。
All OSPF protocol exchanges are authenticated. This means that only trusted routers can participate in the Autonomous System's routing. A variety of authentication schemes can be used; in fact, separate authentication schemes can be configured for each IP subnet.
所有OSPF协议交换都经过身份验证。这意味着只有受信任的路由器才能参与自治系统的路由。可以使用多种身份验证方案;事实上,可以为每个IP子网配置单独的身份验证方案。
Externally derived routing data (e.g., routes learned from an Exterior Gateway Protocol such as BGP; see [Ref23]) is advertised throughout the Autonomous System. This externally derived data is kept separate from the OSPF protocol's link state data. Each external route can also be tagged by the advertising router, enabling the passing of additional information between routers on the boundary of the Autonomous System.
外部派生的路由数据(例如,从外部网关协议(如BGP)学习的路由;参见[Ref23])在整个自治系统中公布。此外部派生的数据与OSPF协议的链路状态数据分开保存。每个外部路由也可以由广告路由器标记,从而能够在自治系统边界上的路由器之间传递附加信息。
1.2. Definitions of commonly used terms
1.2. 常用术语的定义
This section provides definitions for terms that have a specific meaning to the OSPF protocol and that are used throughout the text. The reader unfamiliar with the Internet Protocol Suite is referred to [Ref13] for an introduction to IP.
本节提供了对OSPF协议具有特定含义且贯穿全文的术语的定义。不熟悉互联网协议套件的读者可参考[Ref13]了解IP简介。
Router A level three Internet Protocol packet switch. Formerly called a gateway in much of the IP literature.
路由器一个三级互联网协议分组交换机。以前在许多IP文献中称为网关。
Autonomous System A group of routers exchanging routing information via a common routing protocol. Abbreviated as AS.
自治系统一组路由器,通过公共路由协议交换路由信息。缩写为。
Interior Gateway Protocol The routing protocol spoken by the routers belonging to an Autonomous system. Abbreviated as IGP. Each Autonomous System has a single IGP. Separate Autonomous Systems may be running different IGPs.
内部网关协议属于自治系统的路由器所说的路由协议。缩写为IGP。每个自治系统都有一个IGP。独立的自治系统可能运行不同的IGP。
Router ID A 32-bit number assigned to each router running the OSPF protocol. This number uniquely identifies the router within an Autonomous System.
路由器ID分配给每个运行OSPF协议的路由器的32位数字。此编号唯一标识自治系统中的路由器。
Network In this memo, an IP network/subnet/supernet. It is possible for one physical network to be assigned multiple IP network/subnet numbers. We consider these to be separate networks. Point-to-point physical networks are an exception - they are considered a single network no matter how many (if any at all) IP network/subnet numbers are assigned to them.
网络在此备忘录中,是一个IP网络/子网/超级网。一个物理网络可以分配多个IP网络/子网编号。我们认为这些是独立的网络。点对点物理网络是一个例外-无论为它们分配了多少(如果有的话)IP网络/子网号,它们都被视为单个网络。
Network mask A 32-bit number indicating the range of IP addresses residing on a single IP network/subnet/supernet. This specification displays network masks as hexadecimal numbers.
网络掩码一个32位数字,指示驻留在单个IP网络/子网/超网上的IP地址范围。此规范将网络掩码显示为十六进制数。
For example, the network mask for a class C IP network is displayed as 0xffffff00. Such a mask is often displayed elsewhere in the literature as 255.255.255.0.
例如,C类IP网络的网络掩码显示为0xFFFF00。此类遮罩通常在文献中的其他地方显示为255.255.255.0。
Point-to-point networks A network that joins a single pair of routers. A 56Kb serial line is an example of a point-to-point network.
点对点网络连接一对路由器的网络。56Kb串行线是点到点网络的一个示例。
Broadcast networks Networks supporting many (more than two) attached routers, together with the capability to address a single physical message to all of the attached routers (broadcast). Neighboring routers are discovered dynamically on these nets using OSPF's Hello Protocol. The Hello Protocol itself takes advantage of the broadcast capability. The OSPF protocol makes further use of multicast capabilities, if they exist. Each pair of routers on a broadcast network is assumed to be able to communicate directly. An ethernet is an example of a broadcast network.
广播网络支持多个(两个以上)连接路由器的网络,以及向所有连接路由器发送单个物理消息的能力(广播)。使用OSPF的Hello协议在这些网络上动态发现相邻路由器。Hello协议本身利用了广播功能。OSPF协议进一步利用了多播功能(如果有的话)。假定广播网络上的每对路由器都能够直接通信。以太网是广播网络的一个示例。
Non-broadcast networks Networks supporting many (more than two) routers, but having no broadcast capability. Neighboring routers are maintained on these nets using OSPF's Hello Protocol. However, due to the lack of broadcast capability, some configuration information may be necessary to aid in the discovery of neighbors. On non-broadcast networks, OSPF protocol packets that are normally multicast need to be sent to each neighboring router, in turn. An X.25 Public Data Network (PDN) is an example of a non-broadcast network.
非广播网络支持多个(两个以上)路由器但没有广播能力的网络。相邻路由器使用OSPF的Hello协议维护在这些网络上。然而,由于缺乏广播能力,可能需要一些配置信息来帮助发现邻居。在非广播网络上,通常为多播的OSPF协议包需要依次发送到每个相邻路由器。X.25公共数据网络(PDN)是非广播网络的一个示例。
OSPF runs in one of two modes over non-broadcast networks. The first mode, called non-broadcast multi-access or NBMA, simulates the operation of OSPF on a broadcast network. The second mode, called Point-to-MultiPoint, treats the non-broadcast network as a collection of point-to-point links. Non-broadcast networks are referred to as NBMA networks or Point-to-MultiPoint networks, depending on OSPF's mode of operation over the network.
OSPF在非广播网络上以两种模式之一运行。第一种模式称为非广播多址或NBMA,模拟广播网络上OSPF的操作。第二种模式称为点对多点,将非广播网络视为点对点链路的集合。非广播网络称为NBMA网络或点对多点网络,具体取决于OSPF在网络上的操作模式。
Interface The connection between a router and one of its attached networks. An interface has state information associated with it, which is obtained from the underlying lower level protocols and the routing protocol itself. An interface to a network has associated with it a single IP address and mask (unless the network is an unnumbered point-to-point network). An interface is sometimes also referred to as a link.
接口路由器与其连接的网络之间的连接。接口具有与之相关联的状态信息,这些信息从底层低层协议和路由协议本身获得。网络接口与单个IP地址和掩码相关联(除非网络是未编号的点对点网络)。接口有时也称为链接。
Neighboring routers Two routers that have interfaces to a common network. Neighbor relationships are maintained by, and usually dynamically discovered by, OSPF's Hello Protocol.
相邻路由器两个与公共网络有接口的路由器。邻居关系由OSPF的Hello协议维护,通常由OSPF的Hello协议动态发现。
Adjacency A relationship formed between selected neighboring routers for the purpose of exchanging routing information. Not every pair of neighboring routers become adjacent.
为了交换路由信息,在选定的相邻路由器之间形成的一种关系。并不是每对相邻的路由器都变得相邻。
Link state advertisement Unit of data describing the local state of a router or network. For a router, this includes the state of the router's interfaces and adjacencies. Each link state advertisement is flooded throughout the routing domain. The collected link state advertisements of all routers and networks forms the protocol's link state database. Throughout this memo, link state advertisement is abbreviated as LSA.
描述路由器或网络的本地状态的数据的链路状态播发单元。对于路由器,这包括路由器接口和邻接的状态。每个链路状态播发都会淹没整个路由域。收集的所有路由器和网络的链路状态广告构成协议的链路状态数据库。在本备忘录中,链接状态广告缩写为LSA。
Hello Protocol The part of the OSPF protocol used to establish and maintain neighbor relationships. On broadcast networks the Hello Protocol can also dynamically discover neighboring routers.
Hello协议OSPF协议中用于建立和维护邻居关系的部分。在广播网络上,Hello协议还可以动态发现相邻路由器。
Flooding The part of the OSPF protocol that distributes and synchronizes the link-state database between OSPF routers.
泛洪OSPF协议中在OSPF路由器之间分发和同步链路状态数据库的部分。
Designated Router Each broadcast and NBMA network that has at least two attached routers has a Designated Router. The Designated
指定路由器至少有两个连接路由器的每个广播和NBMA网络都有一个指定路由器。指定的
Router generates an LSA for the network and has other special responsibilities in the running of the protocol. The Designated Router is elected by the Hello Protocol.
路由器为网络生成LSA,并在协议运行过程中承担其他特殊责任。指定的路由器由Hello协议选择。
The Designated Router concept enables a reduction in the number of adjacencies required on a broadcast or NBMA network. This in turn reduces the amount of routing protocol traffic and the size of the link-state database.
指定路由器概念能够减少广播或NBMA网络上所需的邻接数量。这反过来又减少了路由协议通信量和链路状态数据库的大小。
Lower-level protocols The underlying network access protocols that provide services to the Internet Protocol and in turn the OSPF protocol. Examples of these are the X.25 packet and frame levels for X.25 PDNs, and the ethernet data link layer for ethernets.
较低级别协议为Internet协议和OSPF协议提供服务的底层网络访问协议。例如,X.25 PDN的X.25数据包和帧级别,以及以太网的以太网数据链路层。
1.3. Brief history of link-state routing technology
1.3. 链路状态路由技术简史
OSPF is a link state routing protocol. Such protocols are also referred to in the literature as SPF-based or distributed-database protocols. This section gives a brief description of the developments in link-state technology that have influenced the OSPF protocol.
OSPF是一种链路状态路由协议。此类协议在文献中也被称为基于SPF的或分布式数据库协议。本节简要介绍了影响OSPF协议的链路状态技术的发展。
The first link-state routing protocol was developed for use in the ARPANET packet switching network. This protocol is described in [Ref3]. It has formed the starting point for all other link-state protocols. The homogeneous ARPANET environment, i.e., single-vendor packet switches connected by synchronous serial lines, simplified the design and implementation of the original protocol.
第一个链路状态路由协议是为在ARPANET分组交换网络中使用而开发的。参考文献3中描述了该协议。它已成为所有其他链路状态协议的起点。同质ARPANET环境,即通过同步串行线连接的单供应商分组交换机,简化了原始协议的设计和实现。
Modifications to this protocol were proposed in [Ref4]. These modifications dealt with increasing the fault tolerance of the routing protocol through, among other things, adding a checksum to the LSAs (thereby detecting database corruption). The paper also included means for reducing the routing traffic overhead in a link-state protocol. This was accomplished by introducing mechanisms which enabled the interval between LSA originations to be increased by an order of magnitude.
参考文献4中提出了对该方案的修改。这些修改主要通过向LSA添加校验和(从而检测数据库损坏)来提高路由协议的容错性。本文还包括减少链路状态协议中路由通信开销的方法。这是通过引入机制实现的,该机制使LSA发起之间的间隔增加了一个数量级。
A link-state algorithm has also been proposed for use as an ISO IS-IS routing protocol. This protocol is described in [Ref2]. The protocol includes methods for data and routing traffic reduction when operating over broadcast networks. This is accomplished by election of a Designated Router for each broadcast network, which then originates an LSA for the network.
还提出了一种链路状态算法,用作ISO IS-IS路由协议。该协议在[参考文献2]中进行了描述。该协议包括在广播网络上运行时减少数据和路由流量的方法。这是通过为每个广播网络选择一个指定的路由器来实现的,然后该路由器为该网络发起一个LSA。
The OSPF Working Group of the IETF has extended this work in developing the OSPF protocol. The Designated Router concept has been greatly enhanced to further reduce the amount of routing traffic required. Multicast capabilities are utilized for additional routing bandwidth reduction. An area routing scheme has been developed enabling information hiding/protection/reduction. Finally, the algorithms have been tailored for efficient operation in TCP/IP internets.
IETF的OSPF工作组在开发OSPF协议时扩展了这项工作。指定路由器的概念已大大增强,以进一步减少所需的路由流量。多播功能用于减少额外的路由带宽。开发了一种区域路由方案,可实现信息隐藏/保护/减少。最后,为了在TCP/IP互联网上高效运行,对算法进行了定制。
1.4. Organization of this document
1.4. 本文件的组织
The first three sections of this specification give a general overview of the protocol's capabilities and functions. Sections 4-16 explain the protocol's mechanisms in detail. Packet formats, protocol constants and configuration items are specified in the appendices.
本规范的前三节概述了协议的功能和功能。第4-16节详细解释了协议的机制。数据包格式、协议常数和配置项在附录中规定。
Labels such as HelloInterval encountered in the text refer to protocol constants. They may or may not be configurable. Architectural constants are summarized in Appendix B. Configurable constants are summarized in Appendix C.
文本中遇到的HelloInterval等标签指的是协议常量。它们可能是可配置的,也可能不是可配置的。附录B总结了体系结构常数。附录C总结了可配置常数。
The detailed specification of the protocol is presented in terms of data structures. This is done in order to make the explanation more precise. Implementations of the protocol are required to support the functionality described, but need not use the precise data structures that appear in this memo.
协议的详细说明是从数据结构的角度给出的。这样做是为了使解释更精确。协议的实现需要支持所描述的功能,但不需要使用本备忘录中显示的精确数据结构。
1.5. Acknowledgments
1.5. 致谢
The author would like to thank Ran Atkinson, Fred Baker, Jeffrey Burgan, Rob Coltun, Dino Farinacci, Vince Fuller, Phanindra Jujjavarapu, Milo Medin, Tom Pusateri, Kannan Varadhan, Zhaohui
作者要感谢Ran Atkinson、Fred Baker、Jeffrey Burgan、Rob Coltun、Dino Farinaci、Vince Fuller、Phanindra Jujjavarapu、Milo Medin、Tom Pusateri、Kannan Varadhan、赵晖
Zhang and the rest of the OSPF Working Group for the ideas and support they have given to this project.
张和OSPF工作组的其他成员感谢他们对该项目的想法和支持。
The OSPF Point-to-MultiPoint interface is based on work done by Fred Baker.
OSPF点对多点接口基于Fred Baker所做的工作。
The OSPF Cryptographic Authentication option was developed by Fred Baker and Ran Atkinson.
OSPF加密认证选项由Fred Baker开发并运行Atkinson。
The following subsections describe the organization of OSPF's link-state database, and the routing calculations that are performed on the database in order to produce a router's routing table.
以下小节描述了OSPF链路状态数据库的组织,以及为生成路由器路由表而在数据库上执行的路由计算。
2.1. Representation of routers and networks
2.1. 路由器和网络的表示
The Autonomous System's link-state database describes a directed graph. The vertices of the graph consist of routers and networks. A graph edge connects two routers when they are attached via a physical point-to-point network. An edge connecting a router to a network indicates that the router has an interface on the network. Networks can be either transit or stub networks. Transit networks are those capable of carrying data traffic that is neither locally originated nor locally destined. A transit network is represented by a graph vertex having both incoming and outgoing edges. A stub network's vertex has only incoming edges.
自治系统的链路状态数据库描述了一个有向图。图的顶点由路由器和网络组成。当两个路由器通过物理点对点网络连接时,图边连接两个路由器。将路由器连接到网络的边缘表示路由器在网络上有接口。网络可以是传输网络或存根网络。公交网络是那些能够承载既不是本地发起的也不是本地目的地的数据流量的网络。公交网络由一个同时具有输入和输出边的图顶点表示。存根网络的顶点只有传入边。
The neighborhood of each network node in the graph depends on the network's type (point-to-point, broadcast, NBMA or Point-to-MultiPoint) and the number of routers having an interface to the network. Three cases are depicted in Figure 1a. Rectangles indicate routers. Circles and oblongs indicate networks. Router names are prefixed with the letters RT and network names with the letter N. Router interface names are prefixed by the letter I. Lines between routers indicate point-to-point networks. The left side of the figure shows networks with their connected routers, with the resulting graphs shown on the right.
图中每个网络节点的邻域取决于网络的类型(点对点、广播、NBMA或点对多点)和具有网络接口的路由器的数量。图1a中描述了三种情况。矩形表示路由器。圆圈和长方形表示网络。路由器名称的前缀为字母RT,网络名称的前缀为字母N。路由器接口名称的前缀为字母I。路由器之间的线表示点对点网络。图的左侧显示了网络及其连接的路由器,结果图显示在右侧。
**FROM**
**FROM**
* |RT1|RT2| +---+Ia +---+ * ------------ |RT1|------|RT2| T RT1| | X | +---+ Ib+---+ O RT2| X | | * Ia| | X | * Ib| X | |
* |RT1|RT2| +---+Ia +---+ * ------------ |RT1|------|RT2| T RT1| | X | +---+ Ib+---+ O RT2| X | | * Ia| | X | * Ib| X | |
Physical point-to-point networks
物理点对点网络
**FROM** +---+ * |RT7| * |RT7| N3| +---+ T ------------ | O RT7| | | +----------------------+ * N3| X | | N3 *
**FROM** +---+ * |RT7| * |RT7| N3| +---+ T ------------ | O RT7| | | +----------------------+ * N3| X | | N3 *
Stub networks
终端网络
**FROM** +---+ +---+ |RT3| |RT4| |RT3|RT4|RT5|RT6|N2 | +---+ +---+ * ------------------------ | N2 | * RT3| | | | | X | +----------------------+ T RT4| | | | | X | | | O RT5| | | | | X | +---+ +---+ * RT6| | | | | X | |RT5| |RT6| * N2| X | X | X | X | | +---+ +---+
**FROM** +---+ +---+ |RT3| |RT4| |RT3|RT4|RT5|RT6|N2 | +---+ +---+ * ------------------------ | N2 | * RT3| | | | | X | +----------------------+ T RT4| | | | | X | | | O RT5| | | | | X | +---+ +---+ * RT6| | | | | X | |RT5| |RT6| * N2| X | X | X | X | | +---+ +---+
Broadcast or NBMA networks
广播或NBMA网络
Figure 1a: Network map components
图1a:网络地图组件
Networks and routers are represented by vertices. An edge connects Vertex A to Vertex B iff the intersection of Column A and Row B is marked with an X.
网络和路由器由顶点表示。当列A和行B的交点标有X时,边将顶点A连接到顶点B。
The top of Figure 1a shows two routers connected by a point-to-point link. In the resulting link-state database graph, the two router vertices are directly connected by a pair of edges, one in each direction. Interfaces to point-to-point networks need not be assigned IP addresses. When interface addresses are assigned, they are modelled as stub links, with each router advertising a stub connection to the other router's interface address. Optionally, an IP subnet can be assigned to the point-to-point network. In this case, both routers advertise a stub link to the IP subnet, instead of advertising each others' IP interface addresses.
图1a的顶部显示了通过点对点链路连接的两个路由器。在生成的链接状态数据库图中,两个路由器顶点由一对边直接连接,每个方向一条。点到点网络的接口不需要分配IP地址。分配接口地址时,它们被建模为存根链接,每个路由器向另一个路由器的接口地址播发存根连接。或者,可以将IP子网分配给点到点网络。在这种情况下,两个路由器都会公布到IP子网的存根链接,而不是公布彼此的IP接口地址。
The middle of Figure 1a shows a network with only one attached router (i.e., a stub network). In this case, the network appears on the end of a stub connection in the link-state database's graph.
图1a的中间部分显示了一个只有一个连接路由器的网络(即存根网络)。在这种情况下,网络出现在链路状态数据库图形中存根连接的末尾。
When multiple routers are attached to a broadcast network, the link-state database graph shows all routers bidirectionally connected to the network vertex. This is pictured at the bottom of Figure 1a.
当多个路由器连接到广播网络时,链路状态数据库图显示所有双向连接到网络顶点的路由器。如图1a底部所示。
Each network (stub or transit) in the graph has an IP address and associated network mask. The mask indicates the number of nodes on the network. Hosts attached directly to routers (referred to as host routes) appear on the graph as stub networks. The network mask for a host route is always 0xffffffff, which indicates the presence of a single node.
图中的每个网络(存根或传输)都有一个IP地址和相关的网络掩码。掩码指示网络上的节点数。直接连接到路由器的主机(称为主机路由)在图上显示为存根网络。主机路由的网络掩码始终为0xffffffff,这表示存在单个节点。
2.1.1. Representation of non-broadcast networks
2.1.1. 非广播网络的表示
As mentioned previously, OSPF can run over non-broadcast networks in one of two modes: NBMA or Point-to-MultiPoint. The choice of mode determines the way that the Hello
如前所述,OSPF可以以两种模式之一在非广播网络上运行:NBMA或点对多点。模式的选择决定了问候的方式
protocol and flooding work over the non-broadcast network, and the way that the network is represented in the link-state database.
协议和泛洪在非广播网络上工作,以及在链路状态数据库中表示网络的方式。
In NBMA mode, OSPF emulates operation over a broadcast network: a Designated Router is elected for the NBMA network, and the Designated Router originates an LSA for the network. The graph representation for broadcast networks and NBMA networks is identical. This representation is pictured in the middle of Figure 1a.
在NBMA模式下,OSPF模拟广播网络上的操作:为NBMA网络选择指定路由器,指定路由器为网络发起LSA。广播网络和NBMA网络的图形表示是相同的。这个表示被描绘在图1A的中间。
NBMA mode is the most efficient way to run OSPF over non-broadcast networks, both in terms of link-state database size and in terms of the amount of routing protocol traffic. However, it has one significant restriction: it requires all routers attached to the NBMA network to be able to communicate directly. This restriction may be met on some non-broadcast networks, such as an ATM subnet utilizing SVCs. But it is often not met on other non-broadcast networks, such as PVC-only Frame Relay networks. On non-broadcast networks where not all routers can communicate directly you can break the non-broadcast network into logical subnets, with the routers on each subnet being able to communicate directly, and then run each separate subnet as an NBMA network (see [Ref15]). This however requires quite a bit of administrative overhead, and is prone to misconfiguration. It is probably better to run such a non-broadcast network in Point-to-Multipoint mode.
NBMA模式是在非广播网络上运行OSPF的最有效方式,无论是在链路状态数据库大小还是在路由协议流量方面。然而,它有一个重要的限制:它要求连接到NBMA网络的所有路由器能够直接通信。在某些非广播网络上,例如使用SVC的ATM子网,可能会满足此限制。但在其他非广播网络上,如仅限PVC的帧中继网络上,通常无法满足这一要求。在并非所有路由器都可以直接通信的非广播网络上,您可以将非广播网络划分为逻辑子网,每个子网上的路由器都可以直接通信,然后将每个单独的子网作为NBMA网络运行(参见[Ref15])。然而,这需要相当多的管理开销,并且容易出现配置错误。以点对多点模式运行这样一个非广播网络可能更好。
In Point-to-MultiPoint mode, OSPF treats all router-to-router connections over the non-broadcast network as if they were point-to-point links. No Designated Router is elected for the network, nor is there an LSA generated for the network. In fact, a vertex for the Point-to-MultiPoint network does not appear in the graph of the link-state database.
在点对多点模式下,OSPF将非广播网络上的所有路由器对路由器连接视为点对点链路。没有为网络选择指定的路由器,也没有为网络生成LSA。事实上,点对多点网络的顶点不会出现在链接状态数据库的图形中。
Figure 1b illustrates the link-state database representation of a Point-to-MultiPoint network. On the left side of the figure, a Point-to-MultiPoint network is pictured. It is assumed that all routers can communicate directly, except for routers RT4 and RT5. I3 though I6 indicate the routers'
图1b说明了点对多点网络的链路状态数据库表示。图的左侧显示了一个点对多点网络。假设除路由器RT4和RT5外,所有路由器都可以直接通信。I3到I6表示路由器的
IP interface addresses on the Point-to-MultiPoint network. In the graphical representation of the link-state database, routers that can communicate directly over the Point-to-MultiPoint network are joined by bidirectional edges, and each router also has a stub connection to its own IP interface address (which is in contrast to the representation of real point-to-point links; see Figure 1a).
点对多点网络上的IP接口地址。在链路状态数据库的图形表示中,可通过点对多点网络直接通信的路由器通过双向边缘连接,并且每个路由器还具有到其自身IP接口地址的存根连接(这与真实点对点链路的表示相反;见图1a)。
On some non-broadcast networks, use of Point-to-MultiPoint mode and data-link protocols such as Inverse ARP (see [Ref14]) will allow autodiscovery of OSPF neighbors even though broadcast support is not available.
在一些非广播网络上,使用点对多点模式和数据链路协议,如反向ARP(参见[Ref14]),将允许自动发现OSPF邻居,即使广播支持不可用。
**FROM** +---+ +---+ |RT3| |RT4| |RT3|RT4|RT5|RT6| +---+ +---+ * -------------------- I3| N2 |I4 * RT3| | X | X | X | +----------------------+ T RT4| X | | | X | I5| |I6 O RT5| X | | | X | +---+ +---+ * RT6| X | X | X | | |RT5| |RT6| * I3| X | | | | +---+ +---+ I4| | X | | | I5| | | X | | I6| | | | X |
**FROM** +---+ +---+ |RT3| |RT4| |RT3|RT4|RT5|RT6| +---+ +---+ * -------------------- I3| N2 |I4 * RT3| | X | X | X | +----------------------+ T RT4| X | | | X | I5| |I6 O RT5| X | | | X | +---+ +---+ * RT6| X | X | X | | |RT5| |RT6| * I3| X | | | | +---+ +---+ I4| | X | | | I5| | | X | | I6| | | | X |
Figure 1b: Network map components Point-to-MultiPoint networks
图1b:网络图组件点对多点网络
All routers can communicate directly over N2, except routers RT4 and RT5. I3 through I6 indicate IP interface addresses
除路由器RT4和RT5外,所有路由器都可以通过N2直接通信。I3到I6表示IP接口地址
2.1.2. An example link-state database
2.1.2. 链接状态数据库示例
Figure 2 shows a sample map of an Autonomous System. The rectangle labelled H1 indicates a host, which has a SLIP connection to Router RT12. Router RT12 is therefore advertising a host route. Lines between routers indicate physical point-to-point networks. The only point-to-point network that has been assigned interface addresses is the one joining Routers RT6 and RT10. Routers RT5 and RT7 have BGP connections to other Autonomous Systems. A set of BGP-learned routes have been displayed for both of these routers.
图2显示了自治系统的示例图。标记为H1的矩形表示主机,该主机与路由器RT12有滑动连接。因此,路由器RT12正在播发主机路由。路由器之间的线路表示物理点对点网络。唯一被分配接口地址的点对点网络是连接路由器RT6和RT10的网络。路由器RT5和RT7具有到其他自治系统的BGP连接。这两个路由器都显示了一组BGP学习路由。
A cost is associated with the output side of each router interface. This cost is configurable by the system administrator. The lower the cost, the more likely the interface is to be used to forward data traffic. Costs are also associated with the externally derived routing data (e.g., the BGP-learned routes).
成本与每个路由器接口的输出端相关。此成本可由系统管理员配置。成本越低,接口用于转发数据流量的可能性就越大。成本还与外部导出的路由数据(例如,BGP学习的路由)相关。
The directed graph resulting from the map in Figure 2 is depicted in Figure 3. Arcs are labelled with the cost of the corresponding router output interface. Arcs having no labelled cost have a cost of 0. Note that arcs leading from networks to routers always have cost 0; they are significant nonetheless. Note also that the externally derived routing data appears on the graph as stubs.
由图2中的映射生成的有向图如图3所示。弧标上相应路由器输出接口的成本。没有标记成本的弧的成本为0。请注意,从网络到路由器的弧的成本始终为0;尽管如此,它们意义重大。还要注意,外部派生的路由数据在图形上显示为存根。
The link-state database is pieced together from LSAs generated by the routers. In the associated graphical representation, the neighborhood of each router or transit network is represented in a single, separate LSA. Figure 4 shows these LSAs graphically. Router RT12 has an interface to two broadcast networks and a SLIP line to a host. Network N6 is a broadcast network with three attached routers. The cost of all links from Network N6 to its attached routers is 0. Note that the LSA for Network N6 is actually generated by one of the network's attached routers: the router that has been elected Designated Router for the network.
链路状态数据库由路由器生成的LSA拼凑而成。在相关的图形表示中,每个路由器或传输网络的邻域在单个单独的LSA中表示。图4以图形方式显示了这些LSA。路由器RT12有一个到两个广播网络的接口和一个到主机的滑线。网络N6是一个带有三个连接路由器的广播网络。从网络N6到其连接的路由器的所有链路的成本为0。请注意,网络N6的LSA实际上是由网络连接的路由器之一生成的:被选为网络指定路由器的路由器。
+ | 3+---+ N12 N14 N1|--|RT1|\ 1 \ N13 / | +---+ \ 8\ |8/8 + \ ____ \|/ / \ 1+---+8 8+---+6 * N3 *---|RT4|------|RT5|--------+ \____/ +---+ +---+ | + / | |7 | | 3+---+ / | | | N2|--|RT2|/1 |1 |6 | | +---+ +---+8 6+---+ | + |RT3|--------------|RT6| | +---+ +---+ | |2 Ia|7 | | | | +---------+ | | N4 | | | | | | N11 | | +---------+ | | | | | N12 |3 | |6 2/ +---+ | +---+/ |RT9| | |RT7|---N15 +---+ | +---+ 9 |1 + | |1 _|__ | Ib|5 __|_ / \ 1+----+2 | 3+----+1 / \ * N9 *------|RT11|----|---|RT10|---* N6 * \____/ +----+ | +----+ \____/ | | | |1 + |1 +--+ 10+----+ N8 +---+ |H1|-----|RT12| |RT8| +--+SLIP +----+ +---+ |2 |4 | | +---------+ +--------+ N10 N7
+ | 3+---+ N12 N14 N1|--|RT1|\ 1 \ N13 / | +---+ \ 8\ |8/8 + \ ____ \|/ / \ 1+---+8 8+---+6 * N3 *---|RT4|------|RT5|--------+ \____/ +---+ +---+ | + / | |7 | | 3+---+ / | | | N2|--|RT2|/1 |1 |6 | | +---+ +---+8 6+---+ | + |RT3|--------------|RT6| | +---+ +---+ | |2 Ia|7 | | | | +---------+ | | N4 | | | | | | N11 | | +---------+ | | | | | N12 |3 | |6 2/ +---+ | +---+/ |RT9| | |RT7|---N15 +---+ | +---+ 9 |1 + | |1 _|__ | Ib|5 __|_ / \ 1+----+2 | 3+----+1 / \ * N9 *------|RT11|----|---|RT10|---* N6 * \____/ +----+ | +----+ \____/ | | | |1 + |1 +--+ 10+----+ N8 +---+ |H1|-----|RT12| |RT8| +--+SLIP +----+ +---+ |2 |4 | | +---------+ +--------+ N10 N7
Figure 2: A sample Autonomous System
图2:一个示例自治系统
**FROM**
**FROM**
|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT| |1 |2 |3 |4 |5 |6 |7 |8 |9 |10|11|12|N3|N6|N8|N9| ----- --------------------------------------------- RT1| | | | | | | | | | | | |0 | | | | RT2| | | | | | | | | | | | |0 | | | | RT3| | | | | |6 | | | | | | |0 | | | | RT4| | | | |8 | | | | | | | |0 | | | | RT5| | | |8 | |6 |6 | | | | | | | | | | RT6| | |8 | |7 | | | | |5 | | | | | | | RT7| | | | |6 | | | | | | | | |0 | | | * RT8| | | | | | | | | | | | | |0 | | | * RT9| | | | | | | | | | | | | | | |0 | T RT10| | | | | |7 | | | | | | | |0 |0 | | O RT11| | | | | | | | | | | | | | |0 |0 | * RT12| | | | | | | | | | | | | | | |0 | * N1|3 | | | | | | | | | | | | | | | | N2| |3 | | | | | | | | | | | | | | | N3|1 |1 |1 |1 | | | | | | | | | | | | | N4| | |2 | | | | | | | | | | | | | | N6| | | | | | |1 |1 | |1 | | | | | | | N7| | | | | | | |4 | | | | | | | | | N8| | | | | | | | | |3 |2 | | | | | | N9| | | | | | | | |1 | |1 |1 | | | | | N10| | | | | | | | | | | |2 | | | | | N11| | | | | | | | |3 | | | | | | | | N12| | | | |8 | |2 | | | | | | | | | | N13| | | | |8 | | | | | | | | | | | | N14| | | | |8 | | | | | | | | | | | | N15| | | | | | |9 | | | | | | | | | | H1| | | | | | | | | | | |10| | | | |
|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT| |1 |2 |3 |4 |5 |6 |7 |8 |9 |10|11|12|N3|N6|N8|N9| ----- --------------------------------------------- RT1| | | | | | | | | | | | |0 | | | | RT2| | | | | | | | | | | | |0 | | | | RT3| | | | | |6 | | | | | | |0 | | | | RT4| | | | |8 | | | | | | | |0 | | | | RT5| | | |8 | |6 |6 | | | | | | | | | | RT6| | |8 | |7 | | | | |5 | | | | | | | RT7| | | | |6 | | | | | | | | |0 | | | * RT8| | | | | | | | | | | | | |0 | | | * RT9| | | | | | | | | | | | | | | |0 | T RT10| | | | | |7 | | | | | | | |0 |0 | | O RT11| | | | | | | | | | | | | | |0 |0 | * RT12| | | | | | | | | | | | | | | |0 | * N1|3 | | | | | | | | | | | | | | | | N2| |3 | | | | | | | | | | | | | | | N3|1 |1 |1 |1 | | | | | | | | | | | | | N4| | |2 | | | | | | | | | | | | | | N6| | | | | | |1 |1 | |1 | | | | | | | N7| | | | | | | |4 | | | | | | | | | N8| | | | | | | | | |3 |2 | | | | | | N9| | | | | | | | |1 | |1 |1 | | | | | N10| | | | | | | | | | | |2 | | | | | N11| | | | | | | | |3 | | | | | | | | N12| | | | |8 | |2 | | | | | | | | | | N13| | | | |8 | | | | | | | | | | | | N14| | | | |8 | | | | | | | | | | | | N15| | | | | | |9 | | | | | | | | | | H1| | | | | | | | | | | |10| | | | |
Figure 3: The resulting directed graph
图3:生成的有向图
Networks and routers are represented by vertices. An edge of cost X connects Vertex A to Vertex B iff the intersection of Column A and Row B is marked with an X.
网络和路由器由顶点表示。当列A和行B的交点标记为X时,成本X的边将顶点A连接到顶点B。
**FROM** **FROM**
**FROM** **FROM**
|RT12|N9|N10|H1| |RT9|RT11|RT12|N9| * -------------------- * ---------------------- * RT12| | | | | * RT9| | | |0 | T N9|1 | | | | T RT11| | | |0 | O N10|2 | | | | O RT12| | | |0 | * H1|10 | | | | * N9| | | | | * * RT12's router-LSA N9's network-LSA
|RT12|N9|N10|H1| |RT9|RT11|RT12|N9| * -------------------- * ---------------------- * RT12| | | | | * RT9| | | |0 | T N9|1 | | | | T RT11| | | |0 | O N10|2 | | | | O RT12| | | |0 | * H1|10 | | | | * N9| | | | | * * RT12's router-LSA N9's network-LSA
Figure 4: Individual link state components
图4:单个链路状态组件
Networks and routers are represented by vertices. An edge of cost X connects Vertex A to Vertex B iff the intersection of Column A and Row B is marked with an X.
网络和路由器由顶点表示。当列A和行B的交点标记为X时,成本X的边将顶点A连接到顶点B。
2.2. The shortest-path tree
2.2. 最短路径树
When no OSPF areas are configured, each router in the Autonomous System has an identical link-state database, leading to an identical graphical representation. A router generates its routing table from this graph by calculating a tree of shortest paths with the router itself as root. Obviously, the shortest-path tree depends on the router doing the calculation. The shortest-path tree for Router RT6 in our example is depicted in Figure 5.
当未配置OSPF区域时,自治系统中的每个路由器都具有相同的链路状态数据库,从而产生相同的图形表示。路由器通过计算以路由器自身为根的最短路径树,从该图生成其路由表。显然,最短路径树取决于进行计算的路由器。在我们的示例中,路由器RT6的最短路径树如图5所示。
The tree gives the entire path to any destination network or host. However, only the next hop to the destination is used in the forwarding process. Note also that the best route to any router has also been calculated. For the processing of external data, we note the next hop and distance to any router advertising external routes. The resulting routing table for Router RT6 is pictured in Table 2. Note that there is a separate route for each end of a numbered point-to-point network (in this case, the serial line between Routers RT6 and RT10).
该树给出了到任何目标网络或主机的整个路径。但是,在转发过程中只使用到目的地的下一个跃点。还请注意,到任何路由器的最佳路由也已计算出来。对于外部数据的处理,我们注意到下一跳和到任何公布外部路由的路由器的距离。路由器RT6的最终路由表如表2所示。请注意,编号的点到点网络(在本例中,路由器RT6和RT10之间的串行线)的每一端都有单独的路由。
Routes to networks belonging to other AS'es (such as N12) appear as dashed lines on the shortest path tree in Figure 5. Use of
到属于其他AS(如N12)的网络的路由在图5的最短路径树上显示为虚线。使用
RT6(origin) RT5 o------------o-----------o Ib /|\ 6 |\ 7 8/8|8\ | \ / | \ 6| \ o | o | \7 N12 o N14 | \ N13 2 | \ N4 o-----o RT3 \ / \ 5 1/ RT10 o-------o Ia / |\ RT4 o-----o N3 3| \1 /| | \ N6 RT7 / | N8 o o---------o / | | | /| RT2 o o RT1 | | 2/ |9 / | | |RT8 / | /3 |3 RT11 o o o o / | | | N12 N15 N2 o o N1 1| |4 | | N9 o o N7 /| / | N11 RT9 / |RT12 o--------o-------o o--------o H1 3 | 10 |2 | o N10
RT6(origin) RT5 o------------o-----------o Ib /|\ 6 |\ 7 8/8|8\ | \ / | \ 6| \ o | o | \7 N12 o N14 | \ N13 2 | \ N4 o-----o RT3 \ / \ 5 1/ RT10 o-------o Ia / |\ RT4 o-----o N3 3| \1 /| | \ N6 RT7 / | N8 o o---------o / | | | /| RT2 o o RT1 | | 2/ |9 / | | |RT8 / | /3 |3 RT11 o o o o / | | | N12 N15 N2 o o N1 1| |4 | | N9 o o N7 /| / | N11 RT9 / |RT12 o--------o-------o o--------o H1 3 | 10 |2 | o N10
Figure 5: The SPF tree for Router RT6
图5:路由器RT6的SPF树
Edges that are not marked with a cost have a cost of of zero (these are network-to-router links). Routes to networks N12-N15 are external information that is considered in Section 2.3
未标记成本的边的成本为零(这些是网络到路由器的链路)。网络N12-N15的路由是第2.3节中考虑的外部信息
Destination Next Hop Distance __________________________________ N1 RT3 10 N2 RT3 10 N3 RT3 7 N4 RT3 8 Ib * 7 Ia RT10 12 N6 RT10 8 N7 RT10 12 N8 RT10 10 N9 RT10 11 N10 RT10 13 N11 RT10 14 H1 RT10 21 __________________________________ RT5 RT5 6 RT7 RT10 8
Destination Next Hop Distance __________________________________ N1 RT3 10 N2 RT3 10 N3 RT3 7 N4 RT3 8 Ib * 7 Ia RT10 12 N6 RT10 8 N7 RT10 12 N8 RT10 10 N9 RT10 11 N10 RT10 13 N11 RT10 14 H1 RT10 21 __________________________________ RT5 RT5 6 RT7 RT10 8
Table 2: The portion of Router RT6's routing table listing local destinations.
表2:路由器RT6的路由表中列出本地目的地的部分。
this externally derived routing information is considered in the next section.
下一节将考虑从外部导出的路由信息。
2.3. Use of external routing information
2.3. 使用外部路由信息
After the tree is created the external routing information is examined. This external routing information may originate from another routing protocol such as BGP, or be statically configured (static routes). Default routes can also be included as part of the Autonomous System's external routing information.
创建树后,将检查外部路由信息。此外部路由信息可能来自另一个路由协议,如BGP,或静态配置(静态路由)。默认路由也可以作为自治系统外部路由信息的一部分。
External routing information is flooded unaltered throughout the AS. In our example, all the routers in the Autonomous System know that Router RT7 has two external routes, with metrics 2 and 9.
在整个AS中,外部路由信息都是不变的。在我们的示例中,自治系统中的所有路由器都知道路由器RT7有两个外部路由,度量为2和9。
OSPF supports two types of external metrics. Type 1 external metrics are expressed in the same units as OSPF interface cost
OSPF支持两种类型的外部度量。类型1外部指标以与OSPF接口成本相同的单位表示
(i.e., in terms of the link state metric). Type 2 external metrics are an order of magnitude larger; any Type 2 metric is considered greater than the cost of any path internal to the AS. Use of Type 2 external metrics assumes that routing between AS'es is the major cost of routing a packet, and eliminates the need for conversion of external costs to internal link state metrics.
(即,根据链路状态度量)。第2类外部指标的数量级更大;任何类型2指标都被视为大于AS内部任何路径的成本。使用类型2外部度量时,假设AS之间的路由是路由数据包的主要成本,并且不需要将外部成本转换为内部链路状态度量。
As an example of Type 1 external metric processing, suppose that the Routers RT7 and RT5 in Figure 2 are advertising Type 1 external metrics. For each advertised external route, the total cost from Router RT6 is calculated as the sum of the external route's advertised cost and the distance from Router RT6 to the advertising router. When two routers are advertising the same external destination, RT6 picks the advertising router providing the minimum total cost. RT6 then sets the next hop to the external destination equal to the next hop that would be used when routing packets to the chosen advertising router.
作为类型1外部度量处理的示例,假设图2中的路由器RT7和RT5是广告类型1外部度量。对于每个播发的外部路由,来自路由器RT6的总成本计算为外部路由的播发成本和从路由器RT6到播发路由器的距离之和。当两个路由器对同一外部目的地进行广告时,RT6选择提供最低总成本的广告路由器。RT6然后将到外部目的地的下一个跃点设置为将数据包路由到所选广告路由器时使用的下一个跃点。
In Figure 2, both Router RT5 and RT7 are advertising an external route to destination Network N12. Router RT7 is preferred since it is advertising N12 at a distance of 10 (8+2) to Router RT6, which is better than Router RT5's 14 (6+8). Table 3 shows the entries that are added to the routing table when external routes are examined:
在图2中,路由器RT5和RT7都在为到目的地网络N12的外部路由做广告。路由器RT7是首选的,因为它在距离路由器RT6 10(8+2)的距离处宣传N12,这比路由器RT5的14(6+8)要好。表3显示了在检查外部路由时添加到路由表中的条目:
Destination Next Hop Distance __________________________________ N12 RT10 10 N13 RT5 14 N14 RT5 14 N15 RT10 17
Destination Next Hop Distance __________________________________ N12 RT10 10 N13 RT5 14 N14 RT5 14 N15 RT10 17
Table 3: The portion of Router RT6's routing table listing external destinations.
表3:路由器RT6的路由表中列出外部目的地的部分。
Processing of Type 2 external metrics is simpler. The AS boundary router advertising the smallest external metric is
类型2外部度量的处理更简单。AS边界路由器的最小外部度量为
chosen, regardless of the internal distance to the AS boundary router. Suppose in our example both Router RT5 and Router RT7 were advertising Type 2 external routes. Then all traffic destined for Network N12 would be forwarded to Router RT7, since 2 < 8. When several equal-cost Type 2 routes exist, the internal distance to the advertising routers is used to break the tie.
选择此选项,与AS边界路由器的内部距离无关。假设在我们的示例中,路由器RT5和路由器RT7都是广告类型2外部路由。然后,所有发送到网络N12的流量将转发到路由器RT7,因为2<8。当存在多条相同成本的2类路由时,使用到广告路由器的内部距离来打破这种联系。
Both Type 1 and Type 2 external metrics can be present in the AS at the same time. In that event, Type 1 external metrics always take precedence.
类型1和类型2外部度量可以同时出现在AS中。在这种情况下,类型1外部度量始终优先。
This section has assumed that packets destined for external destinations are always routed through the advertising AS boundary router. This is not always desirable. For example, suppose in Figure 2 there is an additional router attached to Network N6, called Router RTX. Suppose further that RTX does not participate in OSPF routing, but does exchange BGP information with the AS boundary router RT7. Then, Router RT7 would end up advertising OSPF external routes for all destinations that should be routed to RTX. An extra hop will sometimes be introduced if packets for these destinations need always be routed first to Router RT7 (the advertising router).
本节假设发往外部目的地的数据包始终作为边界路由器通过广告路由。这并不总是可取的。例如,假设在图2中有一个附加的路由器连接到网络N6,称为路由器RTX。进一步假设RTX不参与OSPF路由,而是和AS边界路由器RT7交换BGP信息。然后,路由器RT7将为所有应该路由到RTX的目的地提供OSPF外部路由的广告。如果这些目的地的数据包始终需要首先路由到路由器RT7(广告路由器),则有时会引入额外的跃点。
To deal with this situation, the OSPF protocol allows an AS boundary router to specify a "forwarding address" in its AS-external-LSAs. In the above example, Router RT7 would specify RTX's IP address as the "forwarding address" for all those destinations whose packets should be routed directly to RTX.
为了处理这种情况,OSPF协议允许AS边界路由器在其AS外部LSA中指定“转发地址”。在上面的示例中,路由器RT7将RTX的IP地址指定为其数据包应直接路由到RTX的所有目的地的“转发地址”。
The "forwarding address" has one other application. It enables routers in the Autonomous System's interior to function as "route servers". For example, in Figure 2 the router RT6 could become a route server, gaining external routing information through a combination of static configuration and external routing protocols. RT6 would then start advertising itself as an AS boundary router, and would originate a collection of OSPF AS-external-LSAs. In each AS-external-LSA, Router RT6 would specify the correct Autonomous System exit point to use for the destination through appropriate setting of the LSA's "forwarding address" field.
“转发地址”还有一个应用程序。它使自治系统内部的路由器能够充当“路由服务器”。例如,在图2中,路由器RT6可以成为路由服务器,通过静态配置和外部路由协议的组合获得外部路由信息。然后,RT6将开始将自己作为一个as边界路由器进行宣传,并将发起一个OSPF集合作为外部LSA。在每个AS外部LSA中,路由器RT6将通过适当设置LSA的“转发地址”字段来指定用于目的地的正确自治系统出口点。
2.4. Equal-cost multipath
2.4. 等成本多路径
The above discussion has been simplified by considering only a single route to any destination. In reality, if multiple equal-cost routes to a destination exist, they are all discovered and used. This requires no conceptual changes to the algorithm, and its discussion is postponed until we consider the tree-building process in more detail.
通过只考虑到通往任何目的地的单一路线,上述讨论已被简化。实际上,如果存在多条到目的地的等成本路线,它们都会被发现并使用。这就不需要对算法进行概念上的改变,并且它的讨论被推迟,直到我们更详细地考虑树构建过程。
With equal cost multipath, a router potentially has several available next hops towards any given destination.
在成本相等的多径情况下,路由器可能会向任何给定的目的地提供多个可用的下一跳。
OSPF allows collections of contiguous networks and hosts to be grouped together. Such a group, together with the routers having interfaces to any one of the included networks, is called an area. Each area runs a separate copy of the basic link-state routing algorithm. This means that each area has its own link-state database and corresponding graph, as explained in the previous section.
OSPF允许将连续网络和主机的集合分组在一起。这样的一个组,连同具有到所包括的网络中的任何一个的接口的路由器,被称为区域。每个区域运行基本链路状态路由算法的单独副本。这意味着每个区域都有自己的链接状态数据库和相应的图形,如前一节所述。
The topology of an area is invisible from the outside of the area. Conversely, routers internal to a given area know nothing of the detailed topology external to the area. This isolation of knowledge enables the protocol to effect a marked reduction in routing traffic as compared to treating the entire Autonomous System as a single link-state domain.
从区域外部看不到区域的拓扑。相反,给定区域内部的路由器对该区域外部的详细拓扑一无所知。与将整个自治系统视为单个链路状态域相比,这种知识隔离使得协议能够显著减少路由流量。
With the introduction of areas, it is no longer true that all routers in the AS have an identical link-state database. A router actually has a separate link-state database for each area it is connected to. (Routers connected to multiple areas are called area border routers). Two routers belonging to the same area have, for that area, identical area link-state databases.
随着区域的引入,AS中的所有路由器不再具有相同的链路状态数据库。实际上,路由器连接到的每个区域都有一个单独的链路状态数据库。(连接到多个区域的路由器称为区域边界路由器)。属于同一区域的两个路由器对于该区域具有相同的区域链路状态数据库。
Routing in the Autonomous System takes place on two levels, depending on whether the source and destination of a packet reside in the same area (intra-area routing is used) or different areas (inter-area routing is used). In intra-area routing, the packet is routed solely on information obtained within the area; no routing
自治系统中的路由在两个级别上进行,这取决于数据包的源和目的地是位于同一区域(使用区域内路由)还是不同区域(使用区域间路由)。在区域内路由中,分组仅基于在区域内获得的信息进行路由;无路由
information obtained from outside the area can be used. This protects intra-area routing from the injection of bad routing information. We discuss inter-area routing in Section 3.2.
可以使用从区域外获得的信息。这可以保护区域内路由免受不良路由信息的注入。我们将在第3.2节中讨论区域间路由。
3.1. The backbone of the Autonomous System
3.1. 自治系统的骨干
The OSPF backbone is the special OSPF Area 0 (often written as Area 0.0.0.0, since OSPF Area ID's are typically formatted as IP addresses). The OSPF backbone always contains all area border routers. The backbone is responsible for distributing routing information between non-backbone areas. The backbone must be contiguous. However, it need not be physically contiguous; backbone connectivity can be established/maintained through the configuration of virtual links.
OSPF主干是特殊的OSPF区域0(通常写为区域0.0.0.0,因为OSPF区域ID通常被格式化为IP地址)。OSPF主干网始终包含所有区域边界路由器。主干网负责在非主干网区域之间分发路由信息。主干必须是连续的。然而,它不需要物理上相邻;可以通过配置虚拟链路来建立/维护主干网连接。
Virtual links can be configured between any two backbone routers that have an interface to a common non-backbone area. Virtual links belong to the backbone. The protocol treats two routers joined by a virtual link as if they were connected by an unnumbered point-to-point backbone network. On the graph of the backbone, two such routers are joined by arcs whose costs are the intra-area distances between the two routers. The routing protocol traffic that flows along the virtual link uses intra-area routing only.
可以在任何两个主干路由器之间配置虚拟链路,这两个主干路由器具有到公共非主干区域的接口。虚拟链路属于主干网。该协议将通过虚拟链路连接的两个路由器视为通过未编号的点到点骨干网络连接。在主干图上,两个这样的路由器由弧连接,弧的代价是两个路由器之间的区域内距离。沿虚拟链路流动的路由协议流量仅使用区域内路由。
3.2. Inter-area routing
3.2. 区域间路由
When routing a packet between two non-backbone areas the backbone is used. The path that the packet will travel can be broken up into three contiguous pieces: an intra-area path from the source to an area border router, a backbone path between the source and destination areas, and then another intra-area path to the destination. The algorithm finds the set of such paths that have the smallest cost.
在两个非主干区域之间路由数据包时,使用主干。数据包将要传输的路径可以分为三个连续的部分:从源到区域边界路由器的区域内路径、源和目标区域之间的主干路径,以及到目标的另一个区域内路径。该算法找到成本最小的路径集。
Looking at this another way, inter-area routing can be pictured as forcing a star configuration on the Autonomous System, with the backbone as hub and each of the non-backbone areas as spokes.
从另一个角度来看,区域间路由可以被描述为在自治系统上强制采用星形配置,主干作为中心,每个非主干区域作为辐条。
The topology of the backbone dictates the backbone paths used between areas. The topology of the backbone can be enhanced by adding virtual links. This gives the system administrator some control over the routes taken by inter-area traffic.
主干的拓扑结构决定了区域之间使用的主干路径。主干网的拓扑结构可以通过添加虚拟链路来增强。这使系统管理员能够控制区域间通信所采用的路由。
The correct area border router to use as the packet exits the source area is chosen in exactly the same way routers advertising external routes are chosen. Each area border router in an area summarizes for the area its cost to all networks external to the area. After the SPF tree is calculated for the area, routes to all inter-area destinations are calculated by examining the summaries of the area border routers.
当数据包离开源区域时,选择正确的区域边界路由器,其方式与选择外部路由的路由器完全相同。一个区域中的每个区域边界路由器汇总该区域对该区域外部所有网络的成本。在为区域计算SPF树之后,通过检查区域边界路由器的摘要来计算到所有区域间目的地的路由。
3.3. Classification of routers
3.3. 路由器的分类
Before the introduction of areas, the only OSPF routers having a specialized function were those advertising external routing information, such as Router RT5 in Figure 2. When the AS is split into OSPF areas, the routers are further divided according to function into the following four overlapping categories:
在引入AREA之前,唯一具有专门功能的OSPF路由器是那些宣传外部路由信息的路由器,如图2中的路由器RT5。当AS划分为OSPF区域时,路由器根据功能进一步划分为以下四个重叠类别:
Internal routers A router with all directly connected networks belonging to the same area. These routers run a single copy of the basic routing algorithm.
内部路由器具有属于同一区域的所有直接连接网络的路由器。这些路由器运行基本路由算法的单一副本。
Area border routers A router that attaches to multiple areas. Area border routers run multiple copies of the basic algorithm, one copy for each attached area. Area border routers condense the topological information of their attached areas for distribution to the backbone. The backbone in turn distributes the information to the other areas.
区域边界路由器连接到多个区域的路由器。区域边界路由器运行基本算法的多个副本,每个附加区域一个副本。区域边界路由器压缩其连接区域的拓扑信息,以便分发到主干网。主干网依次将信息分发到其他区域。
Backbone routers A router that has an interface to the backbone area. This includes all routers that interface to more than one area (i.e., area border routers). However, backbone routers do not have to be area border routers. Routers with all interfaces connecting to the backbone area are supported.
主干路由器具有与主干区域的接口的路由器。这包括连接到多个区域的所有路由器(即区域边界路由器)。然而,主干路由器不必是区域边界路由器。支持所有接口连接到主干区域的路由器。
AS boundary routers A router that exchanges routing information with routers belonging to other Autonomous Systems. Such a router advertises AS external routing information throughout the Autonomous System. The paths to each AS boundary router are known by every router in the AS. This classification is completely independent of the previous classifications: AS boundary routers may be internal or area border routers, and may or may not participate in the backbone.
作为边界路由器,与属于其他自治系统的路由器交换路由信息的路由器。这样的路由器在整个自治系统中作为外部路由信息进行广告。AS中的每个路由器都知道每个AS边界路由器的路径。此分类完全独立于以前的分类:因为边界路由器可能是内部或区域边界路由器,并且可能参与主干网,也可能不参与主干网。
3.4. A sample area configuration
3.4. 示例区域配置
Figure 6 shows a sample area configuration. The first area consists of networks N1-N4, along with their attached routers RT1-RT4. The second area consists of networks N6-N8, along with their attached routers RT7, RT8, RT10 and RT11. The third area consists of networks N9-N11 and Host H1, along with their attached routers RT9, RT11 and RT12. The third area has been configured so that networks N9-N11 and Host H1 will all be grouped into a single route, when advertised external to the area (see Section 3.5 for more details).
图6显示了一个示例区域配置。第一个区域由网络N1-N4及其连接的路由器RT1-RT4组成。第二个区域包括网络N6-N8及其连接的路由器RT7、RT8、RT10和RT11。第三个区域包括网络N9-N11和主机H1,以及它们连接的路由器RT9、RT11和RT12。第三个区域已配置为,当在该区域外部进行广告时,网络N9-N11和主机H1将全部分组为一条路由(更多详细信息,请参见第3.5节)。
In Figure 6, Routers RT1, RT2, RT5, RT6, RT8, RT9 and RT12 are internal routers. Routers RT3, RT4, RT7, RT10 and RT11 are area border routers. Finally, as before, Routers RT5 and RT7 are AS boundary routers.
在图6中,路由器RT1、RT2、RT5、RT6、RT8、RT9和RT12是内部路由器。路由器RT3、RT4、RT7、RT10和RT11是区域边界路由器。最后,和以前一样,路由器RT5和RT7作为边界路由器。
Figure 7 shows the resulting link-state database for the Area 1. The figure completely describes that area's intra-area routing. It also shows the complete view of the internet for the two internal routers RT1 and RT2. It is the job of the area border routers, RT3 and RT4, to advertise into Area 1 the distances to all destinations external to the area. These are indicated in Figure 7 by the dashed stub routes. Also, RT3 and RT4 must advertise into Area 1 the location of the AS boundary routers RT5 and RT7. Finally, AS-external-LSAs from RT5 and RT7 are flooded throughout the entire AS, and in particular throughout Area 1. These LSAs are included in Area 1's database, and yield routes to Networks N12-N15.
图7显示了区域1的链接状态数据库。该图完全描述了该区域的区域内路由。它还显示了两个内部路由器RT1和RT2的互联网的完整视图。区域边界路由器RT3和RT4的工作是向区域1公布到该区域外部所有目的地的距离。这些在图7中由虚线存根路由指示。此外,RT3和RT4必须在区域1中公布AS边界路由器RT5和RT7的位置。最后,来自RT5和RT7的AS外部LSA被淹没在整个AS中,尤其是整个区域1。这些LSA包含在区域1的数据库中,并提供到网络N12-N15的路由。
Routers RT3 and RT4 must also summarize Area 1's topology for
路由器RT3和RT4还必须总结区域1的拓扑结构,以便
........................... . + . . | 3+---+ . N12 N14 . N1|--|RT1|\ 1 . \ N13 / . | +---+ \ . 8\ |8/8 . + \ ____ . \|/ . / \ 1+---+8 8+---+6 . * N3 *---|RT4|------|RT5|--------+ . \____/ +---+ +---+ | . + / \ . |7 | . | 3+---+ / \ . | | . N2|--|RT2|/1 1\ . |6 | . | +---+ +---+8 6+---+ | . + |RT3|------|RT6| | . +---+ +---+ | . 2/ . Ia|7 | . / . | | . +---------+ . | | .Area 1 N4 . | | ........................... | | .......................... | | . N11 . | | . +---------+ . | | . | . | | N12 . |3 . Ib|5 |6 2/ . +---+ . +----+ +---+/ . |RT9| . .........|RT10|.....|RT7|---N15. . +---+ . . +----+ +---+ 9 . . |1 . . + /3 1\ |1 . . _|__ . . | / \ __|_ . . / \ 1+----+2 |/ \ / \ . . * N9 *------|RT11|----| * N6 * . . \____/ +----+ | \____/ . . | . . | | . . |1 . . + |1 . . +--+ 10+----+ . . N8 +---+ . . |H1|-----|RT12| . . |RT8| . . +--+SLIP +----+ . . +---+ . . |2 . . |4 . . | . . | . . +---------+ . . +--------+ .
........................... . + . . | 3+---+ . N12 N14 . N1|--|RT1|\ 1 . \ N13 / . | +---+ \ . 8\ |8/8 . + \ ____ . \|/ . / \ 1+---+8 8+---+6 . * N3 *---|RT4|------|RT5|--------+ . \____/ +---+ +---+ | . + / \ . |7 | . | 3+---+ / \ . | | . N2|--|RT2|/1 1\ . |6 | . | +---+ +---+8 6+---+ | . + |RT3|------|RT6| | . +---+ +---+ | . 2/ . Ia|7 | . / . | | . +---------+ . | | .Area 1 N4 . | | ........................... | | .......................... | | . N11 . | | . +---------+ . | | . | . | | N12 . |3 . Ib|5 |6 2/ . +---+ . +----+ +---+/ . |RT9| . .........|RT10|.....|RT7|---N15. . +---+ . . +----+ +---+ 9 . . |1 . . + /3 1\ |1 . . _|__ . . | / \ __|_ . . / \ 1+----+2 |/ \ / \ . . * N9 *------|RT11|----| * N6 * . . \____/ +----+ | \____/ . . | . . | | . . |1 . . + |1 . . +--+ 10+----+ . . N8 +---+ . . |H1|-----|RT12| . . |RT8| . . +--+SLIP +----+ . . +---+ . . |2 . . |4 . . | . . | . . +---------+ . . +--------+ .
. N10 . . N7 . . . .Area 2 . .Area 3 . ................................ ..........................
. N10 . . N7 . . . .Area 2 . .Area 3 . ................................ ..........................
Figure 6: A sample OSPF area configuration
图6:OSPF区域配置示例
distribution to the backbone. Their backbone LSAs are shown in Table 4. These summaries show which networks are contained in Area 1 (i.e., Networks N1-N4), and the distance to these networks from the routers RT3 and RT4 respectively.
分配到主干网。其主干LSA如表4所示。这些摘要显示区域1中包含哪些网络(即网络N1-N4),以及分别从路由器RT3和RT4到这些网络的距离。
The link-state database for the backbone is shown in Figure 8. The set of routers pictured are the backbone routers. Router RT11 is a backbone router because it belongs to two areas. In order to make the backbone connected, a virtual link has been configured between Routers R10 and R11.
主干网的链路状态数据库如图8所示。图中的路由器组是主干路由器。路由器RT11是主干路由器,因为它属于两个领域。为了连接主干网,在路由器R10和R11之间配置了虚拟链路。
The area border routers RT3, RT4, RT7, RT10 and RT11 condense the routing information of their attached non-backbone areas for distribution via the backbone; these are the dashed stubs that appear in Figure 8. Remember that the third area has been configured to condense Networks N9-N11 and Host H1 into a single route. This yields a single dashed line for networks N9-N11 and Host H1 in Figure 8. Routers RT5 and RT7 are AS boundary routers; their externally derived information also appears on the graph in Figure 8 as stubs.
区域边界路由器RT3、RT4、RT7、RT10和RT11压缩其连接的非主干区域的路由信息,以便通过主干进行分发;这些是图8中显示的虚线存根。请记住,第三个区域已配置为将网络N9-N11和主机H1压缩为单个路由。这将在图8中为网络N9-N11和主机H1生成一条虚线。路由器RT5和RT7作为边界路由器;它们的外部派生信息也以存根的形式出现在图8的图表上。
Network RT3 adv. RT4 adv. _____________________________ N1 4 4 N2 4 4 N3 1 1 N4 2 3
Network RT3 adv. RT4 adv. _____________________________ N1 4 4 N2 4 4 N3 1 1 N4 2 3
Table 4: Networks advertised to the backbone by Routers RT3 and RT4.
表4:通过路由器RT3和RT4向主干网播发的网络。
**FROM**
**FROM**
|RT|RT|RT|RT|RT|RT| |1 |2 |3 |4 |5 |7 |N3| ----- ------------------- RT1| | | | | | |0 | RT2| | | | | | |0 | RT3| | | | | | |0 | * RT4| | | | | | |0 | * RT5| | |14|8 | | | | T RT7| | |20|14| | | | O N1|3 | | | | | | | * N2| |3 | | | | | | * N3|1 |1 |1 |1 | | | | N4| | |2 | | | | | Ia,Ib| | |20|27| | | | N6| | |16|15| | | | N7| | |20|19| | | | N8| | |18|18| | | | N9-N11,H1| | |29|36| | | | N12| | | | |8 |2 | | N13| | | | |8 | | | N14| | | | |8 | | | N15| | | | | |9 | |
|RT|RT|RT|RT|RT|RT| |1 |2 |3 |4 |5 |7 |N3| ----- ------------------- RT1| | | | | | |0 | RT2| | | | | | |0 | RT3| | | | | | |0 | * RT4| | | | | | |0 | * RT5| | |14|8 | | | | T RT7| | |20|14| | | | O N1|3 | | | | | | | * N2| |3 | | | | | | * N3|1 |1 |1 |1 | | | | N4| | |2 | | | | | Ia,Ib| | |20|27| | | | N6| | |16|15| | | | N7| | |20|19| | | | N8| | |18|18| | | | N9-N11,H1| | |29|36| | | | N12| | | | |8 |2 | | N13| | | | |8 | | | N14| | | | |8 | | | N15| | | | | |9 | |
Figure 7: Area 1's Database.
图7:区域1的数据库。
Networks and routers are represented by vertices. An edge of cost X connects Vertex A to Vertex B iff the intersection of Column A and Row B is marked with an X.
网络和路由器由顶点表示。当列A和行B的交点标记为X时,成本X的边将顶点A连接到顶点B。
**FROM**
**FROM**
|RT|RT|RT|RT|RT|RT|RT |3 |4 |5 |6 |7 |10|11| ------------------------ RT3| | | |6 | | | | RT4| | |8 | | | | | RT5| |8 | |6 |6 | | | RT6|8 | |7 | | |5 | | RT7| | |6 | | | | | * RT10| | | |7 | | |2 | * RT11| | | | | |3 | | T N1|4 |4 | | | | | | O N2|4 |4 | | | | | | * N3|1 |1 | | | | | | * N4|2 |3 | | | | | | Ia| | | | | |5 | | Ib| | | |7 | | | | N6| | | | |1 |1 |3 | N7| | | | |5 |5 |7 | N8| | | | |4 |3 |2 | N9-N11,H1| | | | | | |11| N12| | |8 | |2 | | | N13| | |8 | | | | | N14| | |8 | | | | | N15| | | | |9 | | |
|RT|RT|RT|RT|RT|RT|RT |3 |4 |5 |6 |7 |10|11| ------------------------ RT3| | | |6 | | | | RT4| | |8 | | | | | RT5| |8 | |6 |6 | | | RT6|8 | |7 | | |5 | | RT7| | |6 | | | | | * RT10| | | |7 | | |2 | * RT11| | | | | |3 | | T N1|4 |4 | | | | | | O N2|4 |4 | | | | | | * N3|1 |1 | | | | | | * N4|2 |3 | | | | | | Ia| | | | | |5 | | Ib| | | |7 | | | | N6| | | | |1 |1 |3 | N7| | | | |5 |5 |7 | N8| | | | |4 |3 |2 | N9-N11,H1| | | | | | |11| N12| | |8 | |2 | | | N13| | |8 | | | | | N14| | |8 | | | | | N15| | | | |9 | | |
Figure 8: The backbone's database.
图8:主干网的数据库。
Networks and routers are represented by vertices. An edge of cost X connects Vertex A to Vertex B iff the intersection of Column A and Row B is marked with an X.
网络和路由器由顶点表示。当列A和行B的交点标记为X时,成本X的边将顶点A连接到顶点B。
The backbone enables the exchange of summary information between area border routers. Every area border router hears the area summaries from all other area border routers. It then forms a picture of the distance to all networks outside of its area by examining the collected LSAs, and adding in the backbone distance to each advertising router.
主干网支持在区域边界路由器之间交换摘要信息。每个区域边界路由器从所有其他区域边界路由器听到区域摘要。然后,通过检查收集到的LSA,并将到每个广告路由器的主干距离相加,形成到其区域外所有网络的距离图。
Again using Routers RT3 and RT4 as an example, the procedure goes as follows: They first calculate the SPF tree for the backbone. This gives the distances to all other area border routers. Also noted are the distances to networks (Ia and Ib) and AS boundary routers (RT5 and RT7) that belong to the backbone. This calculation is shown in Table 5.
再次以路由器RT3和RT4为例,过程如下:它们首先计算主干的SPF树。这将给出到所有其他区域边界路由器的距离。还注意到到到属于主干网的网络(Ia和Ib)和AS边界路由器(RT5和RT7)的距离。该计算如表5所示。
Next, by looking at the area summaries from these area border routers, RT3 and RT4 can determine the distance to all networks outside their area. These distances are then advertised internally to the area by RT3 and RT4. The advertisements that Router RT3 and RT4 will make into Area 1 are shown in Table 6. Note that Table 6 assumes that an area range has been configured for the backbone which groups Ia and Ib into a single LSA.
接下来,通过查看这些区域边界路由器的区域摘要,RT3和RT4可以确定到其区域外所有网络的距离。然后,这些距离通过RT3和RT4在区域内部发布。路由器RT3和RT4将进入区域1的广告如表6所示。请注意,表6假设已为主干配置了一个区域范围,该主干将Ia和Ib分组为单个LSA。
The information imported into Area 1 by Routers RT3 and RT4 enables an internal router, such as RT1, to choose an area border router intelligently. Router RT1 would use RT4 for traffic to Network N6, RT3 for traffic to Network N10, and would
路由器RT3和RT4导入到区域1的信息使内部路由器(如RT1)能够智能地选择区域边界路由器。路由器RT1将RT4用于网络N6的流量,RT3用于网络N10的流量,并且
dist from dist from RT3 RT4 __________________________________ to RT3 * 21 to RT4 22 * to RT7 20 14 to RT10 15 22 to RT11 18 25 __________________________________ to Ia 20 27 to Ib 15 22 __________________________________ to RT5 14 8 to RT7 20 14
dist from dist from RT3 RT4 __________________________________ to RT3 * 21 to RT4 22 * to RT7 20 14 to RT10 15 22 to RT11 18 25 __________________________________ to Ia 20 27 to Ib 15 22 __________________________________ to RT5 14 8 to RT7 20 14
Table 5: Backbone distances calculated by Routers RT3 and RT4.
表5:路由器RT3和RT4计算的主干距离。
Destination RT3 adv. RT4 adv. _________________________________ Ia,Ib 20 27 N6 16 15 N7 20 19 N8 18 18 N9-N11,H1 29 36 _________________________________ RT5 14 8 RT7 20 14
Destination RT3 adv. RT4 adv. _________________________________ Ia,Ib 20 27 N6 16 15 N7 20 19 N8 18 18 N9-N11,H1 29 36 _________________________________ RT5 14 8 RT7 20 14
Table 6: Destinations advertised into Area 1 by Routers RT3 and RT4.
表6:通过路由器RT3和RT4向区域1播发的目的地。
load share between the two for traffic to Network N8.
两个服务器之间的负载共享用于网络N8的流量。
Router RT1 can also determine in this manner the shortest path to the AS boundary routers RT5 and RT7. Then, by looking at RT5 and RT7's AS-external-LSAs, Router RT1 can decide between RT5 or RT7 when sending to a destination in another Autonomous System (one of the networks N12-N15).
路由器RT1还可以以这种方式确定到AS边界路由器RT5和RT7的最短路径。然后,通过将RT5和RT7视为外部LSA,路由器RT1可以在发送到另一个自治系统(网络N12-N15之一)中的目的地时在RT5或RT7之间作出决定。
Note that a failure of the line between Routers RT6 and RT10 will cause the backbone to become disconnected. Configuring a virtual link between Routers RT7 and RT10 will give the backbone more connectivity and more resistance to such failures.
请注意,路由器RT6和RT10之间的线路故障将导致主干断开连接。在路由器RT7和RT10之间配置虚拟链路将使主干网具有更多的连接性和更强的抗此类故障能力。
3.5. IP subnetting support
3.5. IP子网支持
OSPF attaches an IP address mask to each advertised route. The mask indicates the range of addresses being described by the particular route. For example, a summary-LSA for the destination 128.185.0.0 with a mask of 0xffff0000 actually is describing a single route to the collection of destinations 128.185.0.0 - 128.185.255.255. Similarly, host routes are always advertised with a mask of 0xffffffff, indicating the presence of only a single destination.
OSPF将IP地址掩码附加到每个播发的路由。掩码表示特定路由描述的地址范围。例如,掩码为0xffff0000的目的地128.185.0.0的摘要LSA实际上描述了到目的地128.185.0.0-128.185.255.255集合的单个路由。类似地,主机路由始终使用0xffffffff掩码进行播发,表示仅存在一个目的地。
Including the mask with each advertised destination enables the implementation of what is commonly referred to as variable-length subnetting. This means that a single IP class A, B, or C network number can be broken up into many subnets of various sizes. For example, the network 128.185.0.0 could be broken up into 62 variable-sized subnets: 15 subnets of size 4K, 15 subnets of size 256, and 32 subnets of size 8. Table 7 shows some of the resulting network addresses together with their masks.
在每个播发的目的地中包含掩码可以实现通常称为可变长度子网的功能。这意味着单个IP a类、B类或C类网络编号可以分解为许多不同大小的子网。例如,网络128.185.0.0可分为62个大小可变的子网:15个大小为4K的子网、15个大小为256的子网和32个大小为8的子网。表7显示了一些生成的网络地址及其掩码。
Network address IP address mask Subnet size _______________________________________________ 128.185.16.0 0xfffff000 4K 128.185.1.0 0xffffff00 256 128.185.0.8 0xfffffff8 8
Network address IP address mask Subnet size _______________________________________________ 128.185.16.0 0xfffff000 4K 128.185.1.0 0xffffff00 256 128.185.0.8 0xfffffff8 8
Table 7: Some sample subnet sizes.
表7:一些示例子网大小。
There are many possible ways of dividing up a class A, B, and C network into variable sized subnets. The precise procedure for doing so is beyond the scope of this specification. This specification however establishes the following guideline: When an IP packet is forwarded, it is always forwarded to the network that is the best match for the packet's destination. Here best match is synonymous with the longest or most specific match. For example, the default route with destination of 0.0.0.0 and mask 0x00000000 is always a match for every IP destination. Yet it is always less specific than any other match. Subnet masks must be assigned so that the best match for any IP destination is unambiguous.
将a类、B类和C类网络划分为不同大小的子网有很多可能的方法。执行此操作的精确程序超出本规范的范围。然而,本规范确立了以下准则:当IP数据包被转发时,它总是被转发到与数据包目的地最匹配的网络。这里,最佳匹配是最长或最特定匹配的同义词。例如,目标为0.0.0.0且掩码为0x00000000的默认路由始终与每个IP目标匹配。然而,它总是没有任何其他比赛那么具体。必须分配子网掩码,以便任何IP目标的最佳匹配都是明确的。
Attaching an address mask to each route also enables the support of IP supernetting. For example, a single physical network segment could be assigned the [address,mask] pair [192.9.4.0,0xfffffc00]. The segment would then be single IP network, containing addresses from the four consecutive class C network numbers 192.9.4.0 through 192.9.7.0. Such addressing is now becoming commonplace with the advent of CIDR (see [Ref10]).
将地址掩码附加到每个路由还可以支持IP超级网。例如,可以为单个物理网段分配[address,mask]对[192.9.4.0,0xfffffc00]。然后,该段将是单个IP网络,包含来自四个连续C类网络编号192.9.4.0到192.9.7.0的地址。随着CIDR的出现,这种寻址方式变得越来越普遍(见参考文献10)。
In order to get better aggregation at area boundaries, area address ranges can be employed (see Section C.2 for more details). Each address range is defined as an [address,mask] pair. Many separate networks may then be contained in a single address range, just as a subnetted network is composed of many separate subnets. Area border routers then summarize the area contents (for distribution to the backbone) by advertising a single route for each address range. The cost of the route is the maximum cost to any of the networks falling in the specified range.
为了在区域边界处获得更好的聚合,可以使用区域地址范围(有关更多详细信息,请参阅第C.2节)。每个地址范围定义为[地址,掩码]对。许多独立的网络可以包含在一个地址范围内,就像子网网络由许多独立的子网组成一样。然后,区域边界路由器通过为每个地址范围发布单个路由来汇总区域内容(用于分发到主干网)。路由成本是指定范围内任何网络的最大成本。
For example, an IP subnetted network might be configured as a single OSPF area. In that case, a single address range could be configured: a class A, B, or C network number along with its natural IP mask. Inside the area, any number of variable sized subnets could be defined. However, external to the area a single route for the entire subnetted network would be distributed, hiding even the fact that the network is subnetted at all. The cost of this route is the maximum of the set of costs to the component subnets.
例如,IP子网网络可以配置为单个OSPF区域。在这种情况下,可以配置单个地址范围:a类、B类或C类网络号及其自然IP掩码。在该区域内,可以定义任意数量的可变大小的子网。然而,在该区域之外,整个子网网络的单一路由将被分配,甚至隐藏了网络完全是子网的事实。此路由的成本是组件子网成本集合的最大值。
3.6. Supporting stub areas
3.6. 支撑短柱区域
In some Autonomous Systems, the majority of the link-state database may consist of AS-external-LSAs. An OSPF AS-external-LSA is usually flooded throughout the entire AS. However, OSPF allows certain areas to be configured as "stub areas". AS-external-LSAs are not flooded into/throughout stub areas; routing to AS external destinations in these areas is based on a (per-area) default only. This reduces the link-state database size, and therefore the memory requirements, for a stub area's internal routers.
在一些自治系统中,大部分链路状态数据库可能由外部LSA组成。OSPF AS外部LSA通常淹没整个AS。但是,OSPF允许将某些区域配置为“存根区域”。因为外部LSA不会淹没到/贯穿存根区域;在这些区域中,路由到AS外部目的地仅基于(每个区域)默认值。这降低了存根区域内部路由器的链路状态数据库大小,从而降低了内存需求。
In order to take advantage of the OSPF stub area support, default routing must be used in the stub area. This is accomplished as follows. One or more of the stub area's area border routers must advertise a default route into the stub area via summary-LSAs. These summary defaults are flooded throughout the stub area, but no further. (For this reason these defaults pertain only to the particular stub area). These summary default routes will be used for any destination that is not
为了利用OSPF存根区域支持,存根区域中必须使用默认路由。这是通过以下方式实现的。一个或多个存根区域的区域边界路由器必须通过摘要LSA向存根区域播发默认路由。这些摘要默认值在整个存根区域中被淹没,但不会进一步。(因此,这些默认值仅适用于特定的存根区域)。这些摘要默认路由将用于任何未指定的目的地
explicitly reachable by an intra-area or inter-area path (i.e., AS external destinations).
可通过区域内或区域间路径(即作为外部目的地)显式访问。
An area can be configured as a stub when there is a single exit point from the area, or when the choice of exit point need not be made on a per-external-destination basis. For example, Area 3 in Figure 6 could be configured as a stub area, because all external traffic must travel though its single area border router RT11. If Area 3 were configured as a stub, Router RT11 would advertise a default route for distribution inside Area 3 (in a summary-LSA), instead of flooding the AS-external-LSAs for Networks N12-N15 into/throughout the area.
当一个区域有一个单一的出口点时,或者当出口点的选择不需要基于每个外部目的地时,可以将该区域配置为存根。例如,图6中的区域3可以配置为存根区域,因为所有外部流量都必须通过其单区域边界路由器RT11。如果将区域3配置为存根,路由器RT11将公布一条默认路由,以便在区域3内分发(在摘要LSA中),而不是将网络N12-N15的as外部LSA淹没到该区域内或整个区域内。
The OSPF protocol ensures that all routers belonging to an area agree on whether the area has been configured as a stub. This guarantees that no confusion will arise in the flooding of AS-external-LSAs.
OSPF协议确保属于某个区域的所有路由器都同意该区域是否已配置为存根。这保证了AS外部LSA泛滥时不会出现混淆。
There are a couple of restrictions on the use of stub areas. Virtual links cannot be configured through stub areas. In addition, AS boundary routers cannot be placed internal to stub areas.
对存根区域的使用有一些限制。无法通过存根区域配置虚拟链接。此外,由于边界路由器不能放置在存根区域的内部。
3.7. Partitions of areas
3.7. 分区
OSPF does not actively attempt to repair area partitions. When an area becomes partitioned, each component simply becomes a separate area. The backbone then performs routing between the new areas. Some destinations reachable via intra-area routing before the partition will now require inter-area routing.
OSPF不会主动尝试修复区域分区。当一个区域被分割时,每个组件都会成为一个单独的区域。主干然后在新区域之间执行路由。分区之前可通过区域内路由到达的某些目的地现在需要区域间路由。
However, in order to maintain full routing after the partition, an address range must not be split across multiple components of the area partition. Also, the backbone itself must not partition. If it does, parts of the Autonomous System will become unreachable. Backbone partitions can be repaired by configuring virtual links (see Section 15).
但是,为了在分区后保持完整路由,地址范围不能跨区域分区的多个组件分割。此外,主干本身不能进行分区。如果它这样做,自治系统的某些部分将无法访问。主干分区可以通过配置虚拟链路来修复(参见第15节)。
Another way to think about area partitions is to look at the Autonomous System graph that was introduced in Section 2. Area IDs can be viewed as colors for the graph's edges.[1] Each edge
考虑区域划分的另一种方法是查看第2节中介绍的自治系统图。可以将区域ID视为图形边的颜色。[1]每条边
of the graph connects to a network, or is itself a point-to-point network. In either case, the edge is colored with the network's Area ID.
图的一部分连接到网络,或其本身是点对点网络。在这两种情况下,边缘都用网络的区域ID着色。
A group of edges, all having the same color, and interconnected by vertices, represents an area. If the topology of the Autonomous System is intact, the graph will have several regions of color, each color being a distinct Area ID.
一组边表示一个区域,所有边都具有相同的颜色,并通过顶点相互连接。如果自治系统的拓扑结构完好无损,图形将有几个颜色区域,每个颜色都是一个不同的区域ID。
When the AS topology changes, one of the areas may become partitioned. The graph of the AS will then have multiple regions of the same color (Area ID). The routing in the Autonomous System will continue to function as long as these regions of same color are connected by the single backbone region.
当AS拓扑更改时,其中一个区域可能会被分区。AS的图形将具有多个相同颜色的区域(区域ID)。只要这些颜色相同的区域由单一主干区域连接,自治系统中的路由将继续发挥作用。
A separate copy of OSPF's basic routing algorithm runs in each area. Routers having interfaces to multiple areas run multiple copies of the algorithm. A brief summary of the routing algorithm follows.
OSPF基本路由算法的单独副本在每个区域运行。具有多个区域接口的路由器运行算法的多个副本。下面简要介绍路由算法。
When a router starts, it first initializes the routing protocol data structures. The router then waits for indications from the lower-level protocols that its interfaces are functional.
当路由器启动时,它首先初始化路由协议数据结构。路由器然后等待来自较低级别协议的指示,表明其接口功能正常。
A router then uses the OSPF's Hello Protocol to acquire neighbors. The router sends Hello packets to its neighbors, and in turn receives their Hello packets. On broadcast and point-to-point networks, the router dynamically detects its neighboring routers by sending its Hello packets to the multicast address AllSPFRouters. On non-broadcast networks, some configuration information may be necessary in order to discover neighbors. On broadcast and NBMA networks the Hello Protocol also elects a Designated router for the network.
路由器然后使用OSPF的Hello协议来获取邻居。路由器向其邻居发送Hello数据包,然后依次接收他们的Hello数据包。在广播和点对点网络上,路由器通过向多播地址AllsFrouters发送Hello数据包来动态检测其相邻路由器。在非广播网络上,可能需要一些配置信息来发现邻居。在广播和NBMA网络上,Hello协议还为网络选择指定的路由器。
The router will attempt to form adjacencies with some of its newly acquired neighbors. Link-state databases are synchronized between pairs of adjacent routers. On broadcast and NBMA networks, the Designated Router determines which routers should become adjacent.
路由器将尝试与一些新获得的邻居形成邻接。链路状态数据库在相邻路由器对之间同步。在广播和NBMA网络上,指定的路由器决定哪些路由器应该相邻。
Adjacencies control the distribution of routing information. Routing updates are sent and received only on adjacencies.
邻接控制路由信息的分布。路由更新仅在邻接处发送和接收。
A router periodically advertises its state, which is also called link state. Link state is also advertised when a router's state changes. A router's adjacencies are reflected in the contents of its LSAs. This relationship between adjacencies and link state allows the protocol to detect dead routers in a timely fashion.
路由器定期公布其状态,也称为链路状态。当路由器的状态改变时,链路状态也会被公布。路由器的邻接关系反映在其LSA的内容中。邻接和链路状态之间的这种关系允许协议及时地检测失效路由器。
LSAs are flooded throughout the area. The flooding algorithm is reliable, ensuring that all routers in an area have exactly the same link-state database. This database consists of the collection of LSAs originated by each router belonging to the area. From this database each router calculates a shortest-path tree, with itself as root. This shortest-path tree in turn yields a routing table for the protocol.
LSA淹没了整个地区。泛洪算法是可靠的,确保一个区域中的所有路由器都具有完全相同的链路状态数据库。该数据库由属于该区域的每个路由器发起的LSA集合组成。从这个数据库中,每个路由器计算出一个最短路径树,它本身就是根。该最短路径树依次生成协议的路由表。
4.1. Inter-area routing
4.1. 区域间路由
The previous section described the operation of the protocol within a single area. For intra-area routing, no other routing information is pertinent. In order to be able to route to destinations outside of the area, the area border routers inject additional routing information into the area. This additional information is a distillation of the rest of the Autonomous System's topology.
上一节描述了协议在单个区域内的操作。对于区域内路由,没有其他路由信息是相关的。为了能够路由到区域外的目的地,区域边界路由器向区域中注入额外的路由信息。该附加信息是自治系统拓扑结构其余部分的升华。
This distillation is accomplished as follows: Each area border router is by definition connected to the backbone. Each area border router summarizes the topology of its attached non-backbone areas for transmission on the backbone, and hence to all other area border routers. An area border router then has complete topological information concerning the backbone, and the area summaries from each of the other area border routers. From this information, the router calculates paths to all inter-area destinations. The router then advertises these paths into its attached areas. This enables the area's internal routers to pick the best exit router when forwarding traffic inter-area destinations.
这种升华是按如下方式完成的:根据定义,每个区域边界路由器都连接到主干网。每个区域边界路由器汇总其连接的非主干区域的拓扑,以便在主干上传输,从而传输到所有其他区域边界路由器。然后,区域边界路由器具有有关主干网的完整拓扑信息,以及来自其他每个区域边界路由器的区域摘要。根据该信息,路由器计算到所有区域间目的地的路径。然后路由器将这些路径播发到其连接的区域。这使该区域的内部路由器能够在转发区域间目的地的流量时选择最佳出口路由器。
4.2. AS external routes
4.2. 作为对外路线
Routers that have information regarding other Autonomous Systems can flood this information throughout the AS. This external routing information is distributed verbatim to every participating router. There is one exception: external routing information is not flooded into "stub" areas (see Section 3.6).
具有关于其他自治系统的信息的路由器可以在整个AS中泛滥该信息。此外部路由信息将逐字分发到每个参与路由器。有一个例外:外部路由信息不会淹没到“存根”区域(见第3.6节)。
To utilize external routing information, the path to all routers advertising external information must be known throughout the AS (excepting the stub areas). For that reason, the locations of these AS boundary routers are summarized by the (non-stub) area border routers.
要利用外部路由信息,必须在整个AS中知道所有公布外部信息的路由器的路径(存根区域除外)。因此,这些作为边界路由器的位置由(非存根)区域边界路由器汇总。
4.3. Routing protocol packets
4.3. 路由协议包
The OSPF protocol runs directly over IP, using IP protocol 89. OSPF does not provide any explicit fragmentation/reassembly support. When fragmentation is necessary, IP fragmentation/reassembly is used. OSPF protocol packets have been designed so that large protocol packets can generally be split into several smaller protocol packets. This practice is recommended; IP fragmentation should be avoided whenever possible.
OSPF协议使用IP协议89直接在IP上运行。OSPF不提供任何明确的碎片/重组支持。当需要分段时,使用IP分段/重新组装。OSPF协议包的设计使得大的协议包通常可以分成几个较小的协议包。建议采用这种做法;应尽可能避免IP碎片化。
Routing protocol packets should always be sent with the IP TOS field set to 0. If at all possible, routing protocol packets should be given preference over regular IP data traffic, both when being sent and received. As an aid to accomplishing this, OSPF protocol packets should have their IP precedence field set to the value Internetwork Control (see [Ref5]).
发送路由协议数据包时,应始终将IP TOS字段设置为0。如果可能的话,在发送和接收路由协议数据包时,应该优先考虑常规IP数据流量。为了帮助实现这一点,OSPF协议数据包的IP优先级字段应设置为值Internetwork Control(参见[参考文献5])。
All OSPF protocol packets share a common protocol header that is described in Appendix A. The OSPF packet types are listed below in Table 8. Their formats are also described in Appendix A.
所有OSPF协议包共享一个公共协议头,如附录a所述。OSPF包类型如下表8所示。其格式也在附录A中描述。
Type Packet name Protocol function __________________________________________________________ 1 Hello Discover/maintain neighbors 2 Database Description Summarize database contents 3 Link State Request Database download 4 Link State Update Database update 5 Link State Ack Flooding acknowledgment
Type Packet name Protocol function __________________________________________________________ 1 Hello Discover/maintain neighbors 2 Database Description Summarize database contents 3 Link State Request Database download 4 Link State Update Database update 5 Link State Ack Flooding acknowledgment
Table 8: OSPF packet types.
表8:OSPF数据包类型。
OSPF's Hello protocol uses Hello packets to discover and maintain neighbor relationships. The Database Description and Link State Request packets are used in the forming of adjacencies. OSPF's reliable update mechanism is implemented by the Link State Update and Link State Acknowledgment packets.
OSPF的Hello协议使用Hello数据包来发现和维护邻居关系。数据库描述和链路状态请求包用于邻接的形成。OSPF的可靠更新机制由链路状态更新和链路状态确认包实现。
Each Link State Update packet carries a set of new link state advertisements (LSAs) one hop further away from their point of origination. A single Link State Update packet may contain the LSAs of several routers. Each LSA is tagged with the ID of the originating router and a checksum of its link state contents. Each LSA also has a type field; the different types of OSPF LSAs are listed below in Table 9.
每个链路状态更新包携带一组新的链路状态播发(LSA),这些新的链路状态播发(LSA)距离它们的起始点更远一跳。单个链路状态更新包可能包含多个路由器的LSA。每个LSA都标记有发起路由器的ID及其链路状态内容的校验和。每个LSA还具有一个类型字段;下表9列出了不同类型的OSPF LSA。
OSPF routing packets (with the exception of Hellos) are sent only over adjacencies. This means that all OSPF protocol packets travel a single IP hop, except those that are sent over virtual adjacencies. The IP source address of an OSPF protocol packet is one end of a router adjacency, and the IP destination address is either the other end of the adjacency or an IP multicast address.
OSPF路由数据包(Hellos除外)仅通过邻接发送。这意味着所有OSPF协议数据包都在一个IP跃点上传输,通过虚拟邻接发送的数据包除外。OSPF协议包的IP源地址是路由器邻接的一端,IP目的地址是邻接的另一端或IP多播地址。
4.4. Basic implementation requirements
4.4. 基本实施要求
An implementation of OSPF requires the following pieces of system support:
OSPF的实施需要以下系统支持:
Timers Two different kind of timers are required. The first kind, called "single shot timers", fire once and cause a protocol event to be processed. The second kind, called "interval timers", fire at continuous intervals. These are used for the sending of packets at regular intervals. A good example of this is the regular broadcast of Hello packets. The granularity of both kinds of timers is one second.
定时器需要两种不同的定时器。第一种称为“单次触发计时器”,触发一次并导致协议事件被处理。第二种称为“间隔计时器”,以连续的间隔开火。它们用于定期发送数据包。一个很好的例子是Hello数据包的定期广播。这两种计时器的粒度都是1秒。
Interval timers should be implemented to avoid drift. In some router implementations, packet processing can affect timer execution. When multiple routers are attached to a single network, all doing broadcasts, this can lead to the synchronization of routing packets (which should be avoided). If timers cannot be implemented to avoid drift, small random amounts should be added to/subtracted from the interval timer at each firing.
应使用间隔计时器以避免漂移。在一些路由器实现中,数据包处理会影响计时器的执行。当多个路由器连接到单个网络时,所有路由器都进行广播,这可能导致路由数据包的同步(应该避免)。如果无法实现定时器以避免漂移,则应在每次点火时向间隔定时器添加或从中减去少量随机量。
LS LSA LSA description type name ________________________________________________________ 1 Router-LSAs Originated by all routers. This LSA describes the collected states of the router's interfaces to an area. Flooded throughout a single area only. ________________________________________________________ 2 Network-LSAs Originated for broadcast and NBMA networks by the Designated Router. This LSA contains the list of routers connected to the network. Flooded throughout a single area only. ________________________________________________________ 3,4 Summary-LSAs Originated by area border routers, and flooded through- out the LSA's associated area. Each summary-LSA describes a route to a destination outside the area, yet still inside the AS (i.e., an inter-area route). Type 3 summary-LSAs describe routes to networks. Type 4 summary-LSAs describe routes to AS boundary routers. ________________________________________________________ 5 AS-external-LSAs Originated by AS boundary routers, and flooded through- out the AS. Each AS-external-LSA describes a route to a destination in another Autonomous System. Default routes for the AS can also be described by AS-external-LSAs.
LS LSA LSA description type name ________________________________________________________ 1 Router-LSAs Originated by all routers. This LSA describes the collected states of the router's interfaces to an area. Flooded throughout a single area only. ________________________________________________________ 2 Network-LSAs Originated for broadcast and NBMA networks by the Designated Router. This LSA contains the list of routers connected to the network. Flooded throughout a single area only. ________________________________________________________ 3,4 Summary-LSAs Originated by area border routers, and flooded through- out the LSA's associated area. Each summary-LSA describes a route to a destination outside the area, yet still inside the AS (i.e., an inter-area route). Type 3 summary-LSAs describe routes to networks. Type 4 summary-LSAs describe routes to AS boundary routers. ________________________________________________________ 5 AS-external-LSAs Originated by AS boundary routers, and flooded through- out the AS. Each AS-external-LSA describes a route to a destination in another Autonomous System. Default routes for the AS can also be described by AS-external-LSAs.
Table 9: OSPF link state advertisements (LSAs).
表9:OSPF链路状态播发(LSA)。
IP multicast Certain OSPF packets take the form of IP multicast datagrams. Support for receiving and sending IP multicast datagrams, along with the appropriate lower-level protocol support, is required. The IP multicast datagrams used by OSPF never travel more than one hop. For this reason, the ability to forward IP multicast datagrams is not required. For information on IP multicast, see [Ref7].
IP多播某些OSPF数据包采用IP多播数据报的形式。需要支持接收和发送IP多播数据报,以及适当的低级别协议支持。OSPF使用的IP多播数据报的传输时间不会超过一个跃点。因此,不需要转发IP多播数据报的能力。有关IP多播的信息,请参见[Ref7]。
Variable-length subnet support The router's IP protocol support must include the ability to divide a single IP class A, B, or C network number into many subnets of various sizes. This is commonly called variable-length subnetting; see Section 3.5 for details.
可变长度子网支持路由器的IP协议支持必须包括将单个IP a类、B类或C类网络编号划分为多个不同大小的子网的能力。这通常称为可变长度子网;详见第3.5节。
IP supernetting support The router's IP protocol support must include the ability to aggregate contiguous collections of IP class A, B, and C networks into larger quantities called supernets. Supernetting has been proposed as one way to improve the scaling of IP routing in the worldwide Internet. For more information on IP supernetting, see [Ref10].
IP超级网支持路由器的IP协议支持必须包括将IP A类、B类和C类网络的连续集合聚合为更大数量的超级网的能力。Supernetting被认为是一种在全球互联网上提高IP路由扩展性的方法。有关IP超级网的更多信息,请参见[Ref10]。
Lower-level protocol support The lower level protocols referred to here are the network access protocols, such as the Ethernet data link layer. Indications must be passed from these protocols to OSPF as the network interface goes up and down. For example, on an ethernet it would be valuable to know when the ethernet transceiver cable becomes unplugged.
低级协议支持这里提到的低级协议是网络访问协议,例如以太网数据链路层。当网络接口上下波动时,指示必须从这些协议传递到OSPF。例如,在以太网上,了解以太网收发器电缆何时被拔出是很有价值的。
Non-broadcast lower-level protocol support On non-broadcast networks, the OSPF Hello Protocol can be aided by providing an indication when an attempt is made to send a packet to a dead or non-existent router. For example, on an X.25 PDN a dead neighboring router may be
非广播较低级别协议支持在非广播网络上,OSPF Hello协议可以通过在试图向失效或不存在的路由器发送数据包时提供指示来辅助。例如,在X.25 PDN上,可能会出现死区相邻路由器
indicated by the reception of a X.25 clear with an appropriate cause and diagnostic, and this information would be passed to OSPF.
通过接收带有适当原因和诊断的X.25清除指示,该信息将传递给OSPF。
List manipulation primitives Much of the OSPF functionality is described in terms of its operation on lists of LSAs. For example, the collection of LSAs that will be retransmitted to an adjacent router until acknowledged are described as a list. Any particular LSA may be on many such lists. An OSPF implementation needs to be able to manipulate these lists, adding and deleting constituent LSAs as necessary.
列表操作原语OSPF的许多功能都是根据其对LSA列表的操作来描述的。例如,在确认之前将被重新传输到相邻路由器的lsa集合被描述为列表。任何特定的LSA都可能在许多这样的列表中。OSPF实现需要能够操作这些列表,根据需要添加和删除组成LSA。
Tasking support Certain procedures described in this specification invoke other procedures. At times, these other procedures should be executed in-line, that is, before the current procedure is finished. This is indicated in the text by instructions to execute a procedure. At other times, the other procedures are to be executed only when the current procedure has finished. This is indicated by instructions to schedule a task.
任务分配支持本规范中描述的某些过程调用其他过程。有时,这些其他过程应该在线执行,也就是说,在当前过程完成之前。这在文本中由执行过程的指令指示。在其他情况下,仅当当前程序完成时才执行其他程序。这由安排任务的说明指示。
4.5. Optional OSPF capabilities
4.5. 可选OSPF功能
The OSPF protocol defines several optional capabilities. A router indicates the optional capabilities that it supports in its OSPF Hello packets, Database Description packets and in its LSAs. This enables routers supporting a mix of optional capabilities to coexist in a single Autonomous System.
OSPF协议定义了几个可选功能。路由器在其OSPF Hello数据包、数据库描述数据包和LSA中指示其支持的可选功能。这使得支持混合可选功能的路由器能够在单个自治系统中共存。
Some capabilities must be supported by all routers attached to a specific area. In this case, a router will not accept a neighbor's Hello Packet unless there is a match in reported capabilities (i.e., a capability mismatch prevents a neighbor relationship from forming). An example of this is the ExternalRoutingCapability (see below).
某些功能必须由连接到特定区域的所有路由器支持。在这种情况下,路由器将不接受邻居的Hello数据包,除非报告的功能中存在匹配(即,功能不匹配会阻止邻居关系的形成)。ExternalRoutingCapability就是一个例子(见下文)。
Other capabilities can be negotiated during the Database Exchange process. This is accomplished by specifying the optional capabilities in Database Description packets. A
其他功能可以在数据库交换过程中协商。这是通过在数据库描述数据包中指定可选功能来实现的。A.
capability mismatch with a neighbor in this case will result in only a subset of the link state database being exchanged between the two neighbors.
在这种情况下,与邻居的能力不匹配将导致两个邻居之间仅交换链路状态数据库的一个子集。
The routing table build process can also be affected by the presence/absence of optional capabilities. For example, since the optional capabilities are reported in LSAs, routers incapable of certain functions can be avoided when building the shortest path tree.
路由表构建过程也可能受到可选功能存在/不存在的影响。例如,由于可选功能在LSA中报告,因此在构建最短路径树时可以避免无法实现某些功能的路由器。
The OSPF optional capabilities defined in this memo are listed below. See Section A.2 for more information.
本备忘录中定义的OSPF可选功能如下所示。有关更多信息,请参见第A.2节。
ExternalRoutingCapability Entire OSPF areas can be configured as "stubs" (see Section 3.6). AS-external-LSAs will not be flooded into stub areas. This capability is represented by the E-bit in the OSPF Options field (see Section A.2). In order to ensure consistent configuration of stub areas, all routers interfacing to such an area must have the E-bit clear in their Hello packets (see Sections 9.5 and 10.5).
外部路由能力整个OSPF区域可配置为“存根”(见第3.6节)。因为外部LSA不会淹没到存根区域。此功能由OSPF选项字段中的E位表示(参见第A.2节)。为了确保存根区域的一致配置,所有连接到该区域的路由器必须在其Hello数据包中清除E位(见第9.5节和第10.5节)。
The OSPF protocol is described herein in terms of its operation on various protocol data structures. The following list comprises the top-level OSPF data structures. Any initialization that needs to be done is noted. OSPF areas, interfaces and neighbors also have associated data structures that are described later in this specification.
本文根据其在各种协议数据结构上的操作来描述OSPF协议。以下列表包括顶级OSPF数据结构。任何需要进行的初始化都会被记录下来。OSPF区域、接口和邻居也有相关的数据结构,这些数据结构将在本规范后面描述。
Router ID A 32-bit number that uniquely identifies this router in the AS. One possible implementation strategy would be to use the smallest IP interface address belonging to the router. If a router's OSPF Router ID is changed, the router's OSPF software should be restarted before the new Router ID takes effect. In this case the router should flush its self-originated LSAs from the routing domain (see Section 14.1) before restarting, or they will persist for up to MaxAge minutes.
路由器ID在AS中唯一标识此路由器的32位数字。一种可能的实现策略是使用属于路由器的最小IP接口地址。如果路由器的OSPF路由器ID发生更改,则应在新路由器ID生效之前重新启动路由器的OSPF软件。在这种情况下,路由器应在重新启动之前从路由域(见第14.1节)刷新其自源LSA,否则它们将持续最长分钟。
Area structures Each one of the areas to which the router is connected has its own data structure. This data structure describes the working of the basic OSPF algorithm. Remember that each area runs a separate copy of the basic OSPF algorithm.
区域结构路由器连接到的每个区域都有自己的数据结构。该数据结构描述了基本OSPF算法的工作原理。请记住,每个区域都运行基本OSPF算法的单独副本。
Backbone (area) structure The OSPF backbone area is responsible for the dissemination of inter-area routing information.
主干(区域)结构OSPF主干区域负责区域间路由信息的传播。
Virtual links configured The virtual links configured with this router as one endpoint. In order to have configured virtual links, the router itself must be an area border router. Virtual links are identified by the Router ID of the other endpoint -- which is another area border router. These two endpoint routers must be attached to a common area, called the virtual link's Transit area. Virtual links are part of the backbone, and behave as if they were unnumbered point-to-point networks between the two routers. A virtual link uses the intra-area routing of its Transit area to forward packets. Virtual links are brought up and down through the building of the shortest-path trees for the Transit area.
虚拟链路配置将此路由器配置为一个端点的虚拟链路。为了配置虚拟链路,路由器本身必须是区域边界路由器。虚拟链路由另一个端点(另一个区域边界路由器)的路由器ID标识。这两个端点路由器必须连接到一个公共区域,称为虚拟链路的传输区域。虚拟链路是主干网的一部分,其行为就好像它们是两个路由器之间未编号的点对点网络一样。虚拟链路使用其传输区域的区域内路由转发数据包。虚拟链路通过为中转区建立最短路径树来上下移动。
List of external routes These are routes to destinations external to the Autonomous System, that have been gained either through direct experience with another routing protocol (such as BGP), or through configuration information, or through a combination of the two (e.g., dynamic external information to be advertised by OSPF with configured metric). Any router having these external routes is called an AS boundary router. These routes are advertised by the router into the OSPF routing domain via AS-external-LSAs.
外部路由列表这些路由到自治系统外部的目的地,通过直接体验另一个路由协议(如BGP),或通过配置信息,或通过两者的组合(例如,OSPF根据配置的指标公布的动态外部信息)获得. 任何具有这些外部路由的路由器都称为AS边界路由器。这些路由由路由器通过AS外部LSA播发到OSPF路由域。
List of AS-external-LSAs Part of the link-state database. These have originated from the AS boundary routers. They comprise routes to destinations external to the Autonomous System. Note that, if the router is itself an AS boundary router, some of these AS-external-LSAs have been self-originated.
作为链接状态数据库的一部分的外部LSAs列表。这些都起源于AS边界路由器。它们包括到自治系统外部目的地的路线。请注意,如果路由器本身是AS边界路由器,则其中一些AS外部LSA是自创的。
The routing table Derived from the link-state database. Each entry in the routing table is indexed by a destination, and contains the destination's cost and a set of paths to use in forwarding packets to the destination. A path is described by its type and next hop. For more information, see Section 11.
从链接状态数据库派生的路由表。路由表中的每个条目都由一个目的地索引,并包含目的地的成本和一组用于将数据包转发到目的地的路径。路径由其类型和下一跳描述。有关更多信息,请参见第11节。
Figure 9 shows the collection of data structures present in a typical router. The router pictured is RT10, from the map in Figure 6. Note that Router RT10 has a virtual link configured to Router RT11, with Area 2 as the link's Transit area. This is indicated by the dashed line in Figure 9. When the virtual link becomes active, through the building of the shortest path tree for Area 2, it becomes an interface to the backbone (see the two backbone interfaces depicted in Figure 9).
图9显示了典型路由器中的数据结构集合。图中的路由器是RT10,如图6所示。注意,路由器RT10有一个配置为路由器RT11的虚拟链路,区域2作为链路的传输区域。这由图9中的虚线表示。当虚拟链路变为活动时,通过构建区域2的最短路径树,它将成为主干网的接口(参见图9所示的两个主干网接口)。
The area data structure contains all the information used to run the basic OSPF routing algorithm. Each area maintains its own link-state database. A network belongs to a single area, and a router interface connects to a single area. Each router adjacency also belongs to a single area.
区域数据结构包含用于运行基本OSPF路由算法的所有信息。每个区域都维护自己的链接状态数据库。网络属于单个区域,路由器接口连接到单个区域。每个路由器邻接也属于单个区域。
The OSPF backbone is the special OSPF area responsible for disseminating inter-area routing information.
OSPF主干网是负责传播区域间路由信息的特殊OSPF区域。
The area link-state database consists of the collection of router-LSAs, network-LSAs and summary-LSAs that have originated from the area's routers. This information is flooded throughout a single area only. The list of AS-external-LSAs (see Section 5) is also considered to be part of each area's link-state database.
区域链路状态数据库由源自该区域路由器的路由器LSA、网络LSA和摘要LSA的集合组成。该信息仅在一个区域内被淹没。AS外部LSA列表(见第5节)也被视为每个区域链路状态数据库的一部分。
Area ID A 32-bit number identifying the area. The Area ID of 0.0.0.0 is reserved for the backbone.
区域ID标识该区域的32位数字。区域ID 0.0.0.0是为主干保留的。
List of area address ranges In order to aggregate routing information at area boundaries, area address ranges can be employed. Each address range is specified by an [address,mask] pair and a status indication of either Advertise or DoNotAdvertise (see Section 12.4.3).
区域地址范围列表为了在区域边界聚集路由信息,可以使用区域地址范围。每个地址范围由[address,mask]对和播发或不播发状态指示指定(见第12.4.3节)。
+----+ |RT10|------+ +----+ \+-------------+ / \ |Routing Table| / \ +-------------+ / \ +------+ / \ +--------+ |Area 2|---+ +---|Backbone| +------+***********+ +--------+ / \ * / \ / \ * / \ +---------+ +---------+ +------------+ +------------+ |Interface| |Interface| |Virtual Link| |Interface Ib| | to N6 | | to N8 | | to RT11 | +------------+ +---------+ +---------+ +------------+ | / \ | | | / \ | | | +--------+ +--------+ | +-------------+ +------------+ |Neighbor| |Neighbor| | |Neighbor RT11| |Neighbor RT6| | RT8 | | RT7 | | +-------------+ +------------+ +--------+ +--------+ | | +-------------+ |Neighbor RT11| +-------------+
+----+ |RT10|------+ +----+ \+-------------+ / \ |Routing Table| / \ +-------------+ / \ +------+ / \ +--------+ |Area 2|---+ +---|Backbone| +------+***********+ +--------+ / \ * / \ / \ * / \ +---------+ +---------+ +------------+ +------------+ |Interface| |Interface| |Virtual Link| |Interface Ib| | to N6 | | to N8 | | to RT11 | +------------+ +---------+ +---------+ +------------+ | / \ | | | / \ | | | +--------+ +--------+ | +-------------+ +------------+ |Neighbor| |Neighbor| | |Neighbor RT11| |Neighbor RT6| | RT8 | | RT7 | | +-------------+ +------------+ +--------+ +--------+ | | +-------------+ |Neighbor RT11| +-------------+
Figure 9: Router RT10's Data structures
图9:路由器RT10的数据结构
Associated router interfaces This router's interfaces connecting to the area. A router interface belongs to one and only one area (or the backbone). For the backbone area this list includes all the virtual links. A virtual link is identified by the Router ID of its other endpoint; its cost is the cost of the shortest intra-area path through the Transit area that exists between the two routers.
关联路由器接口连接到该区域的路由器接口。路由器接口只属于一个区域(或主干)。对于主干区域,此列表包括所有虚拟链路。虚拟链路由其另一个端点的路由器ID标识;它的代价是通过两个路由器之间存在的中转区的最短区域内路径的代价。
List of router-LSAs A router-LSA is generated by each router in the area. It describes the state of the router's interfaces to the area.
路由器LSA列表由区域中的每个路由器生成路由器LSA。它描述路由器与该区域的接口状态。
List of network-LSAs One network-LSA is generated for each transit broadcast and NBMA network in the area. A network-LSA describes the set of routers currently connected to the network.
网络LSA列表为区域内的每个公交广播和NBMA网络生成一个网络LSA。网络LSA描述当前连接到网络的一组路由器。
List of summary-LSAs Summary-LSAs originate from the area's area border routers. They describe routes to destinations internal to the Autonomous System, yet external to the area (i.e., inter-area destinations).
摘要LSA列表摘要LSA源于区域的区域边界路由器。它们描述了到自治系统内部但区域外部的目的地(即区域间目的地)的路线。
Shortest-path tree The shortest-path tree for the area, with this router itself as root. Derived from the collected router-LSAs and network-LSAs by the Dijkstra algorithm (see Section 16.1).
最短路径树区域的最短路径树,此路由器本身作为根。由Dijkstra算法收集的路由器LSA和网络LSA导出(见第16.1节)。
TransitCapability This parameter indicates whether the area can carry data traffic that neither originates nor terminates in the area itself. This parameter is calculated when the area's shortest-path tree is built (see Section 16.1, where TransitCapability is set to TRUE if and only if there are one or more fully adjacent virtual links using the area as Transit area), and is used as an input to a subsequent step of the routing table build process (see Section 16.3). When an area's TransitCapability is set to TRUE, the area is said to be a "transit area".
TransitCapability此参数指示区域是否可以承载既不在区域本身发起也不在区域本身终止的数据流量。该参数在构建区域的最短路径树时计算(参见第16.1节,其中TransitCapability设置为TRUE,当且仅当有一个或多个完全相邻的虚拟链路使用该区域作为传输区域时),并用作路由表构建过程后续步骤的输入(参见第16.3节)。当一个区域的可传输性设置为TRUE时,该区域称为“传输区域”。
ExternalRoutingCapability Whether AS-external-LSAs will be flooded into/throughout the area. This is a configurable parameter. If AS-external-LSAs are excluded from the area, the area is called a "stub". Within stub areas, routing to AS external destinations will be based solely on a default summary route. The backbone cannot be configured as a stub area. Also, virtual links cannot be configured through stub areas. For more information, see Section 3.6.
外部布线能力是否为外部LSA将被淹没到该区域/整个区域。这是一个可配置的参数。如果外部LSA被排除在该区域之外,则该区域称为“存根”。在存根区域内,到外部目的地的路由将仅基于默认摘要路由。主干不能配置为存根区域。此外,不能通过存根区域配置虚拟链接。有关更多信息,请参见第3.6节。
StubDefaultCost If the area has been configured as a stub area, and the router itself is an area border router, then the StubDefaultCost indicates the cost of the default summary-LSA that the router should advertise into the area. See Section 12.4.3 for more information.
StubDefaultCost如果该区域已配置为存根区域,并且路由器本身是区域边界路由器,则StubDefaultCost表示路由器应向该区域播发的默认摘要LSA的成本。详见第12.4.3节。
Unless otherwise specified, the remaining sections of this document refer to the operation of the OSPF protocol within a single area.
除非另有规定,本文件其余部分均指OSPF协议在单个区域内的操作。
OSPF creates adjacencies between neighboring routers for the purpose of exchanging routing information. Not every two neighboring routers will become adjacent. This section covers the generalities involved in creating adjacencies. For further details consult Section 10.
OSPF在相邻路由器之间创建邻接,以交换路由信息。并不是每两个相邻的路由器都会变得相邻。本节介绍创建邻接所涉及的一般性。有关更多详细信息,请参阅第10节。
7.1. The Hello Protocol
7.1. Hello协议
The Hello Protocol is responsible for establishing and maintaining neighbor relationships. It also ensures that communication between neighbors is bidirectional. Hello packets are sent periodically out all router interfaces. Bidirectional communication is indicated when the router sees itself listed in the neighbor's Hello Packet. On broadcast and NBMA networks, the Hello Protocol elects a Designated Router for the network.
Hello协议负责建立和维护邻居关系。它还确保邻居之间的通信是双向的。Hello数据包定期发送到所有路由器接口。当路由器看到自己列在邻居的Hello数据包中时,指示双向通信。在广播和NBMA网络上,Hello协议为网络选择指定的路由器。
The Hello Protocol works differently on broadcast networks, NBMA networks and Point-to-MultiPoint networks. On broadcast networks, each router advertises itself by periodically multicasting Hello Packets. This allows neighbors to be discovered dynamically. These Hello Packets contain the router's view of the Designated Router's identity, and the list of routers whose Hello Packets have been seen recently.
Hello协议在广播网络、NBMA网络和点对多点网络上的工作方式不同。在广播网络上,每个路由器通过周期性地多播Hello数据包来宣传自己。这允许动态发现邻居。这些Hello数据包包含路由器对指定路由器身份的视图,以及最近看到其Hello数据包的路由器列表。
On NBMA networks some configuration information may be necessary for the operation of the Hello Protocol. Each router that may potentially become Designated Router has a list of all other
在NBMA网络上,Hello协议的操作可能需要一些配置信息。每个可能成为指定路由器的路由器都有一个所有其他路由器的列表
routers attached to the network. A router, having Designated Router potential, sends Hello Packets to all other potential Designated Routers when its interface to the NBMA network first becomes operational. This is an attempt to find the Designated Router for the network. If the router itself is elected Designated Router, it begins sending Hello Packets to all other routers attached to the network.
连接到网络的路由器。具有指定路由器电势的路由器在其与NBMA网络的接口第一次开始工作时向所有其他潜在的指定路由器发送Hello分组。这是试图找到网络的指定路由器。如果路由器本身被选为指定路由器,它将开始向连接到网络的所有其他路由器发送Hello数据包。
On Point-to-MultiPoint networks, a router sends Hello Packets to all neighbors with which it can communicate directly. These neighbors may be discovered dynamically through a protocol such as Inverse ARP (see [Ref14]), or they may be configured.
在点对多点网络上,路由器将Hello数据包发送给所有它可以直接与之通信的邻居。这些邻居可以通过反向ARP(参见[Ref14])等协议动态发现,也可以对其进行配置。
After a neighbor has been discovered, bidirectional communication ensured, and (if on a broadcast or NBMA network) a Designated Router elected, a decision is made regarding whether or not an adjacency should be formed with the neighbor (see Section 10.4). If an adjacency is to be formed, the first step is to synchronize the neighbors' link-state databases. This is covered in the next section.
发现邻居后,确保双向通信,并且(如果在广播或NBMA网络上)选择指定的路由器,就是否应与邻居形成邻接作出决定(见第10.4节)。如果要形成邻接,第一步是同步邻居的链路状态数据库。这将在下一节中介绍。
7.2. The Synchronization of Databases
7.2. 数据库的同步
In a link-state routing algorithm, it is very important for all routers' link-state databases to stay synchronized. OSPF simplifies this by requiring only adjacent routers to remain synchronized. The synchronization process begins as soon as the routers attempt to bring up the adjacency. Each router describes its database by sending a sequence of Database Description packets to its neighbor. Each Database Description Packet describes a set of LSAs belonging to the router's database. When the neighbor sees an LSA that is more recent than its own database copy, it makes a note that this newer LSA should be requested.
在链路状态路由算法中,所有路由器的链路状态数据库保持同步是非常重要的。OSPF只需要相邻路由器保持同步,从而简化了这一过程。一旦路由器试图建立邻接关系,同步过程就开始了。每个路由器通过向其邻居发送一系列数据库描述数据包来描述其数据库。每个数据库描述包描述一组属于路由器数据库的LSA。当邻居看到一个比它自己的数据库副本更新的LSA时,它会注意到应该请求这个新的LSA。
This sending and receiving of Database Description packets is called the "Database Exchange Process". During this process, the two routers form a master/slave relationship. Each Database Description Packet has a sequence number. Database Description Packets sent by the master (polls) are acknowledged by the slave through echoing of the sequence number. Both polls and their
数据库描述包的发送和接收称为“数据库交换过程”。在此过程中,两个路由器形成主/从关系。每个数据库描述数据包都有一个序列号。主站发送的数据库描述数据包(轮询)由从站通过回显序列号进行确认。民意测验及其结果
responses contain summaries of link state data. The master is the only one allowed to retransmit Database Description Packets. It does so only at fixed intervals, the length of which is the configured per-interface constant RxmtInterval.
响应包含链路状态数据的摘要。主机是唯一允许重新传输数据库描述数据包的主机。它仅以固定的间隔执行此操作,其长度为配置的每个接口常量RxmtInterval。
Each Database Description contains an indication that there are more packets to follow --- the M-bit. The Database Exchange Process is over when a router has received and sent Database Description Packets with the M-bit off.
Each Database Description contains an indication that there are more packets to follow --- the M-bit. The Database Exchange Process is over when a router has received and sent Database Description Packets with the M-bit off.
During and after the Database Exchange Process, each router has a list of those LSAs for which the neighbor has more up-to-date instances. These LSAs are requested in Link State Request Packets. Link State Request packets that are not satisfied are retransmitted at fixed intervals of time RxmtInterval. When the Database Description Process has completed and all Link State Requests have been satisfied, the databases are deemed synchronized and the routers are marked fully adjacent. At this time the adjacency is fully functional and is advertised in the two routers' router-LSAs.
在数据库交换过程期间和之后,每个路由器都有一个LSA列表,其中邻居有更多的最新实例。这些LSA是在链路状态请求数据包中请求的。未满足的链路状态请求数据包以固定的时间间隔RxmtInterval重新传输。当数据库描述过程完成且满足所有链路状态请求时,数据库被视为已同步,路由器被标记为完全相邻。此时,邻接是全功能的,并在两个路由器的路由器LSA中公布。
The adjacency is used by the flooding procedure as soon as the Database Exchange Process begins. This simplifies database synchronization, and guarantees that it finishes in a predictable period of time.
一旦数据库交换过程开始,洪泛过程就会使用邻接关系。这简化了数据库同步,并保证它在可预测的时间内完成。
7.3. The Designated Router
7.3. 指定路由器
Every broadcast and NBMA network has a Designated Router. The Designated Router performs two main functions for the routing protocol:
每个广播和NBMA网络都有一个指定的路由器。指定路由器执行路由协议的两个主要功能:
o The Designated Router originates a network-LSA on behalf of the network. This LSA lists the set of routers (including the Designated Router itself) currently attached to the network. The Link State ID for this LSA (see Section 12.1.4) is the IP interface address of the Designated Router. The IP network number can then be obtained by using the network's subnet/network mask.
o 指定的路由器代表网络发起网络LSA。此LSA列出当前连接到网络的一组路由器(包括指定的路由器本身)。此LSA的链路状态ID(见第12.1.4节)是指定路由器的IP接口地址。然后可以使用网络的子网/网络掩码获取IP网络号。
o The Designated Router becomes adjacent to all other routers on the network. Since the link state databases are synchronized across adjacencies (through adjacency bring-up and then the flooding procedure), the Designated Router plays a central part in the synchronization process.
o 指定的路由器与网络上的所有其他路由器相邻。由于链路状态数据库是跨邻接同步的(通过邻接启动,然后是泛洪过程),因此指定的路由器在同步过程中起着核心作用。
The Designated Router is elected by the Hello Protocol. A router's Hello Packet contains its Router Priority, which is configurable on a per-interface basis. In general, when a router's interface to a network first becomes functional, it checks to see whether there is currently a Designated Router for the network. If there is, it accepts that Designated Router, regardless of its Router Priority. (This makes it harder to predict the identity of the Designated Router, but ensures that the Designated Router changes less often. See below.) Otherwise, the router itself becomes Designated Router if it has the highest Router Priority on the network. A more detailed (and more accurate) description of Designated Router election is presented in Section 9.4.
指定的路由器由Hello协议选择。路由器的Hello数据包包含其路由器优先级,该优先级可根据每个接口进行配置。通常,当路由器与网络的接口第一次起作用时,它会检查网络当前是否有指定的路由器。如果有,它接受指定的路由器,而不考虑其路由器优先级。(这使得很难预测指定路由器的身份,但可以确保指定路由器的更改频率较低。请参见下文。)否则,如果路由器在网络上具有最高的路由器优先级,则路由器本身将成为指定路由器。第9.4节对指定路由器选择进行了更详细(更准确)的描述。
The Designated Router is the endpoint of many adjacencies. In order to optimize the flooding procedure on broadcast networks, the Designated Router multicasts its Link State Update Packets to the address AllSPFRouters, rather than sending separate packets over each adjacency.
指定的路由器是许多邻接的端点。为了优化广播网络上的泛洪过程,指定的路由器将其链路状态更新数据包多播到地址AllsFrouters,而不是在每个相邻位置发送单独的数据包。
Section 2 of this document discusses the directed graph representation of an area. Router nodes are labelled with their Router ID. Transit network nodes are actually labelled with the IP address of their Designated Router. It follows that when the Designated Router changes, it appears as if the network node on the graph is replaced by an entirely new node. This will cause the network and all its attached routers to originate new LSAs. Until the link-state databases again converge, some temporary loss of connectivity may result. This may result in ICMP unreachable messages being sent in response to data traffic. For that reason, the Designated Router should change only infrequently. Router Priorities should be configured so that the most dependable router on a network eventually becomes Designated Router.
本文档第2节讨论区域的有向图表示。路由器节点标有其路由器ID。传输网络节点实际上标有其指定路由器的IP地址。因此,当指定的路由器发生变化时,图上的网络节点似乎被一个全新的节点所取代。这将导致网络及其所有连接的路由器发起新的LSA。在链路状态数据库再次聚合之前,可能会导致连接暂时中断。这可能导致发送ICMP无法访问的消息以响应数据流量。由于这个原因,指定的路由器应该很少改变。路由器优先级的配置应确保网络上最可靠的路由器最终成为指定路由器。
7.4. The Backup Designated Router
7.4. 备份指定的路由器
In order to make the transition to a new Designated Router smoother, there is a Backup Designated Router for each broadcast and NBMA network. The Backup Designated Router is also adjacent to all routers on the network, and becomes Designated Router when the previous Designated Router fails. If there were no Backup Designated Router, when a new Designated Router became necessary, new adjacencies would have to be formed between the new Designated Router and all other routers attached to the network. Part of the adjacency forming process is the synchronizing of link-state databases, which can potentially take quite a long time. During this time, the network would not be available for transit data traffic. The Backup Designated obviates the need to form these adjacencies, since they already exist. This means the period of disruption in transit traffic lasts only as long as it takes to flood the new LSAs (which announce the new Designated Router).
为了使向新的指定路由器的过渡更加顺利,每个广播和NBMA网络都有一个备份的指定路由器。备份指定路由器也与网络上的所有路由器相邻,当先前指定的路由器出现故障时,它将成为指定路由器。如果没有备用指定路由器,当需要新的指定路由器时,必须在新的指定路由器和连接到网络的所有其他路由器之间形成新的邻接。邻接形成过程的一部分是链路状态数据库的同步,这可能需要相当长的时间。在此期间,网络将无法用于传输数据通信。指定的备份避免了形成这些邻接的需要,因为它们已经存在。这意味着过境交通中断的时间只会持续到淹没新LSA(宣布新的指定路由器)所需的时间。
The Backup Designated Router does not generate a network-LSA for the network. (If it did, the transition to a new Designated Router would be even faster. However, this is a tradeoff between database size and speed of convergence when the Designated Router disappears.)
备份指定路由器不为网络生成网络LSA。(如果是这样的话,到新的指定路由器的转换速度会更快。但是,当指定路由器消失时,这是数据库大小和收敛速度之间的折衷。)
The Backup Designated Router is also elected by the Hello Protocol. Each Hello Packet has a field that specifies the Backup Designated Router for the network.
备份指定路由器也由Hello协议选择。每个Hello数据包都有一个字段,用于指定网络的备份指定路由器。
In some steps of the flooding procedure, the Backup Designated Router plays a passive role, letting the Designated Router do more of the work. This cuts down on the amount of local routing traffic. See Section 13.3 for more information.
在泛洪过程的某些步骤中,备份指定路由器扮演被动角色,让指定路由器完成更多工作。这将减少本地路由通信量。更多信息请参见第13.3节。
7.5. The graph of adjacencies
7.5. 邻接图
An adjacency is bound to the network that the two routers have in common. If two routers have multiple networks in common, they may have multiple adjacencies between them.
一个邻接绑定到两个路由器共同拥有的网络。如果两个路由器有多个共同的网络,它们之间可能有多个邻接。
One can picture the collection of adjacencies on a network as forming an undirected graph. The vertices consist of routers, with an edge joining two routers if they are adjacent. The graph of adjacencies describes the flow of routing protocol packets, and in particular Link State Update Packets, through the Autonomous System.
可以将网络上的邻接集合描绘成一个无向图。顶点由路由器组成,如果两个路由器相邻,则边连接两个路由器。邻接图描述了路由协议数据包,尤其是链路状态更新数据包通过自治系统的流程。
Two graphs are possible, depending on whether a Designated Router is elected for the network. On physical point-to-point networks, Point-to-MultiPoint networks and virtual links, neighboring routers become adjacent whenever they can communicate directly. In contrast, on broadcast and NBMA networks only the Designated Router and the Backup Designated Router become adjacent to all other routers attached to the network.
根据是否为网络选择了指定的路由器,可能有两个图。在物理点对点网络、点对多点网络和虚拟链路上,只要可以直接通信,相邻路由器就会变得相邻。相反,在广播和NBMA网络上,只有指定路由器和备份指定路由器与连接到网络的所有其他路由器相邻。
+---+ +---+ |RT1|------------|RT2| o---------------o +---+ N1 +---+ RT1 RT2
+---+ +---+ |RT1|------------|RT2| o---------------o +---+ N1 +---+ RT1 RT2
RT7 o---------+ +---+ +---+ +---+ /|\ | |RT7| |RT3| |RT4| / | \ | +---+ +---+ +---+ / | \ | | | | / | \ | +-----------------------+ RT5o RT6o oRT4 | | | N2 * * * | +---+ +---+ * * * | |RT5| |RT6| * * * | +---+ +---+ *** | o---------+ RT3
RT7 o---------+ +---+ +---+ +---+ /|\ | |RT7| |RT3| |RT4| / | \ | +---+ +---+ +---+ / | \ | | | | / | \ | +-----------------------+ RT5o RT6o oRT4 | | | N2 * * * | +---+ +---+ * * * | |RT5| |RT6| * * * | +---+ +---+ *** | o---------+ RT3
Figure 10: The graph of adjacencies
图10:邻接图
These graphs are shown in Figure 10. It is assumed that Router RT7 has become the Designated Router, and Router RT3 the Backup Designated Router, for the Network N2. The Backup Designated Router performs a lesser function during the flooding procedure than the Designated Router (see Section 13.3). This is the reason for the dashed lines connecting the Backup Designated Router RT3.
这些图如图10所示。假设路由器RT7已成为网络N2的指定路由器,而路由器RT3已成为备份指定路由器。在泛洪过程中,备用指定路由器的功能不如指定路由器(见第13.3节)。这就是虚线连接备份指定路由器RT3的原因。
This section discusses the general processing of OSPF routing protocol packets. It is very important that the router link-state databases remain synchronized. For this reason, routing protocol packets should get preferential treatment over ordinary data packets, both in sending and receiving.
本节讨论OSPF路由协议数据包的一般处理。路由器链路状态数据库保持同步非常重要。因此,无论在发送还是接收过程中,路由协议包都应该得到比普通数据包更优惠的待遇。
Routing protocol packets are sent along adjacencies only (with the exception of Hello packets, which are used to discover the adjacencies). This means that all routing protocol packets travel a single IP hop, except those sent over virtual links.
路由协议数据包仅沿邻接发送(用于发现邻接的Hello数据包除外)。这意味着,除了通过虚拟链路发送的路由协议数据包外,所有路由协议数据包都只经过一个IP跃点。
All routing protocol packets begin with a standard header. The sections below provide details on how to fill in and verify this standard header. Then, for each packet type, the section giving more details on that particular packet type's processing is listed.
所有路由协议数据包都以标准头开始。以下各节提供了有关如何填写和验证此标准标题的详细信息。然后,对于每种数据包类型,将列出关于该特定数据包类型处理的更多细节的部分。
8.1. Sending protocol packets
8.1. 发送协议包
When a router sends a routing protocol packet, it fills in the fields of the standard OSPF packet header as follows. For more details on the header format consult Section A.3.1:
当路由器发送路由协议数据包时,它会按如下方式填写标准OSPF数据包头的字段。有关标题格式的更多详细信息,请参阅第A.3.1节:
Version # Set to 2, the version number of the protocol as documented in this specification.
版本#设置为2,即本规范中记录的协议版本号。
Packet type The type of OSPF packet, such as Link state Update or Hello Packet.
数据包类型OSPF数据包的类型,如链路状态更新或Hello数据包。
Packet length The length of the entire OSPF packet in bytes, including the standard OSPF packet header.
数据包长度整个OSPF数据包的长度(字节),包括标准OSPF数据包头。
Router ID The identity of the router itself (who is originating the packet).
路由器ID路由器本身的身份(发起数据包的人)。
Area ID The OSPF area that the packet is being sent into.
Area ID数据包发送到的OSPF区域。
Checksum The standard IP 16-bit one's complement checksum of the entire OSPF packet, excluding the 64-bit authentication field. This checksum is calculated as part of the appropriate authentication procedure; for some OSPF authentication types, the checksum calculation is omitted. See Section D.4 for details.
校验和整个OSPF数据包的标准IP 16位1的补码校验和,不包括64位身份验证字段。该校验和作为适当认证过程的一部分进行计算;对于某些OSPF身份验证类型,将省略校验和计算。详见第D.4节。
AuType and Authentication Each OSPF packet exchange is authenticated. Authentication types are assigned by the protocol and are documented in Appendix D. A different authentication procedure can be used for each IP network/subnet. Autype indicates the type of authentication procedure in use. The 64-bit authentication field is then for use by the chosen authentication procedure. This procedure should be the last called when forming the packet to be sent. See Section D.4 for details.
AuType和身份验证每个OSPF数据包交换都经过身份验证。认证类型由协议分配,并记录在附录D中。每个IP网络/子网可使用不同的认证程序。Autype表示正在使用的身份验证过程的类型。然后,64位身份验证字段供所选身份验证过程使用。在形成要发送的数据包时,应最后调用此过程。详见第D.4节。
The IP destination address for the packet is selected as follows. On physical point-to-point networks, the IP destination is always set to the address AllSPFRouters. On all other network types (including virtual links), the majority of OSPF packets are sent as unicasts, i.e., sent directly to the other end of the adjacency. In this case, the IP destination is just the Neighbor IP address associated with the other end of the adjacency (see Section 10). The only packets not sent as unicasts are on broadcast networks; on these networks Hello packets are sent to the multicast destination AllSPFRouters, the Designated Router and its Backup send both Link State Update
分组的IP目的地地址选择如下。在物理点对点网络上,IP目的地始终设置为AllSPFRouters地址。在所有其他网络类型(包括虚拟链路)上,大多数OSPF数据包作为单播发送,即直接发送到相邻网络的另一端。在这种情况下,IP目的地只是与邻接的另一端相关联的邻居IP地址(参见第10节)。唯一不作为单播发送的数据包是在广播网络上;在这些网络上,Hello数据包被发送到多播目的地AllSPFRouters,指定的路由器及其备份发送链路状态更新
Packets and Link State Acknowledgment Packets to the multicast address AllSPFRouters, while all other routers send both their Link State Update and Link State Acknowledgment Packets to the multicast address AllDRouters.
数据包和链路状态确认数据包发送到多播地址AllsFroOuters,而所有其他路由器将其链路状态更新和链路状态确认数据包发送到多播地址AlldOuters。
Retransmissions of Link State Update packets are ALWAYS sent directly to the neighbor. On multi-access networks, this means that retransmissions should be sent to the neighbor's IP address.
链路状态更新数据包的重传总是直接发送给邻居。在多址网络上,这意味着应将重传发送到邻居的IP地址。
The IP source address should be set to the IP address of the sending interface. Interfaces to unnumbered point-to-point networks have no associated IP address. On these interfaces, the IP source should be set to any of the other IP addresses belonging to the router. For this reason, there must be at least one IP address assigned to the router.[2] Note that, for most purposes, virtual links act precisely the same as unnumbered point-to-point networks. However, each virtual link does have an IP interface address (discovered during the routing table build process) which is used as the IP source when sending packets over the virtual link.
IP源地址应设置为发送接口的IP地址。未编号的点到点网络的接口没有关联的IP地址。在这些接口上,IP源应设置为属于路由器的任何其他IP地址。因此,必须至少为路由器分配一个IP地址。[2]注意,在大多数情况下,虚拟链路的作用与未编号的点对点网络完全相同。但是,每个虚拟链路都有一个IP接口地址(在路由表构建过程中发现),当通过虚拟链路发送数据包时,该地址用作IP源。
For more information on the format of specific OSPF packet types, consult the sections listed in Table 10.
有关特定OSPF数据包类型格式的更多信息,请参阅表10中列出的部分。
Type Packet name detailed section (transmit) _________________________________________________________ 1 Hello Section 9.5 2 Database description Section 10.8 3 Link state request Section 10.9 4 Link state update Section 13.3 5 Link state ack Section 13.5
Type Packet name detailed section (transmit) _________________________________________________________ 1 Hello Section 9.5 2 Database description Section 10.8 3 Link state request Section 10.9 4 Link state update Section 13.3 5 Link state ack Section 13.5
Table 10: Sections describing OSPF protocol packet transmission.
表10:描述OSPF协议包传输的章节。
8.2. Receiving protocol packets
8.2. 接收协议包
Whenever a protocol packet is received by the router it is marked with the interface it was received on. For routers that have virtual links configured, it may not be immediately obvious which interface to associate the packet with. For example, consider the Router RT11 depicted in Figure 6. If RT11 receives an OSPF protocol packet on its interface to Network N8, it may want to associate the packet with the interface to Area 2, or with the virtual link to Router RT10 (which is part of the backbone). In the following, we assume that the packet is initially associated with the non-virtual link.[3]
每当路由器接收到一个协议包时,它都会用它接收到的接口进行标记。对于配置了虚拟链路的路由器,可能无法立即确定要将数据包与哪个接口关联。例如,考虑图6中描述的路由器RT11。如果RT11在其与网络N8的接口上接收到OSPF协议分组,则它可能希望将该分组与到区域2的接口相关联,或者与到路由器RT10(其是主干网的一部分)的虚拟链路相关联。在下文中,我们假设数据包最初与非虚拟链路相关联。[3]
In order for the packet to be accepted at the IP level, it must pass a number of tests, even before the packet is passed to OSPF for processing:
为了在IP级别接受数据包,它必须通过许多测试,甚至在数据包被传递到OSPF进行处理之前:
o The IP checksum must be correct.
o IP校验和必须正确。
o The packet's IP destination address must be the IP address of the receiving interface, or one of the IP multicast addresses AllSPFRouters or AllDRouters.
o 数据包的IP目的地地址必须是接收接口的IP地址,或者是IP多播地址AllSPFRouters或AlldRotters中的一个。
o The IP protocol specified must be OSPF (89).
o 指定的IP协议必须是OSPF(89)。
o Locally originated packets should not be passed on to OSPF. That is, the source IP address should be examined to make sure this is not a multicast packet that the router itself generated.
o 本地发起的数据包不应传递到OSPF。也就是说,应该检查源IP地址,以确保这不是路由器本身生成的多播数据包。
Next, the OSPF packet header is verified. The fields specified in the header must match those configured for the receiving interface. If they do not, the packet should be discarded:
接下来,验证OSPF分组报头。标头中指定的字段必须与为接收接口配置的字段匹配。如果没有,则应丢弃数据包:
o The version number field must specify protocol version 2.
o 版本号字段必须指定协议版本2。
o The Area ID found in the OSPF header must be verified. If both of the following cases fail, the packet should be discarded. The Area ID specified in the header must either:
o 必须验证在OSPF标头中找到的区域ID。如果以下两种情况均失败,则应丢弃数据包。标头中指定的区域ID必须:
(1) Match the Area ID of the receiving interface. In this case, the packet has been sent over a single hop. Therefore, the packet's IP source address is required to be on the same network as the receiving interface. This can be verified by comparing the packet's IP source address to the interface's IP address, after masking both addresses with the interface mask. This comparison should not be performed on point-to-point networks. On point-to-point networks, the interface addresses of each end of the link are assigned independently, if they are assigned at all.
(1) 匹配接收接口的区域ID。在这种情况下,数据包是通过单跳发送的。因此,数据包的IP源地址要求与接收接口位于同一网络上。在用接口掩码屏蔽两个地址之后,可以通过比较数据包的IP源地址和接口的IP地址来验证这一点。不应在点到点网络上执行此比较。在点到点网络上,链路每一端的接口地址都是独立分配的(如果分配的话)。
(2) Indicate the backbone. In this case, the packet has been sent over a virtual link. The receiving router must be an area border router, and the Router ID specified in the packet (the source router) must be the other end of a configured virtual link. The receiving interface must also attach to the virtual link's configured Transit area. If all of these checks succeed, the packet is accepted and is from now on associated with the virtual link (and the backbone area).
(2) 表示主干。在这种情况下,数据包已通过虚拟链路发送。接收路由器必须是区域边界路由器,数据包中指定的路由器ID(源路由器)必须是已配置虚拟链路的另一端。接收接口还必须连接到虚拟链路的配置传输区域。如果所有这些检查都成功,则数据包将被接受,并从现在起与虚拟链路(和主干区域)关联。
o Packets whose IP destination is AllDRouters should only be accepted if the state of the receiving interface is DR or Backup (see Section 9.1).
o 仅当接收接口的状态为DR或Backup时,才应接受IP目的地为AllDrooters的数据包(见第9.1节)。
o The AuType specified in the packet must match the AuType specified for the associated area.
o 数据包中指定的AuType必须与为关联区域指定的AuType匹配。
o The packet must be authenticated. The authentication procedure is indicated by the setting of AuType (see Appendix D). The authentication procedure may use one or more Authentication keys, which can be configured on a per-interface basis. The authentication procedure may also verify the checksum field in the OSPF packet header (which, when used, is set to the standard IP 16-bit one's complement checksum of the OSPF packet's contents after excluding the 64-bit authentication field). If the authentication procedure fails, the packet should be discarded.
o 数据包必须经过身份验证。认证程序由AuType设置指示(见附录D)。认证过程可以使用一个或多个认证密钥,可以基于每个接口进行配置。认证过程还可以验证OSPF分组报头中的校验和字段(当使用该校验和字段时,在排除64位认证字段之后,将其设置为OSPF分组内容的标准IP 16位一的补码校验和)。如果身份验证过程失败,则应丢弃数据包。
If the packet type is Hello, it should then be further processed by the Hello Protocol (see Section 10.5). All other packet types are sent/received only on adjacencies. This means that the packet must have been sent by one of the router's active neighbors. If the receiving interface connects to a broadcast network, Point-to-MultiPoint network or NBMA network the sender is identified by the IP source address found in the packet's IP header. If the receiving interface connects to a point-to-point network or a virtual link, the sender is identified by the Router ID (source router) found in the packet's OSPF header. The data structure associated with the receiving interface contains the list of active neighbors. Packets not matching any active neighbor are discarded.
如果数据包类型为Hello,则应通过Hello协议对其进行进一步处理(参见第10.5节)。所有其他数据包类型仅在相邻位置发送/接收。这意味着数据包必须由路由器的一个活动邻居发送。如果接收接口连接到广播网络、点对多点网络或NBMA网络,则发送方通过在数据包的IP报头中找到的IP源地址进行标识。如果接收接口连接到点对点网络或虚拟链路,则发送方将通过在数据包的OSPF报头中找到的路由器ID(源路由器)进行标识。与接收接口关联的数据结构包含活动邻居列表。不匹配任何活动邻居的数据包将被丢弃。
At this point all received protocol packets are associated with an active neighbor. For the further input processing of specific packet types, consult the sections listed in Table 11.
此时,所有接收到的协议包都与活动邻居关联。有关特定数据包类型的进一步输入处理,请参阅表11中列出的部分。
Type Packet name detailed section (receive) ________________________________________________________ 1 Hello Section 10.5 2 Database description Section 10.6 3 Link state request Section 10.7 4 Link state update Section 13 5 Link state ack Section 13.7
Type Packet name detailed section (receive) ________________________________________________________ 1 Hello Section 10.5 2 Database description Section 10.6 3 Link state request Section 10.7 4 Link state update Section 13 5 Link state ack Section 13.7
Table 11: Sections describing OSPF protocol packet reception.
表11:描述OSPF协议数据包接收的章节。
An OSPF interface is the connection between a router and a network. We assume a single OSPF interface to each attached network/subnet, although supporting multiple interfaces on a single network is considered in Appendix F. Each interface structure has at most one IP interface address.
OSPF接口是路由器和网络之间的连接。我们假设每个连接的网络/子网都有一个OSPF接口,尽管附录F中考虑了在单个网络上支持多个接口。每个接口结构最多有一个IP接口地址。
An OSPF interface can be considered to belong to the area that contains the attached network. All routing protocol packets originated by the router over this interface are labelled with the interface's Area ID. One or more router adjacencies may develop over an interface. A router's LSAs reflect the state of its interfaces and their associated adjacencies.
可以认为OSPF接口属于包含连接网络的区域。路由器在该接口上发起的所有路由协议数据包都标有该接口的区域ID。一个或多个路由器邻接可能在一个接口上发展。路由器的LSA反映其接口及其相关邻接的状态。
The following data items are associated with an interface. Note that a number of these items are actually configuration for the attached network; such items must be the same for all routers connected to the network.
以下数据项与接口相关联。请注意,其中许多项实际上是连接网络的配置;对于连接到网络的所有路由器,这些项目必须相同。
Type The OSPF interface type is either point-to-point, broadcast, NBMA, Point-to-MultiPoint or virtual link.
类型OSPF接口类型为点对点、广播、NBMA、点对多点或虚拟链路。
State The functional level of an interface. State determines whether or not full adjacencies are allowed to form over the interface. State is also reflected in the router's LSAs.
说明接口的功能级别。状态确定是否允许在接口上形成完全邻接。状态也反映在路由器的LSA中。
IP interface address The IP address associated with the interface. This appears as the IP source address in all routing protocol packets originated over this interface. Interfaces to unnumbered point-to-point networks do not have an associated IP address.
IP接口地址与接口关联的IP地址。这在通过该接口发起的所有路由协议数据包中显示为IP源地址。指向未编号的点到点网络的接口没有关联的IP地址。
IP interface mask Also referred to as the subnet mask, this indicates the portion of the IP interface address that identifies the attached network. Masking the IP interface address with the IP interface mask yields the IP network number of the attached network. On point-to-point networks and virtual links, the IP interface mask is not defined. On these networks, the link itself is not assigned an IP network number, and so the addresses of each side of the link are assigned independently, if they are assigned at all.
IP接口掩码也称为子网掩码,表示IP接口地址中标识连接网络的部分。使用IP接口掩码屏蔽IP接口地址会生成连接网络的IP网络号。在点到点网络和虚拟链路上,未定义IP接口掩码。在这些网络上,链路本身没有分配IP网络号,因此链路每一侧的地址都是独立分配的,如果它们被分配的话。
Area ID The Area ID of the area to which the attached network belongs. All routing protocol packets originating from the interface are labelled with this Area ID.
Area ID连接网络所属区域的区域ID。来自接口的所有路由协议数据包都标有此区域ID。
HelloInterval The length of time, in seconds, between the Hello packets that the router sends on the interface. Advertised in Hello packets sent out this interface.
HelloInterval路由器在接口上发送的Hello数据包之间的时间长度,以秒为单位。在Hello中播发的数据包发送到此接口。
RouterDeadInterval The number of seconds before the router's neighbors will declare it down, when they stop hearing the router's Hello Packets. Advertised in Hello packets sent out this interface.
RouterReadInterval路由器的邻居停止听到路由器的Hello数据包时,在宣布关闭之前的秒数。在Hello中播发的数据包发送到此接口。
InfTransDelay The estimated number of seconds it takes to transmit a Link State Update Packet over this interface. LSAs contained in the Link State Update packet will have their age incremented by this amount before transmission. This value should take into account transmission and propagation delays; it must be greater than zero.
InfTransDelay通过此接口传输链路状态更新数据包所需的估计秒数。链路状态更新数据包中包含的LSA将在传输前按此数量增加其年龄。该值应考虑传输和传播延迟;它必须大于零。
Router Priority An 8-bit unsigned integer. When two routers attached to a network both attempt to become Designated Router, the one with the highest Router Priority takes precedence. A router whose Router Priority is set to 0 is ineligible to become Designated Router on the attached network. Advertised in Hello packets sent out this interface.
路由器优先级为8位无符号整数。当两个连接到网络的路由器都试图成为指定路由器时,具有最高路由器优先级的路由器优先。路由器优先级设置为0的路由器没有资格成为连接网络上的指定路由器。在Hello中播发的数据包发送到此接口。
Hello Timer An interval timer that causes the interface to send a Hello packet. This timer fires every HelloInterval seconds. Note that on non-broadcast networks a separate Hello packet is sent to each qualified neighbor.
Hello Timer使接口发送Hello数据包的间隔计时器。此计时器每隔几秒钟启动一次。请注意,在非广播网络上,会向每个合格的邻居发送一个单独的Hello数据包。
Wait Timer A single shot timer that causes the interface to exit the Waiting state, and as a consequence select a Designated Router on the network. The length of the timer is RouterDeadInterval seconds.
Wait Timer使接口退出等待状态并因此选择网络上指定路由器的单次触发计时器。计时器的长度为RouterDeadInterval秒。
List of neighboring routers The other routers attached to this network. This list is formed by the Hello Protocol. Adjacencies will be formed to some of
连接到此网络的其他路由器的相邻路由器列表。此列表由Hello协议组成。将与以下部分形成邻接:
these neighbors. The set of adjacent neighbors can be determined by an examination of all of the neighbors' states.
这些邻居。相邻邻居的集合可以通过检查所有邻居的状态来确定。
Designated Router The Designated Router selected for the attached network. The Designated Router is selected on all broadcast and NBMA networks by the Hello Protocol. Two pieces of identification are kept for the Designated Router: its Router ID and its IP interface address on the network. The Designated Router advertises link state for the network; this network-LSA is labelled with the Designated Router's IP address. The Designated Router is initialized to 0.0.0.0, which indicates the lack of a Designated Router.
指定路由器为连接的网络选择的指定路由器。通过Hello协议在所有广播和NBMA网络上选择指定的路由器。为指定的路由器保留两个标识:其路由器ID和网络上的IP接口地址。指定的路由器播发网络的链路状态;此网络LSA标有指定路由器的IP地址。指定的路由器被初始化为0.0.0.0,这表示缺少指定的路由器。
Backup Designated Router The Backup Designated Router is also selected on all broadcast and NBMA networks by the Hello Protocol. All routers on the attached network become adjacent to both the Designated Router and the Backup Designated Router. The Backup Designated Router becomes Designated Router when the current Designated Router fails. The Backup Designated Router is initialized to 0.0.0.0, indicating the lack of a Backup Designated Router.
备份指定路由器也通过Hello协议在所有广播和NBMA网络上选择备份指定路由器。连接网络上的所有路由器都与指定路由器和备份指定路由器相邻。当当前指定的路由器出现故障时,备份指定的路由器将变为指定路由器。备份指定路由器初始化为0.0.0.0,表示缺少备份指定路由器。
Interface output cost(s) The cost of sending a data packet on the interface, expressed in the link state metric. This is advertised as the link cost for this interface in the router-LSA. The cost of an interface must be greater than zero.
接口输出成本在接口上发送数据包的成本,以链路状态度量表示。这在路由器LSA中作为该接口的链路成本公布。接口的成本必须大于零。
RxmtInterval The number of seconds between LSA retransmissions, for adjacencies belonging to this interface. Also used when retransmitting Database Description and Link State Request Packets.
RxMTINERVAL对于属于此接口的邻接,LSA重新传输之间的秒数。在重新传输数据库描述和链路状态请求数据包时也使用。
AuType The type of authentication used on the attached network/subnet. Authentication types are defined in Appendix D. All OSPF packet exchanges are authenticated. Different authentication schemes may be used on different networks/subnets.
AuType连接的网络/子网上使用的身份验证类型。认证类型在附录D中定义。所有OSPF数据包交换都经过认证。在不同的网络/子网上可以使用不同的身份验证方案。
Authentication key This configured data allows the authentication procedure to generate and/or verify OSPF protocol packets. The Authentication key can be configured on a per-interface basis. For example, if the AuType indicates simple password, the Authentication key would be a 64-bit clear password which is inserted into the OSPF packet header. If instead Autype indicates Cryptographic authentication, then the Authentication key is a shared secret which enables the generation/verification of message digests which are appended to the OSPF protocol packets. When Cryptographic authentication is used, multiple simultaneous keys are supported in order to achieve smooth key transition (see Section D.3).
身份验证密钥此配置数据允许身份验证过程生成和/或验证OSPF协议数据包。可以基于每个接口配置身份验证密钥。例如,如果AuType指示简单密码,则身份验证密钥将是插入OSPF数据包头中的64位清除密码。如果Autype指示加密身份验证,则身份验证密钥是一个共享密钥,它支持生成/验证附加到OSPF协议数据包的消息摘要。使用加密身份验证时,支持多个同时密钥,以实现平稳的密钥转换(参见第D.3节)。
9.1. Interface states
9.1. 界面状态
The various states that router interfaces may attain is documented in this section. The states are listed in order of progressing functionality. For example, the inoperative state is listed first, followed by a list of intermediate states before the final, fully functional state is achieved. The specification makes use of this ordering by sometimes making references such as "those interfaces in state greater than X". Figure 11 shows the graph of interface state changes. The arcs of the graph are labelled with the event causing the state change. These events are documented in Section 9.2. The interface state machine is described in more detail in Section 9.3.
路由器接口可能达到的各种状态记录在本节中。这些状态按功能的进展顺序列出。例如,首先列出不工作状态,然后列出中间状态列表,然后才能达到最终的完全功能状态。本规范有时通过引用“状态大于X的接口”等方式利用这种顺序。图11显示了接口状态变化图。图形的圆弧标有导致状态更改的事件。这些事件记录在第9.2节中。第9.3节详细描述了接口状态机。
Down This is the initial interface state. In this state, the lower-level protocols have indicated that the interface is unusable. No protocol traffic at all will be sent or received on such a interface. In this state, interface parameters should be set to their initial values. All interface timers should be disabled, and there should be no adjacencies associated with the interface.
向下,这是初始接口状态。在此状态下,较低级别的协议表明接口不可用。在这样的接口上根本不会发送或接收协议通信量。在此状态下,接口参数应设置为其初始值。应禁用所有接口计时器,并且不应存在与接口相关联的邻接。
Loopback In this state, the router's interface to the network is
环回在这种状态下,路由器与网络的接口是
+----+ UnloopInd +--------+ |Down|<--------------|Loopback| +----+ +--------+ | |InterfaceUp +-------+ | +--------------+ |Waiting|<-+-------------->|Point-to-point| +-------+ +--------------+ | WaitTimer|BackupSeen | | | NeighborChange +------+ +-+<---------------- +-------+ |Backup|<----------|?|----------------->|DROther| +------+---------->+-+<-----+ +-------+ Neighbor | | Change | |Neighbor | |Change | +--+ +---->|DR| +--+
+----+ UnloopInd +--------+ |Down|<--------------|Loopback| +----+ +--------+ | |InterfaceUp +-------+ | +--------------+ |Waiting|<-+-------------->|Point-to-point| +-------+ +--------------+ | WaitTimer|BackupSeen | | | NeighborChange +------+ +-+<---------------- +-------+ |Backup|<----------|?|----------------->|DROther| +------+---------->+-+<-----+ +-------+ Neighbor | | Change | |Neighbor | |Change | +--+ +---->|DR| +--+
Figure 11: Interface State changes
图11:接口状态更改
In addition to the state transitions pictured, Event InterfaceDown always forces Down State, and Event LoopInd always forces Loopback State
除了图中的状态转换之外,Event InterfacedDown始终强制关闭状态,Event LoopInd始终强制返回状态
looped back. The interface may be looped back in hardware or software. The interface will be unavailable for regular data traffic. However, it may still be desirable to gain information on the quality of this interface, either through sending ICMP pings to the interface or through something like a bit error test. For this reason, IP packets may still be addressed to an interface in Loopback state. To
环回。接口可以在硬件或软件中循环。该接口将无法用于常规数据通信。然而,可能仍然希望通过向接口发送ICMP ping或通过类似于位错误测试的方式来获得有关该接口质量的信息。由于这个原因,IP分组仍然可以被寻址到处于环回状态的接口。到
facilitate this, such interfaces are advertised in router-LSAs as single host routes, whose destination is the IP interface address.[4]
为了便于实现这一点,此类接口在路由器LSA中作为单主机路由发布,其目的地是IP接口地址。[4]
Waiting In this state, the router is trying to determine the identity of the (Backup) Designated Router for the network. To do this, the router monitors the Hello Packets it receives. The router is not allowed to elect a Backup Designated Router nor a Designated Router until it transitions out of Waiting state. This prevents unnecessary changes of (Backup) Designated Router.
在此状态下等待,路由器将尝试确定网络的(备份)指定路由器的身份。为此,路由器监控它接收到的Hello数据包。不允许路由器选择备份指定路由器或指定路由器,直到它从等待状态转换出来。这样可以防止对(备份)指定路由器进行不必要的更改。
Point-to-point In this state, the interface is operational, and connects either to a physical point-to-point network or to a virtual link. Upon entering this state, the router attempts to form an adjacency with the neighboring router. Hello Packets are sent to the neighbor every HelloInterval seconds.
点到点在此状态下,接口可运行,并连接到物理点到点网络或虚拟链路。进入该状态后,路由器尝试与相邻路由器形成邻接。Hello数据包每隔几秒钟发送给邻居。
DR Other The interface is to a broadcast or NBMA network on which another router has been selected to be the Designated Router. In this state, the router itself has not been selected Backup Designated Router either. The router forms adjacencies to both the Designated Router and the Backup Designated Router (if they exist).
DR Other接口连接到广播或NBMA网络,在该网络上,已选择另一路由器作为指定路由器。在这种状态下,路由器本身也没有被选择备份指定的路由器。路由器与指定路由器和备份指定路由器(如果存在)形成邻接。
Backup In this state, the router itself is the Backup Designated Router on the attached network. It will be promoted to Designated Router when the present Designated Router fails. The router establishes adjacencies to all other routers attached to the network. The Backup Designated Router performs slightly different functions during the Flooding Procedure, as compared to the Designated Router (see Section 13.3). See Section 7.4 for more details on the functions performed by the Backup Designated Router.
备份在此状态下,路由器本身是连接网络上的备份指定路由器。当当前指定路由器出现故障时,它将被提升到指定路由器。路由器与连接到网络的所有其他路由器建立邻接关系。与指定路由器相比,备用指定路由器在泛洪过程中执行的功能略有不同(参见第13.3节)。有关备份指定路由器执行的功能的更多详细信息,请参见第7.4节。
DR In this state, this router itself is the Designated Router on the attached network. Adjacencies are established to all other routers attached to the network. The router must also
DR在此状态下,此路由器本身就是连接网络上的指定路由器。与连接到网络的所有其他路由器建立邻接。路由器还必须
originate a network-LSA for the network node. The network-LSA will contain links to all routers (including the Designated Router itself) attached to the network. See Section 7.3 for more details on the functions performed by the Designated Router.
为网络节点发起网络LSA。网络LSA将包含连接到网络的所有路由器(包括指定路由器本身)的链接。有关指定路由器执行的功能的更多详细信息,请参见第7.3节。
9.2. Events causing interface state changes
9.2. 导致接口状态更改的事件
State changes can be effected by a number of events. These events are pictured as the labelled arcs in Figure 11. The label definitions are listed below. For a detailed explanation of the effect of these events on OSPF protocol operation, consult Section 9.3.
状态更改可能受多个事件的影响。这些事件在图11中显示为带标签的弧。下面列出了标签定义。有关这些事件对OSPF协议运行影响的详细解释,请参阅第9.3节。
InterfaceUp Lower-level protocols have indicated that the network interface is operational. This enables the interface to transition out of Down state. On virtual links, the interface operational indication is actually a result of the shortest path calculation (see Section 16.7).
InterfaceUp低级协议表明网络接口可运行。这使接口能够转换出关闭状态。在虚拟链路上,接口操作指示实际上是最短路径计算的结果(见第16.7节)。
WaitTimer The Wait Timer has fired, indicating the end of the waiting period that is required before electing a (Backup) Designated Router.
WaitTimer等待计时器已启动,指示选择(备份)指定路由器之前所需的等待时间结束。
BackupSeen The router has detected the existence or non-existence of a Backup Designated Router for the network. This is done in one of two ways. First, an Hello Packet may be received from a neighbor claiming to be itself the Backup Designated Router. Alternatively, an Hello Packet may be received from a neighbor claiming to be itself the Designated Router, and indicating that there is no Backup Designated Router. In either case there must be bidirectional communication with the neighbor, i.e., the router must also appear in the neighbor's Hello Packet. This event signals an end to the Waiting state.
备份查看路由器已检测到网络中存在或不存在备份指定路由器。这可以通过以下两种方式之一实现。首先,可以从声称自己是备份指定路由器的邻居接收Hello分组。或者,可以从声称自己是指定路由器的邻居接收Hello分组,并指示不存在备份指定路由器。无论哪种情况,都必须与邻居进行双向通信,即路由器也必须出现在邻居的Hello数据包中。此事件表示等待状态结束。
NeighborChange There has been a change in the set of bidirectional neighbors associated with the interface. The (Backup) Designated Router needs to be recalculated. The following neighbor changes lead to the NeighborChange event. For an explanation of neighbor states, see Section 10.1.
NeighborChange与接口关联的一组双向邻居发生了变化。需要重新计算(备份)指定的路由器。以下邻居更改将导致NeighborChange事件。有关相邻状态的解释,请参见第10.1节。
o Bidirectional communication has been established to a neighbor. In other words, the state of the neighbor has transitioned to 2-Way or higher.
o 已与邻居建立双向通信。换句话说,邻居的状态已转换为双向或更高。
o There is no longer bidirectional communication with a neighbor. In other words, the state of the neighbor has transitioned to Init or lower.
o 不再与邻居进行双向通信。换句话说,邻居的状态已转换为Init或更低。
o One of the bidirectional neighbors is newly declaring itself as either Designated Router or Backup Designated Router. This is detected through examination of that neighbor's Hello Packets.
o 其中一个双向邻居最近将自己声明为指定路由器或备份指定路由器。这是通过检查邻居的Hello数据包检测到的。
o One of the bidirectional neighbors is no longer declaring itself as Designated Router, or is no longer declaring itself as Backup Designated Router. This is again detected through examination of that neighbor's Hello Packets.
o 其中一个双向邻居不再将自己声明为指定路由器,或者不再将自己声明为备份指定路由器。通过检查邻居的Hello数据包再次检测到这一点。
o The advertised Router Priority for a bidirectional neighbor has changed. This is again detected through examination of that neighbor's Hello Packets.
o 双向邻居的播发路由器优先级已更改。通过检查邻居的Hello数据包再次检测到这一点。
LoopInd An indication has been received that the interface is now looped back to itself. This indication can be received either from network management or from the lower level protocols.
LoopInd收到一个指示,表明接口现在已循环回自身。此指示可以从网络管理或较低级别的协议接收。
UnloopInd An indication has been received that the interface is no longer looped back. As with the LoopInd event, this
Unlopind接收到接口不再循环的指示。与LoopInd事件一样,这
indication can be received either from network management or from the lower level protocols.
可以从网络管理或较低级别协议接收指示。
InterfaceDown Lower-level protocols indicate that this interface is no longer functional. No matter what the current interface state is, the new interface state will be Down.
InterfacedDown低级协议表明此接口不再起作用。无论当前接口状态是什么,新接口状态都将关闭。
9.3. The Interface state machine
9.3. 接口状态机
A detailed description of the interface state changes follows. Each state change is invoked by an event (Section 9.2). This event may produce different effects, depending on the current state of the interface. For this reason, the state machine below is organized by current interface state and received event. Each entry in the state machine describes the resulting new interface state and the required set of additional actions.
接口状态更改的详细描述如下。每个状态更改都由一个事件调用(第9.2节)。此事件可能会产生不同的效果,具体取决于接口的当前状态。因此,下面的状态机是按当前接口状态和接收到的事件组织的。状态机中的每个条目描述生成的新接口状态和所需的附加操作集。
When an interface's state changes, it may be necessary to originate a new router-LSA. See Section 12.4 for more details.
当一个接口的状态改变时,可能需要发起一个新的路由器LSA。详见第12.4节。
Some of the required actions below involve generating events for the neighbor state machine. For example, when an interface becomes inoperative, all neighbor connections associated with the interface must be destroyed. For more information on the neighbor state machine, see Section 10.3.
下面的一些必需操作涉及为邻居状态机生成事件。例如,当某个接口不工作时,必须销毁与该接口关联的所有相邻连接。有关邻居状态机的更多信息,请参阅第10.3节。
State(s): Down
州:关闭
Event: InterfaceUp
事件:interfaceeup
New state: Depends upon action routine
新状态:取决于操作例程
Action: Start the interval Hello Timer, enabling the periodic sending of Hello packets out the interface. If the attached network is a physical point-to-point network, Point-to-MultiPoint network or virtual link, the interface state transitions to Point-to-Point. Else, if the router is not eligible to become Designated Router the interface state transitions to DR Other.
操作:启动interval Hello计时器,启用从接口定期发送Hello数据包。如果连接的网络是物理点对点网络、点对多点网络或虚拟链路,则接口状态将转换为点对点。否则,如果路由器没有资格成为指定路由器,接口状态将转换为DR Other。
Otherwise, the attached network is a broadcast or NBMA network and the router is eligible to become Designated Router. In this case, in an attempt to discover the attached network's Designated Router the interface state is set to Waiting and the single shot Wait Timer is started. Additionally, if the network is an NBMA network examine the configured list of neighbors for this interface and generate the neighbor event Start for each neighbor that is also eligible to become Designated Router.
否则,连接的网络是广播或NBMA网络,路由器有资格成为指定路由器。在这种情况下,在试图发现连接网络的指定路由器时,接口状态设置为等待,单次触发等待计时器启动。此外,如果网络是NBMA网络,请检查此接口的已配置邻居列表,并为每个也有资格成为指定路由器的邻居生成邻居事件启动。
State(s): Waiting
国家:等待
Event: BackupSeen
事件:备份
New state: Depends upon action routine.
新状态:取决于操作例程。
Action: Calculate the attached network's Backup Designated Router and Designated Router, as shown in Section 9.4. As a result of this calculation, the new state of the interface will be either DR Other, Backup or DR.
措施:计算连接网络的备份指定路由器和指定路由器,如第9.4节所示。此计算的结果是,接口的新状态将是DR Other、Backup或DR。
State(s): Waiting
国家:等待
Event: WaitTimer
事件:等待计时器
New state: Depends upon action routine.
新状态:取决于操作例程。
Action: Calculate the attached network's Backup Designated Router and Designated Router, as shown in Section 9.4. As a result of this calculation, the new state of the interface will be either DR Other, Backup or DR.
措施:计算连接网络的备份指定路由器和指定路由器,如第9.4节所示。此计算的结果是,接口的新状态将是DR Other、Backup或DR。
State(s): DR Other, Backup or DR
状态:灾难恢复其他、备份或灾难恢复
Event: NeighborChange
事件:邻居更改
New state: Depends upon action routine.
新状态:取决于操作例程。
Action: Recalculate the attached network's Backup Designated Router and Designated Router, as shown in Section 9.4. As a result of this calculation, the new state of the interface will be either DR Other, Backup or DR.
措施:重新计算连接网络的备份指定路由器和指定路由器,如第9.4节所示。此计算的结果是,接口的新状态将是DR Other、Backup或DR。
State(s): Any State
国家:任何国家
Event: InterfaceDown
事件:InterfaceDown
New state: Down
新州:关闭
Action: All interface variables are reset, and interface timers disabled. Also, all neighbor connections associated with the interface are destroyed. This is done by generating the event KillNbr on all associated neighbors (see Section 10.2).
措施:重置所有接口变量,并禁用接口计时器。此外,与接口关联的所有邻居连接都将被破坏。这是通过在所有相关邻居上生成事件KillNbr来实现的(参见第10.2节)。
State(s): Any State
国家:任何国家
Event: LoopInd
事件:LoopInd
New state: Loopback
新状态:环回
Action: Since this interface is no longer connected to the attached network the actions associated with the above InterfaceDown event are executed.
操作:由于此接口不再连接到连接的网络,因此将执行与上述InterfacedDown事件关联的操作。
State(s): Loopback
国家:环回
Event: UnloopInd
事件:卸载
New state: Down
新州:关闭
Action: No actions are necessary. For example, the interface variables have already been reset upon entering the Loopback state. Note that reception of
措施:无需采取任何措施。例如,接口变量已在进入环回状态时重置。请注意,接收
an InterfaceUp event is necessary before the interface again becomes fully functional.
在接口再次完全发挥功能之前,需要InterfaceUp事件。
9.4. Electing the Designated Router
9.4. 选择指定路由器
This section describes the algorithm used for calculating a network's Designated Router and Backup Designated Router. This algorithm is invoked by the Interface state machine. The initial time a router runs the election algorithm for a network, the network's Designated Router and Backup Designated Router are initialized to 0.0.0.0. This indicates the lack of both a Designated Router and a Backup Designated Router.
本节介绍用于计算网络指定路由器和备份指定路由器的算法。该算法由接口状态机调用。路由器运行网络选举算法的初始时间,网络的指定路由器和备份指定路由器初始化为0.0.0.0。这表明缺少指定路由器和备份指定路由器。
The Designated Router election algorithm proceeds as follows: Call the router doing the calculation Router X. The list of neighbors attached to the network and having established bidirectional communication with Router X is examined. This list is precisely the collection of Router X's neighbors (on this network) whose state is greater than or equal to 2-Way (see Section 10.1). Router X itself is also considered to be on the list. Discard all routers from the list that are ineligible to become Designated Router. (Routers having Router Priority of 0 are ineligible to become Designated Router.) The following steps are then executed, considering only those routers that remain on the list:
指定的路由器选择算法如下:调用执行计算的路由器X。检查连接到网络并与路由器X建立双向通信的邻居列表。此列表正是路由器X的邻居(在此网络上)的集合,其状态大于或等于双向(见第10.1节)。路由器X本身也被认为在名单上。从列表中丢弃所有没有资格成为指定路由器的路由器。(路由器优先级为0的路由器不符合成为指定路由器的资格。)然后执行以下步骤,仅考虑保留在列表上的路由器:
(1) Note the current values for the network's Designated Router and Backup Designated Router. This is used later for comparison purposes.
(1) 记下网络指定路由器和备份指定路由器的当前值。这将在稍后用于比较目的。
(2) Calculate the new Backup Designated Router for the network as follows. Only those routers on the list that have not declared themselves to be Designated Router are eligible to become Backup Designated Router. If one or more of these routers have declared themselves Backup Designated Router (i.e., they are currently listing themselves as Backup Designated Router, but not as Designated Router, in their Hello Packets) the one having highest Router Priority is declared to be Backup Designated Router. In case of a tie, the one having the highest Router ID is chosen. If no routers have declared themselves Backup Designated Router,
(2) 计算网络的新备份指定路由器,如下所示。只有列表上那些尚未声明自己为指定路由器的路由器才有资格成为备份指定路由器。如果这些路由器中的一个或多个已声明自己为备份指定路由器(即,它们当前在其Hello数据包中将自己列为备份指定路由器,但未列为指定路由器),则具有最高路由器优先级的路由器将被声明为备份指定路由器。如果是平局,则选择具有最高路由器ID的一个。如果没有路由器声明自己是备份指定路由器,
choose the router having highest Router Priority, (again excluding those routers who have declared themselves Designated Router), and again use the Router ID to break ties.
选择具有最高路由器优先级的路由器(同样不包括那些声明自己为指定路由器的路由器),然后再次使用路由器ID断开连接。
(3) Calculate the new Designated Router for the network as follows. If one or more of the routers have declared themselves Designated Router (i.e., they are currently listing themselves as Designated Router in their Hello Packets) the one having highest Router Priority is declared to be Designated Router. In case of a tie, the one having the highest Router ID is chosen. If no routers have declared themselves Designated Router, assign the Designated Router to be the same as the newly elected Backup Designated Router.
(3) 按如下方式计算网络的新指定路由器。如果一个或多个路由器已声明自己为指定路由器(即,它们当前在其Hello数据包中将自己列为指定路由器),则具有最高路由器优先级的路由器被声明为指定路由器。如果是平局,则选择具有最高路由器ID的一个。如果没有路由器声明自己为指定路由器,请将指定路由器指定为与新选择的备份指定路由器相同。
(4) If Router X is now newly the Designated Router or newly the Backup Designated Router, or is now no longer the Designated Router or no longer the Backup Designated Router, repeat steps 2 and 3, and then proceed to step 5. For example, if Router X is now the Designated Router, when step 2 is repeated X will no longer be eligible for Backup Designated Router election. Among other things, this will ensure that no router will declare itself both Backup Designated Router and Designated Router.[5]
(4) 如果路由器X现在是新指定的路由器或新指定的备份路由器,或者现在不再是指定的路由器或不再是备份指定的路由器,请重复步骤2和3,然后继续步骤5。例如,如果路由器X现在是指定路由器,当重复步骤2时,X将不再有资格选择备份指定路由器。除其他事项外,这将确保没有路由器会同时声明备份指定路由器和指定路由器。[5]
(5) As a result of these calculations, the router itself may now be Designated Router or Backup Designated Router. See Sections 7.3 and 7.4 for the additional duties this would entail. The router's interface state should be set accordingly. If the router itself is now Designated Router, the new interface state is DR. If the router itself is now Backup Designated Router, the new interface state is Backup. Otherwise, the new interface state is DR Other.
(5) 根据这些计算结果,路由器本身现在可能是指定路由器或备份指定路由器。参见第7.3节和第7.4节,了解由此产生的额外职责。路由器的接口状态应相应设置。如果路由器本身现在是指定路由器,则新接口状态为DR。如果路由器本身现在是备份指定路由器,则新接口状态为备份。否则,新接口状态为DR Other。
(6) If the attached network is an NBMA network, and the router itself has just become either Designated Router or Backup Designated Router, it must start sending Hello Packets to those neighbors that are not eligible to become Designated Router (see Section 9.5.1). This is done by invoking the neighbor event Start for each neighbor having a Router Priority of 0.
(6) 如果连接的网络是NBMA网络,且路由器本身刚刚成为指定路由器或备份指定路由器,则必须开始向不符合成为指定路由器条件的邻居发送Hello数据包(见第9.5.1节)。这是通过为路由器优先级为0的每个邻居调用邻居事件开始来完成的。
(7) If the above calculations have caused the identity of either the Designated Router or Backup Designated Router to change, the set of adjacencies associated with this interface will need to be modified. Some adjacencies may need to be formed, and others may need to be broken. To accomplish this, invoke the event AdjOK? on all neighbors whose state is at least 2-Way. This will cause their eligibility for adjacency to be reexamined (see Sections 10.3 and 10.4).
(7) 如果上述计算导致指定路由器或备份指定路由器的身份发生更改,则需要修改与此接口相关联的邻接集。可能需要形成一些邻接,而其他邻接可能需要断开。要完成此操作,请调用事件AdjOK?在状态至少为双向的所有邻居上。这将导致重新审查其邻接资格(见第10.3节和第10.4节)。
The reason behind the election algorithm's complexity is the desire for an orderly transition from Backup Designated Router to Designated Router, when the current Designated Router fails. This orderly transition is ensured through the introduction of hysteresis: no new Backup Designated Router can be chosen until the old Backup accepts its new Designated Router responsibilities.
选举算法复杂性背后的原因是,当当前指定的路由器出现故障时,需要从备份指定的路由器有序地过渡到指定的路由器。这种有序的过渡通过引入滞后来确保:在旧备份接受其新的指定路由器职责之前,不能选择新的备份指定路由器。
The above procedure may elect the same router to be both Designated Router and Backup Designated Router, although that router will never be the calculating router (Router X) itself. The elected Designated Router may not be the router having the highest Router Priority, nor will the Backup Designated Router necessarily have the second highest Router Priority. If Router X is not itself eligible to become Designated Router, it is possible that neither a Backup Designated Router nor a Designated Router will be selected in the above procedure. Note also that if Router X is the only attached router that is eligible to become Designated Router, it will select itself as Designated Router and there will be no Backup Designated Router for the network.
上述过程可以选择同一路由器作为指定路由器和备份指定路由器,尽管该路由器本身永远不会是计算路由器(路由器X)。选定的指定路由器可能不是具有最高路由器优先级的路由器,备份指定路由器也不一定具有第二高路由器优先级。如果路由器X本身没有资格成为指定路由器,则在上述过程中可能既不会选择备份指定路由器,也不会选择指定路由器。还请注意,如果路由器X是唯一有资格成为指定路由器的连接路由器,它将选择自己作为指定路由器,并且网络将没有备份指定路由器。
9.5. Sending Hello packets
9.5. 发送问候包
Hello packets are sent out each functioning router interface. They are used to discover and maintain neighbor relationships.[6] On broadcast and NBMA networks, Hello Packets are also used to elect the Designated Router and Backup Designated Router.
Hello数据包被发送到每个正常工作的路由器接口。它们用于发现和维护邻居关系。[6]在广播和NBMA网络上,Hello数据包还用于选择指定路由器和备份指定路由器。
The format of an Hello packet is detailed in Section A.3.2. The Hello Packet contains the router's Router Priority (used in choosing the Designated Router), and the interval between Hello Packets sent out the interface (HelloInterval). The Hello Packet also indicates how often a neighbor must be heard from to remain active (RouterDeadInterval). Both HelloInterval and RouterDeadInterval must be the same for all routers attached to a common network. The Hello packet also contains the IP address mask of the attached network (Network Mask). On unnumbered point-to-point networks and on virtual links this field should be set to 0.0.0.0.
Hello数据包的格式详见第A.3.2节。Hello数据包包含路由器的路由器优先级(用于选择指定的路由器),以及发送到接口的Hello数据包之间的间隔(HelloInterval)。Hello数据包还指示必须多久听到邻居的声音才能保持活动状态(RouterDeadInterval)。对于连接到公共网络的所有路由器,HelloInterval和RouterDeadInterval必须相同。Hello数据包还包含连接网络的IP地址掩码(网络掩码)。在未编号的点到点网络和虚拟链路上,此字段应设置为0.0.0.0。
The Hello packet's Options field describes the router's optional OSPF capabilities. One optional capability is defined in this specification (see Sections 4.5 and A.2). The E-bit of the Options field should be set if and only if the attached area is capable of processing AS-external-LSAs (i.e., it is not a stub area). If the E-bit is set incorrectly the neighboring routers will refuse to accept the Hello Packet (see Section 10.5). Unrecognized bits in the Hello Packet's Options field should be set to zero.
Hello数据包的选项字段描述路由器的可选OSPF功能。本规范中定义了一种可选功能(见第4.5节和A.2节)。当且仅当连接区域能够作为外部LSA进行处理(即,它不是存根区域)时,才应设置选项字段的E位。如果E位设置不正确,相邻路由器将拒绝接受Hello数据包(见第10.5节)。Hello数据包选项字段中无法识别的位应设置为零。
In order to ensure two-way communication between adjacent routers, the Hello packet contains the list of all routers on the network from which Hello Packets have been seen recently. The Hello packet also contains the router's current choice for Designated Router and Backup Designated Router. A value of 0.0.0.0 in these fields means that one has not yet been selected.
为了确保相邻路由器之间的双向通信,Hello数据包包含最近从中看到Hello数据包的网络上所有路由器的列表。Hello数据包还包含路由器对指定路由器和备份指定路由器的当前选择。这些字段中的值为0.0.0.0表示尚未选择一个字段。
On broadcast networks and physical point-to-point networks, Hello packets are sent every HelloInterval seconds to the IP multicast address AllSPFRouters. On virtual links, Hello packets are sent as unicasts (addressed directly to the other end of the virtual link) every HelloInterval seconds. On Point-to-MultiPoint networks, separate Hello packets are sent to each attached neighbor every HelloInterval seconds. Sending of Hello packets on NBMA networks is covered in the next section.
在广播网络和物理点对点网络上,Hello数据包每Hello每隔几秒钟发送一次到IP多播地址AllsFrouters。在虚拟链路上,Hello数据包每HelloInterval秒作为单播发送(直接发送到虚拟链路的另一端)。在点对多点网络上,每隔几秒钟向每个连接的邻居发送单独的Hello数据包。下一节将介绍在NBMA网络上发送Hello数据包。
9.5.1. Sending Hello packets on NBMA networks
9.5.1. 在NBMA网络上发送Hello数据包
Static configuration information may be necessary in order for the Hello Protocol to function on non-broadcast networks (see Sections C.5 and C.6). On NBMA networks, every attached router which is eligible to become Designated Router becomes aware of all of its neighbors on the network (either through configuration or by some unspecified mechanism). Each neighbor is labelled with the neighbor's Designated Router eligibility.
为了使Hello协议在非广播网络上运行,可能需要静态配置信息(参见第C.5节和第C.6节)。在NBMA网络上,每个有资格成为指定路由器的连接路由器都会意识到其在网络上的所有邻居(通过配置或某些未指定的机制)。每个邻居都标有其指定的路由器资格。
The interface state must be at least Waiting for any Hello Packets to be sent out the NBMA interface. Hello Packets are then sent directly (as unicasts) to some subset of a router's neighbors. Sometimes an Hello Packet is sent periodically on a timer; at other times it is sent as a response to a received Hello Packet. A router's hello-sending behavior varies depending on whether the router itself is eligible to become Designated Router.
接口状态必须至少等待任何Hello数据包从NBMA接口发送出去。然后,Hello数据包直接(作为单播)发送到路由器邻居的某个子集。有时,一个Hello数据包在计时器上周期性地发送;在其他时间,它作为对收到的Hello数据包的响应发送。路由器的hello发送行为因路由器本身是否有资格成为指定路由器而有所不同。
If the router is eligible to become Designated Router, it must periodically send Hello Packets to all neighbors that are also eligible. In addition, if the router is itself the Designated Router or Backup Designated Router, it must also send periodic Hello Packets to all other neighbors. This means that any two eligible routers are always exchanging Hello Packets, which is necessary for the correct operation of the Designated Router election algorithm. To minimize the number of Hello Packets sent, the number of eligible routers on an NBMA network should be kept small.
如果路由器有资格成为指定路由器,它必须定期向所有也有资格的邻居发送Hello数据包。此外,如果路由器本身是指定路由器或备份指定路由器,它还必须定期向所有其他邻居发送Hello数据包。这意味着任何两个合格的路由器总是交换Hello数据包,这对于指定的路由器选择算法的正确操作是必要的。为了尽量减少发送的Hello数据包的数量,NBMA网络上合格路由器的数量应该保持较小。
If the router is not eligible to become Designated Router, it must periodically send Hello Packets to both the Designated Router and the Backup Designated Router (if they exist). It must also send an Hello Packet in reply to an Hello Packet received from any eligible neighbor (other than the current Designated Router and Backup Designated Router). This is needed to establish an initial bidirectional relationship with any potential Designated Router.
如果路由器没有资格成为指定路由器,它必须定期向指定路由器和备份指定路由器(如果存在)发送Hello数据包。它还必须发送一个Hello数据包,作为对从任何合格邻居(当前指定路由器和备份指定路由器除外)收到的Hello数据包的回复。这需要与任何潜在的指定路由器建立初始双向关系。
When sending Hello packets periodically to any neighbor, the interval between Hello Packets is determined by the
当定期向任何邻居发送Hello数据包时,Hello数据包之间的间隔由
neighbor's state. If the neighbor is in state Down, Hello Packets are sent every PollInterval seconds. Otherwise, Hello Packets are sent every HelloInterval seconds.
邻居的国家。如果邻居处于关闭状态,则每隔几秒钟发送一次Hello数据包。否则,Hello数据包每HelloInterval秒发送一次。
An OSPF router converses with its neighboring routers. Each separate conversation is described by a "neighbor data structure". Each conversation is bound to a particular OSPF router interface, and is identified either by the neighboring router's OSPF Router ID or by its Neighbor IP address (see below). Thus if the OSPF router and another router have multiple attached networks in common, multiple conversations ensue, each described by a unique neighbor data structure. Each separate conversation is loosely referred to in the text as being a separate "neighbor".
OSPF路由器与其相邻的路由器进行对话。每个单独的对话由“邻居数据结构”描述。每个会话都绑定到一个特定的OSPF路由器接口,并由相邻路由器的OSPF路由器ID或其相邻IP地址标识(见下文)。因此,如果OSPF路由器和另一路由器具有多个共同连接的网络,则会发生多个会话,每个会话由唯一的邻居数据结构描述。每一个单独的对话在文本中被松散地称为一个单独的“邻居”。
The neighbor data structure contains all information pertinent to the forming or formed adjacency between the two neighbors. (However, remember that not all neighbors become adjacent.) An adjacency can be viewed as a highly developed conversation between two routers.
邻居数据结构包含与两个邻居之间形成或形成的邻接相关的所有信息。(但是,请记住,并非所有邻居都是相邻的。)邻接可以被视为两个路由器之间高度发达的对话。
State The functional level of the neighbor conversation. This is described in more detail in Section 10.1.
说明邻居对话的功能级别。第10.1节对此进行了更详细的描述。
Inactivity Timer A single shot timer whose firing indicates that no Hello Packet has been seen from this neighbor recently. The length of the timer is RouterDeadInterval seconds.
不活动计时器一个单次触发计时器,其触发表示最近没有看到来自该邻居的Hello数据包。计时器的长度为RouterDeadInterval秒。
Master/Slave When the two neighbors are exchanging databases, they form a master/slave relationship. The master sends the first Database Description Packet, and is the only part that is allowed to retransmit. The slave can only respond to the master's Database Description Packets. The master/slave relationship is negotiated in state ExStart.
主/从当两个邻居交换数据库时,它们形成主/从关系。主机发送第一个数据库描述数据包,并且是唯一允许重新传输的部分。从属服务器只能响应主服务器的数据库描述数据包。主/从关系在ExStart状态下协商。
DD Sequence Number The DD Sequence number of the Database Description packet that is currently being sent to the neighbor.
DD序列号当前发送到邻居的数据库描述数据包的DD序列号。
Last received Database Description packet The initialize(I), more (M) and master(MS) bits, Options field, and DD sequence number contained in the last Database Description packet received from the neighbor. Used to determine whether the next Database Description packet received from the neighbor is a duplicate.
上次接收的数据库描述数据包从邻居接收的上次数据库描述数据包中包含的初始化(I)、更多(M)和主(MS)位、选项字段和DD序列号。用于确定从邻居接收的下一个数据库描述数据包是否重复。
Neighbor ID The OSPF Router ID of the neighboring router. The Neighbor ID is learned when Hello packets are received from the neighbor, or is configured if this is a virtual adjacency (see Section C.4).
邻居ID相邻路由器的OSPF路由器ID。当从邻居接收到Hello数据包时,邻居ID被学习,或者如果这是一个虚拟邻接,则对其进行配置(参见第C.4节)。
Neighbor Priority The Router Priority of the neighboring router. Contained in the neighbor's Hello packets, this item is used when selecting the Designated Router for the attached network.
邻居优先级相邻路由器的路由器优先级。包含在邻居的Hello数据包中,此项用于为连接的网络选择指定的路由器。
Neighbor IP address The IP address of the neighboring router's interface to the attached network. Used as the Destination IP address when protocol packets are sent as unicasts along this adjacency. Also used in router-LSAs as the Link ID for the attached network if the neighboring router is selected to be Designated Router (see Section 12.4.1). The Neighbor IP address is learned when Hello packets are received from the neighbor. For virtual links, the Neighbor IP address is learned during the routing table build process (see Section 15).
邻居IP地址相邻路由器与连接网络的接口的IP地址。当协议数据包作为单播沿着该邻接发送时,用作目标IP地址。如果选择相邻路由器作为指定路由器,则也在路由器LSA中用作连接网络的链路ID(参见第12.4.1节)。当从邻居接收到Hello数据包时,邻居IP地址被学习。对于虚拟链路,在路由表构建过程中学习邻居IP地址(参见第15节)。
Neighbor Options The optional OSPF capabilities supported by the neighbor. Learned during the Database Exchange process (see Section 10.6). The neighbor's optional OSPF capabilities are also listed in its Hello packets. This enables received Hello Packets to be rejected (i.e., neighbor relationships will not even start to form) if there is a mismatch in certain crucial OSPF capabilities (see Section 10.5). The optional OSPF capabilities are documented in Section 4.5.
邻居选项邻居支持的可选OSPF功能。在数据库交换过程中学习(参见第10.6节)。邻居的可选OSPF功能也列在其Hello数据包中。如果某些关键的OSPF功能不匹配,则可以拒绝接收到的Hello数据包(即,邻居关系甚至不会开始形成)(参见第10.5节)。可选OSPF功能在第4.5节中有记录。
Neighbor's Designated Router The neighbor's idea of the Designated Router. If this is the neighbor itself, this is important in the local calculation of the Designated Router. Defined only on broadcast and NBMA networks.
邻居的指定路由器邻居对指定路由器的想法。如果这是邻居本身,这在指定路由器的本地计算中很重要。仅在广播和NBMA网络上定义。
Neighbor's Backup Designated Router The neighbor's idea of the Backup Designated Router. If this is the neighbor itself, this is important in the local calculation of the Backup Designated Router. Defined only on broadcast and NBMA networks.
邻居的备份指定路由器邻居对备份指定路由器的想法。如果这是邻居本身,这在备份指定路由器的本地计算中很重要。仅在广播和NBMA网络上定义。
The next set of variables are lists of LSAs. These lists describe subsets of the area link-state database. This memo defines five distinct types of LSAs, all of which may be present in an area link-state database: router-LSAs, network-LSAs, and Type 3 and 4 summary-LSAs (all stored in the area data structure), and AS-external-LSAs (stored in the global data structure).
下一组变量是LSA列表。这些列表描述了区域链接状态数据库的子集。此备忘录定义了五种不同类型的LSA,它们都可能存在于区域链路状态数据库中:路由器LSA、网络LSA、类型3和4摘要LSA(均存储在区域数据结构中)以及外部LSA(存储在全局数据结构中)。
Link state retransmission list The list of LSAs that have been flooded but not acknowledged on this adjacency. These will be retransmitted at intervals until they are acknowledged, or until the adjacency is destroyed.
链路状态重传列表已被淹没但未在此邻接上确认的LSA列表。这些将每隔一段时间重新传输,直到它们被确认,或者直到邻接被破坏。
Database summary list The complete list of LSAs that make up the area link-state database, at the moment the neighbor goes into Database Exchange state. This list is sent to the neighbor in Database Description packets.
数据库摘要列出组成区域链接状态数据库的LSA的完整列表,此时邻居进入数据库交换状态。此列表在数据库描述数据包中发送给邻居。
Link state request list The list of LSAs that need to be received from this neighbor in order to synchronize the two neighbors' link-state databases. This list is created as Database Description packets are received, and is then sent to the neighbor in Link State Request packets. The list is depleted as appropriate Link State Update packets are received.
链路状态请求列表需要从该邻居接收的LSA列表,以便同步两个邻居的链路状态数据库。此列表是在接收数据库描述数据包时创建的,然后以链路状态请求数据包的形式发送给邻居。当接收到适当的链路状态更新包时,该列表被耗尽。
10.1. Neighbor states
10.1. 邻国
The state of a neighbor (really, the state of a conversation being held with a neighboring router) is documented in the following sections. The states are listed in order of progressing functionality. For example, the inoperative state is listed first, followed by a list of intermediate states before the final, fully functional state is achieved. The specification makes use of this ordering by sometimes making references such as "those neighbors/adjacencies in state greater than X". Figures 12 and 13 show the graph of neighbor state changes. The arcs of the graphs are labelled with the event causing the state change. The neighbor events are documented in Section 10.2.
邻居的状态(实际上,与邻居路由器进行对话的状态)记录在以下部分中。这些状态按功能的进展顺序列出。例如,首先列出不工作状态,然后列出中间状态列表,然后才能达到最终的完全功能状态。该规范有时通过引用“状态大于X的那些邻居/邻接”来利用这种排序。图12和13显示了相邻状态的变化图。图中的弧标有导致状态更改的事件。相邻事件记录在第10.2节中。
The graph in Figure 12 shows the state changes effected by the Hello Protocol. The Hello Protocol is responsible for neighbor acquisition and maintenance, and for ensuring two way communication between neighbors.
图12中的图表显示了受Hello协议影响的状态更改。Hello协议负责邻居的获取和维护,并确保邻居之间的双向通信。
The graph in Figure 13 shows the forming of an adjacency. Not every two neighboring routers become adjacent (see Section 10.4). The adjacency starts to form when the neighbor is in state ExStart. After the two routers discover their master/slave status, the state transitions to Exchange. At this point the neighbor starts to be used in the flooding procedure, and the two neighboring routers begin synchronizing their databases. When this synchronization is finished, the neighbor is in state Full and we say that the two routers are fully adjacent. At this point the adjacency is listed in LSAs.
图13中的图表显示了邻接的形成。并非每两个相邻的路由器都是相邻的(参见第10.4节)。当邻居处于ExStart状态时,邻接开始形成。两个路由器发现其主/从状态后,状态转换为Exchange。此时,邻居开始在泛洪过程中使用,两个相邻的路由器开始同步它们的数据库。当同步完成时,邻居处于完全状态,我们说这两个路由器完全相邻。此时,邻接在LSA中列出。
For a more detailed description of neighbor state changes, together with the additional actions involved in each change, see Section 10.3.
有关相邻状态更改以及每个更改中涉及的附加操作的更详细描述,请参见第10.3节。
Down This is the initial state of a neighbor conversation. It indicates that there has been no recent information received from the neighbor. On NBMA networks, Hello packets may still be sent to "Down" neighbors, although at a reduced frequency (see Section 9.5.1).
这是邻居对话的初始状态。表示最近没有收到邻居的信息。在NBMA网络上,Hello数据包仍可发送到“下行”邻居,尽管频率降低(见第9.5.1节)。
+----+ |Down| +----+ |\ | \Start | \ +-------+ Hello | +---->|Attempt| Received | +-------+ | | +----+<-+ |HelloReceived |Init|<---------------+ +----+<--------+ | | |2-Way |1-Way |Received |Received | | +-------+ | +-----+ |ExStart|<--------+------->|2-Way| +-------+ +-----+
+----+ |Down| +----+ |\ | \Start | \ +-------+ Hello | +---->|Attempt| Received | +-------+ | | +----+<-+ |HelloReceived |Init|<---------------+ +----+<--------+ | | |2-Way |1-Way |Received |Received | | +-------+ | +-----+ |ExStart|<--------+------->|2-Way| +-------+ +-----+
Figure 12: Neighbor state changes (Hello Protocol)
图12:邻居状态更改(Hello协议)
In addition to the state transitions pictured, Event KillNbr always forces Down State, Event InactivityTimer always forces Down State, Event LLDown always forces Down State
除了图中的状态转换之外,Event KillNbr始终强制关闭状态,Event InactivityTimer始终强制关闭状态,Event LLDown始终强制关闭状态
+-------+ |ExStart| +-------+ | NegotiationDone| +->+--------+ |Exchange| +--+--------+ | Exchange| Done | +----+ | +-------+ |Full|<---------+----->|Loading| +----+<-+ +-------+ | LoadingDone | +------------------+
+-------+ |ExStart| +-------+ | NegotiationDone| +->+--------+ |Exchange| +--+--------+ | Exchange| Done | +----+ | +-------+ |Full|<---------+----->|Loading| +----+<-+ +-------+ | LoadingDone | +------------------+
Figure 13: Neighbor state changes (Database Exchange)
图13:邻居状态更改(数据库交换)
In addition to the state transitions pictured, Event SeqNumberMismatch forces ExStart state, Event BadLSReq forces ExStart state, Event 1-Way forces Init state, Event KillNbr always forces Down State, Event InactivityTimer always forces Down State, Event LLDown always forces Down State, Event AdjOK? leads to adjacency forming/breaking
除了图中的状态转换外,事件SeqNumberMismatch强制ExStart状态、事件BadLSReq强制ExStart状态、事件单向强制Init状态、事件KillNbr始终强制Down状态、事件InactivityTimer始终强制Down状态、事件LLDown始终强制Down状态、事件AdjOK?导致邻接形成/断裂
Attempt This state is only valid for neighbors attached to NBMA networks. It indicates that no recent information has been received from the neighbor, but that a more concerted effort should be made to contact the neighbor. This is done by sending the neighbor Hello packets at intervals of HelloInterval (see Section 9.5.1).
尝试此状态仅对连接到NBMA网络的邻居有效。这表明没有从邻居那里收到任何最新信息,但应该更加协调一致地与邻居联系。这是通过每隔HelloInterval发送邻居Hello数据包来实现的(见第9.5.1节)。
Init In this state, an Hello packet has recently been seen from the neighbor. However, bidirectional communication has not yet been established with the neighbor (i.e., the router itself did not appear in the neighbor's Hello packet). All
Init在这种状态下,最近从邻居处看到了一个Hello数据包。但是,尚未与邻居建立双向通信(即,路由器本身未出现在邻居的Hello数据包中)。全部的
neighbors in this state (or higher) are listed in the Hello packets sent from the associated interface.
处于该状态(或更高状态)的邻居列在从关联接口发送的Hello数据包中。
2-Way In this state, communication between the two routers is bidirectional. This has been assured by the operation of the Hello Protocol. This is the most advanced state short of beginning adjacency establishment. The (Backup) Designated Router is selected from the set of neighbors in state 2-Way or greater.
双向在此状态下,两个路由器之间的通信是双向的。Hello协议的运行保证了这一点。这是最先进的国家短的开始邻接建立。从状态为2路或更高的邻居集中选择(备份)指定的路由器。
ExStart This is the first step in creating an adjacency between the two neighboring routers. The goal of this step is to decide which router is the master, and to decide upon the initial DD sequence number. Neighbor conversations in this state or greater are called adjacencies.
ExStart这是在两个相邻路由器之间创建邻接的第一步。这一步的目标是确定哪个路由器是主路由器,并确定初始DD序列号。处于这种或更高状态的邻居对话称为邻接。
Exchange In this state the router is describing its entire link state database by sending Database Description packets to the neighbor. Each Database Description Packet has a DD sequence number, and is explicitly acknowledged. Only one Database Description Packet is allowed outstanding at any one time. In this state, Link State Request Packets may also be sent asking for the neighbor's more recent LSAs. All adjacencies in Exchange state or greater are used by the flooding procedure. In fact, these adjacencies are fully capable of transmitting and receiving all types of OSPF routing protocol packets.
Exchange在此状态下,路由器通过向邻居发送数据库描述数据包来描述其整个链路状态数据库。每个数据库描述数据包都有一个DD序列号,并被明确确认。一次只允许有一个数据库描述数据包。在这种状态下,还可以发送链路状态请求包,请求邻居最近的lsa。泛洪过程使用交换状态或更高状态的所有邻接。事实上,这些邻接完全能够发送和接收所有类型的OSPF路由协议数据包。
Loading In this state, Link State Request packets are sent to the neighbor asking for the more recent LSAs that have been discovered (but not yet received) in the Exchange state.
在这种状态下,链路状态请求数据包被发送到邻居,请求在交换状态下发现(但尚未收到)的最近的LSA。
Full In this state, the neighboring routers are fully adjacent. These adjacencies will now appear in router-LSAs and network-LSAs.
完全在此状态下,相邻路由器完全相邻。这些邻接现在将出现在路由器LSA和网络LSA中。
10.2. Events causing neighbor state changes
10.2. 导致邻居状态更改的事件
State changes can be effected by a number of events. These events are shown in the labels of the arcs in Figures 12 and 13. The label definitions are as follows:
状态更改可能受多个事件的影响。这些事件显示在图12和13中的弧标签中。标签定义如下:
HelloReceived An Hello packet has been received from the neighbor.
他收到邻居发送的Hello数据包。
Start This is an indication that Hello Packets should now be sent to the neighbor at intervals of HelloInterval seconds. This event is generated only for neighbors associated with NBMA networks.
开始这表示Hello数据包现在应该每隔HelloInterval秒发送给邻居。此事件仅针对与NBMA网络关联的邻居生成。
2-WayReceived Bidirectional communication has been realized between the two neighboring routers. This is indicated by the router seeing itself in the neighbor's Hello packet.
在两个相邻路由器之间实现了双向接收通信。路由器在邻居的Hello数据包中看到自己,这表明了这一点。
NegotiationDone The Master/Slave relationship has been negotiated, and DD sequence numbers have been exchanged. This signals the start of the sending/receiving of Database Description packets. For more information on the generation of this event, consult Section 10.8.
协商完成主/从关系已协商,DD序列号已交换。这表示开始发送/接收数据库描述数据包。有关该事件产生的更多信息,请参阅第10.8节。
ExchangeDone Both routers have successfully transmitted a full sequence of Database Description packets. Each router now knows what parts of its link state database are out of date. For more information on the generation of this event, consult Section 10.8.
ExchangeOne两个路由器都成功地传输了完整的数据库描述数据包序列。每个路由器现在都知道其链路状态数据库的哪些部分已过时。有关该事件产生的更多信息,请参阅第10.8节。
BadLSReq A Link State Request has been received for an LSA not contained in the database. This indicates an error in the Database Exchange process.
BadLSReq已收到数据库中未包含的LSA的链路状态请求。这表示数据库交换过程中出现错误。
Loading Done Link State Updates have been received for all out-of-date
已收到所有过期的加载完成链接状态更新
portions of the database. This is indicated by the Link state request list becoming empty after the Database Exchange process has completed.
数据库的一部分。数据库交换过程完成后,链接状态请求列表变为空表示这一点。
AdjOK? A decision must be made as to whether an adjacency should be established/maintained with the neighbor. This event will start some adjacencies forming, and destroy others.
好吗?必须决定是否应与邻居建立/保持邻接关系。此事件将开始形成一些邻接,并破坏其他邻接。
The following events cause well developed neighbors to revert to lesser states. Unlike the above events, these events may occur when the neighbor conversation is in any of a number of states.
以下事件导致发达的邻国恢复到较不发达的国家。与上述事件不同,这些事件可能在邻居会话处于多种状态中的任何一种时发生。
SeqNumberMismatch A Database Description packet has been received that either a) has an unexpected DD sequence number, b) unexpectedly has the Init bit set or c) has an Options field differing from the last Options field received in a Database Description packet. Any of these conditions indicate that some error has occurred during adjacency establishment.
SeqNumberMitch已接收到一个数据库描述数据包,其中A)具有意外的DD序列号,b)意外设置了初始位,或c)具有与数据库描述数据包中接收到的最后一个选项字段不同的选项字段。这些条件中的任何一个都表明在邻接建立过程中发生了一些错误。
1-Way An Hello packet has been received from the neighbor, in which the router is not mentioned. This indicates that communication with the neighbor is not bidirectional.
已从邻居接收到单向Hello数据包,其中未提及路由器。这表明与邻居的通信不是双向的。
KillNbr This is an indication that all communication with the neighbor is now impossible, forcing the neighbor to revert to Down state.
KillNbr这表示现在无法与邻居进行所有通信,迫使邻居恢复到关闭状态。
InactivityTimer The inactivity Timer has fired. This means that no Hello packets have been seen recently from the neighbor. The neighbor reverts to Down state.
InactivityTimer非活动计时器已启动。这意味着最近没有看到邻居发送的Hello数据包。邻居恢复到关闭状态。
LLDown This is an indication from the lower level protocols that the neighbor is now unreachable. For example, on an X.25 network this could be indicated by an X.25 clear indication
LLDown这是来自较低级别协议的指示,表明邻居现在无法访问。例如,在X.25网络上,这可以通过X.25清晰指示来指示
with appropriate cause and diagnostic fields. This event forces the neighbor into Down state.
具有适当的原因和诊断字段。此事件强制邻居进入关闭状态。
10.3. The Neighbor state machine
10.3. 邻居状态机
A detailed description of the neighbor state changes follows. Each state change is invoked by an event (Section 10.2). This event may produce different effects, depending on the current state of the neighbor. For this reason, the state machine below is organized by current neighbor state and received event. Each entry in the state machine describes the resulting new neighbor state and the required set of additional actions.
下面详细描述了相邻状态的更改。每个状态更改都由一个事件调用(第10.2节)。此事件可能会产生不同的效果,具体取决于邻居的当前状态。因此,下面的状态机是由当前邻居状态和接收到的事件组织的。状态机中的每个条目描述生成的新邻居状态和所需的附加操作集。
When a neighbor's state changes, it may be necessary to rerun the Designated Router election algorithm. This is determined by whether the interface NeighborChange event is generated (see Section 9.2). Also, if the Interface is in DR state (the router is itself Designated Router), changes in neighbor state may cause a new network-LSA to be originated (see Section 12.4).
当邻居的状态改变时,可能需要重新运行指定的路由器选择算法。这取决于是否生成接口邻居更改事件(见第9.2节)。此外,如果接口处于DR状态(路由器本身被指定为路由器),邻居状态的变化可能会导致新的网络LSA产生(见第12.4节)。
When the neighbor state machine needs to invoke the interface state machine, it should be done as a scheduled task (see Section 4.4). This simplifies things, by ensuring that neither state machine will be executed recursively.
当邻居状态机需要调用接口状态机时,应将其作为计划任务进行(参见第4.4节)。通过确保两个状态机都不会递归执行,这简化了事情。
State(s): Down
州:关闭
Event: Start
事件:开始
New state: Attempt
新国家:尝试
Action: Send an Hello Packet to the neighbor (this neighbor is always associated with an NBMA network) and start the Inactivity Timer for the neighbor. The timer's later firing would indicate that communication with the neighbor was not attained.
操作:向邻居发送Hello数据包(此邻居始终与NBMA网络关联),并启动邻居的非活动计时器。计时器稍后的触发将表明无法与邻居进行通信。
State(s): Attempt
国家:企图
Event: HelloReceived
事件:HelloReceived
New state: Init
新状态:Init
Action: Restart the Inactivity Timer for the neighbor, since the neighbor has now been heard from.
操作:重新启动邻居的非活动计时器,因为现在已收到邻居的消息。
State(s): Down
州:关闭
Event: HelloReceived
事件:HelloReceived
New state: Init
新状态:Init
Action: Start the Inactivity Timer for the neighbor. The timer's later firing would indicate that the neighbor is dead.
操作:启动邻居的非活动计时器。定时器稍后的触发将表明邻居已经死亡。
State(s): Init or greater
状态:初始或更高
Event: HelloReceived
事件:HelloReceived
New state: No state change.
新状态:无状态更改。
Action: Restart the Inactivity Timer for the neighbor, since the neighbor has again been heard from.
操作:重新启动邻居的非活动计时器,因为再次听到邻居的消息。
State(s): Init
国家:初始
Event: 2-WayReceived
事件:双向接收
New state: Depends upon action routine.
新状态:取决于操作例程。
Action: Determine whether an adjacency should be established with the neighbor (see Section 10.4). If not, the new neighbor state is 2-Way.
措施:确定是否应与邻居建立邻接关系(见第10.4节)。如果不是,则新邻居状态为双向。
Otherwise (an adjacency should be established) the neighbor state transitions to ExStart. Upon entering this state, the router increments the DD
否则(应建立邻接)相邻状态将转换为ExStart。进入该状态后,路由器增加DD
sequence number in the neighbor data structure. If this is the first time that an adjacency has been attempted, the DD sequence number should be assigned some unique value (like the time of day clock). It then declares itself master (sets the master/slave bit to master), and starts sending Database Description Packets, with the initialize (I), more (M) and master (MS) bits set. This Database Description Packet should be otherwise empty. This Database Description Packet should be retransmitted at intervals of RxmtInterval until the next state is entered (see Section 10.8).
相邻数据结构中的序列号。如果这是第一次尝试邻接,则应该为DD序列号分配一些唯一的值(如时间时钟)。然后它声明自己为master(将master/slave位设置为master),并开始发送数据库描述数据包,并设置initialize(I)、more(M)和master(MS)位。否则,此数据库描述数据包应为空。在进入下一个状态之前,应每隔RxmtInterval重新传输该数据库描述数据包(见第10.8节)。
State(s): ExStart
国家:ExStart
Event: NegotiationDone
事件:协商完成
New state: Exchange
新国家:交易所
Action: The router must list the contents of its entire area link state database in the neighbor Database summary list. The area link state database consists of the router-LSAs, network-LSAs and summary-LSAs contained in the area structure, along with the AS-external-LSAs contained in the global structure. AS-external-LSAs are omitted from a virtual neighbor's Database summary list. AS-external-LSAs are omitted from the Database summary list if the area has been configured as a stub (see Section 3.6). LSAs whose age is equal to MaxAge are instead added to the neighbor's Link state retransmission list. A summary of the Database summary list will be sent to the neighbor in Database Description packets. Each Database Description Packet has a DD sequence number, and is explicitly acknowledged. Only one Database Description Packet is allowed outstanding at any one time. For more detail on the sending and receiving of Database Description packets, see Sections 10.8 and 10.6.
措施:路由器必须在邻居数据库摘要列表中列出其整个区域链路状态数据库的内容。区域链路状态数据库包括区域结构中包含的路由器LSA、网络LSA和摘要LSA,以及全局结构中包含的AS外部LSA。因为虚拟邻居的数据库摘要列表中省略了外部LSA。如果区域已配置为存根,则外部LSA将从数据库摘要列表中省略(参见第3.6节)。其年龄等于MaxAge的lsa被添加到邻居的链路状态重传列表中。数据库摘要列表的摘要将在数据库描述数据包中发送给邻居。每个数据库描述数据包都有一个DD序列号,并被明确确认。一次只允许有一个数据库描述数据包。有关发送和接收数据库描述数据包的更多详细信息,请参阅第10.8节和第10.6节。
State(s): Exchange
国家:交易所
Event: ExchangeDone
事件:ExchangeOne
New state: Depends upon action routine.
新状态:取决于操作例程。
Action: If the neighbor Link state request list is empty, the new neighbor state is Full. No other action is required. This is an adjacency's final state.
操作:如果邻居链路状态请求列表为空,则新邻居状态为已满。无需采取其他行动。这是邻接的最终状态。
Otherwise, the new neighbor state is Loading. Start (or continue) sending Link State Request packets to the neighbor (see Section 10.9). These are requests for the neighbor's more recent LSAs (which were discovered but not yet received in the Exchange state). These LSAs are listed in the Link state request list associated with the neighbor.
否则,将加载新的邻居状态。开始(或继续)向邻居发送链路状态请求数据包(见第10.9节)。这些是对邻居最近的LSA(已发现但在Exchange状态下尚未收到)的请求。这些LSA列在与邻居关联的链路状态请求列表中。
State(s): Loading
国家:装载
Event: Loading Done
事件:加载完成
New state: Full
新州:全部
Action: No action required. This is an adjacency's final state.
措施:无需采取任何措施。这是邻接的最终状态。
State(s): 2-Way
州:双向
Event: AdjOK?
事件:好吗?
New state: Depends upon action routine.
新状态:取决于操作例程。
Action: Determine whether an adjacency should be formed with the neighboring router (see Section 10.4). If not, the neighbor state remains at 2-Way. Otherwise, transition the neighbor state to ExStart and perform the actions associated with the above state machine entry for state Init and event 2-WayReceived.
措施:确定是否应与相邻路由器形成邻接(见第10.4节)。如果不是,则相邻状态保持双向。否则,将邻居状态转换为ExStart,并针对state Init和event 2-WayReceived执行与上述状态机条目相关的操作。
State(s): ExStart or greater
状态:ExStart或更高版本
Event: AdjOK?
事件:好吗?
New state: Depends upon action routine.
新状态:取决于操作例程。
Action: Determine whether the neighboring router should still be adjacent. If yes, there is no state change and no further action is necessary.
操作:确定相邻路由器是否仍应相邻。如果是,则不存在状态更改,也无需采取进一步措施。
Otherwise, the (possibly partially formed) adjacency must be destroyed. The neighbor state transitions to 2-Way. The Link state retransmission list, Database summary list and Link state request list are cleared of LSAs.
否则,必须破坏(可能部分形成的)邻接。相邻状态转换为双向。清除链路状态重传列表、数据库摘要列表和链路状态请求列表中的LSA。
State(s): Exchange or greater
国家:交换或更大
Event: SeqNumberMismatch
事件:SeqNumberMismatch
New state: ExStart
新状态:ExStart
Action: The (possibly partially formed) adjacency is torn down, and then an attempt is made at reestablishment. The neighbor state first transitions to ExStart. The Link state retransmission list, Database summary list and Link state request list are cleared of LSAs. Then the router increments the DD sequence number in the neighbor data structure, declares itself master (sets the master/slave bit to master), and starts sending Database Description Packets, with the initialize (I), more (M) and master (MS) bits set. This Database Description Packet should be otherwise empty (see Section 10.8).
措施:拆除(可能部分形成的)邻接,然后尝试重建。邻居状态首先转换为ExStart。清除链路状态重传列表、数据库摘要列表和链路状态请求列表中的LSA。然后,路由器增加邻居数据结构中的DD序列号,声明自己为master(将主/从位设置为master),并开始发送数据库描述数据包,其中设置了initialize(I)、more(M)和master(MS)位。该数据库描述数据包应为空(见第10.8节)。
State(s): Exchange or greater
国家:交换或更大
Event: BadLSReq
事件:BadLSReq
New state: ExStart
新状态:ExStart
Action: The action for event BadLSReq is exactly the same as for the neighbor event SeqNumberMismatch. The (possibly partially formed) adjacency is torn down, and then an attempt is made at reestablishment. For more information, see the neighbor state machine entry that is invoked when event SeqNumberMismatch is generated in state Exchange or greater.
操作:事件BadLSReq的操作与相邻事件SeqNumberMismatch的操作完全相同。拆除(可能部分形成的)邻接,然后尝试重建。有关更多信息,请参阅在状态交换或更高版本中生成事件SeqNumberMismatch时调用的邻居状态机条目。
State(s): Any state
国家:任何国家
Event: KillNbr
活动名称:KillNbr
New state: Down
新州:关闭
Action: The Link state retransmission list, Database summary list and Link state request list are cleared of LSAs. Also, the Inactivity Timer is disabled.
操作:清除链路状态重传列表、数据库摘要列表和链路状态请求列表中的LSA。此外,不活动计时器被禁用。
State(s): Any state
国家:任何国家
Event: LLDown
事件:LLDown
New state: Down
新州:关闭
Action: The Link state retransmission list, Database summary list and Link state request list are cleared of LSAs. Also, the Inactivity Timer is disabled.
操作:清除链路状态重传列表、数据库摘要列表和链路状态请求列表中的LSA。此外,不活动计时器被禁用。
State(s): Any state
国家:任何国家
Event: InactivityTimer
事件:InactivityTimer
New state: Down
新州:关闭
Action: The Link state retransmission list, Database summary list and Link state request list are cleared of LSAs.
操作:清除链路状态重传列表、数据库摘要列表和链路状态请求列表中的LSA。
State(s): 2-Way or greater
状态:双向或更大
Event: 1-WayReceived
事件:1-3天
New state: Init
新状态:Init
Action: The Link state retransmission list, Database summary list and Link state request list are cleared of LSAs.
操作:清除链路状态重传列表、数据库摘要列表和链路状态请求列表中的LSA。
State(s): 2-Way or greater
状态:双向或更大
Event: 2-WayReceived
事件:双向接收
New state: No state change.
新状态:无状态更改。
Action: No action required.
措施:无需采取任何措施。
State(s): Init
国家:初始
Event: 1-WayReceived
事件:1-3天
New state: No state change.
新状态:无状态更改。
Action: No action required.
措施:无需采取任何措施。
10.4. Whether to become adjacent
10.4. 是否相邻
Adjacencies are established with some subset of the router's neighbors. Routers connected by point-to-point networks, Point-to-MultiPoint networks and virtual links always become adjacent. On broadcast and NBMA networks, all routers become adjacent to both the Designated Router and the Backup Designated Router.
邻接是通过路由器的一些邻居子集建立的。通过点对点网络、点对多点网络和虚拟链路连接的路由器总是相邻的。在广播和NBMA网络上,所有路由器都与指定路由器和备份指定路由器相邻。
The adjacency-forming decision occurs in two places in the neighbor state machine. First, when bidirectional communication is initially established with the neighbor, and secondly, when the identity of the attached network's (Backup) Designated
邻接形成决策发生在相邻状态机的两个位置。首先,当最初与邻居建立双向通信时,其次,当指定连接网络的(备份)身份时
Router changes. If the decision is made to not attempt an adjacency, the state of the neighbor communication stops at 2- Way.
路由器改变。如果决定不尝试邻接,则相邻通信的状态在双向停止。
An adjacency should be established with a bidirectional neighbor when at least one of the following conditions holds:
当至少满足以下条件之一时,应与双向邻居建立邻接:
o The underlying network type is point-to-point
o 底层网络类型为点对点
o The underlying network type is Point-to-MultiPoint
o 底层网络类型为点对多点
o The underlying network type is virtual link
o 基础网络类型为虚拟链路
o The router itself is the Designated Router
o 路由器本身就是指定的路由器
o The router itself is the Backup Designated Router
o 路由器本身就是备份指定的路由器
o The neighboring router is the Designated Router
o 相邻路由器是指定的路由器
o The neighboring router is the Backup Designated Router
o 相邻路由器是备份指定的路由器
10.5. Receiving Hello Packets
10.5. 接收Hello数据包
This section explains the detailed processing of a received Hello Packet. (See Section A.3.2 for the format of Hello packets.) The generic input processing of OSPF packets will have checked the validity of the IP header and the OSPF packet header. Next, the values of the Network Mask, HelloInterval, and RouterDeadInterval fields in the received Hello packet must be checked against the values configured for the receiving interface. Any mismatch causes processing to stop and the packet to be dropped. In other words, the above fields are really describing the attached network's configuration. However, there is one exception to the above rule: on point-to-point networks and on virtual links, the Network Mask in the received Hello Packet should be ignored.
本节介绍接收到的Hello数据包的详细处理。(Hello数据包格式见第A.3.2节。)OSPF数据包的通用输入处理将检查IP报头和OSPF数据包报头的有效性。接下来,必须对照为接收接口配置的值检查接收到的Hello数据包中网络掩码、HelloInterval和routerheadinterval字段的值。任何不匹配都会导致处理停止并丢弃数据包。换句话说,上述字段实际上描述了连接网络的配置。但是,上述规则有一个例外:在点到点网络和虚拟链路上,应该忽略接收到的Hello数据包中的网络掩码。
The receiving interface attaches to a single OSPF area (this could be the backbone). The setting of the E-bit found in the Hello Packet's Options field must match this area's
接收接口连接到单个OSPF区域(这可能是主干)。在Hello数据包的选项字段中找到的E位设置必须与此区域的匹配
ExternalRoutingCapability. If AS-external-LSAs are not flooded into/throughout the area (i.e, the area is a "stub") the E-bit must be clear in received Hello Packets, otherwise the E-bit must be set. A mismatch causes processing to stop and the packet to be dropped. The setting of the rest of the bits in the Hello Packet's Options field should be ignored.
外部路由能力。如果外部LSA没有淹没到该区域内/整个区域(即,该区域是一个“存根”),则接收到的Hello数据包中的e位必须清除,否则必须设置e位。不匹配会导致处理停止并丢弃数据包。应忽略Hello数据包选项字段中其余位的设置。
At this point, an attempt is made to match the source of the Hello Packet to one of the receiving interface's neighbors. If the receiving interface connects to a broadcast, Point-to-MultiPoint or NBMA network the source is identified by the IP source address found in the Hello's IP header. If the receiving interface connects to a point-to-point link or a virtual link, the source is identified by the Router ID found in the Hello's OSPF packet header. The interface's current list of neighbors is contained in the interface's data structure. If a matching neighbor structure cannot be found, (i.e., this is the first time the neighbor has been detected), one is created. The initial state of a newly created neighbor is set to Down.
此时,将尝试将Hello数据包的源与接收接口的一个邻居进行匹配。如果接收接口连接到广播、点对多点或NBMA网络,则源由Hello的IP报头中的IP源地址标识。如果接收接口连接到点对点链路或虚拟链路,则源由Hello的OSPF数据包头中的路由器ID标识。接口的当前邻居列表包含在接口的数据结构中。如果找不到匹配的邻居结构(即,这是第一次检测到邻居),将创建一个。新创建的邻居的初始状态设置为“关闭”。
When receiving an Hello Packet from a neighbor on a broadcast, Point-to-MultiPoint or NBMA network, set the neighbor structure's Neighbor ID equal to the Router ID found in the packet's OSPF header. For these network types, the neighbor structure's Router Priority field, Neighbor's Designated Router field, and Neighbor's Backup Designated Router field are also set equal to the corresponding fields found in the received Hello Packet; changes in these fields should be noted for possible use in the steps below. When receiving an Hello on a point-to-point network (but not on a virtual link) set the neighbor structure's Neighbor IP address to the packet's IP source address.
在广播、点对多点或NBMA网络上从邻居接收Hello数据包时,将邻居结构的邻居ID设置为与数据包的OSPF报头中的路由器ID相同。对于这些网络类型,邻居结构的路由器优先级字段、邻居的指定路由器字段和邻居的备份指定路由器字段也设置为与接收到的Hello数据包中找到的相应字段相等;应注意这些字段中的更改,以便在以下步骤中使用。在点到点网络(而不是虚拟链路)上接收Hello时,将邻居结构的邻居IP地址设置为数据包的IP源地址。
Now the rest of the Hello Packet is examined, generating events to be given to the neighbor and interface state machines. These state machines are specified either to be executed or scheduled (see Section 4.4). For example, by specifying below that the neighbor state machine be executed in line, several neighbor state transitions may be effected by a single received Hello:
现在检查Hello数据包的其余部分,生成要提供给邻居和接口状态机的事件。这些状态机被指定为要执行或计划的状态机(见第4.4节)。例如,通过在下面指定以行方式执行邻居状态机,可以通过单个接收到的Hello来影响多个邻居状态转换:
o Each Hello Packet causes the neighbor state machine to be executed with the event HelloReceived.
o 每个Hello数据包都会导致邻居状态机执行HelloReceived事件。
o Then the list of neighbors contained in the Hello Packet is examined. If the router itself appears in this list, the neighbor state machine should be executed with the event 2- WayReceived. Otherwise, the neighbor state machine should be executed with the event 1-WayReceived, and the processing of the packet stops.
o 然后检查Hello包中包含的邻居列表。如果路由器本身出现在此列表中,则应使用事件2-WayReceived执行邻居状态机。否则,应在接收到事件1-WayReceived的情况下执行邻居状态机,并停止对数据包的处理。
o Next, if a change in the neighbor's Router Priority field was noted, the receiving interface's state machine is scheduled with the event NeighborChange.
o 接下来,如果注意到邻居的路由器优先级字段发生了更改,则接收接口的状态机将与事件NeighborChange一起调度。
o If the neighbor is both declaring itself to be Designated Router (Hello Packet's Designated Router field = Neighbor IP address) and the Backup Designated Router field in the packet is equal to 0.0.0.0 and the receiving interface is in state Waiting, the receiving interface's state machine is scheduled with the event BackupSeen. Otherwise, if the neighbor is declaring itself to be Designated Router and it had not previously, or the neighbor is not declaring itself Designated Router where it had previously, the receiving interface's state machine is scheduled with the event NeighborChange.
o 如果邻居同时声明自己是指定路由器(Hello数据包的指定路由器字段=邻居IP地址),并且数据包中的备份指定路由器字段等于0.0.0.0,并且接收接口处于等待状态,则接收接口的状态机将与事件BackupSeen一起调度。否则,如果邻居将自己声明为指定路由器,但以前没有,或者邻居未将自己声明为其以前所在的指定路由器,则接收接口的状态机将使用事件NeighborChange进行调度。
o If the neighbor is declaring itself to be Backup Designated Router (Hello Packet's Backup Designated Router field = Neighbor IP address) and the receiving interface is in state Waiting, the receiving interface's state machine is scheduled with the event BackupSeen. Otherwise, if the neighbor is declaring itself to be Backup Designated Router and it had not previously, or the neighbor is not declaring itself Backup Designated Router where it had previously, the receiving interface's state machine is scheduled with the event NeighborChange.
o 如果邻居声明自己是备份指定路由器(Hello数据包的备份指定路由器字段=邻居IP地址),并且接收接口处于等待状态,则接收接口的状态机将与事件BackupSeen一起调度。否则,如果邻居将自己声明为备份指定路由器,但以前没有,或者邻居未将自己声明为备份指定路由器,则接收接口的状态机将使用事件NeighborChange进行调度。
On NBMA networks, receipt of an Hello Packet may also cause an Hello Packet to be sent back to the neighbor in response. See Section 9.5.1 for more details.
在NBMA网络上,接收Hello数据包也可能导致将Hello数据包发送回邻居作为响应。详见第9.5.1节。
10.6. Receiving Database Description Packets
10.6. 接收数据库描述数据包
This section explains the detailed processing of a received Database Description Packet. The incoming Database Description Packet has already been associated with a neighbor and receiving interface by the generic input packet processing (Section 8.2). Whether the Database Description packet should be accepted, and if so, how it should be further processed depends upon the neighbor state.
本节说明接收到的数据库描述数据包的详细处理。传入数据库描述数据包已通过通用输入数据包处理(第8.2节)与邻居和接收接口相关联。是否应接受数据库描述数据包,如果是,应如何进一步处理它取决于邻居的状态。
If a Database Description packet is accepted, the following packet fields should be saved in the corresponding neighbor data structure under "last received Database Description packet": the packet's initialize(I), more (M) and master(MS) bits, Options field, and DD sequence number. If these fields are set identically in two consecutive Database Description packets received from the neighbor, the second Database Description packet is considered to be a "duplicate" in the processing described below.
如果接受数据库描述数据包,则以下数据包字段应保存在“上次接收的数据库描述数据包”下的相应相邻数据结构中:数据包的初始化(I)、更多(M)和主(MS)位、选项字段和DD序列号。如果在从邻居接收的两个连续的数据库描述数据包中相同地设置了这些字段,则在下面描述的处理中,第二个数据库描述数据包被认为是“重复的”。
If the Interface MTU field in the Database Description packet indicates an IP datagram size that is larger than the router can accept on the receiving interface without fragmentation, the Database Description packet is rejected. Otherwise, if the neighbor state is:
如果数据库描述数据包中的接口MTU字段指示IP数据报大小大于路由器在接收接口上可以接受的无碎片的IP数据报大小,则拒绝数据库描述数据包。否则,如果邻居状态为:
Down The packet should be rejected.
下一个包应该被拒绝。
Attempt The packet should be rejected.
该数据包应被拒绝。
Init The neighbor state machine should be executed with the event 2-WayReceived. This causes an immediate state change to either state 2-Way or state ExStart. If the new state is ExStart, the processing of the current packet should then continue in this new state by falling through to case ExStart below.
Init应在接收到事件2的情况下执行邻居状态机。这会导致状态立即更改为双向或ExStart状态。如果新状态为ExStart,则当前数据包的处理应在此新状态下继续,直至下面的ExStart情况。
2-Way The packet should be ignored. Database Description Packets are used only for the purpose of bringing up adjacencies.[7]
双向数据包应被忽略。数据库描述数据包仅用于产生邻接关系。[7]
ExStart If the received packet matches one of the following cases, then the neighbor state machine should be executed with the event NegotiationDone (causing the state to transition to Exchange), the packet's Options field should be recorded in the neighbor structure's Neighbor Options field and the packet should be accepted as next in sequence and processed further (see below). Otherwise, the packet should be ignored.
ExStart如果接收到的数据包与以下情况之一匹配,则应使用事件协商完成(导致状态转换为Exchange)执行邻居状态机,数据包的选项字段应记录在邻居结构的邻居选项字段中,数据包应按顺序接受并进一步处理(见下文)。否则,应忽略该数据包。
o The initialize(I), more (M) and master(MS) bits are set, the contents of the packet are empty, and the neighbor's Router ID is larger than the router's own. In this case the router is now Slave. Set the master/slave bit to slave, and set the neighbor data structure's DD sequence number to that specified by the master.
o 初始化(I)、更多(M)和主(MS)位被设置,数据包的内容为空,并且邻居的路由器ID大于路由器自己的。在这种情况下,路由器现在是从属的。将主/从位设置为从,并将相邻数据结构的DD序列号设置为主指定的序列号。
o The initialize(I) and master(MS) bits are off, the packet's DD sequence number equals the neighbor data structure's DD sequence number (indicating acknowledgment) and the neighbor's Router ID is smaller than the router's own. In this case the router is Master.
o 初始化(I)和主(MS)位关闭,数据包的DD序列号等于邻居数据结构的DD序列号(表示确认),并且邻居的路由器ID小于路由器自己的ID。在这种情况下,路由器是主路由器。
Exchange Duplicate Database Description packets are discarded by the master, and cause the slave to retransmit the last Database Description packet that it had sent. Otherwise (the packet is not a duplicate):
Exchange重复数据库描述数据包被主服务器丢弃,并导致从属服务器重新传输它发送的最后一个数据库描述数据包。否则(数据包不是重复的):
o If the state of the MS-bit is inconsistent with the master/slave state of the connection, generate the neighbor event SeqNumberMismatch and stop processing the packet.
o 如果MS位的状态与连接的主/从状态不一致,则生成邻居事件SeqNumberMismatch并停止处理数据包。
o If the initialize(I) bit is set, generate the neighbor event SeqNumberMismatch and stop processing the packet.
o 如果设置了初始化(I)位,则生成邻居事件SeqNumberMismatch并停止处理数据包。
o If the packet's Options field indicates a different set of optional OSPF capabilities than were previously received from the neighbor (recorded in the Neighbor Options field of the neighbor structure), generate the neighbor event SeqNumberMismatch and stop processing the packet.
o 如果数据包的选项字段指示的可选OSPF功能集与以前从邻居接收的不同(记录在邻居结构的邻居选项字段中),则生成邻居事件SeqNumberMismatch并停止处理数据包。
o Database Description packets must be processed in sequence, as indicated by the packets' DD sequence numbers. If the router is master, the next packet received should have DD sequence number equal to the DD sequence number in the neighbor data structure. If the router is slave, the next packet received should have DD sequence number equal to one more than the DD sequence number stored in the neighbor data structure. In either case, if the packet is the next in sequence it should be accepted and its contents processed as specified below.
o 数据库描述数据包必须按顺序处理,如数据包的DD序列号所示。如果路由器是主路由器,则接收到的下一个数据包的DD序列号应等于邻居数据结构中的DD序列号。如果路由器是从路由器,则接收到的下一个数据包的DD序列号应比存储在相邻数据结构中的DD序列号多一个。在任何一种情况下,如果数据包是序列中的下一个,则应接受该数据包,并按以下规定处理其内容。
o Else, generate the neighbor event SeqNumberMismatch and stop processing the packet.
o 否则,生成邻居事件SeqNumberMismatch并停止处理数据包。
Loading or Full In this state, the router has sent and received an entire sequence of Database Description Packets. The only packets received should be duplicates (see above). In particular, the packet's Options field should match the set of optional OSPF capabilities previously indicated by the neighbor (stored in the neighbor structure's Neighbor Options field). Any other packets received, including the reception of a packet with the Initialize(I) bit set, should generate the neighbor event SeqNumberMismatch.[8] Duplicates should be discarded by the master. The slave must respond to duplicates by repeating the last Database Description packet that it had sent.
加载或完全在此状态下,路由器已发送和接收整个数据库描述数据包序列。收到的唯一数据包应为重复数据包(见上文)。特别是,数据包的选项字段应与邻居先前指示的可选OSPF功能集相匹配(存储在邻居结构的邻居选项字段中)。接收到的任何其他数据包,包括接收设置了初始化(I)位的数据包,都应生成邻居事件SeqNumberMismatch。[8]主服务器应丢弃重复的数据包。从属服务器必须通过重复其发送的最后一个数据库描述数据包来响应副本。
When the router accepts a received Database Description Packet as the next in sequence the packet contents are processed as follows. For each LSA listed, the LSA's LS type is checked for validity. If the LS type is unknown (e.g., not one of the LS types 1-5 defined by this specification), or if this is an AS-external-LSA (LS type = 5) and the neighbor is associated with a
当路由器接受接收到的数据库描述数据包作为下一个序列时,数据包内容将按如下方式处理。对于列出的每个LSA,将检查LSA的LS类型的有效性。如果LS类型未知(例如,不是本规范定义的LS类型1-5之一),或者如果这是AS外部LSA(LS类型=5),并且邻居与
stub area, generate the neighbor event SeqNumberMismatch and stop processing the packet. Otherwise, the router looks up the LSA in its database to see whether it also has an instance of the LSA. If it does not, or if the database copy is less recent (see Section 13.1), the LSA is put on the Link state request list so that it can be requested (immediately or at some later time) in Link State Request Packets.
存根区域,生成邻居事件SeqNumberMismatch并停止处理数据包。否则,路由器将在其数据库中查找LSA,以查看是否也有LSA的实例。如果没有,或者如果数据库副本不是最近的(参见第13.1节),LSA将被放在链路状态请求列表中,以便可以在链路状态请求数据包中请求它(立即或稍后)。
When the router accepts a received Database Description Packet as the next in sequence, it also performs the following actions, depending on whether it is master or slave:
当路由器接受接收到的数据库描述数据包作为序列中的下一个数据包时,它还执行以下操作,具体取决于它是主数据包还是从数据包:
Master Increments the DD sequence number in the neighbor data structure. If the router has already sent its entire sequence of Database Description Packets, and the just accepted packet has the more bit (M) set to 0, the neighbor event ExchangeDone is generated. Otherwise, it should send a new Database Description to the slave.
Master增加相邻数据结构中的DD序列号。如果路由器已经发送了其整个数据库描述数据包序列,并且刚刚接受的数据包的更多位(M)设置为0,则生成邻居事件ExchangeOne。否则,它应该向从属服务器发送一个新的数据库描述。
Slave Sets the DD sequence number in the neighbor data structure to the DD sequence number appearing in the received packet. The slave must send a Database Description Packet in reply. If the received packet has the more bit (M) set to 0, and the packet to be sent by the slave will also have the M-bit set to 0, the neighbor event ExchangeDone is generated. Note that the slave always generates this event before the master.
从机将邻居数据结构中的DD序列号设置为接收数据包中出现的DD序列号。从属服务器必须发送数据库描述数据包作为回复。如果接收到的数据包的更多位(M)设置为0,并且从机发送的数据包的M位也将设置为0,则生成邻居事件ExchangeOne。请注意,从机总是在主机之前生成此事件。
10.7. Receiving Link State Request Packets
10.7. 接收链路状态请求数据包
This section explains the detailed processing of received Link State Request packets. Received Link State Request Packets specify a list of LSAs that the neighbor wishes to receive. Link State Request Packets should be accepted when the neighbor is in states Exchange, Loading, or Full. In all other states Link State Request Packets should be ignored.
本节说明接收到的链路状态请求数据包的详细处理。接收的链路状态请求数据包指定邻居希望接收的LSA列表。当邻居处于交换、加载或已满状态时,应接受链路状态请求数据包。在所有其他状态下,应忽略链路状态请求数据包。
Each LSA specified in the Link State Request packet should be located in the router's database, and copied into Link State Update packets for transmission to the neighbor. These LSAs should NOT be placed on the Link state retransmission list for the neighbor. If an LSA cannot be found in the database, something has gone wrong with the Database Exchange process, and neighbor event BadLSReq should be generated.
链路状态请求数据包中指定的每个LSA都应该位于路由器的数据库中,并复制到链路状态更新数据包中,以便传输到邻居。这些LSA不应放在邻居的链路状态重传列表中。如果在数据库中找不到LSA,则表明数据库交换进程出现问题,应生成邻居事件BadLSReq。
10.8. Sending Database Description Packets
10.8. 发送数据库描述数据包
This section describes how Database Description Packets are sent to a neighbor. The Database Description packet's Interface MTU field is set to the size of the largest IP datagram that can be sent out the sending interface, without fragmentation. Common MTUs in use in the Internet can be found in Table 7-1 of [Ref22]. Interface MTU should be set to 0 in Database Description packets sent over virtual links.
本节介绍如何将数据库描述数据包发送给邻居。数据库描述数据包的接口MTU字段被设置为发送接口可以发送的最大IP数据报的大小,而不会出现碎片。互联网上使用的常见MTU见[参考文献22]的表7-1。在通过虚拟链接发送的数据库描述数据包中,接口MTU应设置为0。
The router's optional OSPF capabilities (see Section 4.5) are transmitted to the neighbor in the Options field of the Database Description packet. The router should maintain the same set of optional capabilities throughout the Database Exchange and flooding procedures. If for some reason the router's optional capabilities change, the Database Exchange procedure should be restarted by reverting to neighbor state ExStart. One optional capability is defined in this specification (see Sections 4.5 and A.2). The E-bit should be set if and only if the attached network belongs to a non-stub area. Unrecognized bits in the Options field should be set to zero.
路由器的可选OSPF功能(见第4.5节)在数据库描述数据包的选项字段中传输给邻居。路由器应在整个数据库交换和泛洪过程中保持相同的可选功能集。如果由于某种原因路由器的可选功能发生更改,则应通过还原到邻居状态ExStart来重新启动数据库交换过程。本规范中定义了一种可选功能(见第4.5节和A.2节)。当且仅当连接的网络属于非存根区域时,才应设置E位。选项字段中无法识别的位应设置为零。
The sending of Database Description packets depends on the neighbor's state. In state ExStart the router sends empty Database Description packets, with the initialize (I), more (M) and master (MS) bits set. These packets are retransmitted every RxmtInterval seconds.
数据库描述数据包的发送取决于邻居的状态。在ExStart状态下,路由器发送空数据库描述数据包,并设置初始化(I)、更多(M)和主(MS)位。这些数据包每RxMTINERVAL秒重新传输一次。
In state Exchange the Database Description Packets actually contain summaries of the link state information contained in the router's database. Each LSA in the area's link-state database (at the time the neighbor transitions into Exchange state) is listed in the neighbor Database summary list. Each new Database
在状态交换中,数据库描述包实际上包含路由器数据库中包含的链路状态信息的摘要。区域链路状态数据库中的每个LSA(在邻居转换为Exchange状态时)都列在邻居数据库摘要列表中。每个新数据库
Description Packet copies its DD sequence number from the neighbor data structure and then describes the current top of the Database summary list. Items are removed from the Database summary list when the previous packet is acknowledged.
描述数据包从邻居数据结构复制其DD序列号,然后描述数据库摘要列表的当前顶部。确认前一个数据包时,将从数据库摘要列表中删除项。
In state Exchange, the determination of when to send a Database Description packet depends on whether the router is master or slave:
在状态交换中,何时发送数据库描述数据包的确定取决于路由器是主路由器还是从路由器:
Master Database Description packets are sent when either a) the slave acknowledges the previous Database Description packet by echoing the DD sequence number or b) RxmtInterval seconds elapse without an acknowledgment, in which case the previous Database Description packet is retransmitted.
当a)从机通过回显DD序列号确认上一个数据库描述数据包,或b)RxMTINERVAL秒过去而未确认时,发送主数据库描述数据包,在这种情况下,重新传输上一个数据库描述数据包。
Slave Database Description packets are sent only in response to Database Description packets received from the master. If the Database Description packet received from the master is new, a new Database Description packet is sent, otherwise the previous Database Description packet is resent.
从属数据库描述数据包仅响应从主数据库接收的数据库描述数据包而发送。如果从主机接收的数据库描述数据包是新的,则发送新的数据库描述数据包,否则重新发送以前的数据库描述数据包。
In states Loading and Full the slave must resend its last Database Description packet in response to duplicate Database Description packets received from the master. For this reason the slave must wait RouterDeadInterval seconds before freeing the last Database Description packet. Reception of a Database Description packet from the master after this interval will generate a SeqNumberMismatch neighbor event.
在加载和完全状态下,从属服务器必须重新发送其最后一个数据库描述数据包,以响应从主服务器接收到的重复数据库描述数据包。因此,在释放最后一个数据库描述数据包之前,从属服务器必须等待RouterDeadInterval秒。在此间隔后从主机接收数据库描述数据包将生成SeqNumberMismatch邻居事件。
10.9. Sending Link State Request Packets
10.9. 发送链路状态请求数据包
In neighbor states Exchange or Loading, the Link state request list contains a list of those LSAs that need to be obtained from the neighbor. To request these LSAs, a router sends the neighbor the beginning of the Link state request list, packaged in a Link State Request packet.
在邻居状态交换或加载中,链路状态请求列表包含需要从邻居获取的那些LSA的列表。为了请求这些LSA,路由器向邻居发送链路状态请求列表的开头,该列表打包在链路状态请求数据包中。
When the neighbor responds to these requests with the proper Link State Update packet(s), the Link state request list is truncated and a new Link State Request packet is sent. This process continues until the Link state request list becomes empty. LSAs on the Link state request list that have been requested, but not yet received, are packaged into Link State Request packets for retransmission at intervals of RxmtInterval. There should be at most one Link State Request packet outstanding at any one time.
当邻居使用正确的链路状态更新数据包响应这些请求时,链路状态请求列表将被截断,并发送新的链路状态请求数据包。此过程将继续,直到链接状态请求列表变为空。链路状态请求列表上已请求但尚未接收的LSA被打包到链路状态请求包中,以便每隔RxmtInterval重新传输。在任何时候,最多应有一个链路状态请求包未完成。
When the Link state request list becomes empty, and the neighbor state is Loading (i.e., a complete sequence of Database Description packets has been sent to and received from the neighbor), the Loading Done neighbor event is generated.
当链路状态请求列表变为空,并且邻居状态正在加载(即,已向邻居发送并从邻居接收完整的数据库描述数据包序列)时,将生成加载完成邻居事件。
10.10. An Example
10.10. 一个例子
Figure 14 shows an example of an adjacency forming. Routers RT1 and RT2 are both connected to a broadcast network. It is assumed that RT2 is the Designated Router for the network, and that RT2 has a higher Router ID than Router RT1.
图14显示了邻接形成的示例。路由器RT1和RT2都连接到广播网络。假设RT2是网络的指定路由器,并且RT2具有比路由器RT1更高的路由器ID。
The neighbor state changes realized by each router are listed on the sides of the figure.
图的侧面列出了每个路由器实现的邻居状态更改。
At the beginning of Figure 14, Router RT1's interface to the network becomes operational. It begins sending Hello Packets, although it doesn't know the identity of the Designated Router or of any other neighboring routers. Router RT2 hears this hello (moving the neighbor to Init state), and in its next Hello Packet indicates that it is itself the Designated Router and that it has heard Hello Packets from RT1. This in turn causes RT1 to go to state ExStart, as it starts to bring up the adjacency.
在图14的开头,路由器RT1与网络的接口开始工作。它开始发送Hello数据包,尽管它不知道指定路由器或任何其他相邻路由器的身份。路由器RT2听到这个hello(将邻居移动到Init状态),在它的下一个hello数据包中表示它本身就是指定的路由器,并且它已经听到来自RT1的hello数据包。这反过来会导致RT1进入ExStart状态,因为它开始显示邻接关系。
RT1 begins by asserting itself as the master. When it sees that RT2 is indeed the master (because of RT2's higher Router ID), RT1 transitions to slave state and adopts its neighbor's DD sequence number. Database Description packets are then exchanged, with polls coming from the master (RT2) and responses from the slave (RT1). This sequence of Database Description
RT1首先声明自己是主节点。当它看到RT2确实是主机时(因为RT2的路由器ID更高),RT1将转换到从属状态并采用其邻居的DD序列号。然后交换数据库描述数据包,轮询来自主机(RT2),响应来自从机(RT1)。这是数据库描述的顺序
+---+ +---+ |RT1| |RT2| +---+ +---+
+---+ +---+ |RT1| |RT2| +---+ +---+
Down Down Hello(DR=0,seen=0) ------------------------------> Hello (DR=RT2,seen=RT1,...) Init <------------------------------ ExStart D-D (Seq=x,I,M,Master) ------------------------------> D-D (Seq=y,I,M,Master) ExStart <------------------------------ Exchange D-D (Seq=y,M,Slave) ------------------------------> D-D (Seq=y+1,M,Master) Exchange <------------------------------ D-D (Seq=y+1,M,Slave) ------------------------------> ... ... ... D-D (Seq=y+n, Master) <------------------------------ D-D (Seq=y+n, Slave) Loading ------------------------------> LS Request Full ------------------------------> LS Update <------------------------------ LS Request ------------------------------> LS Update <------------------------------ Full
Down Down Hello(DR=0,seen=0) ------------------------------> Hello (DR=RT2,seen=RT1,...) Init <------------------------------ ExStart D-D (Seq=x,I,M,Master) ------------------------------> D-D (Seq=y,I,M,Master) ExStart <------------------------------ Exchange D-D (Seq=y,M,Slave) ------------------------------> D-D (Seq=y+1,M,Master) Exchange <------------------------------ D-D (Seq=y+1,M,Slave) ------------------------------> ... ... ... D-D (Seq=y+n, Master) <------------------------------ D-D (Seq=y+n, Slave) Loading ------------------------------> LS Request Full ------------------------------> LS Update <------------------------------ LS Request ------------------------------> LS Update <------------------------------ Full
Figure 14: An adjacency bring-up example
图14:邻接显示示例
Packets ends when both the poll and associated response has the M-bit off.
当轮询和相关响应都关闭M位时,数据包结束。
In this example, it is assumed that RT2 has a completely up to date database. In that case, RT2 goes immediately into Full state. RT1 will go into Full state after updating the necessary parts of its database. This is done by sending Link State Request Packets, and receiving Link State Update Packets in response. Note that, while RT1 has waited until a complete set of Database Description Packets has been received (from RT2) before sending any Link State Request Packets, this need not be the case. RT1 could have interleaved the sending of Link State Request Packets with the reception of Database Description Packets.
在本例中,假设RT2有一个完全最新的数据库。在这种情况下,RT2立即进入完全状态。RT1将在更新其数据库的必要部分后进入完全状态。这是通过发送链路状态请求数据包和接收响应的链路状态更新数据包来完成的。注意,虽然RT1在发送任何链路状态请求数据包之前一直等待(从RT2)接收到一组完整的数据库描述数据包,但情况并非如此。RT1可以将链路状态请求数据包的发送与数据库描述数据包的接收交织在一起。
The routing table data structure contains all the information necessary to forward an IP data packet toward its destination. Each routing table entry describes the collection of best paths to a particular destination. When forwarding an IP data packet, the routing table entry providing the best match for the packet's IP destination is located. The matching routing table entry then provides the next hop towards the packet's destination. OSPF also provides for the existence of a default route (Destination ID = DefaultDestination, Address Mask = 0x00000000). When the default route exists, it matches all IP destinations (although any other matching entry is a better match). Finding the routing table entry that best matches an IP destination is further described in Section 11.1.
路由表数据结构包含将IP数据包转发到其目的地所需的所有信息。每个路由表条目描述到特定目标的最佳路径集合。转发IP数据包时,为该包的IP目的地提供最佳匹配的路由表条目位于。然后,匹配的路由表条目向数据包的目的地提供下一跳。OSPF还提供默认路由的存在(目的地ID=DefaultDestination,地址掩码=0x00000000)。当默认路由存在时,它匹配所有IP目的地(尽管任何其他匹配条目都是更好的匹配)。查找与IP目的地最匹配的路由表条目将在第11.1节中进一步说明。
There is a single routing table in each router. Two sample routing tables are described in Sections 11.2 and 11.3. The building of the routing table is discussed in Section 16.
每个路由器中都有一个路由表。第11.2节和第11.3节描述了两个示例路由表。第16节讨论了路由表的构建。
The rest of this section defines the fields found in a routing table entry. The first set of fields describes the routing table entry's destination.
本节的其余部分定义路由表条目中的字段。第一组字段描述路由表项的目标。
Destination Type Destination type is either "network" or "router". Only network entries are actually used when forwarding IP data traffic. Router routing table entries are used solely as intermediate steps in the routing table build process.
目的地类型目的地类型为“网络”或“路由器”。转发IP数据流量时,实际上只使用网络条目。路由器路由表条目仅用作路由表构建过程中的中间步骤。
A network is a range of IP addresses, to which IP data traffic may be forwarded. This includes IP networks (class A, B, or C), IP subnets, IP supernets and single IP hosts. The default route also falls into this category.
网络是一系列IP地址,IP数据流量可以转发到这些地址。这包括IP网络(A类、B类或C类)、IP子网、IP超级网和单个IP主机。默认路线也属于此类别。
Router entries are kept for area border routers and AS boundary routers. Routing table entries for area border routers are used when calculating the inter-area routes (see Section 16.2), and when maintaining configured virtual links (see Section 15). Routing table entries for AS boundary routers are used when calculating the AS external routes (see Section 16.4).
路由器条目用于区域边界路由器和AS边界路由器。区域边界路由器的路由表条目用于计算区域间路由(见第16.2节)和维护配置的虚拟链路(见第15节)。当计算AS外部路由时,使用AS边界路由器的路由表条目(见第16.4节)。
Destination ID The destination's identifier or name. This depends on the Destination Type. For networks, the identifier is their associated IP address. For routers, the identifier is the OSPF Router ID.[9]
目的地ID目的地的标识符或名称。这取决于目标类型。对于网络,标识符是其关联的IP地址。对于路由器,标识符是OSPF路由器ID。[9]
Address Mask Only defined for networks. The network's IP address together with its address mask defines a range of IP addresses. For IP subnets, the address mask is referred to as the subnet mask. For host routes, the mask is "all ones" (0xffffffff).
仅为网络定义地址掩码。网络的IP地址及其地址掩码定义了一系列IP地址。对于IP子网,地址掩码称为子网掩码。对于主机路由,掩码为“全部”(0xffffffff)。
Optional Capabilities When the destination is a router this field indicates the optional OSPF capabilities supported by the destination router. The only optional capability defined by this specification is the ability to process AS-external-LSAs. For a further discussion of OSPF's optional capabilities, see Section 4.5.
可选功能当目标为路由器时,此字段表示目标路由器支持的可选OSPF功能。本规范定义的唯一可选功能是作为外部LSA进行处理的能力。有关OSPF可选功能的进一步讨论,请参见第4.5节。
The set of paths to use for a destination may vary based on the OSPF area to which the paths belong. This means that there may be multiple routing table entries for the same destination, depending on the values of the next field.
用于目的地的路径集可以根据路径所属的OSPF区域而变化。这意味着,根据下一个字段的值,同一目的地可能有多个路由表条目。
Area This field indicates the area whose link state information has led to the routing table entry's collection of paths. This is called the entry's associated area. For sets of AS external paths, this field is not defined. For destinations of type "router", there may be separate sets of paths (and therefore separate routing table entries) associated with each of several areas. For example, this will happen when two area border routers share multiple areas in common. For destinations of type "network", only the set of paths associated with the best area (the one providing the preferred route) is kept.
Area此字段表示其链接状态信息导致路由表项的路径集合的区域。这称为条目的关联区域。对于作为外部路径的集合,未定义此字段。对于“路由器”类型的目的地,可能存在与多个区域中的每一个相关联的单独路径集(因此也可能存在单独的路由表条目)。例如,当两个区域边界路由器共享多个公共区域时,就会发生这种情况。对于“网络”类型的目的地,仅保留与最佳区域(提供首选路由的区域)相关联的路径集。
The rest of the routing table entry describes the set of paths to the destination. The following fields pertain to the set of paths as a whole. In other words, each one of the paths contained in a routing table entry is of the same path-type and cost (see below).
路由表条目的其余部分描述了到目标的路径集。以下字段作为一个整体与路径集相关。换句话说,路由表条目中包含的每一条路径都具有相同的路径类型和成本(见下文)。
Path-type There are four possible types of paths used to route traffic to the destination, listed here in decreasing order of preference: intra-area, inter-area, type 1 external or type 2 external. Intra-area paths indicate destinations belonging to one of the router's attached areas. Inter-area paths are paths to destinations in other OSPF areas. These are discovered through the examination of received summary-LSAs. AS external paths are paths to destinations external to the AS. These are detected through the examination of received AS-external-LSAs.
路径类型用于将流量路由到目的地的路径有四种可能的类型,此处按优先顺序递减列出:区域内、区域间、类型1外部或类型2外部。区域内路径表示属于路由器连接区域之一的目的地。区域间路径是指向其他OSPF区域中的目的地的路径。这些是通过检查收到的汇总LSA发现的。AS外部路径是指向AS外部目标的路径。这些是通过检查作为外部LSA接收的数据来检测的。
Cost The link state cost of the path to the destination. For all paths except type 2 external paths this describes the entire path's cost. For Type 2 external paths, this field describes the cost of the portion of the path internal to the AS. This
Cost指向目标的路径的链接状态开销。对于除类型2外部路径以外的所有路径,这描述了整个路径的成本。对于类型2外部路径,此字段描述AS内部路径部分的成本。这
cost is calculated as the sum of the costs of the path's constituent links.
成本计算为路径组成链接的成本之和。
Type 2 cost Only valid for type 2 external paths. For these paths, this field indicates the cost of the path's external portion. This cost has been advertised by an AS boundary router, and is the most significant part of the total path cost. For example, a type 2 external path with type 2 cost of 5 is always preferred over a path with type 2 cost of 10, regardless of the cost of the two paths' internal components.
类型2成本仅对类型2外部路径有效。对于这些路径,此字段指示路径外部部分的成本。该成本已由AS边界路由器公布,是总路径成本中最重要的部分。例如,与类型2成本为10的路径相比,类型2成本为5的类型2外部路径始终是首选路径,而与两个路径的内部组件的成本无关。
Link State Origin Valid only for intra-area paths, this field indicates the LSA (router-LSA or network-LSA) that directly references the destination. For example, if the destination is a transit network, this is the transit network's network-LSA. If the destination is a stub network, this is the router-LSA for the attached router. The LSA is discovered during the shortest-path tree calculation (see Section 16.1). Multiple LSAs may reference the destination, however a tie-breaking scheme always reduces the choice to a single LSA. The Link State Origin field is not used by the OSPF protocol, but it is used by the routing table calculation in OSPF's Multicast routing extensions (MOSPF).
链路状态原点仅对区域内路径有效,此字段表示直接引用目标的LSA(路由器LSA或网络LSA)。例如,如果目的地是公交网络,则这是公交网络的网络LSA。如果目标是存根网络,则这是连接的路由器的路由器LSA。LSA是在最短路径树计算期间发现的(见第16.1节)。多个LSA可能会引用目的地,但是平局中断方案总是将选择减少到单个LSA。链路状态起始字段不用于OSPF协议,但用于OSPF的多播路由扩展(MOSPF)中的路由表计算。
When multiple paths of equal path-type and cost exist to a destination (called elsewhere "equal-cost" paths), they are stored in a single routing table entry. Each one of the "equal-cost" paths is distinguished by the following fields:
当目标存在多条路径类型和成本相同的路径(在别处称为“同等成本”路径)时,它们存储在单个路由表条目中。每个“同等成本”路径都通过以下字段进行区分:
Next hop The outgoing router interface to use when forwarding traffic to the destination. On broadcast, Point-to-MultiPoint and NBMA networks, the next hop also includes the IP address of the next router (if any) in the path towards the destination.
下一跳将流量转发到目的地时要使用的传出路由器接口。在广播、点对多点和NBMA网络中,下一跳还包括通向目的地的路径中的下一路由器(如果有)的IP地址。
Advertising router Valid only for inter-area and AS external paths. This field indicates the Router ID of the router advertising the summary-LSA or AS-external-LSA that led to this path.
广告路由器仅对区域间和外部路径有效。此字段表示公布摘要LSA或作为指向此路径的外部LSA的路由器的路由器ID。
11.1. Routing table lookup
11.1. 路由表查找
When an IP data packet is received, an OSPF router finds the routing table entry that best matches the packet's destination. This routing table entry then provides the outgoing interface and next hop router to use in forwarding the packet. This section describes the process of finding the best matching routing table entry.
当接收到IP数据包时,OSPF路由器会找到与数据包目的地最匹配的路由表条目。然后,此路由表条目提供用于转发数据包的传出接口和下一跳路由器。本节介绍查找最佳匹配路由表项的过程。
Before the lookup begins, "discard" routing table entries should be inserted into the routing table for each of the router's active area address ranges (see Section 3.5). (An area range is considered "active" if the range contains one or more networks reachable by intra-area paths.) The destination of a "discard" entry is the set of addresses described by its associated active area address range, and the path type of each "discard" entry is set to "inter-area".[10]
在开始查找之前,应将“丢弃”路由表条目插入路由器每个活动区域地址范围的路由表中(见第3.5节)。(如果区域范围包含一个或多个可通过区域内路径访问的网络,则该区域范围被视为“活动”。“丢弃”项的目的地是由其关联的活动区域地址范围描述的地址集,并且每个“丢弃”项的路径类型被设置为“区域间”。[10]
Several routing table entries may match the destination address. In this case, the "best match" is the routing table entry that provides the most specific (longest) match. Another way of saying this is to choose the entry that specifies the narrowest range of IP addresses.[11] For example, the entry for the address/mask pair of (128.185.1.0, 0xffffff00) is more specific than an entry for the pair (128.185.0.0, 0xffff0000). The default route is the least specific match, since it matches all destinations. (Note that for any single routing table entry, multiple paths may be possible. In these cases, the calculations in Sections 16.1, 16.2, and 16.4 always yield the paths having the most preferential path-type, as described in Section 11).
多个路由表条目可能与目标地址匹配。在这种情况下,“最佳匹配”是提供最特定(最长)匹配的路由表条目。另一种说法是选择指定IP地址最窄范围的条目。[11]例如,地址/掩码对(128.185.1.0,0xffffff00)的条目比该对(128.185.0.0,0xffff0000)的条目更具体。默认路由是最不特定的匹配,因为它匹配所有目的地。(请注意,对于任何单个路由表条目,可能存在多条路径。在这些情况下,第16.1、16.2和16.4节中的计算始终会产生具有最优先路径类型的路径,如第11节所述)。
If there is no matching routing table entry, or the best match routing table entry is one of the above "discard" routing table entries, then the packet's IP destination is considered unreachable. Instead of being forwarded, the packet should then be discarded and an ICMP destination unreachable message should be returned to the packet's source.
如果没有匹配的路由表条目,或者最佳匹配的路由表条目是上述“丢弃”路由表条目之一,则认为数据包的IP目的地不可到达。然后应丢弃数据包而不是转发数据包,并将ICMP目的地不可访问消息返回到数据包的源。
11.2. Sample routing table, without areas
11.2. 示例路由表,不带区域
Consider the Autonomous System pictured in Figure 2. No OSPF areas have been configured. A single metric is shown per
考虑图2中所示的自治系统。尚未配置OSPF区域。一个度量单位显示为每个
outbound interface. The calculation of Router RT6's routing table proceeds as described in Section 2.2. The resulting routing table is shown in Table 12. Destination types are abbreviated: Network as "N", Router as "R".
出站接口。路由器RT6路由表的计算如第2.2节所述进行。生成的路由表如表12所示。目的地类型缩写为:网络为“N”,路由器为“R”。
There are no instances of multiple equal-cost shortest paths in this example. Also, since there are no areas, there are no inter-area paths.
本例中没有多条等成本最短路径的实例。此外,由于没有区域,因此没有区域间路径。
Routers RT5 and RT7 are AS boundary routers. Intra-area routes have been calculated to Routers RT5 and RT7. This allows external routes to be calculated to the destinations advertised by RT5 and RT7 (i.e., Networks N12, N13, N14 and N15). It is assumed all AS-external-LSAs originated by RT5 and RT7 are advertising type 1 external metrics. This results in type 1 external paths being calculated to destinations N12-N15.
路由器RT5和RT7作为边界路由器。已计算到路由器RT5和RT7的区域内路由。这允许计算到RT5和RT7播发的目的地(即网络N12、N13、N14和N15)的外部路由。假设所有由RT5和RT7发起的外部LSA都是广告类型1外部度量。这将导致计算到目的地N12-N15的类型1外部路径。
11.3. Sample routing table, with areas
11.3. 示例路由表,带区域
Consider the previous example, this time split into OSPF areas. An OSPF area configuration is pictured in Figure 6. Router RT4's routing table will be described for this area configuration. Router RT4 has a connection to Area 1 and a backbone connection. This causes Router RT4 to view the AS as the concatenation of the two graphs shown in Figures 7 and 8. The resulting routing table is displayed in Table 13.
考虑前面的例子,这次分割成OSPF区域。OSPF区域配置如图6所示。路由器RT4的路由表将针对该区域配置进行描述。路由器RT4具有到区域1的连接和主干连接。这使得路由器RT4将AS视为图7和图8所示两个图的串联。生成的路由表如表13所示。
Again, Routers RT5 and RT7 are AS boundary routers. Routers RT3, RT4, RT7, RT10 and RT11 are area border routers. Note that there are two routing entries for the area border router RT3, since it has two areas in common with RT4 (Area 1 and the backbone).
同样,路由器RT5和RT7作为边界路由器。路由器RT3、RT4、RT7、RT10和RT11是区域边界路由器。请注意,区域边界路由器RT3有两个路由条目,因为它有两个与RT4相同的区域(区域1和主干)。
Backbone paths have been calculated to all area border routers. These are used when determining the inter-area routes. Note that all of the inter-area routes are associated with the backbone; this is always the case when the calculating router is itself an area border router. Routing information is condensed at area boundaries. In this example, we assume that Area 3 has been defined so that networks N9-N11 and the host route to H1
主干路径已计算到所有区域边界路由器。在确定区域间路由时使用这些路由。请注意,所有区域间路由都与主干相关联;当计算路由器本身是一个区域边界路由器时,总是这样。路由信息在区域边界处压缩。在本例中,我们假设已定义区域3,以便网络N9-N11和主机路由到H1
Type Dest Area Path Type Cost Next Adv. Hop(s) Router(s) ____________________________________________________________ N N1 0 intra-area 10 RT3 * N N2 0 intra-area 10 RT3 * N N3 0 intra-area 7 RT3 * N N4 0 intra-area 8 RT3 * N Ib 0 intra-area 7 * * N Ia 0 intra-area 12 RT10 * N N6 0 intra-area 8 RT10 * N N7 0 intra-area 12 RT10 * N N8 0 intra-area 10 RT10 * N N9 0 intra-area 11 RT10 * N N10 0 intra-area 13 RT10 * N N11 0 intra-area 14 RT10 * N H1 0 intra-area 21 RT10 * R RT5 0 intra-area 6 RT5 * R RT7 0 intra-area 8 RT10 * ____________________________________________________________ N N12 * type 1 ext. 10 RT10 RT7 N N13 * type 1 ext. 14 RT5 RT5 N N14 * type 1 ext. 14 RT5 RT5 N N15 * type 1 ext. 17 RT10 RT7
Type Dest Area Path Type Cost Next Adv. Hop(s) Router(s) ____________________________________________________________ N N1 0 intra-area 10 RT3 * N N2 0 intra-area 10 RT3 * N N3 0 intra-area 7 RT3 * N N4 0 intra-area 8 RT3 * N Ib 0 intra-area 7 * * N Ia 0 intra-area 12 RT10 * N N6 0 intra-area 8 RT10 * N N7 0 intra-area 12 RT10 * N N8 0 intra-area 10 RT10 * N N9 0 intra-area 11 RT10 * N N10 0 intra-area 13 RT10 * N N11 0 intra-area 14 RT10 * N H1 0 intra-area 21 RT10 * R RT5 0 intra-area 6 RT5 * R RT7 0 intra-area 8 RT10 * ____________________________________________________________ N N12 * type 1 ext. 10 RT10 RT7 N N13 * type 1 ext. 14 RT5 RT5 N N14 * type 1 ext. 14 RT5 RT5 N N15 * type 1 ext. 17 RT10 RT7
Table 12: The routing table for Router RT6 (no configured areas).
表12:路由器RT6的路由表(无配置区域)。
are all condensed to a single route when advertised into the backbone (by Router RT11). Note that the cost of this route is the maximum of the set of costs to its individual components.
当通过路由器RT11播发到主干网时,所有路由都压缩为一条路由。请注意,此路线的成本是其各个组件的成本集合的最大值。
There is a virtual link configured between Routers RT10 and RT11. Without this configured virtual link, RT11 would be unable to advertise a route for networks N9-N11 and Host H1 into the backbone, and there would not be an entry for these networks in Router RT4's routing table.
在路由器RT10和RT11之间配置了一个虚拟链路。如果没有此配置的虚拟链路,RT11将无法将网络N9-N11和主机H1的路由播发到主干网中,并且在路由器RT4的路由表中不会有这些网络的条目。
In this example there are two equal-cost paths to Network N12. However, they both use the same next hop (Router RT5).
在本例中,有两条到网络N12的成本相等的路径。然而,它们都使用相同的下一跳(路由器RT5)。
Router RT4's routing table would improve (i.e., some of the paths in the routing table would become shorter) if an additional virtual link were configured between Router RT4 and Router RT3. The new virtual link would itself be associated with the first entry for area border router RT3 in Table 13 (an intra-area path through Area 1). This would yield a cost of 1 for the virtual link. The routing table entries changes that would be caused by the addition of this virtual link are shown
如果在路由器RT4和路由器RT3之间配置额外的虚拟链路,则路由器RT4的路由表将得到改进(即,路由表中的一些路径将变得更短)。新的虚拟链路本身将与表13中区域边界路由器RT3的第一个条目相关联(通过区域1的区域内路径)。这将为虚拟链路产生1的成本。显示了添加此虚拟链接可能导致的路由表条目更改
Type Dest Area Path Type Cost Next Adv. Hops(s) Router(s) __________________________________________________________________ N N1 1 intra-area 4 RT1 * N N2 1 intra-area 4 RT2 * N N3 1 intra-area 1 * * N N4 1 intra-area 3 RT3 * R RT3 1 intra-area 1 * * __________________________________________________________________ N Ib 0 intra-area 22 RT5 * N Ia 0 intra-area 27 RT5 * R RT3 0 intra-area 21 RT5 * R RT5 0 intra-area 8 * * R RT7 0 intra-area 14 RT5 * R RT10 0 intra-area 22 RT5 * R RT11 0 intra-area 25 RT5 * __________________________________________________________________ N N6 0 inter-area 15 RT5 RT7 N N7 0 inter-area 19 RT5 RT7 N N8 0 inter-area 18 RT5 RT7 N N9-N11,H1 0 inter-area 36 RT5 RT11 __________________________________________________________________ N N12 * type 1 ext. 16 RT5 RT5,RT7 N N13 * type 1 ext. 16 RT5 RT5 N N14 * type 1 ext. 16 RT5 RT5 N N15 * type 1 ext. 23 RT5 RT7
Type Dest Area Path Type Cost Next Adv. Hops(s) Router(s) __________________________________________________________________ N N1 1 intra-area 4 RT1 * N N2 1 intra-area 4 RT2 * N N3 1 intra-area 1 * * N N4 1 intra-area 3 RT3 * R RT3 1 intra-area 1 * * __________________________________________________________________ N Ib 0 intra-area 22 RT5 * N Ia 0 intra-area 27 RT5 * R RT3 0 intra-area 21 RT5 * R RT5 0 intra-area 8 * * R RT7 0 intra-area 14 RT5 * R RT10 0 intra-area 22 RT5 * R RT11 0 intra-area 25 RT5 * __________________________________________________________________ N N6 0 inter-area 15 RT5 RT7 N N7 0 inter-area 19 RT5 RT7 N N8 0 inter-area 18 RT5 RT7 N N9-N11,H1 0 inter-area 36 RT5 RT11 __________________________________________________________________ N N12 * type 1 ext. 16 RT5 RT5,RT7 N N13 * type 1 ext. 16 RT5 RT5 N N14 * type 1 ext. 16 RT5 RT5 N N15 * type 1 ext. 23 RT5 RT7
Table 13: Router RT4's routing table in the presence of areas.
表13:存在区域时路由器RT4的路由表。
in Table 14.
表14。
Each router in the Autonomous System originates one or more link state advertisements (LSAs). This memo defines five distinct types of LSAs, which are described in Section 4.3. The collection of LSAs forms the link-state database. Each separate type of LSA has a separate function. Router-LSAs and network-LSAs describe how an area's routers and networks are interconnected. Summary-LSAs provide a way of condensing an area's routing information. AS-external-LSAs provide a way of transparently advertising externally-derived routing information throughout the Autonomous System.
自治系统中的每个路由器发起一个或多个链路状态公告(lsa)。本备忘录定义了五种不同类型的LSA,详见第4.3节。LSA的集合构成链接状态数据库。每种单独类型的LSA都有单独的功能。路由器LSA和网络LSA描述了一个区域的路由器和网络是如何相互连接的。摘要LSA提供了一种压缩区域路由信息的方法。因为外部lsa提供了一种在整个自治系统中透明地宣传外部导出的路由信息的方法。
Each LSA begins with a standard 20-byte header. This LSA header is discussed below.
每个LSA都以一个标准的20字节头开始。下面将讨论此LSA标头。
Type Dest Area Path Type Cost Next Adv. Hop(s) Router(s) ________________________________________________________________ N Ib 0 intra-area 16 RT3 * N Ia 0 intra-area 21 RT3 * R RT3 0 intra-area 1 * * R RT10 0 intra-area 16 RT3 * R RT11 0 intra-area 19 RT3 * ________________________________________________________________ N N9-N11,H1 0 inter-area 30 RT3 RT11
Type Dest Area Path Type Cost Next Adv. Hop(s) Router(s) ________________________________________________________________ N Ib 0 intra-area 16 RT3 * N Ia 0 intra-area 21 RT3 * R RT3 0 intra-area 1 * * R RT10 0 intra-area 16 RT3 * R RT11 0 intra-area 19 RT3 * ________________________________________________________________ N N9-N11,H1 0 inter-area 30 RT3 RT11
Table 14: Changes resulting from an additional virtual link.
表14:附加虚拟链接导致的更改。
12.1. The LSA Header
12.1. LSA报头
The LSA header contains the LS type, Link State ID and Advertising Router fields. The combination of these three fields uniquely identifies the LSA.
LSA标头包含LS类型、链路状态ID和播发路由器字段。这三个字段的组合唯一标识LSA。
There may be several instances of an LSA present in the Autonomous System, all at the same time. It must then be determined which instance is more recent. This determination is made by examining the LS sequence, LS checksum and LS age fields. These fields are also contained in the 20-byte LSA header.
自治系统中可能同时存在多个LSA实例。然后必须确定哪个实例是最近的。通过检查LS序列、LS校验和和和LS年龄字段来确定。这些字段也包含在20字节LSA头中。
Several of the OSPF packet types list LSAs. When the instance is not important, an LSA is referred to by its LS type, Link State ID and Advertising Router (see Link State Request Packets). Otherwise, the LS sequence number, LS age and LS checksum fields must also be referenced.
一些OSPF数据包类型列出了LSA。当实例不重要时,LSA通过其LS类型、链路状态ID和广告路由器(请参阅链路状态请求数据包)来引用。否则,还必须引用LS序列号、LS年龄和LS校验和字段。
A detailed explanation of the fields contained in the LSA header follows.
下面详细解释LSA标题中包含的字段。
12.1.1. LS age
12.1.1. 老化时间
This field is the age of the LSA in seconds. It should be processed as an unsigned 16-bit integer. It is set to 0 when the LSA is originated. It must be incremented by InfTransDelay on every hop of the flooding procedure. LSAs are also aged as they are held in each router's database.
此字段是LSA的使用时间(以秒为单位)。应将其处理为无符号16位整数。当启动LSA时,它被设置为0。它必须在泛洪过程的每个跃点上增加InfTransDelay。LSA也会老化,因为它们保存在每个路由器的数据库中。
The age of an LSA is never incremented past MaxAge. LSAs having age MaxAge are not used in the routing table calculation. When an LSA's age first reaches MaxAge, it is reflooded. An LSA of age MaxAge is finally flushed from the database when it is no longer needed to ensure database synchronization. For more information on the aging of LSAs, consult Section 14.
LSA的年龄不会增加到超过最大年龄。路由表计算中不使用年龄最大的LSA。当LSA的年龄首次达到最大年龄时,它会重新上浮。当不再需要确保数据库同步时,最后从数据库中刷新一个年龄为MaxAge的LSA。有关LSA老化的更多信息,请参阅第14节。
The LS age field is examined when a router receives two instances of an LSA, both having identical LS sequence numbers and LS checksums. An instance of age MaxAge is then
当路由器接收到两个具有相同LS序列号和LS校验和的LSA实例时,将检查LS age字段。此时将显示age MaxAge的一个实例
always accepted as most recent; this allows old LSAs to be flushed quickly from the routing domain. Otherwise, if the ages differ by more than MaxAgeDiff, the instance having the smaller age is accepted as most recent.[12] See Section 13.1 for more details.
总是被认为是最近的;这允许从路由域快速刷新旧LSA。否则,如果年龄差异大于MaxAgeDiff,则年龄较小的实例被视为最新实例。[12]有关详细信息,请参阅第13.1节。
12.1.2. Options
12.1.2. 选择权
The Options field in the LSA header indicates which optional capabilities are associated with the LSA. OSPF's optional capabilities are described in Section 4.5. One optional capability is defined by this specification, represented by the E-bit found in the Options field. The unrecognized bits in the Options field should be set to zero.
LSA标头中的选项字段指示与LSA关联的可选功能。第4.5节描述了OSPF的可选功能。本规范定义了一个可选功能,由选项字段中的E位表示。选项字段中未识别的位应设置为零。
The E-bit represents OSPF's ExternalRoutingCapability. This bit should be set in all LSAs associated with the backbone, and all LSAs associated with non-stub areas (see Section 3.6). It should also be set in all AS-external-LSAs. It should be reset in all router-LSAs, network-LSAs and summary-LSAs associated with a stub area. For all LSAs, the setting of the E-bit is for informational purposes only; it does not affect the routing table calculation.
E位表示OSPF的外部路由功能。该位应设置在与主干相关的所有LSA中,以及与非存根区域相关的所有LSA中(见第3.6节)。它还应设置为所有外部LSA。它应该在与存根区域相关联的所有路由器LSA、网络LSA和摘要LSA中重置。对于所有LSA,E位的设置仅供参考;它不会影响路由表的计算。
12.1.3. LS type
12.1.3. 状态类型
The LS type field dictates the format and function of the LSA. LSAs of different types have different names (e.g., router-LSAs or network-LSAs). All LSA types defined by this memo, except the AS-external-LSAs (LS type = 5), are flooded throughout a single area only. AS-external-LSAs are flooded throughout the entire Autonomous System, excepting stub areas (see Section 3.6). Each separate LSA type is briefly described below in Table 15.
LS type字段指示LSA的格式和功能。不同类型的LSA具有不同的名称(例如,路由器LSA或网络LSA)。本备忘录定义的所有LSA类型(AS外部LSA(LS类型=5)除外)仅在单个区域内淹没。由于外部LSA被淹没在整个自治系统中,存根区域除外(见第3.6节)。下表15简要描述了每种单独的LSA类型。
12.1.4. Link State ID
12.1.4. 链路状态ID
This field identifies the piece of the routing domain that is being described by the LSA. Depending on the LSA's LS type, the Link State ID takes on the values listed in Table
此字段标识LSA正在描述的路由域片段。根据LSA的LS类型,链路状态ID采用表中列出的值
LS Type LSA description ________________________________________________ 1 These are the router-LSAs. They describe the collected states of the router's interfaces. For more information, consult Section 12.4.1. ________________________________________________ 2 These are the network-LSAs. They describe the set of routers attached to the network. For more information, consult Section 12.4.2. ________________________________________________ 3 or 4 These are the summary-LSAs. They describe inter-area routes, and enable the condensation of routing information at area borders. Originated by area border routers, the Type 3 summary-LSAs describe routes to networks while the Type 4 summary-LSAs describe routes to AS boundary routers. ________________________________________________ 5 These are the AS-external-LSAs. Originated by AS boundary routers, they describe routes to destinations external to the Autonomous System. A default route for the Autonomous System can also be described by an AS-external-LSA.
LS Type LSA description ________________________________________________ 1 These are the router-LSAs. They describe the collected states of the router's interfaces. For more information, consult Section 12.4.1. ________________________________________________ 2 These are the network-LSAs. They describe the set of routers attached to the network. For more information, consult Section 12.4.2. ________________________________________________ 3 or 4 These are the summary-LSAs. They describe inter-area routes, and enable the condensation of routing information at area borders. Originated by area border routers, the Type 3 summary-LSAs describe routes to networks while the Type 4 summary-LSAs describe routes to AS boundary routers. ________________________________________________ 5 These are the AS-external-LSAs. Originated by AS boundary routers, they describe routes to destinations external to the Autonomous System. A default route for the Autonomous System can also be described by an AS-external-LSA.
Table 15: OSPF link state advertisements (LSAs).
表15:OSPF链路状态播发(LSA)。
16.
16
Actually, for Type 3 summary-LSAs (LS type = 3) and AS-external-LSAs (LS type = 5), the Link State ID may
实际上,对于类型3摘要LSA(LS类型=3)和外部LSA(LS类型=5),链路状态ID可能
LS Type Link State ID _______________________________________________ 1 The originating router's Router ID. 2 The IP interface address of the network's Designated Router. 3 The destination network's IP address. 4 The Router ID of the described AS boundary router. 5 The destination network's IP address.
LS Type Link State ID _______________________________________________ 1 The originating router's Router ID. 2 The IP interface address of the network's Designated Router. 3 The destination network's IP address. 4 The Router ID of the described AS boundary router. 5 The destination network's IP address.
Table 16: The LSA's Link State ID.
表16:LSA的链路状态ID。
additionally have one or more of the destination network's "host" bits set. For example, when originating an AS-external-LSA for the network 10.0.0.0 with mask of 255.0.0.0, the Link State ID can be set to anything in the range 10.0.0.0 through 10.255.255.255 inclusive (although 10.0.0.0 should be used whenever possible). The freedom to set certain host bits allows a router to originate separate LSAs for two networks having the same address but different masks. See Appendix E for details.
另外,设置一个或多个目标网络的“主机”位。例如,当为掩码为255.0.0.0的网络10.0.0.0启动AS外部LSA时,链路状态ID可以设置为10.0.0.0至10.255.255.255(包括10.0.0.0至10.255.255)范围内的任何值(尽管应尽可能使用10.0.0.0)。自由设置某些主机位允许路由器为具有相同地址但不同掩码的两个网络发起单独的LSA。详情见附录E。
When the LSA is describing a network (LS type = 2, 3 or 5), the network's IP address is easily derived by masking the Link State ID with the network/subnet mask contained in the body of the LSA. When the LSA is describing a router (LS type = 1 or 4), the Link State ID is always the described router's OSPF Router ID.
当LSA描述网络时(LS type=2、3或5),通过使用LSA主体中包含的网络/子网掩码屏蔽链路状态ID,可以很容易地导出网络的IP地址。当LSA描述路由器(LS type=1或4)时,链路状态ID始终是所描述路由器的OSPF路由器ID。
When an AS-external-LSA (LS Type = 5) is describing a default route, its Link State ID is set to DefaultDestination (0.0.0.0).
当AS外部LSA(LS Type=5)描述默认路由时,其链路状态ID设置为DefaultDestination(0.0.0.0)。
12.1.5. Advertising Router
12.1.5. 公告路由器
This field specifies the OSPF Router ID of the LSA's originator. For router-LSAs, this field is identical to the Link State ID field. Network-LSAs are originated by the
此字段指定LSA发起人的OSPF路由器ID。对于路由器LSA,此字段与链路状态ID字段相同。网络LSA由
network's Designated Router. Summary-LSAs originated by area border routers. AS-external-LSAs are originated by AS boundary routers.
网络的指定路由器。由区域边界路由器发起的LSA摘要。AS外部LSA由AS边界路由器发起。
12.1.6. LS sequence number
12.1.6. 序列号
The sequence number field is a signed 32-bit integer. It is used to detect old and duplicate LSAs. The space of sequence numbers is linearly ordered. The larger the sequence number (when compared as signed 32-bit integers) the more recent the LSA. To describe to sequence number space more precisely, let N refer in the discussion below to the constant 2**31.
序列号字段是有符号32位整数。它用于检测旧的和重复的LSA。序列号的空间是线性有序的。序列号越大(与有符号32位整数相比),LSA越近。为了更精确地描述序列号空间,让N在下面的讨论中参考常数2**31。
The sequence number -N (0x80000000) is reserved (and unused). This leaves -N + 1 (0x80000001) as the smallest (and therefore oldest) sequence number; this sequence number is referred to as the constant InitialSequenceNumber. A router uses InitialSequenceNumber the first time it originates any LSA. Afterwards, the LSA's sequence number is incremented each time the router originates a new instance of the LSA. When an attempt is made to increment the sequence number past the maximum value of N - 1 (0x7fffffff; also referred to as MaxSequenceNumber), the current instance of the LSA must first be flushed from the routing domain. This is done by prematurely aging the LSA (see Section 14.1) and reflooding it. As soon as this flood has been acknowledged by all adjacent neighbors, a new instance can be originated with sequence number of InitialSequenceNumber.
序列号-N(0x8000000)为保留(未使用)。这使得-N+1(0x8000001)成为最小的(因此也是最早的)序列号;此序列号称为常量InitialSequenceNumber。路由器在第一次发起任何LSA时使用InitialSequenceNumber。之后,每次路由器启动LSA的新实例时,LSA的序列号都会增加。当试图将序列号增加到超过最大值N-1(0x7fffffff;也称为MaxSequenceNumber)时,必须首先从路由域刷新LSA的当前实例。这是通过提前老化LSA(见第14.1节)并对其进行再焊来实现的。一旦所有相邻邻居都确认了该洪水,就可以使用InitialSequenceNumber的序列号创建一个新实例。
The router may be forced to promote the sequence number of one of its LSAs when a more recent instance of the LSA is unexpectedly received during the flooding process. This should be a rare event. This may indicate that an out-of-date LSA, originated by the router itself before its last restart/reload, still exists in the Autonomous System. For more information see Section 13.4.
当在泛洪处理期间意外地接收到LSA的较新实例时,路由器可能被迫提升其LSA之一的序列号。这应该是一个罕见的事件。这可能表明在最后一次重新启动/重新加载之前由路由器自身发起的过期LSA仍然存在于自治系统中。有关更多信息,请参见第13.4节。
12.1.7. LS checksum
12.1.7. LS校验和
This field is the checksum of the complete contents of the LSA, excepting the LS age field. The LS age field is excepted so that an LSA's age can be incremented without updating the checksum. The checksum used is the same that is used for ISO connectionless datagrams; it is commonly referred to as the Fletcher checksum. It is documented in Annex B of [Ref6]. The LSA header also contains the length of the LSA in bytes; subtracting the size of the LS age field (two bytes) yields the amount of data to checksum.
此字段是LSA完整内容的校验和,LS age字段除外。LS age字段除外,因此LSA的age可以在不更新校验和的情况下递增。使用的校验和与ISO无连接数据报相同;它通常被称为弗莱彻校验和。其记录在[参考文献6]的附录B中。LSA头还包含LSA的长度(字节);减去LS age字段的大小(两个字节)得到要校验和的数据量。
The checksum is used to detect data corruption of an LSA. This corruption can occur while an LSA is being flooded, or while it is being held in a router's memory. The LS checksum field cannot take on the value of zero; the occurrence of such a value should be considered a checksum failure. In other words, calculation of the checksum is not optional.
校验和用于检测LSA的数据损坏。这种损坏可能发生在LSA被淹没时,或者在它被保存在路由器内存中时。LS校验和字段的值不能为零;出现此类值应视为校验和故障。换句话说,校验和的计算不是可选的。
The checksum of an LSA is verified in two cases: a) when it is received in a Link State Update Packet and b) at times during the aging of the link state database. The detection of a checksum failure leads to separate actions in each case. See Sections 13 and 14 for more details.
LSA的校验和在两种情况下进行验证:a)在链路状态更新数据包中接收LSA时,以及b)在链路状态数据库老化期间进行验证。在每种情况下,检测校验和故障会导致单独的操作。详见第13节和第14节。
Whenever the LS sequence number field indicates that two instances of an LSA are the same, the LS checksum field is examined. If there is a difference, the instance with the larger LS checksum is considered to be most recent.[13] See Section 13.1 for more details.
只要LS序列号字段指示LSA的两个实例相同,就会检查LS校验和字段。如果存在差异,则LS校验和较大的实例被视为是最新的。[13]有关更多详细信息,请参阅第13.1节。
12.2. The link state database
12.2. 链接状态数据库
A router has a separate link state database for every area to which it belongs. All routers belonging to the same area have identical link state databases for the area.
路由器所属的每个区域都有一个单独的链路状态数据库。属于同一区域的所有路由器都具有该区域的相同链路状态数据库。
The databases for each individual area are always dealt with separately. The shortest path calculation is performed separately for each area (see Section 16). Components of the
每个单独区域的数据库始终单独处理。对每个区域分别进行最短路径计算(见第16节)。组成部分
area link-state database are flooded throughout the area only. Finally, when an adjacency (belonging to Area A) is being brought up, only the database for Area A is synchronized between the two routers.
区域链接状态数据库仅覆盖整个区域。最后,当一个邻接(属于区域A)被提出时,只有区域A的数据库在两个路由器之间同步。
The area database is composed of router-LSAs, network-LSAs and summary-LSAs (all listed in the area data structure). In addition, external routes (AS-external-LSAs) are included in all non-stub area databases (see Section 3.6).
区域数据库由路由器LSA、网络LSA和摘要LSA组成(均列在区域数据结构中)。此外,外部路由(作为外部LSA)包含在所有非存根区域数据库中(见第3.6节)。
An implementation of OSPF must be able to access individual pieces of an area database. This lookup function is based on an LSA's LS type, Link State ID and Advertising Router.[14] There will be a single instance (the most up-to-date) of each LSA in the database. The database lookup function is invoked during the LSA flooding procedure (Section 13) and the routing table calculation (Section 16). In addition, using this lookup function the router can determine whether it has itself ever originated a particular LSA, and if so, with what LS sequence number.
OSPF的实现必须能够访问区域数据库的各个部分。此查找功能基于LSA的LS类型、链路状态ID和广告路由器。[14]数据库中每个LSA都有一个实例(最新)。在LSA泛洪过程(第13节)和路由表计算(第16节)期间调用数据库查找功能。此外,使用此查找功能,路由器可以确定自己是否发起过特定的LSA,如果是,则使用什么样的LS序列号。
An LSA is added to a router's database when either a) it is received during the flooding process (Section 13) or b) it is originated by the router itself (Section 12.4). An LSA is deleted from a router's database when either a) it has been overwritten by a newer instance during the flooding process (Section 13) or b) the router originates a newer instance of one of its self-originated LSAs (Section 12.4) or c) the LSA ages out and is flushed from the routing domain (Section 14). Whenever an LSA is deleted from the database it must also be removed from all neighbors' Link state retransmission lists (see Section 10).
当a)在泛洪过程中接收到LSA(第13节)或b)由路由器本身发起(第12.4节)时,LSA被添加到路由器的数据库中。当a)LSA在泛洪过程中被较新的实例覆盖(第13节)或b)路由器启动其自创LSA之一的较新实例(第12.4节)或c)LSA过期并从路由域刷新(第14节)时,LSA将从路由器数据库中删除。无论何时从数据库中删除LSA,都必须将其从所有邻居的链路状态重传列表中删除(参见第10节)。
12.3. Representation of TOS
12.3. TOS的表示
For backward compatibility with previous versions of the OSPF specification ([Ref9]), TOS-specific information can be included in router-LSAs, summary-LSAs and AS-external-LSAs. The encoding of TOS in OSPF LSAs is specified in Table 17. That table relates the OSPF encoding to the IP packet header's TOS field (defined in [Ref12]). The OSPF encoding is expressed as a decimal
为了与以前版本的OSPF规范([Ref9])向后兼容,TOS特定信息可以包含在路由器LSA、摘要LSA和外部LSA中。表17规定了OSPF LSA中TOS的编码。该表将OSPF编码与IP数据包头的TOS字段(定义见[Ref12])相关联。OSPF编码表示为十进制
integer, and the IP packet header's TOS field is expressed in the binary TOS values used in [Ref12].
整数,IP数据包头的TOS字段用[Ref12]中使用的二进制TOS值表示。
OSPF encoding RFC 1349 TOS values ___________________________________________ 0 0000 normal service 2 0001 minimize monetary cost 4 0010 maximize reliability 6 0011 8 0100 maximize throughput 10 0101 12 0110 14 0111 16 1000 minimize delay 18 1001 20 1010 22 1011 24 1100 26 1101 28 1110 30 1111
OSPF encoding RFC 1349 TOS values ___________________________________________ 0 0000 normal service 2 0001 minimize monetary cost 4 0010 maximize reliability 6 0011 8 0100 maximize throughput 10 0101 12 0110 14 0111 16 1000 minimize delay 18 1001 20 1010 22 1011 24 1100 26 1101 28 1110 30 1111
Table 17: Representing TOS in OSPF.
表17:在OSPF中表示TOS。
12.4. Originating LSAs
12.4. 始发LSA
Into any given OSPF area, a router will originate several LSAs. Each router originates a router-LSA. If the router is also the Designated Router for any of the area's networks, it will originate network-LSAs for those networks.
在任何给定的OSPF区域中,路由器将发起多个LSA。每个路由器产生一个路由器LSA。如果路由器也是该区域任何网络的指定路由器,它将为这些网络发起网络LSA。
Area border routers originate a single summary-LSA for each known inter-area destination. AS boundary routers originate a single AS-external-LSA for each known AS external destination. Destinations are advertised one at a time so that the change in any single route can be flooded without reflooding the entire collection of routes. During the flooding procedure, many LSAs can be carried by a single Link State Update packet.
区域边界路由器为每个已知的区域间目的地生成一个汇总LSA。AS边界路由器为每个称为外部目的地的AS外部LSA发起单个AS。目的地一次发布一个广告,这样任何一条路线的变化都可以被淹没,而不会使整个路线集合重新上浮。在泛洪过程中,单个链路状态更新包可以携带许多LSA。
As an example, consider Router RT4 in Figure 6. It is an area border router, having a connection to Area 1 and the backbone. Router RT4 originates 5 distinct LSAs into the backbone (one router-LSA, and one summary-LSA for each of the networks N1-N4). Router RT4 will also originate 8 distinct LSAs into Area 1 (one router-LSA and seven summary-LSAs as pictured in Figure 7). If RT4 has been selected as Designated Router for Network N3, it will also originate a network-LSA for N3 into Area 1.
作为一个例子,考虑图6中的路由器RT4。它是一个区域边界路由器,连接到区域1和主干网。路由器RT4在主干网中发起5个不同的LSA(一个路由器LSA,每个网络N1-N4一个汇总LSA)。路由器RT4还将向区域1发起8个不同的LSA(一个路由器LSA和七个汇总LSA,如图7所示)。如果已选择RT4作为网络N3的指定路由器,则它还将在区域1中为N3发起网络LSA。
In this same figure, Router RT5 will be originating 3 distinct AS-external-LSAs (one for each of the networks N12-N14). These will be flooded throughout the entire AS, assuming that none of the areas have been configured as stubs. However, if area 3 has been configured as a stub area, the AS-external-LSAs for networks N12-N14 will not be flooded into area 3 (see Section 3.6). Instead, Router RT11 would originate a default summary-LSA that would be flooded throughout area 3 (see Section 12.4.3). This instructs all of area 3's internal routers to send their AS external traffic to RT11.
在同一图中,路由器RT5将作为外部LSA(网络N12-N14各一个)发起3个不同的LSA。假设未将任何区域配置为存根,则这些区域将在整个AS中被淹没。但是,如果已将区域3配置为存根区域,则网络N12-N14的as外部LSA将不会淹没到区域3中(参见第3.6节)。相反,路由器RT11将产生一个默认的汇总LSA,该LSA将淹没整个区域3(见第12.4.3节)。这指示所有区域3的内部路由器将其作为外部流量发送到RT11。
Whenever a new instance of an LSA is originated, its LS sequence number is incremented, its LS age is set to 0, its LS checksum is calculated, and the LSA is added to the link state database and flooded out the appropriate interfaces. See Section 13.2 for details concerning the installation of the LSA into the link state database. See Section 13.3 for details concerning the flooding of newly originated LSAs.
每当一个LSA的新实例被创建时,它的LS序列号就会增加,它的LS age设置为0,它的LS校验和就会被计算出来,LSA会被添加到链路状态数据库中,并被相应的接口淹没。有关将LSA安装到链路状态数据库的详细信息,请参见第13.2节。参见第13.3节,了解有关新产生的LSA洪水的详细信息。
The ten events that can cause a new instance of an LSA to be originated are:
可能导致LSA新实例产生的十个事件是:
(1) The LS age field of one of the router's self-originated LSAs reaches the value LSRefreshTime. In this case, a new instance of the LSA is originated, even though the contents of the LSA (apart from the LSA header) will be the same. This guarantees periodic originations of all LSAs. This periodic updating of LSAs adds robustness to the link state algorithm. LSAs that solely describe unreachable destinations should not be refreshed, but should instead be flushed from the routing domain (see Section 14.1).
(1) 路由器自创LSA之一的LS age字段达到值LSRefreshTime。在这种情况下,即使LSA的内容(除了LSA头)相同,也会生成LSA的新实例。这保证了所有LSA的定期发起。LSA的这种周期性更新增加了链路状态算法的鲁棒性。仅描述不可到达目的地的LSA不应刷新,而应从路由域中刷新(参见第14.1节)。
When whatever is being described by an LSA changes, a new LSA is originated. However, two instances of the same LSA may not be originated within the time period MinLSInterval. This may require that the generation of the next instance be delayed by up to MinLSInterval. The following events may cause the contents of an LSA to change. These events should cause new originations if and only if the contents of the new LSA would be different:
当LSA描述的内容发生变化时,就会产生新的LSA。但是,同一LSA的两个实例可能不会在MinLSInterval时间段内发起。这可能需要将下一个实例的生成延迟至多MinLSInterval。以下事件可能会导致LSA的内容发生更改。当且仅当新LSA的内容不同时,这些事件才会导致新的起源:
(2) An interface's state changes (see Section 9.1). This may mean that it is necessary to produce a new instance of the router-LSA.
(2) 接口的状态发生变化(见第9.1节)。这可能意味着需要生成路由器LSA的新实例。
(3) An attached network's Designated Router changes. A new router-LSA should be originated. Also, if the router itself is now the Designated Router, a new network-LSA should be produced. If the router itself is no longer the Designated Router, any network-LSA that it might have originated for the network should be flushed from the routing domain (see Section 14.1).
(3) 连接网络的指定路由器发生变化。应创建一个新的路由器LSA。此外,如果路由器本身现在是指定的路由器,则应生成新的网络LSA。如果路由器本身不再是指定的路由器,则应该从路由域中清除它可能为网络发起的任何网络LSA(参见第14.1节)。
(4) One of the neighboring routers changes to/from the FULL state. This may mean that it is necessary to produce a new instance of the router-LSA. Also, if the router is itself the Designated Router for the attached network, a new network-LSA should be produced.
(4) 其中一个相邻路由器更改为/从完全状态更改为完全状态。这可能意味着需要生成路由器LSA的新实例。此外,如果路由器本身是连接网络的指定路由器,则应生成新的网络LSA。
The next four events concern area border routers only:
接下来的四个事件仅涉及区域边界路由器:
(5) An intra-area route has been added/deleted/modified in the routing table. This may cause a new instance of a summary-LSA (for this route) to be originated in each attached area (possibly including the backbone).
(5) 已在路由表中添加/删除/修改区域内路由。这可能会导致在每个连接区域(可能包括主干网)中产生汇总LSA(用于该路由)的新实例。
(6) An inter-area route has been added/deleted/modified in the routing table. This may cause a new instance of a summary-LSA (for this route) to be originated in each attached area (but NEVER for the backbone).
(6) 已在路由表中添加/删除/修改区域间路由。这可能会导致摘要LSA的新实例(用于此路由)在每个连接区域中产生(但不会用于主干网)。
(7) The router becomes newly attached to an area. The router must then originate summary-LSAs into the newly attached area for all pertinent intra-area and inter-area routes in the router's routing table. See Section 12.4.3 for more details.
(7) 路由器新连接到某个区域。然后,路由器必须为路由器路由表中的所有相关区域内和区域间路由向新连接的区域发起摘要LSA。详见第12.4.3节。
(8) When the state of one of the router's configured virtual links changes, it may be necessary to originate a new router-LSA into the virtual link's Transit area (see the discussion of the router-LSA's bit V in Section 12.4.1), as well as originating a new router-LSA into the backbone.
(8) 当一个路由器配置的虚拟链路的状态发生变化时,可能需要在虚拟链路的传输区域中发起一个新的路由器LSA(参见第12.4.1节中关于路由器LSA位V的讨论),以及在主干中发起一个新的路由器LSA。
The last two events concern AS boundary routers (and former AS boundary routers) only:
最后两个事件仅涉及边界路由器(前者为边界路由器):
(9) An external route gained through direct experience with an external routing protocol (like BGP) changes. This will cause an AS boundary router to originate a new instance of an AS-external-LSA.
(9) 通过直接体验外部路由协议(如BGP)变化而获得的外部路由。这将导致AS边界路由器创建AS外部LSA的新实例。
(10) A router ceases to be an AS boundary router, perhaps after restarting. In this situation the router should flush all AS-external-LSAs that it had previously originated. These LSAs can be flushed via the premature aging procedure specified in Section 14.1.
(10) 路由器可能在重新启动后不再作为边界路由器。在这种情况下,路由器应将所有数据作为其先前发起的外部LSA进行刷新。这些LSA可通过第14.1节规定的过早老化程序进行冲洗。
The construction of each type of LSA is explained in detail below. In general, these sections describe the contents of the LSA body (i.e., the part coming after the 20-byte LSA header). For information concerning the building of the LSA header, see Section 12.1.
下面详细说明每种LSA的构造。通常,这些部分描述LSA正文的内容(即,位于20字节LSA头之后的部分)。有关LSA收割台构建的信息,请参见第12.1节。
12.4.1. Router-LSAs
12.4.1. 路由器LSA
A router originates a router-LSA for each area that it belongs to. Such an LSA describes the collected states of the router's links to the area. The LSA is flooded throughout the particular area, and no further.
路由器为其所属的每个区域生成一个路由器LSA。这样的LSA描述路由器到该区域的链路的收集状态。LSA被淹没在整个特定区域,不再继续。
.................................... . 192.1.2 Area 1 . . + . . | . . | 3+---+1 . . N1 |--|RT1|-----+ . . | +---+ \ . . | \ _______N3 . . + \/ \ . 1+---+ . * 192.1.1 *------|RT4| . + /\_______/ . +---+ . | / | . . | 3+---+1 / | . . N2 |--|RT2|-----+ 1| . . | +---+ +---+8 . 6+---+ . | |RT3|----------------|RT6| . + +---+ . +---+ . 192.1.3 |2 . 18.10.0.6|7 . | . | . +------------+ . . 192.1.4 (N4) . ....................................
.................................... . 192.1.2 Area 1 . . + . . | . . | 3+---+1 . . N1 |--|RT1|-----+ . . | +---+ \ . . | \ _______N3 . . + \/ \ . 1+---+ . * 192.1.1 *------|RT4| . + /\_______/ . +---+ . | / | . . | 3+---+1 / | . . N2 |--|RT2|-----+ 1| . . | +---+ +---+8 . 6+---+ . | |RT3|----------------|RT6| . + +---+ . +---+ . 192.1.3 |2 . 18.10.0.6|7 . | . | . +------------+ . . 192.1.4 (N4) . ....................................
Figure 15: Area 1 with IP addresses shown
图15:显示IP地址的区域1
The format of a router-LSA is shown in Appendix A (Section A.4.2). The first 20 bytes of the LSA consist of the generic LSA header that was discussed in Section 12.1. router-LSAs have LS type = 1.
路由器LSA的格式见附录a(第a.4.2节)。LSA的前20个字节由第12.1节中讨论的通用LSA头组成。路由器LSA的LS类型为1。
A router also indicates whether it is an area border router, or an AS boundary router, by setting the appropriate bits (bit B and bit E, respectively) in its router-LSAs. This enables paths to those types of routers to be saved in the routing table, for later processing of summary-LSAs and AS-external-LSAs. Bit B should be set whenever the router is actively attached to two or more areas, even if the router is not currently attached to the OSPF backbone area. Bit E should never be set in a router-LSA for a stub area (stub areas cannot contain AS boundary routers).
路由器还通过在其路由器LSA中设置适当的位(分别为位B和位E),指示它是区域边界路由器还是AS边界路由器。这使得到这些类型路由器的路径能够保存在路由表中,以便以后处理摘要LSA和作为外部LSA。每当路由器主动连接到两个或多个区域时,即使路由器当前未连接到OSPF主干区域,也应设置位B。决不能在路由器LSA中为存根区域设置位E(存根区域不能包含边界路由器)。
In addition, the router sets bit V in its router-LSA for Area A if and only if the router is the endpoint of one or more fully adjacent virtual links having Area A as their Transit area. The setting of bit V enables other routers in Area A to discover whether the area supports transit traffic (see TransitCapability in Section 6).
此外,路由器在其路由器LSA中为区域A设置位V,当且仅当路由器是具有区域A作为其传输区域的一个或多个完全相邻的虚拟链路的端点时。位V的设置使区域A中的其他路由器能够发现该区域是否支持传输流量(参见第6节中的传输能力)。
The router-LSA then describes the router's working connections (i.e., interfaces or links) to the area. Each link is typed according to the kind of attached network. Each link is also labelled with its Link ID. This Link ID gives a name to the entity that is on the other end of the link. Table 18 summarizes the values used for the Type and Link ID fields.
然后,路由器LSA描述路由器与该区域的工作连接(即接口或链路)。每个链接都是根据连接的网络类型键入的。每个链接还标有其链接ID。此链接ID为链接另一端的实体提供名称。表18总结了用于类型和链接ID字段的值。
Link type Description Link ID __________________________________________________ 1 Point-to-point Neighbor Router ID link 2 Link to transit Interface address of network Designated Router 3 Link to stub IP network number network 4 Virtual link Neighbor Router ID
Link type Description Link ID __________________________________________________ 1 Point-to-point Neighbor Router ID link 2 Link to transit Interface address of network Designated Router 3 Link to stub IP network number network 4 Virtual link Neighbor Router ID
Table 18: Link descriptions in the router-LSA.
表18:路由器LSA中的链路描述。
In addition, the Link Data field is specified for each link. This field gives 32 bits of extra information for the link. For links to transit networks, numbered point-to-point links and virtual links, this field specifies the IP interface address of the associated router interface (this is needed by the routing table calculation, see Section 16.1.1). For links to stub networks, this field specifies the stub network's IP address mask. For unnumbered point-to-point links, the Link Data field should be set to the unnumbered interface's MIB-II [Ref8] ifIndex value.
此外,还为每个链路指定了链路数据字段。此字段为链接提供32位额外信息。对于到传输网络的链路、编号的点到点链路和虚拟链路,此字段指定相关路由器接口的IP接口地址(路由表计算需要此地址,请参见第16.1.1节)。对于到存根网络的链接,此字段指定存根网络的IP地址掩码。对于未编号的点到点链路,链路数据字段应设置为未编号接口的MIB-II[Ref8]iIndex值。
Finally, the cost of using the link for output is specified. The output cost of a link is configurable. With the exception of links to stub networks, the output cost must always be non-zero.
最后,指定了使用链接进行输出的成本。链路的输出成本是可配置的。除了到存根网络的链接之外,输出成本必须始终为非零。
To further describe the process of building the list of link descriptions, suppose a router wishes to build a router-LSA for Area A. The router examines its collection of interface data structures. For each interface, the following steps are taken:
为了进一步描述构建链路描述列表的过程,假设路由器希望为区域a构建路由器LSA。路由器检查其接口数据结构的集合。对于每个接口,采取以下步骤:
o If the attached network does not belong to Area A, no links are added to the LSA, and the next interface should be examined.
o 如果连接的网络不属于区域A,则不会向LSA添加任何链接,并且应检查下一个接口。
o If the state of the interface is Down, no links are added.
o 如果接口的状态为关闭,则不会添加任何链接。
o If the state of the interface is Loopback, add a Type 3 link (stub network) as long as this is not an interface to an unnumbered point-to-point network. The Link ID should be set to the IP interface address, the Link Data set to the mask 0xffffffff (indicating a host route), and the cost set to 0.
o 如果接口的状态为环回,则添加类型3链路(存根网络),只要该链路不是未编号的点对点网络的接口。链路ID应设置为IP接口地址,链路数据设置为掩码0xffffffff(表示主机路由),成本设置为0。
o Otherwise, the link descriptions added to the router-LSA depend on the OSPF interface type. Link descriptions used for point-to-point interfaces are specified in Section 12.4.1.1, for virtual links in Section 12.4.1.2, for broadcast and NBMA interfaces in 12.4.1.3, and for Point-to-MultiPoint interfaces in 12.4.1.4.
o 否则,添加到路由器LSA的链路描述取决于OSPF接口类型。第12.4.1.1节规定了用于点对点接口的链路描述,第12.4.1.2节规定了用于虚拟链路的链路描述,第12.4.1.3节规定了用于广播和NBMA接口的链路描述,第12.4.1.4节规定了用于点对多点接口的链路描述。
After consideration of all the router interfaces, host links are added to the router-LSA by examining the list of attached hosts belonging to Area A. A host route is represented as a Type 3 link (stub network) whose Link ID is the host's IP address, Link Data is the mask of all ones (0xffffffff), and cost the host's configured cost (see Section C.7).
在考虑所有路由器接口后,通过检查属于区域A的连接主机列表,将主机链路添加到路由器LSA。主机路由表示为类型3链路(存根网络),其链路ID为主机的IP地址,链路数据为所有链路的掩码(0xffffffff),并消耗主机的配置成本(见第C.7节)。
12.4.1.1. Describing point-to-point interfaces
12.4.1.1. 描述点对点接口
For point-to-point interfaces, one or more link descriptions are added to the router-LSA as follows:
对于点到点接口,一个或多个链路描述添加到路由器LSA,如下所示:
o If the neighboring router is fully adjacent, add a Type 1 link (point-to-point). The Link ID should be set to the Router ID of the neighboring router. For numbered point-to-point networks, the Link Data should specify the IP interface address. For unnumbered point-to-point networks, the Link Data field should specify the interface's MIB-II [Ref8] ifIndex value. The cost should be set to the output cost of the point-to-point interface.
o 如果相邻路由器完全相邻,则添加类型1链路(点对点)。链路ID应设置为相邻路由器的路由器ID。对于编号的点到点网络,链路数据应指定IP接口地址。对于未编号的点到点网络,链路数据字段应指定接口的MIB-II[Ref8]iIndex值。成本应设置为点到点接口的输出成本。
o In addition, as long as the state of the interface is "Point-to-Point" (and regardless of the neighboring router state), a Type 3 link (stub network) should be added. There are two forms that this stub link can take:
o 此外,只要接口的状态是“点对点”(并且不考虑相邻路由器的状态),就应该添加类型3链路(存根网络)。此存根链接可以采取两种形式:
Option 1 Assuming that the neighboring router's IP address is known, set the Link ID of the Type 3 link to the neighbor's IP address, the Link Data to the mask 0xffffffff (indicating a host route), and the cost to the interface's configured output cost.[15]
选项1假设邻居路由器的IP地址已知,将类型3链路的链路ID设置为邻居的IP地址,将链路数据设置为掩码0xffffffff(表示主机路由),并将成本设置为接口配置的输出成本。[15]
Option 2 If a subnet has been assigned to the point-to-point link, set the Link ID of the Type 3 link to the subnet's IP address, the Link Data to the subnet's mask, and the cost to the interface's configured output cost.[16]
选项2如果已将子网分配给点到点链路,则将类型3链路的链路ID设置为子网的IP地址,将链路数据设置为子网的掩码,并将成本设置为接口的配置输出成本。[16]
12.4.1.2. Describing broadcast and NBMA interfaces
12.4.1.2. 描述广播和NBMA接口
For operational broadcast and NBMA interfaces, a single link description is added to the router-LSA as follows:
对于操作广播和NBMA接口,向路由器LSA添加单链路描述,如下所示:
o If the state of the interface is Waiting, add a Type 3 link (stub network) with Link ID set to the IP network number of the attached network, Link Data set to the attached network's address mask, and cost equal to the interface's configured output cost.
o 如果接口的状态为等待,则添加类型3链路(存根网络),链路ID设置为连接网络的IP网络号,链路数据设置为连接网络的地址掩码,成本等于接口的配置输出成本。
o Else, there has been a Designated Router elected for the attached network. If the router is fully adjacent to the Designated Router, or if the router itself is Designated Router and is fully adjacent to at least one other router, add a single Type 2 link (transit network) with Link ID set to the IP interface address of the attached network's Designated Router (which may be the router itself), Link Data set to the router's own IP interface address, and cost equal to the interface's configured output cost. Otherwise, add a link as if the interface state were Waiting (see above).
o 否则,已为连接的网络选择了指定的路由器。如果路由器与指定路由器完全相邻,或者如果路由器本身是指定路由器并且与至少一个其他路由器完全相邻,则添加一个链路ID设置为连接网络的指定路由器(可能是路由器本身)的IP接口地址的单一类型2链路(传输网络),将数据集链接到路由器自己的IP接口地址,成本等于接口配置的输出成本。否则,添加一个链接,就像接口状态正在等待一样(参见上文)。
12.4.1.3. Describing virtual links
12.4.1.3. 描述虚拟链接
For virtual links, a link description is added to the router-LSA only when the virtual neighbor is fully adjacent. In this case, add a Type 4 link (virtual link) with Link ID set to the Router ID of the virtual neighbor, Link Data set to the IP interface address associated with the virtual link and cost set to the cost calculated for the virtual link during the routing table calculation (see Section 15).
对于虚拟链路,只有当虚拟邻居完全相邻时,才会向路由器LSA添加链路描述。在这种情况下,添加类型4链路(虚拟链路),链路ID设置为虚拟邻居的路由器ID,链路数据设置为与虚拟链路关联的IP接口地址,成本设置为路由表计算期间为虚拟链路计算的成本(见第15节)。
12.4.1.4. Describing Point-to-MultiPoint interfaces
12.4.1.4. 描述点对多点接口
For operational Point-to-MultiPoint interfaces, one or more link descriptions are added to the router-LSA as follows:
对于操作点对多点接口,一个或多个链路描述添加到路由器LSA,如下所示:
o A single Type 3 link (stub network) is added with Link ID set to the router's own IP interface address, Link Data set to the mask 0xffffffff (indicating a host route), and cost set to 0.
o 添加单个类型3链路(存根网络),链路ID设置为路由器自己的IP接口地址,链路数据设置为掩码0xFFFFFF(表示主机路由),成本设置为0。
o For each fully adjacent neighbor associated with the interface, add an additional Type 1 link (point-to-point) with Link ID set to the Router ID of the neighboring router, Link Data set to the IP interface address and cost equal to the interface's configured output cost.
o 对于与接口关联的每个完全相邻的邻居,添加一个额外的类型1链路(点对点),链路ID设置为相邻路由器的路由器ID,链路数据设置为IP接口地址,成本等于接口的配置输出成本。
12.4.1.5. Examples of router-LSAs
12.4.1.5. 路由器lsa示例
Consider the router-LSAs generated by Router RT3, as pictured in Figure 6. The area containing Router RT3 (Area 1) has been redrawn, with actual network addresses, in Figure 15. Assume that the last byte of all of RT3's interface addresses is 3, giving it the interface addresses 192.1.1.3 and 192.1.4.3, and that the other routers have similar addressing schemes. In addition, assume that all links are functional, and that Router IDs are assigned as the smallest IP interface address.
考虑路由器RT3生成的路由器LSA,如图6所示。包含路由器RT3的区域(区域1)已用实际网络地址重新绘制,如图15所示。假设所有RT3接口地址的最后一个字节为3,即接口地址192.1.1.3和192.1.4.3,并且其他路由器具有类似的寻址方案。此外,假设所有链路都正常工作,并且路由器ID被分配为最小的IP接口地址。
RT3 originates two router-LSAs, one for Area 1 and one for the backbone. Assume that Router RT4 has been selected as the Designated router for network 192.1.1.0. RT3's router-LSA for Area 1 is then shown below. It indicates that RT3 has two connections to Area 1, the first a link to the transit network 192.1.1.0 and the second a link to the stub network 192.1.4.0. Note that the transit network is identified by the IP interface of its Designated Router (i.e., the Link ID = 192.1.1.4 which is the Designated Router RT4's IP interface to 192.1.1.0). Note also that RT3 has indicated that it is an area border router.
RT3发起两个路由器LSA,一个用于区域1,一个用于主干。假设已选择路由器RT4作为网络192.1.1.0的指定路由器。区域1的RT3路由器LSA如下所示。它表示RT3有两个到区域1的连接,第一个是到传输网络192.1.1.0的a链路,第二个是到存根网络192.1.4.0的a链路。注意,传输网络由其指定路由器的IP接口标识(即,链路ID=192.1.1.4,这是指定路由器RT4到192.1.1.0的IP接口)。还请注意,RT3表示它是一个区域边界路由器。
; RT3's router-LSA for Area 1
; 区域1的RT3路由器LSA
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 1 ;indicates router-LSA Link State ID = 192.1.1.3 ;RT3's Router ID Advertising Router = 192.1.1.3 ;RT3's Router ID bit E = 0 ;not an AS boundary router
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 1 ;indicates router-LSA Link State ID = 192.1.1.3 ;RT3's Router ID Advertising Router = 192.1.1.3 ;RT3's Router ID bit E = 0 ;not an AS boundary router
bit B = 1 ;area border router #links = 2 Link ID = 192.1.1.4 ;IP address of Desig. Rtr. Link Data = 192.1.1.3 ;RT3's IP interface to net Type = 2 ;connects to transit network # TOS metrics = 0 metric = 1
bit B = 1 ;area border router #links = 2 Link ID = 192.1.1.4 ;IP address of Desig. Rtr. Link Data = 192.1.1.3 ;RT3's IP interface to net Type = 2 ;connects to transit network # TOS metrics = 0 metric = 1
Link ID = 192.1.4.0 ;IP Network number Link Data = 0xffffff00 ;Network mask Type = 3 ;connects to stub network # TOS metrics = 0 metric = 2
Link ID = 192.1.4.0 ;IP Network number Link Data = 0xffffff00 ;Network mask Type = 3 ;connects to stub network # TOS metrics = 0 metric = 2
Next RT3's router-LSA for the backbone is shown. It indicates that RT3 has a single attachment to the backbone. This attachment is via an unnumbered point-to-point link to Router RT6. RT3 has again indicated that it is an area border router.
接下来显示了RT3的主干路由器LSA。它表示RT3有一个到主干的连接。此附件通过未编号的点对点链路连接到路由器RT6。RT3再次表明它是一个区域边界路由器。
; RT3's router-LSA for the backbone
; RT3的主干路由器LSA
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 1 ;indicates router-LSA Link State ID = 192.1.1.3 ;RT3's router ID Advertising Router = 192.1.1.3 ;RT3's router ID bit E = 0 ;not an AS boundary router bit B = 1 ;area border router #links = 1 Link ID = 18.10.0.6 ;Neighbor's Router ID Link Data = 0.0.0.3 ;MIB-II ifIndex of P-P link Type = 1 ;connects to router # TOS metrics = 0 metric = 8
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 1 ;indicates router-LSA Link State ID = 192.1.1.3 ;RT3's router ID Advertising Router = 192.1.1.3 ;RT3's router ID bit E = 0 ;not an AS boundary router bit B = 1 ;area border router #links = 1 Link ID = 18.10.0.6 ;Neighbor's Router ID Link Data = 0.0.0.3 ;MIB-II ifIndex of P-P link Type = 1 ;connects to router # TOS metrics = 0 metric = 8
12.4.2. Network-LSAs
12.4.2. 网络LSA
A network-LSA is generated for every transit broadcast or NBMA network. (A transit network is a network having two or more attached routers). The network-LSA describes all the routers that are attached to the network.
为每个传输广播或NBMA网络生成网络LSA。(中转网络是具有两个或多个连接路由器的网络)。网络LSA描述连接到网络的所有路由器。
The Designated Router for the network originates the LSA. The Designated Router originates the LSA only if it is fully adjacent to at least one other router on the network. The network-LSA is flooded throughout the area that contains the transit network, and no further. The network-LSA lists those routers that are fully adjacent to the Designated Router; each fully adjacent router is identified by its OSPF Router ID. The Designated Router includes itself in this list.
网络的指定路由器发起LSA。仅当指定路由器与网络上的至少一个其他路由器完全相邻时,才发起LSA。网络LSA被淹没在包含公交网络的整个区域内,不再进一步。网络LSA列出与指定路由器完全相邻的那些路由器;每个完全相邻的路由器都由其OSPF路由器ID标识。指定的路由器包含在此列表中。
The Link State ID for a network-LSA is the IP interface address of the Designated Router. This value, masked by the network's address mask (which is also contained in the network-LSA) yields the network's IP address.
网络LSA的链路状态ID是指定路由器的IP接口地址。该值由网络的地址掩码(也包含在网络LSA中)屏蔽,生成网络的IP地址。
A router that has formerly been the Designated Router for a network, but is no longer, should flush the network-LSA that it had previously originated. This LSA is no longer used in the routing table calculation. It is flushed by prematurely incrementing the LSA's age to MaxAge and reflooding (see Section 14.1). In addition, in those rare cases where a router's Router ID has changed, any network-LSAs that were originated with the router's previous Router ID must be flushed. Since the router may have no idea what it's previous Router ID might have been, these network-LSAs are indicated by having their Link State ID equal to one of the router's IP interface addresses and their Advertising Router equal to some value other than the router's current Router ID (see Section 13.4 for more details).
以前是网络的指定路由器但现在不再是的路由器应该刷新它以前发起的网络LSA。此LSA不再用于路由表计算。通过提前将LSA的使用年限增加至最大使用年限和再溢流(见第14.1节)进行冲洗。此外,在路由器的路由器ID发生更改的罕见情况下,必须刷新由路由器以前的路由器ID发起的任何网络LSA。由于路由器可能不知道它以前的路由器ID可能是什么,这些网络LSA通过其链路状态ID等于路由器的IP接口地址之一和其广告路由器等于路由器当前路由器ID以外的某个值来表示(更多详细信息,请参阅第13.4节)。
12.4.2.1. Examples of network-LSAs
12.4.2.1. 网络lsa示例
Again consider the area configuration in Figure 6. Network-LSAs are originated for Network N3 in Area 1, Networks N6 and N8 in Area 2, and Network N9 in Area 3. Assuming that Router RT4 has been selected as the Designated Router for Network N3, the following network-LSA is generated by RT4 on behalf of Network N3 (see Figure 15 for the address assignments):
再次考虑图6中的区域配置。为区域1中的网络N3、区域2中的网络N6和N8以及区域3中的网络N9发起网络LSA。假设已选择路由器RT4作为网络N3的指定路由器,则RT4代表网络N3生成以下网络LSA(有关地址分配,请参见图15):
; Network-LSA for Network N3
; 网络N3的网络LSA
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 2 ;indicates network-LSA Link State ID = 192.1.1.4 ;IP address of Desig. Rtr. Advertising Router = 192.1.1.4 ;RT4's Router ID Network Mask = 0xffffff00 Attached Router = 192.1.1.4 ;Router ID Attached Router = 192.1.1.1 ;Router ID Attached Router = 192.1.1.2 ;Router ID Attached Router = 192.1.1.3 ;Router ID
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 2 ;indicates network-LSA Link State ID = 192.1.1.4 ;IP address of Desig. Rtr. Advertising Router = 192.1.1.4 ;RT4's Router ID Network Mask = 0xffffff00 Attached Router = 192.1.1.4 ;Router ID Attached Router = 192.1.1.1 ;Router ID Attached Router = 192.1.1.2 ;Router ID Attached Router = 192.1.1.3 ;Router ID
12.4.3. Summary-LSAs
12.4.3. LSA摘要
The destination described by a summary-LSA is either an IP network, an AS boundary router or a range of IP addresses. Summary-LSAs are flooded throughout a single area only. The destination described is one that is external to the area, yet still belongs to the Autonomous System.
摘要LSA描述的目的地是IP网络、AS边界路由器或一系列IP地址。摘要LSA仅淹没在单个区域内。所描述的目的地是区域外部的目的地,但仍然属于自治系统。
Summary-LSAs are originated by area border routers. The precise summary routes to advertise into an area are determined by examining the routing table structure (see Section 11) in accordance with the algorithm described below. Note that only intra-area routes are advertised into the backbone, while both intra-area and inter-area routes are advertised into the other areas.
摘要LSA由区域边界路由器发起。根据下面描述的算法,通过检查路由表结构(参见第11节)来确定要播发到某个区域的精确摘要路由。注意,只有区域内路由被播发到主干网,而区域内和区域间路由都被播发到其他区域。
To determine which routes to advertise into an attached Area A, each routing table entry is processed as follows. Remember that each routing table entry describes a set of equal-cost best paths to a particular destination:
为了确定要播发到附加区域A中的路由,每个路由表条目的处理如下。请记住,每个路由表条目都描述了一组到特定目的地的成本相等的最佳路径:
o Only Destination Types of network and AS boundary router are advertised in summary-LSAs. If the routing table entry's Destination Type is area border router, examine the next routing table entry.
o 摘要LSA中仅公布网络和AS边界路由器的目标类型。如果路由表条目的目标类型为区域边界路由器,请检查下一个路由表条目。
o AS external routes are never advertised in summary-LSAs. If the routing table entry has Path-type of type 1 external or type 2 external, examine the next routing table entry.
o 因为外部路由从不在摘要LSA中公布。如果路由表条目的路径类型为类型1外部或类型2外部,请检查下一个路由表条目。
o Else, if the area associated with this set of paths is the Area A itself, do not generate a summary-LSA for the route.[17]
o 否则,如果与这组路径关联的区域是区域A本身,则不要为路由生成摘要LSA。[17]
o Else, if the next hops associated with this set of paths belong to Area A itself, do not generate a summary-LSA for the route.[18] This is the logical equivalent of a Distance Vector protocol's split horizon logic.
o 否则,如果与这组路径相关联的下一个跃点属于区域A本身,则不生成路由的摘要LSA。[18]这是距离向量协议的拆分地平线逻辑的逻辑等价物。
o Else, if the routing table cost equals or exceeds the value LSInfinity, a summary-LSA cannot be generated for this route.
o 否则,如果路由表成本等于或超过值LSInfinity,则无法为此路由生成摘要LSA。
o Else, if the destination of this route is an AS boundary router, a summary-LSA should be originated if and only if the routing table entry describes the preferred path to the AS boundary router (see Step 3 of Section 16.4). If so, a Type 4 summary-LSA is originated for the destination, with Link State ID equal to the AS boundary router's Router ID and metric equal to the routing table entry's cost. Note: these LSAs should not be generated if Area A has been configured as a stub area.
o 否则,如果该路由的目的地是AS边界路由器,则当且仅当路由表条目描述到AS边界路由器的首选路径时(参见第16.4节的步骤3),才应生成摘要LSA。如果是这样,则针对目的地发起类型4摘要LSA,链路状态ID等于AS边界路由器的路由器ID,度量等于路由表条目的成本。注意:如果区域A已配置为存根区域,则不应生成这些LSA。
o Else, the Destination type is network. If this is an inter-area route, generate a Type 3 summary-LSA for the destination, with Link State ID equal to the network's address (if necessary, the Link State ID can also have one or more of the network's host bits set; see Appendix E for details) and metric equal to the routing table cost.
o 否则,目标类型为网络。如果这是区域间路由,则为目的地生成类型3摘要LSA,链路状态ID等于网络地址(如有必要,链路状态ID还可以设置一个或多个网络主机位;有关详细信息,请参见附录E),度量等于路由表成本。
o The one remaining case is an intra-area route to a network. This means that the network is contained in one of the router's directly attached areas. In general, this information must be condensed before appearing in summary-LSAs. Remember that an area has a configured list of address ranges, each range consisting of an [address,mask] pair and a status indication of either Advertise or DoNotAdvertise. At most a single Type 3 summary-LSA is originated for each range. When the range's status indicates Advertise, a Type 3 summary-LSA is generated with Link State ID equal to the
o 剩下的一种情况是到网络的区域内路由。这意味着网络包含在路由器的一个直接连接区域中。通常,这些信息必须在摘要LSA中出现之前进行压缩。请记住,一个区域有一个已配置的地址范围列表,每个范围由一个[address,mask]对和一个Advertise或DoNotAdvertise的状态指示组成。对于每个范围,最多生成一个单一的3类汇总LSA。当范围的状态指示播发时,将生成链接状态ID等于
range's address (if necessary, the Link State ID can also have one or more of the range's "host" bits set; see Appendix E for details) and cost equal to the largest cost of any of the component networks. When the range's status indicates DoNotAdvertise, the Type 3 summary-LSA is suppressed and the component networks remain hidden from other areas.
范围的地址(如有必要,链路状态ID也可以设置一个或多个范围的“主机”位;有关详细信息,请参见附录E)和等于任何组件网络的最大成本的成本。当范围的状态指示DoNotAdvertise时,类型3摘要LSA将被抑制,并且元件网络将保持对其他区域隐藏。
By default, if a network is not contained in any explicitly configured address range, a Type 3 summary-LSA is generated with Link State ID equal to the network's address (if necessary, the Link State ID can also have one or more of the network's "host" bits set; see Appendix E for details) and metric equal to the network's routing table cost.
默认情况下,如果网络未包含在任何显式配置的地址范围内,则生成类型3摘要LSA,其中链路状态ID等于网络地址(如有必要,链路状态ID还可以设置一个或多个网络“主机”位;有关详细信息,请参阅附录E)和等于网络路由表成本的度量。
If an area is capable of carrying transit traffic (i.e., its TransitCapability is set to TRUE), routing information concerning backbone networks should not be condensed before being summarized into the area. Nor should the advertisement of backbone networks into transit areas be suppressed. In other words, the backbone's configured ranges should be ignored when originating summary-LSAs into transit areas.
如果一个区域能够承载过境业务(即,其过境能力设置为TRUE),则在将主干网的路由信息汇总到该区域之前,不应将其压缩。也不应禁止向过境区宣传主干网。换句话说,在将摘要LSA发送到传输区域时,应忽略主干的配置范围。
If a router advertises a summary-LSA for a destination which then becomes unreachable, the router must then flush the LSA from the routing domain by setting its age to MaxAge and reflooding (see Section 14.1). Also, if the destination is still reachable, yet can no longer be advertised according to the above procedure (e.g., it is now an inter-area route, when it used to be an intra-area route associated with some non-backbone area; it would thus no longer be advertisable to the backbone), the LSA should also be flushed from the routing domain.
如果路由器播发某个目的地的摘要LSA,而该目的地随后变得不可访问,则路由器必须通过将其年龄设置为最大年龄并重新下载,从路由域中清除LSA(见第14.1节)。此外,如果目的地仍然是可到达的,但是根据上述过程不能再被通告(例如,它现在是一个区域间路由,当它过去是一个与一些非主干区域相关联的区域内路由时;因此它将不再可通告给主干),那么LSA也应该从路由域中清除。
12.4.3.1. Originating summary-LSAs into stub areas
12.4.3.1. 将摘要LSA发送到存根区域
The algorithm in Section 12.4.3 is optional when Area A is an OSPF stub area. Area border routers connecting to a stub area can originate summary-LSAs into the area
当区域A是OSPF存根区域时,第12.4.3节中的算法是可选的。连接到存根区域的区域边界路由器可以向该区域发起摘要LSA
according to the Section 12.4.3's algorithm, or can choose to originate only a subset of the summary-LSAs, possibly under configuration control. The fewer LSAs originated, the smaller the stub area's link state database, further reducing the demands on its routers' resources. However, omitting LSAs may also lead to sub-optimal inter-area routing, although routing will continue to function.
根据第12.4.3节的算法,或可选择仅发起汇总LSA的子集,可能在配置控制下。产生的LSA越少,存根区域的链路状态数据库就越小,进一步减少了对路由器资源的需求。然而,省略lsa也可能导致次优的区域间路由,尽管路由将继续工作。
As specified in Section 12.4.3, Type 4 summary-LSAs (ASBR-summary-LSAs) are never originated into stub areas.
如第12.4.3节所述,类型4汇总LSA(ASBR汇总LSA)从不起源于存根区域。
In a stub area, instead of importing external routes each area border router originates a "default summary-LSA" into the area. The Link State ID for the default summary-LSA is set to DefaultDestination, and the metric set to the (per-area) configurable parameter StubDefaultCost. Note that StubDefaultCost need not be configured identically in all of the stub area's area border routers.
在存根区域中,每个区域边界路由器不导入外部路由,而是在该区域中创建一个“默认摘要LSA”。默认摘要LSA的链接状态ID设置为DefaultDestination,度量设置为(每个区域)可配置参数StubDefaultCost。请注意,StubDefaultCost不需要在所有存根区域的区域边界路由器中进行相同的配置。
12.4.3.2. Examples of summary-LSAs
12.4.3.2. 汇总LSA示例
Consider again the area configuration in Figure 6. Routers RT3, RT4, RT7, RT10 and RT11 are all area border routers, and therefore are originating summary-LSAs. Consider in particular Router RT4. Its routing table was calculated as the example in Section 11.3. RT4 originates summary-LSAs into both the backbone and Area 1. Into the backbone, Router RT4 originates separate LSAs for each of the networks N1-N4. Into Area 1, Router RT4 originates separate LSAs for networks N6-N8 and the AS boundary routers RT5,RT7. It also condenses host routes Ia and Ib into a single summary-LSA. Finally, the routes to networks N9,N10,N11 and Host H1 are advertised by a single summary-LSA. This condensation was originally performed by the router RT11.
再次考虑图6中的区域配置。路由器RT3、RT4、RT7、RT10和RT11都是区域边界路由器,因此都是源概要LSA。特别考虑路由器RT4。其路由表的计算如第11.3节所示。RT4将摘要LSA同时发送到主干网和区域1。在主干网中,路由器RT4为每个网络N1-N4发起单独的LSA。在区域1中,路由器RT4为网络N6-N8和AS边界路由器RT5、RT7发起单独的LSA。它还将主机路由Ia和Ib压缩为单个摘要LSA。最后,到网络N9、N10、N11和主机H1的路由由单个摘要LSA播发。该冷凝最初由路由器RT11执行。
These LSAs are illustrated graphically in Figures 7 and 8. Two of the summary-LSAs originated by Router RT4 follow. The actual IP addresses for the networks and routers in question have been assigned in Figure 15.
这些LSA如图7和图8所示。下面是由路由器RT4发起的两个摘要LSA。图15中分配了相关网络和路由器的实际IP地址。
; Summary-LSA for Network N1, ; originated by Router RT4 into the backbone
; 网络N1的LSA摘要;由路由器RT4发起进入主干网
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 3 ;Type 3 summary-LSA Link State ID = 192.1.2.0 ;N1's IP network number Advertising Router = 192.1.1.4 ;RT4's ID metric = 4
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 3 ;Type 3 summary-LSA Link State ID = 192.1.2.0 ;N1's IP network number Advertising Router = 192.1.1.4 ;RT4's ID metric = 4
; Summary-LSA for AS boundary router RT7 ; originated by Router RT4 into Area 1
; AS边界路由器RT7的LSA摘要;由路由器RT4发起进入区域1
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 4 ;Type 4 summary-LSA Link State ID = Router RT7's ID Advertising Router = 192.1.1.4 ;RT4's ID metric = 14
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 4 ;Type 4 summary-LSA Link State ID = Router RT7's ID Advertising Router = 192.1.1.4 ;RT4's ID metric = 14
12.4.4. AS-external-LSAs
12.4.4. 作为外部LSA
AS-external-LSAs describe routes to destinations external to the Autonomous System. Most AS-external-LSAs describe routes to specific external destinations; in these cases the LSA's Link State ID is set to the destination network's IP address (if necessary, the Link State ID can also have one or more of the network's "host" bits set; see Appendix E for details). However, a default route for the Autonomous System can be described in an AS-external-LSA by setting the LSA's Link State ID to DefaultDestination (0.0.0.0). AS-external-LSAs are originated by AS boundary routers. An AS boundary router originates a single AS-external-LSA for each external route that it has learned, either through another routing protocol (such as BGP), or through configuration information.
AS外部LSA描述到自治系统外部目的地的路线。大多数作为外部LSA描述到特定外部目的地的路线;在这些情况下,LSA的链路状态ID设置为目标网络的IP地址(如有必要,链路状态ID还可以设置一个或多个网络“主机”位;有关详细信息,请参阅附录E)。然而,自治系统的默认路由可以通过将LSA的链路状态ID设置为DefaultDestination(0.0.0.0)在AS外部LSA中描述。AS外部LSA由AS边界路由器发起。AS边界路由器通过另一个路由协议(如BGP)或通过配置信息,为其已学习的每个外部路由发起单个AS外部LSA。
AS-external-LSAs are the only type of LSAs that are flooded throughout the entire Autonomous System; all other types of LSAs are specific to a single area. However, AS-external-LSAs are not flooded into/throughout stub areas (see Section 3.6). This enables a reduction in link state database size for routers internal to stub areas.
因为外部LSA是在整个自治系统中被淹没的唯一LSA类型;所有其他类型的LSA都特定于单个区域。但是,由于外部LSA未被淹没到/贯穿存根区域(见第3.6节)。这可以减少存根区域内部路由器的链路状态数据库大小。
The metric that is advertised for an external route can be one of two types. Type 1 metrics are comparable to the link state metric. Type 2 metrics are assumed to be larger than the cost of any intra-AS path.
为外部路由播发的度量可以是两种类型之一。类型1度量与链路状态度量具有可比性。假设类型2指标大于任何内部AS路径的成本。
If a router advertises an AS-external-LSA for a destination which then becomes unreachable, the router must then flush the LSA from the routing domain by setting its age to MaxAge and reflooding (see Section 14.1).
如果一个路由器为一个目的地播发一个外部LSA,而该目的地随后变得不可访问,则路由器必须通过将其年龄设置为最大年龄并重新下载(见第14.1节),从路由域中清除LSA。
12.4.4.1. Examples of AS-external-LSAs
12.4.4.1. AS外部LSA的示例
Consider once again the AS pictured in Figure 6. There are two AS boundary routers: RT5 and RT7. Router RT5 originates three AS-external-LSAs, for networks N12-N14. Router RT7 originates two AS-external-LSAs, for networks N12 and N15. Assume that RT7 has learned its route to N12 via BGP, and that it wishes to advertise a Type 2 metric to the AS. RT7 would then originate the following LSA for N12:
再次考虑如图6所示。有两种AS边界路由器:RT5和RT7。路由器RT5发起三个外部LSA,用于网络N12-N14。路由器RT7为网络N12和N15发起两个外部LSA。假设RT7已经学会了通过BGP到N12的路由,并且它希望向AS公布类型2度量。然后,RT7将为N12发起以下LSA:
; AS-external-LSA for Network N12, ; originated by Router RT7
; 作为网络N12的外部LSA;由路由器RT7发起
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 5 ;AS-external-LSA Link State ID = N12's IP network number Advertising Router = Router RT7's ID bit E = 1 ;Type 2 metric metric = 2 Forwarding address = 0.0.0.0
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 5 ;AS-external-LSA Link State ID = N12's IP network number Advertising Router = Router RT7's ID bit E = 1 ;Type 2 metric metric = 2 Forwarding address = 0.0.0.0
In the above example, the forwarding address field has been set to 0.0.0.0, indicating that packets for the external destination should be forwarded to the advertising OSPF router (RT7). This is not always desirable. Consider the example pictured in Figure 16. There are three OSPF routers (RTA, RTB and RTC) connected to a common network. Only one of these routers, RTA, is exchanging BGP information with the non-OSPF router RTX. RTA must then originate AS-external-LSAs for those destinations it has learned from RTX. By using the AS-external-LSA's forwarding address field, RTA can specify that packets for these destinations be forwarded directly to RTX. Without this feature, Routers RTB and RTC would take an extra hop to get to these destinations.
在上面的示例中,转发地址字段已设置为0.0.0.0,指示外部目的地的分组应转发到广告OSPF路由器(RT7)。这并不总是可取的。考虑图16中所示的例子。有三个OSPF路由器(RTA、RTB和RTC)连接到公共网络。这些路由器中只有一个RTA正在与非OSPF路由器RTX交换BGP信息。RTA必须作为从RTX学到的目的地的外部LSA发起。通过使用AS external LSA的转发地址字段,RTA可以指定将这些目的地的数据包直接转发到RTX。如果没有此功能,路由器RTB和RTC将需要额外的跃点才能到达这些目的地。
Note that when the forwarding address field is non-zero, it should point to a router belonging to another Autonomous System.
请注意,当转发地址字段非零时,它应该指向属于另一个自治系统的路由器。
A forwarding address can also be specified for the default route. For example, in figure 16 RTA may want to specify that all externally-destined packets should by default be forwarded to its BGP peer RTX. The resulting AS-external-LSA is pictured below. Note that the Link State ID is set to DefaultDestination.
也可以为默认路由指定转发地址。例如,在图16中,RTA可能希望指定默认情况下所有外部目的地的数据包都应转发到其BGP对等RTX。产生的外部LSA如下图所示。请注意,链接状态ID设置为DefaultDestination。
; Default route, originated by Router RTA ; Packets forwarded through RTX
; 默认路由,由路由器RTA发起;通过RTX转发的数据包
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 5 ;AS-external-LSA Link State ID = DefaultDestination ; default route Advertising Router = Router RTA's ID bit E = 1 ;Type 2 metric metric = 1 Forwarding address = RTX's IP address
LS age = 0 ;always true on origination Options = (E-bit) ; LS type = 5 ;AS-external-LSA Link State ID = DefaultDestination ; default route Advertising Router = Router RTA's ID bit E = 1 ;Type 2 metric metric = 1 Forwarding address = RTX's IP address
In figure 16, suppose instead that both RTA and RTB exchange BGP information with RTX. In this case,
在图16中,假设RTA和RTB都与RTX交换BGP信息。在这种情况下,,
RTA and RTB would originate the same set of AS-external-LSAs. These LSAs, if they specify the same metric, would be functionally equivalent since they would specify the same destination and forwarding address (RTX). This leads to a clear duplication of effort. If only one of RTA or RTB originated the set of AS-external-LSAs, the routing would remain the same, and the size of the link state database would decrease. However, it must be unambiguously defined as to which router originates the LSAs (otherwise neither may, or the identity of the originator may oscillate). The following rule is thereby established: if two routers, both reachable from one another, originate functionally equivalent AS-external-LSAs (i.e., same destination, cost and non-zero forwarding address), then the LSA originated by the router having the highest OSPF Router ID is used. The router having the lower OSPF Router ID can then flush its LSA. Flushing an LSA is discussed in Section 14.1.
RTA和RTB将产生与外部LSA相同的一组LSA。如果这些LSA指定相同的度量,那么它们在功能上是等效的,因为它们将指定相同的目的地和转发地址(RTX)。这导致了明显的重复工作。如果RTA或RTB中只有一个发起了AS外部LSA集,则路由将保持不变,并且链路状态数据库的大小将减小。然而,它必须明确定义是哪个路由器发起了LSA(否则两者都不可能,或者发起人的身份可能会振荡)。由此建立以下规则:如果两个路由器(都可以从彼此到达)在功能上等同于外部LSA(即,相同的目的地、成本和非零转发地址),则使用由具有最高OSPF路由器ID的路由器发起的LSA。然后,具有较低OSPF路由器ID的路由器可以刷新其LSA。冲洗LSA在第14.1节中进行了讨论。
+ | +---+.....|.BGP |RTA|-----|.....+---+ +---+ |-----|RTX| | +---+ +---+ | |RTB|-----| +---+ | | +---+ | |RTC|-----| +---+ | | +
+ | +---+.....|.BGP |RTA|-----|.....+---+ +---+ |-----|RTX| | +---+ +---+ | |RTB|-----| +---+ | | +---+ | |RTC|-----| +---+ | | +
Figure 16: Forwarding address example
图16:转发地址示例
Link State Update packets provide the mechanism for flooding LSAs. A Link State Update packet may contain several distinct LSAs, and floods each LSA one hop further from its point of origination. To make the flooding procedure reliable, each LSA must be acknowledged separately. Acknowledgments are transmitted in Link State Acknowledgment packets. Many separate acknowledgments can also be grouped together into a single packet.
链路状态更新包提供了泛洪LSA的机制。链路状态更新包可能包含多个不同的LSA,并将每个LSA从其起始点进一步泛洪一跳。为了使注水程序可靠,必须单独确认每个LSA。确认在链路状态确认包中传输。许多单独的确认也可以组合到一个数据包中。
The flooding procedure starts when a Link State Update packet has been received. Many consistency checks have been made on the received packet before being handed to the flooding procedure (see Section 8.2). In particular, the Link State Update packet has been associated with a particular neighbor, and a particular area. If the neighbor is in a lesser state than Exchange, the packet should be dropped without further processing.
当接收到链路状态更新包时,泛洪过程开始。在移交给泛洪程序之前,已对收到的数据包进行了多次一致性检查(见第8.2节)。具体地,链路状态更新分组已经与特定邻居和特定区域相关联。如果邻居的状态低于Exchange,则应在不进行进一步处理的情况下丢弃数据包。
All types of LSAs, other than AS-external-LSAs, are associated with a specific area. However, LSAs do not contain an area field. An LSA's area must be deduced from the Link State Update packet header.
所有类型的LSA(外部LSA除外)都与特定区域关联。但是,LSA不包含区域字段。LSA的区域必须从链路状态更新数据包头中推导出来。
For each LSA contained in a Link State Update packet, the following steps are taken:
对于链路状态更新包中包含的每个LSA,采取以下步骤:
(1) Validate the LSA's LS checksum. If the checksum turns out to be invalid, discard the LSA and get the next one from the Link State Update packet.
(1) 验证LSA的LS校验和。如果校验和结果无效,则丢弃LSA并从链路状态更新数据包中获取下一个LSA。
(2) Examine the LSA's LS type. If the LS type is unknown, discard the LSA and get the next one from the Link State Update Packet. This specification defines LS types 1-5 (see Section 4.3).
(2) 检查LSA的LS类型。如果LS类型未知,则丢弃LSA并从链路状态更新数据包中获取下一个LSA。本规范定义了LS类型1-5(见第4.3节)。
(3) Else if this is an AS-external-LSA (LS type = 5), and the area has been configured as a stub area, discard the LSA and get the next one from the Link State Update Packet. AS-external-LSAs are not flooded into/throughout stub areas (see Section 3.6).
(3) 否则,如果这是AS外部LSA(LS type=5),并且该区域已配置为存根区域,则丢弃该LSA并从链路状态更新数据包中获取下一个LSA。因为外部LSA不会淹没到/贯穿短柱区域(见第3.6节)。
(4) Else if the LSA's LS age is equal to MaxAge, and there is currently no instance of the LSA in the router's link state database, and none of router's neighbors are in states Exchange
(4) 否则,如果LSA的LS age等于MaxAge,并且路由器的链路状态数据库中当前没有LSA的实例,并且路由器的任何邻居都不处于交换状态
or Loading, then take the following actions: a) Acknowledge the receipt of the LSA by sending a Link State Acknowledgment packet back to the sending neighbor (see Section 13.5), and b) Discard the LSA and examine the next LSA (if any) listed in the Link State Update packet.
或加载,然后采取以下措施:a)通过向发送邻居发送链路状态确认数据包(见第13.5节)确认收到LSA,以及b)丢弃LSA并检查链路状态更新数据包中列出的下一个LSA(如果有)。
(5) Otherwise, find the instance of this LSA that is currently contained in the router's link state database. If there is no database copy, or the received LSA is more recent than the database copy (see Section 13.1 below for the determination of which LSA is more recent) the following steps must be performed:
(5) 否则,请查找当前包含在路由器链路状态数据库中的此LSA的实例。如果没有数据库副本,或者收到的LSA比数据库副本更新(关于确定哪一个LSA更新,请参见下文第13.1节),则必须执行以下步骤:
(a) If there is already a database copy, and if the database copy was received via flooding and installed less than MinLSArrival seconds ago, discard the new LSA (without acknowledging it) and examine the next LSA (if any) listed in the Link State Update packet.
(a) 如果已经存在数据库副本,并且如果数据库副本是通过洪泛接收的,并且在不到MinLSArrival秒之前安装的,则丢弃新LSA(不确认),并检查链路状态更新数据包中列出的下一个LSA(如果有)。
(b) Otherwise immediately flood the new LSA out some subset of the router's interfaces (see Section 13.3). In some cases (e.g., the state of the receiving interface is DR and the LSA was received from a router other than the Backup DR) the LSA will be flooded back out the receiving interface. This occurrence should be noted for later use by the acknowledgment process (Section 13.5).
(b) 否则,立即将新的LSA溢出路由器接口的某些子集(见第13.3节)。在某些情况下(例如,接收接口的状态为DR,并且LSA是从备份DR以外的路由器接收的),LSA将被淹没回接收接口。应注意此情况,以供确认过程(第13.5节)以后使用。
(c) Remove the current database copy from all neighbors' Link state retransmission lists.
(c) 从所有邻居的链路状态重传列表中删除当前数据库副本。
(d) Install the new LSA in the link state database (replacing the current database copy). This may cause the routing table calculation to be scheduled. In addition, timestamp the new LSA with the current time (i.e., the time it was received). The flooding procedure cannot overwrite the newly installed LSA until MinLSArrival seconds have elapsed. The LSA installation process is discussed further in Section 13.2.
(d) 在链接状态数据库中安装新LSA(替换当前数据库副本)。这可能会导致安排路由表计算。此外,用当前时间(即接收到的时间)为新LSA加上时间戳。泛洪过程无法覆盖新安装的LSA,直到超过最小LSA到达秒。第13.2节将进一步讨论LSA安装过程。
(e) Possibly acknowledge the receipt of the LSA by sending a Link State Acknowledgment packet back out the receiving interface. This is explained below in Section 13.5.
(e) 可能通过向接收接口发回链路状态确认包来确认LSA的接收。下文第13.5节对此进行了解释。
(f) If this new LSA indicates that it was originated by the receiving router itself (i.e., is considered a self-originated LSA), the router must take special action, either updating the LSA or in some cases flushing it from the routing domain. For a description of how self-originated LSAs are detected and subsequently handled, see Section 13.4.
(f) 如果这个新的LSA表明它是由接收路由器本身发起的(即,被认为是自发起的LSA),路由器必须采取特殊行动,要么更新LSA,要么在某些情况下从路由域刷新LSA。有关如何检测和随后处理自创LSA的说明,请参见第13.4节。
(6) Else, if there is an instance of the LSA on the sending neighbor's Link state request list, an error has occurred in the Database Exchange process. In this case, restart the Database Exchange process by generating the neighbor event BadLSReq for the sending neighbor and stop processing the Link State Update packet.
(6) 否则,如果发送邻居的链路状态请求列表上存在LSA实例,则数据库交换过程中发生错误。在这种情况下,通过为发送邻居生成邻居事件BadLSReq并停止处理链路状态更新数据包来重新启动数据库交换进程。
(7) Else, if the received LSA is the same instance as the database copy (i.e., neither one is more recent) the following two steps should be performed:
(7) 否则,如果收到的LSA与数据库副本是同一实例(即,两个实例都不是最近的),则应执行以下两个步骤:
(a) If the LSA is listed in the Link state retransmission list for the receiving adjacency, the router itself is expecting an acknowledgment for this LSA. The router should treat the received LSA as an acknowledgment by removing the LSA from the Link state retransmission list. This is termed an "implied acknowledgment". Its occurrence should be noted for later use by the acknowledgment process (Section 13.5).
(a) 如果LSA列在接收邻接的链路状态重传列表中,则路由器本身期望该LSA得到确认。路由器应通过从链路状态重传列表中删除LSA,将收到的LSA视为确认。这被称为“默示承认”。应注意其出现情况,以供确认流程稍后使用(第13.5节)。
(b) Possibly acknowledge the receipt of the LSA by sending a Link State Acknowledgment packet back out the receiving interface. This is explained below in Section 13.5.
(b) 可能通过向接收接口发回链路状态确认包来确认LSA的接收。下文第13.5节对此进行了解释。
(8) Else, the database copy is more recent. If the database copy has LS age equal to MaxAge and LS sequence number equal to MaxSequenceNumber, simply discard the received LSA without acknowledging it. (In this case, the LSA's LS sequence number is wrapping, and the MaxSequenceNumber LSA must be completely flushed before any new LSA instance can be introduced). Otherwise, as long as the database copy has not been sent in a Link State Update within the last MinLSArrival seconds, send the database copy back to the sending neighbor, encapsulated within a Link State Update Packet. The Link State Update Packet should be sent directly to the neighbor. In so doing, do not put the
(8) 否则,数据库副本将更新。如果数据库副本的LS age等于MaxAge,LS sequence number等于MaxSequenceNumber,只需丢弃接收到的LSA而不确认它。(在这种情况下,LSA的LS序列号正在包装,在引入任何新LSA实例之前,必须完全刷新MaxSequenceNumber LSA)。否则,只要数据库副本在最后几分钟内没有在链路状态更新中发送,就将数据库副本发送回发送邻居,并封装在链路状态更新数据包中。链路状态更新数据包应直接发送给邻居。这样做时,不要将
database copy of the LSA on the neighbor's link state retransmission list, and do not acknowledge the received (less recent) LSA instance.
邻居链路状态重传列表上LSA的数据库副本,并且不确认接收到的(较新的)LSA实例。
13.1. Determining which LSA is newer
13.1. 确定哪个LSA较新
When a router encounters two instances of an LSA, it must determine which is more recent. This occurred above when comparing a received LSA to its database copy. This comparison must also be done during the Database Exchange procedure which occurs during adjacency bring-up.
当路由器遇到两个LSA实例时,它必须确定哪个是最近的。上述情况发生在将接收到的LSA与其数据库副本进行比较时。这种比较也必须在数据库交换过程中进行,该过程发生在邻接打开过程中。
An LSA is identified by its LS type, Link State ID and Advertising Router. For two instances of the same LSA, the LS sequence number, LS age, and LS checksum fields are used to determine which instance is more recent:
LSA由其LS类型、链路状态ID和广告路由器标识。对于同一LSA的两个实例,LS序列号、LS年龄和LS校验和字段用于确定哪个实例是最近的:
o The LSA having the newer LS sequence number is more recent. See Section 12.1.6 for an explanation of the LS sequence number space. If both instances have the same LS sequence number, then:
o 具有较新LS序列号的LSA是较新的。有关LS序列号空间的说明,请参见第12.1.6节。如果两个实例具有相同的LS序列号,则:
o If the two instances have different LS checksums, then the instance having the larger LS checksum (when considered as a 16-bit unsigned integer) is considered more recent.
o 如果两个实例具有不同的LS校验和,则具有较大LS校验和(当被视为16位无符号整数时)的实例被视为较新的实例。
o Else, if only one of the instances has its LS age field set to MaxAge, the instance of age MaxAge is considered to be more recent.
o 否则,如果只有一个实例的LS age字段设置为MaxAge,则age MaxAge实例被认为是较新的实例。
o Else, if the LS age fields of the two instances differ by more than MaxAgeDiff, the instance having the smaller (younger) LS age is considered to be more recent.
o 否则,如果两个实例的LS age字段的差异大于MaxAgeDiff,则具有较小(较年轻)LS age的实例被视为较新的实例。
o Else, the two instances are considered to be identical.
o 否则,这两个实例被认为是相同的。
13.2. Installing LSAs in the database
13.2. 在数据库中安装LSA
Installing a new LSA in the database, either as the result of flooding or a newly self-originated LSA, may cause the OSPF routing table structure to be recalculated. The contents of the new LSA should be compared to the old instance, if present. If there is no difference, there is no need to recalculate the routing table. When comparing an LSA to its previous instance, the following are all considered to be differences in contents:
在数据库中安装新的LSA,无论是由于泛洪还是新的自创LSA,都可能导致重新计算OSPF路由表结构。新LSA的内容应与旧实例(如果存在)进行比较。如果没有差异,则无需重新计算路由表。将LSA与其前一个实例进行比较时,以下内容均被视为内容上的差异:
o The LSA's Options field has changed.
o LSA的选项字段已更改。
o One of the LSA instances has LS age set to MaxAge, and the other does not.
o 其中一个LSA实例已将LS age设置为MaxAge,而另一个未设置。
o The length field in the LSA header has changed.
o LSA标头中的长度字段已更改。
o The body of the LSA (i.e., anything outside the 20-byte LSA header) has changed. Note that this excludes changes in LS Sequence Number and LS Checksum.
o LSA的主体(即,20字节LSA头以外的任何内容)已更改。请注意,这不包括LS序列号和LS校验和的更改。
If the contents are different, the following pieces of the routing table must be recalculated, depending on the new LSA's LS type field:
如果内容不同,则必须重新计算路由表的以下部分,具体取决于新LSA的LS type字段:
Router-LSAs and network-LSAs The entire routing table must be recalculated, starting with the shortest path calculations for each area (not just the area whose link-state database has changed). The reason that the shortest path calculation cannot be restricted to the single changed area has to do with the fact that AS boundary routers may belong to multiple areas. A change in the area currently providing the best route may force the router to use an intra-area route provided by a different area.[19]
路由器LSA和网络LSA必须重新计算整个路由表,首先计算每个区域的最短路径(不仅仅是链路状态数据库已更改的区域)。由于边界路由器可能属于多个区域,因此最短路径计算不能局限于单个变化区域。当前提供最佳路由的区域的变化可能会迫使路由器使用不同区域提供的区域内路由。[19]
Summary-LSAs The best route to the destination described by the summary-LSA must be recalculated (see Section 16.5). If this destination is an AS boundary router, it may also be necessary to re-examine all the AS-external-LSAs.
摘要LSA必须重新计算到摘要LSA所述目的地的最佳路线(见第16.5节)。如果此目的地是AS边界路由器,则可能还需要重新检查所有AS外部LSA。
AS-external-LSAs The best route to the destination described by the AS-external-LSA must be recalculated (see Section 16.6).
作为外部LSA,必须重新计算到达AS外部LSA所述目的地的最佳路线(见第16.6节)。
Also, any old instance of the LSA must be removed from the database when the new LSA is installed. This old instance must also be removed from all neighbors' Link state retransmission lists (see Section 10).
此外,安装新LSA时,必须从数据库中删除LSA的任何旧实例。该旧实例还必须从所有邻居的链路状态重传列表中删除(参见第10节)。
13.3. Next step in the flooding procedure
13.3. 泛洪程序的下一步
When a new (and more recent) LSA has been received, it must be flooded out some set of the router's interfaces. This section describes the second part of flooding procedure (the first part being the processing that occurred in Section 13), namely, selecting the outgoing interfaces and adding the LSA to the appropriate neighbors' Link state retransmission lists. Also included in this part of the flooding procedure is the maintenance of the neighbors' Link state request lists.
当一个新的(和最近的)LSA被接收时,它必须被路由器的一些接口所淹没。本节描述泛洪过程的第二部分(第一部分是第13节中发生的处理),即选择传出接口并将LSA添加到相应邻居的链路状态重传列表中。洪泛过程的这一部分还包括邻居链路状态请求列表的维护。
This section is equally applicable to the flooding of an LSA that the router itself has just originated (see Section 12.4). For these LSAs, this section provides the entirety of the flooding procedure (i.e., the processing of Section 13 is not performed, since, for example, the LSA has not been received from a neighbor and therefore does not need to be acknowledged).
本节同样适用于路由器本身刚刚发起的LSA泛洪(见第12.4节)。对于这些LSA,本节提供了泛洪过程的全部(即,不执行第13节的处理,因为,例如,没有从邻居接收LSA,因此不需要确认)。
Depending upon the LSA's LS type, the LSA can be flooded out only certain interfaces. These interfaces, defined by the following, are called the eligible interfaces:
根据LSA的LS类型,LSA只能淹没某些接口。以下定义的这些接口称为合格接口:
AS-external-LSAs (LS Type = 5) AS-external-LSAs are flooded throughout the entire AS, with the exception of stub areas (see Section 3.6). The eligible interfaces are all the router's interfaces, excluding virtual links and those interfaces attaching to stub areas.
AS外部LSA(LS类型=5)AS外部LSA淹没在整个AS中,但存根区域除外(见第3.6节)。合格的接口是所有路由器的接口,不包括虚拟链路和连接到存根区域的接口。
All other LS types All other types are specific to a single area (Area A). The
所有其他LS类型所有其他类型特定于单个区域(区域a)。这个
eligible interfaces are all those interfaces attaching to the Area A. If Area A is the backbone, this includes all the virtual links.
合格接口是连接到区域A的所有接口。如果区域A是主干,则包括所有虚拟链路。
Link state databases must remain synchronized over all adjacencies associated with the above eligible interfaces. This is accomplished by executing the following steps on each eligible interface. It should be noted that this procedure may decide not to flood an LSA out a particular interface, if there is a high probability that the attached neighbors have already received the LSA. However, in these cases the flooding procedure must be absolutely sure that the neighbors eventually do receive the LSA, so the LSA is still added to each adjacency's Link state retransmission list. For each eligible interface:
链接状态数据库必须在与上述合格接口相关联的所有邻接上保持同步。这是通过在每个符合条件的接口上执行以下步骤来实现的。应该注意的是,如果连接的邻居很有可能已经接收到LSA,则该过程可能决定不将LSA从特定接口溢出。然而,在这些情况下,泛洪过程必须绝对确保邻居最终确实接收到LSA,因此LSA仍然被添加到每个邻接的链路状态重传列表中。对于每个合格接口:
(1) Each of the neighbors attached to this interface are examined, to determine whether they must receive the new LSA. The following steps are executed for each neighbor:
(1) 将检查连接到此接口的每个邻居,以确定它们是否必须接收新的LSA。对每个邻居执行以下步骤:
(a) If the neighbor is in a lesser state than Exchange, it does not participate in flooding, and the next neighbor should be examined.
(a) 如果邻居的状态低于Exchange,则它不会参与泛洪,应该检查下一个邻居。
(b) Else, if the adjacency is not yet full (neighbor state is Exchange or Loading), examine the Link state request list associated with this adjacency. If there is an instance of the new LSA on the list, it indicates that the neighboring router has an instance of the LSA already. Compare the new LSA to the neighbor's copy:
(b) 否则,如果邻接尚未满(邻居状态为Exchange或Loading),请检查与此邻接关联的链接状态请求列表。如果列表上有新LSA的实例,则表示相邻路由器已经有一个LSA实例。将新LSA与邻居的副本进行比较:
o If the new LSA is less recent, then examine the next neighbor.
o 如果新的LSA不是最近的,则检查下一个邻居。
o If the two copies are the same instance, then delete the LSA from the Link state request list, and examine the next neighbor.[20]
o 如果两个副本是相同的实例,则从链路状态请求列表中删除LSA,并检查下一个邻居。[20]
o Else, the new LSA is more recent. Delete the LSA from the Link state request list.
o 除此之外,新的LSA是较新的。从链路状态请求列表中删除LSA。
(c) If the new LSA was received from this neighbor, examine the next neighbor.
(c) 如果新的LSA是从这个邻居收到的,请检查下一个邻居。
(d) At this point we are not positive that the neighbor has an up-to-date instance of this new LSA. Add the new LSA to the Link state retransmission list for the adjacency. This ensures that the flooding procedure is reliable; the LSA will be retransmitted at intervals until an acknowledgment is seen from the neighbor.
(d) 在这一点上,我们不能肯定邻居是否有这个新LSA的最新实例。将新LSA添加到邻接的链路状态重传列表中。这确保了注水程序的可靠性;LSA将每隔一段时间重新传输,直到邻居发出确认。
(2) The router must now decide whether to flood the new LSA out this interface. If in the previous step, the LSA was NOT added to any of the Link state retransmission lists, there is no need to flood the LSA out the interface and the next interface should be examined.
(2) 路由器现在必须决定是否将新LSA从该接口溢出。如果在上一步骤中,没有将LSA添加到任何链路状态重传列表中,则不需要将LSA从接口中溢出,并且应该检查下一个接口。
(3) If the new LSA was received on this interface, and it was received from either the Designated Router or the Backup Designated Router, chances are that all the neighbors have received the LSA already. Therefore, examine the next interface.
(3) 如果在该接口上接收到新的LSA,并且该LSA是从指定的路由器或备份指定的路由器接收的,则所有邻居都可能已经接收到LSA。因此,请检查下一个接口。
(4) If the new LSA was received on this interface, and the interface state is Backup (i.e., the router itself is the Backup Designated Router), examine the next interface. The Designated Router will do the flooding on this interface. However, if the Designated Router fails the router (i.e., the Backup Designated Router) will end up retransmitting the updates.
(4) 如果在此接口上接收到新的LSA,并且接口状态为备份(即路由器本身是备份指定的路由器),请检查下一个接口。指定的路由器将在此接口上执行泛洪操作。但是,如果指定路由器出现故障,路由器(即备份指定路由器)将重新传输更新。
(5) If this step is reached, the LSA must be flooded out the interface. Send a Link State Update packet (including the new LSA as contents) out the interface. The LSA's LS age must be incremented by InfTransDelay (which must be > 0) when it is copied into the outgoing Link State Update packet (until the LS age field reaches the maximum value of MaxAge).
(5) 如果达到此步骤,LSA必须从接口中溢出。向接口发送链路状态更新包(包括新的LSA作为内容)。LSA的LS age在复制到传出链路状态更新数据包时必须增加InfTransDelay(必须大于0)(直到LS age字段达到最大值MaxAge)。
On broadcast networks, the Link State Update packets are multicast. The destination IP address specified for the Link State Update Packet depends on the state of the interface. If the interface state is DR or Backup, the
在广播网络上,链路状态更新包是多播的。为链路状态更新数据包指定的目标IP地址取决于接口的状态。如果接口状态为灾难恢复或备份,则
address AllSPFRouters should be used. Otherwise, the address AllDRouters should be used.
应使用地址ALSPFROUTERS。否则,应使用AllDrooter的地址。
On non-broadcast networks, separate Link State Update packets must be sent, as unicasts, to each adjacent neighbor (i.e., those in state Exchange or greater). The destination IP addresses for these packets are the neighbors' IP addresses.
在非广播网络上,必须将单独的链路状态更新数据包作为单播发送到每个相邻的邻居(即处于状态交换或更高状态的邻居)。这些数据包的目标IP地址是邻居的IP地址。
13.4. Receiving self-originated LSAs
13.4. 接收自创LSA
It is a common occurrence for a router to receive self-originated LSAs via the flooding procedure. A self-originated LSA is detected when either 1) the LSA's Advertising Router is equal to the router's own Router ID or 2) the LSA is a network-LSA and its Link State ID is equal to one of the router's own IP interface addresses.
路由器通常通过泛洪过程接收自创LSA。当1)LSA的广告路由器等于路由器自己的路由器ID或2)LSA是网络LSA且其链路状态ID等于路由器自己的IP接口地址之一时,检测到自创LSA。
However, if the received self-originated LSA is newer than the last instance that the router actually originated, the router must take special action. The reception of such an LSA indicates that there are LSAs in the routing domain that were originated by the router before the last time it was restarted. In most cases, the router must then advance the LSA's LS sequence number one past the received LS sequence number, and originate a new instance of the LSA.
但是,如果收到的自发端LSA比路由器实际发端的最后一个实例要新,路由器必须采取特殊措施。接收到这样的LSA表示路由域中存在在路由器上次重新启动之前由路由器发起的LSA。在大多数情况下,路由器必须将LSA的LS序列号提前1,超过接收到的LS序列号,并发起LSA的新实例。
It may be the case the router no longer wishes to originate the received LSA. Possible examples include: 1) the LSA is a summary-LSA or AS-external-LSA and the router no longer has an (advertisable) route to the destination, 2) the LSA is a network-LSA but the router is no longer Designated Router for the network or 3) the LSA is a network-LSA whose Link State ID is one of the router's own IP interface addresses but whose Advertising Router is not equal to the router's own Router ID (this latter case should be rare, and it indicates that the router's Router ID has changed since originating the LSA). In all these cases, instead of updating the LSA, the LSA should be flushed from the routing domain by incrementing the received LSA's LS age to MaxAge and reflooding (see Section 14.1).
路由器可能不再希望发起接收到的LSA。可能的示例包括:1)LSA是摘要LSA或作为外部LSA,并且路由器不再具有到目的地的(可通告的)路由,2)LSA是网络LSA,但路由器不再是网络的指定路由器;或3)LSA是网络LSA,其链路状态ID是路由器自己的IP接口地址之一,但其广告路由器不等于路由器自己的路由器ID(后一种情况应该是罕见的,它表明路由器的路由器ID在发起LSA后发生了变化)。在所有这些情况下,不更新LSA,而应该通过将接收到的LSA的LS age增加到MaxAge并重新加载来从路由域刷新LSA(见第14.1节)。
13.5. Sending Link State Acknowledgment packets
13.5. 发送链路状态确认数据包
Each newly received LSA must be acknowledged. This is usually done by sending Link State Acknowledgment packets. However, acknowledgments can also be accomplished implicitly by sending Link State Update packets (see step 7a of Section 13).
必须确认每个新收到的LSA。这通常通过发送链路状态确认数据包来完成。然而,也可以通过发送链路状态更新包隐式地完成确认(参见第13节的步骤7a)。
Many acknowledgments may be grouped together into a single Link State Acknowledgment packet. Such a packet is sent back out the interface which received the LSAs. The packet can be sent in one of two ways: delayed and sent on an interval timer, or sent directly to a particular neighbor. The particular acknowledgment strategy used depends on the circumstances surrounding the receipt of the LSA.
许多确认可以组合到一个链路状态确认包中。这样的数据包被发送回接收LSA的接口。数据包可以通过两种方式之一发送:延迟并在间隔计时器上发送,或者直接发送到特定的邻居。所使用的特定确认策略取决于接收LSA的环境。
Sending delayed acknowledgments accomplishes several things: 1) it facilitates the packaging of multiple acknowledgments in a single Link State Acknowledgment packet, 2) it enables a single Link State Acknowledgment packet to indicate acknowledgments to several neighbors at once (through multicasting) and 3) it randomizes the Link State Acknowledgment packets sent by the various routers attached to a common network. The fixed interval between a router's delayed transmissions must be short (less than RxmtInterval) or needless retransmissions will ensue.
发送延迟确认可完成以下几件事:1)它有助于将多个确认打包到单个链路状态确认数据包中,2)它使单个链路状态确认数据包能够同时向多个邻居指示确认(通过多播)以及3)它随机化连接到公共网络的各种路由器发送的链路状态确认包。路由器延迟传输之间的固定间隔必须很短(小于RxmtInterval),否则将导致不必要的重新传输。
Direct acknowledgments are sent directly to a particular neighbor in response to the receipt of duplicate LSAs. Direct acknowledgments are sent immediately when the duplicate is received. On multi-access networks, these acknowledgments are sent directly to the neighbor's IP address.
直接确认直接发送到特定的邻居,以响应重复LSA的接收。收到副本后立即发送直接确认。在多址网络上,这些确认直接发送到邻居的IP地址。
The precise procedure for sending Link State Acknowledgment packets is described in Table 19. The circumstances surrounding the receipt of the LSA are listed in the left column. The acknowledgment action then taken is listed in one of the two right columns. This action depends on the state of the concerned interface; interfaces in state Backup behave differently from interfaces in all other states. Delayed acknowledgments must be delivered to all adjacent routers associated with the interface. On broadcast networks, this is accomplished by sending the delayed Link State Acknowledgment packets as multicasts. The Destination IP address used depends
表19中描述了发送链路状态确认包的精确过程。左栏列出了收到LSA的相关情况。然后执行的确认操作列在右侧两列中的一列中。此操作取决于相关接口的状态;状态备份中的接口与所有其他状态中的接口行为不同。延迟确认必须发送到与接口相关的所有相邻路由器。在广播网络上,这是通过将延迟链路状态确认包作为多播发送来实现的。使用的目标IP地址取决于
Action taken in state Circumstances Backup All other states _________________________________________________________________ LSA has No acknowledgment No acknowledgment been flooded back sent. sent. out receiving in- terface (see Sec- tion 13, step 5b). _________________________________________________________________ LSA is Delayed acknowledg- Delayed ack- more recent than ment sent if adver- nowledgment sent. database copy, but tisement received was not flooded from Designated back out receiving Router, otherwise interface do nothing _________________________________________________________________ LSA is a Delayed acknowledg- No acknowledgment duplicate, and was ment sent if adver- sent. treated as an im- tisement received plied acknowledg- from Designated ment (see Section Router, otherwise 13, step 7a). do nothing _________________________________________________________________ LSA is a Direct acknowledg- Direct acknowledg- duplicate, and was ment sent. ment sent. not treated as an implied ack- nowledgment. _________________________________________________________________ LSA's LS Direct acknowledg- Direct acknowledg- age is equal to ment sent. ment sent. MaxAge, and there is no current instance of the LSA in the link state database, and none of router's neighbors are in states Exchange
Action taken in state Circumstances Backup All other states _________________________________________________________________ LSA has No acknowledgment No acknowledgment been flooded back sent. sent. out receiving in- terface (see Sec- tion 13, step 5b). _________________________________________________________________ LSA is Delayed acknowledg- Delayed ack- more recent than ment sent if adver- nowledgment sent. database copy, but tisement received was not flooded from Designated back out receiving Router, otherwise interface do nothing _________________________________________________________________ LSA is a Delayed acknowledg- No acknowledgment duplicate, and was ment sent if adver- sent. treated as an im- tisement received plied acknowledg- from Designated ment (see Section Router, otherwise 13, step 7a). do nothing _________________________________________________________________ LSA is a Direct acknowledg- Direct acknowledg- duplicate, and was ment sent. ment sent. not treated as an implied ack- nowledgment. _________________________________________________________________ LSA's LS Direct acknowledg- Direct acknowledg- age is equal to ment sent. ment sent. MaxAge, and there is no current instance of the LSA in the link state database, and none of router's neighbors are in states Exchange
or Loading (see Section 13, step 4).
或装载(见第13节第4步)。
Table 19: Sending link state acknowledgements.
表19:发送链路状态确认。
on the state of the interface. If the interface state is DR or Backup, the destination AllSPFRouters is used. In all other states, the destination AllDRouters is used. On non-broadcast networks, delayed Link State Acknowledgment packets must be unicast separately over each adjacency (i.e., neighbor whose state is >= Exchange).
关于接口的状态。如果接口状态为DR或Backup,则使用目标AllSPFRouters。在所有其他州,使用目的地AllDrooter。在非广播网络上,延迟链路状态确认数据包必须在每个邻接(即状态为>=交换的邻居)上单独单播。
The reasoning behind sending the above packets as multicasts is best explained by an example. Consider the network configuration depicted in Figure 15. Suppose RT4 has been elected as Designated Router, and RT3 as Backup Designated Router for the network N3. When Router RT4 floods a new LSA to Network N3, it is received by routers RT1, RT2, and RT3. These routers will not flood the LSA back onto net N3, but they still must ensure that their link-state databases remain synchronized with their adjacent neighbors. So RT1, RT2, and RT4 are waiting to see an acknowledgment from RT3. Likewise, RT4 and RT3 are both waiting to see acknowledgments from RT1 and RT2. This is best achieved by sending the acknowledgments as multicasts.
作为多播发送上述数据包背后的原因最好通过一个例子来解释。考虑图15中描述的网络配置。假设RT4被选为指定路由器,RT3被选为网络N3的备份指定路由器。当路由器RT4将新的LSA洪泛到网络N3时,它被路由器RT1、RT2和RT3接收。这些路由器将不会将LSA洪泛回网络N3,但它们仍然必须确保其链路状态数据库与其相邻的邻居保持同步。所以RT1、RT2和RT4正在等待来自RT3的确认。同样,RT4和RT3都在等待来自RT1和RT2的确认。这最好通过多播发送确认来实现。
The reason that the acknowledgment logic for Backup DRs is slightly different is because they perform differently during the flooding of LSAs (see Section 13.3, step 4).
备份DRs的确认逻辑略有不同的原因是,它们在LSA泛洪期间的执行情况不同(请参阅第13.3节,步骤4)。
13.6. Retransmitting LSAs
13.6. 重传lsa
LSAs flooded out an adjacency are placed on the adjacency's Link state retransmission list. In order to ensure that flooding is reliable, these LSAs are retransmitted until they are acknowledged. The length of time between retransmissions is a configurable per-interface value, RxmtInterval. If this is set
淹没邻接的LSA被放置在邻接的链路状态重传列表中。为了确保泛洪是可靠的,将重新传输这些LSA,直到它们被确认。重新传输之间的时间长度是可配置的每个接口值RxmtInterval。如果设置了此选项
too low for an interface, needless retransmissions will ensue. If the value is set too high, the speed of the flooding, in the face of lost packets, may be affected.
对于接口来说太低,不必要的重新传输将随之发生。如果该值设置得太高,则面对丢失的数据包,泛洪的速度可能会受到影响。
Several retransmitted LSAs may fit into a single Link State Update packet. When LSAs are to be retransmitted, only the number fitting in a single Link State Update packet should be sent. Another packet of retransmissions can be sent whenever some of the LSAs are acknowledged, or on the next firing of the retransmission timer.
多个重传的lsa可适合于单个链路状态更新分组。当要重新传输LSA时,只应发送适合单个链路状态更新数据包的号码。每当一些lsa被确认时或在重传定时器的下一次触发时,可以发送另一个重传分组。
Link State Update Packets carrying retransmissions are always sent directly to the neighbor. On multi-access networks, this means that retransmissions are sent directly to the neighbor's IP address. Each LSA's LS age must be incremented by InfTransDelay (which must be > 0) when it is copied into the outgoing Link State Update packet (until the LS age field reaches the maximum value of MaxAge).
承载重传的链路状态更新数据包始终直接发送到邻居。在多址网络上,这意味着重传将直接发送到邻居的IP地址。当将每个LSA的LS age复制到传出链路状态更新数据包中时(直到LS age字段达到最大值MaxAge),必须将其增量为InfTransDelay(必须大于0)。
If an adjacent router goes down, retransmissions may occur until the adjacency is destroyed by OSPF's Hello Protocol. When the adjacency is destroyed, the Link state retransmission list is cleared.
如果相邻路由器发生故障,可能会发生重传,直到相邻路由器被OSPF的Hello协议破坏。当邻接被破坏时,链路状态重传列表被清除。
13.7. Receiving link state acknowledgments
13.7. 接收链路状态确认
Many consistency checks have been made on a received Link State Acknowledgment packet before it is handed to the flooding procedure. In particular, it has been associated with a particular neighbor. If this neighbor is in a lesser state than Exchange, the Link State Acknowledgment packet is discarded.
在将接收到的链路状态确认数据包交给泛洪过程之前,已经对其进行了许多一致性检查。特别是,它与一个特定的邻居相关联。如果该邻居的状态低于Exchange,则丢弃链路状态确认数据包。
Otherwise, for each acknowledgment in the Link State Acknowledgment packet, the following steps are performed:
否则,对于链路状态确认包中的每个确认,执行以下步骤:
o Does the LSA acknowledged have an instance on the Link state retransmission list for the neighbor? If not, examine the next acknowledgment. Otherwise:
o LSA确认在邻居的链路状态重传列表上是否有实例?如果没有,请检查下一个确认。否则:
o If the acknowledgment is for the same instance that is contained on the list, remove the item from the list and examine the next acknowledgment. Otherwise:
o 如果确认与列表中包含的实例相同,请从列表中删除该项并检查下一个确认。否则:
o Log the questionable acknowledgment, and examine the next one.
o 记录有问题的确认,并检查下一个确认。
Each LSA has an LS age field. The LS age is expressed in seconds. An LSA's LS age field is incremented while it is contained in a router's database. Also, when copied into a Link State Update Packet for flooding out a particular interface, the LSA's LS age is incremented by InfTransDelay.
每个LSA都有一个LS年龄字段。LS年龄以秒表示。LSA的LS age字段在包含在路由器数据库中时递增。此外,当复制到链路状态更新数据包以溢出特定接口时,LSA的LS age将增加InfTransDelay。
An LSA's LS age is never incremented past the value MaxAge. LSAs having age MaxAge are not used in the routing table calculation. As a router ages its link state database, an LSA's LS age may reach MaxAge.[21] At this time, the router must attempt to flush the LSA from the routing domain. This is done simply by reflooding the MaxAge LSA just as if it was a newly originated LSA (see Section 13.3).
LSA的LS age的增量永远不会超过值MaxAge。路由表计算中不使用年龄最大的LSA。当路由器老化其链路状态数据库时,LSA的LS老化可能达到最大老化。[21]此时,路由器必须尝试从路由域刷新LSA。这只需将MaxAge LSA重新涂上,就好像它是一个新推出的LSA一样(见第13.3节)。
When creating a Database summary list for a newly forming adjacency, any MaxAge LSAs present in the link state database are added to the neighbor's Link state retransmission list instead of the neighbor's Database summary list. See Section 10.3 for more details.
为新形成的邻接创建数据库摘要列表时,链路状态数据库中存在的任何MaxAge LSA都将添加到邻居的链路状态重传列表中,而不是添加到邻居的数据库摘要列表中。详见第10.3节。
A MaxAge LSA must be removed immediately from the router's link state database as soon as both a) it is no longer contained on any neighbor Link state retransmission lists and b) none of the router's neighbors are in states Exchange or Loading.
一旦A)MaxAge LSA不再包含在任何邻居链路状态重传列表中,以及b)路由器的邻居均未处于交换或加载状态,则必须立即从路由器的链路状态数据库中删除MaxAge LSA。
When, in the process of aging the link state database, an LSA's LS age hits a multiple of CheckAge, its LS checksum should be verified. If the LS checksum is incorrect, a program or memory error has been detected, and at the very least the router itself should be restarted.
在老化链路状态数据库的过程中,当LSA的LS age达到校验的倍数时,应验证其LS校验和。如果LS校验和不正确,则检测到程序或内存错误,至少路由器本身应该重新启动。
14.1. Premature aging of LSAs
14.1. LSA的过早老化
An LSA can be flushed from the routing domain by setting its LS age to MaxAge, while leaving its LS sequence number alone, and then reflooding the LSA. This procedure follows the same course as flushing an LSA whose LS age has naturally reached the value MaxAge (see Section 14). In particular, the MaxAge LSA is removed from the router's link state database as soon as a) it is no longer contained on any neighbor Link state retransmission lists and b) none of the router's neighbors are in states Exchange or Loading. We call the setting of an LSA's LS age to MaxAge "premature aging".
通过将LSA的LS age设置为MaxAge,而不使用其LS序列号,然后重新加载LSA,可以从路由域刷新LSA。该程序遵循与冲洗LS age自然达到最大值的LSA相同的过程(见第14节)。特别是,只要a)MaxAge LSA不再包含在任何邻居链路状态重传列表中,并且b)路由器的邻居没有处于交换或加载状态,MaxAge LSA就会从路由器的链路状态数据库中删除。我们将LSA的LS age设置为MaxAge称为“过早老化”。
Premature aging is used when it is time for a self-originated LSA's sequence number field to wrap. At this point, the current LSA instance (having LS sequence number MaxSequenceNumber) must be prematurely aged and flushed from the routing domain before a new instance with sequence number equal to InitialSequenceNumber can be originated. See Section 12.1.6 for more information.
当自创LSA的序列号字段需要换行时,使用过早老化。此时,当前LSA实例(具有LS序列号MaxSequenceNumber)必须提前老化并从路由域刷新,然后才能生成序列号等于InitialSequenceNumber的新实例。详见第12.1.6节。
Premature aging can also be used when, for example, one of the router's previously advertised external routes is no longer reachable. In this circumstance, the router can flush its AS-external-LSA from the routing domain via premature aging. This procedure is preferable to the alternative, which is to originate a new LSA for the destination specifying a metric of LSInfinity. Premature aging is also be used when unexpectedly receiving self-originated LSAs during the flooding procedure (see Section 13.4).
例如,当路由器先前公布的外部路由之一不再可到达时,也可使用过早老化。在这种情况下,路由器可以通过提前老化将其作为外部LSA从路由域刷新。此过程比另一种方法更可取,即为指定LSInfinity度量的目的地创建新的LSA。在注水过程中意外接收自产LSA时,也可使用过早老化(见第13.4节)。
A router may only prematurely age its own self-originated LSAs. The router may not prematurely age LSAs that have been originated by other routers. An LSA is considered self-originated when either 1) the LSA's Advertising Router is equal to the router's own Router ID or 2) the LSA is a network-LSA and its Link State ID is equal to one of the router's own IP interface addresses.
路由器可能只会过早地老化自己的源于自身的LSA。路由器不得过早老化由其他路由器发起的LSA。当1)LSA的广告路由器等于路由器自己的路由器ID或2)LSA是网络LSA且其链路状态ID等于路由器自己的IP接口地址之一时,LSA被认为是自始的。
The single backbone area (Area ID = 0.0.0.0) cannot be disconnected, or some areas of the Autonomous System will become unreachable. To establish/maintain connectivity of the backbone, virtual links can be configured through non-backbone areas. Virtual links serve to connect physically separate components of the backbone. The two endpoints of a virtual link are area border routers. The virtual link must be configured in both routers. The configuration information in each router consists of the other virtual endpoint (the other area border router), and the non-backbone area the two routers have in common (called the Transit area). Virtual links cannot be configured through stub areas (see Section 3.6).
无法断开单个主干区域(区域ID=0.0.0.0)的连接,否则自治系统的某些区域将无法访问。为了建立/维护主干网的连接,可以通过非主干网区域配置虚拟链路。虚拟链路用于连接主干的物理上独立的组件。虚拟链路的两个端点是区域边界路由器。必须在两个路由器中配置虚拟链路。每个路由器中的配置信息由另一个虚拟端点(另一个区域边界路由器)和两个路由器共有的非主干区域(称为传输区域)组成。虚拟链路不能通过存根区域进行配置(见第3.6节)。
The virtual link is treated as if it were an unnumbered point-to-point network belonging to the backbone and joining the two area border routers. An attempt is made to establish an adjacency over the virtual link. When this adjacency is established, the virtual link will be included in backbone router-LSAs, and OSPF packets pertaining to the backbone area will flow over the adjacency. Such an adjacency has been referred to in this document as a "virtual adjacency".
虚拟链路被视为属于主干网并连接两个区域边界路由器的未编号点对点网络。试图在虚拟链接上建立邻接关系。当建立该邻接时,虚拟链路将包括在主干路由器lsa中,并且与主干区域相关的OSPF分组将在该邻接上流动。这种邻接在本文件中称为“虚拟邻接”。
In each endpoint router, the cost and viability of the virtual link is discovered by examining the routing table entry for the other endpoint router. (The entry's associated area must be the configured Transit area). This is called the virtual link's corresponding routing table entry. The InterfaceUp event occurs for a virtual link when its corresponding routing table entry becomes reachable. Conversely, the InterfaceDown event occurs when its routing table entry becomes unreachable. In other words, the virtual link's viability is determined by the existence of an intra-area path, through the Transit area, between the two endpoints. Note that a virtual link whose underlying path has cost greater than hexadecimal 0xffff (the maximum size of an interface cost in a router-LSA) should be considered inoperational (i.e., treated the same as if the path did not exist).
在每个端点路由器中,通过检查另一个端点路由器的路由表条目来发现虚拟链路的成本和可行性。(入口的关联区域必须是配置的中转区域)。这称为虚拟链路的相应路由表条目。当虚拟链路的相应路由表条目变得可访问时,会发生InterfaceUp事件。相反,InterfaceDown事件在其路由表条目变得不可访问时发生。换句话说,虚拟链路的生存能力取决于两个端点之间存在一条穿过中转区的区域内路径。请注意,其基础路径的开销大于十六进制0xffff(路由器LSA中接口开销的最大大小)的虚拟链路应视为不可操作(即,视为路径不存在)。
The other details concerning virtual links are as follows:
有关虚拟链接的其他详细信息如下:
o AS-external-LSAs are NEVER flooded over virtual adjacencies. This would be duplication of effort, since the same AS-
o 因为外部LSA永远不会淹没在虚拟邻接上。这将是重复的工作,因为-
external-LSAs are already flooded throughout the virtual link's Transit area. For this same reason, AS-external-LSAs are not summarized over virtual adjacencies during the Database Exchange process.
外部LSA已经充斥整个虚拟链路的传输区域。出于同样的原因,在数据库交换过程中,外部LSA不会在虚拟邻接上汇总。
o The cost of a virtual link is NOT configured. It is defined to be the cost of the intra-area path between the two defining area border routers. This cost appears in the virtual link's corresponding routing table entry. When the cost of a virtual link changes, a new router-LSA should be originated for the backbone area.
o 未配置虚拟链路的成本。它被定义为两个定义区域边界路由器之间的区域内路径的成本。此开销显示在虚拟链路的相应路由表条目中。当虚拟链路的成本发生变化时,应为主干区域创建一个新的路由器LSA。
o Just as the virtual link's cost and viability are determined by the routing table build process (through construction of the routing table entry for the other endpoint), so are the IP interface address for the virtual interface and the virtual neighbor's IP address. These are used when sending OSPF protocol packets over the virtual link. Note that when one (or both) of the virtual link endpoints connect to the Transit area via an unnumbered point-to-point link, it may be impossible to calculate either the virtual interface's IP address and/or the virtual neighbor's IP address, thereby causing the virtual link to fail.
o 正如虚拟链路的成本和生存能力由路由表构建过程(通过为另一个端点构建路由表条目)决定一样,虚拟接口的IP接口地址和虚拟邻居的IP地址也是如此。当通过虚拟链路发送OSPF协议数据包时,将使用这些数据包。请注意,当一个(或两个)虚拟链路端点通过未编号的点到点链路连接到传输区域时,可能无法计算虚拟接口的IP地址和/或虚拟邻居的IP地址,从而导致虚拟链路失败。
o In each endpoint's router-LSA for the backbone, the virtual link is represented as a Type 4 link whose Link ID is set to the virtual neighbor's OSPF Router ID and whose Link Data is set to the virtual interface's IP address. See Section 12.4.1 for more information.
o 在每个端点的主干路由器LSA中,虚拟链路表示为类型4链路,其链路ID设置为虚拟邻居的OSPF路由器ID,其链路数据设置为虚拟接口的IP地址。详见第12.4.1节。
o A non-backbone area can carry transit data traffic (i.e., is considered a "transit area") if and only if it serves as the Transit area for one or more fully adjacent virtual links (see TransitCapability in Sections 6 and 16.1). Such an area requires special treatment when summarizing backbone networks into it (see Section 12.4.3), and during the routing calculation (see Section 16.3).
o 当且仅当非主干区域作为一个或多个完全相邻的虚拟链路的传输区域时(参见第6节和第16.1节中的传输能力),非主干区域可以承载传输数据流量(即,被视为“传输区域”)。在将主干网汇总到该区域时(见第12.4.3节),以及在路由计算期间(见第16.3节),需要对该区域进行特殊处理。
o The time between link state retransmissions, RxmtInterval, is configured for a virtual link. This should be well over the expected round-trip delay between the two routers. This may be
o 为虚拟链路配置链路状态重新传输之间的时间RxmtInterval。这应该远远超过两个路由器之间预期的往返延迟。这可能是
hard to estimate for a virtual link; it is better to err on the side of making it too large.
难以估计虚拟链路;宁可把它弄得太大。
This section details the OSPF routing table calculation. Using its attached areas' link state databases as input, a router runs the following algorithm, building its routing table step by step. At each step, the router must access individual pieces of the link state databases (e.g., a router-LSA originated by a certain router). This access is performed by the lookup function discussed in Section 12.2. The lookup process may return an LSA whose LS age is equal to MaxAge. Such an LSA should not be used in the routing table calculation, and is treated just as if the lookup process had failed.
本节详细介绍OSPF路由表的计算。路由器使用其连接区域的链路状态数据库作为输入,运行以下算法,逐步建立其路由表。在每个步骤中,路由器必须访问链路状态数据库的各个部分(例如,由某个路由器发起的路由器LSA)。该访问由第12.2节中讨论的查找功能执行。查找过程可能返回LS age等于MaxAge的LSA。这样的LSA不应用于路由表计算,而应被视为查找过程失败。
The OSPF routing table's organization is explained in Section 11. Two examples of the routing table build process are presented in Sections 11.2 and 11.3. This process can be broken into the following steps:
第11节解释了OSPF路由表的组织。第11.2节和第11.3节介绍了路由表构建过程的两个示例。此过程可分为以下步骤:
(1) The present routing table is invalidated. The routing table is built again from scratch. The old routing table is saved so that changes in routing table entries can be identified.
(1) 当前路由表无效。路由表是从头开始重新构建的。将保存旧路由表,以便可以识别路由表条目中的更改。
(2) The intra-area routes are calculated by building the shortest-path tree for each attached area. In particular, all routing table entries whose Destination Type is "area border router" are calculated in this step. This step is described in two parts. At first the tree is constructed by only considering those links between routers and transit networks. Then the stub networks are incorporated into the tree. During the area's shortest-path tree calculation, the area's TransitCapability is also calculated for later use in Step 4.
(2) 通过为每个附加区域构建最短路径树来计算区域内路由。特别是,目标类型为“区域边界路由器”的所有路由表条目在此步骤中计算。该步骤分两部分描述。该树首先只考虑路由器和公交网络之间的链路。然后将存根网络合并到树中。在该区域的最短路径树计算过程中,还将计算该区域的可传输性,以便稍后在步骤4中使用。
(3) The inter-area routes are calculated, through examination of summary-LSAs. If the router is attached to multiple areas (i.e., it is an area border router), only backbone summary-LSAs are examined.
(3) 通过检查汇总LSA,计算区域间路线。如果路由器连接到多个区域(即,它是一个区域边界路由器),则只检查主干概要LSA。
(4) In area border routers connecting to one or more transit areas (i.e, non-backbone areas whose TransitCapability is found to be TRUE), the transit areas' summary-LSAs are examined to see whether better paths exist using the transit areas than were found in Steps 2-3 above.
(4) 在连接到一个或多个中转区的区域边界路由器(即,发现其中转能力为真的非主干区)中,检查中转区的汇总LSA,以查看使用中转区是否存在比上述步骤2-3中发现的更好的路径。
(5) Routes to external destinations are calculated, through examination of AS-external-LSAs. The locations of the AS boundary routers (which originate the AS-external-LSAs) have been determined in steps 2-4.
(5) 通过检查AS外部LSA,计算到外部目的地的路线。AS边界路由器(源自AS外部LSA)的位置已在步骤2-4中确定。
Steps 2-5 are explained in further detail below.
下面将进一步详细说明步骤2-5。
Changes made to routing table entries as a result of these calculations can cause the OSPF protocol to take further actions. For example, a change to an intra-area route will cause an area border router to originate new summary-LSAs (see Section 12.4). See Section 16.7 for a complete list of the OSPF protocol actions resulting from routing table changes.
由于这些计算而对路由表条目所做的更改可能会导致OSPF协议采取进一步的措施。例如,对区域内路由的更改将导致区域边界路由器发起新的摘要LSA(参见第12.4节)。有关路由表更改导致的OSPF协议操作的完整列表,请参见第16.7节。
16.1. Calculating the shortest-path tree for an area
16.1. 计算区域的最短路径树
This calculation yields the set of intra-area routes associated with an area (called hereafter Area A). A router calculates the shortest-path tree using itself as the root.[22] The formation of the shortest path tree is done here in two stages. In the first stage, only links between routers and transit networks are considered. Using the Dijkstra algorithm, a tree is formed from this subset of the link state database. In the second stage, leaves are added to the tree by considering the links to stub networks.
此计算产生与区域(以下称为区域A)关联的区域内路由集。路由器以自身为根计算最短路径树。[22]最短路径树的形成分两个阶段进行。在第一阶段,只考虑路由器和公交网络之间的链路。使用Dijkstra算法,从链路状态数据库的子集形成一棵树。在第二阶段,通过考虑到存根网络的链接,将叶子添加到树中。
The procedure will be explained using the graph terminology that was introduced in Section 2. The area's link state database is represented as a directed graph. The graph's vertices are routers, transit networks and stub networks. The first stage of the procedure concerns only the transit vertices (routers and transit networks) and their connecting links. Throughout the shortest path calculation, the following data is also associated with each transit vertex:
将使用第2节中介绍的图形术语解释该过程。区域的链接状态数据库表示为有向图。图的顶点是路由器、运输网络和存根网络。该过程的第一阶段仅涉及运输顶点(路由器和运输网络)及其连接链路。在整个最短路径计算过程中,以下数据也与每个过渡顶点关联:
Vertex (node) ID A 32-bit number which together with the vertex type (router or network) uniquely identifies the vertex. For router vertices the Vertex ID is the router's OSPF Router ID. For network vertices, it is the IP address of the network's Designated Router.
顶点(节点)ID一个32位数字,与顶点类型(路由器或网络)一起唯一标识顶点。对于路由器顶点,顶点ID是路由器的OSPF路由器ID。对于网络顶点,它是网络指定路由器的IP地址。
An LSA Each transit vertex has an associated LSA. For router vertices, this is a router-LSA. For transit networks, this is a network-LSA (which is actually originated by the network's Designated Router). In any case, the LSA's Link State ID is always equal to the above Vertex ID.
LSA每个过渡顶点都有一个关联的LSA。对于路由器顶点,这是一个路由器LSA。对于公交网络,这是一个网络LSA(实际上由网络的指定路由器发起)。在任何情况下,LSA的链接状态ID始终等于上述顶点ID。
List of next hops The list of next hops for the current set of shortest paths from the root to this vertex. There can be multiple shortest paths due to the equal-cost multipath capability. Each next hop indicates the outgoing router interface to use when forwarding traffic to the destination. On broadcast, Point-to-MultiPoint and NBMA networks, the next hop also includes the IP address of the next router (if any) in the path towards the destination.
下一跳列表当前从根到该顶点的最短路径集的下一跳列表。由于成本相等的多路径能力,可以有多条最短路径。每个下一跳指示将流量转发到目的地时要使用的传出路由器接口。在广播、点对多点和NBMA网络中,下一跳还包括通向目的地的路径中的下一路由器(如果有)的IP地址。
Distance from root The link state cost of the current set of shortest paths from the root to the vertex. The link state cost of a path is calculated as the sum of the costs of the path's constituent links (as advertised in router-LSAs and network-LSAs). One path is said to be "shorter" than another if it has a smaller link state cost.
距离根当前从根到顶点的最短路径集的链接状态开销。路径的链路状态成本计算为路径组成链路的成本之和(如在路由器LSA和网络LSA中公布的)。如果一条路径的链路状态开销较小,则称其比另一条路径“短”。
The first stage of the procedure (i.e., the Dijkstra algorithm) can now be summarized as follows. At each iteration of the algorithm, there is a list of candidate vertices. Paths from the root to these vertices have been found, but not necessarily the shortest ones. However, the paths to the candidate vertex that is closest to the root are guaranteed to be shortest; this vertex is added to the shortest-path tree, removed from the candidate list, and its adjacent vertices are examined for possible addition to/modification of the candidate list. The
该过程的第一阶段(即Dijkstra算法)现在可以总结如下。在算法的每次迭代中,都有一个候选顶点列表。已经找到了从根到这些顶点的路径,但不一定是最短的路径。然而,到最靠近根的候选顶点的路径保证是最短的;该顶点将添加到最短路径树,并从候选列表中删除,其相邻顶点将检查是否可能添加/修改候选列表。这个
algorithm then iterates again. It terminates when the candidate list becomes empty.
算法然后再次迭代。当候选列表变为空时,它终止。
The following steps describe the algorithm in detail. Remember that we are computing the shortest path tree for Area A. All references to link state database lookup below are from Area A's database.
以下步骤详细描述了该算法。请记住,我们正在计算区域A的最短路径树。下面链接状态数据库查找的所有引用都来自区域A的数据库。
(1) Initialize the algorithm's data structures. Clear the list of candidate vertices. Initialize the shortest-path tree to only the root (which is the router doing the calculation). Set Area A's TransitCapability to FALSE.
(1) 初始化算法的数据结构。清除候选顶点列表。仅将最短路径树初始化为根(即执行计算的路由器)。将区域A的可传输性设置为FALSE。
(2) Call the vertex just added to the tree vertex V. Examine the LSA associated with vertex V. This is a lookup in the Area A's link state database based on the Vertex ID. If this is a router-LSA, and bit V of the router-LSA (see Section A.4.2) is set, set Area A's TransitCapability to TRUE. In any case, each link described by the LSA gives the cost to an adjacent vertex. For each described link, (say it joins vertex V to vertex W):
(2) 调用刚刚添加到树顶点V的顶点。检查与顶点V关联的LSA。这是基于顶点ID在区域a的链接状态数据库中的查找。如果这是路由器LSA,并且设置了路由器LSA的位V(参见第a.4.2节),则将区域a的TransitCapability设置为TRUE。在任何情况下,LSA描述的每个链接都会给相邻顶点带来成本。对于所描述的每个链接,(假设它将顶点V连接到顶点W):
(a) If this is a link to a stub network, examine the next link in V's LSA. Links to stub networks will be considered in the second stage of the shortest path calculation.
(a) 如果这是到存根网络的链接,请检查V的LSA中的下一个链接。在最短路径计算的第二阶段,将考虑到与存根网络的链接。
(b) Otherwise, W is a transit vertex (router or transit network). Look up the vertex W's LSA (router-LSA or network-LSA) in Area A's link state database. If the LSA does not exist, or its LS age is equal to MaxAge, or it does not have a link back to vertex V, examine the next link in V's LSA.[23]
(b) 否则,W是传输顶点(路由器或传输网络)。在区域A的链路状态数据库中查找顶点W的LSA(路由器LSA或网络LSA)。如果LSA不存在,或者它的LS age等于MaxAge,或者它没有返回顶点V的链接,请检查V的LSA中的下一个链接。[23]
(c) If vertex W is already on the shortest-path tree, examine the next link in the LSA.
(c) 如果顶点W已经位于最短路径树上,请检查LSA中的下一个链接。
(d) Calculate the link state cost D of the resulting path from the root to vertex W. D is equal to the sum of the link state cost of the (already calculated) shortest path to vertex V and the advertised cost of the link between vertices V and W. If D is:
(d) 计算从根到顶点W的结果路径的链接状态成本D。D等于(已计算)到顶点V的最短路径的链接状态成本与顶点V和W之间链接的公布成本之和。如果D为:
o Greater than the value that already appears for vertex W on the candidate list, then examine the next link.
o 大于候选列表上顶点W已显示的值,然后检查下一个链接。
o Equal to the value that appears for vertex W on the candidate list, calculate the set of next hops that result from using the advertised link. Input to this calculation is the destination (W), and its parent (V). This calculation is shown in Section 16.1.1. This set of hops should be added to the next hop values that appear for W on the candidate list.
o 等于候选列表上顶点W的值,计算使用播发链接产生的下一个跃点集。此计算的输入是目标(W)及其父项(V)。该计算如第16.1.1节所示。这组跃点应添加到候选列表上为W显示的下一个跃点值中。
o Less than the value that appears for vertex W on the candidate list, or if W does not yet appear on the candidate list, then set the entry for W on the candidate list to indicate a distance of D from the root. Also calculate the list of next hops that result from using the advertised link, setting the next hop values for W accordingly. The next hop calculation is described in Section 16.1.1; it takes as input the destination (W) and its parent (V).
o 小于候选列表中顶点W的值,或者如果W尚未出现在候选列表中,则在候选列表中为W设置条目,以指示距离根D的距离。还计算由于使用播发链路而产生的下一跳列表,相应地设置W的下一跳值。第16.1.1节描述了下一跳计算;它将目的地(W)及其父对象(V)作为输入。
(3) If at this step the candidate list is empty, the shortest-path tree (of transit vertices) has been completely built and this stage of the procedure terminates. Otherwise, choose the vertex belonging to the candidate list that is closest to the root, and add it to the shortest-path tree (removing it from the candidate list in the process). Note that when there is a choice of vertices closest to the root, network vertices must be chosen before router vertices in order to necessarily find all equal-cost paths. This is consistent with the tie-breakers that were introduced in the modified Dijkstra algorithm used by OSPF's Multicast routing extensions (MOSPF).
(3) 如果在此步骤中,候选列表为空,则(过渡顶点的)最短路径树已完全构建,并且该过程的此阶段终止。否则,选择属于最接近根的候选列表的顶点,并将其添加到最短路径树(在此过程中将其从候选列表中删除)。请注意,当选择最接近根的顶点时,必须在路由器顶点之前选择网络顶点,以便找到所有成本相等的路径。这与OSPF的多播路由扩展(MOSPF)使用的改进Dijkstra算法中引入的连接断路器是一致的。
(4) Possibly modify the routing table. For those routing table entries modified, the associated area will be set to Area A, the path type will be set to intra-area, and the cost will be set to the newly discovered shortest path's calculated distance.
(4) 可能修改路由表。对于修改的路由表条目,关联区域将设置为区域A,路径类型将设置为区域内,成本将设置为新发现的最短路径的计算距离。
If the newly added vertex is an area border router or AS boundary router, a routing table entry is added whose destination type is "router". The Options field found in the associated router-LSA is copied into the routing table entry's Optional capabilities field. Call the newly added vertex Router X. If Router X is the endpoint of one of the calculating router's virtual links, and the virtual link uses Area A as Transit area: the virtual link is declared up, the IP address of the virtual interface is set to the IP address of the outgoing interface calculated above for Router X, and the virtual neighbor's IP address is set to Router X's interface address (contained in Router X's router-LSA) that points back to the root of the shortest-path tree; equivalently, this is the interface that points back to Router X's parent vertex on the shortest-path tree (similar to the calculation in Section 16.1.1).
如果新添加的顶点是区域边界路由器或AS边界路由器,则添加一个目标类型为“路由器”的路由表条目。在关联路由器LSA中找到的选项字段被复制到路由表条目的可选功能字段中。调用新添加的顶点路由器X。如果路由器X是计算路由器的一个虚拟链路的端点,并且虚拟链路使用区域A作为传输区域:虚拟链路被声明,则虚拟接口的IP地址设置为上面为路由器X计算的传出接口的IP地址,虚拟邻居的IP地址设置为路由器X的接口地址(包含在路由器X的路由器LSA中),该地址指向最短路径树的根;等效地,这是指向最短路径树上路由器X的父顶点的接口(类似于第16.1.1节中的计算)。
If the newly added vertex is a transit network, the routing table entry for the network is located. The entry's Destination ID is the IP network number, which can be obtained by masking the Vertex ID (Link State ID) with its associated subnet mask (found in the body of the associated network-LSA). If the routing table entry already exists (i.e., there is already an intra-area route to the destination installed in the routing table), multiple vertices have mapped to the same IP network. For example, this can occur when a new Designated Router is being established. In this case, the current routing table entry should be overwritten if and only if the newly found path is just as short and the current routing table entry's Link State Origin has a smaller Link State ID than the newly added vertex' LSA.
如果新添加的顶点是公交网络,则将找到该网络的路由表条目。该条目的目的地ID是IP网络号,可以通过将顶点ID(链路状态ID)与其关联的子网掩码(在关联的网络LSA主体中找到)屏蔽来获得。如果路由表条目已经存在(即,路由表中已经安装了到目的地的区域内路由),则多个顶点已映射到同一IP网络。例如,在建立新的指定路由器时可能会发生这种情况。在这种情况下,当且仅当新找到的路径同样短且当前路由表项的链接状态原点的链接状态ID小于新添加顶点的LSA时,才应覆盖当前路由表项。
If there is no routing table entry for the network (the usual case), a routing table entry for the IP network should be added. The routing table entry's Link State Origin should be set to the newly added vertex' LSA.
如果网络没有路由表条目(通常情况下),则应添加IP网络的路由表条目。路由表条目的链接状态原点应设置为新添加的顶点的LSA。
(5) Iterate the algorithm by returning to Step 2.
(5) 通过返回步骤2来迭代算法。
The stub networks are added to the tree in the procedure's second stage. In this stage, all router vertices are again examined. Those that have been determined to be unreachable in the above first phase are discarded. For each reachable router vertex (call it V), the associated router-LSA is found in the link state database. Each stub network link appearing in the LSA is then examined, and the following steps are executed:
存根网络将在过程的第二阶段添加到树中。在此阶段,将再次检查所有路由器顶点。在上述第一阶段中被确定为不可到达的那些将被丢弃。对于每个可到达的路由器顶点(称之为V),在链路状态数据库中找到关联的路由器LSA。然后检查LSA中出现的每个存根网络链路,并执行以下步骤:
(1) Calculate the distance D of stub network from the root. D is equal to the distance from the root to the router vertex (calculated in stage 1), plus the stub network link's advertised cost. Compare this distance to the current best cost to the stub network. This is done by looking up the stub network's current routing table entry. If the calculated distance D is larger, go on to examine the next stub network link in the LSA.
(1) 计算存根网络与根的距离D。D等于根到路由器顶点的距离(在阶段1中计算),加上存根网络链路的广告成本。将此距离与存根网络的当前最佳成本进行比较。这是通过查找存根网络的当前路由表条目来完成的。如果计算的距离D较大,则继续检查LSA中的下一个存根网络链路。
(2) If this step is reached, the stub network's routing table entry must be updated. Calculate the set of next hops that would result from using the stub network link. This calculation is shown in Section 16.1.1; input to this calculation is the destination (the stub network) and the parent vertex (the router vertex). If the distance D is the same as the current routing table cost, simply add this set of next hops to the routing table entry's list of next hops. In this case, the routing table already has a Link State Origin. If this Link State Origin is a router-LSA whose Link State ID is smaller than V's Router ID, reset the Link State Origin to V's router-LSA.
(2) 如果达到此步骤,则必须更新存根网络的路由表条目。计算使用存根网络链路将产生的下一个跃点集。该计算如第16.1.1节所示;此计算的输入是目标(存根网络)和父顶点(路由器顶点)。如果距离D与当前路由表成本相同,只需将这组下一跳添加到路由表条目的下一跳列表中即可。在这种情况下,路由表已具有链接状态原点。如果此链路状态原点是链路状态ID小于V的路由器ID的路由器LSA,请将链路状态原点重置为V的路由器LSA。
Otherwise D is smaller than the routing table cost. Overwrite the current routing table entry by setting the routing table entry's cost to D, and by setting the entry's list of next hops to the newly calculated set. Set the routing table entry's Link State Origin to V's router-LSA. Then go on to examine the next stub network link.
否则D小于路由表成本。通过将路由表条目的成本设置为D,并将条目的下一跳列表设置为新计算的集合,覆盖当前路由表条目。将路由表条目的链接状态原点设置为V的路由器LSA。然后继续检查下一个存根网络链接。
For all routing table entries added/modified in the second stage, the associated area will be set to Area A and the path type will be set to intra-area. When the list of reachable router-LSAs is exhausted, the second stage is completed. At
对于在第二阶段中添加/修改的所有路由表条目,关联区域将设置为区域A,路径类型将设置为区域内。当可到达路由器lsa的列表用尽时,第二阶段完成。在
this time, all intra-area routes associated with Area A have been determined.
这一次,已确定与区域A关联的所有区域内路由。
The specification does not require that the above two stage method be used to calculate the shortest path tree. However, if another algorithm is used, an identical tree must be produced. For this reason, it is important to note that links between transit vertices must be bidirectional in order to be included in the above tree. It should also be mentioned that more efficient algorithms exist for calculating the tree; for example, the incremental SPF algorithm described in [Ref1].
本规范不要求使用上述两阶段方法计算最短路径树。但是,如果使用另一种算法,则必须生成相同的树。因此,重要的是要注意,过境点之间的链接必须是双向的,才能包含在上述树中。还应该提到的是,存在更有效的算法来计算树;例如,参考文献[1]中描述的增量SPF算法。
16.1.1. The next hop calculation
16.1.1. 下一跳计算
This section explains how to calculate the current set of next hops to use for a destination. Each next hop consists of the outgoing interface to use in forwarding packets to the destination together with the IP address of the next hop router (if any). The next hop calculation is invoked each time a shorter path to the destination is discovered. This can happen in either stage of the shortest-path tree calculation (see Section 16.1). In stage 1 of the shortest-path tree calculation a shorter path is found as the destination is added to the candidate list, or when the destination's entry on the candidate list is modified (Step 2d of Stage 1). In stage 2 a shorter path is discovered each time the destination's routing table entry is modified (Step 2 of Stage 2).
本节说明如何计算要用于目的地的当前下一跳集。每个下一个跃点包括用于将数据包转发到目的地的传出接口以及下一个跃点路由器(如果有)的IP地址。每次发现到目标的较短路径时,都会调用下一跳计算。这可能发生在最短路径树计算的任何阶段(见第16.1节)。在最短路径树计算的阶段1中,当目的地被添加到候选列表中时,或者当目的地在候选列表上的条目被修改时,发现较短的路径(阶段1的步骤2d)。在阶段2中,每次修改目的地的路由表条目时都会发现一条较短的路径(阶段2的步骤2)。
The set of next hops to use for the destination may be recalculated several times during the shortest-path tree calculation, as shorter and shorter paths are discovered. In the end, the destination's routing table entry will always reflect the next hops resulting from the absolute shortest path(s).
当发现越来越短的路径时,可在最短路径树计算期间多次重新计算用于目的地的下一跳集。最后,目的地的路由表条目将始终反映绝对最短路径产生的下一个跃点。
Input to the next hop calculation is a) the destination and b) its parent in the current shortest path between the root (the calculating router) and the destination. The parent is always a transit vertex (i.e., always a router or a transit network).
下一跳计算的输入是a)目的地和b)根(计算路由器)和目的地之间当前最短路径中的其父节点。父节点始终是传输顶点(即,始终是路由器或传输网络)。
If there is at least one intervening router in the current shortest path between the destination and the root, the destination simply inherits the set of next hops from the parent. Otherwise, there are two cases. In the first case, the parent vertex is the root (the calculating router itself). This means that the destination is either a directly connected network or directly connected router. The outgoing interface in this case is simply the OSPF interface connecting to the destination network/router. If the destination is a router which connects to the calculating router via a Point-to-MultiPoint network, the destination's next hop IP address(es) can be determined by examining the destination's router-LSA: each link pointing back to the calculating router and having a Link Data field belonging to the Point-to-MultiPoint network provides an IP address of the next hop router. If the destination is a directly connected network, or a router which connects to the calculating router via a point-to-point interface, no next hop IP address is required. If the destination is a router connected to the calculating router via a virtual link, the setting of the next hop should be deferred until the calculation in Section 16.3.
如果在目标和根之间的当前最短路径中至少有一个中间路由器,则目标仅从父节点继承下一跳集。否则,有两种情况。在第一种情况下,父顶点是根(计算路由器本身)。这意味着目标是直接连接的网络或直接连接的路由器。在这种情况下,输出接口只是连接到目标网络/路由器的OSPF接口。如果目标是通过点对多点网络连接到计算路由器的路由器,则目标的下一跳IP地址可以通过检查目的地的路由器LSA来确定:每个指向计算路由器并具有属于点对多点网络的链路数据字段的链路都提供下一跳路由器的IP地址。如果目的地是直接连接的网络,或通过点对点接口连接到计算路由器的路由器,则不需要下一跳IP地址。如果目的地是通过虚拟链路连接到计算路由器的路由器,则下一跳的设置应推迟到第16.3节中的计算。
In the second case, the parent vertex is a network that directly connects the calculating router to the destination router. The list of next hops is then determined by examining the destination's router-LSA. For each link in the router-LSA that points back to the parent network, the link's Link Data field provides the IP address of a next hop router. The outgoing interface to use can then be derived from the next hop IP address (or it can be inherited from the parent network).
在第二种情况下,父顶点是直接将计算路由器连接到目标路由器的网络。然后通过检查目的地的路由器LSA来确定下一跳的列表。对于路由器LSA中指向父网络的每条链路,链路的链路数据字段提供下一跳路由器的IP地址。然后可以从下一跳IP地址派生出要使用的传出接口(或者可以从父网络继承)。
16.2. Calculating the inter-area routes
16.2. 计算区域间路线
The inter-area routes are calculated by examining summary-LSAs. If the router has active attachments to multiple areas, only backbone summary-LSAs are examined. Routers attached to a single area examine that area's summary-LSAs. In either case, the summary-LSAs examined below are all part of a single area's link state database (call it Area A).
通过检查汇总LSA计算区域间路由。如果路由器具有到多个区域的活动附件,则只检查主干概要LSA。连接到单个区域的路由器检查该区域的摘要LSA。在任何一种情况下,下面检查的汇总LSA都是单个区域链接状态数据库(称为区域a)的一部分。
Summary-LSAs are originated by the area border routers. Each summary-LSA in Area A is considered in turn. Remember that the destination described by a summary-LSA is either a network (Type 3 summary-LSAs) or an AS boundary router (Type 4 summary-LSAs). For each summary-LSA:
摘要LSA由区域边界路由器发起。依次考虑区域A中的每个LSA摘要。请记住,摘要LSA描述的目的地是网络(类型3摘要LSA)或AS边界路由器(类型4摘要LSA)。对于每个LSA摘要:
(1) If the cost specified by the LSA is LSInfinity, or if the LSA's LS age is equal to MaxAge, then examine the the next LSA.
(1) 如果LSA指定的成本为LSInfinity,或者LSA的LS age等于MaxAge,则检查下一个LSA的成本。
(2) If the LSA was originated by the calculating router itself, examine the next LSA.
(2) 如果LSA是由计算路由器本身发起的,请检查下一个LSA。
(3) If it is a Type 3 summary-LSA, and the collection of destinations described by the summary-LSA equals one of the router's configured area address ranges (see Section 3.5), and the particular area address range is active, then the summary-LSA should be ignored. "Active" means that there are one or more reachable (by intra-area paths) networks contained in the area range.
(3) 如果是类型3摘要LSA,且摘要LSA描述的目的地集合等于路由器配置的区域地址范围之一(见第3.5节),且特定区域地址范围处于活动状态,则应忽略摘要LSA。“活动”是指区域范围内包含一个或多个可访问(通过区域内路径)网络。
(4) Else, call the destination described by the LSA N (for Type 3 summary-LSAs, N's address is obtained by masking the LSA's Link State ID with the network/subnet mask contained in the body of the LSA), and the area border originating the LSA BR. Look up the routing table entry for BR having Area A as its associated area. If no such entry exists for router BR (i.e., BR is unreachable in Area A), do nothing with this LSA and consider the next in the list. Else, this LSA describes an inter-area path to destination N, whose cost is the distance to BR plus the cost specified in the LSA. Call the cost of this inter-area path IAC.
(4) 否则,调用LSA N描述的目的地(对于类型3摘要LSA,N的地址是通过使用LSA主体中包含的网络/子网掩码屏蔽LSA的链路状态ID获得的),以及发起LSA BR的区域边界。查找具有区域A作为其关联区域的BR的路由表条目。如果路由器BR不存在这样的条目(即BR在区域A中是不可到达的),那么对该LSA不做任何事情,并考虑列表中的下一个。否则,此LSA描述到目的地N的区域间路径,其成本是到BR的距离加上LSA中指定的成本。调用此区域间路径IAC的成本。
(5) Next, look up the routing table entry for the destination N. (If N is an AS boundary router, look up the "router" routing table entry associated with Area A). If no entry exists for N or if the entry's path type is "type 1 external" or "type 2 external", then install the inter-area path to N, with associated area Area A, cost IAC, next hop equal to the list of next hops to router BR, and Advertising router equal to BR.
(5) 接下来,查找目的地N的路由表条目。(如果N是AS边界路由器,请查找与区域A关联的“路由器”路由表条目)。如果N不存在条目,或者条目的路径类型为“类型1外部”或“类型2外部”,则将区域间路径安装到N,相关区域A、成本IAC、下一跳等于路由器BR的下一跳列表,广告路由器等于BR。
(6) Else, if the paths present in the table are intra-area paths, do nothing with the LSA (intra-area paths are always preferred).
(6) 否则,如果表中的路径是区域内路径,则对LSA不做任何操作(区域内路径总是首选)。
(7) Else, the paths present in the routing table are also inter-area paths. Install the new path through BR if it is cheaper, overriding the paths in the routing table. Otherwise, if the new path is the same cost, add it to the list of paths that appear in the routing table entry.
(7) 否则,路由表中的路径也是区域间路径。通过BR安装新路径(如果更便宜),覆盖路由表中的路径。否则,如果新路径的成本相同,请将其添加到路由表条目中显示的路径列表中。
16.3. Examining transit areas' summary-LSAs
16.3. 检查过境区的LSA摘要
This step is only performed by area border routers attached to one or more non-backbone areas that are capable of carrying transit traffic (i.e., "transit areas", or those areas whose TransitCapability parameter has been set to TRUE in Step 2 of the Dijkstra algorithm (see Section 16.1).
该步骤仅由连接到一个或多个能够承载过境流量的非主干区域(即“过境区域”,或Dijkstra算法步骤2中其过境能力参数设置为真的区域)的区域边界路由器执行(见第16.1节)。
The purpose of the calculation below is to examine the transit areas to see whether they provide any better (shorter) paths than the paths previously calculated in Sections 16.1 and 16.2. Any paths found that are better than or equal to previously discovered paths are installed in the routing table.
以下计算的目的是检查过境区,看看它们是否提供了比第16.1节和第16.2节中先前计算的路径更好(更短)的路径。找到的任何优于或等于以前发现的路径都将安装在路由表中。
The calculation also determines the actual next hop(s) for those destinations whose next hop was calculated as a virtual link in Sections 16.1 and 16.2. After completion of the calculation below, any paths calculated in Sections 16.1 and 16.2 that still have unresolved virtual next hops should be discarded.
该计算还确定了其下一跳在第16.1节和第16.2节中被计算为虚拟链路的目的地的实际下一跳。完成以下计算后,应丢弃第16.1节和第16.2节中计算的仍有未解析虚拟下一跳的任何路径。
The calculation proceeds as follows. All the transit areas' summary-LSAs are examined in turn. Each such summary-LSA describes a route through a transit area Area A to a Network N (N's address is obtained by masking the LSA's Link State ID with the network/subnet mask contained in the body of the LSA) or in the case of a Type 4 summary-LSA, to an AS boundary router N. Suppose also that the summary-LSA was originated by an area border router BR.
计算过程如下。依次检查所有中转区的汇总LSA。每个这样的概要LSA描述了通过传输区域a到网络N的路由(N的地址是通过使用LSA主体中包含的网络/子网掩码屏蔽LSA的链路状态ID获得的),或者在类型4概要LSA的情况下,到AS边界路由器N。还假设汇总LSA由区域边界路由器BR发起。
(1) If the cost advertised by the summary-LSA is LSInfinity, or if the LSA's LS age is equal to MaxAge, then examine the next LSA.
(1) 如果汇总LSA公布的成本为LSInfinity,或者LSA的LS age等于MaxAge,则检查下一个LSA。
(2) If the summary-LSA was originated by the calculating router itself, examine the next LSA.
(2) 如果汇总LSA是由计算路由器本身发起的,请检查下一个LSA。
(3) Look up the routing table entry for N. (If N is an AS boundary router, look up the "router" routing table entry associated with the backbone area). If it does not exist, or if the route type is other than intra-area or inter-area, or if the area associated with the routing table entry is not the backbone area, then examine the next LSA. In other words, this calculation only updates backbone intra-area routes found in Section 16.1 and inter-area routes found in Section 16.2.
(3) 查找N的路由表条目。(如果N是AS边界路由器,请查找与主干区域关联的“路由器”路由表条目)。如果它不存在,或者如果路由类型不是区域内或区域间,或者如果与路由表条目关联的区域不是主干区域,则检查下一个LSA。换句话说,此计算仅更新第16.1节中的主干区域内路由和第16.2节中的区域间路由。
(4) Look up the routing table entry for the advertising router BR associated with the Area A. If it is unreachable, examine the next LSA. Otherwise, the cost to destination N is the sum of the cost in BR's Area A routing table entry and the cost advertised in the LSA. Call this cost IAC.
(4) 查找与区域A关联的广告路由器BR的路由表条目。如果无法访问,请检查下一个LSA。否则,目的地N的成本是BR区域A路由表条目中的成本和LSA中公布的成本之和。这叫成本IAC。
(5) If this cost is less than the cost occurring in N's routing table entry, overwrite N's list of next hops with those used for BR, and set N's routing table cost to IAC. Else, if IAC is the same as N's current cost, add BR's list of next hops to N's list of next hops. In any case, the area associated with N's routing table entry must remain the backbone area, and the path type (either intra-area or inter-area) must also remain the same.
(5) 如果此成本小于N的路由表条目中发生的成本,则用BR使用的下一跳覆盖N的下一跳列表,并将N的路由表成本设置为IAC。否则,如果IAC与N的当前成本相同,则将BR的下一跳列表添加到N的下一跳列表中。在任何情况下,与N的路由表条目相关联的区域必须保持主干区域,并且路径类型(区域内或区域间)也必须保持相同。
It is important to note that the above calculation never makes unreachable destinations reachable, but instead just potentially finds better paths to already reachable destinations. The calculation installs any better cost found into the routing table entry, from which it may be readvertised in summary-LSAs to other areas.
需要注意的是,上述计算不会使无法到达的目的地成为可到达的目的地,而是可能会找到更好的路径到达已经到达的目的地。该计算会将找到的任何更好的成本安装到路由表条目中,从中可以在汇总LSA中将其读取到其他区域。
As an example of the calculation, consider the Autonomous System pictured in Figure 17. There is a single non-backbone area (Area 1) that physically divides the backbone into two separate pieces. To maintain connectivity of the backbone, a virtual link has been configured between routers RT1 and RT4. On the right side of the figure, Network N1 belongs to the backbone. The dotted lines indicate that there is a much shorter intra-area
作为计算的一个例子,考虑图17中所示的自治系统。有一个单独的非主干区域(区域1),它将主干物理上划分为两个独立的部分。为了保持主干网的连通性,在路由器RT1和RT4之间配置了一个虚拟链路。在图的右侧,网络N1属于主干网。虚线表示内部区域要短得多
........................ . Area 1 (transit) . + . . | . +---+1 1+---+100 | . |RT2|----------|RT4|=========| . 1/+---+********* +---+ | . /******* . | . 1/*Virtual . | 1+---+/* Link . Net|work =======|RT1|* . | N1 +---+\ . | . \ . | . \ . | . 1\+---+1 1+---+20 | . |RT3|----------|RT5|=========| . +---+ +---+ | . . | ........................ +
........................ . Area 1 (transit) . + . . | . +---+1 1+---+100 | . |RT2|----------|RT4|=========| . 1/+---+********* +---+ | . /******* . | . 1/*Virtual . | 1+---+/* Link . Net|work =======|RT1|* . | N1 +---+\ . | . \ . | . \ . | . 1\+---+1 1+---+20 | . |RT3|----------|RT5|=========| . +---+ +---+ | . . | ........................ +
Figure 17: Routing through transit areas
图17:通过过境区的路线
backbone path between router RT5 and Network N1 (cost 20) than there is between Router RT4 and Network N1 (cost 100). Both Router RT4 and Router RT5 will inject summary-LSAs for Network N1 into Area 1.
路由器RT5和网络N1之间的主干路径(成本20)比路由器RT4和网络N1之间的主干路径(成本100)高。路由器RT4和路由器RT5都将网络N1的摘要LSA注入区域1。
After the shortest-path tree has been calculated for the backbone in Section 16.1, Router RT1 (left end of the virtual link) will have calculated a path through Router RT4 for all data traffic destined for Network N1. However, since Router RT5 is so much closer to Network N1, all routers internal to Area 1 (e.g., Routers RT2 and RT3) will forward their Network N1 traffic towards Router RT5, instead of RT4. And indeed, after examining Area 1's summary-LSAs by the above calculation, Router RT1 will also forward Network N1 traffic towards RT5. Note that in this example the virtual link enables transit data traffic to be forwarded through Area 1, but the actual path the transit data traffic takes does not follow the virtual link. In other words, virtual links allow transit traffic to be forwarded through an area, but do not dictate the precise path that the traffic will take.
在第16.1节中为主干计算了最短路径树之后,路由器RT1(虚拟链路的左端)将为所有发送到网络N1的数据流量计算通过路由器RT4的路径。然而,由于路由器RT5离网络N1非常近,区域1内部的所有路由器(例如,路由器RT2和RT3)将把它们的网络N1流量转发给路由器RT5,而不是RT4。事实上,在通过上述计算检查区域1的汇总LSA之后,路由器RT1还将向RT5转发网络N1流量。请注意,在此示例中,虚拟链路允许通过区域1转发传输数据流量,但传输数据流量所采用的实际路径不遵循虚拟链路。换句话说,虚拟链路允许过境流量通过某个区域转发,但不指定流量将采用的精确路径。
16.4. Calculating AS external routes
16.4. 作为外部路线计算
AS external routes are calculated by examining AS-external-LSAs. Each of the AS-external-LSAs is considered in turn. Most AS-external-LSAs describe routes to specific IP destinations. An AS-external-LSA can also describe a default route for the Autonomous System (Destination ID = DefaultDestination, network/subnet mask = 0x00000000). For each AS-external-LSA:
AS外部路由通过检查AS外部LSA来计算。依次考虑每个AS外部LSA。大多数AS外部LSA描述到特定IP目的地的路由。AS外部LSA还可以描述自治系统的默认路由(目的地ID=DefaultDestination,网络/子网掩码=0x00000000)。对于每个AS外部LSA:
(1) If the cost specified by the LSA is LSInfinity, or if the LSA's LS age is equal to MaxAge, then examine the next LSA.
(1) 如果LSA指定的成本为LSInfinity,或者LSA的LS age等于MaxAge,则检查下一个LSA。
(2) If the LSA was originated by the calculating router itself, examine the next LSA.
(2) 如果LSA是由计算路由器本身发起的,请检查下一个LSA。
(3) Call the destination described by the LSA N. N's address is obtained by masking the LSA's Link State ID with the network/subnet mask contained in the body of the LSA. Look up the routing table entries (potentially one per attached area) for the AS boundary router (ASBR) that originated the LSA. If no entries exist for router ASBR (i.e., ASBR is unreachable), do nothing with this LSA and consider the next in the list.
(3) 呼叫LSA N描述的目的地。N的地址是通过使用LSA主体中包含的网络/子网掩码屏蔽LSA的链路状态ID获得的。查找发起LSA的AS边界路由器(ASBR)的路由表条目(可能每个连接区域一个)。如果路由器ASBR不存在条目(即,ASBR是不可到达的),不要用这个LSA做任何事情,并考虑列表中的下一个。
Else, this LSA describes an AS external path to destination N. Examine the forwarding address specified in the AS-external-LSA. This indicates the IP address to which packets for the destination should be forwarded.
否则,此LSA将描述到目标N的AS外部路径。请检查AS外部LSA中指定的转发地址。这表示目标的数据包应转发到的IP地址。
If the forwarding address is set to 0.0.0.0, packets should be sent to the ASBR itself. Among the multiple routing table entries for the ASBR, select the preferred entry as follows. If RFC1583Compatibility is set to "disabled", prune the set of routing table entries for the ASBR as described in Section 16.4.1. In any case, among the remaining routing table entries, select the routing table entry with the least cost; when there are multiple least cost routing table entries the entry whose associated area has the largest OSPF Area ID (when considered as an unsigned 32-bit integer) is chosen.
如果转发地址设置为0.0.0.0,则应将数据包发送到ASBR本身。在ASBR的多个路由表条目中,选择首选条目,如下所示。如果RFC1583兼容性设置为“禁用”,请按照第16.4.1节所述修剪ASBR的路由表项集。在任何情况下,在剩余的路由表条目中,选择成本最低的路由表条目;当存在多个最低成本路由表条目时,将选择其关联区域具有最大OSPF区域ID(当被视为无符号32位整数时)的条目。
If the forwarding address is non-zero, look up the forwarding address in the routing table.[24] The matching routing table entry must specify an intra-area or inter-area path; if no such path exists, do nothing with the LSA and consider the next in the list.
如果转发地址非零,请在路由表中查找转发地址。[24]匹配的路由表条目必须指定区域内或区域间路径;如果不存在这样的路径,对LSA什么也不做,并考虑列表中的下一个。
(4) Let X be the cost specified by the preferred routing table entry for the ASBR/forwarding address, and Y the cost specified in the LSA. X is in terms of the link state metric, and Y is a type 1 or 2 external metric.
(4) 设X为ASBR/转发地址的首选路由表项指定的成本,Y为LSA中指定的成本。X表示链路状态度量,Y表示类型1或2外部度量。
(5) Look up the routing table entry for the destination N. If no entry exists for N, install the AS external path to N, with next hop equal to the list of next hops to the forwarding address, and advertising router equal to ASBR. If the external metric type is 1, then the path-type is set to type 1 external and the cost is equal to X+Y. If the external metric type is 2, the path-type is set to type 2 external, the link state component of the route's cost is X, and the type 2 cost is Y.
(5) 查找目的地N的路由表条目。如果不存在N的条目,请将AS外部路径安装到N,下一跳等于转发地址的下一跳列表,播发路由器等于ASBR。如果外部度量类型为1,则路径类型设置为类型1外部,成本等于X+Y。如果外部度量类型为2,则路径类型设置为类型2外部,路由成本的链路状态组件为X,类型2成本为Y。
(6) Compare the AS external path described by the LSA with the existing paths in N's routing table entry, as follows. If the new path is preferred, it replaces the present paths in N's routing table entry. If the new path is of equal preference, it is added to N's routing table entry's list of paths.
(6) 将LSA描述的AS外部路径与N的路由表条目中的现有路径进行比较,如下所示。如果首选新路径,它将替换N的路由表条目中的当前路径。如果新路径具有相同的首选项,则会将其添加到N的路由表条目的路径列表中。
(a) Intra-area and inter-area paths are always preferred over AS external paths.
(a) 区域内和区域间路径始终优先于外部路径。
(b) Type 1 external paths are always preferred over type 2 external paths. When all paths are type 2 external paths, the paths with the smallest advertised type 2 metric are always preferred.
(b) 类型1外部路径始终优于类型2外部路径。当所有路径都是类型2外部路径时,始终首选具有最小播发类型2度量的路径。
(c) If the new AS external path is still indistinguishable from the current paths in the N's routing table entry, and RFC1583Compatibility is set to "disabled", select the preferred paths based on the intra-AS paths to the ASBR/forwarding addresses, as specified in Section 16.4.1.
(c) 如果新的AS外部路径与N的路由表条目中的当前路径仍然无法区分,并且RFC1583兼容性设置为“禁用”,则根据ASBR/转发地址的AS内部路径选择首选路径,如第16.4.1节所述。
(d) If the new AS external path is still indistinguishable from the current paths in the N's routing table entry, select the preferred path based on a least cost comparison. Type 1 external paths are compared by looking at the sum of the distance to the forwarding address and the advertised type 1 metric (X+Y). Type 2 external paths advertising equal type 2 metrics are compared by looking at the distance to the forwarding addresses.
(d) 如果新的AS外部路径与N的路由表条目中的当前路径仍然无法区分,请基于最小成本比较选择首选路径。通过查看到转发地址的距离和播发的类型1度量(X+Y)之和,比较类型1外部路径。通过查看到转发地址的距离来比较类型2外部路径和相同类型2度量。
16.4.1. External path preferences
16.4.1. 外部路径首选项
When multiple intra-AS paths are available to ASBRs/forwarding addresses, the following rules indicate which paths are preferred. These rules apply when the same ASBR is reachable through multiple areas, or when trying to decide which of several AS-external-LSAs should be preferred. In the former case the paths all terminate at the same ASBR, while in the latter the paths terminate at separate ASBRs/forwarding addresses. In either case, each path is represented by a separate routing table entry as defined in Section 11.
当ASBR/转发地址可使用多个内部AS路径时,以下规则指示首选的路径。当可以通过多个区域访问同一个ASBR时,或者当试图决定应优先选择几个AS外部LSA中的哪一个时,这些规则适用。在前一种情况下,所有路径都在同一ASBR处终止,而在后一种情况下,路径在单独的ASBR/转发地址处终止。在任何一种情况下,每个路径都由第11节中定义的单独路由表条目表示。
This section only applies when RFC1583Compatibility is set to "disabled".
本节仅在RFC1583兼容性设置为“禁用”时适用。
The path preference rules, stated from highest to lowest preference, are as follows. Note that as a result of these rules, there may still be multiple paths of the highest preference. In this case, the path to use must be determined based on cost, as described in Section 16.4.
从最高优先权到最低优先权的路径优先权规则如下所示。请注意,由于这些规则,可能仍然存在多个具有最高优先权的路径。在这种情况下,必须根据成本确定使用路径,如第16.4节所述。
o Intra-area paths using non-backbone areas are always the most preferred.
o 使用非主干区域的区域内路径始终是最首选的。
o The other paths, intra-area backbone paths and inter-area paths, are of equal preference.
o 其他路径(区域内主干路径和区域间路径)具有相同的优先权。
16.5. Incremental updates -- summary-LSAs
16.5. 增量更新--摘要LSA
When a new summary-LSA is received, it is not necessary to recalculate the entire routing table. Call the destination
当收到新的摘要LSA时,无需重新计算整个路由表。打电话到目的地
described by the summary-LSA N (N's address is obtained by masking the LSA's Link State ID with the network/subnet mask contained in the body of the LSA), and let Area A be the area to which the LSA belongs. There are then two separate cases:
由概要LSA N描述(N的地址是通过使用LSA主体中包含的网络/子网掩码屏蔽LSA的链路状态ID获得的),并且让区域A成为LSA所属的区域。然后有两种不同的情况:
Case 1: Area A is the backbone and/or the router is not an area border router. In this case, the following calculations must be performed. First, if there is presently an inter-area route to the destination N, N's routing table entry is invalidated, saving the entry's values for later comparisons. Then the calculation in Section 16.2 is run again for the single destination N. In this calculation, all of Area A's summary-LSAs that describe a route to N are examined. In addition, if the router is an area border router attached to one or more transit areas, the calculation in Section 16.3 must be run again for the single destination. If the results of these calculations have changed the cost/path to an AS boundary router (as would be the case for a Type 4 summary-LSA) or to any forwarding addresses, all AS-external-LSAs will have to be reexamined by rerunning the calculation in Section 16.4. Otherwise, if N is now newly unreachable, the calculation in Section 16.4 must be rerun for the single destination N, in case an alternate external route to N exists.
案例1:区域A是主干和/或路由器不是区域边界路由器。在这种情况下,必须进行以下计算。首先,如果当前存在到目的地N的区域间路由,则N的路由表条目无效,保存条目的值以供以后比较。然后,针对单个目的地N再次运行第16.2节中的计算。在该计算中,检查了描述到N的路线的所有区域A的汇总LSA。此外,如果路由器是连接到一个或多个中转区的区域边界路由器,则必须针对单个目的地再次运行第16.3节中的计算。如果这些计算结果改变了AS边界路由器(如4类汇总LSA)或任何转发地址的成本/路径,则必须通过重新运行第16.4节中的计算来重新检查所有AS外部LSA。否则,如果N现在是新无法到达的,则必须针对单个目的地N重新运行第16.4节中的计算,以防存在到N的备用外部路由。
Case 2: Area A is a transit area and the router is an area border router. In this case, the following calculations must be performed. First, if N's routing table entry presently contains one or more inter-area paths that utilize the transit area Area A, these paths should be removed. If this removes all paths from the routing table entry, the entry should be invalidated. The entry's old values should be saved for later comparisons. Next the calculation in Section 16.3 must be run again for the single destination N. If the results of this calculation have caused the cost to N to increase, the complete routing table calculation must be rerun starting with the Dijkstra algorithm specified in Section 16.1. Otherwise, if the cost/path to an AS boundary router (as would be the case for a Type 4 summary-LSA) or to any forwarding addresses has changed, all AS-external-LSAs will
案例2:A区为中转区,路由器为区域边界路由器。在这种情况下,必须进行以下计算。首先,如果N的路由表条目当前包含一个或多个利用传输区域A的区域间路径,则应删除这些路径。如果这将从路由表条目中删除所有路径,则该条目应无效。应保存条目的旧值以供以后比较。接下来,必须针对单一目的地N再次运行第16.3节中的计算。如果该计算结果导致N的成本增加,则必须从第16.1节中规定的Dijkstra算法开始重新运行完整的路由表计算。否则,如果AS边界路由器(如类型4摘要LSA)或任何转发地址的成本/路径已更改,则所有AS外部LSA都将更改
have to be reexamined by rerunning the calculation in Section 16.4. Otherwise, if N is now newly unreachable, the calculation in Section 16.4 must be rerun for the single destination N, in case an alternate external route to N exists.
必须通过重新运行第16.4节中的计算来重新检查。否则,如果N现在是新无法到达的,则必须针对单个目的地N重新运行第16.4节中的计算,以防存在到N的备用外部路由。
16.6. Incremental updates -- AS-external-LSAs
16.6. 增量更新--作为外部LSA
When a new AS-external-LSA is received, it is not necessary to recalculate the entire routing table. Call the destination described by the AS-external-LSA N. N's address is obtained by masking the LSA's Link State ID with the network/subnet mask contained in the body of the LSA. If there is already an intra-area or inter-area route to the destination, no recalculation is necessary (internal routes take precedence).
当接收到新的AS外部LSA时,无需重新计算整个路由表。调用由AS外部LSA N描述的目的地。N的地址是通过使用LSA主体中包含的网络/子网掩码屏蔽LSA的链路状态ID获得的。如果已存在到目的地的区域内或区域间路由,则无需重新计算(内部路由优先)。
Otherwise, the procedure in Section 16.4 will have to be performed, but only for those AS-external-LSAs whose destination is N. Before this procedure is performed, the present routing table entry for N should be invalidated.
否则,必须执行第16.4节中的程序,但仅适用于目的地为N的外部LSA。在执行此程序之前,N的当前路由表条目应无效。
16.7. Events generated as a result of routing table changes
16.7. 由于路由表更改而生成的事件
Changes to routing table entries sometimes cause the OSPF area border routers to take additional actions. These routers need to act on the following routing table changes:
对路由表条目的更改有时会导致OSPF区域边界路由器采取额外的操作。这些路由器需要对以下路由表更改进行操作:
o The cost or path type of a routing table entry has changed. If the destination described by this entry is a Network or AS boundary router, and this is not simply a change of AS external routes, new summary-LSAs may have to be generated (potentially one for each attached area, including the backbone). See Section 12.4.3 for more information. If a previously advertised entry has been deleted, or is no longer advertisable to a particular area, the LSA must be flushed from the routing domain by setting its LS age to MaxAge and reflooding (see Section 14.1).
o 路由表项的成本或路径类型已更改。如果此条目描述的目的地是网络或AS边界路由器,并且这不仅仅是AS外部路由的更改,则可能必须生成新的摘要LSA(可能每个连接区域都有一个LSA,包括主干网)。详见第12.4.3节。如果先前发布的条目已被删除,或不再可在特定区域发布,则必须通过将其LS age设置为MaxAge并重新下载,从路由域刷新LSA(见第14.1节)。
o A routing table entry associated with a configured virtual link has changed. The destination of such a routing table entry is an area border router. The change indicates a modification to the virtual link's cost or viability.
o 与配置的虚拟链接关联的路由表条目已更改。这种路由表条目的目的地是区域边界路由器。这一变化表明虚拟链路的成本或生存能力有所改变。
If the entry indicates that the area border router is newly reachable, the corresponding virtual link is now operational. An InterfaceUp event should be generated for the virtual link, which will cause a virtual adjacency to begin to form (see Section 10.3). At this time the virtual link's IP interface address and the virtual neighbor's Neighbor IP address are also calculated.
如果条目指示区域边界路由器是新可访问的,则相应的虚拟链路现在可操作。应为虚拟链路生成InterfaceUp事件,这将导致虚拟邻接开始形成(见第10.3节)。此时还将计算虚拟链路的IP接口地址和虚拟邻居的邻居IP地址。
If the entry indicates that the area border router is no longer reachable, the virtual link and its associated adjacency should be destroyed. This means an InterfaceDown event should be generated for the associated virtual link.
如果条目指示区域边界路由器不再可访问,则应销毁虚拟链路及其关联的邻接。这意味着应为关联的虚拟链接生成InterfacedDown事件。
If the cost of the entry has changed, and there is a fully established virtual adjacency, a new router-LSA for the backbone must be originated. This in turn may cause further routing table changes.
如果入口成本发生变化,并且存在完全建立的虚拟邻接,则必须为主干网创建一个新的路由器LSA。这反过来可能会导致路由表的进一步更改。
16.8. Equal-cost multipath
16.8. 等成本多路径
The OSPF protocol maintains multiple equal-cost routes to all destinations. This can be seen in the steps used above to calculate the routing table, and in the definition of the routing table structure.
OSPF协议维护到所有目的地的多条等成本路由。这可以在上面用于计算路由表的步骤以及路由表结构的定义中看到。
Each one of the multiple routes will be of the same type (intra-area, inter-area, type 1 external or type 2 external), cost, and will have the same associated area. However, each route may specify a separate next hop and Advertising router.
多条路线中的每一条都将具有相同的类型(区域内、区域间、类型1外部或类型2外部)、成本,并且具有相同的关联区域。然而,每个路由可以指定单独的下一跳和广告路由器。
There is no requirement that a router running OSPF keep track of all possible equal-cost routes to a destination. An implementation may choose to keep only a fixed number of routes to any given destination. This does not affect any of the algorithms presented in this specification.
运行OSPF的路由器不需要跟踪到目的地的所有可能的等成本路由。实现可以选择只保留到任何给定目的地的固定数量的路由。这不影响本规范中提出的任何算法。
Footnotes
脚注
[1]The graph's vertices represent either routers, transit networks, or stub networks. Since routers may belong to multiple areas, it is not possible to color the graph's vertices.
[1] 图的顶点表示路由器、运输网络或存根网络。由于路由器可能属于多个区域,因此无法为图形的顶点着色。
[2]It is possible for all of a router's interfaces to be unnumbered point-to-point links. In this case, an IP address must be assigned to the router. This address will then be advertised in the router's router-LSA as a host route.
[2] 路由器的所有接口都可能是无编号的点对点链路。在这种情况下,必须为路由器分配一个IP地址。然后,该地址将作为主机路由在路由器的路由器LSA中公布。
[3]Note that in these cases both interfaces, the non-virtual and the virtual, would have the same IP address.
[3] 请注意,在这些情况下,非虚拟接口和虚拟接口都具有相同的IP地址。
[4]Note that no host route is generated for, and no IP packets can be addressed to, interfaces to unnumbered point-to-point networks. This is regardless of such an interface's state.
[4] 请注意,没有为未编号的点到点网络的接口生成主机路由,也没有IP数据包可寻址。这与此类接口的状态无关。
[5]It is instructive to see what happens when the Designated Router for the network crashes. Call the Designated Router for the network RT1, and the Backup Designated Router RT2. If Router RT1 crashes (or maybe its interface to the network dies), the other routers on the network will detect RT1's absence within RouterDeadInterval seconds. All routers may not detect this at precisely the same time; the routers that detect RT1's absence before RT2 does will, for a time, select RT2 to be both Designated Router and Backup Designated Router. When RT2 detects that RT1 is gone it will move itself to Designated Router. At this time, the remaining router having highest Router Priority will be selected as Backup Designated Router.
[5] 当指定的网络路由器崩溃时,看看会发生什么是有益的。呼叫网络的指定路由器RT1和备份指定路由器RT2。如果路由器RT1崩溃(或者它与网络的接口失效),网络上的其他路由器将在RouterDeadInterval秒内检测到RT1的缺失。所有路由器可能不会同时检测到这一点;在RT2之前检测到RT1缺失的路由器将在一段时间内选择RT2作为指定路由器和备份指定路由器。当RT2检测到RT1消失时,它将自身移动到指定的路由器。此时,具有最高路由器优先级的剩余路由器将被选择为备份指定路由器。
[6]On point-to-point networks, the lower level protocols indicate whether the neighbor is up and running. Likewise, existence of the neighbor on virtual links is indicated by the routing table calculation. However, in both these cases, the Hello Protocol is still used. This ensures that communication between the neighbors is bidirectional, and that each of the neighbors has a functioning routing protocol layer.
[6] 在点对点网络上,较低级别的协议指示邻居是否已启动并正在运行。同样,虚拟链路上的邻居的存在由路由表计算指示。但是,在这两种情况下,仍然使用Hello协议。这确保了邻居之间的通信是双向的,并且每个邻居都有一个正常工作的路由协议层。
[7]When the identity of the Designated Router is changing, it may be quite common for a neighbor in this state to send the router a
[7] 当指定路由器的身份发生变化时,处于这种状态的邻居向路由器发送一条消息可能非常常见
Database Description packet; this means that there is some momentary disagreement on the Designated Router's identity.
数据库描述包;这意味着在指定路由器的身份上存在一些暂时的分歧。
[8]Note that it is possible for a router to resynchronize any of its fully established adjacencies by setting the adjacency's state back to ExStart. This will cause the other end of the adjacency to process a SeqNumberMismatch event, and therefore to also go back to ExStart state.
[8] 请注意,路由器可以通过将邻接状态设置回ExStart来重新同步其任何完全建立的邻接。这将导致邻接的另一端处理SeqNumberMismatch事件,因此也将返回ExStart状态。
[9]The address space of IP networks and the address space of OSPF Router IDs may overlap. That is, a network may have an IP address which is identical (when considered as a 32-bit number) to some router's Router ID.
[9] IP网络的地址空间和OSPF路由器ID的地址空间可能重叠。也就是说,网络的IP地址可能与某个路由器的路由器ID相同(当被视为32位数字时)。
[10]"Discard" entries are necessary to ensure that route summarization at area boundaries will not cause packet looping.
[10] “丢弃”条目是必要的,以确保区域边界处的路由摘要不会导致数据包循环。
[11]It is assumed that, for two different address ranges matching the destination, one range is more specific than the other. Non-contiguous subnet masks can be configured to violate this assumption. Such subnet mask configurations cannot be handled by the OSPF protocol.
[11] 假设对于与目的地匹配的两个不同地址范围,一个范围比另一个更具体。可以将非连续子网掩码配置为违反此假设。OSPF协议无法处理此类子网掩码配置。
[12]MaxAgeDiff is an architectural constant. It indicates the maximum dispersion of ages, in seconds, that can occur for a single LSA instance as it is flooded throughout the routing domain. If two LSAs differ by more than this, they are assumed to be different instances of the same LSA. This can occur when a router restarts and loses track of the LSA's previous LS sequence number. See Section 13.4 for more details.
[12] MaxAgeDiff是一个体系结构常量。它表示单个LSA实例在整个路由域中被淹没时可能出现的最大年龄分散(以秒为单位)。如果两个LSA的差异大于此,则假定它们是同一LSA的不同实例。当路由器重新启动并丢失LSA以前的LS序列号时,可能会发生这种情况。详见第13.4节。
[13]When two LSAs have different LS checksums, they are assumed to be separate instances. This can occur when a router restarts, and loses track of the LSA's previous LS sequence number. In the case where the two LSAs have the same LS sequence number, it is not possible to determine which LSA is actually newer. However, if the wrong LSA is accepted as newer, the originating router will simply originate another instance. See Section 13.4 for further details.
[13] 当两个LSA具有不同的LS校验和时,假定它们是单独的实例。这可能发生在路由器重新启动时,并且丢失LSA以前的LS序列号。在两个LSA具有相同的LS序列号的情况下,无法确定哪个LSA实际上较新。但是,如果错误的LSA被接受为较新的,则发起路由器将简单地发起另一个实例。详见第13.4节。
[14]There is one instance where a lookup must be done based on partial information. This is during the routing table calculation, when a network-LSA must be found based solely on its Link State ID.
[14] 有一个实例必须根据部分信息进行查找。这是在路由表计算期间,此时必须仅根据其链路状态ID找到网络LSA。
The lookup in this case is still well defined, since no two network-LSAs can have the same Link State ID.
这种情况下的查找仍然定义良好,因为没有两个网络LSA可以具有相同的链路状态ID。
[15]This is the way RFC 1583 specified point-to-point representation. It has three advantages: a) it does not require allocating a subnet to the point-to-point link, b) it tends to bias the routing so that packets destined for the point-to-point interface will actually be received over the interface (which is useful for diagnostic purposes) and c) it allows network bootstrapping of a neighbor, without requiring that the bootstrap program contain an OSPF implementation.
[15] 这是RFC1583指定点到点表示的方式。它有三个优点:a)它不需要为点到点链路分配子网,b)它倾向于偏向路由,以便发送到点到点接口的数据包将通过接口实际接收(这对于诊断目的很有用),c)它允许邻居的网络自举,无需引导程序包含OSPF实现。
[16]This is the more traditional point-to-point representation used by protocols such as RIP.
[16] 这是RIP等协议使用的更传统的点到点表示。
[17]This clause covers the case: Inter-area routes are not summarized to the backbone. This is because inter-area routes are always associated with the backbone area.
[17] 本条款涵盖以下情况:区域间路由未汇总到主干网。这是因为区域间路由始终与主干区域相关联。
[18]This clause is only invoked when a non-backbone Area A supports transit data traffic (i.e., has TransitCapability set to TRUE). For example, in the area configuration of Figure 6, Area 2 can support transit traffic due to the configured virtual link between Routers RT10 and RT11. As a result, Router RT11 need only originate a single summary-LSA into Area 2 (having the collapsed destination N9- N11,H1), since all of Router RT11's other eligible routes have next hops belonging to Area 2 itself (and as such only need be advertised by other area border routers; in this case, Routers RT10 and RT7).
[18] 仅当非主干区域a支持传输数据流量(即,TransitCapability设置为TRUE)时,才会调用此子句。例如,在图6的区域配置中,由于路由器RT10和RT11之间配置的虚拟链路,区域2可以支持传输流量。因此,路由器RT11只需要在区域2中发起一个汇总LSA(具有折叠的目的地N9-N11,H1),因为所有路由器RT11的其他合格路由都具有属于区域2本身的下一跳(并且因此只需要由其他区域边界路由器播发;在这种情况下,路由器RT10和RT7)。
[19]By keeping more information in the routing table, it is possible for an implementation to recalculate the shortest path tree for only a single area. In fact, there are incremental algorithms that allow an implementation to recalculate only a portion of a single area's shortest path tree [Ref1]. However, these algorithms are beyond the scope of this specification.
[19] 通过在路由表中保留更多信息,实现可以仅为单个区域重新计算最短路径树。事实上,有一些增量算法允许实现仅重新计算单个区域最短路径树的一部分[Ref1]。然而,这些算法超出了本规范的范围。
[20]This is how the Link state request list is emptied, which eventually causes the neighbor state to transition to Full. See Section 10.9 for more details.
[20] 这就是链路状态请求列表被清空的方式,这最终会导致邻居状态转换为完全状态。详见第10.9节。
[21]It should be a relatively rare occurrence for an LSA's LS age to reach MaxAge in this fashion. Usually, the LSA will be replaced by
[21]LSA的LS年龄以这种方式达到最大年龄应该是比较罕见的。通常,LSA将由
a more recent instance before it ages out.
在过期之前更新的实例。
[22]Strictly speaking, because of equal-cost multipath, the algorithm does not create a tree. We continue to use the "tree" terminology because that is what occurs most often in the existing literature.
[22]严格地说,由于多路径成本相等,该算法不会创建树。我们继续使用“树”术语,因为这是现有文献中最常见的术语。
[23]Note that the presence of any link back to V is sufficient; it need not be the matching half of the link under consideration from V to W. This is enough to ensure that, before data traffic flows between a pair of neighboring routers, their link state databases will be synchronized.
[23]注意,返回到V的任何链接的存在是足够的;它不需要是考虑中的从V到W的链路的匹配一半。这足以确保在一对相邻路由器之间的数据流量流动之前,它们的链路状态数据库将被同步。
[24]When the forwarding address is non-zero, it should point to a router belonging to another Autonomous System. See Section 12.4.4 for more details.
[24]当转发地址为非零时,它应指向属于另一个自治系统的路由器。详见第12.4.4节。
References
工具书类
[Ref1] McQuillan, J., I. Richer and E. Rosen, "ARPANET Routing Algorithm Improvements", BBN Technical Report 3803, April 1978.
[参考文献1]McQuillan,J.,I.Richer和E.Rosen,“ARPANET路由算法改进”,BBN技术报告3803,1978年4月。
[Ref2] Digital Equipment Corporation, "Information processing systems -- Data communications -- Intermediate System to Intermediate System Intra-Domain Routing Protocol", October 1987.
[参考文献2]数字设备公司,“信息处理系统——数据通信——中间系统到中间系统域内路由协议”,1987年10月。
[Ref3] McQuillan, J., et.al., "The New Routing Algorithm for the ARPANET", IEEE Transactions on Communications, May 1980.
[Ref3]McQuillan,J.等人,“ARPANET的新路由算法”,IEEE通信事务,1980年5月。
[Ref4] Perlman, R., "Fault-Tolerant Broadcast of Routing Information", Computer Networks, December 1983.
[参考文献4]Perlman,R.,“路由信息的容错广播”,计算机网络,1983年12月。
[Ref5] Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981.
[参考文献5]Postel,J.,“互联网协议”,STD 5,RFC 7911981年9月。
[Ref6] McKenzie, A., "ISO Transport Protocol specification ISO DP 8073", RFC 905, April 1984.
[参考文献6]McKenzie,A.,“ISO传输协议规范ISO DP 8073”,RFC 905,1984年4月。
[Ref7] Deering, S., "Host extensions for IP multicasting", STD 5, RFC 1112, May 1988.
[参考文献7]Deering,S.,“IP多播的主机扩展”,STD 5,RFC 1112,1988年5月。
[Ref8] McCloghrie, K., and M. Rose, "Management Information Base for network management of TCP/IP-based internets: MIB-II", STD 17, RFC 1213, March 1991.
[参考文献8]McCloghrie,K.和M.Rose,“基于TCP/IP的互联网网络管理的管理信息库:MIB-II”,STD 17,RFC 1213,1991年3月。
[Ref9] Moy, J., "OSPF Version 2", RFC 1583, March 1994.
[参考文献9]莫伊,J.,“OSPF版本2”,RFC1583,1994年3月。
[Ref10] Fuller, V., T. Li, J. Yu, and K. Varadhan, "Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy", RFC1519, September 1993.
[Ref10]Fuller,V.,T.Li,J.Yu和K.Varadhan,“无类域间路由(CIDR):地址分配和聚合策略”,RFC1519,1993年9月。
[Ref11] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC 1700, October 1994.
[参考11]雷诺兹,J.和J.波斯特尔,“分配的数字”,标准2,RFC 1700,1994年10月。
[Ref12] Almquist, P., "Type of Service in the Internet Protocol Suite", RFC 1349, July 1992.
[Ref12]Almquist,P.,“互联网协议套件中的服务类型”,RFC 1349,1992年7月。
[Ref13] Leiner, B., et.al., "The DARPA Internet Protocol Suite", DDN Protocol Handbook, April 1985.
[Ref13]Leiner,B.等人,“DARPA互联网协议套件”,DDN协议手册,1985年4月。
[Ref14] Bradley, T., and C. Brown, "Inverse Address Resolution Protocol", RFC 1293, January 1992.
[Ref14]Bradley,T.和C.Brown,“反向地址解析协议”,RFC 1293,1992年1月。
[Ref15] deSouza, O., and M. Rodrigues, "Guidelines for Running OSPF Over Frame Relay Networks", RFC 1586, March 1994.
[参考文献15]deSouza,O.和M.Rodrigues,“OSPF在帧中继网络上运行的指南”,RFC 1586,1994年3月。
[Ref16] Bellovin, S., "Security Problems in the TCP/IP Protocol Suite", ACM Computer Communications Review, Volume 19, Number 2, pp. 32-38, April 1989.
[参考文献16]Bellovin,S.,“TCP/IP协议套件中的安全问题”,《ACM计算机通信评论》,第19卷,第2期,第32-38页,1989年4月。
[Ref17] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, April 1992.
[Ref17]Rivest,R.,“MD5消息摘要算法”,RFC 13211992年4月。
[Ref18] Moy, J., "Multicast Extensions to OSPF", RFC 1584, March 1994.
[参考文献18]莫伊,J.,“OSPF的多播扩展”,RFC1584,1994年3月。
[Ref19] Coltun, R., and V. Fuller, "The OSPF NSSA Option", RFC 1587, March 1994.
[Ref19]Coltun,R.和V.Fuller,“OSPF NSSA方案”,RFC 1587,1994年3月。
[Ref20] Ferguson, D., "The OSPF External Attributes LSA", work in progress.
[Ref20]Ferguson,D.,“OSPF外部属性LSA”,正在进行中。
[Ref21] Moy, J., "Extending OSPF to Support Demand Circuits", RFC 1793, April 1995.
[参考文献21]Moy,J.“扩展OSPF以支持需求电路”,RFC 1793,1995年4月。
[Ref22] Mogul, J., and S. Deering, "Path MTU Discovery", RFC 1191, November 1990.
[参考文献22]Mogul,J.和S.Deering,“MTU发现路径”,RFC191990年11月。
[Ref23] Rekhter, Y., and T. Li, "A Border Gateway Protocol 4 (BGP-4)", RFC 1771, March 1995.
[参考文献23]Rekhter,Y.和T.Li,“边境网关协议4(BGP-4)”,RFC 1771,1995年3月。
[Ref24] Hinden, R., "Internet Routing Protocol Standardization Criteria", BBN, October 1991.
[Ref24]Hinden,R.,“互联网路由协议标准化标准”,BBN,1991年10月。
[Ref25] Moy, J., "OSPF Version 2", RFC 2178, July 1997.
[参考文献25]莫伊,J.,“OSPF版本2”,RFC2178,1997年7月。
[Ref26] Rosen, E., "Vulnerabilities of Network Control Protocols: An Example", Computer Communication Review, July 1981.
[参考文献26]Rosen,E.“网络控制协议的漏洞:一个例子”,《计算机通信评论》,1981年7月。
A. OSPF data formats
A.OSPF数据格式
This appendix describes the format of OSPF protocol packets and OSPF LSAs. The OSPF protocol runs directly over the IP network layer. Before any data formats are described, the details of the OSPF encapsulation are explained.
本附录描述了OSPF协议包和OSPF LSA的格式。OSPF协议直接在IP网络层上运行。在描述任何数据格式之前,将解释OSPF封装的细节。
Next the OSPF Options field is described. This field describes various capabilities that may or may not be supported by pieces of the OSPF routing domain. The OSPF Options field is contained in OSPF Hello packets, Database Description packets and in OSPF LSAs.
接下来描述OSPF选项字段。此字段描述OSPF路由域的各个部分可能支持也可能不支持的各种功能。OSPF选项字段包含在OSPF Hello数据包、数据库描述数据包和OSPF LSA中。
OSPF packet formats are detailed in Section A.3. A description of OSPF LSAs appears in Section A.4.
OSPF数据包格式详见第A.3节。OSPF LSA的说明见第A.4节。
OSPF runs directly over the Internet Protocol's network layer. OSPF packets are therefore encapsulated solely by IP and local data-link headers.
OSPF直接在互联网协议的网络层上运行。因此,OSPF数据包仅由IP和本地数据链路头封装。
OSPF does not define a way to fragment its protocol packets, and depends on IP fragmentation when transmitting packets larger than the network MTU. If necessary, the length of OSPF packets can be up to 65,535 bytes (including the IP header). The OSPF packet types that are likely to be large (Database Description Packets, Link State Request, Link State Update, and Link State Acknowledgment packets) can usually be split into several separate protocol packets, without loss of functionality. This is recommended; IP fragmentation should be avoided whenever possible. Using this reasoning, an attempt should be made to limit the sizes of OSPF packets sent over virtual links to 576 bytes unless Path MTU Discovery is being performed (see [Ref22]).
OSPF没有定义对其协议数据包进行分段的方法,并且在传输大于网络MTU的数据包时依赖于IP分段。如有必要,OSPF数据包的长度可高达65535字节(包括IP报头)。可能较大的OSPF数据包类型(数据库描述数据包、链路状态请求、链路状态更新和链路状态确认数据包)通常可以拆分为多个单独的协议数据包,而不会丢失功能。这是建议的;应尽可能避免IP碎片化。根据这一推理,应尝试将通过虚拟链路发送的OSPF数据包的大小限制为576字节,除非正在执行路径MTU发现(参见[Ref22])。
The other important features of OSPF's IP encapsulation are:
OSPF IP封装的其他重要功能包括:
o Use of IP multicast. Some OSPF messages are multicast, when sent over broadcast networks. Two distinct IP multicast addresses are used. Packets sent to these multicast addresses should never be forwarded; they are meant to travel a single hop only. To ensure that these packets will not travel multiple hops, their IP TTL must be set to 1.
o 使用IP多播。当通过广播网络发送时,一些OSPF消息是多播的。使用两个不同的IP多播地址。发送到这些多播地址的数据包不应该被转发;他们只能跳一步。为了确保这些数据包不会经过多个跃点,它们的IP TTL必须设置为1。
AllSPFRouters This multicast address has been assigned the value 224.0.0.5. All routers running OSPF should be prepared to receive packets sent to this address. Hello packets are always sent to this destination. Also, certain OSPF protocol packets are sent to this address during the flooding procedure.
此多播地址的所有SPFROUTERS已分配值224.0.0.5。所有运行OSPF的路由器都应该准备好接收发送到此地址的数据包。Hello数据包始终发送到此目的地。此外,在泛洪过程中,某些OSPF协议包被发送到此地址。
AllDRouters This multicast address has been assigned the value 224.0.0.6. Both the Designated Router and Backup Designated Router must be prepared to receive packets destined to this address. Certain OSPF protocol packets are sent to this address during the flooding procedure.
此多播地址已分配值224.0.0.6。指定路由器和备份指定路由器都必须准备好接收发送到此地址的数据包。在泛洪过程中,某些OSPF协议数据包被发送到此地址。
o OSPF is IP protocol number 89. This number has been registered with the Network Information Center. IP protocol number assignments are documented in [Ref11].
o OSPF是IP协议编号89。此号码已在网络信息中心注册。IP协议编号分配记录在[Ref11]中。
o All OSPF routing protocol packets are sent using the normal service TOS value of binary 0000 defined in [Ref12].
o 所有OSPF路由协议数据包均使用[Ref12]中定义的二进制0000的正常服务TOS值发送。
o Routing protocol packets are sent with IP precedence set to Internetwork Control. OSPF protocol packets should be given precedence over regular IP data traffic, in both sending and receiving. Setting the IP precedence field in the IP header to Internetwork Control [Ref5] may help implement this objective.
o 发送路由协议数据包时,IP优先级设置为Internetwork Control。在发送和接收时,OSPF协议包应优先于常规IP数据通信。将IP报头中的IP优先级字段设置为Internetwork Control[Ref5]可能有助于实现这一目标。
The OSPF Options field is present in OSPF Hello packets, Database Description packets and all LSAs. The Options field enables OSPF routers to support (or not support) optional capabilities, and to communicate their capability level to other OSPF routers. Through this mechanism routers of differing capabilities can be mixed within an OSPF routing domain.
OSPF选项字段出现在OSPF Hello数据包、数据库描述数据包和所有LSA中。选项字段使OSPF路由器能够支持(或不支持)可选功能,并将其功能级别与其他OSPF路由器进行通信。通过这种机制,不同功能的路由器可以在OSPF路由域中混合使用。
When used in Hello packets, the Options field allows a router to reject a neighbor because of a capability mismatch. Alternatively, when capabilities are exchanged in Database Description packets a router can choose not to forward certain LSAs to a neighbor because of its reduced functionality. Lastly, listing capabilities in LSAs allows routers to forward traffic around reduced functionality routers, by excluding them from parts of the routing table calculation.
当在Hello数据包中使用时,Options字段允许路由器因为功能不匹配而拒绝邻居。或者,当在数据库描述数据包中交换功能时,路由器可以选择不将某些LSA转发给邻居,因为它的功能减少了。最后,在LSA中列出功能允许路由器转发功能减少的路由器周围的流量,方法是将它们排除在路由表计算的部分之外。
Five bits of the OSPF Options field have been assigned, although only one (the E-bit) is described completely by this memo. Each bit is described briefly below. Routers should reset (i.e. clear) unrecognized bits in the Options field when sending Hello packets or Database Description packets and when originating LSAs. Conversely, routers encountering unrecognized Option bits in received Hello Packets, Database Description packets or LSAs should ignore the capability and process the packet/LSA normally.
OSPF选项字段的五位已分配,但本备忘录仅完整描述了一位(E位)。下面简要描述每个位。在发送Hello数据包或数据库描述数据包以及发起LSA时,路由器应重置(即清除)选项字段中未识别的位。相反,在收到的Hello数据包、数据库描述数据包或LSA中遇到无法识别的选项位的路由器应忽略该功能,并正常处理数据包/LSA。
+------------------------------------+ | * | * | DC | EA | N/P | MC | E | * | +------------------------------------+
+------------------------------------+ | * | * | DC | EA | N/P | MC | E | * | +------------------------------------+
The Options field
选项字段
E-bit This bit describes the way AS-external-LSAs are flooded, as described in Sections 3.6, 9.5, 10.8 and 12.1.2 of this memo.
E-bit该bit描述了外部LSA被淹没的方式,如本备忘录第3.6、9.5、10.8和12.1.2节所述。
MC-bit This bit describes whether IP multicast datagrams are forwarded according to the specifications in [Ref18].
MC位该位描述IP多播数据报是否根据[参考文献18]中的规范转发。
N/P-bit This bit describes the handling of Type-7 LSAs, as specified in [Ref19].
N/P位该位描述了[Ref19]中规定的7型LSA的处理。
EA-bit This bit describes the router's willingness to receive and forward External-Attributes-LSAs, as specified in [Ref20].
EA位该位描述路由器接收和转发外部属性LSA的意愿,如参考文献20所述。
DC-bit This bit describes the router's handling of demand circuits, as specified in [Ref21].
DC位该位描述了[Ref21]中规定的路由器对需求电路的处理。
There are five distinct OSPF packet types. All OSPF packet types begin with a standard 24 byte header. This header is described first. Each packet type is then described in a succeeding section. In these sections each packet's division into fields is displayed, and then the field definitions are enumerated.
有五种不同的OSPF数据包类型。所有OSPF数据包类型都以标准的24字节报头开始。首先描述该标题。然后在接下来的一节中描述每种分组类型。在这些部分中,将显示每个数据包的字段划分,然后枚举字段定义。
All OSPF packet types (other than the OSPF Hello packets) deal with lists of LSAs. For example, Link State Update packets implement the flooding of LSAs throughout the OSPF routing domain. Because of this, OSPF protocol packets cannot be parsed unless the format of LSAs is also understood. The format of LSAs is described in Section A.4.
所有OSPF数据包类型(OSPF Hello数据包除外)都处理LSA列表。例如,链路状态更新包在整个OSPF路由域中实现LSA的泛洪。因此,除非理解LSA的格式,否则无法解析OSPF协议数据包。LSA的格式见第A.4节。
The receive processing of OSPF packets is detailed in Section 8.2. The sending of OSPF packets is explained in Section 8.1.
OSPF数据包的接收处理详见第8.2节。第8.1节解释了OSPF数据包的发送。
Every OSPF packet starts with a standard 24 byte header. This header contains all the information necessary to determine whether the packet should be accepted for further processing. This determination is described in Section 8.2 of the specification.
每个OSPF数据包都以一个标准的24字节报头开始。此报头包含确定是否应接受数据包以进行进一步处理所需的所有信息。本规范第8.2节描述了该测定。
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | Type | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | Type | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Version # The OSPF version number. This specification documents version 2 of the protocol.
版本#OSPF版本号。本规范记录了协议的第2版。
Type The OSPF packet types are as follows. See Sections A.3.2 through A.3.6 for details.
类型OSPF数据包类型如下所示。详见第A.3.2至A.3.6节。
Type Description ________________________________ 1 Hello 2 Database Description 3 Link State Request 4 Link State Update 5 Link State Acknowledgment
Type Description ________________________________ 1 Hello 2 Database Description 3 Link State Request 4 Link State Update 5 Link State Acknowledgment
Packet length The length of the OSPF protocol packet in bytes. This length includes the standard OSPF header.
数据包长度OSPF协议数据包的长度,以字节为单位。此长度包括标准OSPF标头。
Router ID The Router ID of the packet's source.
路由器ID数据包源的路由器ID。
Area ID A 32 bit number identifying the area that this packet belongs to. All OSPF packets are associated with a single area. Most travel a single hop only. Packets travelling over a virtual link are labelled with the backbone Area ID of 0.0.0.0.
区域ID标识此数据包所属区域的32位数字。所有OSPF数据包都与单个区域相关联。大多数旅行只有一个单跳。在虚拟链路上传输的数据包被标记为主干区域ID为0.0.0.0。
Checksum The standard IP checksum of the entire contents of the packet, starting with the OSPF packet header but excluding the 64-bit authentication field. This checksum is calculated as the 16-bit one's complement of the one's complement sum of all the 16-bit words in the packet, excepting the authentication field. If the packet's length is not an integral number of 16-bit words, the packet is padded with a byte of zero before checksumming. The checksum is considered to be part of the packet authentication procedure; for some authentication types the checksum calculation is omitted.
校验和数据包全部内容的标准IP校验和,从OSPF数据包头开始,但不包括64位身份验证字段。此校验和计算为数据包中所有16位字的16位1的补码和的16位1的补码,验证字段除外。如果数据包的长度不是16位字的整数,则在校验和之前用零字节填充数据包。校验和被认为是分组认证过程的一部分;对于某些身份验证类型,将忽略校验和计算。
AuType Identifies the authentication procedure to be used for the packet. Authentication is discussed in Appendix D of the specification. Consult Appendix D for a list of the currently defined authentication types.
AuType标识要用于数据包的身份验证过程。认证在本规范附录D中讨论。有关当前定义的身份验证类型的列表,请参阅附录D。
Authentication A 64-bit field for use by the authentication scheme. See Appendix D for details.
身份验证供身份验证方案使用的64位字段。详见附录D。
Hello packets are OSPF packet type 1. These packets are sent periodically on all interfaces (including virtual links) in order to establish and maintain neighbor relationships. In addition, Hello Packets are multicast on those physical networks having a multicast or broadcast capability, enabling dynamic discovery of neighboring routers.
Hello数据包是OSPF数据包类型1。这些数据包在所有接口(包括虚拟链路)上定期发送,以便建立和维护邻居关系。此外,Hello数据包是具有多播或广播功能的物理网络上的多播,能够动态发现相邻路由器。
All routers connected to a common network must agree on certain parameters (Network mask, HelloInterval and RouterDeadInterval). These parameters are included in Hello packets, so that differences can inhibit the forming of neighbor relationships. A detailed explanation of the receive processing for Hello packets is presented in Section 10.5. The sending of Hello packets is covered in Section 9.5.
连接到公共网络的所有路由器必须就某些参数(网络掩码、HelloInterval和RouterDeadInterval)达成一致。这些参数包含在Hello数据包中,因此差异可以抑制邻居关系的形成。第10.5节详细解释了Hello数据包的接收处理。第9.5节介绍了Hello数据包的发送。
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | 1 | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Network Mask | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HelloInterval | Options | Rtr Pri | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RouterDeadInterval | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Designated Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Backup Designated Router |
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | 1 | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Network Mask | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HelloInterval | Options | Rtr Pri | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RouterDeadInterval | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Designated Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Backup Designated Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Neighbor | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Neighbor | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
Network mask The network mask associated with this interface. For example, if the interface is to a class B network whose third byte is used for subnetting, the network mask is 0xffffff00.
网络掩码与此接口关联的网络掩码。例如,如果接口连接到第三个字节用于子网的B类网络,则网络掩码为0xFFFF00。
Options The optional capabilities supported by the router, as documented in Section A.2.
选项路由器支持的可选功能,如第A.2节所述。
HelloInterval The number of seconds between this router's Hello packets.
HelloInterval此路由器的Hello数据包之间的秒数。
Rtr Pri This router's Router Priority. Used in (Backup) Designated Router election. If set to 0, the router will be ineligible to become (Backup) Designated Router.
Rtr Pri此路由器的路由器优先级。用于(备份)指定路由器选择。如果设置为0,路由器将没有资格成为(备份)指定路由器。
RouterDeadInterval The number of seconds before declaring a silent router down.
RouterReadInterval声明静默路由器关闭前的秒数。
Designated Router The identity of the Designated Router for this network, in the view of the sending router. The Designated Router is identified here by its IP interface address on the network. Set to 0.0.0.0 if there is no Designated Router.
指定路由器在发送路由器的视图中,此网络的指定路由器的标识。此处指定的路由器通过其在网络上的IP接口地址进行标识。如果没有指定的路由器,则设置为0.0.0.0。
Backup Designated Router The identity of the Backup Designated Router for this network, in the view of the sending router. The Backup Designated Router is identified here by its IP interface address on the network. Set to 0.0.0.0 if there is no Backup Designated Router.
备份指定路由器发送路由器视图中此网络的备份指定路由器的标识。此处通过网络上的IP接口地址标识备份指定路由器。如果没有备份指定路由器,则设置为0.0.0.0。
Neighbor The Router IDs of each router from whom valid Hello packets have been seen recently on the network. Recently means in the last RouterDeadInterval seconds.
邻居最近在网络上看到有效Hello数据包的每个路由器的路由器ID。最近表示在最后一个RouterDeadInterval秒内。
Database Description packets are OSPF packet type 2. These packets are exchanged when an adjacency is being initialized. They describe the contents of the link-state database. Multiple packets may be used to describe the database. For this purpose a poll-response procedure is used. One of the routers is designated to be the master, the other the slave. The master sends Database Description packets (polls) which are acknowledged by Database Description packets sent by the slave (responses). The responses are linked to the polls via the packets' DD sequence numbers.
数据库描述数据包为OSPF数据包类型2。当邻接被初始化时,这些数据包被交换。它们描述链接状态数据库的内容。可以使用多个数据包来描述数据库。为此,使用了轮询响应程序。其中一个路由器被指定为主路由器,另一个路由器被指定为从路由器。主服务器发送数据库描述数据包(轮询),由从服务器发送的数据库描述数据包(响应)确认。响应通过数据包的DD序列号链接到轮询。
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | 2 | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Interface MTU | Options |0|0|0|0|0|I|M|MS +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DD sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +- An LSA Header -+ | | +- -+ | | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | 2 | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Interface MTU | Options |0|0|0|0|0|I|M|MS +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DD sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +- An LSA Header -+ | | +- -+ | | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
The format of the Database Description packet is very similar to both the Link State Request and Link State Acknowledgment packets. The main part of all three is a list of items, each item describing a piece of the link-state database. The sending of Database Description Packets is documented in Section 10.8. The reception of Database Description packets is documented in Section 10.6.
数据库描述数据包的格式与链路状态请求和链路状态确认数据包非常相似。这三个项目的主要部分是一个项目列表,每个项目描述链接状态数据库的一部分。第10.8节记录了数据库描述数据包的发送。数据库描述数据包的接收记录在第10.6节中。
Interface MTU The size in bytes of the largest IP datagram that can be sent out the associated interface, without fragmentation. The MTUs of common Internet link types can be found in Table 7-1 of [Ref22]. Interface MTU should be set to 0 in Database Description packets sent over virtual links.
接口MTU可发送到相关接口的最大IP数据报的字节大小,无碎片。常见互联网链路类型的MTU见[参考文献22]的表7-1。在通过虚拟链接发送的数据库描述数据包中,接口MTU应设置为0。
Options The optional capabilities supported by the router, as documented in Section A.2.
选项路由器支持的可选功能,如第A.2节所述。
I-bit The Init bit. When set to 1, this packet is the first in the sequence of Database Description Packets.
我一点一点的。当设置为1时,此数据包是数据库描述数据包序列中的第一个数据包。
M-bit The More bit. When set to 1, it indicates that more Database Description Packets are to follow.
M-一点一点。当设置为1时,表示将遵循更多的数据库描述数据包。
MS-bit The Master/Slave bit. When set to 1, it indicates that the router is the master during the Database Exchange process. Otherwise, the router is the slave.
MS位为主/从位。当设置为1时,表示在数据库交换过程中路由器是主路由器。否则,路由器就是从机。
DD sequence number Used to sequence the collection of Database Description Packets. The initial value (indicated by the Init bit being set) should be unique. The DD sequence number then increments until the complete database description has been sent.
用于对数据库描述数据包集合进行排序的DD序列号。初始值(由设置的初始位指示)应该是唯一的。然后,DD序列号递增,直到发送完整的数据库描述。
The rest of the packet consists of a (possibly partial) list of the link-state database's pieces. Each LSA in the database is described by its LSA header. The LSA header is documented in Section A.4.1. It contains all the information required to uniquely identify both the LSA and the LSA's current instance.
数据包的其余部分由链路状态数据库片段的(可能是部分)列表组成。数据库中的每个LSA都由其LSA头描述。LSA标题记录在第A.4.1节中。它包含唯一标识LSA和LSA当前实例所需的所有信息。
Link State Request packets are OSPF packet type 3. After exchanging Database Description packets with a neighboring router, a router may find that parts of its link-state database are out-of-date. The Link State Request packet is used to request the pieces of the neighbor's database that are more up-to-date. Multiple Link State Request packets may need to be used.
链路状态请求数据包为OSPF数据包类型3。在与相邻路由器交换数据库描述数据包后,路由器可能会发现其链路状态数据库的某些部分已过时。链路状态请求数据包用于请求邻居数据库中更新的数据块。可能需要使用多个链路状态请求数据包。
A router that sends a Link State Request packet has in mind the precise instance of the database pieces it is requesting. Each instance is defined by its LS sequence number, LS checksum, and LS age, although these fields are not specified in the Link State Request Packet itself. The router may receive even more recent instances in response.
发送链路状态请求数据包的路由器会记住它所请求的数据库片段的精确实例。每个实例由其LS序列号、LS校验和和和LS年龄定义,尽管这些字段未在链路状态请求数据包本身中指定。路由器可能会收到更多最近的实例作为响应。
The sending of Link State Request packets is documented in Section 10.9. The reception of Link State Request packets is documented in Section 10.7.
链路状态请求数据包的发送记录在第10.9节中。链路状态请求数据包的接收记录在第10.7节中。
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | 3 | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | 3 | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
Each LSA requested is specified by its LS type, Link State ID, and Advertising Router. This uniquely identifies the LSA, but not its instance. Link State Request packets are understood to be requests for the most recent instance (whatever that might be).
请求的每个LSA由其LS类型、链路状态ID和播发路由器指定。这唯一标识LSA,但不标识其实例。链路状态请求包被理解为最近实例的请求(不管是什么)。
Link State Update packets are OSPF packet type 4. These packets implement the flooding of LSAs. Each Link State Update packet carries a collection of LSAs one hop further from their origin. Several LSAs may be included in a single packet.
链路状态更新数据包为OSPF数据包类型4。这些数据包实现LSA的泛洪。每个链路状态更新数据包携带一个LSA集合,该集合距离其源站更远一跳。在单个分组中可以包括多个lsa。
Link State Update packets are multicast on those physical networks that support multicast/broadcast. In order to make the flooding procedure reliable, flooded LSAs are acknowledged in Link State Acknowledgment packets. If retransmission of certain LSAs is necessary, the retransmitted LSAs are always sent directly to the neighbor. For more information on the reliable flooding of LSAs, consult Section 13.
链路状态更新数据包是支持多播/广播的物理网络上的多播。为了使泛洪过程可靠,在链路状态确认包中确认泛洪LSA。如果需要重新传输某些LSA,则重新传输的LSA始终直接发送给邻居。有关LSA可靠泛洪的更多信息,请参阅第13节。
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | 4 | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | # LSAs | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- +-+ | LSAs | +- +-+ | ... |
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | 4 | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | # LSAs | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- +-+ | LSAs | +- +-+ | ... |
# LSAs The number of LSAs included in this update.
#LSA此更新中包含的LSA数。
The body of the Link State Update packet consists of a list of LSAs. Each LSA begins with a common 20 byte header, described in Section A.4.1. Detailed formats of the different types of LSAs are described in Section A.4.
链路状态更新包的主体由LSA列表组成。每个LSA以一个通用的20字节报头开始,如第a.4.1节所述。不同类型LSA的详细格式见第A.4节。
Link State Acknowledgment Packets are OSPF packet type 5. To make the flooding of LSAs reliable, flooded LSAs are explicitly acknowledged. This acknowledgment is accomplished through the sending and receiving of Link State Acknowledgment packets. Multiple LSAs can be acknowledged in a single Link State Acknowledgment packet.
链路状态确认数据包为OSPF数据包类型5。为了使LSA的泛洪可靠,明确确认泛洪LSA。此确认通过发送和接收链路状态确认数据包来完成。在单个链路状态确认数据包中可以确认多个LSA。
Depending on the state of the sending interface and the sender of the corresponding Link State Update packet, a Link State Acknowledgment packet is sent either to the multicast address AllSPFRouters, to the multicast address AllDRouters, or as a unicast. The sending of Link State Acknowledgement packets is documented in Section 13.5. The reception of Link State Acknowledgement packets is documented in Section 13.7.
根据发送接口的状态和相应链路状态更新包的发送方,链路状态确认包被发送到多播地址AllsFrouters、多播地址AllDrooters或作为单播。链路状态确认数据包的发送记录在第13.5节中。链路状态确认数据包的接收记录在第13.7节中。
The format of this packet is similar to that of the Data Description packet. The body of both packets is simply a list of LSA headers.
此数据包的格式与数据描述数据包的格式相似。两个数据包的主体只是一个LSA头的列表。
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | 5 | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +- An LSA Header -+ | | +- -+
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version # | 5 | Packet length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Area ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | AuType | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +- An LSA Header -+ | | +- -+
| | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
| | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
Each acknowledged LSA is described by its LSA header. The LSA header is documented in Section A.4.1. It contains all the information required to uniquely identify both the LSA and the LSA's current instance.
每个已确认的LSA由其LSA头描述。LSA标题记录在第A.4.1节中。它包含唯一标识LSA和LSA当前实例所需的所有信息。
This memo defines five distinct types of LSAs. Each LSA begins with a standard 20 byte LSA header. This header is explained in Section A.4.1. Succeeding sections then diagram the separate LSA types.
本备忘录定义了五种不同类型的LSA。每个LSA都以一个标准的20字节LSA头开始。该标题在第A.4.1节中解释。接下来的部分将分别绘制LSA类型图。
Each LSA describes a piece of the OSPF routing domain. Every router originates a router-LSA. In addition, whenever the router is elected Designated Router, it originates a network-LSA. Other types of LSAs may also be originated (see Section 12.4). All LSAs are then flooded throughout the OSPF routing domain. The flooding algorithm is reliable, ensuring that all routers have the same collection of LSAs. (See Section 13 for more information concerning the flooding algorithm). This collection of LSAs is called the link-state database.
每个LSA描述OSPF路由域的一部分。每个路由器产生一个路由器LSA。此外,只要路由器被选为指定路由器,它就会发起一个网络LSA。也可能产生其他类型的LSA(见第12.4节)。然后,所有LSA在整个OSPF路由域中被淹没。泛洪算法是可靠的,确保所有路由器具有相同的LSA集合。(有关泛洪算法的更多信息,请参见第13节)。此LSA集合称为链接状态数据库。
From the link state database, each router constructs a shortest path tree with itself as root. This yields a routing table (see Section 11). For the details of the routing table build process, see Section 16.
从链路状态数据库中,每个路由器构建一个以自身为根的最短路径树。这将产生一个路由表(见第11节)。有关路由表生成过程的详细信息,请参阅第16节。
All LSAs begin with a common 20 byte header. This header contains enough information to uniquely identify the LSA (LS type, Link State ID, and Advertising Router). Multiple instances of the LSA may exist in the routing domain at the same time. It is then necessary to determine which instance is more recent. This is accomplished by examining the LS age, LS sequence number and LS checksum fields that are also contained in the LSA header.
所有LSA都以一个公共的20字节头开始。此标头包含足够的信息来唯一标识LSA(LS类型、链路状态ID和播发路由器)。LSA的多个实例可能同时存在于路由域中。然后有必要确定哪个实例是最近的。这是通过检查也包含在LSA标头中的LS age、LS序列号和LS校验和字段来实现的。
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS age | Options | LS type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS checksum | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS age | Options | LS type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS checksum | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
LS age The time in seconds since the LSA was originated.
LS age自启动LSA以来的时间(以秒为单位)。
Options The optional capabilities supported by the described portion of the routing domain. OSPF's optional capabilities are documented in Section A.2.
选项路由域的所述部分支持的可选功能。OSPF的可选功能记录在第A.2节中。
LS type The type of the LSA. Each LSA type has a separate advertisement format. The LSA types defined in this memo are as follows (see Section 12.1.3 for further explanation):
LS type LSA的类型。每种LSA类型都有单独的广告格式。本备忘录中定义的LSA类型如下(进一步解释见第12.1.3节):
LS Type Description ___________________________________ 1 Router-LSAs 2 Network-LSAs 3 Summary-LSAs (IP network) 4 Summary-LSAs (ASBR) 5 AS-external-LSAs
LS Type Description ___________________________________ 1 Router-LSAs 2 Network-LSAs 3 Summary-LSAs (IP network) 4 Summary-LSAs (ASBR) 5 AS-external-LSAs
Link State ID This field identifies the portion of the internet environment that is being described by the LSA. The contents of this field depend on the LSA's LS type. For example, in network-LSAs the Link State ID is set to the IP interface address of the network's Designated Router (from which the network's IP address can be derived). The Link State ID is further discussed in Section 12.1.4.
链路状态ID此字段标识LSA描述的internet环境部分。此字段的内容取决于LSA的LS类型。例如,在网络LSAs中,链路状态ID被设置为网络指定路由器的IP接口地址(网络的IP地址可以从中派生)。链路状态ID将在第12.1.4节中进一步讨论。
Advertising Router The Router ID of the router that originated the LSA. For example, in network-LSAs this field is equal to the Router ID of the network's Designated Router.
广告路由器发起LSA的路由器的路由器ID。例如,在网络LSAs中,此字段等于网络指定路由器的路由器ID。
LS sequence number Detects old or duplicate LSAs. Successive instances of an LSA are given successive LS sequence numbers. See Section 12.1.6 for more details.
LS序列号检测旧的或重复的LSA。LSA的连续实例被赋予连续的LS序列号。详见第12.1.6节。
LS checksum The Fletcher checksum of the complete contents of the LSA, including the LSA header but excluding the LS age field. See Section 12.1.7 for more details.
LS校验和LSA完整内容的Fletcher校验和,包括LSA标头,但不包括LS age字段。详见第12.1.7节。
length The length in bytes of the LSA. This includes the 20 byte LSA header.
长度LSA的长度(以字节为单位)。这包括20字节的LSA报头。
Router-LSAs are the Type 1 LSAs. Each router in an area originates a router-LSA. The LSA describes the state and cost of the router's links (i.e., interfaces) to the area. All of the router's links to the area must be described in a single router-LSA. For details concerning the construction of router-LSAs, see Section 12.4.1.
路由器LSA是类型1 LSA。一个区域中的每个路由器都发起一个路由器LSA。LSA描述路由器到该区域的链路(即接口)的状态和成本。必须在单个路由器LSA中描述该区域的所有路由器链接。有关路由器LSA构造的详细信息,请参见第12.4.1节。
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS age | Options | 1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS checksum | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 0 |V|E|B| 0 | # links | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | # TOS | metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TOS | 0 | TOS metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS age | Options | 1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS checksum | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 0 |V|E|B| 0 | # links | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | # TOS | metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TOS | 0 | TOS metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
In router-LSAs, the Link State ID field is set to the router's OSPF Router ID. Router-LSAs are flooded throughout a single area only.
在路由器LSA中,链路状态ID字段设置为路由器的OSPF路由器ID。路由器LSA仅在单个区域内被淹没。
bit V When set, the router is an endpoint of one or more fully adjacent virtual links having the described area as Transit area (V is for virtual link endpoint).
位V设置时,路由器是一个或多个完全相邻的虚拟链路的端点,该虚拟链路具有所述区域作为传输区域(V表示虚拟链路端点)。
bit E When set, the router is an AS boundary router (E is for external).
位E设置后,路由器为AS边界路由器(E为外部路由器)。
bit B When set, the router is an area border router (B is for border).
位B设置后,路由器为区域边界路由器(B表示边界)。
# links The number of router links described in this LSA. This must be the total collection of router links (i.e., interfaces) to the area.
#链路本LSA中描述的路由器链路数。这必须是到该区域的路由器链路(即接口)的总集合。
The following fields are used to describe each router link (i.e., interface). Each router link is typed (see the below Type field). The Type field indicates the kind of link being described. It may be a link to a transit network, to another router or to a stub network. The values of all the other fields describing a router link depend on the link's Type. For example, each link has an associated 32-bit Link Data field. For links to stub networks this field specifies the network's IP address mask. For other link types the Link Data field specifies the router interface's IP address.
以下字段用于描述每个路由器链路(即接口)。每个路由器链接都已键入(请参见下面的类型字段)。类型字段指示所描述的链接类型。它可能是到传输网络、到另一路由器或到存根网络的链路。描述路由器链路的所有其他字段的值取决于链路的类型。例如,每个链路都有一个关联的32位链路数据字段。对于到存根网络的链接,此字段指定网络的IP地址掩码。对于其他链路类型,链路数据字段指定路由器接口的IP地址。
Type A quick description of the router link. One of the following. Note that host routes are classified as links to stub networks with network mask of 0xffffffff.
键入路由器链接的快速说明。下列情况之一。请注意,主机路由被分类为到网络掩码为0xFFFFFF的存根网络的链接。
Type Description __________________________________________________ 1 Point-to-point connection to another router 2 Connection to a transit network 3 Connection to a stub network 4 Virtual link
Type Description __________________________________________________ 1 Point-to-point connection to another router 2 Connection to a transit network 3 Connection to a stub network 4 Virtual link
Link ID Identifies the object that this router link connects to. Value depends on the link's Type. When connecting to an object that also originates an LSA (i.e., another router or a transit network) the Link ID is equal to the neighboring LSA's Link State ID. This provides the key for looking up the neighboring LSA in the link state database during the routing table calculation. See Section 12.2 for more details.
链路ID标识此路由器链路连接到的对象。值取决于链接的类型。当连接到也发起LSA的对象(即,另一个路由器或传输网络)时,链路ID等于相邻LSA的链路状态ID。这提供了在路由表计算期间在链路状态数据库中查找相邻LSA的密钥。详见第12.2节。
Type Link ID ______________________________________ 1 Neighboring router's Router ID 2 IP address of Designated Router 3 IP network/subnet number 4 Neighboring router's Router ID
Type Link ID ______________________________________ 1 Neighboring router's Router ID 2 IP address of Designated Router 3 IP network/subnet number 4 Neighboring router's Router ID
Link Data Value again depends on the link's Type field. For connections to stub networks, Link Data specifies the network's IP address mask. For unnumbered point-to-point connections, it specifies the interface's MIB-II [Ref8] ifIndex value. For the other link types it specifies the router interface's IP address. This latter piece of information is needed during the routing table build process, when calculating the IP address of the next hop. See Section 16.1.1 for more details.
链接数据值同样取决于链接的类型字段。对于到存根网络的连接,链路数据指定网络的IP地址掩码。对于未编号的点到点连接,它指定接口的MIB-II[Ref8]iIndex值。对于其他链路类型,它指定路由器接口的IP地址。在路由表构建过程中,计算下一跳的IP地址时,需要后一段信息。详见第16.1.1节。
# TOS The number of different TOS metrics given for this link, not counting the required link metric (referred to as the TOS 0 metric in [Ref9]). For example, if no additional TOS metrics are given, this field is set to 0.
#TOS为该链路提供的不同TOS度量的数量,不包括所需的链路度量(参考文献9中称为TOS 0度量)。例如,如果未给出其他TOS指标,则此字段设置为0。
metric The cost of using this router link.
度量使用此路由器链路的成本。
Additional TOS-specific information may also be included, for backward compatibility with previous versions of the OSPF specification ([Ref9]). Within each link, and for each desired TOS, TOS TOS-specific link information may be encoded as follows:
还可以包括其他特定于TOS的信息,以便与OSPF规范的早期版本(参考文献9)向后兼容。在每个链路内,对于每个期望的TOS,TOS-TOS特定链路信息可被编码如下:
TOS IP Type of Service that this metric refers to. The encoding of TOS in OSPF LSAs is described in Section 12.3.
此指标所指的TOS IP服务类型。OSPF LSA中TOS的编码如第12.3节所述。
TOS metric TOS-specific metric information.
TOS度量TOS特定度量信息。
Network-LSAs are the Type 2 LSAs. A network-LSA is originated for each broadcast and NBMA network in the area which supports two or more routers. The network-LSA is originated by the network's Designated Router. The LSA describes all routers attached to the network, including the Designated Router itself. The LSA's Link State ID field lists the IP interface address of the Designated Router.
网络LSA是类型2 LSA。在支持两个或多个路由器的区域中,为每个广播和NBMA网络发起网络LSA。网络LSA由网络的指定路由器发起。LSA描述连接到网络的所有路由器,包括指定的路由器本身。LSA的链路状态ID字段列出指定路由器的IP接口地址。
The distance from the network to all attached routers is zero. This is why metric fields need not be specified in the network-LSA. For details concerning the construction of network-LSAs, see Section 12.4.2.
从网络到所有连接的路由器的距离为零。这就是为什么不需要在网络LSA中指定度量字段。有关网络LSA建设的详细信息,请参见第12.4.2节。
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS age | Options | 2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS checksum | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Network Mask | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Attached Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS age | Options | 2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS checksum | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Network Mask | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Attached Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
Network Mask The IP address mask for the network. For example, a class A network would have the mask 0xff000000.
网络掩码网络的IP地址掩码。例如,a类网络的掩码为0xff000000。
Attached Router The Router IDs of each of the routers attached to the network. Actually, only those routers that are fully adjacent to the Designated Router are listed. The Designated Router includes itself in this list. The number of routers included can be deduced from the LSA header's length field.
连接的路由器连接到网络的每个路由器的路由器ID。实际上,仅列出与指定路由器完全相邻的路由器。指定的路由器将自身包含在此列表中。包含的路由器数量可以从LSA报头的长度字段中推断出来。
Summary-LSAs are the Type 3 and 4 LSAs. These LSAs are originated by area border routers. Summary-LSAs describe inter-area destinations. For details concerning the construction of summary-LSAs, see Section 12.4.3.
摘要LSA为3型和4型LSA。这些LSA由区域边界路由器发起。摘要LSA描述了区域间目的地。有关汇总LSA构造的详细信息,请参见第12.4.3节。
Type 3 summary-LSAs are used when the destination is an IP network. In this case the LSA's Link State ID field is an IP network number (if necessary, the Link State ID can also have one or more of the network's "host" bits set; see Appendix E for details). When the destination is an AS boundary router, a Type 4 summary-LSA is used, and the Link State ID field is the AS boundary router's OSPF Router ID. (To see why it is necessary to advertise the location of each ASBR, consult Section 16.4.) Other than the difference in the Link State ID field, the format of Type 3 and 4 summary-LSAs is identical.
当目标是IP网络时,使用类型3摘要LSA。在这种情况下,LSA的链路状态ID字段是IP网络号(如有必要,链路状态ID还可以设置一个或多个网络“主机”位;有关详细信息,请参阅附录E)。当目的地是AS边界路由器时,使用类型4摘要LSA,并且链路状态ID字段是AS边界路由器的OSPF路由器ID。(要了解为什么有必要公布每个ASBR的位置,请参阅第16.4节。)除了链路状态ID字段中的差异外,类型3和4摘要LSA的格式是相同的。
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS age | Options | 3 or 4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS checksum | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Network Mask | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 0 | metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TOS | TOS metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS age | Options | 3 or 4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS checksum | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Network Mask | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 0 | metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TOS | TOS metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
For stub areas, Type 3 summary-LSAs can also be used to describe a (per-area) default route. Default summary routes are used in stub areas instead of flooding a complete set of external routes. When describing a default summary route, the summary-LSA's Link State ID is always set to DefaultDestination (0.0.0.0) and the Network Mask is set to 0.0.0.0.
对于存根区域,类型3摘要LSA也可用于描述(每个区域)的默认路由。默认摘要路由用于存根区域,而不是淹没一整套外部路由。描述默认摘要路由时,摘要LSA的链路状态ID始终设置为DefaultDestination(0.0.0.0),网络掩码设置为0.0.0.0。
Network Mask For Type 3 summary-LSAs, this indicates the destination network's IP address mask. For example, when advertising the location of a class A network the value 0xff000000 would be used. This field is not meaningful and must be zero for Type 4 summary-LSAs.
类型3摘要LSA的网络掩码,表示目标网络的IP地址掩码。例如,在公布a类网络的位置时,将使用值0xff000000。此字段没有意义,对于类型4摘要LSA,必须为零。
metric The cost of this route. Expressed in the same units as the interface costs in the router-LSAs.
衡量这条路线的成本。以与路由器LSA中的接口成本相同的单位表示。
Additional TOS-specific information may also be included, for backward compatibility with previous versions of the OSPF specification ([Ref9]). For each desired TOS, TOS-specific information is encoded as follows:
还可以包括其他特定于TOS的信息,以便与OSPF规范的早期版本(参考文献9)向后兼容。对于每个期望的TOS,TOS特定信息编码如下:
TOS IP Type of Service that this metric refers to. The encoding of TOS in OSPF LSAs is described in Section 12.3.
此指标所指的TOS IP服务类型。OSPF LSA中TOS的编码如第12.3节所述。
TOS metric TOS-specific metric information.
TOS度量TOS特定度量信息。
AS-external-LSAs are the Type 5 LSAs. These LSAs are originated by AS boundary routers, and describe destinations external to the AS. For details concerning the construction of AS-external-LSAs, see Section 12.4.3.
与外部LSA相同的是5型LSA。这些LSA由AS边界路由器发起,并描述AS外部的目的地。有关AS外部LSA施工的详细信息,请参见第12.4.3节。
AS-external-LSAs usually describe a particular external destination. For these LSAs the Link State ID field specifies an IP network number (if necessary, the Link State ID can also have one or more of the network's "host" bits set; see Appendix E for details). AS-external-LSAs are also used to describe a default route. Default routes are used when no specific route exists to the destination. When describing a default route, the Link State ID is always set to DefaultDestination (0.0.0.0) and the Network Mask is set to 0.0.0.0.
因为外部LSA通常描述特定的外部目的地。对于这些LSA,链路状态ID字段指定IP网络号(如有必要,链路状态ID还可以设置一个或多个网络“主机”位;有关详细信息,请参阅附录E)。AS外部LSA也用于描述默认路由。当不存在到目的地的特定路线时,使用默认路线。描述默认路由时,链路状态ID始终设置为DefaultDestination(0.0.0.0),网络掩码设置为0.0.0.0。
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS age | Options | 5 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS checksum | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Network Mask | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |E| 0 | metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Forwarding address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | External Route Tag | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |E| TOS | TOS metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Forwarding address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS age | Options | 5 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link State ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertising Router | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LS checksum | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Network Mask | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |E| 0 | metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Forwarding address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | External Route Tag | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |E| TOS | TOS metric | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Forwarding address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| External Route Tag | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
| External Route Tag | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... |
Network Mask The IP address mask for the advertised destination. For example, when advertising a class A network the mask 0xff000000 would be used.
网络掩码播发目标的IP地址掩码。例如,在公布a类网络时,将使用掩码0xff000000。
bit E The type of external metric. If bit E is set, the metric specified is a Type 2 external metric. This means the metric is considered larger than any link state path. If bit E is zero, the specified metric is a Type 1 external metric. This means that it is expressed in the same units as the link state metric (i.e., the same units as interface cost).
位E表示外部度量的类型。如果设置了位E,则指定的度量是类型2外部度量。这意味着该度量被视为大于任何链路状态路径。如果位E为零,则指定的度量是类型1外部度量。这意味着它以与链路状态度量相同的单位表示(即,与接口成本相同的单位)。
metric The cost of this route. Interpretation depends on the external type indication (bit E above).
衡量这条路线的成本。解释取决于外部类型指示(上面的E位)。
Forwarding address Data traffic for the advertised destination will be forwarded to this address. If the Forwarding address is set to 0.0.0.0, data traffic will be forwarded instead to the LSA's originator (i.e., the responsible AS boundary router).
转发地址播发目的地的数据通信将转发到此地址。如果转发地址设置为0.0.0.0,则数据流量将转发给LSA的发起人(即负责的AS边界路由器)。
External Route Tag A 32-bit field attached to each external route. This is not used by the OSPF protocol itself. It may be used to communicate information between AS boundary routers; the precise nature of such information is outside the scope of this specification.
外部路由标记附加到每个外部路由的32位字段。OSPF协议本身不使用此选项。它可用于在AS边界路由器之间进行信息通信;此类信息的准确性质不在本规范范围内。
Additional TOS-specific information may also be included, for backward compatibility with previous versions of the OSPF specification ([Ref9]). For each desired TOS, TOS-specific information is encoded as follows:
还可以包括其他特定于TOS的信息,以便与OSPF规范的早期版本(参考文献9)向后兼容。对于每个期望的TOS,TOS特定信息编码如下:
TOS The Type of Service that the following fields concern. The encoding of TOS in OSPF LSAs is described in Section 12.3.
TOS以下字段涉及的服务类型。OSPF LSA中TOS的编码如第12.3节所述。
bit E For backward-compatibility with [Ref9].
位E与[Ref9]向后兼容。
TOS metric TOS-specific metric information.
TOS度量TOS特定度量信息。
Forwarding address For backward-compatibility with [Ref9].
与[Ref9]向后兼容的转发地址。
External Route Tag For backward-compatibility with [Ref9].
与[Ref9]向后兼容的外部路由标记。
B. Architectural Constants
B.建筑常数
Several OSPF protocol parameters have fixed architectural values. These parameters have been referred to in the text by names such as LSRefreshTime. The same naming convention is used for the configurable protocol parameters. They are defined in Appendix C.
几个OSPF协议参数具有固定的体系结构值。这些参数在文本中已通过名称(如lsrefreshttime)引用。可配置协议参数使用相同的命名约定。它们的定义见附录C。
The name of each architectural constant follows, together with its value and a short description of its function.
每个体系结构常量的名称及其值和对其功能的简短描述如下。
LSRefreshTime The maximum time between distinct originations of any particular LSA. If the LS age field of one of the router's self-originated LSAs reaches the value LSRefreshTime, a new instance of the LSA is originated, even though the contents of the LSA (apart from the LSA header) will be the same. The value of LSRefreshTime is set to 30 minutes.
LSRefreshTime任何特定LSA的不同来源之间的最长时间。如果路由器自创LSA之一的LS age字段达到值LSRefreshTime,则会生成LSA的新实例,即使LSA的内容(LSA标头除外)相同。LSRefreshTime的值设置为30分钟。
MinLSInterval The minimum time between distinct originations of any particular LSA. The value of MinLSInterval is set to 5 seconds.
MinlInterval任何特定LSA的不同来源之间的最短时间。MinlInterval的值设置为5秒。
MinLSArrival For any particular LSA, the minimum time that must elapse between reception of new LSA instances during flooding. LSA instances received at higher frequencies are discarded. The value of MinLSArrival is set to 1 second.
MinLSArrival对于任何特定LSA,在泛洪期间接收新LSA实例之间必须经过的最短时间。丢弃以更高频率接收的LSA实例。MinLSArrival的值设置为1秒。
MaxAge The maximum age that an LSA can attain. When an LSA's LS age field reaches MaxAge, it is reflooded in an attempt to flush the LSA from the routing domain (See Section 14). LSAs of age MaxAge are not used in the routing table calculation. The value of MaxAge is set to 1 hour.
最大年龄LSA可以达到的最大年龄。当LSA的LS age字段达到MaxAge时,它将重新加载,以尝试从路由域刷新LSA(请参阅第14节)。路由表计算中不使用最大年龄的LSA。MaxAge的值设置为1小时。
CheckAge When the age of an LSA in the link state database hits a multiple of CheckAge, the LSA's checksum is verified. An incorrect checksum at this time indicates a serious error. The value of CheckAge is set to 5 minutes.
校验当链路状态数据库中的LSA的校验期达到校验期的倍数时,将验证LSA的校验和。此时不正确的校验和表示严重错误。CheckAge的值设置为5分钟。
MaxAgeDiff The maximum time dispersion that can occur, as an LSA is flooded throughout the AS. Most of this time is accounted for by the LSAs sitting on router output queues (and therefore not aging) during the flooding process. The value of MaxAgeDiff is set to 15 minutes.
MaxAgeDiff当LSA在整个as中被淹没时,可能发生的最大时间分散。在泛洪过程中,大部分时间是由位于路由器输出队列上的LSA占用的(因此不会老化)。MaxAgeDiff的值设置为15分钟。
LSInfinity The metric value indicating that the destination described by an LSA is unreachable. Used in summary-LSAs and AS-external-LSAs as an alternative to premature aging (see Section 14.1). It is defined to be the 24-bit binary value of all ones: 0xffffff.
LSInfinity表示无法到达LSA所描述的目的地的度量值。用于总结LSA和外部LSA,以替代过早老化(见第14.1节)。它被定义为所有值的24位二进制值:0xffffff。
DefaultDestination The Destination ID that indicates the default route. This route is used when no other matching routing table entry can be found. The default destination can only be advertised in AS-external-LSAs and in stub areas' type 3 summary-LSAs. Its value is the IP address 0.0.0.0. Its associated Network Mask is also always 0.0.0.0.
DefaultDestination指示默认路由的目的地ID。当找不到其他匹配的路由表条目时,将使用此路由。默认目标只能作为外部LSA和存根区域的类型3摘要LSA发布。它的值是IP地址0.0.0.0。其关联的网络掩码也始终为0.0.0.0。
InitialSequenceNumber The value used for LS Sequence Number when originating the first instance of any LSA. Its value is the signed 32-bit integer 0x80000001.
InitialSequenceNumber在初始化任何LSA的第一个实例时用于LS序列号的值。其值为有符号32位整数0x8000001。
MaxSequenceNumber The maximum value that LS Sequence Number can attain. Its value is the signed 32-bit integer 0x7fffffff.
MaxSequenceNumber LS SequenceNumber可以达到的最大值。其值是有符号32位整数0x7fffffff。
C. Configurable Constants
C.可配置常数
The OSPF protocol has quite a few configurable parameters. These parameters are listed below. They are grouped into general functional categories (area parameters, interface parameters, etc.). Sample values are given for some of the parameters.
OSPF协议有很多可配置的参数。下面列出了这些参数。它们分为一般功能类别(区域参数、接口参数等)。给出了一些参数的样本值。
Some parameter settings need to be consistent among groups of routers. For example, all routers in an area must agree on that area's parameters, and all routers attached to a network must agree on that network's IP network number and mask.
某些参数设置需要在路由器组之间保持一致。例如,一个区域中的所有路由器必须同意该区域的参数,连接到网络的所有路由器必须同意该网络的IP网络号和掩码。
Some parameters may be determined by router algorithms outside of this specification (e.g., the address of a host connected to the router via a SLIP line). From OSPF's point of view, these items are still configurable.
一些参数可由本规范之外的路由器算法确定(例如,通过滑线连接到路由器的主机地址)。从OSPF的角度来看,这些项目仍然是可配置的。
C.1 Global parameters
C.1全局参数
In general, a separate copy of the OSPF protocol is run for each area. Because of this, most configuration parameters are defined on a per-area basis. The few global configuration parameters are listed below.
通常,每个区域都会运行OSPF协议的单独副本。因此,大多数配置参数都是按面积定义的。下面列出了几个全局配置参数。
Router ID This is a 32-bit number that uniquely identifies the router in the Autonomous System. One algorithm for Router ID assignment is to choose the largest or smallest IP address assigned to the router. If a router's OSPF Router ID is changed, the router's OSPF software should be restarted before the new Router ID takes effect. Before restarting in order to change its Router ID, the router should flush its self-originated LSAs from the routing domain (see Section 14.1), or they will persist for up to MaxAge minutes.
路由器ID这是一个32位的数字,唯一标识自治系统中的路由器。路由器ID分配的一种算法是选择分配给路由器的最大或最小IP地址。如果路由器的OSPF路由器ID发生更改,则应在新路由器ID生效之前重新启动路由器的OSPF软件。在重新启动以更改其路由器ID之前,路由器应从路由域刷新其自源LSA(请参阅第14.1节),否则它们将持续最长分钟。
RFC1583Compatibility Controls the preference rules used in Section 16.4 when choosing among multiple AS-external-LSAs advertising the same destination. When set to "enabled", the preference rules remain those specified by RFC 1583 ([Ref9]). When set to "disabled", the preference rules are those stated in
RFC1583兼容性控制第16.4节中在多个AS外部LSA中选择宣传同一目的地时使用的偏好规则。当设置为“启用”时,首选项规则保持RFC 1583([Ref9])指定的规则。当设置为“禁用”时,首选项规则为中所述的规则
Section 16.4.1, which prevent routing loops when AS-external-LSAs for the same destination have been originated from different areas. Set to "enabled" by default.
第16.4.1节,当相同目的地的外部LSA来自不同区域时,防止路由环路。默认设置为“已启用”。
In order to minimize the chance of routing loops, all OSPF routers in an OSPF routing domain should have RFC1583Compatibility set identically. When there are routers present that have not been updated with the functionality specified in Section 16.4.1 of this memo, all routers should have RFC1583Compatibility set to "enabled". Otherwise, all routers should have RFC1583Compatibility set to "disabled", preventing all routing loops.
为了最小化路由循环的机会,OSPF路由域中的所有OSPF路由器都应该具有相同的RFC1583兼容性设置。当存在未使用本备忘录第16.4.1节中规定的功能更新的路由器时,所有路由器应将RFC1583兼容性设置为“已启用”。否则,所有路由器应将RFC1583兼容性设置为“禁用”,以防止所有路由循环。
C.2 Area parameters
C.2面积参数
All routers belonging to an area must agree on that area's configuration. Disagreements between two routers will lead to an inability for adjacencies to form between them, with a resulting hindrance to the flow of routing protocol and data traffic. The following items must be configured for an area:
属于某个区域的所有路由器必须同意该区域的配置。两个路由器之间的分歧将导致它们之间无法形成邻接,从而阻碍路由协议和数据流量的流动。必须为区域配置以下项目:
Area ID This is a 32-bit number that identifies the area. The Area ID of 0.0.0.0 is reserved for the backbone. If the area represents a subnetted network, the IP network number of the subnetted network may be used for the Area ID.
区域ID这是标识区域的32位数字。区域ID 0.0.0.0是为主干保留的。如果区域表示子网网络,则子网网络的IP网络号可用于区域ID。
List of address ranges An OSPF area is defined as a list of address ranges. Each address range consists of the following items:
地址范围列表OSPF区域定义为地址范围列表。每个地址范围由以下项目组成:
[IP address, mask] Describes the collection of IP addresses contained in the address range. Networks and hosts are assigned to an area depending on whether their addresses fall into one of the area's defining address ranges. Routers are viewed as belonging to multiple areas, depending on their attached networks' area membership.
[IP地址,掩码]描述地址范围中包含的IP地址集合。网络和主机被分配到一个区域,这取决于它们的地址是否属于该区域定义的地址范围之一。路由器被视为属于多个区域,这取决于其连接网络的区域成员资格。
Status Set to either Advertise or DoNotAdvertise. Routing information is condensed at area boundaries. External to the area, at most a single route is advertised (via a summary-LSA) for each address range. The route is advertised if and only if the address range's Status is set to Advertise. Unadvertised ranges allow the existence of certain networks to be intentionally hidden from other areas. Status is set to Advertise by default.
状态设置为播发或不播发。路由信息在区域边界处压缩。在该区域之外,对于每个地址范围,最多只公布一条路由(通过摘要LSA)。当且仅当地址范围的状态设置为播发时,才会播发路由。未经宣传的范围允许故意对其他区域隐藏某些网络的存在。默认情况下,状态设置为播发。
As an example, suppose an IP subnetted network is to be its own OSPF area. The area would be configured as a single address range, whose IP address is the address of the subnetted network, and whose mask is the natural class A, B, or C address mask. A single route would be advertised external to the area, describing the entire subnetted network.
例如,假设一个IP子网网络是它自己的OSPF区域。该区域将配置为单个地址范围,其IP地址为子网网络的地址,其掩码为自然a类、B类或C类地址掩码。将在该区域外部公布一条路线,描述整个子网网络。
ExternalRoutingCapability Whether AS-external-LSAs will be flooded into/throughout the area. If AS-external-LSAs are excluded from the area, the area is called a "stub". Internal to stub areas, routing to external destinations will be based solely on a default summary route. The backbone cannot be configured as a stub area. Also, virtual links cannot be configured through stub areas. For more information, see Section 3.6.
外部布线能力是否为外部LSA将被淹没到该区域/整个区域。如果外部LSA被排除在该区域之外,则该区域称为“存根”。内部到存根区域,到外部目的地的路由将仅基于默认摘要路由。主干不能配置为存根区域。此外,不能通过存根区域配置虚拟链接。有关更多信息,请参见第3.6节。
StubDefaultCost If the area has been configured as a stub area, and the router itself is an area border router, then the StubDefaultCost indicates the cost of the default summary-LSA that the router should advertise into the area.
StubDefaultCost如果该区域已配置为存根区域,并且路由器本身是区域边界路由器,则StubDefaultCost表示路由器应向该区域播发的默认摘要LSA的成本。
C.3 Router interface parameters
C.3路由器接口参数
Some of the configurable router interface parameters (such as IP interface address and subnet mask) actually imply properties of the attached networks, and therefore must be consistent across all the routers attached to that network. The parameters that must be configured for a router interface are:
一些可配置的路由器接口参数(如IP接口地址和子网掩码)实际上意味着连接网络的属性,因此必须在连接到该网络的所有路由器上保持一致。必须为路由器接口配置的参数包括:
IP interface address The IP protocol address for this interface. This uniquely identifies the router over the entire internet. An IP address is not required on point-to-point networks. Such a point-to-point network is called "unnumbered".
IP接口地址此接口的IP协议地址。这将唯一地标识整个internet上的路由器。点到点网络上不需要IP地址。这种点到点网络称为“无编号”。
IP interface mask Also referred to as the subnet/network mask, this indicates the portion of the IP interface address that identifies the attached network. Masking the IP interface address with the IP interface mask yields the IP network number of the attached network. On point-to-point networks and virtual links, the IP interface mask is not defined. On these networks, the link itself is not assigned an IP network number, and so the addresses of each side of the link are assigned independently, if they are assigned at all.
IP接口掩码也称为子网/网络掩码,表示IP接口地址中标识连接网络的部分。使用IP接口掩码屏蔽IP接口地址会生成连接网络的IP网络号。在点到点网络和虚拟链路上,未定义IP接口掩码。在这些网络上,链路本身没有分配IP网络号,因此链路每一侧的地址都是独立分配的,如果它们被分配的话。
Area ID The OSPF area to which the attached network belongs.
Area ID连接网络所属的OSPF区域。
Interface output cost The cost of sending a packet on the interface, expressed in the link state metric. This is advertised as the link cost for this interface in the router's router-LSA. The interface output cost must always be greater than 0.
接口输出成本在接口上发送数据包的成本,以链路状态度量表示。这在路由器的路由器LSA中作为该接口的链路成本公布。接口输出成本必须始终大于0。
RxmtInterval The number of seconds between LSA retransmissions, for adjacencies belonging to this interface. Also used when retransmitting Database Description and Link State Request Packets. This should be well over the expected round-trip delay between any two routers on the attached network. The setting of this value should be conservative or needless retransmissions will result. Sample value for a local area network: 5 seconds.
RxMTINERVAL对于属于此接口的邻接,LSA重新传输之间的秒数。在重新传输数据库描述和链路状态请求数据包时也使用。这应该远远超过连接网络上任何两个路由器之间的预期往返延迟。此值的设置应保守,否则将导致不必要的重新传输。局域网的样本值:5秒。
InfTransDelay The estimated number of seconds it takes to transmit a Link State Update Packet over this interface. LSAs contained in the update packet must have their age incremented by this amount before transmission. This value should take into account the transmission and propagation delays of the
InfTransDelay通过此接口传输链路状态更新数据包所需的估计秒数。在传输之前,更新数据包中包含的LSA的年龄必须增加此数量。该值应考虑数据的传输和传播延迟
interface. It must be greater than 0. Sample value for a local area network: 1 second.
界面它必须大于0。局域网的样本值:1秒。
Router Priority An 8-bit unsigned integer. When two routers attached to a network both attempt to become Designated Router, the one with the highest Router Priority takes precedence. If there is still a tie, the router with the highest Router ID takes precedence. A router whose Router Priority is set to 0 is ineligible to become Designated Router on the attached network. Router Priority is only configured for interfaces to broadcast and NBMA networks.
路由器优先级为8位无符号整数。当两个连接到网络的路由器都试图成为指定路由器时,具有最高路由器优先级的路由器优先。如果仍然存在平局,则具有最高路由器ID的路由器优先。路由器优先级设置为0的路由器没有资格成为连接网络上的指定路由器。路由器优先级仅为广播和NBMA网络的接口配置。
HelloInterval The length of time, in seconds, between the Hello Packets that the router sends on the interface. This value is advertised in the router's Hello Packets. It must be the same for all routers attached to a common network. The smaller the HelloInterval, the faster topological changes will be detected; however, more OSPF routing protocol traffic will ensue. Sample value for a X.25 PDN network: 30 seconds. Sample value for a local area network: 10 seconds.
HelloInterval路由器在接口上发送的Hello数据包之间的时间长度,以秒为单位。此值在路由器的Hello数据包中公布。连接到公共网络的所有路由器必须相同。HelloInterval越小,检测到的拓扑变化越快;然而,更多的OSPF路由协议流量将随之增加。X.25 PDN网络的样本值:30秒。局域网的样本值:10秒。
RouterDeadInterval After ceasing to hear a router's Hello Packets, the number of seconds before its neighbors declare the router down. This is also advertised in the router's Hello Packets in their RouterDeadInterval field. This should be some multiple of the HelloInterval (say 4). This value again must be the same for all routers attached to a common network.
RouterReadInterval停止听到路由器的Hello数据包后,其邻居宣布路由器关闭前的秒数。这也会在路由器的Hello数据包的RouterReadInterval字段中公布。这应该是HelloInterval的倍数(比如4)。对于连接到公共网络的所有路由器,该值也必须相同。
AuType Identifies the authentication procedure to be used on the attached network. This value must be the same for all routers attached to the network. See Appendix D for a discussion of the defined authentication types.
AuType标识要在连接的网络上使用的身份验证过程。对于连接到网络的所有路由器,此值必须相同。有关定义的身份验证类型的讨论,请参见附录D。
Authentication key This configured data allows the authentication procedure to verify OSPF protocol packets received over the interface. For example, if the AuType indicates simple password, the
身份验证密钥此配置数据允许身份验证过程验证通过接口接收的OSPF协议数据包。例如,如果AuType指示简单密码,则
Authentication key would be a clear 64-bit password. Authentication keys associated with the other OSPF authentication types are discussed in Appendix D.
身份验证密钥将是一个清晰的64位密码。与其他OSPF认证类型相关的认证密钥在附录D中讨论。
C.4 Virtual link parameters
C.4虚拟链路参数
Virtual links are used to restore/increase connectivity of the backbone. Virtual links may be configured between any pair of area border routers having interfaces to a common (non-backbone) area. The virtual link appears as an unnumbered point-to-point link in the graph for the backbone. The virtual link must be configured in both of the area border routers.
虚拟链路用于恢复/增加主干网的连接性。虚拟链路可以配置在具有公共(非主干)区域接口的任何一对区域边界路由器之间。虚拟链路在主干的图形中显示为未编号的点到点链路。必须在两个区域边界路由器中配置虚拟链路。
A virtual link appears in router-LSAs (for the backbone) as if it were a separate router interface to the backbone. As such, it has all of the parameters associated with a router interface (see Section C.3). Although a virtual link acts like an unnumbered point-to-point link, it does have an associated IP interface address. This address is used as the IP source in OSPF protocol packets it sends along the virtual link, and is set dynamically during the routing table build process. Interface output cost is also set dynamically on virtual links to be the cost of the intra-area path between the two routers. The parameter RxmtInterval must be configured, and should be well over the expected round-trip delay between the two routers. This may be hard to estimate for a virtual link; it is better to err on the side of making it too large. Router Priority is not used on virtual links.
虚拟链路出现在路由器LSA(用于主干网)中,就好像它是到主干网的单独路由器接口一样。因此,它具有与路由器接口相关的所有参数(参见第C.3节)。尽管虚拟链路的行为类似于未编号的点到点链路,但它确实具有关联的IP接口地址。该地址用作它沿虚拟链路发送的OSPF协议包中的IP源,并在路由表构建过程中动态设置。接口输出成本也在虚拟链路上动态设置为两个路由器之间区域内路径的成本。必须配置参数RxmtInterval,并且参数RxmtInterval应远远超过两个路由器之间的预期往返延迟。对于虚拟链路,这可能很难估计;宁可把它弄得太大。虚拟链路上未使用路由器优先级。
A virtual link is defined by the following two configurable parameters: the Router ID of the virtual link's other endpoint, and the (non-backbone) area through which the virtual link runs (referred to as the virtual link's Transit area). Virtual links cannot be configured through stub areas.
虚拟链路由以下两个可配置参数定义:虚拟链路的另一个端点的路由器ID和虚拟链路运行所经过的(非主干)区域(称为虚拟链路的传输区域)。无法通过存根区域配置虚拟链接。
C.5 NBMA network parameters
C.5 NBMA网络参数
OSPF treats an NBMA network much like it treats a broadcast network. Since there may be many routers attached to the network, a Designated Router is selected for the network. This Designated Router then originates a network-LSA, which lists all routers attached to the NBMA network.
OSPF对待NBMA网络就像对待广播网络一样。由于可能有许多路由器连接到网络,因此为网络选择指定的路由器。然后,该指定路由器发起网络LSA,列出连接到NBMA网络的所有路由器。
However, due to the lack of broadcast capabilities, it may be necessary to use configuration parameters in the Designated Router selection. These parameters will only need to be configured in those routers that are themselves eligible to become Designated Router (i.e., those router's whose Router Priority for the network is non-zero), and then only if no automatic procedure for discovering neighbors exists:
但是,由于缺少广播功能,可能需要在指定的路由器选择中使用配置参数。这些参数只需要在那些自身有资格成为指定路由器的路由器中配置(即,网络路由器优先级为非零的路由器),并且只有在不存在自动发现邻居程序的情况下:
List of all other attached routers The list of all other routers attached to the NBMA network. Each router is listed by its IP interface address on the network. Also, for each router listed, that router's eligibility to become Designated Router must be defined. When an interface to a NBMA network comes up, the router sends Hello Packets only to those neighbors eligible to become Designated Router, until the identity of the Designated Router is discovered.
所有其他连接路由器的列表连接到NBMA网络的所有其他路由器的列表。每个路由器都按其在网络上的IP接口地址列出。此外,对于列出的每个路由器,必须定义该路由器成为指定路由器的资格。当NBMA网络的接口出现时,路由器只向有资格成为指定路由器的邻居发送Hello数据包,直到发现指定路由器的身份为止。
PollInterval If a neighboring router has become inactive (Hello Packets have not been seen for RouterDeadInterval seconds), it may still be necessary to send Hello Packets to the dead neighbor. These Hello Packets will be sent at the reduced rate PollInterval, which should be much larger than HelloInterval. Sample value for a PDN X.25 network: 2 minutes.
PollInterval如果相邻路由器已变为非活动状态(在RouterDeadInterval秒内未看到Hello数据包),则可能仍然需要向死亡的邻居发送Hello数据包。这些Hello数据包将以较低的PollInterval速率发送,这应该比HelloInterval大得多。PDN X.25网络的样本值:2分钟。
C.6 Point-to-MultiPoint network parameters
C.6点对多点网络参数
On Point-to-MultiPoint networks, it may be necessary to configure the set of neighbors that are directly reachable over the Point-to-MultiPoint network. Each neighbor is identified by its IP address on the Point-to-MultiPoint network. Designated Routers are not elected on Point-to-MultiPoint networks, so the Designated Router eligibility of configured neighbors is undefined.
在点对多点网络上,可能需要配置可通过点对多点网络直接访问的邻居集。在点对多点网络中,每个邻居通过其IP地址进行标识。在点对多点网络上未选择指定路由器,因此未定义已配置邻居的指定路由器资格。
Alternatively, neighbors on Point-to-MultiPoint networks may be dynamically discovered by lower-level protocols such as Inverse ARP ([Ref14]).
或者,点对多点网络上的邻居可以通过较低级别的协议(如反向ARP)动态发现([Ref14])。
C.7 Host route parameters
C.7主机路由参数
Host routes are advertised in router-LSAs as stub networks with mask 0xffffffff. They indicate either router interfaces to point-to-point networks, looped router interfaces, or IP hosts that are directly connected to the router (e.g., via a SLIP line). For each host directly connected to the router, the following items must be configured:
主机路由在路由器LSA中作为带有掩码0xffffffff的存根网络发布。它们表示指向点到点网络的路由器接口、环形路由器接口或直接连接到路由器(例如,通过滑线)的IP主机。对于每个直接连接到路由器的主机,必须配置以下项目:
Host IP address The IP address of the host.
主机IP地址主机的IP地址。
Cost of link to host The cost of sending a packet to the host, in terms of the link state metric. However, since the host probably has only a single connection to the internet, the actual configured cost in many cases is unimportant (i.e., will have no effect on routing).
链路到主机的成本根据链路状态度量向主机发送数据包的成本。但是,由于主机可能只有一个到internet的连接,因此在许多情况下,实际配置的成本并不重要(即,对路由没有影响)。
Area ID The OSPF area to which the host belongs.
区域ID主机所属的OSPF区域。
D. Authentication
D.认证
All OSPF protocol exchanges are authenticated. The OSPF packet header (see Section A.3.1) includes an authentication type field, and 64-bits of data for use by the appropriate authentication scheme (determined by the type field).
所有OSPF协议交换都经过身份验证。OSPF数据包头(见第A.3.1节)包括一个认证类型字段和64位数据,供适当的认证方案使用(由类型字段确定)。
The authentication type is configurable on a per-interface (or equivalently, on a per-network/subnet) basis. Additional authentication data is also configurable on a per-interface basis.
可在每个接口(或等效地,在每个网络/子网)的基础上配置身份验证类型。还可以根据每个接口配置其他身份验证数据。
Authentication types 0, 1 and 2 are defined by this specification. All other authentication types are reserved for definition by the IANA (iana@ISI.EDU). The current list of authentication types is described below in Table 20.
身份验证类型0、1和2由本规范定义。所有其他身份验证类型保留供IANA定义(iana@ISI.EDU). 表20中描述了认证类型的当前列表。
AuType Description ___________________________________________ 0 Null authentication 1 Simple password 2 Cryptographic authentication All others Reserved for assignment by the IANA (iana@ISI.EDU)
AuType Description ___________________________________________ 0 Null authentication 1 Simple password 2 Cryptographic authentication All others Reserved for assignment by the IANA (iana@ISI.EDU)
Table 20: OSPF authentication types.
表20:OSPF认证类型。
D.1 Null authentication
D.1空身份验证
Use of this authentication type means that routing exchanges over the network/subnet are not authenticated. The 64-bit authentication field in the OSPF header can contain anything; it is not examined on packet reception. When employing Null authentication, the entire contents of each OSPF packet (other than the 64-bit authentication field) are checksummed in order to detect data corruption.
使用此身份验证类型意味着网络/子网上的路由交换未经身份验证。OSPF头中的64位身份验证字段可以包含任何内容;在数据包接收时不检查它。当采用空身份验证时,每个OSPF数据包(64位身份验证字段除外)的全部内容将进行校验和,以检测数据损坏。
D.2 Simple password authentication
D.2简单密码验证
Using this authentication type, a 64-bit field is configured on a per-network basis. All packets sent on a particular network must have this configured value in their OSPF header 64-bit authentication field. This essentially serves as a "clear" 64- bit password. In addition, the entire contents of each OSPF packet (other than the 64-bit authentication field) are checksummed in order to detect data corruption.
使用此身份验证类型,将基于每个网络配置64位字段。在特定网络上发送的所有数据包必须在其OSPF头64位身份验证字段中具有此配置值。这实际上是一个“清晰”的64位密码。此外,每个OSPF数据包(64位身份验证字段除外)的全部内容进行校验和,以检测数据损坏。
Simple password authentication guards against routers inadvertently joining the routing domain; each router must first be configured with its attached networks' passwords before it can participate in routing. However, simple password authentication is vulnerable to passive attacks currently widespread in the Internet (see [Ref16]). Anyone with physical access to the network can learn the password and compromise the security of the OSPF routing domain.
简单的密码认证防止路由器无意中加入路由域;每个路由器必须首先配置其连接网络的密码,然后才能参与路由。然而,简单密码认证容易受到目前在互联网上广泛存在的被动攻击(参见[Ref16])。任何物理访问网络的人都可以学习密码并危害OSPF路由域的安全。
D.3 Cryptographic authentication
D.3加密认证
Using this authentication type, a shared secret key is configured in all routers attached to a common network/subnet. For each OSPF protocol packet, the key is used to generate/verify a "message digest" that is appended to the end of the OSPF packet. The message digest is a one-way function of the OSPF protocol packet and the secret key. Since the secret key is never sent over the network in the clear, protection is provided against passive attacks.
使用此身份验证类型,将在连接到公共网络/子网的所有路由器中配置共享密钥。对于每个OSPF协议包,密钥用于生成/验证附加到OSPF包末尾的“消息摘要”。消息摘要是OSPF协议包和密钥的单向函数。由于秘密密钥永远不会通过网络发送,因此提供了针对被动攻击的保护。
The algorithms used to generate and verify the message digest are specified implicitly by the secret key. This specification completely defines the use of OSPF Cryptographic authentication when the MD5 algorithm is used.
用于生成和验证消息摘要的算法由密钥隐式指定。本规范完全定义了在使用MD5算法时使用OSPF加密身份验证。
In addition, a non-decreasing sequence number is included in each OSPF protocol packet to protect against replay attacks. This provides long term protection; however, it is still possible to replay an OSPF packet until the sequence number changes. To implement this feature, each neighbor data structure contains a new field called the "cryptographic sequence number". This field is initialized to zero, and is also set to zero
此外,每个OSPF协议包中都包含一个非递减序列号,以防止重播攻击。这提供了长期的保护;然而,仍然可以重播OSPF数据包,直到序列号改变。为了实现此功能,每个邻居数据结构都包含一个称为“加密序列号”的新字段。此字段初始化为零,也设置为零
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 0 | Key ID | Auth Data Len | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Cryptographic sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 0 | Key ID | Auth Data Len | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Cryptographic sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 18: Usage of the Authentication field in the OSPF packet header when Cryptographic Authentication is employed
图18:使用加密身份验证时OSPF数据包头中身份验证字段的用法
whenever the neighbor's state transitions to "Down". Whenever an OSPF packet is accepted as authentic, the cryptographic sequence number is set to the received packet's sequence number.
每当邻居的状态转换为“关闭”时。每当OSPF数据包被接受为可信数据包时,加密序列号就被设置为所接收数据包的序列号。
This specification does not provide a rollover procedure for the cryptographic sequence number. When the cryptographic sequence number that the router is sending hits the maximum value, the router should reset the cryptographic sequence number that it is sending back to 0. After this is done, the router's neighbors will reject the router's OSPF packets for a period of RouterDeadInterval, and then the router will be forced to reestablish all adjacencies over the interface. However, it is expected that many implementations will use "seconds since reboot" (or "seconds since 1960", etc.) as the cryptographic sequence number. Such a choice will essentially prevent rollover, since the cryptographic sequence number field is 32 bits in length.
本规范不提供加密序列号的滚动过程。当路由器发送的加密序列号达到最大值时,路由器应将其发送的加密序列号重置为0。完成此操作后,路由器的邻居将在RouterDeadInterval期间拒绝路由器的OSPF数据包,然后路由器将被迫重新建立接口上的所有邻接。然而,预计许多实现将使用“重新启动后的秒数”(或“1960年后的秒数”等)作为加密序列号。由于加密序列号字段的长度为32位,因此这样的选择基本上可以防止翻滚。
The OSPF Cryptographic authentication option does not provide confidentiality.
OSPF加密身份验证选项不提供机密性。
When cryptographic authentication is used, the 64-bit Authentication field in the standard OSPF packet header is redefined as shown in Figure 18. The new field definitions are as follows:
当使用加密身份验证时,标准OSPF数据包头中的64位身份验证字段被重新定义,如图18所示。新字段定义如下所示:
Key ID This field identifies the algorithm and secret key used to create the message digest appended to the OSPF packet. Key Identifiers are unique per-interface (or equivalently, per-subnet).
密钥ID此字段标识用于创建附加到OSPF数据包的消息摘要的算法和密钥。每个接口(或等效地,每个子网)的密钥标识符是唯一的。
Auth Data Len The length in bytes of the message digest appended to the OSPF packet.
Auth Data Len附加到OSPF数据包的消息摘要的字节长度。
Cryptographic sequence number An unsigned 32-bit non-decreasing sequence number. Used to guard against replay attacks.
加密序列号无符号32位非递减序列号。用于防止重播攻击。
The message digest appended to the OSPF packet is not actually considered part of the OSPF protocol packet: the message digest is not included in the OSPF header's packet length, although it is included in the packet's IP header length field.
附加到OSPF数据包的消息摘要实际上不被视为OSPF协议数据包的一部分:消息摘要不包括在OSPF报头的数据包长度中,尽管它包括在数据包的IP报头长度字段中。
Each key is identified by the combination of interface and Key ID. An interface may have multiple keys active at any one time. This enables smooth transition from one key to another. Each key has four time constants associated with it. These time constants can be expressed in terms of a time-of-day clock, or in terms of a router's local clock (e.g., number of seconds since last reboot):
每个密钥由接口和密钥ID的组合标识。一个接口在任何时候都可能有多个密钥处于活动状态。这样可以实现从一个关键点到另一个关键点的平滑过渡。每个键都有四个与之关联的时间常数。这些时间常数可以表示为一天中的时间时钟,或者表示为路由器的本地时钟(例如,自上次重新启动后的秒数):
KeyStartAccept The time that the router will start accepting packets that have been created with the given key.
KeyStartAccept路由器开始接受使用给定密钥创建的数据包的时间。
KeyStartGenerate The time that the router will start using the key for packet generation.
Keystart生成路由器开始使用密钥生成数据包的时间。
KeyStopGenerate The time that the router will stop using the key for packet generation.
KeyStopGenerate路由器停止使用密钥生成数据包的时间。
KeyStopAccept The time that the router will stop accepting packets that have been created with the given key.
keystopacept路由器停止接受使用给定密钥创建的数据包的时间。
In order to achieve smooth key transition, KeyStartAccept should be less than KeyStartGenerate and KeyStopGenerate should be less than KeyStopAccept. If KeyStopGenerate and KeyStopAccept are left unspecified, the key's lifetime is infinite. When a new key replaces an old, the KeyStartGenerate time for the new key must be less than or equal to the KeyStopGenerate time of the old key.
为了实现平滑的密钥转换,KeyStartAccept应小于KeyStartGenerate,KeyspGenerate应小于Keyspaccept。如果KeyStopGenerate和keystopacept未指定,则密钥的生存期是无限的。当新密钥替换旧密钥时,新密钥的KeyStartGenerate时间必须小于或等于旧密钥的KeyspGenerate时间。
Key storage should persist across a system restart, warm or cold, to avoid operational issues. In the event that the last key associated with an interface expires, it is unacceptable to revert to an unauthenticated condition, and not advisable to disrupt routing. Therefore, the router should send a "last authentication key expiration" notification to the network manager and treat the key as having an infinite lifetime until the lifetime is extended, the key is deleted by network management, or a new key is configured.
密钥存储应在系统重新启动期间保持不变,无论是热重启还是冷重启,以避免操作问题。如果与接口关联的最后一个密钥过期,则无法恢复到未经验证的状态,并且不建议中断路由。因此,路由器应向网络管理器发送“上次验证密钥到期”通知,并将密钥视为具有无限生存期,直到延长生存期、通过网络管理删除密钥或配置新密钥为止。
D.4 Message generation
D.4信息生成
After building the contents of an OSPF packet, the authentication procedure indicated by the sending interface's Autype value is called before the packet is sent. The authentication procedure modifies the OSPF packet as follows.
在构建OSPF数据包的内容之后,在发送数据包之前,调用发送接口的Autype值指示的身份验证过程。身份验证过程修改OSPF数据包如下。
D.4.1 Generating Null authentication
D.4.1 生成空身份验证
When using Null authentication, the packet is modified as follows:
使用空身份验证时,数据包修改如下:
(1) The Autype field in the standard OSPF header is set to 0.
(1) 标准OSPF标头中的Autype字段设置为0。
(2) The checksum field in the standard OSPF header is set to the standard IP checksum of the entire contents of the packet, starting with the OSPF packet header but excluding the 64-bit authentication field. This checksum is calculated as the 16-bit one's complement of the one's complement sum of all the 16-bit words in the packet, excepting the authentication field. If the
(2) 标准OSPF报头中的校验和字段设置为数据包全部内容的标准IP校验和,从OSPF数据包报头开始,但不包括64位身份验证字段。此校验和计算为数据包中所有16位字的16位1的补码和的16位1的补码,验证字段除外。如果
packet's length is not an integral number of 16-bit words, the packet is padded with a byte of zero before checksumming.
数据包的长度不是16位字的整数,在校验和之前,数据包用零字节填充。
D.4.2 Generating Simple password authentication
D.4.2 生成简单密码身份验证
When using Simple password authentication, the packet is modified as follows:
使用简单密码身份验证时,数据包修改如下:
(1) The Autype field in the standard OSPF header is set to 1.
(1) 标准OSPF标头中的Autype字段设置为1。
(2) The checksum field in the standard OSPF header is set to the standard IP checksum of the entire contents of the packet, starting with the OSPF packet header but excluding the 64-bit authentication field. This checksum is calculated as the 16-bit one's complement of the one's complement sum of all the 16-bit words in the packet, excepting the authentication field. If the packet's length is not an integral number of 16-bit words, the packet is padded with a byte of zero before checksumming.
(2) 标准OSPF报头中的校验和字段设置为数据包全部内容的标准IP校验和,从OSPF数据包报头开始,但不包括64位身份验证字段。此校验和计算为数据包中所有16位字的16位1的补码和的16位1的补码,验证字段除外。如果数据包的长度不是16位字的整数,则在校验和之前用零字节填充数据包。
(3) The 64-bit authentication field in the OSPF packet header is set to the 64-bit password (i.e., authentication key) that has been configured for the interface.
(3) OSPF数据包头中的64位身份验证字段设置为已为接口配置的64位密码(即身份验证密钥)。
D.4.3 Generating Cryptographic authentication
D.4.3 生成加密身份验证
When using Cryptographic authentication, there may be multiple keys configured for the interface. In this case, among the keys that are valid for message generation (i.e, that have KeyStartGenerate <= current time < KeyStopGenerate) choose the one with the most recent KeyStartGenerate time. Using this key, modify the packet as follows:
使用加密身份验证时,可能会为接口配置多个密钥。在这种情况下,在对消息生成有效的密钥(即,具有KeyStartGenerate<=当前时间<KeyspGenerate)中,选择具有最新KeyStartGenerate时间的密钥。使用此键,按如下方式修改数据包:
(1) The Autype field in the standard OSPF header is set to 2.
(1) 标准OSPF标头中的Autype字段设置为2。
(2) The checksum field in the standard OSPF header is not calculated, but is instead set to 0.
(2) 标准OSPF标头中的校验和字段未计算,而是设置为0。
(3) The Key ID (see Figure 18) is set to the chosen key's Key ID.
(3) 密钥ID(见图18)设置为所选密钥的密钥ID。
(4) The Auth Data Len field is set to the length in bytes of the message digest that will be appended to the OSPF packet. When using MD5 as the authentication algorithm, Auth Data Len will be 16.
(4) Auth Data Len字段设置为将附加到OSPF数据包的消息摘要的字节长度。当使用MD5作为身份验证算法时,Auth Data Len将为16。
(5) The 32-bit Cryptographic sequence number (see Figure 18) is set to a non-decreasing value (i.e., a value at least as large as the last value sent out the interface). The precise values to use in the cryptographic sequence number field are implementation-specific. For example, it may be based on a simple counter, or be based on the system's clock.
(5) 32位加密序列号(见图18)设置为非递减值(即,至少与发送到接口的最后一个值一样大的值)。要在加密序列号字段中使用的精确值是特定于实现的。例如,它可以基于一个简单的计数器,或者基于系统的时钟。
(6) The message digest is then calculated and appended to the OSPF packet. The authentication algorithm to be used in calculating the digest is indicated by the key itself. Input to the authentication algorithm consists of the OSPF packet and the secret key. When using MD5 as the authentication algorithm, the message digest calculation proceeds as follows:
(6) 然后计算消息摘要并将其附加到OSPF数据包中。用于计算摘要的身份验证算法由密钥本身指示。认证算法的输入由OSPF数据包和密钥组成。当使用MD5作为身份验证算法时,消息摘要计算如下:
(a) The 16 byte MD5 key is appended to the OSPF packet.
(a) 16字节MD5密钥附加到OSPF数据包中。
(b) Trailing pad and length fields are added, as specified in [Ref17].
(b) 按照[Ref17]中的规定,添加了尾随垫和长度字段。
(c) The MD5 authentication algorithm is run over the concatenation of the OSPF packet, secret key, pad and length fields, producing a 16 byte message digest (see [Ref17]).
(c) MD5认证算法在OSPF数据包、密钥、pad和长度字段的串联上运行,生成16字节的消息摘要(参见[Ref17])。
(d) The MD5 digest is written over the OSPF key (i.e., appended to the original OSPF packet). The digest is not counted in the OSPF packet's length field, but
(d) MD5摘要写在OSPF密钥上(即附加到原始OSPF数据包中)。摘要不计入OSPF数据包的长度字段,但
is included in the packet's IP length field. Any trailing pad or length fields beyond the digest are not counted or transmitted.
包含在数据包的IP长度字段中。摘要之外的任何尾随焊盘或长度字段都不会被计数或传输。
D.5 Message verification
D.5信息验证
When an OSPF packet has been received on an interface, it must be authenticated. The authentication procedure is indicated by the setting of Autype in the standard OSPF packet header, which matches the setting of Autype for the receiving OSPF interface.
当接口上接收到OSPF数据包时,必须对其进行身份验证。认证过程由标准OSPF数据包头中的Autype设置指示,该设置与接收OSPF接口的Autype设置相匹配。
If an OSPF protocol packet is accepted as authentic, processing of the packet continues as specified in Section 8.2. Packets which fail authentication are discarded.
如果OSPF协议数据包被认为是可信的,则按照第8.2节的规定继续处理该数据包。未通过身份验证的数据包将被丢弃。
D.5.1 Verifying Null authentication
D.5.1 验证空身份验证
When using Null authentication, the checksum field in the OSPF header must be verified. It must be set to the 16-bit one's complement of the one's complement sum of all the 16- bit words in the packet, excepting the authentication field. (If the packet's length is not an integral number of 16-bit words, the packet is padded with a byte of zero before checksumming.)
使用空身份验证时,必须验证OSPF标头中的校验和字段。它必须设置为数据包中所有16位字的补码和的16位1的补码,认证字段除外。(如果数据包的长度不是16位字的整数,则在校验和之前用零字节填充数据包。)
D.5.2 Verifying Simple password authentication
D.5.2 验证简单密码身份验证
When using Simple password authentication, the received OSPF packet is authenticated as follows:
使用简单密码身份验证时,接收到的OSPF数据包进行身份验证,如下所示:
(1) The checksum field in the OSPF header must be verified. It must be set to the 16-bit one's complement of the one's complement sum of all the 16-bit words in the packet, excepting the authentication field. (If the packet's length is not an integral number of 16-bit words, the packet is padded with a byte of zero before checksumming.)
(1) 必须验证OSPF标头中的校验和字段。它必须设置为数据包中所有16位字的补码和中的16位1的补码,验证字段除外。(如果数据包的长度不是16位字的整数,则在校验和之前用零字节填充数据包。)
(2) The 64-bit authentication field in the OSPF packet header must be equal to the 64-bit password (i.e., authentication key) that has been configured for the interface.
(2) OSPF数据包头中的64位身份验证字段必须等于为接口配置的64位密码(即身份验证密钥)。
D.5.3 Verifying Cryptographic authentication
D.5.3 验证加密身份验证
When using Cryptographic authentication, the received OSPF packet is authenticated as follows:
当使用加密身份验证时,接收到的OSPF数据包按如下方式进行身份验证:
(1) Locate the receiving interface's configured key having Key ID equal to that specified in the received OSPF packet (see Figure 18). If the key is not found, or if the key is not valid for reception (i.e., current time < KeyStartAccept or current time >= KeyStopAccept), the OSPF packet is discarded.
(1) 找到接收接口的配置密钥,该密钥ID等于接收到的OSPF数据包中指定的密钥ID(见图18)。如果找不到密钥,或者密钥接收无效(即当前时间<KeyStartAccept或当前时间>=Keyspaccept),则丢弃OSPF数据包。
(2) If the cryptographic sequence number found in the OSPF header (see Figure 18) is less than the cryptographic sequence number recorded in the sending neighbor's data structure, the OSPF packet is discarded.
(2) 如果在OSPF报头中找到的加密序列号(见图18)小于发送邻居的数据结构中记录的加密序列号,则丢弃OSPF数据包。
(3) Verify the appended message digest in the following steps:
(3) 在以下步骤中验证附加的消息摘要:
(a) The received digest is set aside.
(a) 收到的摘要放在一边。
(b) A new digest is calculated, as specified in Step 6 of Section D.4.3.
(b) 按照第D.4.3节第6步的规定,计算新的摘要。
(c) The calculated and received digests are compared. If they do not match, the OSPF packet is discarded. If they do match, the OSPF protocol packet is accepted as authentic, and the "cryptographic sequence number" in the neighbor's data structure is set to the sequence number found in the packet's OSPF header.
(c) 将计算的摘要与收到的摘要进行比较。如果它们不匹配,则丢弃OSPF数据包。如果它们确实匹配,则OSPF协议数据包被认为是可信的,并且邻居的数据结构中的“加密序列号”被设置为在数据包的OSPF报头中找到的序列号。
E. An algorithm for assigning Link State IDs
E.分配链路状态ID的算法
The Link State ID in AS-external-LSAs and summary-LSAs is usually set to the described network's IP address. However, if necessary one or more of the network's host bits may be set in the Link State ID. This allows the router to originate separate LSAs for networks having the same address, yet different masks. Such networks can occur in the presence of supernetting and subnet 0s (see [Ref10]).
AS外部LSA和摘要LSA中的链路状态ID通常设置为所述网络的IP地址。然而,如有必要,可在链路状态ID中设置一个或多个网络主机位。这允许路由器为具有相同地址但不同掩码的网络发起单独的LSA。这种网络可以在存在超网和子网0的情况下出现(参见[Ref10])。
This appendix gives one possible algorithm for setting the host bits in Link State IDs. The choice of such an algorithm is a local decision. Separate routers are free to use different algorithms, since the only LSAs affected are the ones that the router itself originates. The only requirement on the algorithms used is that the network's IP address should be used as the Link State ID whenever possible; this maximizes interoperability with OSPF implementations predating RFC 1583.
本附录给出了在链路状态ID中设置主机位的一种可能算法。这种算法的选择是一个局部决策。单独的路由器可以自由使用不同的算法,因为唯一受影响的LSA是路由器本身发起的LSA。对所用算法的唯一要求是尽可能使用网络的IP地址作为链路状态ID;这最大限度地提高了与RFC1583之前的OSPF实现的互操作性。
The algorithm below is stated for AS-external-LSAs. This is only for clarity; the exact same algorithm can be used for summary-LSAs. Suppose that the router wishes to originate an AS-external-LSA for a network having address NA and mask NM1. The following steps are then used to determine the LSA's Link State ID:
以下是AS外部LSA的算法。这只是为了澄清;同样的算法也可用于汇总LSA。假设路由器希望为具有地址NA和掩码NM1的网络发起AS外部LSA。然后使用以下步骤确定LSA的链路状态ID:
(1) Determine whether the router is already originating an AS-external-LSA with Link State ID equal to NA (in such an LSA the router itself will be listed as the LSA's Advertising Router). If not, the Link State ID is set equal to NA and the algorithm terminates. Otherwise,
(1) 确定路由器是否已经发起链路状态ID等于NA的AS外部LSA(在这种LSA中,路由器本身将被列为LSA的广告路由器)。否则,链路状态ID设置为NA,算法终止。否则
(2) Obtain the network mask from the body of the already existing AS-external-LSA. Call this mask NM2. There are then two cases:
(2) 从已存在的外部LSA主体中获取网络掩码。把这个面具叫做NM2。然后有两种情况:
o NM1 is longer (i.e., more specific) than NM2. In this case, set the Link State ID in the new LSA to be the network [NA,NM1] with all the host bits set (i.e., equal to NA or'ed together with all the bits that are not set in NM1, which is network [NA,NM1]'s broadcast address).
o NM1比NM2长(即更具体)。在这种情况下,将新LSA中的链路状态ID设置为设置了所有主机位的网络[NA,NM1](即,等于NA或'ed加上NM1中未设置的所有位,即网络[NA,NM1]的广播地址)。
o NM2 is longer than NM1. In this case, change the existing LSA (having Link State ID of NA) to reference the new network [NA,NM1] by incrementing the sequence number,
o NM2比NM1长。在这种情况下,通过增加序列号,将现有LSA(链路状态ID为NA)更改为引用新网络[NA,NM1],
changing the mask in the body to NM1 and inserting the cost of the new network. Then originate a new LSA for the old network [NA,NM2], with Link State ID equal to NA or'ed together with the bits that are not set in NM2 (i.e., network [NA,NM2]'s broadcast address).
将主体中的掩码更改为NM1,并插入新网络的成本。然后,为旧网络[NA,NM2]发起一个新的LSA,链路状态ID等于NA或'ed以及未在NM2中设置的位(即网络[NA,NM2]的广播地址)。
The above algorithm assumes that all masks are contiguous; this ensures that when two networks have the same address, one mask is more specific than the other. The algorithm also assumes that no network exists having an address equal to another network's broadcast address. Given these two assumptions, the above algorithm always produces unique Link State IDs. The above algorithm can also be reworded as follows: When originating an AS-external-LSA, try to use the network number as the Link State ID. If that produces a conflict, examine the two networks in conflict. One will be a subset of the other. For the less specific network, use the network number as the Link State ID and for the more specific use the network's broadcast address instead (i.e., flip all the "host" bits to 1). If the most specific network was originated first, this will cause you to originate two LSAs at once.
上述算法假设所有掩码都是连续的;这确保了当两个网络具有相同地址时,一个掩码比另一个掩码更具体。该算法还假设不存在地址等于另一个网络广播地址的网络。鉴于这两个假设,上述算法总是生成唯一的链路状态ID。上述算法也可以改写如下:当发起as外部LSA时,尝试使用网络号作为链路状态ID。如果这会产生冲突,请检查冲突中的两个网络。一个将是另一个的子集。对于不太具体的网络,使用网络号作为链路状态ID,对于更具体的网络,使用网络的广播地址(即,将所有“主机”位翻转为1)。如果首先发起最特定的网络,这将导致您同时发起两个LSA。
As an example of the algorithm, consider its operation when the following sequence of events occurs in a single router (Router A).
作为算法的一个例子,考虑在单个路由器(路由器A)中发生以下事件序列时的操作。
(1) Router A wants to originate an AS-external-LSA for [10.0.0.0,255.255.255.0]:
(1) 路由器A希望为[10.0.0.0255.255.255.0]发起AS外部LSA:
(a) A Link State ID of 10.0.0.0 is used.
(a) 使用的链接状态ID为10.0.0.0。
(2) Router A then wants to originate an AS-external-LSA for [10.0.0.0,255.255.0.0]:
(2) 然后,路由器A想要为[10.0.0.0255.255.0.0]发起AS外部LSA:
(a) The LSA for [10.0.0,0,255.255.255.0] is reoriginated using a new Link State ID of 10.0.0.255.
(a) [10.0.0,0255.255.255.0]的LSA使用10.0.0.255的新链接状态ID进行重新排序。
(b) A Link State ID of 10.0.0.0 is used for [10.0.0.0,255.255.0.0].
(b) [10.0.0.0255.255.0.0]使用链接状态ID 10.0.0.0。
(3) Router A then wants to originate an AS-external-LSA for [10.0.0.0,255.0.0.0]:
(3) 然后,路由器A想要为[10.0.0.0255.0.0.0]发起AS外部LSA:
(a) The LSA for [10.0.0.0,255.255.0.0] is reoriginated using a new Link State ID of 10.0.255.255.
(a) [10.0.0.0255.255.0.0]的LSA使用10.0.255.255的新链接状态ID进行重新排序。
(b) A Link State ID of 10.0.0.0 is used for [10.0.0.0,255.0.0.0].
(b) [10.0.0.0255.0.0.0]使用链路状态ID 10.0.0.0。
(c) The network [10.0.0.0,255.255.255.0] keeps its Link State ID of 10.0.0.255.
(c) 网络[10.0.0.0255.255.255.0]保持其链接状态ID为10.0.0.255。
F. Multiple interfaces to the same network/subnet
F.同一网络/子网的多个接口
There are at least two ways to support multiple physical interfaces to the same IP subnet. Both methods will interoperate with implementations of RFC 1583 (and of course this memo). The two methods are sketched briefly below. An assumption has been made that each interface has been assigned a separate IP address (otherwise, support for multiple interfaces is more of a link-level or ARP issue than an OSPF issue).
至少有两种方法支持同一IP子网的多个物理接口。这两种方法都将与RFC1583(当然还有本备忘录)的实现进行互操作。下面简要介绍这两种方法。假设每个接口都分配了一个单独的IP地址(否则,支持多个接口更多的是链路级别或ARP问题,而不是OSPF问题)。
Method 1: Run the entire OSPF functionality over both interfaces, sending and receiving hellos, flooding, supporting separate interface and neighbor FSMs for each interface, etc. When doing this all other routers on the subnet will treat the two interfaces as separate neighbors, since neighbors are identified (on broadcast and NBMA networks) by their IP address.
方法1:在两个接口上运行整个OSPF功能,发送和接收hellos、洪泛、为每个接口支持单独的接口和邻居FSM等。执行此操作时,子网上的所有其他路由器将把这两个接口视为单独的邻居,因为邻居被识别(在广播和NBMA网络上)通过他们的IP地址。
Method 1 has the following disadvantages:
方法1有以下缺点:
(1) You increase the total number of neighbors and adjacencies.
(1) 增加邻居和邻接的总数。
(2) You lose the bidirectionality test on both interfaces, since bidirectionality is based on Router ID.
(2) 由于双向性是基于路由器ID的,因此两个接口上的双向性测试都会丢失。
(3) You have to consider both interfaces together during the Designated Router election, since if you declare both to be DR simultaneously you can confuse the tie-breaker (which is Router ID).
(3) 在指定的路由器选择过程中,你必须同时考虑这两个接口,因为如果你同时声明为DR,则可以混淆TIE断路器(即路由器ID)。
Method 2: Run OSPF over only one interface (call it the primary interface), but include both the primary and secondary interfaces in your Router-LSA.
方法2:只在一个接口上运行OSPF(称之为主接口),但在路由器LSA中包括主接口和辅助接口。
Method 2 has the following disadvantages:
方法2有以下缺点:
(1) You lose the bidirectionality test on the secondary interface.
(1) 您将丢失辅助接口上的双向性测试。
(2) When the primary interface fails, you need to promote the secondary interface to primary status.
(2) 当主接口出现故障时,您需要将辅助接口升级到主状态。
G. Differences from RFC 2178
G.与RFC 2178的差异
This section documents the differences between this memo and RFC 2178. All differences are backward-compatible. Implementations of this memo and of RFCs 2178, 1583, and 1247 will interoperate.
本节记录了本备忘录与RFC 2178之间的差异。所有差异都是向后兼容的。本备忘录和RFC 2178、1583和1247的实施将互操作。
G.1 Flooding modifications
G.1泛洪改造
Three changes have been made to the flooding procedure in Section 13.
对第13节中的注水程序进行了三处修改。
The first change is to step 4 in Section 13. Now MaxAge LSAs are acknowledged and then discarded only when both a) there is no database copy of the LSA and b) none of router's neighbors are in states Exchange or Loading. In all other cases, the MaxAge LSA is processed like any other LSA, installing the LSA in the database and flooding it out the appropriate interfaces when the LSA is more recent than the database copy (Step 5 of Section 13). This change also affects the contents of Table 19.
第一个更改是第13节中的步骤4。现在,只有当a)没有LSA的数据库副本,b)路由器的邻居都没有处于交换或加载状态时,MaxAge LSA才会被确认,然后被丢弃。在所有其他情况下,处理MaxAge LSA与处理任何其他LSA一样,在数据库中安装LSA,并在LSA比数据库副本更新时将其溢出到适当的接口(第13节第5步)。这一变化也影响到表19的内容。
The second change is to step 5a in Section 13. The MinLSArrival check is meant only for LSAs received during flooding, and should not be performed on those LSAs that the router itself originates.
第二个变化是第13节中的步骤5a。MinLSArrival检查仅用于泛洪期间接收的LSA,不应在路由器本身发起的LSA上执行。
The third change is to step 8 in Section 13. Confusion between routers as to which LSA instance is more recent can cause a disastrous amount of flooding in a link-state protocol (see [Ref26]). OSPF guards against this problem in two ways: a) the LS age field is used like a TTL field in flooding, to eventually remove looping LSAs from the network (see Section 13.3), and b) routers refuse to accept LSA updates more frequently than once every MinLSArrival seconds (see Section 13). However, there is still one case in RFC 2178 where disagreements regarding which LSA is more recent can cause a lot of flooding traffic: responding to old LSAs by reflooding the database copy. For this reason, Step 8 of Section 13 has been amended to only respond with the database copy when that copy has not been sent in any Link State Update within the last MinLSArrival seconds.
第三个变化是第13节中的步骤8。路由器之间关于哪个LSA实例最近的混淆可能会导致链路状态协议中灾难性的泛洪(参见[Ref26])。OSPF通过两种方式防止这个问题:a)LS age字段被用作泛洪中的TTL字段,以最终从网络中删除循环LSA(参见第13.3节);b)路由器拒绝接受LSA更新的频率超过每分钟LSA到达秒一次(参见第13节)。然而,在RFC 2178中仍然存在一种情况,即关于哪个LSA是最近的不一致会导致大量的泛洪通信:通过刷新数据库副本来响应旧LSA。因此,对第13节的步骤8进行了修改,使其仅在数据库副本在最后几秒钟内未在任何链路状态更新中发送时,才响应数据库副本。
G.2 Changes to external path preferences
G.2对外部路径首选项的更改
There is still the possibility of a routing loop in RFC 2178 when both a) virtual links are in use and b) the same external route is being imported by multiple ASBRs, each of which is in a separate area. To fix this problem, Section 16.4.1 has been revised. To choose the correct ASBR/forwarding address, intra-area paths through non-backbone areas are always preferred. However, intra-area paths through the backbone area (Area 0) and inter-area paths are now of equal preference, and must be compared solely based on cost.
当a)虚拟链路正在使用,b)多个ASBR正在导入相同的外部路由时,RFC 2178中仍然存在路由循环的可能性,每个ASBR位于单独的区域中。为解决此问题,对第16.4.1节进行了修订。要选择正确的ASBR/转发地址,始终首选通过非主干区域的区域内路径。然而,通过主干区域(区域0)的区域内路径和区域间路径现在具有相同的优先权,并且必须仅基于成本进行比较。
The reasoning behind this change is as follows. When virtual links are in use, an intra-area backbone path for one router can turn into an inter-area path in a router several hops closer to the destination. Hence, intra-area backbone paths and inter-area paths must be of equal preference. We can safely compare their costs, preferring the path with the smallest cost, due to the calculations in Section 16.3.
这一变化背后的原因如下。当使用虚拟链路时,一个路由器的区域内主干路径可以在距离目的地近几跳的路由器中转变为区域间路径。因此,区域内主干路径和区域间路径必须具有相同的优先权。根据第16.3节中的计算,我们可以安全地比较它们的成本,选择成本最小的路径。
Thanks to Michael Briggs and Jeremy McCooey of the UNH InterOperability Lab for pointing out this problem.
感谢UNH互操作性实验室的Michael Briggs和Jeremy McCooey指出了这个问题。
G.3 Incomplete resolution of virtual next hops
G.3虚拟下一跳的不完全解析
One of the functions of the calculation in Section 16.3 is to determine the actual next hop(s) for those destinations whose next hop was calculated as a virtual link in Sections 16.1 and 16.2. After completion of the calculation in Section 16.3, any paths calculated in Sections 16.1 and 16.2 that still have unresolved virtual next hops should be discarded.
第16.3节中的计算功能之一是确定其下一跳在第16.1节和第16.2节中计算为虚拟链路的目的地的实际下一跳。完成第16.3节中的计算后,应丢弃第16.1节和第16.2节中计算的仍有未解析虚拟下一跳的任何路径。
G.4 Routing table lookup
G.4路由表查找
The routing table lookup algorithm in Section 11.1 has been modified to reflect current practice. The "best match" routing table entry is now always selected to be the one providing the most specific (longest) match. Suppose for example a router is forwarding packets to the destination 192.9.1.1. A routing table entry for 192.9.1/24 will always be a better match than the routing table entry for 192.9/16, regardless of the routing table entries' path-types. Note however that when multiple paths
第11.1节中的路由表查找算法已经修改,以反映当前的实践。“最佳匹配”路由表条目现在总是被选择为提供最具体(最长)匹配的条目。例如,假设路由器正在将数据包转发到目的地192.9.1.1。无论路由表条目的路径类型如何,192.9.1/24的路由表条目始终比192.9/16的路由表条目更匹配。但是请注意,当多个路径
are available for a given routing table entry, the calculations in Sections 16.1, 16.2, and 16.4 always yield the paths having the most preferential path-type. (Intra-area paths are the most preferred, followed in order by inter-area, type 1 external and type 2 external paths; see Section 11).
对于给定的路由表条目,第16.1节、第16.2节和第16.4节中的计算始终会产生具有最优先路径类型的路径。(最优选的是区域内路径,其次是区域间路径、1类外部路径和2类外部路径;参见第11节)。
Security Considerations
安全考虑
All OSPF protocol exchanges are authenticated. OSPF supports multiple types of authentication; the type of authentication in use can be configured on a per network segment basis. One of OSPF's authentication types, namely the Cryptographic authentication option, is believed to be secure against passive attacks and provide significant protection against active attacks. When using the Cryptographic authentication option, each router appends a "message digest" to its transmitted OSPF packets. Receivers then use the shared secret key and received digest to verify that each received OSPF packet is authentic.
所有OSPF协议交换都经过身份验证。OSPF支持多种类型的认证;可以基于每个网段配置使用中的身份验证类型。OSPF的一种身份验证类型,即加密身份验证选项,被认为对被动攻击是安全的,并对主动攻击提供重要保护。当使用加密身份验证选项时,每个路由器在其传输的OSPF数据包中附加一个“消息摘要”。然后,接收器使用共享密钥和接收摘要来验证每个接收到的OSPF数据包是真实的。
The quality of the security provided by the Cryptographic authentication option depends completely on the strength of the message digest algorithm (MD5 is currently the only message digest algorithm specified), the strength of the key being used, and the correct implementation of the security mechanism in all communicating OSPF implementations. It also requires that all parties maintain the secrecy of the shared secret key.
加密身份验证选项提供的安全性质量完全取决于消息摘要算法的强度(MD5目前是唯一指定的消息摘要算法)、所用密钥的强度以及所有通信OSPF实现中安全机制的正确实现。它还要求各方维护共享密钥的保密性。
None of the OSPF authentication types provide confidentiality. Nor do they protect against traffic analysis. Key management is also not addressed by this memo.
OSPF身份验证类型都不提供机密性。它们也不能防止流量分析。本备忘录也未涉及密钥管理。
For more information, see Sections 8.1, 8.2, and Appendix D.
有关更多信息,请参见第8.1节、第8.2节和附录D。
Author's Address
作者地址
John Moy Ascend Communications, Inc. 1 Robbins Road Westford, MA 01886
马萨诸塞州韦斯特福德罗宾斯路1号John Moy Ascend Communications,Inc.01886
Phone: 978-952-1367 Fax: 978-392-2075 EMail: jmoy@casc.com
电话:978-952-1367传真:978-392-2075电子邮件:jmoy@casc.com
Full Copyright Statement
完整版权声明
Copyright (C) The Internet Society (1998). All Rights Reserved.
版权所有(C)互联网协会(1998年)。版权所有。
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
本文件及其译本可复制并提供给他人,对其进行评论或解释或协助其实施的衍生作品可全部或部分编制、复制、出版和分发,不受任何限制,前提是上述版权声明和本段包含在所有此类副本和衍生作品中。但是,不得以任何方式修改本文件本身,例如删除版权通知或对互联网协会或其他互联网组织的引用,除非出于制定互联网标准的需要,在这种情况下,必须遵循互联网标准过程中定义的版权程序,或根据需要将其翻译成英语以外的其他语言。
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.
上述授予的有限许可是永久性的,互联网协会或其继承人或受让人不会撤销。
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
本文件和其中包含的信息是按“原样”提供的,互联网协会和互联网工程任务组否认所有明示或暗示的保证,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。