• 浅析SR隧道路径批量构造方法


    为什么要仿真PCE LSP下发隧道路径?

    在大型的多区域网络中,路径计算非常复杂。在某些场景下,为了完成路径计算,需要在控制器上部署特殊的计算组件,并需要不同区域中的节点之间协作。这使得网元在进行路径计算时效率低,还会降低网元本身的转发性能。
    PCE最早是为了解决大型的多区域网络路径计算问题而被提出,通过PCE可以为TE计算跨域路径。如下图所示,PCEP网络包含如下3个部分:

    • PCE(Path ComputationElement,路径计算单元):PCE是能够基于网络拓扑信息计算满足约束的路径的部件。PCE可以部署在路由设备中,也可以部署在一个独立的服务器中。大多数时候,PCE和控制器是集成在一起的。
    • PCC(Path ComputationClient,路径计算客户端):PCC是请求路径计算单元执行路径计算的客户端应用程序。PCC向PCE发送路径请求,并接受PCE返回的路径计算结果。一般情况下,路由设备集成了PCC功能,可以认为路由设备就是PCC。
    • PCEP(Path ComputationElementProtocol,路径计算单元通信协议):PCEP是PCE和PCC、PCE和PCE之间的通信协议。
      图1 应用拓扑
      在这里插入图片描述

    自动化生成PCE LSP能解决什么问题?

    使用仪表模拟PCE时,需要手工创建PCE LSP,并且涉及转发路径标签的确定,Adj-Sid在每次建立SR邻居时都是随机分配标签值,创建隧道路径又必须明确标签值,在创建大量的隧道路径情况下,使用自动化读取SR隧道数据方法创建PCE LSP可节省大量仪表配置精力。

    如何使用自动化构造PCE LSP

    信而泰Renix平台提供了python API接口,可使用python API进行PCE LSP灵活定义。假设业务如下所示:

    • SR-TE单板转发性能:创建ISIS SR-TE业务

    • PCEP隧道托管:DUT与仪表之间建立SR-TE隧道,并把其中4000条隧道路径托管到PCE。
      图2 实验拓扑
      本文选择基础API使用信而泰API(renix_py_api、MiscLibrary),不另做定义,使用时需安装相关环境。代码解析如下:

    • 导入相关库:
      from renix_py_api.renix import *
      import logging
      import pandas as pd

    • 初始化:initialize为仪表初始化
      initialize(log=True,log_level=logging.INFO,log_handle=LogHandle.LOG_FILE)
      chassis_DY = “10.1.1.7”
      port_DY_1 = “//10.1.1.7/3/1”
      path = ‘D:\pcep\pceplsp.xls’
      data = pd.DataFrame(pd.read_excel(path))
      tunnelnum = 16000
      pcelspnum = 4000
      创建自动化前需收集隧道路径参数,格式如下表所示(提供前10供参考,本实验共计250条路径用于承载vpnv4流量,250条路径用于承载6vpe流量):
      在这里插入图片描述

    • 创建仪表基本配置
      sys_entry = get_sys_entry()
      sys_entry.edit(ProductType=1)
      chassis = ConnectChassisCommand(chassis_DY)
      chassis.execute()
      port_location = (‘//10.1.1.7/3/1’)
      port_1 = Port(upper=sys_entry, Location=port_location[0], name=‘port_1’)
      BringPortsOnlineCommand(PortList=[port_1.handle]).execute()

    • 配置pcep
      interface_1 = Interface(upper=port_1)
      build_ipv4_ipv6 = BuildInterfaceCommand(InterfaceList=‘Interface_1’, NetworkLayers=‘eth’, TopLayers=[‘ipv4’, ‘ipv6’])
      build_ipv4_ipv6.execute()
      eth_layer = interface_1.get_children(‘EthIILayer’)[0]
      eth_layer.edit(Address=‘00:10:99:00:00:01’)
      ipv4_layer = interface_1.get_children(‘Ipv4Layer’)[0]
      ipv4_layer.edit(Address=‘12.5.20.2’, Step=‘0.0.0.1’, Count=‘1’, Gateway=‘12.5.20.1’)
      ipv6_layer = interface_1.get_children(‘Ipv6Layer’)[0]
      ipv6_layer.edit(Address=‘12:5:14::2’, Step=‘::1’, Count=‘1’, Gateway=‘12:5:14::1’)
      PcepSession = PcepProtocolConfig(upper=port_1)
      PcepSession.edit(UseGatewayAsDutIp=False)
      PcepSession.edit(PeerIpv4Address=“10.48.48.1”)
      select_interface_1=SelectInterfaceCommand(ProtocolList=[PcepSession.handle], InterfaceList=[interface_1.handle])
      select_interface_1.execute()

    • 配置PCE LSP,根据Excel循环创建
      tunnelperpeer = int(tunnelnum/250)
      counter = 4000
      for x in range(250):
      for y in range(tunnelperpeer):
      PceLsp = PceLspConfig(upper=PcepSession)
      SymbolicName = ‘Tunnel’+str(x*tunnelperpeer+(y+1))
      PceLsp.edit(SymbolicName=SymbolicName)
      SourceIP = data.loc[x][1]
      PceLsp.edit(SourceIpv4Address=SourceIP)
      DestIP = data.loc[x][2]
      PceLsp.edit(DestinationIpv4Address=DestIP)
      PcepSrEroObject = PcepSrEroObjectConfig(upper=PceLsp)
      PcepSrEroSubObject = PcepSrEroSubObjectConfig(upper=PcepSrEroObject)
      PcepSrEroSubObject.edit(NaiType=3)
      PcepSrEroSubObject.edit(FFlag=True)
      Adjsid = int(data.loc[x][3])
      PcepSrEroSubObject.edit(SidLabel=Adjsid)
      PcepSrEroSubObject = PcepSrEroSubObjectConfig(upper=PcepSrEroObject)
      PcepSrEroSubObject.edit(NaiType=1)
      PcepSrEroSubObject.edit(FFlag=True)
      Nodesid = int(data.loc[x][4])
      PcepSrEroSubObject.edit(SidLabel=Nodesid)
      counter -=1
      if counter == 0:
      break
      if counter == 0:
      break

    • 保存Renix平台对应XCFG文件
      save_case = SaveTestCaseCommand(TestCase=‘D:\pcep\pcep.xcfg’, ProductType=1)
      save_case.execute()

    • 执行生成配置文件效果(PCE LSPs)
      在这里插入图片描述

    • PCE LSP对应路径(ERO Object)
      在这里插入图片描述

    DarYu-X系列测试仪

    DarYu-X系列高性能网络测试仪是信而泰推出的面向高端路由器等高端数通设备的测试产品,具有高性能、高密度、高速率等特点,配置信而泰基于PCT架构的新一代测试软件RENIX和X2系列测试模块,可为提供路由高效组网测试解决方案,为建立一张高SLA保证、确定性时延、业务感知、灵活业务路径调优的下一代网络保驾护航。

  • 相关阅读:
    打开英雄联盟缺少d3dcompiler_43.dll有哪些处理方法
    Gbase8s数据库ALTER INDEX 语句
    html静态网页设计制作 HTML我的家乡沧州网页代码 dw静态网页成品模板素材网页 web前端网页设计与制作 div静态网页设计
    svn入门到精通
    【基础】填涂颜色
    基于SpringBoot的企业部门与员工管理系统,毕设、课设资源包,附送项目源码和数据库脚本
    驱动开发:摘除InlineHook内核钩子
    Property和Attribute的区别
    CAN报文:数据帧详解
    【Opencv实战】识别水果的软件叫什么?一款超好用的识别软件分享,一秒鉴定(真是活~久~见~啊)
  • 原文地址:https://blog.csdn.net/XINERTEL/article/details/134329473