WO2015039616A1 - Method and device for packet processing - Google Patents

Method and device for packet processing Download PDF

Info

Publication number
WO2015039616A1
WO2015039616A1 PCT/CN2014/086834 CN2014086834W WO2015039616A1 WO 2015039616 A1 WO2015039616 A1 WO 2015039616A1 CN 2014086834 W CN2014086834 W CN 2014086834W WO 2015039616 A1 WO2015039616 A1 WO 2015039616A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
packet
service node
tcn
node
Prior art date
Application number
PCT/CN2014/086834
Other languages
French (fr)
Chinese (zh)
Inventor
黄勇
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015039616A1 publication Critical patent/WO2015039616A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/08Load balancing or load distribution
    • H04W28/088Load balancing or load distribution among core entities

Landscapes

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

Abstract

Disclosed are a method and device for packet processing. A same TCN is preconfigured for packets in a same packet stream. The TCN and a value of the number of service nodes in a hop are utilized for a load-balancing computation. If suitable TCNs can be selected respectively for different packet streams on the basis of the number of packet streams, sharing of packet streams among service nodes can be implemented. When the number of packet streams is stable, regardless of that the topology states of the service nodes change, load balancing for the service nodes in a same hop can be implemented in a statistical sense.

Description

一种报文处理方法及设备Message processing method and device
本申请要求于2013年9月18日提交中国专利局、申请号为CN201310430814.4、发明名称为“一种报文处理方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. CN201310430814.4, entitled "A Message Processing Method and Apparatus", filed on September 18, 2013, the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本发明涉及无线通信领域,尤其涉及一种报文处理方法及设备。The present invention relates to the field of wireless communications, and in particular, to a packet processing method and device.
背景技术Background technique
具有网络业务功能的业务节点可以对网络报文进行处理,所述业务节点可以是防火墙、传输控制协议(英文:Transmission Control Protocol,缩写:TCP)加速节点或网络地址转换(英文network address translation,缩写NAT)节点等。业务节点包括以下种类的网络业务功能:安全、过滤、统计监测、计费和流量加速。所述具有网络业务功能的业务节点部署在报文流流经的路径上,业务节点对流经的报文流中的每个报文执行相应的网络业务功能。其中:同一报文流中的报文的元组(英文:tuple),如五元组(英文:quintuple),的值相同。The service node with the network service function can process the network packet, and the service node can be a firewall, a transmission control protocol (English: Transmission Control Protocol, abbreviation: TCP), an acceleration node or a network address translation (English network address translation, abbreviation NAT) nodes, etc. Service nodes include the following types of network service functions: security, filtering, statistical monitoring, billing, and traffic acceleration. The service node with the network service function is deployed on the path through which the packet flows, and the service node performs the corresponding network service function for each packet in the packet flow. The tuple of the message in the same packet stream (English: tuple), such as the quintuple (English: quintuple), has the same value.
假设业务节点B1具有的网络业务功能称之为B网络业务功能,业务节点的网络架构中还部署了具有B网络业务功能的业务节点B2,则业务节点B1和业务节点B2构成了业务节点网络中的一跳,也就是说,一跳包括了这样的至少一个业务节点:在业务节点的网络中,具有相同网络业务功能的业务节点,其中任一业务节点能够为报文流中的报文提供该网络业务功能。It is assumed that the network service function of the service node B1 is called the B network service function, and the service node B2 with the B network service function is also deployed in the network structure of the service node, and the service node B1 and the service node B2 form the service node network. One hop, that is, one hop includes at least one service node: a service node having the same network service function in the network of the service node, any one of which can provide a message in the packet flow The network business function.
若将具有相同网络功能的业务节点看成一个节点集合,则一系列节点集合构成的一条路径,称为业务路径。假设一跳业务路由中有两个节点集合,前一个节点集合中包含业务节点A,后一个节点集合中包含业务节点B1和业务节点B2。以报文流中某一报文为例,当该报文被前一个业务节点A执行相应的网络业务功能并向下一个业务节点B1发送时,可视为该报文在业务节点 组成的网络的网络拓朴中的一跳。实际上,报文从业务节点A传输到业务节点B1的过程中可能要经过多个物理网络设备,如流经多个网络交换机,但是从业务节点的网络来看,业务节点A的业务下一跳是业务节点B1或业务节点B2,报文流经过一跳从业务节点A传输到业务节点B1,此时,业务节点B1可称为业务节点A的业务下一跳。If a service node with the same network function is regarded as a node set, a path composed of a series of node sets is called a service path. Assume that there is two node sets in the one-hop service route. The former node set contains the service node A, and the latter node set includes the service node B1 and the service node B2. Taking a certain packet in the packet flow as an example, when the packet is sent by the previous service node A to the corresponding service node B1 and sent to the next service node B1, the packet can be regarded as the service node. A jump in the network topology that makes up the network. In fact, the process of transmitting a message from the service node A to the service node B1 may pass through multiple physical network devices, such as flowing through multiple network switches, but from the network of the service node, the service of the service node A is next. The hop is the service node B1 or the service node B2, and the packet stream is transmitted from the service node A to the service node B1 through one hop. At this time, the service node B1 may be referred to as the service next hop of the service node A.
由于一跳中具有相同网络业务功能的业务节点的数量是可能变化的,例如,如根据业务节点处理负荷来增加或减少部署的业务节点,这种情况更经常发生于当业务节点是利用云计算实现于虚拟机中时。另外如一跳中某个业务节点故障时,相当于该跳中部署的业务节点数量减少了,导致同一跳中业务节点的负载均衡问题比较突出。Since the number of service nodes with the same network service function in one hop is likely to change, for example, if the service node is increased or decreased according to the processing load of the service node, this situation often occurs when the service node utilizes cloud computing. When implemented in a virtual machine. In addition, if a service node fails in a hop, the number of service nodes deployed in the hop is reduced, resulting in a load balancing problem of the service nodes in the same hop.
发明内容Summary of the invention
本发明提供了一种报文处理方法及设备,用以解决当一跳中业务节点的数量发生变化时,同一跳中的业务节点间无法达到负载均衡的问题。The present invention provides a packet processing method and device for solving the problem that load balancing cannot be achieved between service nodes in the same hop when the number of service nodes changes in one hop.
第一方面,提供一种报文处理方法,所述方法包括:The first aspect provides a packet processing method, where the method includes:
根据报文中包含的业务路由标识,在确定报文的业务下一跳有多个业务节点时,根据所述报文中包含的流量分类号和业务下一跳中业务节点的数量值进行负载均衡运算;According to the service route identifier included in the packet, when there are multiple service nodes in the service next hop of the packet, the traffic is classified according to the traffic classification number included in the packet and the number of service nodes in the next hop of the service. Equalization operation
根据运算结果从所述业务下一跳的业务节点中选择一个业务节点,并将所述报文向选择的所述业务节点传输;Selecting a service node from the service nodes of the service next hop according to the operation result, and transmitting the message to the selected service node;
其中,同一报文流中的所有报文的流量分类号相同。The traffic classification numbers of all the packets in the same packet flow are the same.
结合第一方面,在第一方面的第一种可能的实现方式中,根据所述报文中包含的流量分类号和业务下一跳中业务节点的数量值进行负载均衡运算,并根据运算结果从所述业务下一跳的业务节点中选择一个业务节点,具体包括:With reference to the first aspect, in a first possible implementation manner of the first aspect, the load balancing operation is performed according to the traffic classification number included in the packet and the quantity value of the service node in the service next hop, and according to the operation result Selecting a service node from the service node of the next hop of the service, specifically includes:
将所述报文中包含的流量分类号和业务下一跳中业务节点的数量值取模; And modulating the traffic classification number included in the packet and the value of the service node in the next hop of the service;
查询业务节点的标识与运算值的对应关系,将取模结果作为运算值,确定对应的业务节点的标识,并将确定的业务节点的标识对于的业务节点作为选择的业务节点。The corresponding relationship between the identifier of the service node and the operation value is queried, and the modulo result is used as the operation value to determine the identifier of the corresponding service node, and the determined service node identifier is used as the selected service node.
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述报文中包含的流量分类号是由中心控制模块生成并发送给流分类模块后,再由所述流分类模块添加在所述报文中的。With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the traffic classification number included in the packet is generated by the central control module and sent to After the flow classification module is added to the packet by the flow classification module.
结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,所述流量分类号是中心控制模块从资源池中随机选取的一个数值,或是中心控制模块根据报文的元组得到的数值,或是中心控制模块针对报文需流经的业务路径中一跳,根据该跳中多个业务节点间的负载状态确定的一个数值。In conjunction with the second possible implementation of the first aspect, in a third possible implementation manner of the first aspect, the traffic classification number is a value randomly selected by the central control module from the resource pool, or a central control The value obtained by the module according to the tuple of the packet, or a value determined by the central control module for the traffic path through which the packet needs to flow, according to the load state between the multiple service nodes in the hop.
结合第一方面以及第一方面的第一种可能的实现方式至第一方的第三种可能的实现方式中的任意一个,在第一方面的第四种可能的实现方式中,所述方法还包括:In conjunction with the first aspect, and the first possible implementation of the first aspect, to any one of the third possible implementations of the first aspect, in a fourth possible implementation of the first aspect, the method Also includes:
接收到所述报文的业务节点向中心控制模块上报所述报文的元组,以及与该报文所在报文流对应的反向流的元组;The service node that receives the packet reports the tuple of the packet to the central control module, and the tuple of the reverse flow corresponding to the packet flow of the packet;
当所述中心控制模块为所述反向流中的报文生成流量分类号时,生成与所述报文流中的报文相同的流量分类号,使得所述反向流中的报文流经的业务节点与所述报文流中的报文流经的业务节点相同但顺序相反。And generating, by the central control module, a traffic classification number for the packet in the reverse flow, generating a traffic classification number that is the same as the packet in the packet flow, so that the packet flow in the reverse flow The transited service node is the same as the service node through which the packet in the packet flow flows, but in the reverse order.
第二方面,提供一种报文处理设备,所述报文处理设备包括:A second aspect provides a packet processing device, where the packet processing device includes:
运算单元,用于根据报文中包含的业务路由标识,在确定报文的业务下一跳有多个业务节点时,根据所述报文中包含的流量分类号和业务下一跳中业务节点的数量值进行负载均衡运算,其中,同一报文流中的所有报文的流量分类号相同;The operation unit is configured to: according to the service route identifier included in the packet, when the service hop of the packet is determined to have multiple service nodes, according to the traffic classification number included in the packet and the service node in the next hop of the service The number of values is load-balanced, where the traffic classification numbers of all the packets in the same packet flow are the same;
选择单元,用于根据所述运算单元的运算结果从所述业务下一跳的业务节点中选择一个业务节点;a selecting unit, configured to select a service node from the service nodes of the service next hop according to the operation result of the operation unit;
传输单元,用于将所述报文向所述选择单元选择的所述业务节点传输。 And a transmitting unit, configured to transmit the message to the service node selected by the selecting unit.
结合第二方面,在第二方面的第一种可能的实现方式中,所述运算单元,具体用于将所述报文中包含的流量分类号和业务下一跳中业务节点的数量值取模;With reference to the second aspect, in a first possible implementation manner of the second aspect, the computing unit is configured to: take the traffic classification number included in the packet, and the value of the service node in the next hop of the service mold;
所述选择单元,具体用于根据业务节点的标识与运算值的对应关系,将取模结果作为运算值,确定对应的业务节点的标识,并将确定的业务节点的标识对应的业务节点作为选择的业务节点。The selecting unit is specifically configured to determine, according to the correspondence between the identifier of the service node and the calculated value, the modulo result as an operation value, determine the identifier of the corresponding service node, and select the service node corresponding to the determined identifier of the service node as the selection. Business node.
第三方面,提供一种报文处理设备,包括:接口、存储器和处理器,其中,接口、存储器和处理器之间通过总线连接,其中:A third aspect provides a message processing device, including: an interface, a memory, and a processor, wherein the interface, the memory, and the processor are connected by a bus, wherein:
所述接口,用于接收报文,并将接收到的报文传输给处理器,以及将报文传输给处理器选择的业务节点;The interface is configured to receive a message, and transmit the received message to the processor, and transmit the message to the service node selected by the processor;
所述存储器,用于存储程序代码,以及存储业务路由标识所反映的业务路径和该业务路径上每一跳中各业务节点的信息,并将存储的程序代码传输给处理器;The memory is configured to store program code, and store a service path reflected by the service route identifier and information of each service node in each hop of the service path, and transmit the stored program code to the processor;
处理器,用于获得存储器中存储的程序代码,并按照获得的程序代码执行:根据报文中包含的业务路由标识,在确定报文的业务下一跳有多个业务节点时,根据所述报文中包含的流量分类号和业务下一跳中业务节点的数量值进行负载均衡运算,并根据运算结果从所述业务下一跳的业务节点中选择一个业务节点,并将选择的所述业务节点的标识发送给接口,其中,同一报文流中的所有报文的流量分类号相同。a processor, configured to obtain the program code stored in the memory, and execute according to the obtained program code: according to the service routing identifier included in the packet, when determining that the service next hop has multiple service nodes, according to the Performing a load balancing operation on the traffic classification number included in the packet and the number of service nodes in the service next hop, and selecting a service node from the service node of the service next hop according to the operation result, and selecting the selected The identifier of the service node is sent to the interface, where the traffic classification numbers of all the packets in the same packet flow are the same.
结合第三方面,在第三方面的第一种可能的实现方式中,In conjunction with the third aspect, in a first possible implementation of the third aspect,
所述存储器,还用于存储业务节点的标识与运算值的对应关系,并传输给处理器;The memory is further configured to store a correspondence between an identifier of the service node and an operation value, and transmit the relationship to the processor;
所述处理器,具体用于执行如下的负载均衡运算以及选择业务节点:将所述报文中包含的流量分类号和业务下一跳中业务节点的数量值取模,并根据业务节点的标识与运算值的对应关系,将取模结果作为运算值,确定对应的业务节点的标识,并将确定的业务节点的标识对应的业务节点作为选择的业务节点。 The processor is specifically configured to perform the following load balancing operation and select a service node: modulo the traffic classification number included in the packet and the quantity value of the service node in the service next hop, and according to the identifier of the service node Corresponding relationship with the operation value, the modulo result is used as the operation value, the identifier of the corresponding service node is determined, and the service node corresponding to the identified service node identifier is used as the selected service node.
第四方面,提供一种中心控制设备,所述中心控制设备包括:In a fourth aspect, a central control device is provided, and the central control device includes:
生成单元,用于为报文生成流量分类号和业务路由标识;a generating unit, configured to generate a traffic classification number and a service routing identifier for the packet;
发送单元,用于将所述流量分类号和业务路由标识发送给流分类设备,指示流分类设备将所述流量分类号和业务路由标识添加在所述报文中。And a sending unit, configured to send the traffic classification number and the service routing identifier to the traffic classification device, where the traffic classification device adds the traffic classification number and the service routing identifier to the packet.
结合第四方面,在第四方面的第一种可能的实现方式中,With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect,
所述生成单元,具体用于从资源池中随机选取的一个数值作为生成的流量分类号,或是根据报文的元组得到的数值作为生成的流量分类号,或是针对报文需流经的业务路径中一跳,根据该跳中多个业务节点间的负载状态确定的一个数值作为生成的流量分类号。The generating unit is specifically configured to use a value randomly selected from the resource pool as the generated traffic classification number, or the value obtained according to the tuple of the packet as the generated traffic classification number, or the flow of the packet One hop in the service path, a value determined according to the load status between the plurality of service nodes in the hop as the generated traffic classification number.
结合第四方面或第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,所述中心控制设备还包括:With reference to the fourth aspect, or the first possible implementation manner of the fourth aspect, in the second possible implementation manner of the fourth aspect, the central control device further includes:
接收单元,用于接收业务节点上报的报文的元组,以及与该报文所在报文流对应的反向流的元组;a receiving unit, configured to receive a tuple of the packet reported by the service node, and a tuple of the reverse flow corresponding to the packet flow of the packet;
所述生成单元,具体用于为所述反向流中的报文生成流量分类号时,生成与所述报文流中的报文相同的流量分类号,使得所述反向流中的报文流经的业务节点与所述报文流中的报文流经的业务节点相同但顺序相反。The generating unit is configured to: when generating a traffic classification number for the packet in the reverse flow, generate a traffic classification number that is the same as the packet in the packet flow, so that the report in the reverse flow The service node through which the text flows is the same as the service node through which the packet in the packet flow flows, but in the reverse order.
第五方面,提供一种中心控制设备,包括接口、存储器和处理器,其中,接口、存储器和处理器之间通过总线连接;In a fifth aspect, a central control device is provided, including an interface, a memory, and a processor, wherein the interface, the memory, and the processor are connected by a bus;
所述存储器,用于存储程序代码,并将存储的程序代码传输给处理器;The memory is configured to store program code and transmit the stored program code to a processor;
所述处理器,用于为报文生成流量分类号和业务路由标识,并将该流量分类号和业务路由标识传输给接口;The processor is configured to generate a traffic classification number and a service route identifier for the packet, and transmit the traffic classification number and the service route identifier to the interface;
所述接口,用于将所述流量分类号和业务路由标识发送给流分类设备,指示流分类设备将所述流量分类号和业务路由标识添加在所述报文中。The interface is configured to send the traffic classification number and the service route identifier to the traffic classification device, and the traffic classification device adds the traffic classification number and the service route identifier to the packet.
结合第五方面,在第五方面的第一种可能的实现方式中,With reference to the fifth aspect, in a first possible implementation manner of the fifth aspect,
所述存储器,还用于存储资源池中的数值,并传输给处理器;The memory is further configured to store a value in the resource pool and transmit the value to the processor;
所述处理器,具体用于从资源池中随机选取的一个数值作为生成的流量分类号,或是根据报文的元组得到的数值作为生成的流量分类号,或是针对 报文需流经的业务路径中一跳,根据该跳中多个业务节点间的负载状态确定的一个数值作为生成的流量分类号。The processor is specifically configured to use a value randomly selected from the resource pool as the generated traffic classification number, or a value obtained according to the tuple of the packet as the generated traffic classification number, or A hop in the service path through which the packet needs to pass, and a value determined according to the load status between the multiple service nodes in the hop as the generated traffic classification number.
结合第五方面或第一方面的第一种可能的实现方式,在第五方面的第二种可能的实现方式中,With reference to the fifth aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the fifth aspect,
所述接口,还用于接收业务节点上报的报文的元组,以及与该报文所在报文流对应的反向流的元组,并传输给处理器;The interface is further configured to receive a tuple of the packet reported by the service node, and a tuple of the reverse flow corresponding to the packet flow of the packet, and transmit the tuple to the processor;
所述处理器,具体用于为所述反向流中的报文生成流量分类号时,生成与所述报文流中的报文相同的流量分类号,使得所述反向流中的报文流经的业务节点与所述报文流中的报文流经的业务节点相同但顺序相反。The processor is configured to: when generating a traffic classification number for the packet in the reverse flow, generate a traffic classification number that is the same as the packet in the packet flow, so that the report in the reverse flow The service node through which the text flows is the same as the service node through which the packet in the packet flow flows, but in the reverse order.
本发明预先为同一报文流中的各报文配置相同的流量分类号,当报文在业务节点网络中的业务下一跳中有多个业务节点时,利用所述流量分类号进行负载均衡运算后,从所述多个业务节点中选择一个业务节点,使报文流经选择的所述业务节点,在报文流的数量稳定时,可实现一跳中多个业务节点间对报文流的均担,即使一跳中业务节点的数量发生变化,也能够在统计意义上实现业务节点间的负载均衡。The present invention pre-configures the same traffic classification number for each packet in the same packet flow. When the packet has multiple service nodes in the service next hop of the service node network, the traffic classification number is used for load balancing. After the operation, a service node is selected from the plurality of service nodes, so that the packet flows through the selected service node, and when the number of the packet flows is stable, the packets between multiple service nodes in one hop can be implemented. The average load of the flow can realize the load balancing between the service nodes in a statistical sense even if the number of service nodes in one hop changes.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention, Those skilled in the art can also obtain other drawings based on these drawings without paying for inventive labor.
图1为本发明实施例一中报文处理方法的步骤示意图;1 is a schematic diagram of steps of a message processing method according to Embodiment 1 of the present invention;
图2为本发明实施例一和实施例二中的业务节点网络示意图;2 is a schematic diagram of a service node network according to Embodiment 1 and Embodiment 2 of the present invention;
图3为本发明实施例二中报文处理方法的步骤示意图;3 is a schematic diagram of steps of a packet processing method according to Embodiment 2 of the present invention;
图4为本发明实施例三中的业务节点网络示意图;4 is a schematic diagram of a service node network in Embodiment 3 of the present invention;
图5为本发明实施例三中报文处理方法的步骤示意图;FIG. 5 is a schematic diagram of steps of a packet processing method according to Embodiment 3 of the present invention; FIG.
图6(a)和图6(b)为本发明实施例四中报文处理设备的结构示意图; 6(a) and 6(b) are schematic diagrams showing the structure of a message processing device according to Embodiment 4 of the present invention;
图7(a)和图7(b)为本发明实施例五中中心控制设备的结构示意图。7(a) and 7(b) are schematic diagrams showing the structure of a central control device according to a fifth embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The present invention will be further described in detail with reference to the accompanying drawings, in which FIG. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
为了在业务路径上的一跳中的业务节点数量动态变化的情况下,实现业务节点的负载均衡,本发明实施例提出了一种报文处理方案,预先为同一报文流中的每个报文配置相同的流量分类号(英文:traffic classify number,缩写:TCN),当报文流中任一报文的一跳中有多个业务节点(即该跳中有多个具有相同网络业务功能的业务节点),可根据为该报文配置的TCN,从所述多个业务节点中选择一个合适的业务节点,使报文流经选择的所述业务节点。在报文流的数量较多且稳定时,可实现一跳中多个业务节点间对报文流的均担,即使一跳中业务节点的数量发生变化,也能够在统计意义上实现多个业务节点间的负载均衡。In order to implement the load balancing of the service node in the case where the number of the service nodes in the one-hop of the service path is dynamically changed, the embodiment of the present invention provides a packet processing scheme, which is pre-determined for each packet in the same packet flow. The traffic classifier number (English: traffic classify number, abbreviation: TCN) is configured to have multiple service nodes in one hop of any packet in the packet flow (that is, multiple hops have the same network service function). The service node may select a suitable service node from the plurality of service nodes according to the TCN configured for the packet, so that the packet flows through the selected service node. When the number of packet flows is large and stable, the total load of the packet flows between multiple service nodes in one hop can be realized. Even if the number of service nodes changes in one hop, multiple statistics can be realized. Load balancing between business nodes.
在本发明实施例的方案中,报文流从源节点传输至目的节点的过程中,若该报文流中的报文需要被执行若干种网络业务功能,则需流经由多个业务节点构成的业务节点网络。报文流从源节点出发后,可经过多个网络交换机到达业务节点网络的入口,报文流在业务节点网络中传输时,从上一个业务节点经过一跳到达下一个业务节点之间也可以经过多个网络交换机。In the solution of the embodiment of the present invention, in the process of transmitting the packet flow from the source node to the destination node, if the packet in the packet flow needs to perform several kinds of network service functions, the flow needs to be formed through multiple service nodes. Business node network. After the packet stream starts from the source node, it can reach the portal of the service node network through multiple network switches. When the packet stream is transmitted in the service node network, it can also be sent from the previous service node to the next service node after one hop. Pass through multiple network switches.
所述报文流从源节点传输至目的节点的过程可以举例为:作为源节点的视频服务器生成报文流后,该报文流传输至作为目的节点的终端的过程。The process of transmitting the packet flow from the source node to the destination node may be, for example, a process in which the video server that is the source node generates a packet flow and then transmits the packet flow to the terminal that is the destination node.
以图2所示的业务节点网络为例,当报文流到达业务节点网络的入口(图2中的流分类模块)时,流分类模块将报文流中各报文依次向业务第一跳中的业务节点A传输,业务节点A对接收到的报文执行相应的网络业务功能后, 再向业务第二跳中业务节点B1、业务节点B2和业务节点B3中的一个业务节点传输。Taking the service node network shown in FIG. 2 as an example, when the packet flow arrives at the entry of the service node network (the flow classification module in FIG. 2), the flow classification module sequentially forwards each packet in the packet flow to the service first hop. After the service node A transmits, the service node A performs the corresponding network service function on the received message. Then, it is transmitted to one of the service node B1, the service node B2, and the service node B3 in the second hop of the service.
在图2所示的业务节点网络中,每个业务节点附着在一个负载均衡模块上,其中,业务节点附着在负载均衡模块上是指:由负载均衡模块将报文传输给业务节点,并接收业务节点执行网络业务功能后的报文,以及对报文进行下一跳传输,业务节点无需关心报文从哪来以及到哪去,只要接收到所附着的负载均衡模块传输的报文,就对该报文执行相应的网络业务功能即可。In the service node network shown in Figure 2, each service node is attached to a load balancing module. The service node is attached to the load balancing module. The load balancing module transmits the packet to the service node and receives the packet. After the service node performs the network service function and performs the next hop transmission on the packet, the service node does not need to care about where the packet comes from and where to go. As long as the packet transmitted by the attached load balancing module is received, The corresponding network service function can be performed on the message.
负载均衡模块需要记录附着在该负载均衡模块上的业务节点的媒体访问控制(英文:media access control,缩写:MAC)地址等能够与该业务节点进行通信的信息,若一个负载均衡模块上附着有多个业务节点,还需记录与每个业务节点进行通信的通信接口的接口号。同时,业务节点也需记录所附着的负载均衡模块的MAC地址等能够与该负载均衡模块进行通信的信息。The load balancing module needs to record information such as media access control (MAC) address of the service node attached to the load balancing module, and can communicate with the service node, if a load balancing module is attached For multiple service nodes, the interface number of the communication interface that communicates with each service node is also recorded. At the same time, the service node also needs to record information such as the MAC address of the attached load balancing module that can communicate with the load balancing module.
负载均衡模块记录附着在该负载均衡模块上的业务节点所属的节点集合中每个业务节点的信息,还记录根据附着在该负载均衡模块上的业务节点所属的节点集合在业务路径中的位置,记录该节点集合的下一跳节点集合中业务节点的信息。所述业务节点的信息包括:业务节点的标识,业务节点对应的用于进行负载均衡运算的运算值,以及业务节点所附着的负载均衡模块的地址。The load balancing module records information of each service node in the node set to which the service node attached to the load balancing module belongs, and records the location of the node set to which the service node attached to the load balancing module belongs in the service path. Record information of the service node in the next hop node set of the node set. The information of the service node includes: an identifier of the service node, an operation value corresponding to the service node for performing load balancing operation, and an address of the load balancing module to which the service node is attached.
由于一跳中业务节点的数量会发生变化,因此,可由图2中的中心控制模块对业务节点网络中每一跳的业务节点的数量进行监控,若某一跳中业务节点的数量发生变化,则中心控制模块确定增加或减少的业务节点所属的节点集合,将增加或减少的业务节点的信息发送给该节点集合中各业务节点所附着的SRF;以及中心控制模块还根据该节点集合在业务路径中的位置,确定该节点集合的上一跳节点集合,并将增加或减少的业务节点的信息通过更新消息发送给该上一跳节点集合中每个业务节点所附着的负载均衡模块。Since the number of service nodes in a hop changes, the number of service nodes in each hop of the service node network can be monitored by the central control module in FIG. 2, and if the number of service nodes in a hop changes, Then, the central control module determines the node set to which the added or decreased service node belongs, and sends the information of the added or reduced service node to the SRF to which the service node is attached in the node set; and the central control module further performs the service according to the node set. The location in the path determines a set of upper hop nodes of the set of nodes, and sends information of the added or decreased service node to the load balancing module attached to each service node in the set of previous hop nodes through an update message.
接收到中心控制模块发送的所述更新消息的负载均衡模块,需根据接收到的所述更新消息中包含的内容,更新本地记录的业务节点的信息。 The load balancing module that receives the update message sent by the central control module needs to update the information of the locally recorded service node according to the content included in the received update message.
所述负载均衡模块可以是与附着在其上的业务节点独立的模块,如负载均衡模块可以是业务路由功能模块(英文:service routing function,缩写:SRF);所述负载均衡模块还可以是与附着在其上的业务节点集成在一起的模块,负载均衡模块以虚拟机的形式出现。后续为方便描述,以负载均衡模块是SRF为例进行描述。The load balancing module may be a module independent of the service node attached thereto. For example, the load balancing module may be a service routing function (SRF); the load balancing module may also be A module in which the business nodes attached to it are integrated, and the load balancing module appears as a virtual machine. For the convenience of description, the load balancing module is an SRF as an example.
本发明各实施例中所涉及的报文从一个业务节点向另一个业务节点传输的过程,是指报文在业务路径上的传输。The process of transmitting a message from one service node to another service node in the embodiments of the present invention refers to the transmission of the message on the service path.
下面结合具体实施例对本发明方案做具体描述,当然,本发明方案并不局限于以下实施例。The present invention will be specifically described below in conjunction with specific embodiments. Of course, the solution of the present invention is not limited to the following embodiments.
实施例一:Embodiment 1:
如图1所示,为本发明实施例一中报文处理方法的步骤示意图,所述方法包括以下步骤:FIG. 1 is a schematic diagram of steps of a packet processing method according to Embodiment 1 of the present invention, where the method includes the following steps:
步骤101:在根据报文中的业务路由标识确定报文的业务下一跳有多个业务节点时,根据所述报文中包含的TCN和业务下一跳中业务节点的数量值进行负载均衡运算。Step 101: Perform load balancing according to the TCN of the packet and the number of service nodes in the service next hop according to the service route identifier in the packet, when the service next hop has multiple service nodes. Operation.
在实施例一的方案中,同一报文流中的所有报文中添加的TCN相同。In the solution of the first embodiment, the TCNs added to all the packets in the same packet flow are the same.
步骤102:根据运算结果从所述业务下一跳的业务节点中选择一个业务节点,并将所述报文向选择的所述业务节点传输。Step 102: Select a service node from the service nodes of the service next hop according to the operation result, and transmit the message to the selected service node.
通过本发明实施例一中所描述的报文处理方法,在报文流的数量较多且稳定时,可实现一跳中多个业务节点间对报文流的均担,即使一跳中业务节点的数量发生变化,也能够在统计意义上实现多个业务节点间的负载均衡。With the packet processing method described in the first embodiment of the present invention, when the number of packet flows is large and stable, the total load of the packet flows between multiple service nodes in one hop can be realized, even in a hop service. The number of nodes changes, and load balancing between multiple service nodes can also be achieved statistically.
下面以图2所示的业务节点网络为例,通过实施例二对本发明实施例一的方案进行详细描述。The following describes the solution of the first embodiment of the present invention in detail by using the service node network shown in FIG. 2 as an example.
实施例二:Embodiment 2:
如图3所示,为本发明实施例二中报文处理方法的步骤示意图,所述方法包括以下步骤:FIG. 3 is a schematic diagram of steps of a packet processing method according to Embodiment 2 of the present invention, where the method includes the following steps:
步骤201:中心控制模块为报文流中的报文生成TCN和业务路由标识。 Step 201: The central control module generates a TCN and a service route identifier for the packet in the packet flow.
在本发明实施例一的方案中,当报文流到达业务节点组成的入口,即图2中的流分类模块时,该流分类模块首先将报文流中首个报文发送给中心控制模块,中心控制模块为接收到的报文生成TCN和业务路由标识。In the solution of the first embodiment of the present invention, when the packet flow arrives at the entry of the service node, that is, the flow classification module in FIG. 2, the flow classification module first sends the first packet in the packet flow to the central control module. The central control module generates a TCN and a service route identifier for the received packet.
中心控制模块生成的所述TCN可以是中心控制模块从资源池中随机选取的一个数值,也可以根据报文的元组所得到的数值,还可以是针对报文需流经的业务路径中一跳,根据该跳中多个业务节点间的负载状态确定的一个数值。The TCN generated by the central control module may be a value randomly selected by the central control module from the resource pool, or may be based on the value obtained by the tuple of the packet, or may be one of the service paths for the packet to flow through. Hop, a value determined based on the load state between multiple service nodes in the hop.
在中心控制模块生成的所述TCN是中心控制模块从资源池中随机选取的一个数值的情况下,所述资源池中预先缓存有多个可作为TCN的数值。资源池中预先缓存的可作为TCN的数值为正整数。资源池中缓存的所有数值中最大的一个数值满足以下条件:大于等于在报文流经的各跳中,具有相同网络业务功能的业务节点的最大值的M倍,其中M为大于1的整数。可选的,M等于100。例如:在报文需流经的业务第一跳中有一个业务节点A,业务第二跳中有3个业务节点(分别为业务节点B1、业务节点B2和业务节点B3),业务第三跳中有2个业务节点(分别为业务节点C1和业务节点C2),此时,一跳中,具有相同网络业务功能的业务节点的最大值为3,若M等于100,则资源池中的所有数值中最大的一个数值为大于等于300的整数。In the case that the TCN generated by the central control module is a value randomly selected by the central control module from the resource pool, a plurality of values that can be used as TCNs are pre-cached in the resource pool. The value that can be pre-cached in the resource pool as a TCN is a positive integer. The largest value of all the values cached in the resource pool meets the following conditions: greater than or equal to M times the maximum value of the service node with the same network service function in each hop through which the packet flows, where M is an integer greater than 1. . Optionally, M is equal to 100. For example, there is one service node A in the first hop of the service to which the packet needs to flow, and three service nodes in the second hop of the service (the service node B1, the service node B2, and the service node B3, respectively), and the service third hop There are two service nodes (the service node C1 and the service node C2). In this case, the maximum value of the service node with the same network service function is 3 in one hop. If M is equal to 100, all in the resource pool. The largest value in the value is an integer greater than or equal to 300.
所述报文的元组为以下一个或多个的组合:报文的源互联网协议(英文:Internet Protocol,缩写IP)地址;目的IP地址;协议号;在该报文为传输控制协议(英文:Transmission Control Protocol,缩写:TCP)报文的情况下,报文的TCP源端口号;在该报文为TCP报文的情况下,报文的TCP目的端口号;在该报文为用户数据报协议(英文:User Datagram Protocol,缩写:UDP)报文的情况下,报文的UDP源端口号;在该报文为UDP报文的情况下,报文的UDP目的端口号。The tuple of the packet is a combination of one or more of the following: a source Internet protocol (English: Internet Protocol, abbreviated IP) address; a destination IP address; a protocol number; and the packet is a transmission control protocol. : Transmission Control Protocol (abbreviation: TCP), the TCP source port number of the packet, the TCP destination port number of the packet when the packet is a TCP packet, and the user data in the packet. The UDP source port number of the packet in the case of the User Datagram Protocol (UDP) packet. The UDP destination port number of the packet when the packet is a UDP packet.
在中心控制模块生成的所述TCN是根据报文的元组所得到的数值的情况下,具体的,根据所述元组计算出TCN。上述计算的算法可以为散列(英文:hash)算法。以所述报文的元组为报文的目的IP地址,计算的算法为将目的 IP地址以点分十进制表示法(英文:dot-decimal notation)中的四个十进制整数相加为例,如果报文的目的IP地址为200.1.1.154,则将所述目的IP地址中的数值200、1、1和154之和,即356,作为TCN。In the case where the TCN generated by the central control module is a value obtained according to a tuple of a message, specifically, the TCN is calculated according to the tuple. The above calculated algorithm can be a hash (English: hash) algorithm. The tuple of the packet is the destination IP address of the packet, and the algorithm is calculated for the purpose. The IP address is added as an example of the four decimal integers in dotted decimal notation (English: dot-decimal notation). If the destination IP address of the packet is 200.1.1.154, the value in the destination IP address is 200. The sum of 1, 1, and 154, 356, is used as the TCN.
在中心控制模块生成的所述TCN是根据一跳中的多个业务节点的负载状态确定的数值的情况下,中心控制模块确定该跳中多个业务节点中负载较低的业务节点,使得SRF利用确定出的TCN进行步骤209中的负载均衡运算后,根据运算结果能够从所述多个业务节点中选择出所述负载较低的业务节点,以达到业务节点间负载均衡的目的。In a case where the TCN generated by the central control module is a value determined according to load states of a plurality of service nodes in one hop, the central control module determines a service node with a lower load among the plurality of service nodes in the hop, so that the SRF After the load balancing operation in step 209 is performed by using the determined TCN, the service node with the lower load can be selected from the plurality of service nodes according to the operation result, so as to achieve load balancing between the service nodes.
所述中心控制模块可根据报文在业务节点的网络中的业务路径生成业务路由标识,所述业务路由标识可以反映一跳业务路径,换句话说,所述业务路由标识可以反映报文需由具有何种网络业务功能的业务节点对其执行相应的网络业务功能,但是,如果具有同一网络业务功能的业务节点数量有多个,则所述业务路由标识只反映需由这多个业务节点中的一个业务节点对报文执行相应的网络业务功能,而不反映是由这多个业务节点中的哪一个业务节点对报文执行相应的网络业务功能。The central control module may generate a service route identifier according to the service path of the packet in the network of the service node, where the service route identifier may reflect a one-hop service path. In other words, the service route identifier may reflect the packet requirement. The service node having the network service function performs the corresponding network service function on it, but if there are multiple service nodes having the same network service function, the service route identifier only reflects the need to be among the multiple service nodes. A service node performs a corresponding network service function on the message, and does not reflect which of the plurality of service nodes performs a corresponding network service function on the message.
以图2所示的业务节点的网络为例,中心控制模块确定报文需被业务节点A执行相应的网络业务功能,被业务节点B1、业务节点B2或业务节点B3中的一个业务节点执行相应的网络业务功能,生成的业务路由标识可以反映报文在图2所示的网络需流经业务节点A,还需流经业务节点B1、业务节点B2或业务节点B3中的一个业务节点,但无法确定流经业务节点B1、业务节点B2或业务节点B3中的哪一个业务节点。Taking the network of the service node shown in FIG. 2 as an example, the central control module determines that the packet needs to be executed by the service node A to perform the corresponding network service function, and is executed by one of the service node B1, the service node B2, or the service node B3. The network service function, the generated service route identifier can reflect that the packet needs to flow through the service node A in the network shown in FIG. 2, and also needs to flow through one of the service node B1, the service node B2, or the service node B3, but It is impossible to determine which one of the service node B1, the service node B2, or the service node B3 flows through.
本步骤201可以是实现本发明目的的优选步骤,本发明实施例也可以由其他网络设备为报文流中的报文生成TCN和业务路由标识,且生成TCN的方式也不限于以上描述的三种方式。The step 201 may be a preferred step for implementing the object of the present invention. The embodiment of the present invention may also generate a TCN and a service route identifier for the packet in the packet flow by other network devices, and the method for generating the TCN is not limited to the above three. Ways.
步骤202:中心控制模块将生成的所述TCN和业务路由标识传输给流分类模块。Step 202: The central control module transmits the generated TCN and the service route identifier to the flow classification module.
中心控制模块可控制一个或多个流分类模块,在为流分类模块发送的报 文生成TCN和业务路由标识后,将该报文、为该报文生成的TCN和业务路由标识传输给发送该报文的流分类模块。The central control module can control one or more flow classification modules, and send the report to the flow classification module. After the TCN and the service route identifier are generated, the packet, the TCN and the service route identifier generated by the packet are transmitted to the traffic classification module that sends the packet.
步骤203:流分类模块将所述TCN和业务路由标识添加在报文流中的各报文中。Step 203: The flow classification module adds the TCN and the service route identifier to each packet in the packet flow.
报文中添加的TCN和业务路由标识将一直伴随该报文在业务节点网络中的传输,不再发生变化。The TCN and service route identifier added in the packet will always be accompanied by the transmission of the packet in the service node network, and will not change.
优选地,本发明实施例对报文的报文头做了扩展,流分类模块在报文中新增一个业务路由报文头,流分类模块将所述TCN和业务路由标识添加在新增的业务路由报文头中。这样做的好处是:由于某些业务节点对报文执行相应的网络业务功能时,会修改IP头中的内容,将TCN和业务路由标识添加在业务路由报文头中不会被修改。另外,使用TCN做负载均衡运算时不依赖报文格式,可支持全新的报文格式,TCN和业务路由标识添加在业务路由报文头中,不论报文的格式如何,SRF都可从中识别出该报文包含的TCN和业务路由标识。Preferably, the embodiment of the present invention extends the packet header of the packet, and the traffic classification module adds a service routing packet header to the packet, and the traffic classification module adds the TCN and the service routing identifier to the newly added Service routing message header. The advantage of this is that when some service nodes perform the corresponding network service function on the packet, the content in the IP header is modified, and the TCN and the service route identifier are added to the service routing packet header without being modified. In addition, when the TCN is used for load balancing, it does not depend on the packet format. It supports a new packet format. The TCN and the service route identifier are added to the service routing header. The SRF can be identified from the packet regardless of the format of the packet. The TCN and service route identifier contained in the packet.
上述中心控制模块和流分类模块的功能可以由两个网络设备分别实现,也可以由一个网络设备实现,即该网络设备同时具有上述中心控制模块和流分类模块的功能。The functions of the central control module and the flow classification module may be implemented by two network devices, or may be implemented by one network device, that is, the network device has the functions of the central control module and the flow classification module.
以上步骤202和步骤203是本发明实施例的优选步骤,本发明实施例可以通过其他方式或由其他网络设备在报文中添加TCN。The foregoing steps 202 and 203 are preferred steps of the embodiment of the present invention. The embodiment of the present invention may add a TCN to the packet by using other methods or by other network devices.
步骤204:流分类模块根据报文中包含的业务路由标识,将报文流中的各报文向业务节点A所附着的SRF1传输。Step 204: The traffic classification module transmits each packet in the packet flow to the SRF1 attached to the service node A according to the service route identifier included in the packet.
在图2所示的网络中,业务第一跳中只有一个业务节点A,因此,流分类模块可直接将报文向业务节点A传输。假设业务第一跳中有多个具有相同网络业务功能的业务节点,如业务节点A1和业务节点A2,则流分类模块也按照以下步骤208至步骤211的方案,从所述业务节点A1和业务节点A2中选择出一个业务节点,并将报文向选择出的业务节点所附着的SRF传输。In the network shown in FIG. 2, there is only one service node A in the first hop of the service. Therefore, the traffic classification module can directly transmit the packet to the service node A. Assume that there are multiple service nodes with the same network service function in the first hop of the service, such as the service node A1 and the service node A2, and the flow classification module also follows the schemes of the following steps 208 to 211, from the service node A1 and the service. A service node is selected in the node A2, and the message is transmitted to the SRF to which the selected service node is attached.
本步骤204是本发明实施例的优选步骤,本发明实施例的方案可以由其 他网络设备向SRF1传输报文。This step 204 is a preferred step of the embodiment of the present invention, and the solution of the embodiment of the present invention may be His network device transmits a message to SRF1.
步骤205:业务节点A所附着的SRF1接收报文。Step 205: The SRF1 attached to the service node A receives the packet.
步骤206:SRF1将所述报文传输给业务节点A。Step 206: SRF1 transmits the message to service node A.
步骤207:业务节点A对报文执行相应的网络业务功能后,再将该报文返回给SRF1。Step 207: After the service node A performs the corresponding network service function on the packet, the service node A returns the packet to the SRF1.
业务节点记录了所附着的SRF的MAC地址,在业务节点A对报文执行相应的网络业务功能后,根据SRF1的MAC地址,将报文返回给SRF1。The service node records the MAC address of the attached SRF. After the service node A performs the corresponding network service function on the packet, the service node returns the packet to SRF1 according to the MAC address of the SRF1.
以上步骤201至步骤207是在实施例一中步骤101之前执行的,针对任一SRF而言,该SRF在将报文进行下一跳传输之前,需将接收到的报文传输给附着在该SRF上的业务节点,并在接收到业务节点返回的已执行了网络业务功能后的报文时,执行实施例一中步骤101的操作。The foregoing step 201 to step 207 are performed before the step 101 in the first embodiment. For any SRF, the SRF needs to transmit the received message to the attached before the packet is transmitted to the next hop. The service node on the SRF performs the operation of step 101 in the first embodiment when receiving the packet that has been sent by the service node and has performed the network service function.
步骤208:SRF1根据报文中的业务路由标识确定业务下一跳的业务节点,若业务下一跳中有多个业务节点,则执行步骤209;若业务下一跳中只有一个业务节点,则直接将所述报文向业务下一跳的业务节点所附着的SRF传输。Step 208: The SRF1 determines the service node of the service next hop according to the service route identifier in the packet. If there are multiple service nodes in the next hop of the service, step 209 is performed; if there is only one service node in the next hop of the service, The message is directly transmitted to the SRF to which the service node of the next hop of the service is attached.
SRF可以以负载均衡表的形式存储业务路径中,下一跳各业务节点的信息,如表1所示。The SRF can store the information of each service node in the service path in the service path in the form of a load balancing table, as shown in Table 1.
Figure PCTCN2014086834-appb-000001
Figure PCTCN2014086834-appb-000001
表1Table 1
SRF1根据报文中包含的业务路由标识从本地存储的负载均衡表中查询出表1,进而根据表1中的内容确定报文的业务下一跳中包括业务节点B1和业务节点B2,同时,表1中还记录了业务节点B1的运算值和所附着的SRF2的地址,以及记录了业务节点B2的运算值和所附着的SRF3的地址。SRF1 queries the load balancing table stored in the local device according to the service route identifier included in the packet, and determines that the next hop of the service includes the service node B1 and the service node B2 according to the content in Table 1. Table 1 also records the operation value of the service node B1 and the address of the attached SRF2, and records the operation value of the service node B2 and the address of the attached SRF3.
所述运算值用于在后续步骤209进行负载均衡运算后,与得到的运算结果进行比较以选择业务节点的目的。所述运算值可以是业务节点B1和业务节 点B2分别附着的SRF2和SRF3的地址进行排序后的序列值。The operation value is used to compare the obtained operation result with the obtained operation result after the load balancing operation in the subsequent step 209 to select the purpose of the service node. The operation value may be a service node B1 and a service section. The sequence values of the SRF2 and SRF3 addresses respectively attached to point B2 are sorted.
假设图2所示的网络中,新增了一个具有B网络业务功能的业务节点B3(图1中虚线表示部分),业务节点B3附着在SRF4上,则中心控制模块可将业务节点B3的标识、SRF4的地址、业务节点B3对应的的运算值通知SRF1,SRF1将表1中的内容更新为表2。Assume that in the network shown in FIG. 2, a service node B3 having a B network service function (a portion indicated by a broken line in FIG. 1) is added, and the service node B3 is attached to the SRF4, and the central control module can identify the service node B3. The address of SRF4 and the calculated value corresponding to service node B3 are notified to SRF1, and SRF1 updates the contents of Table 1 to Table 2.
Figure PCTCN2014086834-appb-000002
Figure PCTCN2014086834-appb-000002
表2Table 2
除了SRF1中更新表1外,SRF2、SRF3和SRF4也都更新本地的负载均衡表,其中,SRF2记录业务节点B2的标识、业务节点B2的运算值和业务节点B2所附着的SRF3的地址,还记录业务节点B3的标识、业务节点B3的运算值和业务节点B3所附着的SRF4的地址;SRF3记录业务节点B1的标识、业务节点B1的运算值和业务节点B1所附着的SRF2的地址,还记录业务节点B3的标识、业务节点B3的运算值和业务节点B3所附着的SRF4的地址;SRF4记录业务节点B1的标识、业务节点B1的运算值和业务节点B1所附着的SRF2的地址,还记录业务节点B2的标识、业务节点B2的运算值和业务节点B2所附着的SRF3的地址。In addition to updating Table 1 in SRF1, SRF2, SRF3, and SRF4 also update the local load balancing table, where SRF2 records the identity of service node B2, the operational value of service node B2, and the address of SRF3 to which service node B2 is attached. Recording the identity of the service node B3, the operation value of the service node B3, and the address of the SRF4 to which the service node B3 is attached; the SRF3 records the identity of the service node B1, the operation value of the service node B1, and the address of the SRF2 to which the service node B1 is attached, Recording the identity of the service node B3, the operation value of the service node B3, and the address of the SRF4 to which the service node B3 is attached; the SRF4 records the identity of the service node B1, the operation value of the service node B1, and the address of the SRF2 to which the service node B1 is attached. The identification of the service node B2, the operation value of the service node B2, and the address of the SRF3 to which the service node B2 is attached are recorded.
需要说明的是,图2是以每个SRF上附着一个业务节点为例进行说明的,当一个SRF上附着有多个业务节点时,每个业务节点可通过一个独立的端口与SRF通信。假设在图2所示的网络示意图中,新增了一个具有B网络业务功能的业务节点B3,业务节点B3附着在SRF3上,且业务节点B3的运算值为2,中心控制模块可将业务节点B3的标识、运算值和所附着的SRF4的地址通知SRF1,SRF1将表1中的内容更新为表3。It should be noted that FIG. 2 is an example in which a service node is attached to each SRF. When multiple service nodes are attached to one SRF, each service node can communicate with the SRF through an independent port. It is assumed that in the network diagram shown in FIG. 2, a service node B3 having a B network service function is added, the service node B3 is attached to the SRF3, and the operation value of the service node B3 is 2, and the central control module can set the service node. The identifier of B3, the operation value, and the address of the attached SRF4 are notified to SRF1, and SRF1 updates the contents of Table 1 to Table 3.
Figure PCTCN2014086834-appb-000003
Figure PCTCN2014086834-appb-000003
Figure PCTCN2014086834-appb-000004
Figure PCTCN2014086834-appb-000004
表3table 3
除了SRF1中更新表1外,SRF2和SRF3也都更新本地的负载均衡表,其中,SRF2记录业务节点B2的标识、业务节点B2的运算值和业务节点B2所附着的SRF3的地址,还记录业务节点B3的标识、业务节点B3的运算值和业务节点B3所附着的SRF3的地址;SRF3记录业务节点B1的标识、业务节点B1的运算值和业务节点B1所附着的SRF2的地址,还记录业务节点B2与SRF3的通信接口的接口号(假设为接口号1)、业务节点B3与SRF3的通信接口的接口号(假设为接口号2)。In addition to updating Table 1 in SRF1, both SRF2 and SRF3 also update the local load balancing table, where SRF2 records the identity of service node B2, the operational value of service node B2, and the address of SRF3 to which service node B2 is attached, and also records the service. The identifier of the node B3, the operation value of the service node B3, and the address of the SRF3 to which the service node B3 is attached; the SRF3 records the identifier of the service node B1, the operation value of the service node B1, and the address of the SRF2 to which the service node B1 is attached, and records the service. The interface number of the communication interface of node B2 and SRF3 (assumed to be interface number 1), the interface number of the communication interface of service node B3 and SRF3 (assumed to be interface number 2).
步骤209:SRF1根据所述报文中的TCN和业务下一跳中业务节点的数量值进行负载均衡运算。Step 209: SRF1 performs load balancing operation according to the TCN in the packet and the value of the service node in the next hop of the service.
以上步骤209是对实施例一中步骤101的具体描述。The above step 209 is a detailed description of the step 101 in the first embodiment.
步骤210:SRF1根据运算结果,从业务下一跳的多个业务节点中选择一个业务节点。Step 210: SRF1 selects one service node from multiple service nodes of the next hop of the service according to the operation result.
在本步骤210中,SRF1可通过负载均衡运算得到运算结果后,查询表1、表2或表3,在运算结果的值域与表1、表2或表3中运算值的集合相同,因此,根据得到的运算结果可从表1、表2或表3中查询出相同的运算值,进而确定查询出的运算值对应的业务节点。举例来说,上述负载均衡运算可以为hash计算。In this step 210, after obtaining the operation result by the load balancing operation, SRF1 queries Table 1, Table 2, or Table 3, and the value range of the operation result is the same as the set of the operation values in Table 1, Table 2, or Table 3, According to the obtained operation result, the same operation value can be queried from Table 1, Table 2 or Table 3, and then the service node corresponding to the calculated operation value is determined. For example, the above load balancing operation can be a hash calculation.
步骤211:SRF1将所述报文向选择的所述业务节点传输。Step 211: SRF1 transmits the message to the selected service node.
假设在步骤209和步骤210中SFR1通过负载均衡运算以及查询表1选择的业务节点是业务节点B2,在本步骤211中,SRF1再根据表1中业务节点B2所附着的SRF3的地址,将报文向SRF3传输,再由SRF3将报文向业务节点B2传输,实现了报文从业务节点A向业务节点B2传输的过程。 It is assumed that the service node selected by the SFR1 through the load balancing operation and the query table 1 in step 209 and step 210 is the service node B2. In this step 211, the SRF1 is further reported according to the address of the SRF3 attached to the service node B2 in Table 1. The message is transmitted to the SRF3, and then the message is transmitted by the SRF3 to the service node B2, and the process of transmitting the message from the service node A to the service node B2 is realized.
假设在步骤209和步骤210中SRF1通过负载均衡运算以及查询表3选择的业务节点是业务节点B2,在本步骤211中,SRF1再根据表3中业务节点B2所附着的SRF3的地址,向SRF3传输报文;SRF3接收到报文后,确定业务节点B2和业务节点B3都附着在SRF3上,因此,SRF3根据接收到的报文中的TCN和记录的当前跳中业务节点的数量值,进行与SRF1在步骤209中相同的负载均衡运算,得到的运算结果与步骤209中SRF1的运算结果相同,可确定该报文需向业务节点B2传输,SRF3根据业务节点B2与SRF3的通信接口的接口号(假设为接口号1),向业务节点B2传输报文。It is assumed that the service node selected by SRF1 through the load balancing operation and the query table 3 in step 209 and step 210 is the service node B2. In this step 211, the SRF1 is further directed to the SRF3 according to the address of the SRF3 attached to the service node B2 in Table 3. After the message is received, the SRF3 determines that both the service node B2 and the service node B3 are attached to the SRF3. Therefore, the SRF3 performs the TCN according to the received message and the recorded value of the current hop in the current hop. The same load balancing operation as that of SRF1 in step 209, the obtained operation result is the same as the operation result of SRF1 in step 209, and it can be determined that the message needs to be transmitted to the service node B2, and the SRF3 is based on the interface of the communication interface between the service node B2 and the SRF3. The number (assumed to be interface number 1) transmits a message to the service node B2.
当业务节点B2对报文执行相应的网络业务功能后,再将报文返回给SRF3。在报文在图2所示的业务节点网络中的传输过程结束的情况下,如果SRF3具有根据IP地址转发报文的功能,则SRF3根据报文的目的IP地址转发报文;如果SRF3不具有根据IP地址转发报文的功能,则SRF3根据预先设定的转发方式将报文向指定的路由器传输,该路由器根据报文的目的IP地址继续转发报文。After the service node B2 performs the corresponding network service function on the packet, the service packet is returned to the SRF3. In the case that the transmission process of the packet in the service node network shown in FIG. 2 is ended, if the SRF3 has the function of forwarding the packet according to the IP address, the SRF3 forwards the packet according to the destination IP address of the packet; if the SRF3 does not have According to the function of forwarding packets according to the IP address, the SRF3 transmits the packet to the designated router according to the preset forwarding mode. The router continues to forward the packet according to the destination IP address of the packet.
以上步骤210和步骤211是对实施例一中步骤102的具体描述。The above steps 210 and 211 are specific descriptions of the step 102 in the first embodiment.
以上是以图2所示的网络示意图为例对本发明实施例一的方案进行描述的,对于其他形式的业务节点网络,报文在网络中的传输过程与上述步骤208值步骤211的传输过程类似,此处不再赘述。The solution of the first embodiment of the present invention is described by taking the network diagram shown in FIG. 2 as an example. For other forms of service node networks, the transmission process of the message in the network is similar to the transmission process of step 211 of the step 208. , will not repeat them here.
通过本发明实施例一的方案,不论一跳中的业务节点数量发生何种变化,利用报文中包含的TCN来选择业务下一跳中的业务节点的方案,可以在报文流的数量稳定时,确保一跳中各业务节点的负载均衡;即使是通过随机方式为每个报文流中的报文分配TCN,由于一跳中的业务节点数量有限,也能够将大量的报文流基本均分到各个业务节点中。With the solution of the first embodiment of the present invention, the number of service nodes in the next hop can be used to select the service node in the service next hop by using the TCN included in the packet. The load balancing of each service node in one hop is ensured; even if the TCN is allocated for the packets in each packet flow in a random manner, because the number of service nodes in one hop is limited, a large number of packet flows can be basically All are divided into various business nodes.
实施例二:Embodiment 2:
本发明实施例二对实施例一中步骤209~步骤211的具体描述如下:The specific description of the steps 209 to 211 in the first embodiment of the present invention is as follows:
仍以图2所示的业务节点网络示意图为例,假设在实施例一的执行过程中,具有B网络业务功能的业务节点数量为2,分别是业务节点B1和业务节 点B2。在步骤209中,SRF1需要从业务节点B1和业务节点B2中选择一个业务节点,具体地,SRF1可利用hash算法进行负载均衡运算后,根据运算结果来选择业务节点。For example, the service node network diagram shown in FIG. 2 is taken as an example. Assume that during the execution of the first embodiment, the number of service nodes having the B network service function is 2, which are the service node B1 and the service node respectively. Point B2. In step 209, the SRF1 needs to select a service node from the service node B1 and the service node B2. Specifically, the SRF1 can perform a load balancing operation by using a hash algorithm, and then select a service node according to the operation result.
所述负载均衡运算方式包括但不限于:将报文中的TCN与业务下一跳中的业务节点数量值取模,按照取模结果选择一个业务节点,具体实现过程为:The load balancing operation mode includes, but is not limited to, modulating the value of the service node in the TCN and the service next hop in the packet, and selecting a service node according to the modulo result. The specific implementation process is as follows:
首先,SRF1将报文中的TCN与业务下一跳中的业务节点数量值(此时该数量值为2)取模,不论TCN的取值为何,取模结果都为0或1。First, SRF1 modulates the value of the TCN in the packet and the number of service nodes in the next hop of the service (in this case, the value is 2). The modulo result is 0 or 1 regardless of the value of the TCN.
然后,SRF1查询业务节点的标识与运算值的对应关系,并将取模结果作为运算值,对应的业务节点的标识,即查询表1,确定与取模结果相同的运算值对应的业务节点的标识。Then, the SRF1 queries the correspondence between the identifier of the service node and the operation value, and uses the modulo result as the operation value, and the identifier of the corresponding service node, that is, the query table 1, determines the service node corresponding to the operation value with the same modulo result. Logo.
最后,SRF1将确定的业务节点的标识对应的业务节点作为选择的业务节点。Finally, SRF1 takes the determined service node corresponding to the identity of the service node as the selected service node.
以取模结果为0为例,通过查询表1可知:运算值为0对应的业务节点是业务节点B1,则在步骤109中,SRF1从业务节点B1和业务节点B2中选择出业务节点B1。之后,SRF1根据表1中记录的业务节点B1所附着的SRF2的地址,将报文向SRF2传输,再由SRF2将报文向业务节点B1传输,完成了报文从业务节点A向业务节点B1的传输过程。Taking the modulo result as 0 as an example, it can be seen from the query table 1 that the service node corresponding to the operation value of 0 is the service node B1, and in step 109, the SRF1 selects the service node B1 from the service node B1 and the service node B2. After that, SRF1 transmits the packet to SRF2 according to the address of SRF2 attached to service node B1 recorded in Table 1, and then transmits the packet to service node B1 by SRF2, and completes the packet from service node A to service node B1. The transfer process.
以上是以业务第二跳中的业务节点为业务节点B1和业务节点B2为例进行说明的,假设业务第二跳中的业务节点的数量发生了变化,如增加了附着在SRF3上的业务节点B3,此时,业务第二跳中具有B网络业务功能的业务节点的数量值为3,且业务节点B2和业务节点B3都附着在SRF3上,SRF1中存储的负载均衡表为表3。The foregoing is an example in which the service node in the second hop of the service is the service node B1 and the service node B2, and the number of service nodes in the second hop of the service is changed, for example, the service node attached to the SRF3 is added. B3. At this time, the number of service nodes having the B network service function in the second hop of the service is 3, and both the service node B2 and the service node B3 are attached to the SRF3, and the load balancing table stored in the SRF1 is Table 3.
SRF1从业务节点B1、业务节点B2和业务节点B3中选择一个业务节点的过程为:The process of selecting a service node from service node B1, service node B2, and service node B3 by SRF1 is:
首先,SRF1将报文中的TCN与业务下一跳中的业务节点数量值(此时该数量值为3)取模,其取模结果为0、1或2。First, SRF1 modulates the value of the TCN in the packet and the number of service nodes in the next hop of the service (in this case, the value is 3), and the modulo result is 0, 1, or 2.
然后,SRF1查询表3,确定与取模结果相同的运算值。 Then, SRF1 queries Table 3 to determine the same operational value as the modulo result.
最后,SRF1将确定的运算值对应的业务节点作为选择出的业务节点。Finally, SRF1 uses the determined service node corresponding to the calculated value as the selected service node.
以取模结果为1为例,通过查询表3确定运算值为1时对应的业务节点是业务节点B2,则将业务节点B2作为步骤109中选择的业务节点。之后,SRF1查询表3确定业务节点B2附着的SRF3的地址,并根据SRF3的地址,将报文向SRF3传输。SRF3接收到报文后,将报文中的TCN和当前跳的业务节点数量值(此时该数量值为3)取模,得到的取模结果也为1,确定对应的运算值为1的业务节点是业务节点B2,则SRF3根据与业务节点B2之间的接口的接口号,将报文传输给业务节点B2。Taking the modulo result as 1 as an example, when the operation parameter is 1 and the corresponding service node is the service node B2, the service node B2 is taken as the service node selected in step 109. Thereafter, the SRF1 lookup table 3 determines the address of the SRF3 to which the service node B2 is attached, and transmits the message to the SRF3 according to the address of the SRF3. After receiving the packet, the SRF3 modulo the value of the TCN in the packet and the number of the currently hopped service node (the value is 3), and the obtained modulo result is also 1, and the corresponding operation value is determined to be 1. The service node is the service node B2, and the SRF3 transmits the message to the service node B2 according to the interface number of the interface with the service node B2.
本发明实施例二的方案是实现实施例一的优选方案,但本发明实施例一也不限于通过其他负载均衡算法从业务下一跳中选择一个业务节点,作为报文在业务下一跳中流经的业务节点。The solution of the second embodiment of the present invention is a preferred solution of the first embodiment. However, the first embodiment of the present invention is not limited to selecting a service node from the next hop of the service by using another load balancing algorithm, and the packet is in the next hop of the service. Business node.
优选地,在本实施例一或实施例二描述方案的基础上,如果将从源节点传输至目的节点的报文流视为正向流,该报文流达到目的节点后,目的节点对接收到的报文流进行处理后,若再生成回传至源节点的报文流,则可将该报文流视为反向流。如果反向流从所述目的节点回传至所述源节点时,所流经的业务节点与正向流所流经的业务节点相同但流经顺序相反,此时可称之为正向流和反向流共路。在此情况下,如果正向流在业务节点网络内的传输过程实现了业务节点间的负载均衡,则反向流也能够得到上述效果。下面通过实施例三对正向流和反向流的双向传输过程进行描述。Preferably, on the basis of the solution described in the first embodiment or the second embodiment, if the packet flow transmitted from the source node to the destination node is regarded as a forward flow, after the packet flow reaches the destination node, the destination node receives the packet. After the received packet stream is processed, if the packet stream sent back to the source node is generated, the packet stream can be regarded as a reverse stream. If the reverse flow is transmitted back from the destination node to the source node, the service node that flows through is the same as the service node through which the forward flow flows, but the flow sequence is reversed. And the reverse flow is common. In this case, if the transmission process of the forward flow in the service node network implements load balancing between the service nodes, the reverse flow can also achieve the above effect. The bidirectional transmission process of the forward flow and the reverse flow will be described below through the third embodiment.
实施例三:Embodiment 3:
本发明实施例三可以在实施例一和实施例二方案的基础上,进一步增加反向流的处理过程,以图4所示的业务节点网络示意图为例,假设正向流(假设正向流的标识为flow)在图4所示的网络中流经业务节点的顺序是:业务节点A-业务节点B1-业务节点C,为了使反向流(假设反向流的标识为flow-r)与正向流共路,则反向流在图4所示的网络中流经业务节点的顺序应当是:业务节点C-业务节点B1-业务节点A。The third embodiment of the present invention may further increase the reverse flow processing process based on the first embodiment and the second embodiment, and take the service node network diagram shown in FIG. 4 as an example, and assume a forward flow (assuming forward flow) The order of the flow is the flow through the service node in the network shown in Figure 4: service node A - service node B1 - service node C, in order to make the reverse flow (assuming the reverse flow is identified as flow-r) For the forward flow common path, the order of the reverse flow flowing through the service node in the network shown in FIG. 4 should be: service node C-service node B1-service node A.
假设中心控制模块为正向流中的报文生成的TCN的值为24,生成的业务 路由标识为1001,业务节点A所附着的SRF1的IP地址为10.10.1.1,业务节点B1所附着的SRF2的IP地址为10.10.1.2,业务节点B2所附着的SRF3的IP地址为10.10.1.3,业务节点C所附着的SRF4的IP地址为10.10.1.4,SRF1中存储的负载均衡表如表4所示:Suppose the central control module generates a TCN value of 24 for the packets in the forward flow, and generates the generated service. The IP address of the SRF1 to which the service node A is attached is 10.10.1.1, the IP address of the SRF2 to which the service node B1 is attached is 10.10.1.2, and the IP address of the SRF3 to which the service node B2 is attached is 10.10.1.3. The IP address of the SRF4 to which the service node C is attached is 10.10.1.4, and the load balancing table stored in the SRF1 is as shown in Table 4:
Figure PCTCN2014086834-appb-000005
Figure PCTCN2014086834-appb-000005
表4Table 4
SRF2中存储的负载均衡表如表5(a)和表5(b)所示:The load balancing table stored in SRF2 is shown in Table 5(a) and Table 5(b):
Figure PCTCN2014086834-appb-000006
Figure PCTCN2014086834-appb-000006
表5(a)Table 5 (a)
Figure PCTCN2014086834-appb-000007
Figure PCTCN2014086834-appb-000007
表5(b)Table 5(b)
SRF3中存储的负载均衡表如表6(a)和表6(b)所示:The load balancing tables stored in SRF3 are shown in Table 6(a) and Table 6(b):
Figure PCTCN2014086834-appb-000008
Figure PCTCN2014086834-appb-000008
表6(a)Table 6 (a)
Figure PCTCN2014086834-appb-000009
Figure PCTCN2014086834-appb-000009
表6(b)Table 6(b)
SRF4中存储的负载均衡表如表7所示: The load balancing table stored in SRF4 is shown in Table 7:
Figure PCTCN2014086834-appb-000010
Figure PCTCN2014086834-appb-000010
表7Table 7
基于图4所示的网络,对正向流和反向流中报文处理方法的步骤示意图如图5所示,主要包括以下步骤:Based on the network shown in FIG. 4, a schematic diagram of the steps of the packet processing method in the forward flow and the reverse flow is shown in FIG. 5, and mainly includes the following steps:
步骤301:SRF1将正向流的报文依次向业务节点B1所附着的SRF2传输。Step 301: SRF1 sequentially transmits the packet of the forward flow to the SRF2 attached to the service node B1.
流分类模块首先将正向流的报文依次向业务节点A所附着的SRF1传输,由SRF1将报文向业务节点A传输,当SRF1接收到业务节点A执行相应网络业务功能后返回的报文时,根据报文中包含的业务路由标识(此时业务路由标识为1001)查询表4,确定业务下一跳中有两个业务节点;然后将报文中包含的TCN(此时TCN的值为24)与业务下一跳业务节点数量值2取模,取模结果为0,通过查询表4,确定报文在业务下一跳中需流经业务节点B1,最后从表4中查询出业务节点B1所附着的SRF2的地址,将报文向SRF2传输。The traffic classification module firstly transmits the packet of the forward flow to the SRF1 to which the service node A is attached, and the SRF1 transmits the packet to the service node A. When the SRF1 receives the packet returned by the service node A to perform the corresponding network service function, the packet is returned. If the service route identifier (in this case, the service route identifier is 1001) is queried in Table 4, it is determined that there are two service nodes in the service next hop; then the TCN included in the packet (the value of the TCN at this time) 24) and the service next hop service node number value 2 modulo, the modulo result is 0, through the query table 4, it is determined that the message needs to flow through the service node B1 in the service next hop, and finally from the table 4 The address of the SRF2 to which the service node B1 is attached transmits the message to the SRF2.
步骤302:SRF2将报文向业务节点B1传输。Step 302: SRF2 transmits the message to the service node B1.
步骤303:业务节点B1向中心控制模块上报该报文所在的正向流的元组,以及该正向流对应的反向流的元组。Step 303: The service node B1 reports to the central control module a tuple of the forward flow in which the packet is located, and a tuple of the reverse flow corresponding to the forward flow.
由于元组可唯一表示报文流,因此,业务节点B1向中心控制模块上报正向流和反向流的元组后,中心控制模块可根据接收到的元组识别出需共路的正向流和反向流。本发明实施例中所涉及的元组可以是五元组,也可以是七元组。Since the tuple can uniquely represent the packet flow, after the service node B1 reports the tuple of the forward flow and the reverse flow to the central control module, the central control module can identify the forward direction of the common path according to the received tuple. Stream and reverse flow. The tuples involved in the embodiments of the present invention may be a five-tuple or a seven-tuple.
实际上,正向流在业务节点网络的传输过程中,可能会流经多个业务节点,其所流经的每个业务节点并不都需要向中心控制模块上报正向流和反向流的五元组,而是对正向流和反向流有共路需求的业务节点,才需要向中心控制模块上报正向流和反向流的五元组。例如:NAT业务节点需要获知正向 流中报文的源IP地址和目的IP地址,同时还需要获知对应的反向流中报文的源IP地址和目的IP地址,因此,该NAT业务节点有正向流和反向流共路的需求。In fact, in the transmission process of the service node network, the forward flow may flow through multiple service nodes, and each service node that flows through it does not need to report the forward flow and the reverse flow to the central control module. A quintuple, but a service node that has a common demand for the forward flow and the reverse flow, needs to report the quintuple of the forward flow and the reverse flow to the central control module. For example: NAT service node needs to know the positive direction The source IP address and destination IP address of the packets in the flow, and the source IP address and destination IP address of the corresponding reverse flow packets. Therefore, the NAT service node has a forward flow and a reverse flow common path. Demand.
步骤304:中心控制模块在本地记录接收到的正向流的元组和反向流的元组的关联关系,并确定为正向流中报文生成的TCN为24。Step 304: The central control module locally records the association relationship between the received tuple of the forward stream and the tuple of the reverse stream, and determines that the TCN generated for the packet in the forward stream is 24.
步骤305:正向流继续从业务节点B1向业务节点C传输,再向目的节点传输,完成正向流的传输过程。Step 305: The forward flow continues to be transmitted from the service node B1 to the service node C, and then transmitted to the destination node to complete the forward flow transmission process.
在本步骤305中,业务节点B1对报文执行相应的网络业务功能后,将报文返回给SRF2,再由SRF2查询表5(a)后,将报文传输给SRF4,SRF4将报文传输给业务节点C,业务节点C对报文执行相应的网络业务功能后,返回给SRF4,再由SRF4继续对报文执行网络传输,直至报文到达目的节点。In this step 305, after performing the corresponding network service function on the packet, the service node B1 returns the packet to the SRF2, and after the SRF2 queries the table 5(a), the packet is transmitted to the SRF4, and the SRF4 transmits the packet. After the service node C performs the corresponding network service function on the packet, the service node C returns to the SRF4, and then the SRF4 continues to perform network transmission on the packet until the packet reaches the destination node.
步骤306:中心控制模块为反向流生成TCN和业务路由标识,其中,为反向流生成的TCN与所述正向流的TCN相同。Step 306: The central control module generates a TCN and a service route identifier for the reverse flow, where the TCN generated for the reverse flow is the same as the TCN of the forward flow.
当正向流到达目的节点后,目的节点对正向流进行处理,生成反向流,所述反向流经过网络多跳后,到达图3所示的网络入口。图3中的流分类模块将反向流的首个报文发送给中心控制模块,中心控制模块识别出报文中的元组后,与本地已记录的正向流的元组和反向流的元组的关联关系进行比较,若确定接收到的报文中的元组与所述关联关系中反向流的元组相同,则确定接收到的所述报文所在的报文流为反向流,且该反向流需要与正向流共路,因此,中心控制模块为反向流生成业务路由标识(此时业务路由标识为1002),并为反向流生成与正向流相同的TCN(此时TCN为24)。After the forward flow reaches the destination node, the destination node processes the forward flow to generate a reverse flow, and after the multi-hop through the network, the reverse flow reaches the network entry shown in FIG. 3. The flow classification module in FIG. 3 sends the first packet of the reverse flow to the central control module, and the central control module identifies the tuple in the packet, and the tuple and reverse flow of the locally recorded forward flow. If the tuple in the received packet is the same as the tuple in the reverse relationship in the association relationship, it is determined that the received packet flow is reversed. The flow is forwarded, and the reverse flow needs to be shared with the forward flow. Therefore, the central control module generates a service route identifier for the reverse flow (the service route identifier is 1002 at this time), and generates the same reverse flow for the reverse flow. TCN (at this time TCN is 24).
在本实施例三的方案中,正向流进入图3所示的网络时,入口的流分类模块与反向流的进入网络时入口的流分类模块可以是同一网络设备,也可以是分别独立的两个网络设备,本发明实施例并不对流分类模块的形式做限定。In the solution of the third embodiment, when the forward flow enters the network shown in FIG. 3, the flow classification module of the ingress and the flow classification module of the ingress when the reverse flow enters the network may be the same network device, or may be independent. The two network devices of the present invention do not limit the form of the flow classification module.
步骤307:流分类模块将所述TCN和业务路由标识添加在反向流的报文中,并将反向流的报文向业务节点C所附着的SRF4传输。Step 307: The traffic classification module adds the TCN and the service route identifier to the reverse flow packet, and transmits the reverse flow packet to the SRF4 to which the service node C is attached.
步骤308:SRF4将报文向业务节点C传输,在接收到业务节点C返回的 报文时,将报文向业务节点B1所附着的SRF2传输。Step 308: SRF4 transmits the message to the service node C, and receives the return from the service node C. When the message is received, the message is transmitted to the SRF2 to which the service node B1 is attached.
在本步骤308中,SRF4查询表7,确定业务下一跳中有两个业务节点,将TCN与2取模后的取模结果为0,选择业务下一跳中的业务节点B1,并将报文向业务节点B1所附着的SRF2传输。In this step 308, SRF4 queries Table 7, and determines that there are two service nodes in the next hop of the service, and the modulo result of the TCN and 2 modulo is 0, and the service node B1 in the next hop of the service is selected, and The message is transmitted to the SRF2 to which the service node B1 is attached.
通过比较步骤301和步骤308,当正向流和反向流在流经业务节点B1和业务节点B2中的一个业务节点时,由于正向流的报文中的TCN与反向流的报文中的TCN相同,因此,按照相同的取模运算后,SRF1为正向流中的报文选择业务节点B1,SRF4为反向流中的报文也选择业务节点B1,确保了正向流和反向流的同路。By comparing step 301 and step 308, when the forward stream and the reverse stream are flowing through one of the service node B1 and the service node B2, the TCN and the reverse stream message in the packet of the forward flow The TCN in the same is the same. Therefore, after the same modulo operation, SRF1 selects the service node B1 for the message in the forward stream, and SRF4 selects the service node B1 for the message in the reverse stream to ensure the forward flow and The same way of reverse flow.
步骤309:反向流继续从业务节点B1向业务节点A传输,再向源节点传输,完成反向流的传输过程。Step 309: The reverse flow continues to be transmitted from the service node B1 to the service node A, and then transmitted to the source node to complete the reverse flow transmission process.
本步骤309中的源节点是正向流的源节点,是反向流的目的节点。The source node in this step 309 is the source node of the forward stream and is the destination node of the reverse stream.
通过本发明实施例三的方案,当正向流和反向流中报文的TCN相同时,就可实现正向流和反向流的同路,不仅在正向流的传输过程中实现了业务节点间负载均衡,还实现了在反向流的传输过程中的负载均衡;同时,正向流和反向流的同路可以很好地满足诸如NAT业务节点的业务需求。According to the solution of the third embodiment of the present invention, when the TCNs of the packets in the forward flow and the reverse flow are the same, the same path of the forward flow and the reverse flow can be realized, which is not only implemented in the forward flow transmission process. Load balancing between service nodes also implements load balancing during reverse flow transmission. At the same time, the same path of forward flow and reverse flow can well meet the service requirements of NAT service nodes.
需要说明的是,本发明实施例的方案是在新增的业务路由报文头中直接添加固定数值的TCN和业务路由标识,当然,如果不直接在报文中添加TCN,而是在每一次需要从业务下一跳中选择业务节点时,利用对网络报文头的一些字段进行hash运算得到的数值也可以按照本发明实施例的方案进行负载均衡运算,但本发明实施例的方案有如下优点:It should be noted that, in the embodiment of the present invention, a fixed value TCN and a service route identifier are directly added to the newly added service routing packet header. Of course, if the TCN is not directly added to the packet, it is When the service node needs to be selected from the next hop of the service, the value obtained by performing the hash operation on some fields of the network packet header may also perform the load balancing operation according to the solution of the embodiment of the present invention. However, the solution of the embodiment of the present invention has the following advantage:
1)、由于报文被业务节点执行相应的网络业务功能后,网络报文头中某些字段中的内容会发生改变,如被NAT业务节点执行相应的网络业务功能后,网络报文头中目的IP地址会改变,如果恰好利用发生改变的字段中的内容进行hash运算得到的数值进行负载均衡运算的话,最终的负载均衡运算结果可能会干扰报文流在业务节点间的均分,达不到业务节点间负载均衡的目的。而通过本发明实施例的方案,业务路由报文头中的内容不会被修改,确保TCN 的值不会发生变化,以使报文流在业务节点间实现均分。1) After the message is executed by the service node, the content of some fields in the network packet header changes, for example, after the NAT service node performs the corresponding network service function, the network packet header is The destination IP address will change. If the value obtained by hashing the content in the changed field is used for load balancing operation, the final load balancing operation result may interfere with the equalization of the packet flow between the service nodes. The purpose of load balancing between business nodes. With the solution of the embodiment of the present invention, the content in the service routing packet header is not modified, and the TCN is ensured. The value does not change so that the message flow is evenly divided among the business nodes.
2)、若报文流中的报文采用新的报文格式,可能会出现目前已部署的业务节点所附着的SRF无法识别新报文格式的报文的情况,因此,难以实现负载均衡运算;而本发明实施例的方案中,在新增的业务路由报文头中添加TCN和业务路由标识,业务路由报文头的格式不会变化,业务节点能够识别出业务路由报文头中的TCN和业务路由标识。2) If the packet in the packet flow adopts a new packet format, the SRF that is attached to the currently deployed service node cannot identify the packet in the new packet format. Therefore, it is difficult to implement load balancing operation. In the solution of the embodiment of the present invention, the TCN and the service route identifier are added to the newly added service routing packet header, and the format of the service routing packet header does not change, and the service node can identify the service routing packet header. TCN and service route identifier.
实施例四:Embodiment 4:
本发明实施例四描述了一种报文处理设备,如图6(a)所示,所述报文处理设备包括运算单元11、选择单元12和传输单元13,其中:A fourth embodiment of the present invention describes a message processing device. As shown in FIG. 6(a), the message processing device includes an operation unit 11, a selection unit 12, and a transmission unit 13, wherein:
运算单元11用于根据报文中包含的业务路由标识,在确定报文的业务下一跳有多个业务节点时,根据所述报文中包含的TCN和业务下一跳中业务节点的数量值进行负载均衡运算,其中,同一报文流中的所有报文的TCN相同;The operation unit 11 is configured to: according to the service route identifier included in the packet, when there are multiple service nodes in the service next hop of the packet, according to the TCN included in the packet and the number of service nodes in the next hop of the service The value is load-balanced, where the TCNs of all the packets in the same packet flow are the same;
选择单元12用于用于根据所述运算单元11的运算结果从所述业务下一跳的业务节点中选择一个业务节点;The selecting unit 12 is configured to select one service node from the service nodes of the service next hop according to the operation result of the operation unit 11;
传输单元13用于将所述报文向所述选择单元12选择的所述业务节点传输。The transmission unit 13 is configured to transmit the message to the service node selected by the selection unit 12.
可选地,所述运算单元11体用于将所述报文中包含的TCN和业务下一跳中业务节点的数量值取模;Optionally, the operation unit 11 is configured to: modulate a value of a TCN in the packet and a value of a service node in a service next hop;
所述选择单元12具体用于根据业务节点的标识与运算值的对应关系,将取模结果作为运算值,确定对应的业务节点的标识,并将确定的业务节点的标识对于的业务节点作为选择的业务节点;The selecting unit 12 is specifically configured to determine, according to the correspondence between the identifier of the service node and the calculated value, the modulo result as an operation value, determine the identifier of the corresponding service node, and select the determined service node as the service node. Business node
所述传输单元13具体用于根据业务节点与该业务节点所附着的负载均衡模块的对应关系,向选择的业务节点所附着的负载均衡模块传输报文,再由该负载均衡模块将报文向附着在该负载均衡模块上的所述选择的业务节点传输报文。The transmission unit 13 is specifically configured to: according to the correspondence between the service node and the load balancing module to which the service node is attached, transmit a packet to the load balancing module attached to the selected service node, and then the load balancing module sends the packet to the load balancing module. The selected service node attached to the load balancing module transmits a message.
本实施例四中所涉及的报文处理设备可以是实施例一至实施例三中所涉及的负载均衡模块,业务节点的标识与运算值的对应关系和业务节点与该业 务节点所附着的负载均衡模块的对应关系,可以记录在实施例一中负载均衡表中,选择单元12和传输单元13通过查询所述负载均衡表分别确定上述两个对应关系。The packet processing device involved in the fourth embodiment may be the load balancing module involved in the first embodiment to the third embodiment, the correspondence between the identifier of the service node and the calculated value, and the service node and the service. The correspondence between the load balancing modules attached to the service nodes may be recorded in the load balancing table in the first embodiment, and the selecting unit 12 and the transmitting unit 13 respectively determine the two correspondences by querying the load balancing table.
本发明实施例四还描述了另一种报文处理设备,如图6(b)所示,所述报文处理设备包括接口21、存储器22和处理器23,其中,接口21、存储器22和处理器23之间通过总线连接。Another embodiment of the present invention further describes another message processing device. As shown in FIG. 6(b), the message processing device includes an interface 21, a memory 22, and a processor 23, wherein the interface 21, the memory 22, and The processors 23 are connected by a bus.
所述接口21,用于接收报文,并将接收到的报文传输给处理器23,以及将报文传输给处理器23选择的业务节点;The interface 21 is configured to receive a message, and transmit the received message to the processor 23, and transmit the message to the service node selected by the processor 23;
所述存储器22,用于存储程序代码,以及存储业务路由标识所反映的业务路径和该业务路径上每一跳中各业务节点的信息,并将存储的程序代码传输给处理器23;The memory 22 is configured to store the program code, and store the service path reflected by the service route identifier and the information of each service node in each hop on the service path, and transmit the stored program code to the processor 23;
处理器23,用于获得存储器22中存储的程序代码,并按照获得的程序代码执行:根据报文中包含的业务路由标识,在确定报文的业务下一跳有多个业务节点时,根据所述报文中包含的TCN和业务下一跳中业务节点的数量值进行负载均衡运算,并根据运算结果从所述业务下一跳的业务节点中选择一个业务节点,并将选择的所述业务节点的标识发送给接口21,其中,同一报文流中的所有报文的TCN相同。The processor 23 is configured to obtain the program code stored in the memory 22, and execute according to the obtained program code: according to the service routing identifier included in the packet, when determining that the service next hop has multiple service nodes, according to Performing a load balancing operation on the number of service nodes included in the TCN and the service next hop in the packet, and selecting a service node from the service node of the service next hop according to the operation result, and selecting the selected The identifier of the service node is sent to the interface 21, where the TCNs of all the packets in the same packet flow are the same.
所述存储器22,还用于存储业务节点的标识与运算值的对应关系,并传输给处理器23;The memory 22 is further configured to store a correspondence between the identifier of the service node and the operation value, and transmit the corresponding relationship to the processor 23;
所述处理器23,具体用于执行如下的负载均衡运算以及选择业务节点:将所述报文中包含的TCN和业务下一跳中业务节点的数量值取模,并根据业务节点的标识与运算值的对应关系,将取模结果作为运算值,确定对应的业务节点的标识,并将确定的业务节点的标识对应的业务节点作为选择的业务节点。The processor 23 is specifically configured to perform a load balancing operation and select a service node: modulo the value of the TCN and the service node in the service next hop included in the packet, and according to the identifier of the service node Corresponding relationship between the calculated values, the modulo result is used as the operation value, the identifier of the corresponding service node is determined, and the service node corresponding to the determined identity of the service node is taken as the selected service node.
所述存储器22,还用于存储业务节点与该业务节点所附着的负载均衡模块的对应关系,并传输给处理器23,具体地,所述存储器22可以存储在实施例一中负载均衡表,并传输给处理器23。 The memory 22 is further configured to store a correspondence between the service node and the load balancing module to which the service node is attached, and transmit the result to the processor 23. Specifically, the memory 22 may be stored in the load balancing table in the first embodiment. And transmitted to the processor 23.
所述处理器23,具体用于确定选择的业务节点所附着的负载均衡模块,并将该负载均衡模块的地址传输给接口21;The processor 23 is specifically configured to determine a load balancing module to which the selected service node is attached, and transmit the address of the load balancing module to the interface 21;
所述接口21,具体用于根据负载均衡模块的地址将报文传输给负载均衡模块。The interface 21 is specifically configured to transmit the packet to the load balancing module according to the address of the load balancing module.
所述接口21可以为以下一种或多种:提供有线接口的网络接口控制器(英文:network interface controller,缩写:NIC),例如以太网NIC,该以太网NIC可以提供铜线接口,光纤接口或既提供铜线接口也提供光纤接口;提供无线接口的NIC,例如无线局域网(英文:wireless local area network,缩写:WLAN)NIC。The interface 21 may be one or more of the following: a network interface controller (English: network interface controller, NIC), such as an Ethernet NIC, which can provide a copper interface and a fiber interface. Or provide both a copper interface and a fiber interface; a NIC that provides a wireless interface, such as a wireless local area network (WLAN) NIC.
所述存储器22可以是易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);或者非易失性存储器(英文:non-volatile memory),例如快闪存储器(英文:flash memory),硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);或者上述种类的存储器的组合。The memory 22 may be a volatile memory, such as a random access memory (English: random-access memory, abbreviation: RAM), or a non-volatile memory (English: non-volatile memory). For example, flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviated: HDD) or solid state drive (English: solid-state drive, abbreviation: SSD); or a combination of the above types of memory.
所述处理器23可以是中央处理器(英文:central processing unit,缩写:CPU),或者是CPU和硬件芯片的组合。The processor 23 may be a central processing unit (English: central processing unit, abbreviated: CPU), or a combination of a CPU and a hardware chip.
上述硬件芯片可以是以下一种或多种的组合:专用集成电路(英文:application-specific integrated circuit,缩写:ASIC),现场可编程逻辑门阵列(英文:field-programmable gate array,缩写:FPGA),复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),网络处理器(英文:network processor,缩写:NP)。The above hardware chip may be a combination of one or more of the following: an application-specific integrated circuit (ASIC: ASIC), a field-programmable gate array (English: field-programmable gate array, abbreviation: FPGA) , Complex programmable logic device (English: complex programmable logic device, abbreviation: CPLD), network processor (English: network processor, abbreviation: NP).
实施例五:Embodiment 5:
本发明实施例五还描述了一种中心控制设备,如图7(a)所示,所述中心控制设备包括生成单元31和发送单元32,其中:A fifth embodiment of the present invention also describes a central control device. As shown in FIG. 7(a), the central control device includes a generating unit 31 and a transmitting unit 32, where:
生成单元31用于为报文生成TCN和业务路由标识;The generating unit 31 is configured to generate a TCN and a service routing identifier for the packet.
发送单元32用于将所述TCN和业务路由标识发送给流分类设备,并指示流分类设备将所述TCN和业务路由标识添加在所述报文中。 The sending unit 32 is configured to send the TCN and the service routing identifier to the traffic classification device, and instruct the traffic classification device to add the TCN and the service route identifier in the packet.
所述生成单元31具体用于从资源池中随机选取的一个数值作为生成的TCN,或是根据报文的元组得到的数值作为生成的TCN,或是针对报文需流经的业务路径中一跳,根据该跳中多个业务节点间的负载状态确定的一个数值作为生成的TCN。The generating unit 31 is specifically configured to use a value randomly selected from the resource pool as the generated TCN, or the value obtained according to the tuple of the packet as the generated TCN, or in the service path through which the packet needs to flow. One hop, a value determined based on the load state between the plurality of service nodes in the hop as the generated TCN.
所述中心控制设备还包括接收单元33,用于接收业务节点上报的报文的元组,以及与该报文所在报文流对应的反向流的元组;The central control device further includes a receiving unit 33, configured to receive a tuple of the packet reported by the service node, and a tuple of the reverse flow corresponding to the packet flow of the packet;
所述生成单元31,具体用于为所述反向流中的报文生成TCN时,生成与所述报文流中的报文相同的TCN,使得所述反向流中的报文流经的业务节点与所述报文流中的报文流经的业务节点相同但顺序相反。The generating unit 31 is configured to: when generating a TCN for the packet in the reverse flow, generate a TCN that is the same as the packet in the packet flow, so that the packet in the reverse flow flows through The service node is the same as the service node through which the packet in the packet flow flows, but in the reverse order.
本实施例五中所涉及的中心控制设备可以是实施例二和实施例三中所涉及的中心控制模块,所述流分类设备可以是实施例二和实施例三中所涉及的流分类模块。The central control device involved in the fifth embodiment may be the central control module involved in the second embodiment and the third embodiment. The flow classification device may be the flow classification module involved in the second embodiment and the third embodiment.
本发明实施例五还描述了另一种中心控制设备,如图7(b)所示,所述中心控制设备包括接口41、存储器42和处理器43,其中,接口41、存储器42和处理器43之间通过总线连接。Another fifth central control device is also described in the fifth embodiment of the present invention. As shown in FIG. 7(b), the central control device includes an interface 41, a memory 42 and a processor 43, wherein the interface 41, the memory 42 and the processor 43 is connected by bus.
所述存储器42,用于存储程序代码,并将存储的程序代码传输给处理器43;The memory 42, for storing program code, and transmitting the stored program code to the processor 43;
所述处理器43,用于为报文生成TCN和业务路由标识,并将该TCN和业务路由标识传输给接口41;The processor 43 is configured to generate a TCN and a service route identifier for the packet, and transmit the TCN and the service route identifier to the interface 41;
所述接口41,用于将所述TCN和业务路由标识发送给流分类设备,指示流分类设备将所述TCN和业务路由标识添加在所述报文中。The interface 41 is configured to send the TCN and the service route identifier to the traffic classification device, and instruct the traffic classification device to add the TCN and the service route identifier to the packet.
所述存储器42,还用于存储资源池中的数值,并传输给处理器43;The memory 42, is also used to store the value in the resource pool and transmitted to the processor 43;
所述处理器43,具体用于从资源池中随机选取的一个数值作为生成的TCN,或是根据报文的元组得到的数值作为生成的TCN,或是针对报文需流经的业务路径中一跳,根据该跳中多个业务节点间的负载状态确定的一个数值作为生成的TCN。The processor 43 is specifically configured to use a value randomly selected from the resource pool as the generated TCN, or the value obtained according to the tuple of the packet as the generated TCN, or the service path that the packet needs to flow through. In the first hop, a value determined based on the load status between the plurality of service nodes in the hop is used as the generated TCN.
所述接口41,还用于接收业务节点上报的报文的元组,以及与该报文所 在报文流对应的反向流的元组,并传输给处理器43;The interface 41 is further configured to receive a tuple of the packet reported by the service node, and the packet a tuple of the reverse stream corresponding to the packet stream, and transmitted to the processor 43;
所述处理器43,具体用于为所述反向流中的报文生成TCN时,生成与所述报文流中的报文相同的TCN,使得所述反向流中的报文流经的业务节点与所述报文流中的报文流经的业务节点相同但顺序相反。The processor 43 is configured to: when generating a TCN for the packet in the reverse flow, generate a TCN that is the same as the packet in the packet flow, so that the packet in the reverse flow flows through The service node is the same as the service node through which the packet in the packet flow flows, but in the reverse order.
所述接口41可以为以下一种或多种:提供有线接口的网络接口控制器(英文:network interface controller,缩写:NIC),例如以太网NIC,该以太网NIC可以提供铜线接口,光纤接口或既提供铜线接口也提供光纤接口;提供无线接口的NIC,例如无线局域网(英文:wireless local area network,缩写:WLAN)NIC。The interface 41 may be one or more of the following: a network interface controller (English: network interface controller, NIC), such as an Ethernet NIC, which can provide a copper interface, a fiber interface. Or provide both a copper interface and a fiber interface; a NIC that provides a wireless interface, such as a wireless local area network (WLAN) NIC.
所述存储器42可以是易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);或者非易失性存储器(英文:non-volatile memory),例如快闪存储器(英文:flash memory),硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);或者上述种类的存储器的组合。The memory 42 may be a volatile memory, such as a random access memory (RAM), or a non-volatile memory. For example, flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviated: HDD) or solid state drive (English: solid-state drive, abbreviation: SSD); or a combination of the above types of memory.
所述处理器43可以是中央处理器(英文:central processing unit,缩写:CPU),或者是CPU和硬件芯片的组合。The processor 43 may be a central processing unit (English: central processing unit, abbreviated: CPU), or a combination of a CPU and a hardware chip.
上述硬件芯片可以是以下一种或多种的组合:专用集成电路(英文:application-specific integrated circuit,缩写:ASIC),现场可编程逻辑门阵列(英文:field-programmable gate array,缩写:FPGA),复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),网络处理器(英文:network processor,缩写:NP)。The above hardware chip may be a combination of one or more of the following: an application-specific integrated circuit (ASIC: ASIC), a field-programmable gate array (English: field-programmable gate array, abbreviation: FPGA) , Complex programmable logic device (English: complex programmable logic device, abbreviation: CPLD), network processor (English: network processor, abbreviation: NP).
本领域内的技术人员应明白,本申请的实施例可为方法、系统、或计算机程序产品。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present application can be a method, system, or computer program product. Moreover, the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图 和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the present application. It should be understood that the flow chart can be implemented by computer program instructions And/or a combination of the processes and/or blocks in the block diagrams, and the flowcharts and/or blocks in the flowcharts. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
在一个典型的配置中,所述计算机设备包括一个或多个中央处理器(CPU)、输入/输出接口、网络接口和存储器。所述存储器可能包括计算机可读介质中的随机存取存储器(RAM)或只读存储器(ROM)。按照本文中的界定,计算机可读介质不包括非持续性的电脑可读媒体(Transitory Media),如调制的数据信号和载波。In a typical configuration, the computer device includes one or more central processing units (CPUs), input/output interfaces, network interfaces, and memory. The memory may include random access memory (RAM) or read only memory (ROM) in a computer readable medium. As defined herein, computer readable media does not include non-persistent computer readable media (Transitory Media) such as modulated data signals and carrier waves.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While the preferred embodiment of the present application has been described, those skilled in the art can make further changes and modifications to these embodiments once they are aware of the basic inventive concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。 It will be apparent to those skilled in the art that various modifications and changes can be made in the present application without departing from the scope of the application. Thus, it is intended that the present invention cover the modifications and variations of the present invention.

