Movatterモバイル変換


[0]ホーム

URL:


WO2025050814A1 - Traffic determination method and apparatus, electronic device, and storage medium - Google Patents

Traffic determination method and apparatus, electronic device, and storage medium
Download PDF

Info

Publication number
WO2025050814A1
WO2025050814A1PCT/CN2024/104378CN2024104378WWO2025050814A1WO 2025050814 A1WO2025050814 A1WO 2025050814A1CN 2024104378 WCN2024104378 WCN 2024104378WWO 2025050814 A1WO2025050814 A1WO 2025050814A1
Authority
WO
WIPO (PCT)
Prior art keywords
traffic
routing
target
information
flow
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2024/104378
Other languages
French (fr)
Chinese (zh)
Inventor
叶方丹
袁驿飞
翟恩南
杨睿震
朱晓波
马卿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou AliCloud Feitian Information Technology Co Ltd
Original Assignee
Hangzhou AliCloud Feitian Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou AliCloud Feitian Information Technology Co LtdfiledCriticalHangzhou AliCloud Feitian Information Technology Co Ltd
Publication of WO2025050814A1publicationCriticalpatent/WO2025050814A1/en
Pendinglegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Definitions

Landscapes

Abstract

The present application relates to the technical field of networks, and provides a traffic determination method and apparatus, a system, an electronic device, and a storage medium. The method comprises: on the basis of routing information of a target network, constructing a traffic distribution diagram for multiple target data streams flowing into the target network, wherein the routing information comprises information used for determining a data stream forwarding state, one node in the traffic distribution diagram represents one forwarding state of one target data stream, and the forwarding state comprises a current address and next-hop information; and using the traffic on connection edges between nodes in the traffic distribution diagram to determine the traffic on transmission links between routing devices in the target network. According to the technical solution provided in the embodiments of the present application, the traffic level distribution of transmission links in a network topology can be quickly and accurately obtained.

Description

Translated fromChinese
流量确定方法、装置、电子设备及存储介质Flow determination method, device, electronic device and storage medium

本申请要求于2023年09月05日提交中国专利局、申请号为202311143177.2、申请名称为“流量确定方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on September 5, 2023, with application number 202311143177.2 and application name “Flow determination method, device, electronic device and storage medium”, all contents of which are incorporated by reference in this application.

技术领域Technical Field

本申请涉及网络技术领域,尤其涉及一种流量确定方法、装置、电子设备及存储介质。The present application relates to the field of network technology, and in particular to a flow determination method, device, electronic device and storage medium.

背景技术Background Art

网络传输链路上的流量符合预期要求,是保障基于该网络的上层服务正常提供的核心需求。例如,链路水位不能超过带宽的80%,否则将会影响上层服务。因此,需要基于传输链路上的流量对网络流量进行验证。网络流量验证旨在通过数学建模和推理,对传输链路上的流量进行准确、快速地模拟和验证,从而能够提前发现网络维护过程(例如,运维和变更)中是否有网络配置错误、网络拓扑错误(例如,多条链路失效)等导致的流量异常,从而有效预防网络稳定性问题。The traffic on the network transmission link meets the expected requirements, which is the core requirement to ensure the normal provision of upper-layer services based on the network. For example, the link water level cannot exceed 80% of the bandwidth, otherwise it will affect the upper-layer services. Therefore, it is necessary to verify the network traffic based on the traffic on the transmission link. Network traffic verification aims to accurately and quickly simulate and verify the traffic on the transmission link through mathematical modeling and reasoning, so as to detect in advance whether there are network configuration errors, network topology errors (for example, multiple link failures) and other traffic anomalies caused by network maintenance processes (for example, operation and maintenance and changes), thereby effectively preventing network stability issues.

发明内容Summary of the invention

本申请实施例提供一种流量确定方法、装置、电子设备及存储介质,能够高效准确地确定复杂网络的传输链路上的流量分布,从而高效准确地验证流量是否预期。The embodiments of the present application provide a flow determination method, device, electronic device and storage medium, which can efficiently and accurately determine the flow distribution on the transmission link of a complex network, thereby efficiently and accurately verifying whether the flow is expected.

第一方面,本申请实施例提供了一种流量确定方法,包括:基于目标网络的路由信息,为流入所述目标网络的多条目标数据流构建流量分布图;其中,所述路由信息包括用于确定数据流转发状态的信息;所述流量分布图中的一个节点表示一条目标数据流的一个转发状态;所述转发状态包括当前地址和下一跳信息;利用所述流量分布图中各节点之间的连接边上的流量,确定所述目标网络中各路由设备之间的传输链路上的流量。In a first aspect, an embodiment of the present application provides a traffic determination method, comprising: based on the routing information of the target network, constructing a traffic distribution graph for multiple target data flows flowing into the target network; wherein the routing information includes information for determining the forwarding state of the data flow; a node in the traffic distribution graph represents a forwarding state of a target data flow; the forwarding state includes the current address and next hop information; and utilizing the traffic on the connection edges between the nodes in the traffic distribution graph to determine the traffic on the transmission links between the routing devices in the target network.

第二方面,本申请实施例提供了一种流量验证装置,包括:流量分布图构建模块,用于基于目标网络的路由信息,为流入所述目标网络的多条目标数据流构建流量分布图;其中,所述路由信息包括用于确定数据流转发状态的信息;所述流量分布图中的一个节点表示一条目标数据流的一个转发状态;所述转发状态包括当前地址和下一跳信息;传输链路流量确定模块,用于利用所述流量分布图中各节点之间的连接边上的流量,确定所述目标网络中各路由设备之间的传输链路上的流量。In the second aspect, an embodiment of the present application provides a flow verification device, including: a flow distribution map construction module, which is used to construct a flow distribution map for multiple target data flows flowing into the target network based on the routing information of the target network; wherein the routing information includes information for determining the forwarding state of the data flow; a node in the flow distribution map represents a forwarding state of a target data flow; the forwarding state includes the current address and next hop information; a transmission link flow determination module, which is used to determine the flow on the transmission link between the routing devices in the target network by utilizing the flow on the connection edges between the nodes in the flow distribution map.

第三方面,本申请实施例提供了一种电子设备,包括存储器、处理器及存储在存储器上的计算机程序,所述处理器在执行所述计算机程序时实现本申请任一实施例提供的方法。In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a storage device. The processor implements the method provided in any embodiment of the present application when executing the computer program.

第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现本申请任一实施例提供的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method provided in any embodiment of the present application is implemented.

与现有技术相比,本申请具有如下优点:Compared with the prior art, this application has the following advantages:

本申请实施例的技术方案,通过路由表项、SR隧道信息等能够体现网络中各种协议和策略的多维路由信息,确定大规模复杂网络下数据流在不同节点的转发状态,进而高效构建流量分布图,从而能够高效准确地确定大规模复杂网络的流量分布,并为高效、准确地进行网络流量验证提供数据基础,以提高网络稳定性。The technical solution of the embodiment of the present application can reflect the multi-dimensional routing information of various protocols and strategies in the network through routing table items, SR tunnel information, etc., determine the forwarding status of data flows at different nodes in large-scale complex networks, and then efficiently construct a traffic distribution map, so as to efficiently and accurately determine the traffic distribution of large-scale complex networks, and provide a data basis for efficient and accurate network traffic verification to improve network stability.

在一种实施方式中,确定的转发状态不仅限于在路由设备间的状态,还包括有同一路由设备不同端口或不同逻辑状态地址,例如在路由设备A和路由设备B之间的传输链路上可以对应流量分布图上的多个不同节点,即流量分布图上的节点为精确反应数据流转发的细粒度信息,因此,流量分布更为准确。In one embodiment, the determined forwarding state is not limited to the state between routing devices, but also includes different ports or different logical state addresses of the same routing device. For example, the transmission link between routing device A and routing device B can correspond to multiple different nodes on the traffic distribution diagram, that is, the nodes on the traffic distribution diagram accurately reflect the fine-grained information of data flow forwarding, so the traffic distribution is more accurate.

在一种实施方式中,可以从流入目标网络的多条待选数据流中,筛选出若干目标数据流,进行合理的流数缩减,并将总流量按照预设的分配比例分配给各目标数据流,从而在不影响计算结果的前提下,降低计算量,提高流量分布的构建效率,进而提高流量验证的效率,降低对机器性能的要求。In one implementation, several target data flows can be screened out from multiple candidate data flows flowing into the target network, and the number of flows can be reasonably reduced, and the total flow can be allocated to each target data flow according to a preset allocation ratio, thereby reducing the amount of calculation without affecting the calculation results, improving the efficiency of building the flow distribution, and further improving the efficiency of flow verification and reducing the requirements for machine performance.

在另一种实施方式中,当网络发生变化导致路由信息变化时,可以仅计算因此变化而引起的传输链路上的流量水位变化,从而避免对未变化的传输链路流量水位进行复杂的重新模拟计算,大大提高网络变化下的流量水位变化的模拟效率。In another embodiment, when a network change causes a change in routing information, only the traffic level change on the transmission link caused by the change can be calculated, thereby avoiding complex re-simulation calculation of the traffic level of the unchanged transmission link, greatly improving the simulation efficiency of the traffic level change under network changes.

上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,可依照说明书的内容予以实施,并且为了让本申请的上述和其他目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

在附图中,除非另外规定,否则贯穿多个附图相同的附图标记表示相同或相似的部件或存储对象。这些附图不一定是按照比例绘制的。应该理解,这些附图仅描绘了根据本申请的一些实施方式,而不应将其视为是对本申请范围的限制。In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar components or storage objects. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments according to the present application and should not be regarded as limiting the scope of the present application.

图1为本申请应用场景的一个网络拓扑的示例性示意图;FIG1 is an exemplary schematic diagram of a network topology for an application scenario of the present application;

图2示出本申请流量确定技术方案的一个示例性场景图;FIG2 shows an exemplary scenario diagram of the flow determination technical solution of the present application;

图3示出基于图1所示的网络拓扑和流量快照而构建的流量分布图的示例性示意图;FIG3 shows an exemplary schematic diagram of a traffic distribution diagram constructed based on the network topology and traffic snapshot shown in FIG1 ;

图4为本申请实施例一的流量确定方法的流程图;FIG4 is a flow chart of a method for determining flow rate according to Embodiment 1 of the present application;

图5为本申请实施例二的流量确定方法的流程图;FIG5 is a flow chart of a method for determining flow rate according to a second embodiment of the present application;

图6为本申请实施例二的流量确定方法的应用示例图;FIG6 is an application example diagram of the flow determination method of Embodiment 2 of the present application;

图7为本申请实施例三的流量确定方法的流程图;FIG7 is a flow chart of a method for determining flow rate according to Embodiment 3 of the present application;

图8、图9和图10为本申请实施例三的增量模拟的示例图;FIG8 , FIG9 and FIG10 are example diagrams of incremental simulation of the third embodiment of the present application;

图11为本申请实施例三的流量确定方法的应用示例图;FIG11 is an application example diagram of the flow determination method of Embodiment 3 of the present application;

图12为本申请实施例四的流量确定装置的框图;FIG12 is a block diagram of a flow rate determination device according to a fourth embodiment of the present application;

图13为用来实现本申请实施例的电子设备的框图。FIG. 13 is a block diagram of an electronic device used to implement an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

在下文中,仅简单地描述了某些示例性实施例。正如本领域技术人员可认识到的那样,在不脱离本申请的构思或范围的情况下,可通过各种不同方式修改所描述的实施例。因此,附图和描述被认为本质上是示例性的,而非限制性的。In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the concept or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary in nature and not restrictive.

为便于理解本申请实施例的技术方案,以下对本申请实施例的相关技术进行说明。以下相关技术作为可选方案与本申请实施例的技术方案可以进行任意结合,其均属于本申请实施例的保护范围。To facilitate understanding of the technical solutions of the embodiments of the present application, the following describes the related technologies of the embodiments of the present application. The following related technologies can be combined with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application.

应用场景Application Scenario

网络流量验证(network traffic verification)是通过对要验证的网络进行建模,并计算、检查其各个传输链路承载的流量是否满足验证规则。网络流量验证技术依赖路由模拟技术对给定的网络拓扑和网络配置(network configuration)下的路由设备进行路由模拟,再对进入网络的数据流进行流量模拟。其中,网络配置是网络管理人员通过设置网络内部路由设备的通信、组织和控制,从而达到对整个网络进行管理。然而,网络规模越来越庞大,进入网络的数据流的数量和流量也越来越大,网络拓扑和配置的特性也越来越复杂,如何确保高效、准确地确定网络流量进而进行网络流量验证成为一个重大挑战。Network traffic verification is to model the network to be verified, and calculate and check whether the traffic carried by each transmission link meets the verification rules. Network traffic verification technology relies on routing simulation technology to simulate the routing devices under a given network topology and network configuration, and then simulate the traffic of the data flow entering the network. Among them, network configuration is the network administrator's management of the entire network by setting up the communication, organization and control of the routing devices within the network. However, as the scale of the network becomes larger and larger, the number and flow of data flows entering the network are also increasing, and the characteristics of the network topology and configuration are becoming more and more complex. How to ensure efficient and accurate determination of network traffic and then conduct network traffic verification has become a major challenge.

