一类
查看R1路由器产生的一类lsa
R1#sho ip ospf database router 91.1.1.1
OSPF Router with ID (91.1.1.1) (Process ID 100)
Router Link States (Area 1)
LS age: 881 //30分钟周期更新,周期更新时间1800s,老化时间3600s;
Options: (No TOS-capability, DC)
LS Type: Router Links --|
Link State ID: 91.1.1.1 --|-- 唯一标识一条lsa
Advertising Router: 91.1.1.1 --|
LS Seq Number: 80000005
Checksum: 0x54FA
Length: 60
Number of Links: 3
Link connected to: a Stub Network //1,描述路由信息
(Link ID) Network/subnet number: 1.1.1.1
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: another Router (point-to-point) //2,描述点对点的邻居关系;3,ma网络中显示为 a Transit Network
(Link ID) Neighboring Router ID: 92.2.2.2
(Link Data) Router Interface address: 12.1.1.1
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 12.1.1.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64
LSA类别名 | 传播范围 | 通告者(更新源) | 携带信息 | link-id |
---|---|---|---|---|
LSA1 router | 本地所在区域 | 本区域每台路由器(RID) | 1,本地直连路由;2,拓扑信息,我是如何和邻居连接的,比如点对点,ma网络 | 通告者的RID |
二类
由于一类LSA不能完整的描述ma网络中的结构,因此需要二类lsa来补充,比如查看R3路由器的一类lsa
R3#sho ip ospf database router 93.3.3.3
OSPF Router with ID (93.3.3.3) (Process ID 100)
Router Link States (Area 0)
LS age: 2014
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 93.3.3.3
Advertising Router: 93.3.3.3
LS Seq Number: 80000006
Checksum: 0x5E65
Length: 72
Number of Links: 4
Link connected to: a Stub Network
(Link ID) Network/subnet number: 3.3.3.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Transit Network
(Link ID) Designated Router address: 34.1.1.2
(Link Data) Router Interface address: 34.1.1.1
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 92.2.2.2
(Link Data) Router Interface address: 23.1.1.2
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 23.1.1.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64
可以通过一类lsa画出拓扑图
我是93.3.3.3,和我连接的一个92.2.2.2的路由器所在网段为23.1.1.0,我有一个3.3.3.0网段的直连路由,我还通过34.1.1.1接口连接了一个DR接口为34.1.1.2的接口,这样是把图的左半部分描述清楚了,但图的右半部分,只知道连接了一个MA网络,连接了一个DR的接口,具体信息是不知道的。因此需要二类lsa描述MA网络中的情况,而二类lsa只能由DR产生,即图中的R4
查看R4的lsa
R4#sho ip ospf database network
OSPF Router with ID (94.4.4.4) (Process ID 100)
Net Link States (Area 0)
Routing Bit Set on this LSA
LS age: 611
Options: (No TOS-capability, DC)
LS Type: Network Links
Link State ID: 34.1.1.2 (address of Designated Router)
Advertising Router: 94.4.4.4
LS Seq Number: 80000004
Checksum: 0x864F
Length: 32
Network Mask: /24
Attached Router: 94.4.4.4
Attached Router: 93.3.3.3
1,描述了ma网络中的掩码/24
2,描述了ma网络中的路由器
加上二类lsa,这个图就可以画完整了
LSA类别名 | 传播范围 | 通告者(更新源) | 携带信息 | link-id |
---|---|---|---|---|
LSA1 router | 本地所在区域 | 本区域每台路由器(RID) | 本地直连拓扑:1,本地直连路由;2,拓扑信息,我是如何和邻居连接的,比如点对点,ma网络 | 通告者的RID |
LSA2 network | 本地所在区域 | DR(RID) | 单个MA网段的拓扑:1,ma网络中的路由器;2,网络掩码 | DR的接口ip地址 |
三类
一类二类完整的描述了一个区域内的拓扑,但是区域外是不知道的,因此需要用三类lsa来描述
三类lsa由ABR产生,描述域间路由
比如在R3上查看三类lsa
R3#sho ip ospf database summary 1.1.1.0
OSPF Router with ID (93.3.3.3) (Process ID 100)
Summary Net Link States (Area 0)
Routing Bit Set on this LSA
LS age: 373
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 1.1.1.0 (summary Network Number)
Advertising Router: 92.2.2.2
LS Seq Number: 80000001
Checksum: 0x880E
Length: 28
Network Mask: /24
TOS: 0 Metric: 65
此条lsa是由R2产生的,我R3要去1.1.1.0网段要找R2,同理,R4也一样,
但在R5上查看三类lsa时
R5#sho ip os database summary 1.1.1.0
OSPF Router with ID (95.5.5.5) (Process ID 100)
Summary Net Link States (Area 2)
Routing Bit Set on this LSA
LS age: 529
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 1.1.1.0 (summary Network Number)
Advertising Router: 94.4.4.4
LS Seq Number: 80000001
Checksum: 0xD874
Length: 28
Network Mask: /24
TOS: 0 Metric: 130
我R5要去1.1.1.0网段找R4,也就是说,三类lsa在整个ospf区域传输,但是经过下一个ABR时,adv router会被修改为新的ABR的rid
这样就是 R5去1.1.1.0找R4,R4去1.1.1.0找R2,R2通过一类lsa知道如何去1.1.1.0网段
LSA类别名 | 传播范围 | 通告者(更新源) | 携带信息 | link-id |
---|---|---|---|---|
LSA3 summary | 整个OSPF域 | ABR (RID) 在经过下一个ABR时,修改为新的ABR-route-id | O IA 域间路由 | O IA路由目标(网络号,或者说要到达的网段) |
五类
一二三类lsa描述了所有ospf区域的拓扑,但是不能描述ospf区域外的路由信息,这就由五类lsa来完成
因此,五类lsa由ASBR产生
在这里,在R5和R6之间运行eigrp协议,并将外部路由重发布进ospf
R5(config)#router ospf 100
R5(config-router)#redistribute eigrp 100 subnets //subnets表示重发布所有路由,不加的话只重发布主类路由
查看R5的五类lsa
R5#sho ip ospf database external 6.6.6.0
OSPF Router with ID (95.5.5.5) (Process ID 100)
Type-5 AS External Link States
LS age: 348
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 6.6.6.0 (External Network Number )
Advertising Router: 95.5.5.5
LS Seq Number: 80000001
Checksum: 0x4BD4
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0
将外部路由引入ospf会有一个种子度量值,将eigrp的路由已进入ospf的种子度量值是20,并且为类型2,类型2的路由沿途传播时不增加度量值,例如,我在R1上查看这条6.6.6.0的路由时
6.0.0.0/24 is subnetted, 1 subnets
O E2 6.6.6.0 [110/20] via 12.1.1.2, 00:09:01, Serial1/1
类型为 OSPF,域外路由,类型2,故 O E2,metric值依然为20,而类型一则会累加度量值
LSA类别名 | 传播范围 | 通告者(更新源) | 携带信息 | link-id |
---|---|---|---|---|
LSA5 External | 整个OSPF域 | ASBR(协议边界路由器),传递过程中不修改rid,因为ABR不可替代ASBR | O E1/2 域外路由(重发布) | O E 路由目标 |
四类
在R4上查看五类lsa
R4#sho ip ospf database external 6.6.6.0
OSPF Router with ID (94.4.4.4) (Process ID 100)
Type-5 AS External Link States
Routing Bit Set on this LSA
LS age: 1546
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 6.6.6.0 (External Network Number )
Advertising Router: 95.5.5.5
LS Seq Number: 80000003
Checksum: 0x47D6
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0
可以看到,我R4要去6.6.6.0网段,可以找R5
查看R1的五类lsa
R1#sho ip ospf database external 6.6.6.0
OSPF Router with ID (91.1.1.1) (Process ID 100)
Type-5 AS External Link States
Routing Bit Set on this LSA
LS age: 1632
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 6.6.6.0 (External Network Number )
Advertising Router: 95.5.5.5
LS Seq Number: 80000003
Checksum: 0x47D6
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0
我们发现,R1要去6.6.6.0还是要找R5,可是R1和R5根本不在同一区域,R1是不知道R5位置的,也可以看出来五类lsa在传递过程中是不修改rid的,因此就必须有人要告知所有路由器ASBR的位置,这个任务交给R4完成,也就是ASBR所在区域的ABR来产生四类lsa,用于告知ASBR的位置,
在R4上查看四类lsa
R4#sho ip ospf database asbr-summary
OSPF Router with ID (94.4.4.4) (Process ID 100)
Summary ASB Link States (Area 0)
LS age: 1943
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(AS Boundary Router)
Link State ID: 95.5.5.5 (AS Boundary Router address)
Advertising Router: 94.4.4.4
LS Seq Number: 80000003
Checksum: 0xD64A
Length: 28
Network Mask: /0
TOS: 0 Metric: 64
即R4告知其他路由器,你要找95.5.5.5,你要先找到我94.4.4.4,我帮你转发
在查看R1的四类lsa
R1#sho ip ospf database asbr-summary
OSPF Router with ID (91.1.1.1) (Process ID 100)
Summary ASB Link States (Area 1)
Routing Bit Set on this LSA
LS age: 52
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(AS Boundary Router)
Link State ID: 95.5.5.5 (AS Boundary Router address)
Advertising Router: 92.2.2.2
LS Seq Number: 80000004
Checksum: 0x9D49
Length: 28
Network Mask: /0
TOS: 0 Metric: 129
即R1要找95.5.5.5,你要先找到我R2,我R4找到R4,R4知道R5的位置,即,要去6.6.6.0网段,流量先给R2,R2给R4,R4给R5,R5给R6。
可以看出,四类lsa在传播过程中会修改rid
LSA类别名 | 传播范围 | 通告者(更新源) | 携带信息 | link-id |
---|---|---|---|---|
LSA4 asbr-summary | 除ASBR所在区域外的整个OSPF域 | ABR(ASBR所在区域的ABR) 在经过下一个ABR时,修改为新的rid | ASBR的位置 | ASBR的RID |
总结
LSA类别名 | 传播范围 | 通告者(更新源) | 携带信息 | link-id |
---|---|---|---|---|
LSA1 router | 本地所在区域 | 本区域每台路由器(RID) | 本地直连拓扑:1,本地直连路由;2,拓扑信息,我是如何和邻居连接的,比如点对点,ma网络 | 通告者的RID |
LSA2 network | 本地所在区域 | DR(RID) | 单个MA网段的拓扑:1,ma网络中的路由器;2,网络掩码 | DR的接口ip地址 |
LSA3 summary | 整个OSPF域 | ABR (RID) 在经过下一个ABR时,修改为新的ABR-route-id | O IA 域间路由 | O IA路由目标 |
LSA4 asbr-summary | 除ASBR所在区域外的整个OSPF域 | ABR(ASBR所在区域的ABR)在经过下一个ABR时,修改为新的rid | ASBR的位置 | ASBR的RID |
LSA5 External | 整个OSPF域 | ASBR(协议边界路由器),传递过程中不修改rid,因为ABR不可替代ASBR | O E1/2 域外路由(重发布) | O E 路由目标 |
七类
❤️ 将会在ospf特殊区域写到