OSPF | Neighbor / Topology / Routing Table / Areas / Router Roles | LSR / LSU / 11 类 LSA

注:机翻,未校。


OSPF - Part 1: Introduction, OSPF Packet Structure, OSPF Messages and Characteristics

OSPF - 第 1 部分:简介、OSPF 数据包结构、OSPF 消息和特性

Open Shortest Path First (OSPF) is a popular routing protocol developed for Internet Protocol (IP) networks by the Interior Gateway Protocol (IGP) working group of the Internet Engineering Task Force (IETF). The working group was formed in 1988 to design an IGP based on the shortest path first (SPF) algorithm for use in the Internet. Similar to the Interior Gateway Routing Protocol (IGRP), OSPF was created because in the mid-1980s, the Routing Information Protocol (RIP) was increasingly unable to serve large, heterogeneous internetworks.
开放最短路径优先 (OSPF) 是由互联网工程任务组 (IETF) 的内部网关协议 (IGP) 工作组为 Internet 协议 (IP) 网络开发的一种常用路由协议。该工作组成立于 1988 年,旨在设计一种基于最短路径优先 (SPF) 算法的 IGP,用于互联网。与内部网关路由协议 (IGRP) 类似,OSPF 的创建是因为在 1980 年代中期,路由信息协议 (RIP) 越来越无法为大型异构网际网络提供服务。

OSPF Packet Structure & Analysis

OSPF数据包结构与分析

OSPF is a classless routing protocol, which means that in its updates, it includes the subnet of each route it knows about, thus, enabling variable-length subnet masks. With variable-length subnet masks, an IP network can be broken into many subnets of various sizes. This provides network administrators with extra network-configuration flexibility.These updates are multicasts at specific addresses (224.0.0.5 and 224.0.0.6).
OSPF 是一种无类别路由协议,这意味着在其更新中,它包含它知道的每个路由的子网,从而启用可变长度的子网掩码。使用可变长度的子网掩码,可以将 IP 网络分成许多不同大小的子网。这为网络管理员提供了额外的网络配置灵活性。这些更新是特定地址(224.0.0.5 和 224.0.0.6)的多播。

The diagram below shows us the information that each field of an OSPF packet contains:
下图显示了 OSPF 数据包的每个字段包含的信息:

ospf-1

The numbers shown inside the coloured blocks represent the field length in bytes.
彩色块内显示的数字表示字段长度(以字节为单位)。

ospf-2

All OSPF packets begin with a 24-byte header, which is shown right above.
所有 OSPF 数据包都以 24 字节的标头开头,如上图所示。

OSPF ‘Type’ Field

OSPF “类型”字段

The ‘Type’ field (1-byte long) is a critical component of an OSPF (Open Shortest Path First) package. It indicates the type of OSPF message contained within the package, such as a Hello message, Link State Request message, Link State Update message, or Link State Acknowledgment message. The type field plays a crucial role in the OSPF protocol by helping to ensure that routers exchange the correct types of messages with each other, enabling them to learn about the network topology and establish the shortest path to the destination network.
“Type”字段(1 个字节长)是 OSPF(Open Shortest Path First)包的关键组件。它指示包中包含的 OSPF 消息的类型,例如 Hello 消息、链接状态请求消息、链接状态更新消息或链接状态确认消息。类型字段在 OSPF 协议中起着至关重要的作用,它有助于确保路由器相互交换正确类型的消息,使它们能够了解网络拓扑并建立到目标网络的最短路径。

Understanding the significance of the “Type” field is essential for network administrators to troubleshoot OSPF network issues and optimize the performance of their networks. Below are the Type field messages contained with a bit more information about their purpose and role:
了解“类型”字段的重要性对于网络管理员解决 OSPF 网络问题并优化其网络性能至关重要。以下是包含的 Type 字段消息,其中包含有关其用途和角色的更多信息:

  • Hello: Establishes and maintains neighbor relationships.
    您好:建立并维护邻居关系。
  • Database Description: Describes the contents of the topological database. These messages are exchanged when an adjacency is initialized.
    数据库说明:描述拓扑数据库的内容。这些消息在初始化邻接关系时交换。
  • Link-state Request: Requests pieces of the topological database from neighbor routers. These messages are exchanged after a router discovers (by examining database-description packets) that parts of its topological database are out of date.
    链路状态请求:从邻居路由器请求拓扑数据库的各个部分。在路由器发现(通过检查数据库描述数据包)其拓扑数据库的某些部分已过期后,将交换这些消息。
  • Link-state Update: Responds to a link-state request packet. These messages also are used for the regular dispersal of Link-State Acknowledgments (LSA). Several LSAs can be included within a single link-state update packet.
    链路状态更新:响应链路状态请求数据包。这些消息还用于定期传播链路状态确认 (LSA)。多个 LSA 可以包含在单个链路状态更新数据包中。
  • Link-state Acknowledgment: Acknowledges link-state update packets.
    链路状态确认:确认链路状态更新数据包。

