[go: up one dir, main page]

CN115022229A - A Load Sharing Calculation Method Based on Policy Routing - Google Patents

A Load Sharing Calculation Method Based on Policy Routing Download PDF

Info

Publication number
CN115022229A
CN115022229A CN202210833551.0A CN202210833551A CN115022229A CN 115022229 A CN115022229 A CN 115022229A CN 202210833551 A CN202210833551 A CN 202210833551A CN 115022229 A CN115022229 A CN 115022229A
Authority
CN
China
Prior art keywords
load sharing
policy
policy routing
value
routing
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
CN202210833551.0A
Other languages
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.)
Chengdu DBAPPSecurity Co Ltd
Original Assignee
Chengdu DBAPPSecurity 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 Chengdu DBAPPSecurity Co Ltd filed Critical Chengdu DBAPPSecurity Co Ltd
Priority to CN202210833551.0A priority Critical patent/CN115022229A/en
Publication of CN115022229A publication Critical patent/CN115022229A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/14Routing performance; Theoretical aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明涉及网络通信技术领域,公开了一种基于策略路由的负载分担计算方法,包括以下步骤:根据策略路由内六元组内容配置多个下一跳信息,所述六元组内容包括入接口、源地址、目的地址、用户、服务和应用;根据下一跳信息对应的权重信息和配置的负载分担算法计算负载分担结果。本发明用于解决策略路由权重分担的相关问题。本发明就一条策略路由同时存在多个出口时的业务转发提供了一种具体的负载分担计算方法,在一定程度上增加了策略路由的应用场景,能够根据策略路由多个网关的权重来计算流量分担情况。

Figure 202210833551

The invention relates to the technical field of network communication, and discloses a method for calculating load sharing based on policy routing, comprising the following steps: configuring a plurality of next hop information according to the content of a six-tuple in the policy routing, where the content of the six-tuple includes an inbound interface , source address, destination address, user, service, and application; calculate the load sharing result according to the weight information corresponding to the next hop information and the configured load sharing algorithm. The present invention is used to solve the related problem of policy routing weight sharing. The present invention provides a specific load sharing calculation method for service forwarding when a policy route has multiple exits at the same time, increases the application scenario of the policy route to a certain extent, and can calculate the traffic according to the weights of multiple gateways of the policy route. share the situation.

Figure 202210833551

Description

一种基于策略路由的负载分担计算方法A Load Sharing Calculation Method Based on Policy Routing

技术领域technical field

本发明涉及网络通信技术领域,具体地说,是一种基于策略路由的负载分担计算方法,用于解决策略路由权重分担的相关问题。The present invention relates to the technical field of network communication, in particular, to a method for calculating load sharing based on policy routing, which is used to solve the related problems of policy routing weight sharing.

背景技术Background technique

策略路由是一种比基于目标网络进行路由更加灵活得数据包路由转发机制。路由器将通过路由图决定如何对需要路由的数据包进行处理,路由图决定了一个数据包的下一条转发路由器。策略路由是为了改变网络流量所经过的途径而修改路由信息的技术,主要通过改变路由属性(包括可达性)来实现。Policy routing is a more flexible packet routing and forwarding mechanism than routing based on the target network. The router will decide how to process the data packet that needs to be routed through the routing map, and the routing map determines the next forwarding router of a data packet. Policy-based routing is a technology that modifies routing information in order to change the path of network traffic, mainly by changing routing attributes (including reachability).

除此之外,策略路由是一种智能均衡的策略方式。当策略路由存在多个下一跳网关或出接口时,就需要根据不同下一跳的配置来进行业务的负载分担计算,根据计算结果来指导业务的转发。In addition, policy routing is an intelligent balanced policy method. When there are multiple next-hop gateways or outgoing interfaces in policy-based routing, it is necessary to perform load sharing calculation based on the configuration of different next hops, and guide service forwarding according to the calculation results.

