控制平面:路由
- 没有RIB(路由表),不会进行LDP(标签分发)
- LDP相当于路由协议,LIB相当于路由表
- 当控制平面有了路由表,可以下发到转发平面的RIB
Ingress
(入栈点)—>Transit
(转发栈点)—>Egress
(出栈点)实验:如下拓扑
#
sysname R1
#
interface GigabitEthernet0/0/0
ip address 10.1.12.1 255.255.255.0
ospf enable 1 area 0.0.0.0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
ospf enable 1 area 0.0.0.0
#
ospf 1
area 0.0.0.0
#
sysname R2
#
interface GigabitEthernet0/0/0
ip address 10.1.12.2 255.255.255.0
ospf enable 1 area 0.0.0.0
#
interface GigabitEthernet0/0/1
ip address 10.1.23.2 255.255.255.0
ospf enable 1 area 0.0.0.0
#
ospf 1
area 0.0.0.0
#
sysname R3
#
interface GigabitEthernet0/0/0
ip address 10.1.23.3 255.255.255.0
ospf enable 1 area 0.0.0.0
#
interface GigabitEthernet0/0/1
ip address 10.1.34.3 255.255.255.0
ospf enable 1 area 0.0.0.0
#
ospf 1
area 0.0.0.0
#
sysname R4
#
interface GigabitEthernet0/0/0
ip address 10.1.34.4 255.255.255.0
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
#
ospf 1
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 10.1.34.4 0.0.0.0
[R1]mpls lsr-id 1.1.1.1
[R1]mpls //开启MPLS协议
--------------------------------
[R2]mpls lsr-i
[R2]mpls lsr-id 2.2.2.2
--------------------------------
[R3]mpls ls
[R3]mpls lsr-id 3.3.3.3
--------------------------------
[R4]mpls lsr
[R4]mpls lsr-id 4.4.4.4
- 静态LSP中lsr-id可以随便指定,即使本地没有这个地址,但是必须配
- 需要配置两条LSP,一去一回
# R1配置静态LSP,角色为ingress,名字为1-4,目的为4.4.4.4,下一跳是10.1.12.2,出标签为102
[R1]static-lsp ingress 1-4 destination 4.4.4.4 32 nexthop 10.1.12.2 out-label 102
# R2配置静态LSP,角色为transit,名字为1-4,进接口为g0/0/0,进标签为102,下一跳为10.1.23.3,出标签为203
[R2]static-lsp transit 1-4 incoming-interface g0/0/0 in-label 102 nexthop 10.1.23.3 out-label 203
# R3配置静态LSP,角色为transit,名字为1-4,进接口为g0/0/0,进标签为203,下一跳为10.1.34.4,出标签为304
[R3]static-lsp transit 1-4 incoming-interface g0/0/0 in-label 203 nexthop 10.1.34.4 out-label 304
# R4配置静态LSP,角色为egress,名字为1-4,进接口为g0/0/0,进标签为304
[R4]static-lsp egress 1-4 incoming-interface g0/0/0 in-label 304
[R4]static-lsp ingress 4-1 destination 1.1.1.1 32 nexthop 10.1.34.3 out-label 403
[R3]static-lsp transit 4-1 incoming-interface g0/0/1 in-label 403 nexthop 10.1.23.2 out-label 302
[R2]static-lsp transit 4-1 incoming-interface g0/0/1 in-label 302 nexthop 10.1.12.1 out-label 201
[R1]static-lsp egress 4-1 incoming-interface g0/0/0 in-label 201
配好LSP后,还需要在接口下开启MPLS才可以互通
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]mpls
------------------------------------------
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]mpls
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]mpls
------------------------------------------
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]mpls
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]mpls
------------------------------------------
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]mpls
[R1]ping lsp -a 1.1.1.1 ip 4.4.4.4 32
- 决定是IP转发还是走隧道转发看TunnelID
- 当TunnelID为0x0时,走IP转发
- 当TunnelID不为0x0时,走隧道转发,具体走那个隧道看TunnelID对应的隧道
由传输IP地址大的一方发起TCP连接
下游自主
下游按需
- 华为设备默认采用DU的方式发布标签
- DU无需等待上游的请求消息,直接向邻居分配标签
- 网络拓扑发生变化时,DU方式收敛时间更短
独立标签分配控制方式
有序标签分配控制方式
自由标签保持方式
保守标签保持方式
- 华为设备默认使用自由标签保持方式保存标签
- 华为默认使用的搭配:发布方式使用DU(下游自主方式),控制方式使用Ordered(有序标签分配控制方式),保持方式使用Liberal(自由标签保持方式)
标签0-15不能使用
实验:如下拓扑图
#
sysname R1
#
interface GigabitEthernet0/0/0
ip address 10.1.12.1 255.255.255.0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
-----------------------------------------
#
sysname R2
#
interface GigabitEthernet0/0/0
ip address 10.1.12.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.1.23.2 255.255.255.0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
-----------------------------------------
#
sysname R3
#
interface GigabitEthernet0/0/0
ip address 10.1.23.3 255.255.255.0
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
# R1
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 10.1.12.1 0.0.0.0
-----------------------------------------
# R2
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 10.1.12.2 0.0.0.0
network 10.1.23.2 0.0.0.0
-----------------------------------------
# R3
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 10.1.23.3 0.0.0.0
[R1]mpls lsr-id 1.1.1.1
[R1]mpls
Info: Mpls starting, please wait... OK!
[R1-mpls]mpls ld
[R1-mpls-ldp]int g0/0/0
[R1-GigabitEthernet0/0/0]mpls
[R1-GigabitEthernet0/0/0]mpls ldp
[R2]mpls lsr-id 2.2.2.2
[R2]mpls
Info: Mpls starting, please wait... OK!
[R2-mpls]mpls ld
[R2-mpls-ldp]int g0/0/0
[R2-GigabitEthernet0/0/0]mpls
[R2-GigabitEthernet0/0/0]mpls ldp
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]mpls
[R2-GigabitEthernet0/0/1]mpls ldp
[R3]mpls lsr-id 3.3.3.3
[R3]mpls
Info: Mpls starting, please wait... OK!
[R3-mpls]mpls ld
[R3-mpls-ldp]int g0/0/0
[R3-GigabitEthernet0/0/0]mpls
[R3-GigabitEthernet0/0/0]mpls ldp
以上内容均属原创,如有不详或错误,敬请指出。