Summary OSPF LSA types (including an OSPFv3 and OSPFv2)

Reference blog site: https://blog.csdn.net/neo233/article/details/70893043

OSPF LSA

LSA (Link-State Advertisement, LSA) packet is a link-state protocol, which includes information about the neighbor channels and cost. LSAs received by routers in maintaining them the RIB (routing table).

OSPF routing protocol is a link-state type routing protocol, the interface device that is a link here. Link-state type routing protocol routing decision based on the link connection state of the source and target devices. Link state is the description of the interface and its relationship with an adjacent network device, i.e. information interface link, i.e. the link status (information). The interface information includes the IPv6 prefix (prefix), netmask, a network interface connection information (link) type, the interface of the router or the like on the same network (link). The link state information is carried by a different type of LSA, spread on the network.

The collected router LSA in the link-state database, and then run the table is calculated by SPF algorithm. Essentially different link-state database and routing table comprising: a database comprising link state is the complete original data, and the routing table lists the arrival list of all known target network shortest path.

OSPF routing protocol routing protocol provides for the IP protocol. OSPFv2 (OSPF version 2) is to support the IPv4 routing protocol, in order to allow OSPF protocol support IPv6, technical staff developed OSPFv3 (OSPF version 3), OSPFv3 by the  RFC2740  definition.

LSA type

1, OSPFv2 LSA type:
LSA type LSA type number
Router LSA 1
Network LSA 2
Network summary LSA 3
ASBR summary LSA 4
Autonomous system external LSA 5
Group membership LSA 6
NSSA External LSA 7
External attributes LSA for BGP 8
Opaque LSA (link-local) 9
Opaque LSA (local area) 10
Opaque LSA (AS range) 11

Note: The following text description is quite detailed, if textual description really is too much, you can just look the part in bold font. Further down there are summarized LSA Type 1/2/3/4/5/7.

(1) the router LSA (Router LSA): each router will have advertised the LSA Class 1. The basic list of advertised router LSA all links or interfaces, and indicate their status and cost of each link in the outbound direction, and all known OSPF neighbors on the link; Further, 1 LSA is also pointed out that the router is not the ABR or ASBR. The advertisement will only LSA flooding diffusion (as shown below) within their area of origin. The command  show ip ospf database router  can view all routers LSA notices listed in the database.

Class 1 LSA: Router LSA Class 1 LSA: Router LSA

In a link state ID field, a router using the router advertisement ID to identify the type 1 LSA. Each router link (interface) is defined as one of four types: class 2, 3 or 4. LSA comprising a link ID field for identifying the other end of the link; the meaning of the Link ID field varies with the type of the link, the link table describes the various types and LSA Link ID field Class 1:

Link Type description Content of Link ID field
1 The router connected to another point Neighbor router ID
2 Is connected to the transit network DR interface addresses
3 Connected to the distal network IP network / subnet number
4 Virtual link Neighbor router ID

There is also a link data field, which provides additional information of 32 bits. For most types of links, this is related to the IP address of the router interface; stub for connection to a network link, the subnet mask which is the stub network.

(2) network LSA (Network LSA): Class 2 is the LSA DR region is generated for each broadcast or NBMA network transit network. Transit network is directly connected to at least two OSPF routers, such as Ethernet and other multi-access network belongs to the transit network. Class 2 LSA lists all routers constituting the transit network (DR including itself) subnet mask, and links. DR is responsible for advertising category 2 LSA transit links, Class 2 LSA then propagated to all routers in the area, type 2 LSA not be propagated (as shown below) across zone boundaries. Its link state advertisement ID of its IP interface address of the DR. Use the command  show ip ospf database network  can view information about network LSA advertised. Please note that different and router LSA, network LSA in no metric field.

Other explanations of the LSA network:

DR router as a "dummy" node, or a virtual router, used to describe a multi-access network and all routers connected thereto. From this perspective, a network announcement may also depicts LSA "false" a logical node, like a router LSA advertisement depicts a single router on the same physical. LSA lists all network router advertisement associated therewith, including DR router itself. Just as a router LSA, network LSA is only produced in the interior region of this network LSA flooding spread.

Class 2 LSA: Network LSA Class 2 LSA: Network LSA

(3) Network Summary LSA (LSA the Network Summary): 3 LSA is generated by ABR, the network will advertise in a region to another region OSPF autonomous systems (LSA Class 1 and Class 2 is restricted in the region) . After shown below, the ABR class 1 LSA received from the other routers in the area where, sends out the LSA type 3, in order to advertise to other regions learned by Class 1 LSA network. Class 3 LSA only within a diffusion region, but 3 LSA ABR regenerate it to diffuse to other regions. Use command  show ip ospf database summary  may be displayed in the network link state database summary LSA information.

