21 · Introducing OSPFOSPF 簡介

Introducing OSPFOSPF 簡介

OSPF is a link-state routing protocol. You can think of a link as an interface on a router. The state of the link is a description of that interface and of its relationship to its neighboring routers. A description of the interface would include, for example, the IP address of the interface, the subnet mask, the type of network to which it is connected, the routers that are connected to that network, and so on. The collection of all these link states forms an LSDB. All routers in the same area share the same LSDB. Routers in other OSPF areas will have different LSDBs.

OSPF 是一種鏈路狀態路由協定。你可以把鏈路想成路由器上的一個介面。鏈路的狀態則是對該介面及其與相鄰路由器關係的描述。介面的描述可能包括介面的 IP 位址、子網路遮罩、所連接的網路類型、連接到該網路的路由器等等。所有這些鏈路狀態的集合構成了 LSDB。同一區域內的所有路由器共用相同的 LSDB,其他 OSPF 區域中的路由器則會有不同的 LSDB。

OSPF was developed based on an open standard and is supported by several router manufacturers. OSPF is widely used as an IGP, especially in large network environments. OSPF was developed as a replacement for the distance vector routing protocol RIP. The major advantages of OSPF over RIP are its fast convergence and its ability to scale to much larger networks. The OSPF for IPv4 networks is OSPF version 2 (OSPFv2).

OSPF 是根據一項開放標準所開發,並獲得多家路由器製造商的支援。OSPF 被廣泛用作 IGP,尤其是在大型網路環境中。OSPF 的開發目的是取代距離向量路由協定 RIP。OSPF 相較於 RIP 的主要優勢在於其收斂速度快,以及能夠擴充至規模更大的網路。適用於 IPv4 網路的 OSPF 是 OSPF 第 2 版(OSPFv2)。

With OSPF, an autonomous system can be logically subdivided into multiple areas.

透過 OSPF,可以將一個自治系統邏輯地細分為多個區域。

OSPF uses a two-layer network hierarchy that has two primary elements:

OSPF 採用具有兩個主要元素的雙層網路階層架構:

  • Autonomous system:An autonomous system consists of a collection of networks under a common administration that share a common routing strategy. An autonomous system, which is sometimes called adomain, can be logically subdivided into multiple areas.自治系統:自治系統是由在共同管理下、共用相同路由策略的一組網路所構成。自治系統有時也稱為網域,可以邏輯地細分為多個區域。
  • Area:An area is a grouping of contiguous networks. Areas are logical subdivisions of the autonomous system.區域:區域是相鄰網路的分組,是自治系統的邏輯細分。

Within each autonomous system, a contiguous area 0 (backbone area) must be defined. In the multiarea design, all other nonbackbone areas are connected to the backbone area.

在每個自治系統中,必須定義一個相鄰的區域 0(骨幹區域)。在多區域設計中,所有其他非骨幹區域都會連接到骨幹區域。

A multiarea design is more effective because the network is segmented to limit the propagation of LSAs inside an area. It is especially useful for large networks.

多區域設計較為有效,因為網路會被分段,以限制 LSA 在區域內的傳播範圍。這對大型網路特別有用。

In a multiarea topology, there are some special commonly used OSPF terms, based on the OSPF router roles. Routers that are only in Area 0 are known as backbone routers. Routers that are only in nonbackbone (normal) areas are known as internal routers; they have all interfaces in one area only. An area border router (ABR) connects Area 0 to the nonbackbone areas. ABRs contain LSDB information for each area, make route calculations for each area, and advertise routing information between areas. An autonomous system boundary router (ASBR) is a router that has at least one of its interfaces connected to an OSPF area and at least one of its interfaces connected to an external non-OSPF domain, such as EIGRP routing domain.

在多區域拓樸中,根據 OSPF 路由器的角色,有一些特殊且常用的 OSPF 術語。只存在於區域 0 的路由器稱為骨幹路由器。只存在於非骨幹(一般)區域的路由器稱為內部路由器,它們所有的介面都只屬於一個區域。區域邊界路由器(ABR)負責連接區域 0 與非骨幹區域。ABR 包含每個區域的 LSDB 資訊,會為每個區域進行路由計算,並在區域之間通告路由資訊。自治系統邊界路由器(ASBR)是指至少有一個介面連接到 OSPF 區域,且至少有一個介面連接到外部非 OSPF 網域(例如 EIGRP 路由網域)的路由器。

In a single area OSPF, whenever there is a change in a topology, new LSAs are created and sent throughout the area. All routers change their LSDB when they receive the new LSA, and the SPF algorithm is run again on the updated LSDB to verify new paths to destinations within the area.

在單區域 OSPF 中,每當拓樸發生變化,就會產生新的 LSA 並在整個區域內傳送。所有路由器收到新的 LSA 後都會更新自己的 LSDB,並再次對更新後的 LSDB 執行 SPF 演算法,以確認區域內通往目的地的新路徑。

The OSPF dynamic routing protocol does the following:

OSPF 動態路由協定會執行以下工作:

  • Creates a neighbor relationship by exchanging hello packets透過交換 hello 封包建立鄰居關係
  • Propagates LSAs rather than routing table updates:傳播 LSA,而非路由表更新:
    • Link: Router interface鏈路:路由器介面
    • State: Description of an interface and its relationship to neighboring routers狀態:介面及其與相鄰路由器關係的描述
  • Floods LSAs to all OSPF routers in the area, not just to the directly connected routers將 LSA 泛洪給區域內所有 OSPF 路由器,而不只是直接相連的路由器
  • Pieces together all the LSAs that OSPF routers generate to create the OSPF LSDB彙整 OSPF 路由器所產生的所有 LSA,以建立 OSPF LSDB
  • Uses the SPF algorithm to calculate the shortest path to each destination and places it in the routing table使用 SPF 演算法計算到每個目的地的最短路徑,並將其放入路由表

A router sends LSA packets immediately to advertise its state when there are state changes. Moreover, the router resends (floods) its own LSAs every 30 minutes by default as a periodic update. The information about the attached interfaces, the metrics that are used, and other variables are included in OSPF LSAs. As OSPF routers accumulate link-state information, they use the SPF algorithm to calculate the shortest path to each network.

當狀態發生變化時,路由器會立即發送 LSA 封包,通告其狀態。此外,路由器預設也會每 30 分鐘重新發送(泛洪)自己的 LSA,作為定期更新。OSPF LSA 中包含所連接介面的相關資訊、所使用的度量值,以及其他變數。當 OSPF 路由器累積鏈路狀態資訊後,會使用 SPF 演算法計算到每個網路的最短路徑。

Essentially, an LSDB is an overall map of the networks in relation to the routers. It contains the collection of LSAs that all routers in the same area have sent. Because the routers within the same area share the same information, they have identical topological databases.

基本上,LSDB 是網路相對於路由器的整體地圖,其中包含同一區域內所有路由器所發送的 LSA 集合。由於同一區域內的路由器共用相同的資訊,因此它們擁有完全相同的拓樸資料庫。

Which option regarding OSPF is true?關於 OSPF,下列哪個選項是正確的?