在一种实现方式中,控制平面的定量抽象表达(Quantitative Abstract Representation for Control planes,QARC)工具可以用来进行流量验证,其输入三个要素:网络控制面(control plane)的抽象表达,控制面用于控制和管理路由器所有网络协议的运行,并提供了数据面进行数据处理转发前所必需的各种网络信息和转发查询项,其抽象表达通常为扩展拓扑图(extended topology graph)的形式,用于表示网络中的路由设备节点、链路和连接关系等信息;流量矩阵,用于描述网络中流量分布的矩阵,它表示了不同路由设备节点之间的流量;允许的最大链路故障数K,用于限制在验证网络时所能容忍的最大链路故障数量。QARC的输出为:在任何不超过K条链路故障的场景下,所有正常链路均不会水位超标的验证结果,或在一个不超过K条链路故障的故障场景下,使得网络中的某些链路在该场景下水位超标。In one implementation, the Quantitative Abstract Representation for Control planes (QARC) tool can be used to perform traffic verification. Its input is three elements: an abstract representation of the network control plane, which is used to control and manage the operation of all network protocols of the router and provides various network information and forwarding query items required by the data plane before data processing and forwarding. Its abstract representation is usually in the form of an extended topology graph, which is used to represent information such as routing device nodes, links, and connection relationships in the network; a traffic matrix, which is used to describe the matrix of traffic distribution in the network, which represents the traffic between different routing device nodes; and a maximum number of link failures allowed, K, which is used to limit the maximum number of link failures that can be tolerated when verifying the network. The output of QARC is: a verification result that all normal links will not exceed the water level in any scenario with no more than K link failures, or a verification result that some links in the network exceed the water level in a failure scenario with no more than K link failures.

但是,QARC不支持内部边界网关协议(Internal Border Gateway Protocol,iBGP),也不支持外部边界网关协议(External Border Gateway Protocol,eBGP)中的一些在真实网络广泛部署的关键特性,例如本地优先级(local preference),社区属性(communities)等。而且,QARC不支持真实网络中部署的其它常见的重要协议,例如分段路由(Segment Routing,SR),基于策略的路由(Policy-Based Routing,PBR)等;另外,QARC只能验证水位超标这一种流量水位预期,而不能验证水位过低等其他流量水位预期。However, QARC does not support the Internal Border Gateway Protocol (iBGP) nor some of the External Border Gateway Protocol (eBGP) in Key features widely deployed in real networks, such as local preference, communities, etc. Moreover, QARC does not support other common important protocols deployed in real networks, such as Segment Routing (SR), Policy-Based Routing (PBR), etc. In addition, QARC can only verify the expected flow level, such as the water level exceeding the standard, but cannot verify other expected flow levels, such as the water level being too low.

图1示出一个网络拓扑的示例性示意图。如图1所示,通常在网络拓扑中,节点表示一个路由设备,节点之间的连接边表示传输链路,用于承载数据流的流量。本申请实施例中,路由设备包括路由器、交换机等;传输链路为路由设备之间连接的链路。数据流通常以数据包的形式被转发,且具有流向。网络拓扑表征网络中各路由设备之间的连接关系,路由设备配置信息包括通信协议的配置信息和路由策略的配置信息。通信协议可以是边界网关协议(Border Gateway Protocol,BGP),如iBGP、eBGP;也可以是中间系统到中间系统(Intermediate System to Intermediate System,IS-IS)协议,路由策略诸如PBR策略、SR策略等,因此,路由设备配置信息包括但不限于BGP信息、IS-IS协议信息、PBR信息和SR信息中的至少一种。FIG1 shows an exemplary schematic diagram of a network topology. As shown in FIG1 , usually in a network topology, a node represents a routing device, and the connection edge between nodes represents a transmission link, which is used to carry the traffic of a data stream. In an embodiment of the present application, the routing device includes a router, a switch, etc.; the transmission link is a link connecting the routing devices. The data stream is usually forwarded in the form of a data packet and has a flow direction. The network topology characterizes the connection relationship between the routing devices in the network, and the routing device configuration information includes the configuration information of the communication protocol and the configuration information of the routing policy. The communication protocol can be a Border Gateway Protocol (BGP), such as iBGP, eBGP; it can also be an Intermediate System to Intermediate System (IS-IS) protocol, and the routing policy is such as a PBR policy, an SR policy, etc. Therefore, the routing device configuration information includes but is not limited to at least one of BGP information, IS-IS protocol information, PBR information and SR information.

在图1所示的网络中,有两个自治系统(Autonomous System,AS),即两个子网AS100和AS200。其中,AS100包括一个路由设备G(网际协议(Internet Protocol Address,IP)地址:10.0.0.7),AS200包括路由设备A(IP地址:10.0.0.1)、路由设备B(IP地址:10.0.0.2)、路由设备C(IP地址:10.0.0.3)、路由设备D(IP地址:10.0.0.4)、路由设备E(IP地址:10.0.0.5)和路由设备F(IP地址:10.0.0.6)。G和A之间通过eBGP连接,而A、B、C、D、E和F之间建立了iBGP连接。In the network shown in Figure 1, there are two autonomous systems (AS), namely two subnets AS100 and AS200. AS100 includes a routing device G (Internet Protocol Address (IP) address: 10.0.0.7), and AS200 includes routing devices A (IP address: 10.0.0.1), B (IP address: 10.0.0.2), C (IP address: 10.0.0.3), D (IP address: 10.0.0.4), E (IP address: 10.0.0.5) and F (IP address: 10.0.0.6). G and A are connected via eBGP, while A, B, C, D, E and F are connected via iBGP.

AS100的配置信息包括:(1)BGP信息,目的地网络是30/8,其中,"/8"是子网掩码,表示该路由表项适用于前8位相同的IP地址,下一跳地址是11.0.0.5(路由设备地址),即指向目的地网络30/8的数据包通过该下一跳地址进行转发;(2)直连网络路由表项,该路由表项的目的地网络是11.0.0.4/30,指向该目的地网络的数据包通过本地设备接口直接转发。The configuration information of AS100 includes: (1) BGP information, the destination network is 30/8, where "/8" is the subnet mask, indicating that the routing table entry is applicable to IP addresses with the same first 8 bits, and the next hop address is 11.0.0.5 (the routing device address), that is, data packets directed to the destination network 30/8 are forwarded through this next hop address; (2) Directly connected network routing table entry, the destination network of this routing table entry is 11.0.0.4/30, and data packets directed to this destination network are directly forwarded through the local device interface.

路由设备G的配置信息包括PBR信息:针对进入接口"X"的数据包,对于符合源地址范围为20.0.0.0/8的数据包,设置其区分服务代码(Differentiated Services Code Point,DSCP)字段值为5,从而对特定源地址的数据流进行标记,以便在后续的转发过程中进行相应的优先级等策略处理。The configuration information of routing device G includes PBR information: for data packets entering interface "X", for data packets that match the source address range of 20.0.0.0/8, the Differentiated Services Code Point (DSCP) field value is set to 5, thereby marking the data flow with a specific source address so that corresponding priority and other policy processing can be performed in the subsequent forwarding process.

AS200的配置信息包括:(1)BGP信息,目的地网络是30/8,有两条转发路径,分别通过下一跳地址10.0.0.5和10.0.0.6将数据包转发至该目的地网络;(2)IS-IS信息:存在两个目的地网络为10.0.0.5/32和10.0.0.6/32的路由表项,且都使用了SR技术,即根据SR隧道转发到达这两个目的地网络。The configuration information of AS200 includes: (1) BGP information: the destination network is 30/8, and there are two forwarding paths, which forward the data packets to the destination network through the next-hop addresses 10.0.0.5 and 10.0.0.6 respectively; (2) IS-IS information: there are two routing table entries with destination networks 10.0.0.5/32 and 10.0.0.6/32, and both use SR technology, that is, forwarding to these two destination networks is based on SR tunnels.

路由设备A的配置信息包括:(1)SR信息:针对目的地网络10.0.0.5/32,通过路径10.0.0.2-10.0.0.5来转发DSCP字段值为5的数据包,且该路径10.0.0.2-10.0.0.5的权重为10。(2)SR信息:针对目的地网络10.0.0.6/32,通过两个路径来转发DSCP字段值为5的数据包,其中,路径10.0.0.3-10.0.0.6的权重为8,路径10.0.0.4-10.0.0.6的权重为2。其中,可以根据权重在两条路径上分配流量;(3)进入接口地址:11.0.0.5。The configuration information of routing device A includes: (1) SR information: For the destination network 10.0.0.5/32, forward the data packet with the DSCP field value of 5 through the path 10.0.0.2-10.0.0.5, and the path 10.0.0.2-10.0.0.5 The weight is 10. (2) SR information: For the destination network 10.0.0.6/32, packets with a DSCP field value of 5 are forwarded through two paths, of which the weight of the path 10.0.0.3-10.0.0.6 is 8 and the weight of the path 10.0.0.4-10.0.0.6 is 2. Traffic can be distributed on the two paths based on the weights; (3) Ingress interface address: 11.0.0.5.

如图1所示,在当前单位时间内,假设有两条数据流f1和f2,分别通过路由设备A和路由设备G进入包括AS100和AS200D的网络,其中f1的速率稳定在8千兆比特每秒(Gigabits per second,Gbps),而f2的速率在2Gbps至12Gbps间波动。流量模拟的核心问题是如何通过这些信息计算出网络中各个链路上承载的流量大小,难点在于:(1)如何支持BGP、PBR、SR等协议,以计算每条数据流实际的转发路径;(2)如何对流量的分布(例如,A-C-F和A-D-F承载的流量比例为8:2)进行精确地建模。As shown in Figure 1, in the current unit time, assume that there are two data flows f1 and f2, which enter the network including AS100 and AS200D through routing device A and routing device G respectively. The rate of f1 is stable at 8 Gigabits per second (Gbps), while the rate of f2 fluctuates between 2Gbps and 12Gbps. The core problem of traffic simulation is how to use this information to calculate the traffic size carried on each link in the network. The difficulties lie in: (1) how to support BGP, PBR, SR and other protocols to calculate the actual forwarding path of each data flow; (2) how to accurately model the distribution of traffic (for example, the traffic ratio of A-C-F and A-D-F is 8:2).

图2示出本申请流量确定技术方案的一个示例性场景图。如图2所示,针对一个网络,首先,可以基于该网络的网络拓扑和路由设备配置信息调用路由模拟模块201进行路由模拟,输出用于确定数据流转发状态的路由信息。路由信息可以是路由表项、SR隧道信息或其他如路由设备之间的连接状态、传输链路的负载等相关的路由信息。FIG2 shows an exemplary scenario diagram of the technical solution for determining traffic flow in the present application. As shown in FIG2, for a network, first, the routing simulation module 201 can be called to perform routing simulation based on the network topology and routing device configuration information of the network, and the routing information used to determine the forwarding state of the data flow can be output. The routing information can be routing table entries, SR tunnel information, or other related routing information such as the connection status between routing devices, the load of the transmission link, etc.

其中,路由表是路由设备(如路由设备、交换机等)中存储的一张表,用于指导数据包的转发。它记录了目的地网络与下一跳的关系,以确定数据包应该通过哪个接口发送。路由表项是路由表中的每一条记录,它包含了目的地网络的地址(如10.0.0.0/24)、下一跳的路由设备标识、出接口/端口以及其他相关的属性。每个路由表项描述了如何将数据包转发到目的地网络。Among them, the routing table is a table stored in a routing device (such as a routing device, switch, etc.) to guide the forwarding of data packets. It records the relationship between the destination network and the next hop to determine which interface the data packet should be sent through. A routing table entry is each record in the routing table, which contains the address of the destination network (such as 10.0.0.0/24), the routing device identifier of the next hop, the outbound interface/port, and other related attributes. Each routing table entry describes how to forward a data packet to the destination network.

SR隧道用于在网络中创建逻辑上的隧道路径,在SR隧道中,数据包从源节点到目的节点通过一系列的中间节点进行转发。这些中间节点可以是路由设备或交换机。SR隧道通过在数据包头部添加分段标记(Segment Identifier)来指示转发路径。每个分段标记代表着网络中的一个节点或链路,数据包根据分段标记的顺序进行转发。SR隧道通过预定义的路径和段标记,实现了对数据包的精确控制和定向转发。SR隧道信息通常可以包括:隧道起点和终点,指示SR隧道的起始节点和目标节点;分段标识,可以是节点标识、链路标识或任何其他标识符;转发顺序,指示数据包按照哪个顺序经过各个段标记进行转发;隧道属性,包括带宽、延迟、可用性等性能指标,用于优化数据包的转发路径选择;隧道状态,描述隧道的当前状态,如激活、禁用、故障等;隧道标识,用于唯一标识SR隧道的标识符,以便进行管理和配置。SR tunnels are used to create logical tunnel paths in the network. In SR tunnels, data packets are forwarded from the source node to the destination node through a series of intermediate nodes. These intermediate nodes can be routing devices or switches. SR tunnels indicate the forwarding path by adding a segment identifier to the packet header. Each segment identifier represents a node or link in the network, and data packets are forwarded according to the order of segment identifiers. SR tunnels achieve precise control and directional forwarding of data packets through predefined paths and segment identifiers. SR tunnel information can generally include: tunnel start and end points, indicating the starting node and destination node of the SR tunnel; segment identifiers, which can be node identifiers, link identifiers, or any other identifiers; forwarding order, indicating the order in which data packets are forwarded through each segment identifier; tunnel attributes, including performance indicators such as bandwidth, latency, and availability, which are used to optimize the forwarding path selection of data packets; tunnel status, describing the current status of the tunnel, such as activated, disabled, or faulty; tunnel identifier, an identifier used to uniquely identify the SR tunnel for management and configuration.