Class 3 LSA: Network Summary LSA Class 3 LSA: Network Summary LSA

When a summary ABR originating an LSA network, including the cost from itself to the destination of this advertisement is the LSA-consuming. ABR routes even know how to reach the destination, it will only destination this summary LSA advertised as originating single network, thus:

  • If an ABR multiple routes in the region and is connected by itself can reach the destination, it will only be a single originating network summary LSA into the backbone of the region, and this network summary LSA is above the plurality of routes lowest price;
  • Similarly, if an ABR through backbone areas receive more than one network from another ABR summary LSA, then this originating ABR will select the lowest LSA LSA advertised price, and this will be the lowest cost of LSA advertisement to give non-backbone area connected to it.

by default:

  • OSPF does not automatically a set of consecutive subnets summarize, the network will not be aggregated into a network classification;
  • ABR summary LSA will always spread to other areas, regardless of whether the route which is a summary of the route;
  • ABR network administrator must use configuration commands to specify how to summarize;
  • For each sub-region, a 3 LSA will diffuse into the backbone;
  • 汇总 LSA 并不包含汇总路由,因此默认情况下,将通告区域内的所有子网,这可能导致严重的扩散问题,所以应考虑在 ABR 上手工配置路由汇总。

注意:收到 3 类 LSA 时,并不会导致路由器运行 SPF 算法。路由器将 3 类 LSA 通告的路由加入路由表或将其从路由表中删除时,并不一定执行完整的 SPF 计算。调试输出表明,这将导致执行部分 SPF 计算,但表示 SPF 算法执行次数的计数器并不会加 1。有些 Cisco 文档暗示 3 类 LSA 被注入区域时将运行 SPF 算法,但情况并非如此。

扩展:

当其他的路由器从一台 ABR 收到一条网络汇总 LSA 通告时,它并不运行 SPF 算法。相反地,它只是简单地加上从它到那台 ABR 之间路由的代价,并将这个代价包含在这个 LSA 通告当中。通过 ABR 路由器,到达所通告的目的地的路由连同所计算的代价一起被记录进了路由表。这个行为 ―― 依赖中间路由器代替确定到达目的地的全程路由(Full route)的做法 ―― 其实是距离矢量协议的行为。因此,虽然在一个区域内部 OSPF 协议是一个链路状态协议,但是它却使用了距离矢量的算法来查找域间路由。

(4) the ASBR Summary LSA (ASBR summary LSA): Only when there is region ASBR, ABR will generate four types of LSA. Identifies four types of LSA ASBR, and provides a route to the ASBR's go. Go outside the autonomous system of data flow requires routing table contains information about the ASBR advertising external routes. Link State ID is set to the ASBR router ID. Use the command  show ip ospf database asbr-summary  you can view a summary of the LSA ASBR. It should be noted here that, where the destination is a host address, and mask is 0 (by ASBR summary LSA advertised destination will always be a host address, because it is a route to a router).

As shown below, the ASBR transmits a Class 1 LSA, and setting the E bit (outer portion), indicates that the sending of ASBR. Class 1 LSA is defined in the region. However, when the ABR (with border router LSA [B] bit identifier) ​​after receiving the LSA, it creates a class 4 LSA, and floods it to the backbone area (Area 0). Other ABR will regenerate a class 4 LSA, and floods it to own zone.

Class 4: ASBR Summary LSA Class 4: ASBR Summary LSA

(5) AS external LSA (LSA Autonomous System External): 5-LSA describes OSPF routing network to the outside of the autonomous system (including the default route autonomous system external to the OSPF), and is sent by the spread throughout the ASBR aS (shown below). 5 LSA link-state database is not the only area with a particular advertisement associated LSA (i.e., O E2 O E1 and not part of a Routing Area, independent) . Class 5 LSA flooding the advertisement spread throughout the autonomous system. Link status for the network ID number of the external network. Use the command  show ip ospf database external  can see the Type 5 LSA information.

Class 5: AS external LSA Class 5: AS external LSA

Given its diffusion range, if the default setting, that is, no route summarization, external LSA can also cause problems, depending on the number of external networks. Network administrators should summarize the external network blocks on ASBR, to ease proliferation.

About E1 and E2 external routes:

  • E1: For O E1 external routes, cost plus a cost of external overhead packet through the interior of each link. When a plurality of the same external ASBR advertises a route to the same autonomous system, the use of this type, in order to avoid sub-optimal routing;
  • E2 (default): O E2 routing overhead always contain only the external costs. When only one external ASBR router advertisement in the autonomous system, the use of this type.

Shown, external to the autonomous system AS1 routing of overhead E2 always below 1785. After a while the overhead for each E1 link, this just added a link metric (FIG link metric is 10). If multiple AS external path of travel, and the use of E2 overhead, then there will be no difference between the paths.