目前为止,策略路由应用越来越广泛,应用场景也随之增加。现有的策略路由相关专利大都是描述策略路由的具体实现方式或是单一的选路情况。针对这一问题,本发明主要解决在一条策略路由中,存在多个下一跳网关时,业务能够根据相关配置均衡地分担到每一个网关,并根据策略路由多个网关的权重来计算流量分担情况。So far, policy routing has become more and more widely used, and the application scenarios have also increased. Most of the existing PBR related patents describe the specific implementation of PBR or a single route selection situation. Aiming at this problem, the present invention mainly solves the problem that when there are multiple next-hop gateways in a policy route, the service can be evenly distributed to each gateway according to the relevant configuration, and the traffic sharing is calculated according to the weights of the multiple gateways in the policy route. Happening.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于提供一种基于策略路由的负载分担计算方法,实现根据策略路由多个网关的权重来计算流量分担情况的功能,具有解决策略路由权重分担的相关问题的效果。The purpose of the present invention is to provide a load sharing calculation method based on policy routing, which realizes the function of calculating traffic sharing according to the weights of multiple gateways in policy routing, and has the effect of solving the related problems of policy routing weight sharing.

本发明通过下述技术方案实现:一种基于策略路由的负载分担计算方法,包括以下步骤:The present invention is achieved through the following technical solutions: a method for calculating load sharing based on policy routing, comprising the following steps:

根据策略路由内六元组内容配置多个下一跳信息,所述六元组内容包括入接口、源地址、目的地址、用户、服务和应用;Configure multiple next-hop information according to the content of the six-tuple in the policy routing, where the content of the six-tuple includes the inbound interface, the source address, the destination address, the user, the service and the application;

根据下一跳信息对应的权重信息和配置的负载分担算法计算负载分担结果。The load sharing result is calculated according to the weight information corresponding to the next hop information and the configured load sharing algorithm.

为了更好地实现本发明,进一步地,所述根据策略路由内六元组内容配置多个下一跳信息的过程包括:In order to better implement the present invention, further, the process of configuring multiple next hop information according to the content of the six-tuple in the policy routing includes:

所述入接口对指定网卡进来的报文进行策略路由的下一步匹配,其他网卡进入的报文根据目的地址的指导进行转发;The ingress interface performs the next step of policy routing on the packets coming from the specified network card, and the packets entering from other network cards are forwarded according to the guidance of the destination address;

在对应入接口进来的基础上,源地址和目的地址对报文的源地址和目的地址进行匹配,匹配成功则进行策略路由的剩余五元组匹配,匹配不成功则按照目的静态路由或其他路由进行转发;On the basis that the corresponding ingress interface comes in, the source address and the destination address match the source address and destination address of the packet. If the match is successful, the remaining five-tuple of the policy route will be matched. If the match is unsuccessful, the destination static route or other routes will be used. forward;

报文是从指定用户处发出后会进行服务和应用的匹配;After the message is sent from the specified user, the service and application will be matched;

当六元组所有内容均匹配上时,才会按照对应配置的下一跳信息进行转发。When all the contents of the six-tuple match, it will be forwarded according to the corresponding configured next-hop information.

为了更好地实现本发明,进一步地,所述配置的负载分担算法包括:In order to better implement the present invention, further, the configured load sharing algorithm includes:

配置多个下一跳网关,配置权重值,为每个配置权重值占所有权重值之比与2的n次方做乘积后的值,最后将所示乘积后的值四舍五入后完成负载分担算法。Configure multiple next-hop gateways, configure weight values, and multiply the ratio of each configuration weight value to the nth power of 2 to the nth power of 2. Finally, round off the multiplied value shown to complete the load sharing algorithm. .

为了更好地实现本发明,进一步地,计算负载分担结果的过程包括:In order to better realize the present invention, further, the process of calculating the load sharing result includes:

计算负载分担结果的过程包括:The process of calculating load sharing results includes:

计算各个下一跳信息中网关配置项的权重比值;Calculate the weight ratio of gateway configuration items in each next hop information;

将所述各项权重比值依次与2的n次方做乘积,其中,n=0,n=1,将做乘积得到的值P进行四舍五入后取整;当四舍五入后的值小于1时,n+1重新开始做乘积;四舍五入后的值大于1,记录四舍五入后的值为负载分担之比W;Multiply the respective weight ratios with the nth power of 2 in turn, where n=0, n=1, round off the value P obtained by the product; when the rounded value is less than 1, n +1 to start the product again; the rounded value is greater than 1, and the rounded value is recorded as the load sharing ratio W;

将计算的值P和四舍五入后的W做差取绝对值;Take the absolute value of the difference between the calculated value P and the rounded W;

