「SR-MPLS-TE-POLICY」- 配置案例

路由颜色映射隧道颜色

  1. 通过 IGP 协议,来发布 SR Label 信息。
  2. 控制器使用 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

segment-list foo
index 10 sid label xxxx

index 20 sid label xxxx
segment-list bar
index 10 sid label xxxx

index 20 sid label xxxx

sr-te policy “p1” endpoint x.x.x.x color 100
candidate-path perferance 200
seg-list foo
sr-te policy “p2” endpoint x.x.x.x color 200
candidate-path perferance 200
seg-list bar

display tunnel-info all // 能看到新创建的两个 Tunnel
ping lsp sr-te policy policy-name // 测试

路由通告

ip vpn-inst foo

rd

rt

ip vpn-inst bar

rd

rt

Tunnel 1

ip bind vpn-inst foo

Tunnel 2

ip bind vpn-inst bar

acl xxx

rule permait source x.x.x.x 0

acl xxx

rule permait source x.x.x.x 0

route-policy foo

if-match acl

apply ext-commm color 0:100 // 0 为 Flag 位,通常为 0(路由 Color 与 策略 Color 匹配,所以流量得以经过特定路径)

route-policy bar

if-match acl

apply ext-commm color 0:100 // 0 为 Flag 位,通常为 0

bgp

vpnv4 family
peer x.x.x.x route … rt-policy foo

peer x.x.x.x advertis-community // Color 保存在扩展团体属性中
vpn-inst family
import-xxxx

隧道引流

tunnel-policy foo

tunnel select-seq sr-te-policy xxx unmix

ip vpn-instance

tnl-plociuy foo

dispaly ip routtable xxx versbose

TUNNEL-ID

dis tunnel-info all

dis tunnel-info tunnel-id xxxx

tracert -vpn-inst -a xx aa

通过 DSCP 映射

segment-route

sr-te-policy group 1
endpoint x..x.x

color 100 match dscp ipv4 40 // 如果 DSCP == 40 则通过 Color 100 进行转发

通过 H3C vSR1000 实验

1)配置 SR BE

mpls lsr-id xxx
// mpls 不需要

seg-rt
ospf 1

opaque-cap enable

seg-rt mpls

seg-rt glb-blk x x

Inteface Tnl

ospf 1 prefix-sid index 1

Intefa GE

mpls enable

dis mpls lsp
dis ospf lsdb
dis ospf lsdb opaque or-rt x..xx

Intf GE

ospf adj-sid index 21 // 配置产生 Adj SID

dis ospf seg-rt adj

dis mpls tunnel stat…

ip vpn-inst
Interf Lo

ip bind vpn-inst

bgp

address-family vpnv4

ip vpn-inst xxxxx // 类似 IPv4-family vpn-inst
address-family ipv4 unicat

3)通过 Tunnel 实现 TE

mpls te
ospf

mpls te enable

explicat-path x

nextsid label 16002 type prefix

Intf Tul 1 mode mpls-te

ip add umumber lo0

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

select-seq …

4)配置 SR Policy

seg-rt

traffic-eng TE1
segment-list foo
index 1 mpls label 16002

index 10 mpls label 16004
policy foo
color 100 end-point ipv4 x.x.x.x
candiadate-path
preference 200
explicit segment-list foo
preference 100
explicait segmnt-list bar weight xxxx

// default 优选 LSP,所以需要继续进行 Color 关联
// 我们对路由进行着色,使得路由匹配 Color

route-policy

apply extcomm color 01:100 // 01 是 CO 值

bgp

peer xxx rout-policy xxx

dis ip rt-tb vpn-inst xxxx

TE1 // 能看到路由使用 Tnl 作为出接口,原因是路由着色,与 Color 匹配,所以通过 TE 转发