E1 and E2 calculated routing overhead E1 and E2 calculated routing overhead

(6)组成员 LSA(Group membership LSA):是用在 OSPF 协议的一个增强版本――组播 OSPF 协议(MOSPF协议)中的。MOSPF 协议将数据包从一个单一的源地址转发到多个目的地,或者是一组共享 D 类组播地址的成员。

(7)NSSA 外部 LSA(NSSA External LSA):是指在非纯末梢区域(Not-So-Stubby Area, NSSA)内始发于 ASBR 路由器的 LSA 通告。NSSA 外部 LSA 通告几乎和 5 类 LSA 通告是相同的。只是不像 5 类 LSA 通告那样在整个 OSPF 自治系统内进行泛洪扩散,NSSA 外部 LSA 通告仅仅在始发这个 NSSA 外部 LSA 通告的非纯末梢区域内部进行泛洪扩散。可以通过命令 show ip ospf database nssa-external 来显示 NSSA 外部 LSA 通告的信息。

(8) BGP 的外部属性 LSA(External attributes LSA for BGP):是被提议作为运行内部 BGP 协议(iBGP 协议)的另一种选择,以便用来传送 BGP 协议的信息穿过一个 OSPF 域。这个 LSA 从来没有在大范围部署过,IOS 也不支持该 LSA。

(9 ~ 11)不透明 LSA(Opaque LSA):是由标准的 LSA 头部后面跟随专用信息组成的一类 LSA。这个信息字段可以直接由 OSPF 协议使用,或者由其他应用分发信息到整个 OSPF 域间接使用。Opaque LSA 类型用于对 OSPF 增加可变的扩展特性,例如在 MPLS 网络中应用流量工程参数。

  • (9)Opaque LSA(链路本地范围):只在链路间泛洪
  • (10) Opaque LSA (local area): Only in the region flooded
  • (11) Opaque LSA (AS range): flooding throughout the OSPF domain

Other related articles:

2, OSPFv2 LSA type summary:
OSPFv2 LSA Type Summary OSPFv2 LSA Type Summary

Marked: FIG ADV is a router advertisement; the ABR area border routers; the ASBR is an autonomous system border router.

① LSA 1 router LSA (Router LSA)
described routers direct link state information . Announcements initiated by each router, pass only in the region , will not exceed ABR.

② LSA 2 network LSA (Network LSA)
describe the region  BMA / NBMA (serial connection information does not appear here) the network information and the router connected to this network. , Only the announcement delivered by the DR or BDR present BMA / NBMA network in the region.

③ LSA 3 网络汇总 LSA(Network summary LSA)
描述 OSPF 的区域间路由(在路由表中以 O IA 标识)。原 LSA 1 所描述的路由信息会由所在区域的 ABR 将其转换为 LSA 3。由 ABR 通告,3 类 LSA 只在一个区域内扩散,但 ABR 可以重新生成 3 类 LSA 以便将其扩散到其他区域(但是有的特殊区域会不让 LSA 3 进)。
注意:LSA 3 每穿越一个 ABR,其 ADV Router(通告路由器)都会发生改变,ADV Router 转变为最后一次穿越的 ABR 路由器。

④ LSA 5 自治系统外部 LSA (Autonomous system external LSA)
没有看错,这里是 LSA 5,我们先讲 LSA 5 再反过来看 LSA 4。
LSA 5 描述的是 OSPF 区域以外的路由(RIP、EIGRP、BGP 等,在路由表中以 O E1 / O E2 标识)。由 ASBR 通告,LSA 5 可以传播到整个 OSPF 的所有区域(特殊区域除外)。
注意:LSA 5 的 ADV Router 在穿越 ABR 的时候是不会改变的。

⑤ LSA 4 ASBR 汇总 LSA(ASBR summary LSA)
LSA 4 所承载的内容是:ASBR 的 Router-ID。LSA 4 其实就是图中 R4(通告路由器)将 Area 3 中 R11 的 Router-ID 信息转换为 LSA 4,在整个 OSPF 域中泛洪传播(特殊区域除外)。LSA 4 由 ABR 通告。

为什么需要 LSA 4?由于 LSA 5 的通告路由器在穿越 ABR 的时候不会改变,如图中 Area 3 的 LSA 5 在穿越 R4 到达 Area 0 时,通告路由器不改变仍然是 R11,因此除了 Area 3,Area 0 和其他区域都不知道 R11 的信息。此时就需要 LSA 4 为 Area 0 和其他区域提供 R11 的信息,可以这么说,LSA 4 是为 LSA 5 所服务的。