Claims (10)

  1. 一种报文处理方法,其特征在于,所述方法包括:A packet processing method, characterized in that the method comprises:
    根据报文中包含的业务路由标识,在确定报文的业务下一跳有多个业务节点时,根据所述报文中包含的流量分类号TCN和业务下一跳中业务节点的数量值进行负载均衡运算;According to the service route identifier included in the packet, when there are multiple service nodes in the next hop of the service, the traffic classification number TCN and the number of service nodes in the next hop of the service are performed according to the value of the service node. Load balancing operation;
    根据运算结果从所述业务下一跳的业务节点中选择一个业务节点,并将所述报文向选择的所述业务节点传输;Selecting a service node from the service nodes of the service next hop according to the operation result, and transmitting the message to the selected service node;
    其中,同一报文流中的所有报文的TCN相同。The TCNs of all the packets in the same packet flow are the same.
  2. 如权利要求1所述的报文处理方法,其特征在于,根据所述报文中包含的TCN和业务下一跳中业务节点的数量值进行负载均衡运算,并根据运算结果从所述业务下一跳的业务节点中选择一个业务节点,具体包括:The packet processing method according to claim 1, wherein the load balancing operation is performed according to the TCN included in the packet and the number of service nodes in the next hop of the service, and the operation result is from the service. Select one service node from the one-hop service node, including:
    将所述报文中包含的TCN和业务下一跳中业务节点的数量值取模;And modulating the value of the number of service nodes in the TCN and the service next hop included in the packet;
    查询业务节点的标识与运算值的对应关系,将取模结果作为运算值,确定对应的业务节点的标识,并将确定的业务节点的标识对于的业务节点作为选择的业务节点。The corresponding relationship between the identifier of the service node and the operation value is queried, and the modulo result is used as the operation value to determine the identifier of the corresponding service node, and the determined service node identifier is used as the selected service node.
  3. 如权利要求1或2所述的报文处理方法,其特征在于,所述报文中包含的TCN是由中心控制模块生成并发送给流分类模块后,再由所述流分类模块添加在所述报文中的。The packet processing method according to claim 1 or 2, wherein the TCN included in the message is generated by the central control module and sent to the stream classification module, and then added by the stream classification module. In the message.
  4. 如权利要求3所述的报文处理方法,其特征在于,所述TCN是中心控制模块从资源池中随机选取的一个数值,或是中心控制模块根据报文的元组得到的数值,或是中心控制模块针对报文需流经的业务路径中一跳,根据该跳中多个业务节点间的负载状态确定的一个数值。The packet processing method according to claim 3, wherein the TCN is a value randomly selected by the central control module from the resource pool, or a value obtained by the central control module according to the tuple of the message, or The central control module is configured to determine a value according to a load state between multiple service nodes in the hop according to a hop in the service path through which the packet needs to flow.
  5. 如权利要求1~4任一所述的报文处理方法,其特征在于,所述方法还包括:The packet processing method according to any one of claims 1 to 4, wherein the method further comprises:
    接收到所述报文的业务节点向中心控制模块上报所述报文的元组,以及与该报文所在报文流对应的反向流的元组; The service node that receives the packet reports the tuple of the packet to the central control module, and the tuple of the reverse flow corresponding to the packet flow of the packet;
    当所述中心控制模块为所述反向流中的报文生成TCN时,生成与所述报文流中的报文相同的TCN,使得所述反向流中的报文流经的业务节点与所述报文流中的报文流经的业务节点相同但顺序相反。When the central control module generates a TCN for the packet in the reverse flow, the same TCN is generated as the packet in the packet flow, so that the service node in the reverse flow flows through the service node. The same as the service node through which the packet in the packet flow flows, but in the reverse order.
  6. 一种报文处理设备,其特征在于,所述报文处理设备包括:A message processing device, wherein the message processing device includes:
    运算单元,用于根据报文中包含的业务路由标识,在确定报文的业务下一跳有多个业务节点时,根据所述报文中包含的流量分类号TCN和业务下一跳中业务节点的数量值进行负载均衡运算,其中,同一报文流中的所有报文的TCN相同;The operation unit is configured to: according to the service routing identifier included in the packet, when the service hop of the packet is determined to have multiple service nodes, according to the traffic classification number TCN and the service in the next hop of the service The load balancing operation is performed on the number of nodes, where the TCNs of all the packets in the same packet flow are the same;
    选择单元,用于根据所述运算单元的运算结果从所述业务下一跳的业务节点中选择一个业务节点;a selecting unit, configured to select a service node from the service nodes of the service next hop according to the operation result of the operation unit;
    传输单元,用于将所述报文向所述选择单元选择的所述业务节点传输。And a transmitting unit, configured to transmit the message to the service node selected by the selecting unit.
  7. 如权利要求6所述的报文处理设备,其特征在于,A message processing device according to claim 6, wherein:
    所述运算单元,具体用于将所述报文中包含的TCN和业务下一跳中业务节点的数量值取模;The operation unit is specifically configured to: modulate a value of a TCN and a service node in a service next hop included in the packet;
    所述选择单元,具体用于根据业务节点的标识与运算值的对应关系,将取模结果作为运算值,确定对应的业务节点的标识,并将确定的业务节点的标识对应的业务节点作为选择的业务节点。The selecting unit is specifically configured to determine, according to the correspondence between the identifier of the service node and the calculated value, the modulo result as an operation value, determine the identifier of the corresponding service node, and select the service node corresponding to the determined identifier of the service node as the selection. Business node.
  8. 一种中心控制设备,其特征在于,所述中心控制设备包括:A central control device, wherein the central control device comprises:
    生成单元,用于为报文生成流量分类号TCN和业务路由标识;a generating unit, configured to generate a traffic classification number TCN and a service routing identifier for the packet;
    发送单元,用于将所述TCN和业务路由标识发送给流分类设备,指示流分类设备将所述TCN和业务路由标识添加在所述报文中。And a sending unit, configured to send the TCN and the service routing identifier to the traffic classification device, and instruct the traffic classification device to add the TCN and the service routing identifier to the packet.
  9. 如权利要求8所述的中心控制设备,其特征在于,A center control device according to claim 8 wherein:
    所述生成单元,具体用于从资源池中随机选取的一个数值作为生成的TCN,或是根据报文的元组得到的数值作为生成的TCN,或是针对报文需流经的业务路径中一跳,根据该跳中多个业务节点间的负载状态确定的一个数值作为生成的TCN。The generating unit is specifically configured to use a value randomly selected from the resource pool as the generated TCN, or the value obtained according to the tuple of the packet as the generated TCN, or in the service path through which the packet needs to flow. One hop, a value determined based on the load state between the plurality of service nodes in the hop as the generated TCN.
  10. 如权利要求8或9所述的中心控制设备,其特征在于,所述中心控 制设备还包括:A central control device according to claim 8 or 9, wherein said central control Equipment also includes:
    接收单元,用于接收业务节点上报的报文的元组,以及与该报文所在报文流对应的反向流的元组;a receiving unit, configured to receive a tuple of the packet reported by the service node, and a tuple of the reverse flow corresponding to the packet flow of the packet;
    所述生成单元,具体用于为所述反向流中的报文生成TCN时,生成与所述报文流中的报文相同的TCN,使得所述反向流中的报文流经的业务节点与所述报文流中的报文流经的业务节点相同但顺序相反。 The generating unit is configured to: when generating a TCN for the packet in the reverse flow, generate a TCN that is the same as the packet in the packet flow, so that the packet in the reverse flow flows. The service node is the same as the service node through which the packet in the packet flow flows, but in the reverse order.