OSPF’s Primary Characteristics

OSPF 的主要特点

OSPF - The Open Routing Protocol

OSPF - 开放式路由协议

The protocol is open (non proprietary), which means that its specification is in the public domain. The OSPF specification is published as Request For Comments (RFC) 1247. This has allowed vendors around the world to produce products and devices that fully support OSPF, without the need of paying any royalty licenses. This also played a major role in making OSPF as a widely acceptable routing protocol for small, medium and large networks.
该协议是开放的(非专有的),这意味着其规范属于公共领域。OSPF 规范以征求意见 (RFC) 1247 的形式发布。这使得世界各地的供应商能够生产完全支持 OSPF 的产品和设备,而无需支付任何版税许可。这也在使 OSPF 成为小型、中型和大型网络广泛接受的路由协议方面发挥了重要作用。

OSPF - Dijkstra SPF Algorithm OSPF - DIJKSTRA SPF 算法

The second principal characteristic is that OSPF is based on the SPF algorithm, which sometimes is referred to as the Dijkstra algorithm, named for the person credited with its creation.
第二个主要特征是 OSPF 基于 SPF 算法,该算法有时被称为 Dijkstra 算法,以创建该算法的人命名。

The SPF algorithm calculates the shortest path by constructing a graph of the network, assigning costs to the links based on their bandwidth and determining the shortest path from each router to every other router in the network. The algorithm ensures that the path chosen has the lowest cost and that the route is loop-free, providing fast and efficient communication across the network.
SPF 算法通过构建网络图来计算最短路径,根据链路的带宽为链路分配成本,并确定从每个路由器到网络中每个其他路由器的最短路径。该算法确保所选路径的成本最低,并且路由是无环路的,从而在网络上提供快速高效的通信。

The SPF algorithm also helps to ensure network stability and performance by quickly detecting changes in the network topology and recalculating the shortest path. When a change occurs, such as a link failure or a new link being added to the network, OSPF sends out Link State Advertisement (LSA) messages to inform all routers in the network of the change. The routers then use the SPF algorithm to recalculate the shortest path to the destination network based on the updated network topology. This ensures that the network continues to operate efficiently and that data is routed along the most optimal path.
SPF 算法还可以快速检测网络拓扑的变化并重新计算最短路径,从而帮助确保网络的稳定性和性能。当发生更改时,例如链路故障或向网络添加新链路,OSPF 会发送链路状态通告 (LSA) 消息,以将更改通知网络中的所有路由器。然后,路由器使用 SPF 算法根据更新的网络拓扑重新计算到目标网络的最短路径。这确保了网络继续高效运行,并且数据沿着最优的路径进行路由。

OSPF - A Link State Routing Protocol

OSPF - 链路状态路由协议

OSPF is a Link State routing protocol that calls for the sending of link-state advertisements (LSAs) to all other routers within the same hierarchical area. Information on attached interfaces, metrics used, and other variables is included in OSPF LSAs. As OSPF routers accumulate link-state information, they use the SPF algorithm to calculate the shortest path to each node.
OSPF 是一种链路状态路由协议,它要求将链路状态通告 (LSA) 发送到同一层次结构区域内的所有其他路由器。有关附加接口、使用的指标和其他变量的信息包含在 OSPF LSA 中。当 OSPF 路由器积累链路状态信息时,它们使用 SPF 算法来计算到每个节点的最短路径。

As a Link State routing protocol, OSPF contrasts with RIP and IGRP, which are Distance Vector routing protocols. Routers running the Distance Vector algorithm send all or a portion of their routing tables in routing-update messages to their neighbors.
作为链路状态路由协议,OSPF 与 RIP 和 IGRP 形成鲜明对比,后者是距离矢量路由协议。运行距离矢量算法的路由器以路由更新消息的形式将其全部或部分路由表发送到其邻居。

Additional OSPF features include equal-cost, multipath routing, and routing based on upper-layer type-of-service (TOS) requests. TOS-based routing supports those upper-layer protocols that can specify particular types of service. An application, for example, might specify that certain data is urgent. If OSPF has high-priority links at its disposal, these can be used to transport the urgent datagram.
其他 OSPF 功能包括等价、多路径路由和基于上层服务类型 (TOS) 请求的路由。基于 TOS 的路由支持那些可以指定特定类型服务的上层协议。例如,应用程序可能会指定某些数据是紧急的。如果 OSPF 可以使用高优先级链路,则这些链路可用于传输紧急数据报。