示例性地,路由模拟模块201可以通过收集和分析网络拓扑信息和路由设备配置信息,创建虚拟的网络环境,并配置路由设备和链路的属性,然后使用模拟算法模拟路由设备之间的协议运行和信息交换,模拟数据包的传输和转发过程,从而输出路由表项、SR隧道信息等路由信息。以图1所示的网络为例,对路由设备A的路由模拟,包括路由设备A使得转发给10.0.0.5(路由设备E的设备地址)的数据流通过路径A-B-E转发;而使得转发给10.0.0.6(路由设备F的设备地址)的数据流通过路径A-C-F和A-D-F转发,并且这两条路径承载的流量比例为8:2。Exemplarily, the routing simulation module 201 can create a virtual network environment by collecting and analyzing network topology information and routing device configuration information, and configure the properties of routing devices and links, and then use simulation algorithms to simulate the protocol operation and information exchange between routing devices, and simulate the transmission and forwarding process of data packets, thereby outputting routing information such as routing table entries and SR tunnel information. Taking the network shown in FIG1 as an example, the routing simulation of routing device A includes routing device A making the data flow forwarded to 10.0.0.5 (the device address of routing device E) forwarded through path ABE; and making the data flow forwarded to 10.0.0.6 (the device address of routing device F) forwarded through path ACF. and ADF forwarding, and the traffic ratio carried by these two paths is 8:2.

进一步地,数据流的转发状态可以包括当前地址和下一跳信息,下一跳信息可以是下一跳的路由设备标识、下一跳的隧道分段标识或下一跳为待查找的标识信息。如图2所示,流量分布图构建模块202基于路由模拟模块201输出的路由信息以及输入网络的流量快照,可以构建相应的流量分布图(Traffic Distribution Graph,TDG)。Furthermore, the forwarding state of the data stream may include the current address and the next hop information, and the next hop information may be the routing device identifier of the next hop, the tunnel segment identifier of the next hop, or the identifier information of the next hop to be found. As shown in FIG2 , the traffic distribution graph construction module 202 may construct a corresponding traffic distribution graph (TDG) based on the routing information output by the routing simulation module 201 and the traffic snapshot of the input network.

其中,流量快照通常指一个单位时间内,进入网络的数据流和其携带的流量。因此,流量分布图针对流入网络的多个数据流而构建,且可以基于路由信息的变化或流量快照的更新而自动更新。流量分布图可以体现多个节点的拓扑关系,流量分布图中的一个节点表示一条目标数据流的一个转发状态。A traffic snapshot usually refers to the data flow entering the network and the traffic it carries within a unit of time. Therefore, a traffic distribution graph is constructed for multiple data flows entering the network and can be automatically updated based on changes in routing information or updates to traffic snapshots. A traffic distribution graph can reflect the topological relationship of multiple nodes, and a node in the traffic distribution graph represents a forwarding state of a target data flow.

图3示出基于图1所示的网络拓扑和流量快照而构建的流量分布图的示例性示意图。如图3所示。每个节点表示一条目标数据流的一个转发状态,也就是说,数据流不同或数据流的转发状态不同都将映射出不同的节点。因此,可以用一个节点标识和一个三元组来表示流量分布图中的一个节点。其中,节点标识用于表明该节点的名称,如n0、n1……n18。三元组包括数据流标识、当前地址、下一条信息。数据流标识用于表示该节点对应的数据流,如f1和f2。当前地址例如为数据流所在的路由设备的端口,如表示数据流在路由设备A的i0端口上,又如为在路由设备上的逻辑状态地址,如表示在路由设备A的路由表查找逻辑状态地址。下一跳信息例如为:下一跳的路由设备标识,如A、E、F等;下一跳的隧道分段标识如p1、p2、p3;下一跳为待查找的标识信息,如⊥。因此,三元组中的任何一个信息不同,如下一跳信息不同,都将对应不同的节点。FIG3 shows an exemplary schematic diagram of a traffic distribution diagram constructed based on the network topology and traffic snapshot shown in FIG1 . As shown in FIG3 . Each node represents a forwarding state of a target data flow, that is, different data flows or different forwarding states of data flows will map to different nodes. Therefore, a node in the traffic distribution diagram can be represented by a node identifier and a triplet. Among them, the node identifier is used to indicate the name of the node, such as n0 , n1 …n18. The triplet includes a data flow identifier, a current address, and the next piece of information. The data flow identifier is used to indicate the data flow corresponding to the node, such as f1 and f2. The current address is, for example, the port of the routing device where the data flow is located, such as Indicates that the data flow is on port i0 of routing device A, and is also the logical state address on the routing device, such as Indicates searching the logical state address in the routing table of routing device A. The next hop information is, for example: the routing device identifier of the next hop, such as A, E, F, etc.; the tunnel segment identifier of the next hop, such asp1 ,p2 ,p3 ; the next hop is the identifier information to be searched, such as ⊥. Therefore, if any information in the triple is different, such as the next hop information is different, it will correspond to different nodes.

示例性地,如图3所示,节点表示该节点名称为n0,数据流f1在路由设备A的i0端口(即标号为0的入端口)上,处在下一跳待查找的状态(标识为⊥)。节点表示该节点名称为n1,数据流f1在路由设备A的路由表查找逻辑状态上,处在下一跳待查找的状态。节点表示该节点名称为n2,数据流f1在路由设备A的路由表查找逻辑状态上,下一跳为路由设备E。节点表示该节点名称为n3,数据流f1在路由设备A的路由表查找逻辑状态上,下一跳为路由设备F。节点表示该节点名称为n4,数据流f1在路由设备A的路由表查找逻辑状态上,下一跳为隧道分段p1。节点表示该节点名称为n5,数据流f1在路由设备A的e1端口(即标号为1的出端口)上,下一跳为隧道分段p1。节点表示该节点名称为n6,数据流f1在路由设备B的i0端口上,下一跳为隧道分段p1。因此,节点n0至节点n6表示了数据流f1在路径A-B上的不同转发状态。在流量分布图中,节点之间的连接边为有向边,表示了转发状态的变化。例如:n0到n1间的有向连接边表示流f1在路由设备A上由i0端口进入vrf0,进行下一跳查找。For example, as shown in FIG3 , the node Indicates that the node name is n0 , and the data flow f1 is on port i0 of routing device A (i.e., the inbound port labeled 0), and is in the next hop waiting state (marked as ⊥). Indicates that the node name is n1 , and the data flow f1 is in the next hop waiting state in the routing table search logic state of routing device A. Indicates that the node name is n2 , data flow f1 is in the routing table lookup logic state of routing device A, and the next hop is routing device E. Node Indicates that the node name is n3 , data flow f1 is in the routing table lookup logic state of routing device A, and the next hop is routing device F. Node Indicates that the node name is n4 , data flow f1 is in the routing table lookup logic state of routing device A, and the next hop is tunnel segment p1 . Indicates that the node name is n5 , data flow f1 is on port e1 (i.e., the egress port numbered 1) of routing device A, and the next hop is tunnel segment p1 . Indicates that the node name is n6 , data flow f1 is on port i0 of routing device B, and the next hop is tunnel segment p1 . Therefore, nodes n0 to n6 represent different forwarding states of data flow f1 on path AB. In the traffic distribution graph, the connection edges between nodes are directed edges, indicating the change of forwarding state. For example: the directed connection edge between n0 and n1 indicates that flow f1 enters vrf0 from port i0 on routing device A and performs next hop search.

请继续参阅图2,当流量分布图构建完成后,流量模拟模块203可以在此基础上计算每条数据流在流量分布图上的流量分布,进而映射计算网络拓扑中各路由设备之间的传输链路在流量快照下的流量分布,即得到传输链路上的流量大小,也可以叫做流量水位。Please continue to refer to FIG. 2. When the traffic distribution map is constructed, the traffic simulation module 203 can calculate the traffic distribution of each data flow on the traffic distribution map based on this, and then map and calculate the traffic distribution of each routing device in the network topology. The traffic distribution of the transmission link between the two under the traffic snapshot is obtained, that is, the traffic size on the transmission link, which can also be called the traffic water level.

示例性地,在配置信息中,SR策略可以为不同路由路径配置不同权重,从而在路由信息中,不同路由路径可以配置不同权重,用于确定相应路由路径被分配的流量比例,体现在流量分布图中即对应流量分布图中的节点之间的连接边的权重,用于上一节点的数据流转发至下一节点的流量比例,即表示有多少比例的流量会经过该边进行转发。例如,n3到n10间的连接边路由设备了0.8的权重,n3到n11间的边设置了0.2的权重,代表n3上的流量有80%进入n10,有20%进入n11,对应路由设备A上SR策略的配置信息:路径10.0.0.3-10.0.0.6的权重为8,路径10.0.0.4-10.0.0.6的权重为2。Exemplarily, in the configuration information, the SR policy can configure different weights for different routing paths, so that in the routing information, different routing paths can be configured with different weights, which are used to determine the proportion of traffic allocated to the corresponding routing path, which is reflected in the traffic distribution diagram, that is, the weight of the connection edge between the nodes in the corresponding traffic distribution diagram, and is used for the traffic proportion of the data flow from the previous node to the next node, that is, how much proportion of the traffic will be forwarded through the edge. For example, the connection edge between n3 and n10 is set with a weight of 0.8 by the routing device, and the edge between n3 and n11 is set with a weight of 0.2, which means that 80% of the traffic on n3 enters n10 and 20% enters n11 , corresponding to the configuration information of the SR policy on routing device A: the weight of the path 10.0.0.3-10.0.0.6 is 8, and the weight of the path 10.0.0.4-10.0.0.6 is 2.

例如,对于图3的例子,f1进入n0的流量为8Gbps,而n0到n1间的连接边权重为1,所以f1进入n1的流量也是8Gbps。n1到n2、n3的连接边的权重均为0.5,所以f1进入这两条连接边的流量均是4Gbps。重复这样的计算,直到完成f1在每条连接边上的流量计算。同理,流量模拟模块203也对其他数据流(例如f2)进行同样的计算。当所有数据流的计算都结束后,将得到流量转发图上的每条连接边承载的流量,其中对应网络拓扑中传输链路的连接边则是该传输链路在给定流量快照下的流量水位,从而快速准确得到网络拓扑中各传输链路的流量水位,即网络中各传输链路的流量分布。For example, for the example of FIG. 3 , the flow rate of f1 entering n0 is 8 Gbps, and the weight of the connection edge between n0 and n1 is 1, so the flow rate of f1 entering n1 is also 8 Gbps. The weights of the connection edges from n1 to n2 and n3 are both 0.5, so the flow rate of f1 entering these two connection edges is 4 Gbps. Repeat this calculation until the flow rate calculation of f1 on each connection edge is completed. Similarly, the traffic simulation module 203 also performs the same calculation on other data flows (such as f2 ). When the calculation of all data flows is completed, the flow rate carried by each connection edge on the traffic forwarding graph will be obtained, wherein the connection edge corresponding to the transmission link in the network topology is the flow water level of the transmission link under a given flow snapshot, thereby quickly and accurately obtaining the flow water level of each transmission link in the network topology, that is, the flow distribution of each transmission link in the network.

示例性地,请继续参阅图2,流量验证模块204可以基于网络中各传输链路的流量分布,验证各个传输链路承载的流量是否满足验证规则,例如根据流量水位预期的标准值,进行水位是否超标,水位是否过低以及网络变更前后水位变化过大等多种预期目标的验证,输出满足或不满足预期的验证结果,提高网络稳定性。Exemplarily, please continue to refer to Figure 2. The traffic verification module 204 can verify whether the traffic carried by each transmission link meets the verification rules based on the traffic distribution of each transmission link in the network. For example, based on the expected standard value of the traffic water level, it can verify multiple expected goals such as whether the water level exceeds the standard, whether the water level is too low, and whether the water level changes too much before and after the network change, and output verification results that meet or do not meet expectations, thereby improving network stability.

需要说明的是,本申请实施例中提供的流量确定方法的上述应用场景或应用示例,是为了便于理解,本申请实施例对流量确定方法的应用不作具体限定。It should be noted that the above-mentioned application scenarios or application examples of the flow determination method provided in the embodiments of the present application are for ease of understanding, and the embodiments of the present application do not specifically limit the application of the flow determination method.

此外,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,并且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准,并提供有相应的操作入口,供用户选择或编辑授权或者拒绝。In addition, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose or edit authorization or rejection.

下面以具体的实施例对本申请的技术方案以及本申请的技术方案如何解决前述技术问题进行详细说明。所列举的若干具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。The following is a detailed description of the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems with specific embodiments. The listed specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

实施例一Embodiment 1

图4示出根据本申请实施例的流量确定方法的流程图。如图4所示,该流量确定方法包括步骤S401和步骤S402。Fig. 4 shows a flow chart of a flow determination method according to an embodiment of the present application. As shown in Fig. 4, the flow determination method includes step S401 and step S402.

步骤S401:基于目标网络的路由信息,为流入所述目标网络的多条目标数据流构建流量分布图;其中,路由信息包括用于确定数据流转发状态的信息;流量分布图中的一个节点表示一条目标数据流的一个转发状态;转发状态包括当前地址和下一跳信息。Step S401: Based on the routing information of the target network, a traffic distribution map is constructed for multiple target data flows flowing into the target network; wherein the routing information includes information for determining the forwarding state of the data flow; A node represents a forwarding state of a target data flow; the forwarding state includes the current address and next hop information.

本申请实施例中,目标网络即为待进行流量分布确定的网络,其包括若干个路由设备和网络拓扑。其中,路由设备可以是路由器或交换机等网络设备,路由设备之间连接的链路为传输链路,用于传输数据流,承载数据流的流量,目标网络中各传输链路上的流量即为目标网络的流量分布。In the embodiment of the present application, the target network is the network for which traffic distribution is to be determined, and includes a number of routing devices and a network topology. The routing device may be a network device such as a router or a switch, and the link between the routing devices is a transmission link, which is used to transmit data streams and carry the traffic of the data streams. The traffic on each transmission link in the target network is the traffic distribution of the target network.