PCT/CN2014/086834 2013-09-18 2014-09-18 Method and device for packet processing WO2015039616A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310430814.4 2013-09-18
CN201310430814.4A CN104469846B (en) 2013-09-18 2013-09-18 A kind of message processing method and equipment

Publications (1)

Publication Number Publication Date
WO2015039616A1 true WO2015039616A1 (en) 2015-03-26

Family

ID=52688252

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/086834 WO2015039616A1 (en) 2013-09-18 2014-09-18 Method and device for packet processing

Country Status (2)

Country Link
CN (1) CN104469846B (en)
WO (1) WO2015039616A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106330785B (en) * 2015-06-17 2020-08-11 深圳市腾讯计算机系统有限公司 Method and device for selecting service node
CN111050353B (en) 2018-10-11 2021-12-03 华为技术有限公司 Data transmission method and device for wireless backhaul network
CN114338747B (en) * 2021-12-31 2023-07-25 四川启睿克科技有限公司 Cloud scene control system and method supporting device to report data messages in self-defined mode

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546412A (en) * 2012-01-04 2012-07-04 深圳市共进电子股份有限公司 Flow control method and flow controller
CN102624619A (en) * 2012-03-09 2012-08-01 上海大亚科技有限公司 Method for performing message forwarding route selection based on source address under multi-default gateway condition
CN103067294A (en) * 2012-12-30 2013-04-24 大连环宇移动科技有限公司 Method for order-maintaining data flow equilibrium processing in multi-next-hop transmitting router based on flow
CN103281252A (en) * 2013-05-14 2013-09-04 华为技术有限公司 Message flow control method and device based on multi-path transmission

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546412A (en) * 2012-01-04 2012-07-04 深圳市共进电子股份有限公司 Flow control method and flow controller
CN102624619A (en) * 2012-03-09 2012-08-01 上海大亚科技有限公司 Method for performing message forwarding route selection based on source address under multi-default gateway condition
CN103067294A (en) * 2012-12-30 2013-04-24 大连环宇移动科技有限公司 Method for order-maintaining data flow equilibrium processing in multi-next-hop transmitting router based on flow
CN103281252A (en) * 2013-05-14 2013-09-04 华为技术有限公司 Message flow control method and device based on multi-path transmission

