注:机翻,未校对。
OSPF Area Types: Detailed Explanation
Introduction to OSPF Network
OSPF 网络简介
An OSPF network can be divided into sub-domains called *areas*. A router within an area must maintain a topological database for the area to which it belongs. Since the router will not have detailed topology information of routers in other areas, this would greatly reduce the size of database.
OSPF 网络可以划分为称为区域的子域。区域内的路由器必须维护其所属区域的拓扑数据库。由于路由器不会有其他区域路由器的详细拓扑信息,这将大大减小数据库的大小。
Areas limit the scope of route information distribution. The link-state database (LSDB) of routers within the same area must be synchronized and be exactly the same. The main benefit of creating areas is a reduction in the number of routes to propagate—by the filtering and the summarization of routes.
区域限制了路线信息分发的范围。同一区域内路由器的链路状态数据库 (LSDB) 必须同步并且完全相同。创建区域的主要好处是减少了要传播的路由数量 - 通过筛选和汇总路由。
Requirements of an OSPF Network
OSPF 网络的要求
Each OSPF network that is divided into different areas must follow these rules:
划分为不同区域的每个 OSPF 网络都必须遵循以下规则:
- A backbone area—which combines a set of independent areas into a single domain—must exist.
必须存在主干区域,它将一组独立区域组合成一个域。 - Each non-backbone area must be directly connected to the backbone area (though this connection might be a simple logical connection through a virtual link)
每个非主干区域都必须直接连接到主干区域(尽管此连接可能是通过虚拟链路的简单逻辑连接) - The backbone area must not be partitioned—divided into smaller pieces—under any failure conditions, such as link or router down events.
在任何故障情况下,例如链路或路由器关闭事件,不得对主干区域进行分区(分成较小的部分)。
## OSPF Area Types
OSPF 区域类型
OSPF Areas are created to control the movement of LSAs across the OSPF network. There are different OSPF Area types, namely –
创建 OSPF 区域是为了控制 LSA 在 OSPF 网络中的移动。有不同的 OSPF 区域类型,即 –
-
Standard / Normal Area 标准/普通区域
-
Backbone Area 骨干区
-
Stub Area 存根区域
-
Totally Stubby Area 完全末节区域
-
Not So Stubby Area (NSSA) 非完全末节区域 (NSSA)
Standard Area:
标准区域:
LSA Type 1 and 2 are sent between routers within an area and thus help prepare the Shortest Path tree for an area. The LSA Type 3 which shares internal routes and LSA Type 5 that shares external routes flood through this area. Just note that the internal routes are by OSPF Router whereas the external routes are by the ASBR.
LSA 类型 1 和 2 在区域内的路由器之间发送,从而有助于为区域准备最短路径树。共享内部路由的 LSA Type 3 和共享外部路由的 LSA Type 5 流经此区域。请注意,内部路由由 OSPF 路由器提供,而外部路由由 ASBR 提供。
Standard areas help in optimizing routing as the information about all routes is with all routers. But this at times can be a burden to storing / maintain the full database.
标准区域有助于优化路由,因为有关所有路由的信息都与所有路由器有关。但这有时会成为存储/维护完整数据库的负担。

To configure a normal area, we use the command:
要配置正常区域,我们使用以下命令:
R1 (config)# router ospf 10
R1 (config-router)# network <ip address> < wildcard mask> area <area no.>
Backbone Area 骨干区:
Backbone area is similar to the standard area. All areas are connected to this area. This is also known as Area 0.
骨干区域与标准区域相似。所有区域都与此区域相连。这也称为区域 0。
Stub Area 存根区域
In a Stub area the External LSAs i.e. LSA Type 5 is stopped. The LSA Type1 and Type can be used in a stub area so that a topology can be built. The main use of Stub Area is that the number of LSAs flowing in an area is under control which in turn will help consumption of CPU and bandwidth if the router.
在存根区域中,外部 LSA(即 LSA 类型 5)停止。LSA Type1 和 Type 可以在存根区域中使用,以便可以构建拓扑。Stub Area 的主要用途是在一个区域中流动的 LSA 数量受到控制,这反过来将有助于路由器的 CPU 和带宽的消耗。
In a Stub Area, a default route is injected by the ABR along with the Type 3 LSA. And this default route is helpful to reach external networks. All the routers in the area must be configured as stub in order to make an area stub.
在存根区域中,ABR 会与 Type 3 LSA 一起注入默认路由。此默认路由有助于访问外部网络。区域中的所有路由器都必须配置为末节,才能创建区域末节。