路由信息可以是路由表项、SR隧道信息或其他如路由设备之间的连接状态、传输链路的负载等相关的路由信息,用于确定数据流转发状态。一条数据流的转发状态可以包括当前地址和下一跳信息,而当前地址可以是当前设备的端口或当前设备的逻辑状态位置;下一跳信息可以是下一跳的路由设备标识、下一跳的隧道分段标识或下一跳为待查找的标识信息,因此,当前地址和/或下一跳信息不同,该数据流的转发状态就不同,在流量分布图中将对应不同的节点,由此可以利用路由信息中用于确定数据流转发状态的信息,确定各目标数据流的多个转发状态;然后根据各目标数据流的各转发状态,构建流量分布图中的各节点。其中,转发状态和节点的相关介绍可以结合图3并参见应用场景部分的描述,在此不再赘述。Routing information can be routing table entries, SR tunnel information or other related routing information such as the connection status between routing devices, the load of the transmission link, etc., which is used to determine the forwarding status of the data flow. The forwarding status of a data flow can include the current address and the next hop information, and the current address can be the port of the current device or the logical state position of the current device; the next hop information can be the routing device identifier of the next hop, the tunnel segment identifier of the next hop, or the next hop is the identifier information to be found. Therefore, the current address and/or next hop information are different, and the forwarding status of the data flow is different, which will correspond to different nodes in the traffic distribution diagram. Therefore, the information used to determine the forwarding status of the data flow in the routing information can be used to determine multiple forwarding states of each target data flow; then, according to each forwarding state of each target data flow, each node in the traffic distribution diagram is constructed. Among them, the relevant introduction of the forwarding state and the node can be combined with Figure 3 and refer to the description of the application scenario part, which will not be repeated here.

本申请实施例中,目标数据流是指当前单位时间进入目标网络的数据流。当前单位时间可以预设,在此不作具体限定。目标数据流可以基于流量快照确定。In the embodiment of the present application, the target data flow refers to the data flow entering the target network in the current unit time. The current unit time can be preset and is not specifically limited here. The target data flow can be determined based on the traffic snapshot.

路由信息可以体现数据流转发状态,因此,基于路由信息以及输入目标网络的流量快照,可以为目标网络构建当前单位时间下的流量分布图,且流量分布图可以基于路由信息的变化或流量快照的更新而自动更新。具体可结合图3以及应用场景部分的描述,在此不再赘述。Routing information can reflect the data flow forwarding status. Therefore, based on the routing information and the traffic snapshot of the input target network, a traffic distribution map under the current unit time can be constructed for the target network, and the traffic distribution map can be automatically updated based on the change of routing information or the update of traffic snapshot. The details can be combined with Figure 3 and the description of the application scenario, which will not be repeated here.

步骤S402:利用流量分布图中各节点之间的连接边上的流量,确定目标网络中各路由设备之间的传输链路上的流量。Step S402: using the traffic on the connection edges between the nodes in the traffic distribution graph, determine the traffic on the transmission links between the routing devices in the target network.

当流量分布图构建完成后,可以在此基础上计算每条数据流在流量分布图上的流量分布。具体地,根据各目标数据流流入目标网络的流量以及各节点所表示的目标数据流和转发状态,即可以确定各节点之间的连接边上的流量,得到流量分布图上的流量分布。进一步地,将流量分布图上的流量分布映射为网络拓扑中各路由设备之间的传输链路在流量快照下的流量分布,即得到传输链路上的流量大小,也可以叫做流量水位。When the traffic distribution graph is constructed, the traffic distribution of each data flow on the traffic distribution graph can be calculated based on it. Specifically, according to the traffic of each target data flow flowing into the target network and the target data flow and forwarding status represented by each node, the traffic on the connection edge between each node can be determined to obtain the traffic distribution on the traffic distribution graph. Furthermore, the traffic distribution on the traffic distribution graph is mapped to the traffic distribution of the transmission link between each routing device in the network topology under the traffic snapshot, that is, the traffic size on the transmission link is obtained, which can also be called the traffic water level.

根据本申请实施例的方法,通过路由表项、SR隧道信息等能够体现网络中各种协议和策略的多维路由信息,确定大规模复杂网络下数据流在不同节点的转发状态,进而高效构建流量分布图,且确定的转发状态不仅限于在路由设备间的状态,还包括有同一路由设备不同端口或不同逻辑状态,例如在路由设备A和路由设备B之间的传输链路上可以对应流量分布图上的多个不同节点,即流量分布图上的节点为精确反应数据流转发的细粒度信息,因此,流量分布更为准确,从而能够高效准确地确定大规模复杂网络的流量分布,并为高效、准确地进行网络流量验证提供数据基础,以提高网络稳定性。According to the method of the embodiment of the present application, multi-dimensional routing information such as routing table items and SR tunnel information that can reflect various protocols and strategies in the network is used to determine the forwarding status of data flows at different nodes in a large-scale complex network, thereby efficiently constructing a traffic distribution map. The determined forwarding status is not limited to the status between routing devices, but also includes different ports or different logical states of the same routing device. For example, the transmission link between routing device A and routing device B can correspond to multiple different nodes on the traffic distribution map, that is, the nodes on the traffic distribution map are fine-grained information that accurately reflects the forwarding of data flows. Therefore, the traffic distribution is more accurate, thereby being able to efficiently and accurately determine large-scale Traffic distribution in complex networks and provide a data basis for efficient and accurate network traffic verification to improve network stability.

在一种实施方式中,路由信息还包括用于确定数据流转发比例的信息;在步骤S401中,基于目标网络的路由信息,为流入目标网络的多条目标数据流构建流量分布图,可以包括:根据路由信息中用于确定数据流转发状态的信息,确定各目标数据流的多个转发状态;根据各目标数据流的各转发状态,构建流量分布图中的各节点;根据各目标数据流流入目标网络的流量、路由信息中用于确定数据流转发比例的信息、各节点所表示的目标数据流和转发状态,确定各节点之间的连接边上的流量和权重;其中,连接边设置有上的权重,用于确定标识连接边的上一节点的目标数据流转发至下一节点的流量比例。In one embodiment, the routing information also includes information for determining the forwarding ratio of data flows; in step S401, based on the routing information of the target network, a traffic distribution graph is constructed for multiple target data flows flowing into the target network, which may include: determining multiple forwarding states of each target data flow according to the information used to determine the forwarding state of the data flow in the routing information; constructing each node in the traffic distribution graph according to each forwarding state of each target data flow; determining the traffic and weight on the connecting edge between each node according to the traffic of each target data flow flowing into the target network, the information used to determine the forwarding ratio of the data flow in the routing information, and the target data flow and forwarding state represented by each node; wherein the connecting edge is provided with a weight for determining the traffic ratio of the target data flow of the previous node identifying the connecting edge forwarded to the next node.

示例性地,一条数据流的转发状态可以包括当前地址和下一跳信息,当前地址和/或下一跳信息不同,该数据流的转发状态就不同,在流量分布图中将对应不同的节点,可以利用路由信息中用于确定数据流转发状态的信息,确定各目标数据流的多个转发状态;然后根据各目标数据流的各转发状态,构建流量分布图中的各节点。Exemplarily, the forwarding state of a data flow may include the current address and next hop information. Different current addresses and/or next hop information will result in different forwarding states of the data flow, which will correspond to different nodes in the traffic distribution diagram. The information used to determine the forwarding state of the data flow in the routing information can be used to determine multiple forwarding states of each target data flow; then, based on the forwarding states of each target data flow, each node in the traffic distribution diagram is constructed.

在路由信息中,不同路由路径可以配置不同权重,体现在流量分布图中即对应流量分布图中的节点之间的连接边的权重,用于上一节点的数据流转发至下一节点的流量比例,即表示有多少比例的流量会经过该边进行转发。例如,路由设备A的路由信息包括路径10.0.0.3-10.0.0.6的权重为8,路径10.0.0.4-10.0.0.6的权重为2,对应流量分布图中即n3到n10间的连接边设置了0.8的权重,n3到n11间的边设置了0.2的权重,代表n3上的流量有80%进入n10,有20%进入n11。因此,根据各目标数据流流入目标网络的流量、路由信息中用于确定数据流转发比例的信息、各节点所表示的目标数据流和转发状态,即可计算出各节点之间的连接边上的流量和权重。In the routing information, different routing paths can be configured with different weights, which are reflected in the traffic distribution graph, that is, the weight of the connection edge between the nodes in the corresponding traffic distribution graph, and the traffic ratio of the data flow from the previous node to the next node, that is, how much traffic will be forwarded through this edge. For example, the routing information of routing device A includes the weight of 8 for the path 10.0.0.3-10.0.0.6, and the weight of 2 for the path 10.0.0.4-10.0.0.6. The corresponding traffic distribution graph, that is, the connection edge between n3 and n10 , is set with a weight of 0.8, and the edge between n3 and n11 is set with a weight of 0.2, which means that 80% of the traffic on n3 enters n10 and 20% enters n11. Therefore, according to the traffic of each target data flow flowing into the target network, the information used to determine the data flow forwarding ratio in the routing information, the target data flow represented by each node, and the forwarding state, the traffic and weight on the connection edge between each node can be calculated.

基于此,流量分布图可以真实模拟和体现真实网络中的路径优先级策略,从而提高流量分布图的准确性。Based on this, the traffic distribution map can truly simulate and reflect the path priority strategy in the real network, thereby improving the accuracy of the traffic distribution map.

在一种实施方式中,本申请实施例的方法还可以包括:根据目标网络的路由设备连接关系以及配置信息,模拟各路由设备对数据流的转发,生成路由信息;其中,配置信息包括BGP信息、IS-IS协议信息、PBR信息和SR信息中的至少一种。In one embodiment, the method of the embodiment of the present application may also include: simulating the forwarding of data streams by each routing device according to the connection relationship and configuration information of the routing devices of the target network, and generating routing information; wherein the configuration information includes at least one of BGP information, IS-IS protocol information, PBR information and SR information.

BGP是边界网关协议,是一种用于在互联网中交换路由信息的协议。通过交换路由信息,决定最佳的路径来转发数据包。它使用路径矢量算法来选择最佳路径,并支持路由策略的配置,以满足特定的网络需求和策略要求。BGP策略是指在BGP协议中配置的路由策略。BGP策略用于控制和优化BGP路由的转发行为,以满足特定的网络需求和策略要求。通过配置BGP策略,网络管理员可以实现对路由选择、路由过滤、路由重分发等方面的精确控制。BGP信息可以包括以下信息中的一种或多种:路由前缀,用于指示目的地网络的IP地址范围;下一跳,用于指示到达目的地网络的下一跳路由设备的IP地址;AS路径,用于指示数据包经过的自治系统路径,从而确定最佳路径和避免环路;属性和策略信息,如权重、本地优先级、路由标记等,用于影响路由路径选择和转发行为。BGP is the Border Gateway Protocol, a protocol used to exchange routing information on the Internet. By exchanging routing information, the best path is determined to forward data packets. It uses a path vector algorithm to select the best path and supports the configuration of routing policies to meet specific network needs and policy requirements. BGP policy refers to the routing policy configured in the BGP protocol. BGP policy is used to control and optimize the forwarding behavior of BGP routing to meet specific network needs and policy requirements. By configuring BGP policies, network administrators can achieve precise control over route selection, route filtering, route redistribution, etc. BGP information can include one or more of the following information: routing prefix, used to indicate the IP address range of the destination network; next hop, used to indicate the IP address of the next hop routing device to reach the destination network; AS path, used to indicate the autonomous system path through which the data packet passes, thereby determining the best Path and loop avoidance; attribute and policy information, such as weight, local preference, routing tag, etc., used to influence routing path selection and forwarding behavior.

IS-IS协议是一种用于在计算机网络中交换路由信息的内部网关协议,主要用于在AS内部的路由设备之间交换路由信息,以确定数据包的转发路径。IS-IS协议信息可以包括以下信息中的一种或多种:路由设备标识;邻居关系,IS-IS路由设备通过与相邻路由设备建立邻居关系,交换链路状态数据包和路由信息;属性和策略信息,如度量值、开销、优先级等用于影响路由选择和转发行为的信息。The IS-IS protocol is an internal gateway protocol used to exchange routing information in a computer network. It is mainly used to exchange routing information between routing devices within an AS to determine the forwarding path of data packets. IS-IS protocol information may include one or more of the following information: routing device identification; neighbor relationship. IS-IS routing devices establish neighbor relationships with adjacent routing devices to exchange link state data packets and routing information; attribute and policy information, such as metric, cost, priority, etc., which are used to influence routing selection and forwarding behavior.

PBR策略是一种网络路由策略,用于根据特定的条件或策略规则(如源地址、端口、协议、DSCP等),将数据包从源地址转发到目的地址,可以根据其他因素来决定数据包的转发路径。通过配置PBR策略,可以根据数据包的源地址或源子网选择特定的转发路径,也可以根据数据包的源或目的端口、协议类型选择特定的转发路径,还可以根据数据包的DSCP值或服务质量要求选择特定的转发路径,并可以对不同的转发路径进行优先级排序。PBR可以包括以下信息中的一种或多种:匹配条件,指定用于匹配数据包的条件,如源地址、目的地址、端口、协议、DSCP等;转发路径,指定数据包匹配成功后应该转发的路径或下一跳;策略规则,定义了如何根据匹配条件选择转发路径的规则;优先级,指定不同策略规则的优先级,以确定应用哪个规则来选择转发路径。PBR policy is a network routing policy used to forward data packets from the source address to the destination address according to specific conditions or policy rules (such as source address, port, protocol, DSCP, etc.), and can determine the forwarding path of data packets based on other factors. By configuring the PBR policy, you can select a specific forwarding path based on the source address or source subnet of the data packet, or based on the source or destination port, protocol type of the data packet, or based on the DSCP value of the data packet or the quality of service requirement, and you can prioritize different forwarding paths. PBR can include one or more of the following information: matching conditions, which specify the conditions used to match data packets, such as source address, destination address, port, protocol, DSCP, etc.; forwarding path, which specifies the path or next hop to which the data packet should be forwarded after a successful match; policy rules, which define the rules for how to select a forwarding path based on the matching conditions; priority, which specifies the priority of different policy rules to determine which rule to apply to select the forwarding path.