完成所有的配置权重比值与差取绝对值的计算后,将每个乘积得到的P和W差的值相加,若差值之和大于0.1*n,则n+1重新计算;若差值之和小于等于0.1*n,则进行下一步计算;After completing the calculation of the absolute value of the ratio and difference of all configuration weights, add the values of the difference between P and W obtained by each product. If the sum of the difference is greater than 0.1*n, then recalculate n+1; if the difference is If the sum is less than or equal to 0.1*n, proceed to the next calculation;

最终比值为四舍五入后的负载分担之比W。The final ratio is the rounded load sharing ratio W.

本发明与现有技术相比,具有以下优点及有益效果:Compared with the prior art, the present invention has the following advantages and beneficial effects:

(1)本发明就一条策略路由同时存在多个出口时的业务转发提供了一种具体的负载分担计算方法,在一定程度上增加了策略路由的应用场景;(1) The present invention provides a specific load sharing calculation method for service forwarding when a policy route has multiple exits at the same time, and increases the application scenario of policy route to a certain extent;

(2)在本发明中策略路由具有多出口。策略路由可以配置多个下一跳出口,不同出口有相应的权重,本发明可以根据多网关的权重信息计算负载分担结果的过程。(2) In the present invention, policy routing has multiple exits. The policy routing can be configured with multiple next-hop exits, and different exits have corresponding weights, and the present invention can calculate the process of load sharing results according to the weight information of multiple gateways.

附图说明Description of drawings

本发明结合下面附图和实施例做进一步说明,本发明所有构思创新应视为所公开内容和本发明保护范围。The present invention will be further described with reference to the following drawings and embodiments, and all conceptual innovations of the present invention should be regarded as the disclosed content and the protection scope of the present invention.

图1为本发明提供的一种基于策略路由的负载分担计算方法的流程图。FIG. 1 is a flowchart of a method for calculating load sharing based on policy routing provided by the present invention.

图2为本发明提供的一种基于策略路由的负载分担计算方法的负载分担算法计算流程。FIG. 2 is a load sharing algorithm calculation flow of a load sharing calculation method based on policy routing provided by the present invention.

图3为本发明提供的一种基于策略路由的负载分担计算方法的六元组具体组成示意图。FIG. 3 is a schematic diagram of the specific composition of a six-tuple of a method for calculating load sharing based on policy routing provided by the present invention.

具体实施方式Detailed ways

为了更清楚地说明本发明实施例的技术方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,应当理解,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例,因此不应被看作是对保护范围的限定。基于本发明中的实施例,本领域普通技术工作人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the following will clearly and completely describe the technical solutions of the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. It should be understood that the described embodiments are only Some, but not all, embodiments of the present invention should therefore not be construed as limiting the scope of protection. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present invention.

在本发明的描述中,需要说明的是,除非另有明确的规定和限定,术语“设置”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;也可以是直接相连,也可以是通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。In the description of the present invention, it should be noted that, unless otherwise expressly specified and limited, the terms "arranged", "connected" and "connected" should be understood in a broad sense, for example, it may be a fixed connection or a detachable connection Connection, or integral connection; it can be mechanical connection or electrical connection; it can also be directly connected, or it can be indirectly connected through an intermediate medium, and it can be internal communication between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood in specific situations.

实施例1:Example 1:

本实施例的一种基于策略路由的负载分担计算方法,如图1-图3所示,包括以下步骤:A method for calculating load sharing based on policy routing in this embodiment, as shown in Figures 1 to 3, includes the following steps:

根据策略路由内六元组内容配置多个下一跳信息,所述六元组内容包括入接口、源地址、目的地址、用户、服务和应用;Configure multiple next-hop information according to the content of the six-tuple in the policy routing, where the content of the six-tuple includes the inbound interface, the source address, the destination address, the user, the service and the application;

根据下一跳信息对应的权重信息和配置的负载分担算法计算负载分担结果。The load sharing result is calculated according to the weight information corresponding to the next hop information and the configured load sharing algorithm.

