QPPB-QOS policy propagation for BGP

传统的qos更容易对某一类流量在接口上进行处理, 而QPPB可以基于路由来做,相对传统的qos更灵活。即在某入接口进行分类,去往某条路由或者匹配某些源;在出接口做一些Qos的action。

参考博客:

https://community.cisco.com/t5/service-providers-documents/asr9000-xr-implementing-qos-policy-propagation-for-bgp-qppb/ta-p/3136639

配置步骤

  • 定义路由策略(匹配的路由)
  • 将路由策略附加到 BGP 实例
  • 将 QPPB 应用到 Ingress 接口
  • 配置出口 QoS 服务策略

示例如下:

#定义路由策略(匹配的路由)

route-policy set_qos
  if destination in (8.8.8.8/32) then
    set qos-group 1
  elseif source in (200.200.200.200) then   
    set qos-group 2
  else
    set qos-group 3
  endif
  pass
end-policy

#将路由策略附加到 BGP 实例

router bgp 1
 bgp router-id 10.1.1.1
 address-family ipv4 unicast
  table-policy set_qos    <<<<<<<
 !
 neighbor 10.1.12.2
  remote-as 200
  address-family ipv4 unicast
   route-policy pass in
   route-policy pass out
  !
 !
!
#将 QPPB 应用到 Ingress 接口

interface TenGigE0/1/0/0
 ipv4 bgp policy propagation input qos-group destination     <<<<<<  destination/source
 ipv4 address 100.1.1.1 255.255.255.0
 load-interval 30
!

RP/0/RSP0/CPU0:ASR-9906-A#show run int be 100.100
Thu Jul  1 15:49:05.074 UTC
interface Bundle-Ether100.100
 service-policy output QOS
 ipv4 address 10.1.12.1 255.255.255.0
 load-interval 30
 encapsulation dot1q 100
!

#配置出口 QoS 服务策略
RP/0/RSP0/CPU0:ASR-9906-A#show run policy-map QOS 
Thu Jul  1 15:49:12.454 UTC
policy-map QOS
 class qos1
  police rate 100 mbps 
  ! 
 ! 
 class qos2
  police rate 200 mbps 
  ! 
 ! 
 class qos3
  police rate 300 mbps 
  ! 
 ! 
 class class-default
 ! 
 end-policy-map

QPPB实际的用途

参考Frank的博客:

http://www.zhaocs.info/bgp-design-1.html

例如,如果AS200 有两种业务,我们想在AS1到AS200的互联link BE100.100 做区分服务,给9.9.9.9/32 多点带宽, 那么我们就可以在AS1路由器上做基于目的(destination)的QPPB, 即为分别为8.8.8.8/32,9.9.9.9/32 set 不通的qos-group, 在出接口BE100.100 针对不同的qos-group设置不同的带宽。

测试如下:

!!!!!!! 配置参考如上  !!!!!!!

流量测试仪产生一条目的地址为9.9.9.9的流量通过Ten0/1/0/0 送到AS1 router.
9.9.9.9/32的路由会被table-policy设置qos-group的属性, 下发到cef表中, 通过show cef x.x.x.x/x detial 查看

RP/0/RSP0/CPU0:ASR-9906-A#show cef 9.9.9.9/32 detail       
Thu Jul  1 16:07:55.573 UTC
9.9.9.9/32, version 209159, internal 0x5000001 0x0 (ptr 0x7447a990) [1], 0x0 (0x0), 0x0 (0x0)
 Updated Jul  1 09:53:56.844
 Prefix Len 32, traffic index 0, precedence n/a, priority 15
 QoS Group: 3     <<<<<<<<<
   gateway array (0x73fc7ad8) reference count 2, flags 0x2010, source rib (7), 0 backups
                [1 type 3 flags 0x48441 (0x73ffb180) ext 0x0 (0x0)]
                

RP/0/RSP0/CPU0:ASR-9906-A#monitor  int tenGigE 0/1/0/0 be 100.100
Thu Jul  1 16:09:09.776 UTC
ASR-9906-A           Monitor Time: 00:00:02          SysUptime: 187:38:33

Protocol:General
Interface             In(bps)      Out(bps)     InBytes/Delta  OutBytes/Delta
Te0/1/0/0            983.0M/  9%        0/  0%     2.9T/245.8M   152133/0     
BE100.100                 0/  0%   308.8M/  0%     2.7M/0        520.4G/0           <<<<<<< 流量出向被限速到300M

还例如, 有两个数据中心,都需要通过AS1访问AS200, 但是BE100.100 链路带宽有限,所以BE100.100的带宽使用上需要对源地址进行个区分, 来自数据中心A的prefix和来自B的prefix分别设置不同的qos-group, 在BE100.100 出方向上进行限速操作。由于是对源地址进行区分, 这里需要在AS1 连接router A/B的两个接口上做基于源的QPPB。

测试如下:

!!!!!!!!   配置修改如下    !!!!!!!!!

以Ten0/1/0/0 接口为例:

RP/0/RSP0/CPU0:ASR-9906-A#show run int tenGigE 0/1/0/0
Thu Jul  1 16:24:00.342 UTC
interface TenGigE0/1/0/0
 ipv4 bgp policy propagation input qos-group source     <<<<< source
 ipv4 address 100.1.1.1 255.255.255.0
 load-interval 30
 
 ####   BGP的相关配置也要进行一定的修改, 使得AS1 分别总router A/B 学到两条不一样的路由, 这里就不做展示
 
测试仪再产生一条流量源地址为8.8.8.8, 数据中心A的地址, 目的为AS200 内通告的地址。

流量到Ten0/1/0/0 会检查源地址的cef表象看被标记为哪一种Qos-group:

RP/0/RSP0/CPU0:ASR-9906-A#show cef 8.8.8.8/32 detail         
Thu Jul  1 16:27:57.372 UTC
8.8.8.8/32, version 209152, internal 0x5000001 0x0 (ptr 0x744777e0) [1], 0x0 (0x0), 0x0 (0x0)
 Updated Jul  1 09:12:08.133
 Prefix Len 32, traffic index 0, precedence n/a, priority 4
 QoS Group: 1      <<<<<<<<
  gateway array (0x73fc7ad8) reference count 2, flags 0x2010, source rib (7), 0 backups
  
  
接着会根据目的地址,进行路由转发到BE100.100 进行Qos策略:

RP/0/RSP0/CPU0:ASR-9906-A#monitor  int tenGigE 0/1/0/0 be 100.100                        
Thu Jul  1 16:29:27.060 UTC
ASR-9906-A           Monitor Time: 00:00:02          SysUptime: 187:58:50

Protocol:General
Interface             In(bps)      Out(bps)     InBytes/Delta  OutBytes/Delta
Te0/1/0/0            983.1M/  9%        0/  0%     3.1T/245.9M   159636/0     
BE100.100                 0/  0%    96.0M/  0%     2.9M/0        557.7G/0         <<<<<<<<< 限速100M
           

No comments

Comments feed for this article

Reply

Your email address will not be published. Required fields are marked *