SR策略是一种基于隧道分段技术的路由策略,通过在数据包头部添加分段标记来指示转发路径,从而实现对数据包转发的精确控制。SR策略可以根据具体的服务需求,定义多个路径和策略规则,灵活地调整和优化流量的转发路径。SR策略的配置可以通过编程接口进行动态管理,以满足实时的网络需求。SR信息是指在SR策略中用于指示转发路径的信息。SR policy is a routing policy based on tunnel segmentation technology. It adds segmentation marks to the packet header to indicate the forwarding path, thereby achieving precise control over packet forwarding. SR policy can define multiple paths and policy rules based on specific service requirements, and flexibly adjust and optimize the forwarding path of traffic. The configuration of SR policy can be dynamically managed through programming interfaces to meet real-time network requirements. SR information refers to the information used to indicate the forwarding path in SR policy.

在大规模复杂网络中,需要兼容多种协议和策略,路由模拟通过收集和分析网络拓扑信息和路由设备配置信息,创建虚拟的网络环境,并配置路由设备和链路的属性,然后使用模拟算法模拟路由设备之间的协议运行和信息交换,模拟数据包的传输和转发过程,从而输出准确多维的路由信息,进而构建准确的流量分布图。In large-scale complex networks, compatibility with multiple protocols and strategies is required. Routing simulation creates a virtual network environment by collecting and analyzing network topology information and routing device configuration information, and configures the properties of routing devices and links. It then uses simulation algorithms to simulate protocol operation and information exchange between routing devices, and simulates the transmission and forwarding process of data packets, thereby outputting accurate and multi-dimensional routing information and building an accurate traffic distribution map.

实施例二Embodiment 2

本申请实施例提供一种流量确定方法,其中,实施例一至少部分的技术方案和相应的技术效果可以引用到本申请实施例中。图5示出根据本申请实施例的流量确定方法的流程图。如图5所示,该流量确定方法包括:The embodiment of the present application provides a flow determination method, wherein at least part of the technical solutions and corresponding technical effects of the first embodiment can be referenced to the embodiment of the present application. FIG5 shows a flow chart of the flow determination method according to the embodiment of the present application. As shown in FIG5, the flow determination method includes:

步骤S501:从流入目标网络的多条待选数据流中,筛选出多条目标数据流;其中,目标数据流的数量小于待选数据流的数量;Step S501: Filtering out a plurality of target data flows from a plurality of candidate data flows flowing into a target network; wherein the number of target data flows is less than the number of candidate data flows;

步骤S502:将多条待选数据流的总流量作为多条目标数据流的总流量,为各目标数据流分配流量;Step S502: taking the total flow of the multiple data flows to be selected as the total flow of the multiple target data flows, and allocating flow to each target data flow;

步骤S503:基于目标网络的路由信息,为流入目标网络的多条目标数据流构建流量分布图;其中,路由信息包括用于确定数据流转发状态的信息;流量分布图中的一个节点表示一条目标数据流的一个转发状态;转发状态包括当前地址和下一跳信息;当前地址包括当前设备的端口或当前设备的逻辑状态位置;下一跳信息包括下一跳的路由设备标识、下一跳的隧道分段标识或下一跳为待查找的标识信息;Step S503: Based on the routing information of the target network, construct a flow for multiple target data flows flowing into the target network. A traffic distribution diagram; wherein the routing information includes information for determining the forwarding state of a data flow; a node in the traffic distribution diagram represents a forwarding state of a target data flow; the forwarding state includes the current address and the next hop information; the current address includes the port of the current device or the logical state position of the current device; the next hop information includes the routing device identifier of the next hop, the tunnel segment identifier of the next hop, or the identifier information of the next hop to be found;

步骤S504:利用流量分布图中各节点之间的连接边上的流量,确定目标网络中各路由设备之间的传输链路上的流量。Step S504: using the traffic on the connection edges between the nodes in the traffic distribution graph, determine the traffic on the transmission links between the routing devices in the target network.

其中,步骤S503可以采用与步骤S401相同或相类似的实施方式,步骤S504可以采用与步骤S402相同或相类似的实施方式。Among them, step S503 can adopt the same or similar implementation as step S401, and step S504 can adopt the same or similar implementation as step S402.

在真实网络中,输入的流量快照规模非常大,每秒输入的数据流可以达到数千甚至数十万条,如果对输入目标网络的每条数据流均进行转发路径的流量计算,对机器性能(如CPU和内存等)的要求非常高,且非常耗时和影响效率。因此,可以从流入目标网络的多条待选数据流中,筛选出若干目标数据流,进行合理的流数缩减,并将总流量按照预设的分配比例分配给各目标数据流,从而在不影响计算结果的前提下,降低计算量,提高流量分布的构建效率,进而提高流量验证的效率,降低对机器性能的要求。In a real network, the input traffic snapshot scale is very large, and the number of data streams input per second can reach thousands or even hundreds of thousands. If the traffic calculation of the forwarding path is performed for each data stream input to the target network, the requirements for machine performance (such as CPU and memory, etc.) are very high, and it is very time-consuming and affects efficiency. Therefore, it is possible to screen out several target data streams from the multiple candidate data streams flowing into the target network, perform reasonable flow reduction, and distribute the total traffic to each target data stream according to the preset distribution ratio, thereby reducing the amount of calculation without affecting the calculation results, improving the efficiency of building the traffic distribution, and then improving the efficiency of traffic verification and reducing the requirements for machine performance.

示例性地,可以从1000条待选数据流中筛选出500条目标数据流,并将这1000条待选数据流的总流量1000Gps平均分配给这500条目标数据流,每条目标数据流的流量均为2Gps。或者,根据为每条目标数据流设置的分配比例,将总流量分配给每条目标数据流。For example, 500 target data flows can be selected from 1000 candidate data flows, and the total flow of 1000 Gps of the 1000 candidate data flows is evenly distributed to the 500 target data flows, and the flow of each target data flow is 2 Gps. Alternatively, the total flow is distributed to each target data flow according to the distribution ratio set for each target data flow.

在一种实施方式中,在步骤S501中,从流入目标网络的多条待选数据流中,筛选出多条目标数据流,可以包括:基于待选数据流的流量在所述多条待选数据流的总流量中的占比,确定待选数据流的抽中概率;其中,抽中概率与占比正相关;根据各待选数据流的抽中概率,在多条待选数据流中进行预设次数的随机抽样,得到第一预设数量的目标数据流。In one embodiment, in step S501, screening out multiple target data streams from multiple candidate data streams flowing into the target network may include: determining the probability of selecting the candidate data stream based on the proportion of the traffic of the candidate data stream in the total traffic of the multiple candidate data streams; wherein the probability of selecting is positively correlated with the proportion; and performing a preset number of random samplings among the multiple candidate data streams according to the probability of selecting each candidate data stream, to obtain a first preset number of target data streams.

表1示出了一个简单的流量快照的例子。此例中,一共有4条待选数据流,每条对应表格中的一行。每条待选数据流包含一个源IP地址、目的IP地址,以及此待选数据流携带的流量。
Table 1 shows an example of a simple traffic snapshot. In this example, there are 4 candidate data flows, each corresponding to a row in the table. Each candidate data flow includes a source IP address, a destination IP address, and the traffic carried by the candidate data flow.

表1Table 1

本实施方式提供了一种基于流量占比的流抽样算法。在表1的例子中,随机抽样的预设次数为2,即将进行2次随机抽样。目标数据流的数量即第一预设数量为2条,因此,如果预设的分配比例为平均分配,那么2条目标数据流均将被赋予1/2的总流量。具体地,每次抽样中,各条待选数据流被抽中的概率为其流量占总流量的比例。因此,第一条待选数据流被抽中概率为10/(10+20+30+40)=10%,第二条待选数据流被抽中概率为20/(10+20+30+40)=20%,以此类推。假设第一次抽样抽中的流是第二条待选数据流(即源地址为10.0.0.2的待选数据流),将为其赋予1/2的总流量,即50Gbps。假设第二次抽样被抽中的待选数据流是第三条待选数据流,也将为其赋予1/2的总流量,即50Gbps。两次随机抽样结束后,将得到表2的流量快照:
This embodiment provides a flow sampling algorithm based on flow proportion. In the example of Table 1, the preset number of random sampling is 2, that is, 2 random samplings are performed. The number of target data flows, i.e., the first preset number, is 2. Therefore, if the preset allocation ratio is an average distribution, then both target data flows will be assigned 1/2 of the total traffic. Specifically, in each sampling, the probability of each candidate data flow being selected is the proportion of its traffic to the total traffic. Therefore, the probability of the first candidate data flow being selected is 10/(10+20+30+40)=10%, the probability of the second candidate data flow being selected is 20/(10+20+30+40)=20%, and so on. Assuming that the flow selected in the first sampling is the second candidate data flow (that is, the candidate data flow with a source address of 10.0.0.2), it will be assigned 1/2 of the total traffic, that is, 50Gbps. Assuming that the candidate data flow selected in the second sampling is the third candidate data flow, it will also be assigned 1/2 of the total traffic, that is, 50Gbps. After two random samplings, the traffic snapshot in Table 2 will be obtained:

表2Table 2

可以看出,流入目标网络的总流量保持不变,同时数据流的数量由4条缩减为2条,从而缩减了流量快照的规模,同时保持了流量验证的准确性。It can be seen that the total traffic flowing into the target network remains unchanged, while the number of data flows is reduced from 4 to 2, thereby reducing the size of the traffic snapshot while maintaining the accuracy of traffic verification.

在一种实施方式中,路由信息包括路由表项,在步骤S501中,从流入目标网络的多条待选数据流中,筛选出多条目标数据流,可以包括:基于待选数据流的目的地址与路由表项之间的匹配性,将多条待选数据流分成多组,其中,匹配于同一路由表项的待选数据流为同一组;从每组待选数据流中筛选第二预设数量的目标数据流。In one embodiment, the routing information includes routing table entries. In step S501, multiple target data streams are screened out from multiple candidate data streams flowing into the target network, which may include: based on the matching between the destination addresses of the candidate data streams and the routing table entries, the multiple candidate data streams are divided into multiple groups, wherein the candidate data streams matching the same routing table entry are in the same group; and a second preset number of target data streams are screened out from each group of candidate data streams.

真实网络中,流量快照中的数据流在网络中的转发行为可能是完全一致的。因此,重复地对这些数据流计算转发行为将大大降低模拟效率。因此,本实施方式提供了一种基于路由等价性的等价类优化算法,针对转发行为一致的数据流进行合并或部分筛选,从而避免重复计算。In a real network, the forwarding behavior of the data flows in the traffic snapshot may be completely consistent in the network. Therefore, repeatedly calculating the forwarding behavior of these data flows will greatly reduce the simulation efficiency. Therefore, this embodiment provides an equivalence class optimization algorithm based on routing equivalence, which merges or partially screens data flows with consistent forwarding behavior to avoid repeated calculations.

路由表项是路由表中的每一条记录,属于路由信息中的一种。一条路由表项包含了目的地网络的地址(如10.0.0.0/24)、下一跳的路由设备标识以及其他相关的属性,用于指导路由设备(如路由器、交换机等)根据目的地网络的地址来决定数据包的转发路径。A routing table entry is a record in a routing table and is a type of routing information. A routing table entry contains the address of the destination network (such as 10.0.0.0/24), the next-hop routing device identifier, and other related attributes, which are used to guide routing devices (such as routers, switches, etc.) to determine the forwarding path of data packets based on the address of the destination network.

具体地,对于每个路由表项,根据待选数据流的目的地址(目的IP地址),确定与该路由表项的目的地网络的地址匹配的待选数据流并归为同一组;从每组待选数据流筛选第二预设数量的目标数据流,得到的目标数据流的总数量即为第二预设数量乘以组数。第二预设数量可以为1,也可以为该组数据流的数量乘以一个预设比例得到的值。Specifically, for each routing table entry, according to the destination address (destination IP address) of the candidate data stream, the candidate data streams matching the address of the destination network of the routing table entry are determined and grouped into the same group; a second preset number of target data streams are screened from each group of candidate data streams, and the total number of target data streams obtained is the second preset number multiplied by the number of groups. The second preset number can be 1, or it can be a value obtained by multiplying the number of the group of data streams by a preset ratio.

例如,对于表2中的2条数据流,其会匹配上20.0.0.0/24的路由表项,因此它们属于一个等价类,将划分为同一组。对于同一组的数据流,只取其中的1条,同时将该组中所有数据流的流量赋予该条数据流,从而构建新的流量快照,如表3。由此可见,流量快照的规模得到了缩减,同时也保持了流量验证的正确性。

For example, for the two data flows in Table 2, they will match the routing table entry of 20.0.0.0/24, so they belong to an equivalence class and will be divided into the same group. For the data flows in the same group, only one of them is taken, and the traffic of all data flows in the group is assigned to the data flow, so as to construct a new traffic snapshot, as shown in Table 3. It can be seen that the scale of the traffic snapshot has been reduced, while maintaining the correctness of traffic verification.

表3Table 3

在一种实施方式中,基于待选数据流的目的地址与路由表项之间的匹配性,将多条待选数据流分成多组,包括:根据路由表项的目的地网络地址的前缀长度由长到短,对目标网络中的各路由表项进行排序;依序确定与各路由表项分别匹配的待选数据流,得到与各路由表项一一对应的多组待选数据流。In one embodiment, based on the matching between the destination address of the candidate data stream and the routing table entry, multiple candidate data streams are divided into multiple groups, including: sorting the routing table entries in the target network from long to short according to the prefix length of the destination network address of the routing table entry; sequentially determining the candidate data stream that matches each routing table entry, and obtaining multiple groups of candidate data streams corresponding to each routing table entry.