在本实施例中,为解决现有策略路由多网关情况下的业务分担问题,本申请从实际应用场景出发,通过策略路由的实现原理,提供了一种多网关下业务负载分担的计算方式,以解决策略路由权重分担相关问题。本申请提出了基于策略路由的权重分担计算方式,主要由三个部分组成,一个是策略路由组成部分,一个是负载分担的计算流程,最后是负载分担的具体计算过程。根据不同网关的权重配置,计算得出最终不同网关下的流量分担比。策略路由主要由入接口、匹配项、地址、服务、应用、下一跳信息组成。具体组成情况如图3所示,选用六元组能对指定入接口(网卡)进入的报文进行精准匹配,每一个匹配项都匹配上之后才进行策略路由的负载分担。In this embodiment, in order to solve the problem of service sharing in the case of multiple gateways in the existing policy routing, the present application provides a calculation method of service load sharing under multiple gateways based on the actual application scenario and through the implementation principle of policy routing, In order to solve the problem related to the weight sharing of policy routing. This application proposes a weight sharing calculation method based on policy routing, which is mainly composed of three parts, one is the policy routing component, the other is the calculation process of load sharing, and finally is the specific calculation process of load sharing. According to the weight configuration of different gateways, the final traffic sharing ratio under different gateways is calculated. Policy routing mainly consists of inbound interface, matching item, address, service, application, and next hop information. The specific composition is shown in Figure 3. The selection of 6-tuple can accurately match the incoming packets of the specified ingress interface (NIC), and the load sharing of policy routing can be performed after each matching item is matched.

需要说明的是,本申请给出的六元组信息是根据当前领域内的负载所需信息所设置的,六元组信息可以随着本领域内技术的进步再优化进其他信息。It should be noted that the six-tuple information given in this application is set according to the information required by the load in the current field, and the six-tuple information can be optimized into other information with the advancement of technology in the field.

实施例2:Example 2:

本实施例在实施例1的基础上做进一步优化,根据策略路由内六元组内容配置多个下一跳信息的过程包括:This embodiment is further optimized on the basis of Embodiment 1, and the process of configuring multiple next-hop information according to the content of the six-tuple in the policy routing includes:

所述入接口对指定接口进来的报文进行策略路由的下一步匹配,其他接口进入的报文根据目的地址的指导进行转发;The ingress interface performs the next step of policy routing on the packets coming from the designated interface, and the packets entering from other interfaces are forwarded according to the guidance of the destination address;

网元上两个网卡同时有报文进来,未匹配策略路由入接口的报文,直接按照目的路由进行转发。Two NICs on the NE receive incoming packets at the same time, and the incoming packets that do not match the policy route are forwarded directly according to the destination route.

在对应入接口进来的基础上,源地址和目的地址对报文的源地址和目的地址进行匹配,匹配成功则进行策略路由的下一步匹配,匹配不成功则按照目的路由进行转发;On the basis of the corresponding incoming interface, the source address and the destination address match the source address and destination address of the packet. If the match is successful, the next step of policy routing will be matched. If the match is unsuccessful, the packet will be forwarded according to the destination route.

报文是从指定用户处发出后会进行服务和应用的匹配;After the message is sent from the specified user, the service and application will be matched;

当六元组所有内容均匹配上时,才会按照对应配置的下一跳信息进行转发。When all the contents of the six-tuple match, it will be forwarded according to the corresponding configured next-hop information.

在本实施例中,入接口是指对指定接口进来的报文进行策略路由下一步匹配,其他接口进入的报文按目的地址指导转发;源地址和目的地址是在对应入接口进来的基础上,对报文的源地址和目的地址进行匹配,匹配成功则进行策略路由的下一步匹配,匹配不成功则按照目的路由进行转发;用户是指报文是从指定用户处发出的,然后进行服务和应用的匹配。只有当六个条件均匹配上时,才会按照对应配置的下一跳进行转发。下一跳信息中包含流量转发的网关或出接口和对应的权重大小。In this embodiment, the inbound interface refers to the next step of policy routing matching on the incoming packets from the designated interface, and the packets incoming from other interfaces are forwarded according to the destination address guidance; the source address and destination address are based on the incoming packets corresponding to the ingress interface. , match the source address and destination address of the packet. If the match is successful, the next step of policy routing will be matched. If the match is unsuccessful, the packet will be forwarded according to the destination route. User means that the packet is sent from a specified user and then serviced. match with the application. Only when all six conditions are matched, forwarding will be performed according to the corresponding configured next hop. The next hop information includes the gateway or outgoing interface for traffic forwarding and the corresponding weight.

本实施例的其他部分与实施例1相同,故不再赘述。The other parts of this embodiment are the same as those of Embodiment 1, and thus are not repeated here.

实施例3:Example 3:

本实施例在上述实施例1或2的基础上做进一步优化,策略路由存在多个下一跳信息时,根据每个下一跳配置的权重值,来计算得出多个下一跳的负载均衡比。具体实现流程如图2所示。负载分担算法包括配置多个下一跳网关,配置权重值ci,配置权重值依次为c1,c2,c3;为每个配置权重值占所有权重值之比与2的n次方做乘积后的值为Pi,Wi为Pi四舍五入后得到的值。This embodiment is further optimized on the basis of the foregoing embodiment 1 or 2. When there are multiple next hop information in policy routing, the load of multiple next hops is calculated according to the weight value configured for each next hop. Equilibrium ratio. The specific implementation process is shown in Figure 2. The load sharing algorithm includes configuring multiple next-hop gateways, configuring the weight value ci, and configuring the weight values as c1, c2, and c3 in sequence; the ratio of each configuration weight value to all weight values is multiplied by the nth power of 2. The value is Pi, and Wi is the value obtained by rounding Pi.

本实施例的其他部分与上述实施例1或2相同,故不再赘述。The other parts of this embodiment are the same as the above-mentioned Embodiment 1 or 2, and thus are not repeated here.

实施例4:Example 4:

本实施例在上述实施例1-3任一项的基础上做进一步优化,计算负载分担结果的过程包括:This embodiment is further optimized on the basis of any of the foregoing Embodiments 1-3, and the process of calculating the load sharing result includes:

计算各个下一跳信息中网关配置项的权重比值;Calculate the weight ratio of gateway configuration items in each next hop information;

举例如下:An example is as follows:

①在同一条策略路由中配置了三个不同的下一跳,权重配置分别为50、100、150,比值为1:2:3(c1:c2:c3),各项占比为1/6,2/6,3/6;①Three different next hops are configured in the same policy route, the weights are 50, 100, and 150, the ratio is 1:2:3 (c1:c2:c3), and the proportion of each item is 1/6 , 2/6, 3/6;

②取2的0次方与1/6相乘得1/6,四舍五入后小于1,n+1;② Take 2 to the 0th power and multiply it by 1/6 to get 1/6, which is less than 1 after rounding, n+1;

③取2的1次方与1/6相乘得2/6,四舍五入后小于1,n+1;③ Take 2 to the power of 1 and multiply it by 1/6 to get 2/6, which is less than 1 after rounding, n+1;

④取2的2次方与1/6相乘得2/3(P1),四舍五入后等于1(W1),继续下一步运算;④ Take 2 to the power of 2 and multiply it by 1/6 to get 2/3 (P1), which is equal to 1 (W1) after rounding, and continue to the next step;

⑤用④中2/3四舍五入得到的值1,与2/3做差,取绝对值得到1/3(|P1-W1|);⑤ Use the value 1 obtained by rounding 2/3 in ④, make a difference with 2/3, and take the absolute value to get 1/3 (|P1-W1|);

⑥用2的2次方分别与2/6,3/6相乘,重复步骤④⑤,分别的带1/3和0;⑥ Multiply by 2 to the power of 2 with 2/6 and 3/6 respectively, and repeat steps ④⑤, with 1/3 and 0 respectively;

⑦三个计算得出的值(|Pi-Wi|)相加,得到2/3;⑦ Add the three calculated values (|Pi-Wi|) to get 2/3;

⑧2/3与0.1*4(2的2次方)相比,2/3=0.67>0.4,不满足要求,继续计算,n+1;⑧2/3 is compared with 0.1*4 (2 to the power of 2), 2/3=0.67>0.4, does not meet the requirements, continue to calculate, n+1;

⑨用2的3次方依次与1/6、2/6、3/6相乘,与四舍五入后得到的值(1,3,4)取差后,得到1/3,1/3,0;⑨ Multiply 1/6, 2/6, 3/6 by the 3rd power of 2 in turn, and take the difference with the rounded value (1, 3, 4) to get 1/3, 1/3, 0 ;

⑩用⑨中得到的差值之和2/3,与0.1*8(2的3次方)相比,2/3<0.8,满足要求;⑩Use 2/3 of the sum of the differences obtained in ⑨, compared with 0.1*8 (2 to the third power), 2/3<0.8, which meets the requirements;

最终的负载分担Wi之比为:8*(各比例Pi)后四舍五入得到的值,即:1:3:4;The final load sharing Wi ratio is: 8*(each ratio Pi) after rounding, namely: 1:3:4;