⑥ LSA 7 NSSA 外部 LSA(NSSA External LSA):
LSA 7 通告几乎和 LSA 5 通告是相同的由 ASBR 通告,只是不像 LSA 5 那样在整个 OSPF 自治系统内进行泛洪扩散,LSA 7 仅仅在始发这个 LSA 7 的 NSSA Area 和 Total NSSA Area 内部进行泛洪扩散。

其他相关文章:

3、OSPFv3 LSA 类型:

在 IPv6 环境下生成和再次生成 LSA 的过程与 IPv4 环境下的过程是相同的。再次生成的 LSA 的序列码(LS sequence number)递增,LSA 的生存时间(LS age)被设置为 0,LSA 被写入链路状态数据库中,并从适当的接口扩散出去。在 IPv4 环境下能够触发再次生成 LSA 的事件,同样能够触发 IPv6 环境下的路由器再次生成 LSA,除此之外,下列事件或行为也能够触发 IPv6 路由器再次生成 LSA:

  • 任意一个路由器接口状态的改变;
  • DR 路由器身份的改变;
  • 邻居路由器从 full 状态转变到其它状态,或者从其它状态转变到 full 状态;
  • 邻居接口 ID 的改变;
  • 为链路增加了新的地址前缀,或者删除了某个地址前缀;
  • 收到了新的链路 LSA(link-LSA),并引起了链路前缀的变化。

OSPFv3 继承了 OSPFv2 的大多数 LSA 类型,只是名称上有所改变,并增加了新的 LSA 类型。下表列出了 OSPFv3 使用的 LSA。

表 LSA 类型一览表

LSA 名称 LSA 类型编号 LSA 类型编码
Router-LSA 1 0x2001
Network-LSA 2 0x2002
Inter-Area-Prefix-LSA 3 0x2003
Inter-Area-Router-LSA 4 0x2004
AS-External-LSA 5 0x2005
Group-membership-LSA 6 0x2006
Type-7-LSA 7 0x2007
Link-LSA 8 0x2008
Intra-Area-Prefix-LSA 9 0x2009

(1)路由器 LSA(Router-LSA):描述在特定区域内的路由器接口的链路状态及链路开销。该类型 LSA 仅在接口所在的区域内传播。该类型 LSA 还指示出产生该类型 LSA 的路由器是否是一台 ABR 或 ASBR,以及路由器是否是虚链路的一端。类型 1 LSA 也被用来通告末端(stub)网络。

(2)网络 LSA(Network-LSA):由 DR 产生,用来描述 DR 所代表的网络的链路状态信息和链路开销信息。该 LSA 是 BMA 网络上的所有链路信息和链路开销信息的集合信息。

(3)区域间前缀 LSA(Inter-Area-Prefix-LSA):这种类型 LSA 在 OSPFv2 中叫做概括的网络链路状态条目(summary net link states)。该类型 LSA 由 ABR 产生,用来把一个区域内的路由信息通告到另外一个区域。这种类型的 LSA 既可以描述一条具体的路由信息,也可以描述总结的路由信息。在 OSPFv3 中,地址是用前缀和前缀长度表达的,而不再使用地址和掩码的表达形式。缺省路由的前缀长度用 0 代表。

(4)区域间路由器 LSA(Inter-Area-Router-LSA):由 ASBR 产生,用以通告 ASBR 的位置。试图把数据送达外网的路由器使用该 LSA 确定通往下一跳的最佳路径。

(5)自治系统外 LSA(AS-External-LSA):用来携带自治系统外路由信息的 LSA。例如,把其它 AS 的路由再发布到 OSPF 中的路由信息。在该类型的 LSA 中,地址用前缀和前缀长度表达,缺省路由的前缀长度用 0 表达。

(6)类型 6 LSA(Group-membership-LSA):用于组播,不做讨论。

(7)类型 7 LSA(Type-7 LSA):由 NSSA 中的 ASBR 产生,只在 NSSA 中传播。在 ABR 上它被转换成类型 5 并且被扩散到骨干区域。

(8)链路 LSA(Link-LSA):该类型 LSA 仅在本链路上传播,具有以下 3 种目的:向本链路上的其它路由器提供路由器的本链路地址;向本链路上的其它路由器通告 IPv6 地址前缀,使其与本链路相关联;允许路由器在该类型 LSA 中插入一些选项比特,与为本链路产生的网络 LSA 相关联。

(9) within the area prefix LSA (Intra-Area-Prefix-LSA): The type of LSA spread in the region, has one of the following two functions: with reference to the IPv6 network address prefix with LSA transmitting network (transit network) associated; router LSA, or by reference to the IPv6 address prefix associated with the router. A router can be generated for a given area of ​​the plurality of types of LSA, the link state ID field LSA (Link State ID) to distinguish. DR is the link it represents the generation of one or more type of LSA, the link address prefix advertised to the entire region.

Published 19 original articles · won praise 63 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_44967475/article/details/91410841