其中,路由表项的目的地网络地址的前缀长度体现了路由表项的粒度,前缀长度越长,即子网掩码中连续的1的个数越多,表示目的地网络的范围越小,路由表项的粒度也就越细;前缀长度越短,即子网掩码中连续的1的个数越少,表示目的地网络的范围越大,路由表项的粒度也就越粗。因此,根据路由表项的目的地网络地址的前缀长度由长到短,对目标网络中的各路由表项进行排序,也就是按照粒度从细到粗的顺序对各路由表项进行排序。Among them, the prefix length of the destination network address of the routing table entry reflects the granularity of the routing table entry. The longer the prefix length, that is, the more consecutive 1s in the subnet mask, the smaller the range of the destination network, and the finer the granularity of the routing table entry; the shorter the prefix length, that is, the fewer consecutive 1s in the subnet mask, the larger the range of the destination network, and the coarser the granularity of the routing table entry. Therefore, according to the prefix length of the destination network address of the routing table entry from long to short, the routing table entries in the target network are sorted, that is, the routing table entries are sorted in the order of granularity from fine to coarse.

示例性地,假设注入网络的路由(路由表项)有3条,分别是10.0.0.0/8,10.0.0.0/24,20.0.0.0/24,按照最细到最粗的粒度排序对这3条路由表项进行排序,那么排序完后的顺序是10.0.0.0/24,20.0.0.0/24,10.0.0.0/8。然后,对于流量快照中的数据流,按照顺序分别匹配这些路由表项;匹配上同一条路由表项的数据流则归于一个等价类。然后,再从每组待选数据流中筛选出目标数据流。由此可以提高筛选效率,进而提高流量分布图的构建效率。For example, suppose there are three routes (routing table items) injected into the network, namely 10.0.0.0/8, 10.0.0.0/24, and 20.0.0.0/24. These three routing table items are sorted from the finest to the coarsest granularity, and the order after sorting is 10.0.0.0/24, 20.0.0.0/24, and 10.0.0.0/8. Then, for the data flows in the traffic snapshot, these routing table items are matched in order; data flows that match the same routing table item are classified into an equivalence class. Then, the target data flow is screened out from each group of candidate data flows. This can improve the screening efficiency, and thus improve the efficiency of building the traffic distribution map.

需要说明的是,本申请实施例中的基于流量占比的流抽样算法和基于路由等价性的等价类优化算法均可以用来对输入的待选数据流进行流数缩减,可以根据实际需求选择其中一种算法执行,也可以选择两种算法执行,例如先执行流抽样算法,筛选出第一目标数据流,然后基于等价类优化算法,从第一目标数据流中筛选出第二目标数据流,然后将第二目标数据流作为构建流量分布图的数据流。当然,对于两种算法的执行顺序和执行次数,本申请实施例不作限定。It should be noted that the flow sampling algorithm based on flow proportion and the equivalence class optimization algorithm based on routing equivalence in the embodiment of the present application can both be used to reduce the number of flows of the input candidate data flow, and one of the algorithms can be selected for execution according to actual needs, or both algorithms can be selected for execution, for example, the flow sampling algorithm is first executed to filter out the first target data flow, and then based on the equivalence class optimization algorithm, the second target data flow is filtered out from the first target data flow, and then the second target data flow is used as the data flow for constructing the flow distribution diagram. Of course, the execution order and execution times of the two algorithms are not limited in the embodiment of the present application.

在一个应用示例中,如图6所示,针对输入目标网络的流量快照,即当前单位时间下的多个待选数据流,可以按照本申请实施例中的基于流量占比的流抽样算法和基于路由等价性的等价类优化算法,从多个待选数据流中筛选出目标数据流,实现流数缩减,减少流量快照的规模,从而为提高流量模拟和流量验证的效率提供基础;针对目标网络的目标数据流,可以基于实施例一的方法进行路由模拟,并构建流量分布图进行流量模拟;然后,计算每条数据流在流量分布图上的流量分布,进而映射计算网络拓扑中各路由设备之间的传输链路在流量快照下的流量分布,即得到传输链路上的流量;进一步地,基于网络中各传输链路的流量分布,验证各个传输链路承载的流量是否满足流量验证项的要求,例如根据流量水位预期的标准值,进行水位是否超标,水位是否过低以及网络变更前后水位变化过大等多种预期目标的验证,输出通过验证或不通过验证的验证结果,提高网络稳定性。In an application example, as shown in FIG6 , for the traffic snapshot of the input target network, that is, multiple candidate data flows under the current unit time, the target data flow can be screened out from the multiple candidate data flows according to the flow sampling algorithm based on the flow proportion and the equivalence class optimization algorithm based on the routing equivalence in the embodiment of the present application, so as to reduce the number of flows and reduce the scale of the traffic snapshot, thereby providing a basis for improving the efficiency of traffic simulation and traffic verification; for the target data flow of the target network, routing simulation can be performed based on the method of the first embodiment, and a traffic distribution map can be constructed for traffic simulation; then, the traffic distribution of each data flow on the traffic distribution map is calculated, and then the traffic distribution of the transmission links between each routing device in the network topology under the traffic snapshot is mapped and calculated, that is, the traffic on the transmission link is obtained; further, based on the traffic distribution of each transmission link in the network, it is verified whether the traffic carried by each transmission link meets the requirements of the traffic verification item, for example, according to the expected standard value of the traffic water level, whether the water level exceeds the standard, whether the water level is too low, and whether the water level changes too much before and after the network change, and other expected goals are verified, and the verification result of passing or failing the verification is output to improve the network stability.

实施例三Embodiment 3

随着网络变化的频率和规模越来越大,例如链路故障、维护、设备升级、配置变更等。网络变化后,网络管理人员需要及时、准确地知道网络传输链路上的流量水位变化情况,以判断水位变化是否符合预期变化条件(或预设变化条件)。例如,某一传输链路故障后,其它传输链路的流量水位不能超过带宽的80%。As the frequency and scale of network changes increase, such as link failures, maintenance, equipment upgrades, configuration changes, etc., network managers need to know the changes in traffic levels on network transmission links in a timely and accurate manner after network changes to determine whether the changes in traffic levels meet the expected change conditions (or preset change conditions). For example, after a transmission link fails, the traffic levels of other transmission links cannot exceed 80% of the bandwidth.

现有的网络流量验证技术需要对变化后的网络重新进行流量模拟,通过对比变化前后的流量水位,从而验证其变化是否符合网络管理人员的预设变化条件。现有的网络流量验证技术中,即使只有一条传输链路的流量水位发生了变化,也必须对全部传输链路的流量水位进行重新模拟计算,因此无法高效及时地知道网络传输链路上的流量水位变化情况。The existing network traffic verification technology requires re-simulating the traffic of the changed network, and by comparing the traffic water level before and after the change, it is verified whether the change meets the preset change conditions of the network administrator. In the existing network traffic verification technology, even if the traffic water level of only one transmission link has changed, the traffic water level of all transmission links must be re-simulated and calculated, so it is impossible to know the traffic water level changes on the network transmission links efficiently and timely.

请参阅图1,假设路由设备B-E之间的传输链路因为故障不能正常承载流量,从而导致目标网络中的路由信息发生变化。在此情形下,原来经过A-B-E的流量将由A-D-F和A-C-F分担。所以A-C,A-D,D-F和C-F上的流量将相应增加。在真实网络环境下,如何知道是哪些传输链路上的流量会发生变化以及变化的大小是多少。如果按照现有的解决方案对变化后的网络重新进行流量模拟,然后通过对比每条传输链路上的流量变化来解决该问题,将进行大量的重复计算,大大降低流量变化验证的效率。例如,G-A上的流量不会因B-E故障而发生变化,所以无需计算其变化。Please refer to Figure 1. Assume that the transmission link between routing devices B-E cannot carry traffic normally due to a fault, resulting in changes in the routing information in the target network. In this case, the traffic that originally passed through A-B-E will be shared by A-D-F and A-C-F. Therefore, the traffic on A-C, A-D, D-F, and C-F will increase accordingly. In a real network environment, how do you know which transmission links will change traffic and how much the change is? If you re-simulate the traffic on the changed network according to the existing solution, and then solve the problem by comparing the traffic changes on each transmission link, a large number of repeated calculations will be performed, greatly reducing the efficiency of traffic change verification. For example, the traffic on G-A will not change due to the failure of B-E, so there is no need to calculate its change.

本申请实施例提供一种流量确定方法,其中,实施例一和/或实施例二至少部分的技术方案和相应的技术效果可以引用到本申请实施例中。图7示出根据本申请实施例的流量确定方法的流程图。如图7所示,该流量确定方法包括:The embodiment of the present application provides a flow determination method, wherein at least part of the technical solutions and corresponding technical effects of embodiment 1 and/or embodiment 2 can be referenced to the embodiment of the present application. FIG7 shows a flow chart of the flow determination method according to the embodiment of the present application. As shown in FIG7, the flow determination method includes:

步骤S701:基于目标网络的路由信息,为流入目标网络的多条目标数据流构建流量分布图;其中,路由信息包括用于确定数据流转发状态的信息;流量分布图中的一个节点表示一条目标数据流的一个转发状态;转发状态包括当前地址和下一跳信息;Step S701: constructing a traffic distribution graph for multiple target data flows flowing into the target network based on the routing information of the target network; wherein the routing information includes information for determining the forwarding state of the data flow; a node in the traffic distribution graph represents a forwarding state of a target data flow; the forwarding state includes the current address and the next hop information;

步骤S702:利用流量分布图中各节点之间的连接边上的流量,确定目标网络中各路由设备之间的传输链路上的流量。Step S702: using the traffic on the connection edges between the nodes in the traffic distribution graph, determine the traffic on the transmission links between the routing devices in the target network.

步骤S703:响应于目标网络的路由信息发生变化,确定流量分布图中发生变化的目标节点;Step S703: In response to a change in routing information of the target network, determining a changed target node in the traffic distribution graph;

步骤S704:更新与目标节点连接的目标连接边上的流量;Step S704: Update the flow on the target connection edge connected to the target node;

步骤S705:利用更新后的目标连接边上的流量,计算与目标连接边对应的传输链路上的流量。Step S705: using the updated traffic on the target connection edge, calculate the traffic on the transmission link corresponding to the target connection edge.

其中,步骤S701可以采用与步骤S401相同或相类似的实施方式,步骤S702可以采用与步骤S402相同或相类似的实施方式。示例性地,请参阅图1,在当前单位时间内,假设有两条数据流f1和f2,分别通过路由设备A和路由设备G进入包括AS100和AS200D的目标网络,其中f1的速率稳定在8Gbps,而f2的速率在2Gbps至12Gbps间波动。基于实施例一和/或实施例二的方法,可以构建流量分布图,如图3所示,基于流量分布图可以确定目标网络中各传输链路上的流量。Among them, step S701 can adopt the same or similar implementation as step S401, and step S702 can adopt the same or similar implementation as step S402. For example, please refer to Figure 1. In the current unit time, it is assumed that there are two data flows f1 and f2, which enter the target network including AS100 and AS200D through routing device A and routing device G respectively, where the rate of f1 is stable at 8Gbps, and the rate of f2 fluctuates between 2Gbps and 12Gbps. Based on the method of embodiment 1 and/or embodiment 2, a traffic distribution diagram can be constructed, as shown in Figure 3. The traffic distribution diagram can be used to determine the traffic on each transmission link in the target network.

示例性地,传输链路故障、维护、设备升级、配置变更等网络变化,将会导致目标网络的路由信息发生变化。例如,在图1所示的目标网络中,假设路由设备B-E之间的传输链路因为故障不能正常承载流量,从而导致目标网络中的路由信息发生变化。下面结合图8、图9和图10介绍确定流量分布图中发生变化的目标节点以及更新与目标节点相连接的目标连接边上的流量的一个具体示例。Exemplarily, network changes such as transmission link failure, maintenance, equipment upgrade, configuration change, etc. will cause the routing information of the target network to change. For example, in the target network shown in FIG1 , it is assumed that the transmission link between routing devices B-E cannot carry traffic normally due to a failure, which causes the routing information in the target network to change. The following is a specific example of determining the target node that has changed in the traffic distribution graph and updating the traffic on the target connection edge connected to the target node in conjunction with FIG8 , FIG9 , and FIG10 .

如图8所示,传输链路B-E故障下,路由设备A、B、E的路由表会重新收敛,从而影响数据流的转发状态,由此会影响流量分布图的部分节点,即目标节点:节点n1、n2、n4-n9。因此,在进行步骤S704的增量模拟计算之前,可以标记这些目标节点,表明其连接的连接边会发生变化,包括连接状态变化或者权重变化。如图9所示,由于n5-n6间的连接边对应传输链路A-B,而在传输链路B-E故障后,路由设备A将不再通过传输链路A-B转发数据流的流量,所以n5-n6间的连接边承载的流量由5G降至0G。如图10所示,由于路由设备A将原来在传输链路A-B-E的流量转发向传输链路A-C-F和A-D-F,所以n1-n2间的连接边上的流量将降至0G,而n1-n3上的流量增加至10G。同时,由进入n3的流量发生了变化,因此,n3-n10、n3-n11及后续的连接边上的流量将会被更新,而其它连接边由于不受目标节点的变化影响,其上的流量则不会发生变化。当所有发生变化的目标节点相连接的目标连接边的流量更新完成,将得到网络变化后的流量分布图,从而避免了重复计算不必要的节点和流量。As shown in FIG8 , when the transmission link BE fails, the routing tables of routing devices A, B, and E will reconverge, thereby affecting the forwarding state of the data flow, thereby affecting some nodes of the traffic distribution diagram, namely, the target nodes: nodes n1 , n2 , and n4 -n9 . Therefore, before performing the incremental simulation calculation of step S704 , these target nodes can be marked to indicate that the connection edges connected to them will change, including connection state changes or weight changes. As shown in FIG9 , since the connection edge between n5 -n6 corresponds to the transmission link AB, and after the transmission link BE fails, routing device A will no longer forward the traffic of the data flow through the transmission link AB, so the traffic carried by the connection edge between n5 -n6 is reduced from 5G to 0G. As shown in FIG10 , since routing device A forwards the traffic originally on the transmission link ABE to the transmission links ACF and ADF, the traffic on the connection edge between n1 -n2 will be reduced to 0G, while the traffic on n1 -n3 will increase to 10G. At the same time, the traffic entering n3 has changed, so the traffic on n3 -n10 , n3 -n11 and subsequent connection edges will be updated, while the traffic on other connection edges will not change because they are not affected by the change of the target node. When the traffic updates of all target connection edges connected to the changed target nodes are completed, the traffic distribution diagram after the network change will be obtained, thus avoiding repeated calculation of unnecessary nodes and traffic.

