路由颜色映射隧道颜色
- 通过 IGP 协议,来发布 SR Label 信息。
- 控制器使用 BGP Link State 收集属性(网络拓扑、网络带宽、时延、标签、……)。控制器根据约束条件计算出符合业务需求的转发路径,然后将算路结果通过 BGP SR Policy 或 PCEP 下发到转发器。也可由工程师手工配置严格转发路径,然后通过 PCEP 将路径托管到控制器。
最早,在光传送领域中,提出 PCEP 协议,但是在 IP Networking 中,PCEP 存在诸多问题(应用少、厂家间互通困难、性能弱、……),所以较少在企业生产网络中部署。进而,在 SR-MPLS Networking 中,推荐使用 BGP SR-Policy 来下发算路结果。
实验过程
基础配置
IP Configuration
IGP / OSPF
SR MPLS TE
隧道配置
隧道的两端都要进行类似如下配置
segment-routing
index 20 sid label xxxx
index 20 sid label xxxx
…
display tunnel-info all // 能看到新创建的两个 Tunnel
ping lsp sr-te policy policy-name // 测试
路由通告
ip vpn-inst foo
rt
ip vpn-inst bar
rt
Tunnel 1
Tunnel 2
acl xxx
acl xxx
route-policy foo
apply ext-commm color 0:100 // 0 为 Flag 位,通常为 0(路由 Color 与 策略 Color 匹配,所以流量得以经过特定路径)
route-policy bar
apply ext-commm color 0:100 // 0 为 Flag 位,通常为 0
bgp
peer x.x.x.x advertis-community // Color 保存在扩展团体属性中
隧道引流
tunnel-policy foo
ip vpn-instance
dispaly ip routtable xxx versbose
dis tunnel-info all
dis tunnel-info tunnel-id xxxx
tracert -vpn-inst -a xx aa
通过 DSCP 映射
segment-route
color 100 match dscp ipv4 40 // 如果 DSCP == 40 则通过 Color 100 进行转发
通过 H3C vSR1000 实验
1)配置 SR BE
mpls lsr-id xxx
// mpls 不需要
seg-rt
ospf 1
seg-rt mpls
seg-rt glb-blk x x
Inteface Tnl
Intefa GE
dis mpls lsp
dis ospf lsdb
dis ospf lsdb opaque or-rt x..xx
Intf GE
dis ospf seg-rt adj
dis mpls tunnel stat…
ip vpn-inst
Interf Lo
bgp
ip vpn-inst xxxxx // 类似 IPv4-family vpn-inst
3)通过 Tunnel 实现 TE
mpls te
ospf
explicat-path x
…
Intf Tul 1 mode mpls-te
mpls te sig-pro sig-rt
dst x.x.x.x
mpls te path perference 10 explica-path xxx
display mpls te tunnel intf tunnel 1
trct mpls te tunnel
dis ip rt-tab vpn-inst xxx // 这里接口直接为 Tunnel,而华为需要静态路由
tunl-policy
4)配置 SR Policy
seg-rt
index 10 mpls label 16004
// default 优选 LSP,所以需要继续进行 Color 关联
// 我们对路由进行着色,使得路由匹配 Color
route-policy
bgp
dis ip rt-tb vpn-inst xxxx