The command used is as:
使用的命令如下:
(Router-config)# area <area no.> stub
Totally Stubby Area 完全末节区域
As in a Stub area, in the Totally Stubby Area as well the External LSAs are stopped (Type 5 LSA.) In addition the LSA Type 3 i.e. Summary LSA is also not allowed in a Totally Stubby area. Thus this drastically reduces the size of the routing table as both internal and external routes are reduced and only default route is used.
与在存根区域中一样,在完全短截区域中,外部 LSA 也会停止(类型 5 LSA)。此外,LSA 类型 3,即摘要 LSA,也不允许在完全短截的区域中使用。因此,这大大减小了路由表的大小,因为内部和外部路由都会减少,并且只使用默认路由。
The main use of Totally Stubby Area is also similar to a stub area, that the number of LSAs flowing in an area is under control which in turn will help consumption of CPU and bandwidth if the router.
Totally Stubby Area 的主要用途也类似于 Stub Area,即在一个区域中流动的 LSA 数量受到控制,这反过来将有助于 CPU 和带宽的消耗(如果路由器)。
Here also all the routers in the area must be configured as stub and the ABR of the stub areas will be configured as totally stubby.
此外,该区域中的所有路由器都必须配置为末节,并且末节区域的 ABR 将配置为完全短截。

The command used is as:
使用的命令如下:
On the ABR: 在 ABR 上:
(Router-config)# area
On other routers: 在其他路由器上:
(Router-config)# area
Not so Stubby Area (NSSA) 非完全末节区域 (NSSA)
Here Type 7 LSAs are used which are similar to the type 5 LSA. Here the external links are advertised by the ASBR towards the ABR, which in turn will convert the LSA type 7 to LSA Type 5 and then flood it to the rest of OSPF network.
这里使用 7 型 LSA,它类似于 5 型 LSA。在这里,ASBR 向 ABR 通告外部链接,ABR 又将 LSA 类型 7 转换为 LSA 类型 5,然后将其泛洪到 OSPF 网络的其余部分。
Similar to other areas, Type 1 and Type 2 LSAs are used to build the topology tables. The type 3 Network LSA are accepted by the NSSA thus can be used to reach other networks of other areas.
与其他区域类似,类型 1 和类型 2 LSA 用于构建拓扑表。类型 3 网络 LSA 被 NSSA 接受,因此可用于访问其他区域的其他网络。
All the routers in the area must be configured as NSSA.
该区域中的所有路由器都必须配置为 NSSA。

The command is: 命令是:
(Router-config)# area <area no.> nssa
via:
- OSPF Area Types: Detailed Explanation - IP With Ease Rashmi Bhardwaj
https://ipwithease.com/ospf-area-types/
接着来一篇 csdn 上的写的不错的文章。
OSPF 区域类型及详解
1, 骨干区域 (Backbone Area)
骨干区域是 Area 0, 是整个 OSPF 域的中心枢纽。一个 OSPF 域有且只能拥有一个 Area 0, 所有的区域间路由必须通过 Area0 中转。
2, 常规区域 ( Normal Area)
所有的 OSPF 区域缺省情况下都是常规区域,当然,Area 0 是常规区域中比较特殊的一个。
OSPF 要求所有的非骨干区域 (非 0 常规区域) 都必须与 Area 0 直接相连。常规区域中允许 Type-1, Type-2. Type-3, Type-4 以及 Type-5 LSA 泛洪,Type-7 LSA 禁止出现在常规区域内。