根据本申请实施例的方法,当网络发生变化导致路由信息变化时,可以仅计算因此变化而引起的传输链路上的流量水位变化,从而避免对未变化的传输链路流量水位进行复杂的重新模拟计算,大大提高网络变化下的流量水位变化的模拟效率。According to the method of the embodiment of the present application, when the network changes resulting in changes in routing information, only the traffic level changes on the transmission link caused by the changes can be calculated, thereby avoiding complex re-simulation calculations of the traffic level of the unchanged transmission link, greatly improving the simulation efficiency of traffic level changes under network changes.

在一种实施方式中,在步骤S705之后还可以包括:验证目标网络中是否存在流量变化不符合预设变化条件的传输链路。In one implementation, after step S705, the method may further include: verifying whether there is a transmission link in the target network whose traffic change does not meet a preset change condition.

其中,预设变化条件可以是网络管理人员在网络变化中对流量水位改变的预期目标,如某一传输链路故障后,其它传输链路的流量水位不能超过带宽的80%。当网络发生变化后,本申请实施例的方法可以直接得到因此变化而引起的传输链路上的流量水位变化,进而快速验证流量水位变化是否符合预期目标,从而有效减少、避免可能出现的网络变化中的网络稳定性问题。The preset change condition may be the expected target of the network administrator for the change of the flow level in the network change, such as after a transmission link fails, the flow level of other transmission links cannot exceed 80% of the bandwidth. When the network changes, the method of the embodiment of the present application can directly obtain the flow level change on the transmission link caused by the change, and then quickly verify whether the flow level change meets the expected target, thereby effectively reducing and avoiding the network stability problem that may occur in the network change.

在一个应用示例中,如图11所示,针对输入目标网络的流量快照,即当前单位时间下的多个待选数据流,可以基于实施例一或实施例二的方法进行路由模拟,并构建流量分布图进行流量模拟;然后,计算每条数据流在流量分布图上的流量分布,进而映射计算网络拓扑中各路由设备之间的传输链路在流量快照下的流量分布,即得到传输链路上的流量;进一步地,当网络发生变化导致路由信息变化时,仅计算因此变化而引起的传输链路上的流量水位变化,即进行增量流量模拟;然后结合预设变化条件等流量水位变化预期,快速验证流量水位变化是否符合预期,输出满足预期或不满足预期的验证结果,提高网络稳定性。In an application example, as shown in FIG11 , for a traffic snapshot of an input target network, that is, a plurality of candidate data flows under the current unit time, routing simulation can be performed based on the method of Embodiment 1 or Embodiment 2, and a traffic distribution graph can be constructed for traffic simulation; then, the traffic distribution of each data flow on the traffic distribution graph is calculated, and then the traffic distribution of the transmission link between each routing device in the network topology under the traffic snapshot is mapped and calculated, that is, the traffic on the transmission link is obtained; further, when the network changes and causes the routing information to change, only the traffic level change on the transmission link caused by the change is calculated, that is, incremental traffic simulation is performed; then, combined with the traffic level change expectations such as preset change conditions, it is quickly verified whether the traffic level change meets expectations, and the output meets expectations or does not meet expectations. Expected verification results, improving network stability.

实施例四Embodiment 4

与本申请实施例提供的应用场景以及实施例一至三的方法相对应地,本申请实施例还提供一种流量处理装置,如图12所示,该流量处理装置包括:流量分布图构建模块1201,用于基于目标网络的路由信息,为流入目标网络的多条目标数据流构建流量分布图;其中,路由信息包括用于确定数据流转发状态的信息;流量分布图中的一个节点表示一条目标数据流的一个转发状态;转发状态包括当前地址和下一跳信息;下一跳信息包括下一跳的路由设备标识、下一跳的隧道分段标识或下一跳为待查找的标识信息;传输链路流量确定模块1202,用于利用流量分布图中各节点之间的连接边上的流量,确定目标网络中各路由设备之间的传输链路上的流量。Corresponding to the application scenario provided by the embodiment of the present application and the methods of embodiments one to three, the embodiment of the present application also provides a traffic processing device, as shown in Figure 12, the traffic processing device includes: a traffic distribution map construction module 1201, which is used to construct a traffic distribution map for multiple target data streams flowing into the target network based on the routing information of the target network; wherein the routing information includes information for determining the forwarding state of the data stream; a node in the traffic distribution map represents a forwarding state of a target data stream; the forwarding state includes the current address and next hop information; the next hop information includes the routing device identifier of the next hop, the tunnel segment identifier of the next hop, or the identifier information of the next hop to be found; a transmission link traffic determination module 1202, which is used to use the traffic on the connection edges between the nodes in the traffic distribution map to determine the traffic on the transmission link between the routing devices in the target network.

在一种实施方式中,路由信息还包括用于确定数据流转发比例的信息;连接边设置有权重,用于确定上一节点的目标数据流转发至下一节点的流量比例。In one embodiment, the routing information also includes information for determining the forwarding ratio of data flow; the connection edge is provided with a weight for determining the flow ratio of the target data flow of the previous node forwarded to the next node.

在一种实施方式中,该流量确定装置还包括路由信息生成模块,用于根据目标网络的路由设备连接关系以及配置信息,模拟各路由设备对数据流的转发,生成路由信息;其中,配置信息包括边界网关协议BGP信息、中间系统到中间系统IS-IS协议信息、基于策略的路由PBR信息和分段路由SR信息中的至少一种。In one embodiment, the traffic determination device also includes a routing information generation module, which is used to simulate the forwarding of data streams by each routing device according to the connection relationship and configuration information of the routing devices of the target network, and generate routing information; wherein the configuration information includes at least one of Border Gateway Protocol BGP information, Intermediate System to Intermediate System IS-IS protocol information, Policy-based Routing PBR information and Segment Routing SR information.

在一种实施方式中,该流量确定装置还包括筛选模块,用于从流入目标网络的多条待选数据流中,筛选出多条目标数据流;其中,目标数据流的数量小于待选数据流的数量;以及将多条待选数据流的总流量分配给各目标数据流。In one embodiment, the traffic determination device also includes a screening module for screening out multiple target data flows from multiple candidate data flows flowing into the target network; wherein the number of target data flows is less than the number of candidate data flows; and allocating the total traffic of the multiple candidate data flows to each target data flow.

在一种实施方式中,筛选模块还具体用于在多条待选数据流中进行预设次数的随机抽样,得到第一预设数量的目标数据流;其中,待选数据流的抽中概率与待选数据流的流量在多条待选数据流的总流量中的占比正相关。In one embodiment, the screening module is also specifically used to perform a preset number of random samplings among multiple data streams to be selected to obtain a first preset number of target data streams; wherein the probability of selecting a data stream to be selected is positively correlated with the proportion of the traffic of the data stream to be selected in the total traffic of the multiple data streams to be selected.

在一种实施方式中,路由信息包括路由表项,筛选模块还具体用于基于各待选数据流的目的地址与目标网络中的各路由表项之间的匹配性,将匹配于同一路由表项的待选数据流归为同一组;从各组待选数据流中分别筛选第二预设数量的目标数据流。In one embodiment, the routing information includes routing table entries, and the screening module is further specifically used to group the candidate data streams matching the same routing table entry into the same group based on the matching between the destination address of each candidate data stream and each routing table entry in the target network; and to screen a second preset number of target data streams from each group of candidate data streams.

在一种实施方式中,筛选模块还具体用于根据路由表项的目的地网络地址的前缀长度由长到短,对目标网络中的各路由表项进行排序;依序分别确定匹配于各路由表项的待选数据流,得到多组待选数据流。In one embodiment, the screening module is also specifically used to sort the routing table entries in the target network according to the prefix length of the destination network address of the routing table entry from long to short; determine the candidate data flow matching each routing table entry in sequence, and obtain multiple groups of candidate data flows.

在一种实施方式中,该流量确定装置还包括更新模块,用于:响应于目标网络的路由信息发生变化,确定流量分布图中发生变化的目标节点;更新与目标节点相连接的目标连接边上的流量;利用目标连接边上的流量,计算与目标连接边对应的传输链路上的流量。In one embodiment, the traffic determination device also includes an update module, which is used to: determine the changed target node in the traffic distribution diagram in response to changes in the routing information of the target network; update the traffic on the target connection edge connected to the target node; and use the traffic on the target connection edge to calculate the traffic on the transmission link corresponding to the target connection edge.

在一种实施方式中,该流量确定装置还包括验证模块,用于验证目标网络中是否存在流量变化不符合预设变化条件的传输链路。In one embodiment, the traffic determination device further includes a verification module for verifying whether there is a transmission link in the target network whose traffic change does not meet a preset change condition.

在一种实施方式中,验证模块还用于验证传输链路上的流量是否符合预设的流量验证规则。In one embodiment, the verification module is also used to verify whether the traffic on the transmission link meets the preset traffic Validation rules.

本申请实施例各装置中的各模块的功能可以参见上述方法中的对应描述,并具备相应的有益效果,在此不再赘述。The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

实施例六Embodiment 6

图13为用来实现本申请实施例的电子路由设备的框图。如图13所示,该电子路由设备包括:存储器1301和处理器1302,存储器1301内存储有可在处理器1302上运行的计算机程序。处理器1302执行该计算机程序时实现上述实施例中的方法。存储器1301和处理器1302的数量可以为一个或多个。FIG13 is a block diagram of an electronic routing device for implementing an embodiment of the present application. As shown in FIG13 , the electronic routing device includes: a memory 1301 and a processor 1302, wherein the memory 1301 stores a computer program that can be run on the processor 1302. When the processor 1302 executes the computer program, the method in the above embodiment is implemented. The number of the memory 1301 and the processor 1302 can be one or more.

该电子路由设备还包括:The electronic routing device also includes:

通信接口1303,用于与外界路由设备进行通信,进行数据交互传输。The communication interface 1303 is used to communicate with external routing devices and perform data exchange transmission.