OSPF supports one or more metrics. If only one metric is used, it is considered to be arbitrary, and TOS is not supported. If more than one metric is used, TOS is optionally supported through the use of a separate metric (and, therefore, a separate routing table) for each of the eight combinations created by the three IP TOS bits (the delay, throughput, and reliability bits). If, for example, the IP TOS bits specify low delay, low throughput, and high reliability, OSPF calculates routes to all destinations based on this TOS designation.
OSPF 支持一个或多个指标。如果仅使用一个指标,则将其视为任意指标,并且不支持 TOS。如果使用多个度量,则可以选择性地通过使用单独的度量(因此,对于三个 IP TOS 位(延迟、吞吐量和可靠性位)创建的八个组合中的每个组合,都可以选择性地支持 TOS。例如,如果 IP TOS 位指定了低延迟、低吞吐量和高可靠性,则 OSPF 将根据此 TOS 指定计算到所有目的地的路由。

Summary

总结

This article introduced the OSPF routing protocol. It provided an overview of the routing protocol, its purpose, capabilities, and analyzed its structure within an Ethernet II frame. The ‘Type’ field within the OSPF header was examined and we also saw the different type of messages supported (Hello, Database description, Link-state Request, Link-state Update and Acknowledgment).
本文介绍了 OSPF 路由协议。它概述了路由协议、其用途和功能,并分析了其在以太网 II 帧中的结构。检查了 OSPF 标头中的“类型”字段,我们还看到了支持的不同类型的消息(Hello、数据库描述、链路状态请求、链路状态更新和确认)。


OSPF - Part 2: How OSPF Protocol Works & Basic Concepts: OSPF Neighbor, Topology & Routing Table, OSPF Areas & Router Roles, Theory & Overview

OSPF - 第 2 部分:OSPF 协议的工作原理和基本概念:OSPF 邻居、拓扑和路由表、OSPF 区域和路由器角色、理论和概述

Article Reads:242970

ospf-operation-basic-advanced-concepts-ospf-areas-roles-theory-overview
This article covers basic OSPF concepts and operation. We explain how OSPF works, how OSPF tables are built on an OSPF-enabled router and their purpose (Neighbour Table, Topology Table, Routing Table), OSPF areas and their importance. Next we cover OSPF Link State Packet types used to exchange data between OSPF routers: Link State Advertisement (LSA), Link State Database (LSDB), Link State Request (LSR), Link State Update (LSU) and Link State Acknowledgment (LSAcK).
本文介绍 OSPF 的基本概念和操作。我们将解释 OSPF 的工作原理、如何在启用了 OSPF 的路由器上构建 OSPF 表及其用途(邻居表、拓扑表、路由表)、OSPF 区域及其重要性。接下来,我们将介绍用于在 OSPF 路由器之间交换数据的 OSPF 链路状态数据包类型:链路状态通告 (LSA)、链路状态数据库 (LSDB)、链路状态请求 (LSR)、链路状态更新 (LSU) 和链路状态确认 (LSAcK)。

Finally, we take a look at the OSPF roles: Area Boarder Router (ABR), Autonomous System Boundary Router (ASBR), Designated Router (DR), Backup DR and more.
最后,我们看一下 OSPF 角色:区域边界路由器 (ABR)、自治系统边界路由器 (ASBR)、指定路由器 (DR)、备份 DR 等。

What Is OSPF & How Does It Work?

什么是OSPF,它是如何工作的?

OSPF is a Link State protocol that’s considered may be the most famous protocol among the Interior Gateway Protocol (IGP) family, developed in the mid 1980’s by the OSPF working group of the IETF.
OSPF 是一种链路状态协议,被认为是内部网关协议 (IGP) 系列中最著名的协议,由 IETF 的 OSPF 工作组在 1980 年代中期开发。

When configured, OSPF will listen to neighbors and gather all link state data available to build a topology map of all available paths in its network and then save the information in its topology database, also known as its Link-State Database (LSDB). Using the information from its topology database. From the information gathered, it will calculate the best shortest path to each reachable subnet/network using an algorithm called Shortest Path First (SFP) that was developed by the computer scientist Edsger W. Dijkstra in 1956. OSPF will then construct three tables to store the following information:
配置后,OSPF 将侦听邻居并收集所有可用的链路状态数据,以构建其网络中所有可用路径的拓扑图,然后将信息保存在其拓扑数据库(也称为链路状态数据库 (LSDB))中。使用其拓扑数据库中的信息。根据收集到的信息,它将使用计算机科学家 Edsger W. Dijkstra 于 1956 年开发的称为最短路径优先 (SFP) 的算法计算到每个可访问子网/网络的最佳最短路径。然后,OSPF 将构造三个表来存储以下信息:

  • Neighbor Table: Contains all discovered OSPF neighbors with whom routing information will be interchanged
    邻居表:包含所有已发现的 OSPF 邻居,路由信息将与之交换
  • Topology Table: Contains the entire road map of the network with all available OSPF routers and calculated best and alternative paths.
    拓扑表:包含网络的完整路线图,包括所有可用的 OSPF 路由器以及计算出的最佳和替代路径。
  • Routing Table: Contain the current working best paths that will be used to forward data traffic between neighbors.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值