3. 末梢区域 (Stub Area)
末梢区域也被称为 Stub 区域,当一个非 0 常规区域只有单一的出口 (例如该区域只有一个 ABR), 或者区域内的路由器不需要根据特定的外部路由来选择离开区域的出口时,该区域可以被配置为 Stub 区域。
当一个区域被配置为 Stub 区域后,这个区域的 ABR 将阻挡 Type-5 LSA 进入该区域 (禁止外部路由被发布到该区域), 通过这种方式可减少区域内所泛洪的 LSA 数量,同时该区域的 ABR 自动下发一条使用 Type-3 LSA 描述的默认路由,使得区域内的路由器能够通过这条默认路由到达域外,因此既减小了区域内网络设备的路由表规模,又保证了其访问外部网络的数据可达性。
在一个大量引入外部路由的 OSPF 网络中,将适当的区域配置为 Stub 区域可以极大地减小该区域内路由器的路由表规模,从而降低设备的资源消耗。另外,对于 Stub 区域而言,到达 OSPF 域内其他区域的路,由依然能够被注入,即 ABR 依然会将描述区域间路由的 Type-3 LSA 注入到 Stub 区域中。
Area 1 被配置为 Stub 区域,这样 Area 1 的 ABR (CO-SW1 及 Co-sw2) 便不能再将 Type-5 LSA 注入这个区域。由于 Type-5 LSA 无法进入该区域,因此 Type-4LSA 也就没有必要再在该区域内泛洪,所以 Co-sw1 及 Co-sw2 也就不会再向该区域内注入 Type-4 LSA, 进而,Router-X 的路由表将不会再出现到达省公司 (OSPF 域外) 的具体路由,路由表的规模减小了,设备的资源消耗也就降低了。当然,Router-X 访问省公司的需求还是存在的,为了让 Router-X 发往省公司的流量能顺利到达目的地,ABR 会自动向 Areal 中注入默认路由,该条默认路由使用 Type-3 LSA 描述,co-SW1 及 CO-Sw2 都会下发默认路由,网络管理员可以通过把控默认路由的 Cost 从而控制 Routerx 选择的出口。Router-X 发往省公司的流量能够通过该默认路由先到达 co-sW1 或 co-sw2, 再通过它们转发到省公司。

设置末梢区域后 ASBR 生成 Type-5 LSA 无法进入,ABR 也没有必要生成描述 ASBR 位置的 Type-4 LSA,取而代之的是 ABR 生成一条描述外部路由的默认路由 Type-3 LSA,让 stub 里的路由器转发发往外部网络的数据时把数据都发给 ABR,由 ABR 统一转发。减小 stub 区域里的路由器的路由表大小。
所有连接到 stub 区域的路由器,对于该区域的 stub 属性要有一致的认知,否则 OSPF 邻居关系的建立将会出现问题。
还可以在 ABR 上配置,进一步阻挡描述区域间路由的 Type-3 LSA 进入,区域内的路由器访问区域外的网络时,统一把数据发给 ABR。这样,这个区域内只有 Type-1 LSA、Type-2 LSA 及描述默认路由的 Type-3 LSA 存在,这意味着区域内路由器的路由表都将只有到达区域内部的路由,以及指向 ABR 的默认路由,路由器的路由表被极大程度地精简了。这种特殊区域也被称为 ** 完全末梢区域 (Totally Stub Area)**
4. 非完全末梢区域 (Not-So-Stubby Area)
**NSSA (Not-So-Stubby Area) 即非完全末梢区域 **, 可以理解为 Stub 区域的变种,它拥有 Stub 区域的特点 — 阻挡 Type-4 及 Type-5 LSA 进入,从而在一定程度上减少区域内泛洪的 LSA 数量,同时它还有另一个特点,那就是允许该区域的路由器将少量外部路由引入 OSPF, 被引入的外部路由,以 Type-7 LSA 描述,并且这些 Type-7 LSA 只能够在当前的 NSSA 内泛洪,不允许直接进入 Area0, 为了使这些被引入 NSSA 的外部路由能让 OSPF 域内的其他区域学习到,NSSA 的 ABR 会将 Type-7 LSA 转换成 Type-5 LSA 然后注入 Areao, 从而泛洪到整个 OSPF 域。
Area 1 被配置成了 NSSA。这样 Area 1 的 ABR 将阻挡 Type-5 LSA 进入这个区域。另一方面,Router-X 连接到一个 RIP 网络,它将路由表中的 RIP 路由引入 OSPF, 这些被引入的外部路由以 Type-7 LSA 描述,这些 LSA 在 Area 1 内泛洪,并且禁止进入 Area 0.co-sW1 及 CO-SW2 作为 NSSA 的 ABR, 自然也是能收到这些 Type-7 LSA 的,它们能够根据这些 LSA 计算出到达 RIP 网络的路由。
另外它们也负责将 Type-7 LSA 转换成 Type-5 LSA 并将后者注入 Area 0, 这样这些外部路由便能够被整个 OSPF 域中的路由器学习到。另一方面,CO-SW1 及 CO-SW2 会向 NSSA 内下发一条 Type-7 LSA 的默认路由,使得 Router-X 能够通过这条默认路由到达省公司。