如果存储器1301、处理器1302和通信接口1303独立实现,则存储器1301、处理器1302和通信接口1303可以通过总线相互连接并完成相互间的通信。该总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部路由设备互连(Peripheral Component Interconnect,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图13中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。If the memory 1301, the processor 1302 and the communication interface 1303 are implemented independently, the memory 1301, the processor 1302 and the communication interface 1303 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in FIG. 13, but it does not mean that there is only one bus or one type of bus.

可选地,在具体实现上,如果存储器1301、处理器1302及通信接口1303集成在一块芯片上,则存储器1301、处理器1302及通信接口1303可以通过内部接口完成相互间的通信。Optionally, in a specific implementation, if the memory 1301, the processor 1302 and the communication interface 1303 are integrated on a chip, the memory 1301, the processor 1302 and the communication interface 1303 can communicate with each other through an internal interface.

本申请实施例提供了一种计算机可读存储介质,其存储有计算机程序,该程序被处理器执行时实现本申请实施例中提供的方法。An embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the method provided in the embodiment of the present application when the program is executed by a processor.

本申请实施例还提供了一种芯片,该芯片包括处理器,用于从存储器中调用并运行存储器中存储的指令,使得安装有芯片的通信路由设备执行本申请实施例提供的方法。An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication routing device equipped with the chip executes the method provided in the embodiment of the present application.

本申请实施例还提供了一种芯片,包括:输入接口、输出接口、处理器和存储器,输入接口、输出接口、处理器以及存储器之间通过内部连接通路相连,处理器用于执行存储器中的代码,当代码被执行时,处理器用于执行申请实施例提供的方法。An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.

应理解的是,上述处理器可以是中央处理器(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程逻辑门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。值得说明的是,处理器可以是支持进阶精简指令集机器(Advanced RISC Machines,ARM)架构的处理器。It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the Advanced RISC Machines (ARM) architecture.

进一步地,可选地,上述存储器可以包括只读存储器和随机访问存储器。该存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以包括只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以包括随机访问存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM均可用。例如,静态随机访问存储器(Static RAM,SRAM)、动态随机访问存储器(Dynamic Random Access Memory,DRAM)、同步动态随机访问存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机访问存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机访问存储器(Enhanced SDRAM,ESDRAM)、同步链接动态随机访问存储器(Sync link DRAM,SLDRAM)和直接内存总线随机访问存储器(Direct Rambus RAM,DR RAM)。Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of exemplary but not limiting description, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生依照本申请的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包括于本申请的至少一个实施例或示例中。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

流程图中描述的或在此以其他方式描述的任何过程或方法可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分。并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能。Any process or method described in the flow chart or otherwise described herein can be understood as a module, fragment or portion of a code representing one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.

在流程图中描述的或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或路由设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或路由设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或路由设备而使用。The logic and/or steps described in the flowcharts or otherwise described herein, for example, may be considered to be An ordered list of executable instructions for implementing logical functions may be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or routing device (e.g., a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, apparatus, or routing device and execute instructions), or used in conjunction with such instruction execution systems, apparatuses, or routing devices.

应理解的是,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。上述实施例方法的全部或部分步骤是可以通过程序来指令相关的硬件完成,该程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.

此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。上述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读存储介质中。该存储介质可以是只读存储器,磁盘或光盘等。以上所述,仅为本申请的示例性实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请记载的技术范围内,可轻易想到其各种变化或替换,这些都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc. The above is only an exemplary embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or replacements within the technical scope recorded in the present application, which should be covered within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection of the claims.

Claims (13)

Translated fromChinese
一种流量确定方法,包括:A flow determination method, comprising:基于目标网络的路由信息,为流入所述目标网络的多条目标数据流构建流量分布图;其中,所述路由信息包括用于确定数据流转发状态的信息;所述流量分布图中的一个节点表示一条目标数据流的一个转发状态;所述转发状态包括当前地址和下一跳信息;Based on the routing information of the target network, a traffic distribution graph is constructed for multiple target data flows flowing into the target network; wherein the routing information includes information for determining the forwarding state of the data flow; a node in the traffic distribution graph represents a forwarding state of a target data flow; the forwarding state includes current address and next hop information;利用所述流量分布图中各节点之间的连接边上的流量,确定所述目标网络中各路由设备之间的传输链路上的流量。The traffic on the connection edges between the nodes in the traffic distribution graph is used to determine the traffic on the transmission links between the routing devices in the target network.根据权利要求1所述的方法,其中,所述路由信息还包括用于确定数据流转发比例的信息;基于目标网络的路由信息,为流入所述目标网络的多条目标数据流构建流量分布图,包括:The method according to claim 1, wherein the routing information further includes information for determining a data flow forwarding ratio; and constructing a traffic distribution graph for multiple target data flows flowing into the target network based on the routing information of the target network, comprising:根据所述路由信息中用于确定数据流转发状态的信息,确定各目标数据流的多个转发状态;Determine multiple forwarding states of each target data flow according to the information used to determine the forwarding state of the data flow in the routing information;根据各目标数据流的各转发状态,构建所述流量分布图中的各节点;Constructing each node in the traffic distribution graph according to each forwarding state of each target data flow;根据各目标数据流流入所述目标网络的流量、所述路由信息中用于确定数据流转发比例的信息、各节点所表示的目标数据流和转发状态,确定各节点之间的连接边上的流量和权重;其中,所述连接边上的权重用于标识所述连接边的上一节点的目标数据流转发至下一节点的流量比例。The traffic and weight on the connection edge between each node are determined based on the traffic of each target data flow flowing into the target network, the information in the routing information used to determine the data flow forwarding ratio, the target data flow represented by each node and the forwarding status; wherein the weight on the connection edge is used to identify the traffic ratio of the target data flow from the previous node of the connection edge forwarded to the next node.根据权利要求1所述的方法,还包括:The method according to claim 1, further comprising:根据所述目标网络的路由设备连接关系以及配置信息,模拟各所述路由设备对数据流的转发,生成所述路由信息;其中,所述配置信息包括边界网关协议BGP信息、中间系统到中间系统IS-IS协议信息、基于策略的路由PBR信息和分段路由SR信息中的至少一种。According to the connection relationship and configuration information of the routing devices of the target network, the forwarding of the data stream by each of the routing devices is simulated to generate the routing information; wherein the configuration information includes at least one of Border Gateway Protocol BGP information, Intermediate System to Intermediate System IS-IS protocol information, Policy-Based Routing PBR information and Segment Routing SR information.根据权利要求1所述的方法,还包括:The method according to claim 1, further comprising:从流入所述目标网络的多条待选数据流中,筛选出所述多条目标数据流;其中,所述目标数据流的数量小于所述待选数据流的数量;Filtering the plurality of target data flows from the plurality of candidate data flows flowing into the target network; wherein the number of the target data flows is less than the number of the candidate data flows;将所述多条待选数据流的总流量作为所述多条目标数据流的总流量,为各目标数据流分配流量。The total flow of the multiple data flows to be selected is used as the total flow of the multiple target data flows, and the flow is allocated to each target data flow.根据权利要求4所述的方法,其中,从流入所述目标网络的多条待选数据流中,筛选出所述多条目标数据流,包括:The method according to claim 4, wherein screening out the multiple target data flows from the multiple candidate data flows flowing into the target network comprises:基于所述待选数据流的流量在所述多条待选数据流的总流量中的占比,确定所述待选数据流的抽中概率;其中,所述抽中概率与所述占比正相关;Determine the probability of selecting the data stream to be selected based on the proportion of the traffic of the data stream to be selected in the total traffic of the multiple data streams to be selected; wherein the probability of selecting is positively correlated with the proportion;根据各待选数据流的抽中概率,在所述多条待选数据流中进行预设次数的随机抽样,得到第一预设数量的目标数据流。According to the probability of each selected data stream being selected, a preset number of random draws are performed among the multiple selected data streams. In this way, a first preset number of target data streams are obtained.根据权利要求4所述的方法,其中,所述路由信息包括路由表项,从流入所述目标网络的多条待选数据流中,筛选出所述多条目标数据流,包括:The method according to claim 4, wherein the routing information includes routing table entries, and screening out the multiple target data flows from the multiple candidate data flows flowing into the target network comprises:基于所述待选数据流的目的地址与所述路由表项之间的匹配性,将所述多条待选数据流分成多组,其中,匹配于同一路由表项的待选数据流为同一组;Based on the matching between the destination addresses of the candidate data flows and the routing table entries, the multiple candidate data flows are divided into multiple groups, wherein the candidate data flows matching the same routing table entry are in the same group;从每组待选数据流中筛选第二预设数量的目标数据流。A second preset number of target data flows are screened from each group of candidate data flows.根据权利要求6所述的方法,其中,基于所述待选数据流的目的地址与所述路由表项之间的匹配性,将所述多条待选数据流分成多组,包括:The method according to claim 6, wherein the plurality of candidate data flows are divided into a plurality of groups based on the matching between the destination addresses of the candidate data flows and the routing table entries, comprising:根据路由表项的目的地网络地址的前缀长度由长到短,对所述目标网络中的各路由表项进行排序;Sort the routing table entries in the target network according to the prefix length of the destination network address of the routing table entry from long to short;依序确定与各路由表项分别匹配的待选数据流,得到与各路由表项一一对应的多组待选数据流。The candidate data flows that match the respective routing table entries are determined in sequence, and a plurality of groups of candidate data flows that correspond one to one to the respective routing table entries are obtained.根据权利要求1至7任一项所述的方法,还包括:The method according to any one of claims 1 to 7, further comprising:响应于所述目标网络的路由信息发生变化,确定所述流量分布图中发生变化的目标节点;In response to a change in routing information of the target network, determining a changed target node in the traffic distribution graph;更新与所述目标节点连接的目标连接边上的流量;Updating the flow on the target connection edge connected to the target node;利用更新后的所述目标连接边上的流量,计算与所述目标连接边对应的传输链路上的流量。The updated flow on the target connection edge is used to calculate the flow on the transmission link corresponding to the target connection edge.根据权利要求8所述的方法,还包括:The method according to claim 8, further comprising:验证所述目标网络中是否存在流量变化不符合预设变化条件的传输链路。Verify whether there is a transmission link in the target network whose traffic change does not meet the preset change condition.根据权利要求1至7任一项所述的方法,还包括:The method according to any one of claims 1 to 7, further comprising:验证所述传输链路上的流量是否符合预设的流量验证规则。Verify whether the traffic on the transmission link complies with preset traffic verification rules.一种流量验证装置,包括:A flow verification device, comprising:流量分布图构建模块,用于基于目标网络的路由信息,为流入所述目标网络的多条目标数据流构建流量分布图;其中,所述路由信息包括用于确定数据流转发状态的信息;所述流量分布图中的一个节点表示一条目标数据流的一个转发状态;所述转发状态包括当前地址和下一跳信息;A traffic distribution map construction module is used to construct a traffic distribution map for multiple target data flows flowing into the target network based on the routing information of the target network; wherein the routing information includes information for determining the forwarding state of the data flow; a node in the traffic distribution map represents a forwarding state of a target data flow; the forwarding state includes current address and next hop information;传输链路流量确定模块,用于利用所述流量分布图中各节点之间的连接边上的流量,确定所述目标网络中各路由设备之间的传输链路上的流量。The transmission link flow determination module is used to determine the flow on the transmission link between each routing device in the target network by using the flow on the connection edge between each node in the flow distribution graph.一种电子设备,包括存储器、处理器及存储在存储器上的计算机程序,所述处理器在执行所述计算机程序时实现权利要求1-10中任一项所述的方法。An electronic device comprises a memory, a processor and a computer program stored in the memory, wherein the processor implements the method according to any one of claims 1 to 10 when executing the computer program.一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-10中任一项所述的方法。A computer-readable storage medium having a computer program stored therein, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 10.
PCT/CN2024/1043782023-09-052024-07-09Traffic determination method and apparatus, electronic device, and storage mediumPendingWO2025050814A1 (en)

Applications Claiming Priority (2)

Application NumberPriority DateFiling DateTitle
CN202311143177.22023-09-05
CN202311143177.2ACN117201365A (en)2023-09-052023-09-05 Flow rate determination method, device, electronic equipment and storage medium

Publications (1)

Publication NumberPublication Date
WO2025050814A1true WO2025050814A1 (en)2025-03-13

Family

ID=89004602

Family Applications (1)

Application NumberTitlePriority DateFiling Date
PCT/CN2024/104378PendingWO2025050814A1 (en)2023-09-052024-07-09Traffic determination method and apparatus, electronic device, and storage medium

Country Status (2)

CountryLink
CN (1)CN117201365A (en)
WO (1)WO2025050814A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN117201365A (en)*2023-09-052023-12-08杭州阿里巴巴飞天信息技术有限公司 Flow rate determination method, device, electronic equipment and storage medium
CN117938750B (en)*2024-03-222024-06-07腾讯科技(深圳)有限公司Method, device, equipment, storage medium and product for processing scheduling route information

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20180109450A1 (en)*2016-10-142018-04-19Cisco Technology, Inc.Creating and maintaining segment routed traffic engineering policies via border gateway protocol
EP3869751A1 (en)*2020-02-182021-08-25Juniper Networks, Inc.Flexible algorithm aware border gateway protocol (bgp) prefix segment routing identifiers (sids)
CN113454950A (en)*2019-05-152021-09-28阿里巴巴集团控股有限公司Network equipment and link real-time fault detection method and system based on flow statistics
CN116346647A (en)*2023-02-232023-06-27清华大学 Method and device for generating test data packets based on Internet routing configuration
CN117201365A (en)*2023-09-052023-12-08杭州阿里巴巴飞天信息技术有限公司 Flow rate determination method, device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20180109450A1 (en)*2016-10-142018-04-19Cisco Technology, Inc.Creating and maintaining segment routed traffic engineering policies via border gateway protocol
CN113454950A (en)*2019-05-152021-09-28阿里巴巴集团控股有限公司Network equipment and link real-time fault detection method and system based on flow statistics
EP3869751A1 (en)*2020-02-182021-08-25Juniper Networks, Inc.Flexible algorithm aware border gateway protocol (bgp) prefix segment routing identifiers (sids)
CN116346647A (en)*2023-02-232023-06-27清华大学 Method and device for generating test data packets based on Internet routing configuration
CN117201365A (en)*2023-09-052023-12-08杭州阿里巴巴飞天信息技术有限公司 Flow rate determination method, device, electronic equipment and storage medium

Also Published As

Publication numberPublication date
CN117201365A (en)2023-12-08

Similar Documents

PublicationPublication DateTitle
US10742556B2 (en)Tactical traffic engineering based on segment routing policies
US9203743B2 (en)Packet forwarding system, control device, forwarding device and method and program for preparing processing rules
Sherwood et al.Discarte: a disjunctive internet cartographer
CA2706581C (en)System, method and program for determining failed routers in a network
US9954736B2 (en)System and method of discovering paths in a network
WO2025050814A1 (en)Traffic determination method and apparatus, electronic device, and storage medium
CN105745870B (en)Extend operation from for detecting the serial multistage filter flowed greatly removal nose filter to remove stream to realize
US9331910B2 (en)Methods and systems for automatic generation of routing configuration files
CN101917434B (en)Method for verifying intra-domain Internet protocol (IP) source address
US20200028762A1 (en)Network verification system
US11245611B2 (en)Analysis of routing policy application to routes
US20230164058A1 (en)Distributed data plane verfication method
CN109672562A (en)Data processing method, device, electronic equipment and storage medium
CN113872784A (en)Network configuration verification method and device
Wang et al.Rule anomalies detecting and resolving for software defined networks
US10924382B1 (en)Rapid and verifiable network configuration repair
CN112437065A (en)Strategy conflict detection and solution method based on graphic representation under SDN environment
CN117834437A (en) A quantitative attribute verification method based on Internet routing configuration
CN116346647A (en) Method and device for generating test data packets based on Internet routing configuration
CN111478808B (en)Method, system, electronic device and storage medium for assisting configuration update verification
US11438237B1 (en)Systems and methods for determining physical links between network devices
US7912980B1 (en)Setting a maximum prefix exportation limit within a network device
de Silva et al.Formal analysis approach on networks with dynamic behaviours
CN118509360A (en) A method, device and equipment for path arrangement and service provisioning of computing power network
CN105187314B (en)A kind of implementation method of the discovery reserve link based on three-layer network route

Legal Events

DateCodeTitleDescription
121Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number:24861659

Country of ref document:EP

Kind code of ref document:A1


[8]ページ先頭

©2009-2025 Movatter.jp