将各项权重比值依次与2的n次方做乘积,其中,n=0,n=1,将做乘积得到的值P进行四舍五入后取整;当四舍五入后的值小于1时,n+1重新开始做乘积;四舍五入后的值大于1,记录四舍五入后的值为W,无论权重配置为多少比值,最后得到的负载分担比始终为2的n次方,计算方法严密可靠;Multiply the weight ratios with the nth power of 2 in turn, where n=0, n=1, round off the value P obtained by the product; when the rounded value is less than 1, n+1 Start the product again; the rounded value is greater than 1, and the rounded value is recorded as W. No matter what ratio the weight is configured to, the final load sharing ratio is always 2 to the nth power, and the calculation method is rigorous and reliable;

将计算的值P和四舍五入后的W做差取绝对值;Take the absolute value of the difference between the calculated value P and the rounded W;

完成所有的配置权重比值与差取绝对值的计算后,将每个乘积得到的P和W差的值相加,若差值之和大于0.1*n,则n+1重新计算;若差值之和小于等于0.1*n,则进行下一步计算;After completing the calculation of the absolute value of the ratio and difference of all configuration weights, add the values of the difference between P and W obtained by each product. If the sum of the difference is greater than 0.1*n, then recalculate n+1; if the difference is If the sum is less than or equal to 0.1*n, proceed to the next calculation;

最终比值为四舍五入后的W之比。The final ratio is the rounded W ratio.

本实施例的其他部分与上述实施例1-3任一项相同,故不再赘述。The other parts of this embodiment are the same as any of the above-mentioned Embodiments 1-3, and thus are not repeated here.

实施例5:Example 5:

本实施例在上述实施例1-4任一项基础上做进一步优化,当前已有的策略路由相关专利中,主要为策略路由具体的实现方式或是具体的选路方式,而针对单条策略路由同时存在多个出口时的选路或是流量负载分担,没有相应的发明。本发明就一条策略路由同时存在多个出口时的业务转发提供了一种具体的负载分担计算方法,在一定程度上增加了策略路由的应用场景。不同于专利CN201210303955.5 策略路由的实现方法、装置和交换设备,此专利主要是根据策略优先级的大小来配置转发流量出口。而本专利主要是根据策略路由多个网关的权重来计算流量分担情况;不同于专利CN201410709183.4负载分担的方法和路由设备,此专利是根据网络中不同的路由设备来协商确定自己的负载分担信息。而本专利主要是根据策略路由多个网关的权重来计算流量分担情况;其他的很多专利都是策略路由的实现方法或是单独的负载分担相关,而本专利则主要是针对策略路由存在多网关情况下的业务负载分担,且与其他专利分担计算不一样。This embodiment is further optimized on the basis of any of the above-mentioned Embodiments 1 to 4. Among the existing policy-routing related patents, mainly the specific implementation method or the specific routing method of policy-based routing, while the single policy-routing There is no corresponding invention for routing or traffic load sharing when there are multiple exits at the same time. The present invention provides a specific load sharing calculation method for service forwarding when a policy route has multiple exits at the same time, and increases the application scenario of the policy route to a certain extent. Different from patent CN201210303955.5 implementing method, device and switching device of policy routing, this patent mainly configures the forwarding traffic exit according to the size of policy priority. This patent mainly calculates traffic sharing according to the weights of multiple gateways in policy routing; different from the method and routing device for load sharing in patent CN201410709183.4, this patent negotiates and determines its own load sharing according to different routing devices in the network information. This patent mainly calculates the traffic sharing situation according to the weight of multiple gateways in policy routing; many other patents are related to the implementation method of policy routing or separate load sharing, while this patent is mainly aimed at the existence of multiple gateways in policy routing. The business load sharing in the case is different from other patent sharing calculations.

本实施例的其他部分与上述实施例1-4任一项相同,故不再赘述。The other parts of this embodiment are the same as any of the above-mentioned Embodiments 1-4, and thus are not repeated here.

以上所述,仅是本发明的较佳实施例,并非对本发明做任何形式上的限制,凡是依据本发明的技术实质对以上实施例所做的任何简单修改、等同变化,均落入本发明的保护范围之内。The above are only preferred embodiments of the present invention, and do not limit the present invention in any form. Any simple modifications and equivalent changes made to the above embodiments according to the technical essence of the present invention fall into the present invention. within the scope of protection.

Claims (4)