Also Published As

Publication number Publication date
CN104469846B (en) 2018-10-30
CN104469846A (en) 2015-03-25

Similar Documents

Publication Publication Date Title
US10735323B2 (en) Service traffic allocation method and apparatus
US9608938B2 (en) Method and system for tracking and managing network flows
US9450874B2 (en) Method for internet traffic management using a central traffic controller
US20210176168A1 (en) Advanced Preferred Path Route Graph Features in a Network
US9379975B2 (en) Communication control system, control server, forwarding node, communication control method, and communication control program
KR101317969B1 (en) Inter-node link aggregation system and method
US10148560B2 (en) Enhanced error signaling and error handling in a network environment with segment routing
WO2022166691A1 (en) Service processing method and device, storage medium, and electronic device
US9509631B2 (en) Quality of service (QoS) for information centric networks
WO2015039617A1 (en) Method, system, and device for packet processing
WO2015043327A1 (en) Routing method, device and system
US9712649B2 (en) CCN fragmentation gateway
TW201225579A (en) Load balancing in shortest-path-bridging networks
WO2017008712A1 (en) Reachability detection for path between vxlan tunnel end points (vtep)
WO2013026384A1 (en) Service data transmission method, network node and system
WO2016107379A1 (en) Packet sending method and apparatus
WO2018036254A1 (en) Packet forwarding method and device
US9467367B2 (en) Universal labels in internetworking
WO2016029345A1 (en) Network flow information statistics method and apparatus
WO2011095017A1 (en) Method and routing device for implementing load sharing
EP3718269A1 (en) Packet value based packet processing
WO2015039616A1 (en) Method and device for packet processing
US20230188457A1 (en) Bier overlay signaling enhancement
US20200304399A1 (en) Method and system for interfacing communication networks
WO2016103187A1 (en) Method and system for packet redundancy removal

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14846553

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14846553

Country of ref document: EP

Kind code of ref document: A1