RIP 通过 RX 生成的 Type-7 LSA 来描述,生成的 Type-7 在 NSSA 区域内泛洪。ABR 收到 Type-7 后生成 Type-5 LSA 注入到 Area 0 中,让其他区域的路由器可以知道这个 RIP,同时 ABR 也会生成一条 Type-7 LSA 默认路由给 RX 可以访问省公司。
我们还可以在 NSSA 的基础上进一步减少 LSA 的泛洪。在 NSSA 的 ABR 上,可以进一步将 Type-3 LSA 阻挡掉,从而将区域间的路由都过滤掉,而 NSSA 的 ABR 会自动,下发一条默认路由 (使用 Type-3 LSA 描述) 到该区域,使得区域内的路由器能够通过这条默认路由访问 OSPF 域内的其他区域,以及域外的网络。这种类型的特殊区域也被称为 Totally NSSA。
5. 各种区域类型中允许出现的 LSA
表中列举出了在每种 OSPF 区域类型中,允许出现以及禁止出现的 LSA.
| Type-1 | Type-2 | Type-3 | Type-4 | Type-5 | Type-7 | |
|---|---|---|---|---|---|---|
| 常规区域 | √ | √ | √ | √ | √ | × |
| Stub 区域 | √ | √ | √ | × | × | × |
| Totally Stub 区域 | √ | √ | × [1] | × | × | × |
| NSSA | √ | √ | √ | × | × | √ |
| Totally NSSA | √ | √ | x [2] | × | × | √ |
[1] ABR 会自动下发一条 Type-3 LSA 的默认路由,除此之外其他的 Type-3 LSA 都被禁止。
[2] ABR 会自动下发一条 Type-3 LSA 的默认路由,除此之外其他的 Type-3 LSA 都被禁止。
6. 判断 LSA 的新旧
(1) 首先,拥有更高链路状态序列号的 LSA 实例被认为更新,因为路由器每次在刷新 LSA 的时候,会将该 LSA 的链路状态序列号加 1, 链路状态序列号越大,则 LSA 越新。
(2) 如果 LSA 实例的链路状态序列号相同,那么拥有更大校验和的 LSA 实例被认为更新。
(3) 如果 LSA 实例的链路状态序列号相同、校验和也相同,且某个实例的老化时间被设置为 MaxAge (最大老化时间,缺省 3600s), 则该实例被认为最新。
(4) 如果 LSA 实例的链路状态序列号相同、校验和也相同,且没有任何一个实例的老化时间被设置为 MaxAge, 那么当两个实例的老化时间相差超过 MaxAgeDif (到达整个 AS 边界所需的最长时间,通常是 15min)时,这两个实例被认为是不同的实例,且老化时间值越小的 LSA 被认为越新。
(5) 如果 LSA 实例的链路状态序列号相同、校验和也相同,另外,没有任何一个实例的老化时间被设置为 MaxAge, 并且,两个实例的老化时间相等,或相差不超过 MaxAgeDiff, 则它们被认为是相同的实例。
via:
-
OSPF 区域类型及详解 - 优快云 博客 虚幻的章鱼于 2021-01-10 13:24:43 发布
https://blog.youkuaiyun.com/weixin_45793782/article/details/112426310
4120

被折叠的 条评论
为什么被折叠?