1.一种基于策略路由的负载分担计算方法,其特征在于,包括以下步骤:1. a load sharing calculation method based on policy routing, is characterized in that, comprises the following steps: 根据策略路由内六元组内容配置多个下一跳信息,所述六元组内容包括入接口、源地址、目的地址、用户、服务和应用;Configure multiple next-hop information according to the content of the six-tuple in the policy routing, where the content of the six-tuple includes the inbound interface, the source address, the destination address, the user, the service and the application; 根据下一跳信息对应的权重信息和配置的负载分担算法计算负载分担结果。The load sharing result is calculated according to the weight information corresponding to the next hop information and the configured load sharing algorithm. 2.根据权利要求1所述的一种基于策略路由的负载分担计算方法,其特征在于,所述根据策略路由内六元组内容配置多个下一跳信息的过程包括:2. The method for calculating load sharing based on policy routing according to claim 1, wherein the process of configuring multiple next hop information according to the content of the six-tuple in the policy routing comprises: 所述入接口对指定网卡进来的报文进行策略路由的下一步匹配,其他网卡进入的报文根据目的地址的指导进行转发;The ingress interface performs the next step of policy routing on the packets coming from the specified network card, and the packets entering from other network cards are forwarded according to the guidance of the destination address; 在对应入接口进来的基础上,源地址和目的地址对报文的源地址和目的地址进行匹配,匹配成功则进行策略路由的剩余五元组匹配,匹配不成功则按照目的静态路由或其他路由进行转发;On the basis that the corresponding ingress interface comes in, the source address and the destination address match the source address and destination address of the packet. If the match is successful, the remaining five-tuple of the policy route will be matched. If the match is unsuccessful, the destination static route or other routes will be used. forward; 报文是从指定用户处发出后会进行服务和应用的匹配;After the message is sent from the specified user, the service and application will be matched; 当六元组所有内容均匹配上时,才会按照对应配置的下一跳信息进行转发。When all the contents of the six-tuple match, it will be forwarded according to the corresponding configured next-hop information. 3.根据权利要求1所述的一种基于策略路由的负载分担计算方法,其特征在于,所述配置的负载分担算法包括:3. The method for calculating load sharing based on policy routing according to claim 1, wherein the configured load sharing algorithm comprises: 配置多个下一跳网关,配置权重值,为每个配置权重值占所有权重值之比与2的n次方做乘积后的值,最后将所示乘积后的值四舍五入后完成负载分担算法。Configure multiple next-hop gateways, configure weight values, and multiply the ratio of each configuration weight value to the nth power of 2 to the nth power of 2. Finally, round off the multiplied value shown to complete the load sharing algorithm. . 4.根据权利要求1-3任一项所述的一种基于策略路由的负载分担计算方法,其特征在于,计算负载分担结果的过程包括:4. The method for calculating load sharing based on policy routing according to any one of claims 1-3, wherein the process of calculating the load sharing result comprises: 计算各个下一跳信息中网关配置项的权重比值;Calculate the weight ratio of gateway configuration items in each next hop information; 将所述各项权重比值依次与2的n次方做乘积,其中,n=0,n=1,将做乘积得到的值P进行四舍五入后取整;当四舍五入后的值小于1时,n+1重新开始做乘积;四舍五入后的值大于1,记录四舍五入后的值为负载分担之比W;Multiply the respective weight ratios with the nth power of 2 in turn, where n=0, n=1, round off the value P obtained by the product; when the rounded value is less than 1, n +1 to start the product again; the rounded value is greater than 1, and the rounded value is recorded as the load sharing ratio W; 将计算的值P和四舍五入后的W做差取绝对值;Take the absolute value of the difference between the calculated value P and the rounded W; 完成所有的配置权重比值与差取绝对值的计算后,将每个乘积得到的P和W差的值相加,若差值之和大于0.1*n,则n+1重新计算;若差值之和小于等于0.1*n,则进行下一步计算;After completing the calculation of the absolute value of the ratio and difference of all configuration weights, add the values of the difference between P and W obtained by each product. If the sum of the difference is greater than 0.1*n, then recalculate n+1; if the difference is If the sum is less than or equal to 0.1*n, proceed to the next calculation; 最终比值为四舍五入后的负载分担之比W。The final ratio is the rounded load sharing ratio W.
CN202210833551.0A 2022-07-15 2022-07-15 A Load Sharing Calculation Method Based on Policy Routing Pending CN115022229A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210833551.0A CN115022229A (en) 2022-07-15 2022-07-15 A Load Sharing Calculation Method Based on Policy Routing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210833551.0A CN115022229A (en) 2022-07-15 2022-07-15 A Load Sharing Calculation Method Based on Policy Routing

