RFC2328 附录E 设定Link State ID的一种算法 – [An algorithm for assigning Link State IDs] 中英文对照&备注

E       设定Link State ID的一种算法 – [An algorithm for assigning Link State IDs][任1] 

AS-external-LSASummary-LSA中的Link State ID通常被设定为所描述的网络IP地址。但是,有时需要在Link State ID中加上一位或多位主机位。这使得路由器可以为拥有相同网络地址但不同掩码的网络生成不同的LSA。当网络中存在超网和零子网时会出现这种情况(见[引用10])。 

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]).

 

本附录给出了在Link State ID中加上主机位的一种可行算法。算法的选择是独立的,因为仅对路由器自己生成的LSA起作用,所以不同的路由器可以选择不同的算法。所必须的是,应当竟可能得将Link State ID设定为网络IP地址,这将与早先根据RFC 1583的实现达到最大互通。

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.

 

下面的算法是以AS-external-LSA为例的。这仅仅是为了描述的明确,完全相同的算法可以用于Summary-LSA。假设路由器要为一个网络生成AS-external-LSA,其地址为NA,掩码为NM1。使用下面的步骤来决定该LSALink State ID

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:

 

(1)      检查路由器是否已经生成了一个AS-external-LSA,其Link State ID等于NALSA中该路由器为LSA的宣告路由器)。如果没有,设定Link State IDNA,并终止算法。否则,

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,

 

(2)      取得已经存在AS-external-LSANetwork Mask,称其为NM2。有两种情况:

Obtain the network mask from the body of the already existing AS-external-LSA. Call this mask NM2. There are then two cases:

 

NM1NM2要长(即更精确)。这时,设定表示网络[NA,NM1]的新LSALink State ID为全部主机位(即等于NA加上NM1的反掩码,也就是网络[NA,NM1]的广播地址)。

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).

 

NM2NM1要长。通过增加序列号,使已存在的LSA(其LS标识为NA)改为表示新的网络[NA,NM1],改变LSA体中的掩码为NM1,并设定新的距离值。然后为旧网络[NA,NM2]生成新的LSA,设定其LS标识为NA加上NM2的反码(即网络[NA,NM2]的广播地址)。 

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, 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).

 

上面的算法假设所有的掩码是连续的,当两个网络有相同的网络地址时,可以确保一个掩码比另一个更精确。该算法同时假设一个网络的网络地址不会等于另一个网络的广播地址。在满足上面两个假设时,上述算法始终能生成唯一的Link State ID。上面的算法也可以表述如下:当生成AS-external-LSA时,首先试图将其Link State ID设定为网络地址。如果有冲突,检查所冲突的两个网络,其中一个网络将是另一个的子网。对于不精确的网络,设定Link State ID为网络地址;而较精确的网络则使用该网络的广播地址(即主机位全1)。如果先生成的是较精确的网络,则需要同时生成两个LSA[任2] 

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.

 

作为该算法的例子,考虑在一台路由器(路由器A)上发生的一系列事件。[任3] 

As an example of the algorithm, consider its operation when the following sequence of events occurs in a single router (Router A).

 

1)路由器A为网络[10.0.0.0,255.255.255.0]生成AS-external-LSA

a)使用10.0.0.0作为Link State ID[任4] 

2)路由器A又要为网络[10.0.0.0,255.255.0.0]生成AS-external-LSA

a)为网络[10.0.0,0,255.255.255.0]重新生成新的Link State ID10.0.0.255

b)网络[10.0.0.0,255.255.0.0]使用Link State ID 10.0.0.0[任5] 

3)路由器A又要为网络[10.0.0.0,255.0.0.0]生成AS-external-LSA

a)为网络[10.0.0,0,255.255.0.0]重新生成新的LS标识为10.0.255.255

b)网络[10.0.0.0,255.0.0.0]使用LS标识10.0.0.0

c)网络[10.0.0.0,255.255.255.0]仍旧使用LS标识10.0.0.255[任6] 

 

(1)      Router A wants to originate an AS-external-LSA for [10.0.0.0,255.255.255.0]:

(a)           A Link State ID of 10.0.0.0 is used.

(2)      Router A then wants to originate an AS-external-LSA for [10.0.0.0,255.255.0.0]:

(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.

(b)           A Link State ID of 10.0.0.0 is used for [10.0.0.0,255.255.0.0].

(3)      Router A then wants to originate an AS-external-LSA for [10.0.0.0,255.0.0.0]:

(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.

(b)           A Link State ID of 10.0.0.0 is used for [10.0.0.0,255.0.0.0].

(c)           The network [10.0.0.0,255.255.255.0] keeps its Link State ID of 10.0.0.255.


 [任1]该附录主要讲了Link State ID的设定

ENSP实验编号:00004

OneNoteRFC2328 AppendixE支持问题的分析

 [任2]总结

 [任3]NA:10.0.0.0

NM1255.255.255.0

NM2255.255.0.0

NM3255.0.0.0

 [任4]检查路由器没有生成Link State ID10.0.0.0AS-external-LSA,则设定Link State ID10.0.0.0

 [任5]检查路由器已经生成了一个Link State ID10.0.0.0AS-external-LSA,其掩码为255.255.255.0,比NM2255.255.0.0要长,

通过增加序列号,使已存在的Link State ID10.0.0.0LSA改为表示新的网络[10.0.0.0,255.255.0.0],改变LSA体中的掩码为255.255.0.0,并设定新的cost值。然后为[10.0.0.0,255.255.255.0]生成新的LSA,设定其Link State ID10.0.0.0加上255.255.255.0的反掩码(即网络[10.0.0.0,255.255.255.0]的广播地址:10.0.0.255)。 

 [任6]检查路由器已经生成了一个Link State ID10.0.0.0AS-external-LSA,其掩码为255.255.0.0,比NM3255.0.0.0要长,通过增加序列号,使已存在的Link State ID10.0.0.0LSA改为表示新的网络[10.0.0.0,255.0.0.0],改变LSA体中的掩码为255.0.0.0,并设定新的cost值。然后为[10.0.0.0,255.255.0.0]生成新的LSA,设定其Link State ID10.0.0.0加上255.255.0.0的反掩码(即网络[10.0.0.0,255.255.0.0]的广播地址:10.0.255.255)。

posted @ 2018-06-28 15:41  Rjzr  阅读(422)  评论(0编辑  收藏  举报