Publications (1)

Publication Number Publication Date
CN115022229A true CN115022229A (en) 2022-09-06

Family

ID=83082465

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210833551.0A Pending CN115022229A (en) 2022-07-15 2022-07-15 A Load Sharing Calculation Method Based on Policy Routing

Country Status (1)

Country Link
CN (1) CN115022229A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115883468A (en) * 2022-12-23 2023-03-31 北京力控华康科技有限公司 Data forwarding method and device, computer equipment and storage medium
CN116192745A (en) * 2022-12-27 2023-05-30 成都安恒信息技术有限公司 Quick strategy matching method based on VPP

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744563A (en) * 2004-08-31 2006-03-08 杭州华为三康技术有限公司 Method for realizing strate gic route in Ethernet switch
CN101729427A (en) * 2010-01-20 2010-06-09 杭州华三通信技术有限公司 Multilink load sharing and routing method and router
CN112104549A (en) * 2020-08-07 2020-12-18 新华三信息安全技术有限公司 Method and device for realizing load sharing
CN113888440A (en) * 2021-10-20 2022-01-04 上海热芯视觉科技有限公司 FPGA-based infrared image noise reduction method and system
CN114401222A (en) * 2021-12-28 2022-04-26 网络通信与安全紫金山实验室 Data forwarding method and device based on policy routing and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744563A (en) * 2004-08-31 2006-03-08 杭州华为三康技术有限公司 Method for realizing strate gic route in Ethernet switch
CN101729427A (en) * 2010-01-20 2010-06-09 杭州华三通信技术有限公司 Multilink load sharing and routing method and router
CN112104549A (en) * 2020-08-07 2020-12-18 新华三信息安全技术有限公司 Method and device for realizing load sharing
CN113888440A (en) * 2021-10-20 2022-01-04 上海热芯视觉科技有限公司 FPGA-based infrared image noise reduction method and system
CN114401222A (en) * 2021-12-28 2022-04-26 网络通信与安全紫金山实验室 Data forwarding method and device based on policy routing and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115883468A (en) * 2022-12-23 2023-03-31 北京力控华康科技有限公司 Data forwarding method and device, computer equipment and storage medium
CN116192745A (en) * 2022-12-27 2023-05-30 成都安恒信息技术有限公司 Quick strategy matching method based on VPP

Similar Documents

Publication Publication Date Title
US11424987B2 (en) Segment routing: PCE driven dynamic setup of forwarding adjacencies and explicit path
US10218610B2 (en) MPLS segment routing
CN111385206B (en) Message forwarding method, network system, related equipment and computer storage medium
CN111385207B (en) Service data forwarding method, network device and network system
CN107547393B (en) Method and network device for calculating forwarding path
US10382321B1 (en) Aggregate link bundles in label switched paths
US9319312B2 (en) Segment routing mapping server for LDP/SR interoperability
US8718060B2 (en) Technique for multiple path forwarding of label-switched data traffic
CN103905315B (en) Transmit the method, apparatus and system of virtualization and the distribution of routing iinformation used in network
US20140029438A1 (en) SYSTEM, METHOD AND APPARATUS CONFORMING PATH COST CRITERIA ACROSS MULTIPLE ABRs
WO2020165627A1 (en) Limited flooding in dense graphs
CN102594664A (en) Flow forwarding method and device
CN115022229A (en) A Load Sharing Calculation Method Based on Policy Routing
WO2017140112A1 (en) Multi-channel packet forwarding method and device
WO2011095017A1 (en) Method and routing device for implementing load sharing
CN115460123A (en) A message forwarding method and device
CN101483591B (en) Route implementing method and route generating apparatus
CN103220217A (en) Route generating method and equipment
Jamali et al. An enhanced MPLS-TE for transferring multimedia packets
Solano et al. Label space reduction in MPLS networks: How much can a single stacked label do?
US11824763B2 (en) Filtering topologies for path computation in massively scaled networks
CN109309619A (en) An implementation method and device for an inter-domain two-dimensional routing protocol
US20240305582A1 (en) Resource reservation protocol resource notification messages
CN118433090A (en) Communication method and device
Magsi et al. Mitigating Network Congestion through MPLS-TE Based Load Balancing Using Alternate Optimal Path

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20220906

RJ01 Rejection of invention patent application after publication