[go: up one dir, main page]

CN114900560A - Control method, system, equipment and medium - Google Patents

Control method, system, equipment and medium Download PDF

Info

Publication number
CN114900560A
CN114900560A CN202210349412.0A CN202210349412A CN114900560A CN 114900560 A CN114900560 A CN 114900560A CN 202210349412 A CN202210349412 A CN 202210349412A CN 114900560 A CN114900560 A CN 114900560A
Authority
CN
China
Prior art keywords
gateway
indication information
address
processed
network segment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210349412.0A
Other languages
Chinese (zh)
Other versions
CN114900560B (en
Inventor
胡林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Cloud Computing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Cloud Computing Ltd filed Critical Alibaba Cloud Computing Ltd
Priority to CN202210349412.0A priority Critical patent/CN114900560B/en
Publication of CN114900560A publication Critical patent/CN114900560A/en
Application granted granted Critical
Publication of CN114900560B publication Critical patent/CN114900560B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities

Landscapes

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

Abstract

本公开实施例公开了一种控制方法、系统、设备及介质,所述方法包括:获取待处理报文,并向第一网关发送待处理报文,第一网关用于获取待处理报文的源对象标识,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及待处理报文;接收第二网关指示信息以及待处理报文,并根据第二网关指示信息向第二网关转发待处理报文,第二网关用于转发待处理报文。上述方案可以确保相应网关转发报文的带宽能够满足该网关对应的源对象的带宽需求,确保源对象的报文可以被及时转发,改善了用户体验。

Figure 202210349412

Embodiments of the present disclosure disclose a control method, system, device, and medium. The method includes: acquiring a to-be-processed packet, and sending the to-be-processed packet to a first gateway, where the first gateway is configured to acquire the information of the to-be-processed packet source object identifier, obtain the second gateway indication information for indicating the second gateway according to the source object identifier and the correspondence between the source object and the gateway, and send the second gateway indication information and the message to be processed to the switch; receive the second gateway indication information The gateway indication information and the to-be-processed message are forwarded to the second gateway according to the second gateway indication information, and the second gateway is used to forward the to-be-processed message. The above solution can ensure that the bandwidth of the corresponding gateway to forward packets can meet the bandwidth requirements of the source object corresponding to the gateway, ensure that the packets of the source object can be forwarded in time, and improve user experience.

Figure 202210349412

Description

控制方法、系统、设备及介质Control method, system, equipment and medium

技术领域technical field

本公开涉及互联网技术领域,具体涉及一种控制方法、系统、设备及介质。The present disclosure relates to the field of Internet technologies, and in particular, to a control method, system, device and medium.

背景技术Background technique

近年来,随着互联网技术的迅猛发展和普及,诸多相关服务例如视频电话、高清数字电视、视频点播(VOD,Video-On-Demand)、视频直播等开始逐渐在日常生活中普及。通常情况下,相应服务在通过网络对数据进行传输时,是将报文作为传输的数据单元,而报文在网络中传输时需要依赖于多种报文处理设备的处理,包括但不限于网关等。In recent years, with the rapid development and popularization of Internet technology, many related services such as video telephony, high-definition digital TV, Video-On-Demand (VOD, Video-On-Demand), and live video have gradually become popular in daily life. Under normal circumstances, when the corresponding service transmits data through the network, it uses the message as the data unit for transmission, and the message needs to rely on the processing of various message processing devices when the message is transmitted in the network, including but not limited to gateways. Wait.

相关技术中,网关作为网络接入点,可以用于对报文进行转发。然而,网关可能会出现转发报文速度过慢的问题,导致用户体验较差。In the related art, as a network access point, a gateway can be used to forward packets. However, the gateway may forward packets too slowly, resulting in poor user experience.

发明内容SUMMARY OF THE INVENTION

为了解决相关技术中的问题,本公开实施例提供控制方法、系统、设备及介质。In order to solve the problems in the related art, the embodiments of the present disclosure provide a control method, system, device and medium.

第一方面,本公开实施例中提供了一种控制方法,方法应用于交换机,所述方法包括:In a first aspect, an embodiment of the present disclosure provides a control method, the method is applied to a switch, and the method includes:

获取待处理报文,并向第一网关发送待处理报文,第一网关用于获取待处理报文的源对象标识,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及待处理报文,第二网关的带宽满足与第二网关对应的源对象的带宽需求;Acquire the to-be-processed message, and send the to-be-processed message to the first gateway, where the first gateway is used to obtain the source object identifier of the to-be-processed message, and obtains the source object identifier and the corresponding relationship between the source object and the gateway for indicating The second gateway indication information of the second gateway, and the second gateway indication information and the message to be processed are sent to the switch, and the bandwidth of the second gateway meets the bandwidth requirement of the source object corresponding to the second gateway;

接收第二网关指示信息以及待处理报文,并根据第二网关指示信息向第二网关转发待处理报文,第二网关用于转发待处理报文。Receive the indication information of the second gateway and the to-be-processed packet, and forward the to-be-processed packet to the second gateway according to the second gateway indication information, and the second gateway is used to forward the to-be-processed packet.

在本公开一实现方式中,向第一网关发送待处理报文之前,所述方法还包括:In an implementation manner of the present disclosure, before sending the to-be-processed message to the first gateway, the method further includes:

获取待处理报文的报文属性信息,报文属性信息包括待处理报文的源IP地址以及目的IP地址中至少一项;Obtain packet attribute information of the to-be-processed packet, where the packet attribute information includes at least one of a source IP address and a destination IP address of the to-be-processed packet;

根据报文属性信息以及报文属性信息与网关之间的对应关系获取用于指示第一网关的第一网关指示信息;Obtain first gateway indication information for indicating the first gateway according to the message attribute information and the correspondence between the message attribute information and the gateway;

向第一网关发送待处理报文,包括:Send the pending packet to the first gateway, including:

根据第一网关指示信息向第一网关发送待处理报文。Send the to-be-processed packet to the first gateway according to the first gateway indication information.

在本公开一实现方式中,向第一网关发送待处理报文之前,所述方法还包括:In an implementation manner of the present disclosure, before sending the to-be-processed message to the first gateway, the method further includes:

获取用于指示第一网关的第一网关指示信息,第一网关为交换机对应的多个网关中的任一网关;acquiring first gateway indication information for indicating a first gateway, where the first gateway is any one of multiple gateways corresponding to the switch;

向第一网关发送待处理报文,包括:Send the pending packet to the first gateway, including:

根据第一网关指示信息向第一网关发送待处理报文。Send the to-be-processed packet to the first gateway according to the first gateway indication information.

在本公开一实现方式中,向交换机发送第二网关指示信息以及待处理报文之前,所述方法还包括:In an implementation manner of the present disclosure, before sending the second gateway indication information and the to-be-processed message to the switch, the method further includes:

对第二网关指示信息以及待处理报文进行封装,以获取第一封装报文;Encapsulating the indication information of the second gateway and the to-be-processed message to obtain the first encapsulated message;

向交换机发送第二网关指示信息以及待处理报文,包括:Send the second gateway indication information and to-be-processed packets to the switch, including:

向交换机发送第一封装报文:Send the first encapsulated packet to the switch:

接收第二网关指示信息以及待处理报文,包括:Receiving the indication information of the second gateway and the message to be processed, including:

接收第一封装报文。A first encapsulated packet is received.

在本公开一实现方式中,源对象与网关之间的对应关系包括源对象与导流IP地址之间的对应关系,导流IP地址与源对象对应的网关的IP地址属于同一网段,第二网关指示信息包括第二导流IP地址;In an implementation of the present disclosure, the correspondence between the source object and the gateway includes the correspondence between the source object and the diversion IP address, the diversion IP address and the IP address of the gateway corresponding to the source object belong to the same network segment, and the first The second gateway indication information includes the second diversion IP address;

根据第二网关指示信息向第二网关转发待处理报文,包括:Forwarding the to-be-processed packet to the second gateway according to the second gateway indication information includes:

根据第二导流IP地址以及路由表,获取用于指示IP地址与第二导流IP地址属于同一网段的第二网关的第二网关指示信息,并根据第二网关指示信息向第二网关转发待处理报文。According to the second diversion IP address and the routing table, obtain the second gateway indication information for indicating the second gateway whose IP address and the second diversion IP address belong to the same network segment, and report to the second gateway according to the second gateway indication information Forward pending packets.

在本公开一实现方式中,根据第二导流IP地址以及路由表,获取用于指示IP地址与第二导流IP地址属于同一网段的第二网关的第二网关指示信息,包括:In an implementation manner of the present disclosure, according to the second diversion IP address and the routing table, the second gateway indication information for indicating the second gateway whose IP address and the second diversion IP address belong to the same network segment are obtained, including:

根据第二导流IP地址以及路由表获取第二导流IP地址所属的多个网段,并获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息,第一网段为多个网段中子网掩码最长的网段。Acquire multiple network segments to which the second diversion IP address belongs according to the second diversion IP address and the routing table, and acquire second gateway indication information for indicating that the IP address belongs to the second gateway of the first network segment. The segment is the network segment with the longest subnet mask among multiple network segments.

在本公开一实现方式中,获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息,包括:In an implementation manner of the present disclosure, acquiring second gateway indication information for indicating that the IP address belongs to the second gateway of the first network segment includes:

响应于根据路由表确定至少一个网关的IP地址属于第一网段,获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息;In response to determining that the IP address of the at least one gateway belongs to the first network segment according to the routing table, acquiring second gateway indication information for indicating that the IP address belongs to the second gateway of the first network segment;

所述方法还包括:The method also includes:

响应于根据路由表确定任一网关的IP地址均不属于第一网段,且至少一个网关的IP地址属于第二网段,获取用于指示IP地址属于第二网段的第二网关的第二网关指示信息,第二网段为多个网段中子网掩码次长的网段。In response to determining according to the routing table that none of the IP addresses of the gateways belong to the first network segment, and that the IP address of at least one gateway belongs to the second network segment, obtain the second gateway used to indicate that the IP address belongs to the second network segment. Second gateway indication information, the second network segment is the network segment with the second longest subnet mask among the multiple network segments.

在本公开一实现方式中,根据第二导流IP地址以及路由表,获取用于指示IP地址与第二导流IP地址属于同一网段的第二网关的第二网关指示信息,包括:In an implementation manner of the present disclosure, according to the second diversion IP address and the routing table, the second gateway indication information for indicating the second gateway whose IP address and the second diversion IP address belong to the same network segment are obtained, including:

根据第二导流IP地址以及路由表获取第二导流IP地址所属的多个网段,并获取用于指示IP地址属于第三网段的第二网关的第二网关指示信息,第三网段为多个网段中路由路径长度最短的网段。Acquire multiple network segments to which the second diversion IP address belongs according to the second diversion IP address and the routing table, and acquire second gateway indication information for indicating that the IP address belongs to the second gateway of the third network segment, and the third network A segment is the network segment with the shortest routing path length among multiple network segments.

在本公开一实现方式中,获取用于指示IP地址属于第三网段的第二网关的第二网关指示信息,包括:In an implementation manner of the present disclosure, acquiring second gateway indication information for indicating that the IP address belongs to the second gateway of the third network segment includes:

响应于根据路由表确定第三网段内包括至少一个网关的IP地址,获取用于指示第三网段内的第二网关的第二网关指示信息;In response to determining according to the routing table that the IP address of the at least one gateway is included in the third network segment, acquiring second gateway indication information for indicating the second gateway in the third network segment;

所述方法还包括:The method also includes:

响应于根据路由表确定任一网关的IP地址均不属于第三网段,且至少一个网关的IP地址属于第四网段,获取用于指示IP地址属于第四网段的第二网关的第二网关指示信息,第四网段为多个网段中路径长度次短的网段。In response to determining according to the routing table that none of the IP addresses of the gateways belong to the third network segment, and that the IP address of at least one gateway belongs to the fourth network segment, obtain the second gateway used to indicate that the IP address belongs to the fourth network segment. Second gateway indication information, the fourth network segment is the network segment with the next shortest path length among the multiple network segments.

第二方面,本公开实施例中提供了一种控制方法,其中,该方法应用于网关,该方法包括:In a second aspect, an embodiment of the present disclosure provides a control method, wherein the method is applied to a gateway, and the method includes:

接收交换机发送的第一待处理报文,并获取第一待处理报文的源对象标识;receiving the first to-be-processed message sent by the switch, and acquiring the source object identifier of the first to-be-processed message;

根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及第一待处理报文,第二网关的带宽满足与第二网关对应的源对象的带宽需求;Obtain the second gateway indication information for indicating the second gateway according to the source object identifier and the correspondence between the source object and the gateway, and send the second gateway indication information and the first to-be-processed packet to the switch, the bandwidth of the second gateway satisfying the bandwidth requirement of the source object corresponding to the second gateway;

接收交换机发送的第二待处理报文,并转发第二待处理报文。The second to-be-processed packet sent by the switch is received, and the second to-be-processed packet is forwarded.

第三方面,本公开实施例中提供了一种报文处理系统,报文处理系统包括交换机以及至少一个网关,交换机用于实现第一方面、第一方面的任一种实现方式中任一项的方法步骤,网关用于实现第二方面的方法步骤。In a third aspect, an embodiment of the present disclosure provides a message processing system, where the message processing system includes a switch and at least one gateway, and the switch is configured to implement any one of the first aspect and any implementation manner of the first aspect The method steps of the gateway are used to implement the method steps of the second aspect.

第四方面,本公开实施例中提供了一种控制装置,控制装置包括:In a fourth aspect, an embodiment of the present disclosure provides a control device, and the control device includes:

第一报文发送模块,被配置为获取待处理报文,并向第一网关发送待处理报文,第一网关用于获取待处理报文的源对象标识,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及待处理报文,第二网关的带宽满足与第二网关对应的源对象的带宽需求;The first message sending module is configured to obtain the to-be-processed message and send the to-be-processed message to the first gateway, where the first gateway is used to obtain the source object identifier of the to-be-processed message, according to the source object identifier and the source object and the source object. Correspondence between gateways Acquire second gateway indication information used to indicate the second gateway, and send the second gateway indication information and the message to be processed to the switch. The bandwidth of the second gateway satisfies the bandwidth of the source object corresponding to the second gateway. bandwidth requirements;

第一报文接收模块,被配置为接收第二网关指示信息以及待处理报文,并根据第二网关指示信息向第二网关转发待处理报文,第二网关用于转发待处理报文。The first message receiving module is configured to receive the indication information of the second gateway and the message to be processed, and forward the message to be processed to the second gateway according to the indication information of the second gateway, and the second gateway is configured to forward the message to be processed.

第五方面,本公开实施例中提供了一种控制装置,所述控制装置包括:In a fifth aspect, an embodiment of the present disclosure provides a control device, the control device comprising:

第二报文接收模块,被配置为接收交换机发送的第一待处理报文,并获取第一待处理报文的源对象标识;The second message receiving module is configured to receive the first message to be processed sent by the switch, and obtain the source object identifier of the first message to be processed;

第二报文发送模块,被配置为根据所述源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向所述交换机发送所述第二网关指示信息以及所述第一待处理报文,所述第二网关的带宽满足与所述第二网关对应的源对象的带宽需求;The second packet sending module is configured to obtain second gateway indication information for indicating the second gateway according to the source object identifier and the correspondence between the source object and the gateway, and send the second gateway indication information to the switch. Gateway indication information and the first message to be processed, the bandwidth of the second gateway satisfies the bandwidth requirement of the source object corresponding to the second gateway;

第三报文发送模块,被配置为接收所述交换机发送的第二待处理报文,并转发所述第二待处理报文。The third packet sending module is configured to receive the second to-be-processed packet sent by the switch, and to forward the second to-be-processed packet.

第六方面,本公开实施例中提供了一种电子设备,包括存储器和至少一个处理器;存储器用于存储一条或多条计算机指令,一条或多条计算机指令被至少一个处理器执行以实现第一方面、第一方面的任一种实现方式、第二方面中任一项的方法步骤。In a sixth aspect, an embodiment of the present disclosure provides an electronic device, including a memory and at least one processor; the memory is used to store one or more computer instructions, and the one or more computer instructions are executed by at least one processor to implement the first In one aspect, any implementation of the first aspect, the method steps of any one of the second aspect.

第七方面,本公开实施例中提供了一种计算机可读存储介质,其上存储有计算机指令,该计算机指令被处理器执行时实现第一方面、第一方面的任一种实现方式、第二方面任一项的方法步骤。In a seventh aspect, an embodiment of the present disclosure provides a computer-readable storage medium on which computer instructions are stored, and when the computer instructions are executed by a processor, implement the first aspect, any implementation manner of the first aspect, and the third aspect. The method steps of any one of the two aspects.

第八方面,本公开实施例中提供了一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现第一方面、第一方面的任一种实现方式、第二方面任一项的方法步骤。In an eighth aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, implements the first aspect, any implementation manner of the first aspect, and the second aspect. The method steps of any of the aspects.

本公开实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

本公开实施例提供的技术方案应用于交换机,根据该技术方案,通过获取待处理报文,并向第一网关发送待处理报文,第一网关用于获取待处理报文的源对象标识,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及待处理报文;接收第二网关指示信息以及待处理报文,并根据第二网关指示信息向第二网关转发待处理报文,第二网关用于转发待处理报文。其中,考虑到用于转发待处理报文的第二网关的带宽满足与第二网关对应的源对象的带宽需求,因此即使第二网关对应的源对象所传输的报文所属的数据流较少,也不会对第二网关转发报文的带宽,即用于转发第二网关对应的源对象所传输报文的总带宽产生任何影响,即确保相应网关转发报文的带宽能够满足该网关对应的源对象的带宽需求,确保源对象的报文可以被及时转发,改善了用户体验。The technical solution provided by the embodiment of the present disclosure is applied to a switch. According to the technical solution, by acquiring the to-be-processed packet and sending the to-be-processed packet to the first gateway, the first gateway is used to acquire the source object identifier of the to-be-processed packet, Obtain the second gateway indication information for indicating the second gateway according to the source object identifier and the corresponding relationship between the source object and the gateway, and send the second gateway indication information and the message to be processed to the switch; receive the second gateway indication information and The to-be-processed packet is forwarded to the second gateway according to the indication information of the second gateway, and the second gateway is used to forward the to-be-processed packet. Wherein, considering that the bandwidth of the second gateway for forwarding the to-be-processed message meets the bandwidth requirement of the source object corresponding to the second gateway, even if the message transmitted by the source object corresponding to the second gateway belongs to fewer data streams , it will not have any impact on the bandwidth of the packets forwarded by the second gateway, that is, the total bandwidth used to forward the packets transmitted by the source object corresponding to the second gateway, that is, to ensure that the bandwidth of the packets forwarded by the corresponding gateway can meet the corresponding bandwidth of the gateway. The bandwidth requirements of the source object can be determined to ensure that the packets of the source object can be forwarded in time, which improves the user experience.

根据本公开实施例提供的技术方案,通过获取待处理报文的报文属性信息,根据报文属性信息以及报文属性信息与网关之间的对应关系获取用于指示第一网关的第一网关指示信息,并根据第一网关指示信息向第一网关发送待处理报文,可以依据预先设定的报文属性信息与网关之间的对应关系,基于待处理报文的报文属性信息获取第一网关指示信息,便于管理该第一网关具体为那个网关。According to the technical solutions provided by the embodiments of the present disclosure, by acquiring the packet attribute information of the to-be-processed packet, the first gateway used to indicate the first gateway is acquired according to the packet attribute information and the corresponding relationship between the packet attribute information and the gateway. indication information, and send the to-be-processed message to the first gateway according to the first gateway indication information, according to the preset correspondence between the message attribute information and the gateway, and obtain the first A gateway indication information is convenient for managing which gateway the first gateway is specifically.

根据本公开实施例提供的技术方案,通过获取用于指示第一网关的第一网关指示信息,并根据第一网关指示信息向第一网关发送待处理报文,其中由于第一网关为交换机对应的多个网关中的任一网关,因此可以无需管理该第一网关具体为那个网关,减少了所消耗的处理资源。According to the technical solutions provided by the embodiments of the present disclosure, the first gateway indication information used to indicate the first gateway is obtained, and the to-be-processed packet is sent to the first gateway according to the first gateway indication information, wherein because the first gateway corresponds to the switch Therefore, there is no need to manage which gateway the first gateway is specifically, which reduces the consumed processing resources.

根据本公开实施例提供的技术方案,通过使第一网关对第二网关指示信息以及待处理报文进行封装,以获取第一封装报文,并向交换机发送第一封装报文,使交换机可以接收第一封装报文,可以便于对第一封装报文进行发送。According to the technical solutions provided by the embodiments of the present disclosure, by causing the first gateway to encapsulate the indication information of the second gateway and the to-be-processed message, the first encapsulated message is obtained, and the first encapsulated message is sent to the switch, so that the switch can Receiving the first encapsulated packet may facilitate sending the first encapsulated packet.

根据本公开实施例提供的技术方案,通过将源对象与网关之间的对应关系限定为包括源对象与导流IP地址之间的对应关系,将导流IP地址限定为与源对象对应的网关的IP地址属于同一网段,将第二网关指示信息限定为包括第二导流IP地址,并通过根据第二导流IP地址以及路由表,获取用于指示IP地址与第二导流IP地址属于同一网段的第二网关的第二网关指示信息,并根据第二网关指示信息向第二网关转发待处理报文,可以便于对第二网关具体为哪一个网关进行管理。According to the technical solutions provided by the embodiments of the present disclosure, by defining the correspondence between the source object and the gateway to include the correspondence between the source object and the diversion IP address, the diversion IP address is limited to the gateway corresponding to the source object The IP address belongs to the same network segment, the second gateway indication information is limited to include the second diversion IP address, and by obtaining the indication IP address and the second diversion IP address according to the second diversion IP address and the routing table The second gateway indication information of the second gateway belonging to the same network segment, and forwarding the to-be-processed message to the second gateway according to the second gateway indication information, can facilitate the management of which gateway the second gateway is.

根据本公开实施例提供的技术方案,通过根据第二导流IP地址以及路由表获取第二导流IP地址所属的多个网段,并获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息,其中由于第一网段为多个网段中子网掩码最长的网段,因此可以使第二网关指示信息所指示的第二网关唯一,确保不会由多个网关转发该待处理报文,避免进行重复转发,减少了所消耗的处理资源。According to the technical solutions provided by the embodiments of the present disclosure, the multiple network segments to which the second diversion IP address belongs are obtained according to the second diversion IP address and the routing table, and the second diversion IP address used to indicate that the IP address belongs to the first network segment is obtained. The second gateway indication information of the gateway, wherein since the first network segment is the network segment with the longest subnet mask among the multiple network segments, the second gateway indicated by the second gateway indication information can be unique to ensure that no Multiple gateways forward the to-be-processed message to avoid repeated forwarding and reduce the consumption of processing resources.

根据本公开实施例提供的技术方案,通过响应于根据路由表确定至少一个网关的IP地址属于第一网段,并获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息,其中在根据路由表确定至少一个网关的IP地址属于第一网段,可以理解为IP地址被设置为属于第一网段的至少一个网关未出现故障,从而可以确保用于转发待处理报文的第二网关为未出现故障的网关;通过响应于根据路由表确定任一网关的IP地址均不属于第一网段,且至少一个网关的IP地址属于多个网段中子网掩码次长的第二网段,获取用于指示IP地址属于第二网段的第二网关的第二网关指示信息,其中在根据路由表确定任一网关的IP地址均不属于第一网段时,可以理解为IP地址被设置为属于第一网段的网关可能出现了故障,因此上述方案可以确保在部分网关出现故障时,也可以由相应的网关即IP地址属于第二网段的网关作为第二网关对待处理报文进行转发,提高了对待处理报文进行转发的可靠性。According to the technical solutions provided by the embodiments of the present disclosure, in response to determining that the IP address of at least one gateway belongs to the first network segment according to the routing table, and obtaining a second gateway indication for indicating that the IP address belongs to the second gateway of the first network segment information, in which it is determined according to the routing table that the IP address of at least one gateway belongs to the first network segment. The second gateway of the text is a gateway that does not fail; by responding to the routing table, it is determined that the IP address of any gateway does not belong to the first network segment, and the IP address of at least one gateway belongs to the subnet mask in the multiple network segments The second network segment with the second longest, obtains the second gateway indication information used to indicate that the IP address belongs to the second gateway of the second network segment, wherein when it is determined according to the routing table that the IP address of any gateway does not belong to the first network segment , it can be understood that the gateway whose IP address is set to belong to the first network segment may be faulty, so the above solution can ensure that when some gateways fail, the corresponding gateway, that is, the gateway whose IP address belongs to the second network segment, can also be used as the corresponding gateway. The second gateway forwards the to-be-processed message, which improves the reliability of forwarding the to-be-processed message.

根据本公开实施例提供的技术方案,通过根据第二导流IP地址以及路由表获取第二导流IP地址所属的多个网段,并获取用于指示IP地址属于第三网段的第二网关的第二网关指示信息,其中由于第三网段为多个网段中路由路径长度最短的网段,因此可以使第二网关指示信息所指示的第二网关唯一,确保不会由多个网关转发该待处理报文,避免进行重复转发,减少了所消耗的处理资源。According to the technical solutions provided by the embodiments of the present disclosure, the multiple network segments to which the second diversion IP address belongs are obtained according to the second diversion IP address and the routing table, and the second diversion IP address used to indicate that the IP address belongs to the third network segment is obtained. The second gateway indication information of the gateway, wherein since the third network segment is the network segment with the shortest routing path length among the multiple network segments, the second gateway indicated by the second gateway indication information can be unique to ensure that multiple network segments cannot be used by multiple network segments. The gateway forwards the to-be-processed message to avoid repeated forwarding, thereby reducing the processing resources consumed.

根据本公开实施例提供的技术方案,响应于根据路由表确定第三网段内包括至少一个网关的IP地址,获取用于指示第三网段内的第二网关的第二网关指示信息,其中在根据路由表确定至少一个网关的IP地址属于第三网段,可以理解为IP地址被设置为属于第三网段的至少一个网关未出现故障,从而可以确保用于转发待处理报文的第二网关为未出现故障的网关;通过响应于根据路由表确定任一网关的IP地址均不属于第三网段,且至少一个网关的IP地址属于第四网段,获取用于指示IP地址属于第四网段的第二网关的第二网关指示信息,其中在根据路由表确定任一网关的IP地址均不属于第三网段时,可以理解为IP地址被设置为属于第三网段的网关可能出现了故障,因此上述方案可以确保在部分网关出现故障时,也可以由相应的网关即IP地址属于第四网段的网关作为第二网关对待处理报文进行转发,提高了对待处理报文进行转发的可靠性。According to the technical solutions provided by the embodiments of the present disclosure, in response to determining the IP address of at least one gateway in the third network segment according to the routing table, second gateway indication information for indicating the second gateway in the third network segment is obtained, wherein When it is determined according to the routing table that the IP address of at least one gateway belongs to the third network segment, it can be understood that at least one gateway whose IP address is set to belong to the third network segment is not faulty, so as to ensure that the first gateway for forwarding the to-be-processed packet is not faulty. The second gateway is a gateway that has not failed; in response to determining according to the routing table that none of the IP addresses of the gateways belong to the third network segment, and that the IP address of at least one gateway belongs to the fourth network segment, the information used to indicate that the IP address belongs to the third network segment is obtained. The second gateway indication information of the second gateway of the fourth network segment, wherein when it is determined according to the routing table that the IP address of any gateway does not belong to the third network segment, it can be understood that the IP address is set to belong to the third network segment. The gateway may be faulty, so the above solution can ensure that when some gateways are faulty, the corresponding gateway, that is, the gateway whose IP address belongs to the fourth network segment, can be used as the second gateway to forward the to-be-processed packets, which improves the number of to-be-processed packets. The reliability of the forwarding of the text.

本公开实施例提供的技术方案应用于网关,根据该技术方案,通过接收交换机发送的第一待处理报文,并获取第一待处理报文的源对象标识;根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及第一待处理报文;接收交换机发送的第二待处理报文,并转发第二待处理报文。其中,考虑到用于转发待处理报文的第二网关的带宽满足与第二网关对应的源对象的带宽需求,因此即使第二网关对应的源对象所传输的报文所属的数据流较少,也不会对第二网关转发报文的带宽,即用于转发第二网关对应的源对象所传输报文的总带宽产生任何影响,即确保相应网关转发报文的带宽能够满足该网关对应的源对象的带宽需求,确保源对象的报文可以被及时转发,改善了用户体验。The technical solution provided by the embodiment of the present disclosure is applied to a gateway. According to the technical solution, the first message to be processed sent by the switch is received, and the source object identifier of the first message to be processed is obtained; according to the source object identifier and the source object and the source object The correspondence between gateways acquires the second gateway indication information used to indicate the second gateway, and sends the second gateway indication information and the first to-be-processed packet to the switch; receives the second to-be-processed packet sent by the switch, and forwards it The second to-be-processed message. Wherein, considering that the bandwidth of the second gateway for forwarding the to-be-processed message meets the bandwidth requirement of the source object corresponding to the second gateway, even if the message transmitted by the source object corresponding to the second gateway belongs to fewer data streams , it will not have any impact on the bandwidth of the packets forwarded by the second gateway, that is, the total bandwidth used to forward the packets transmitted by the source object corresponding to the second gateway, that is, to ensure that the bandwidth of the packets forwarded by the corresponding gateway can meet the corresponding bandwidth of the gateway. The bandwidth requirements of the source object can be determined to ensure that the packets of the source object can be forwarded in time, which improves the user experience.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明Description of drawings

结合附图,通过以下非限制性实施方式的详细描述,本公开的其它特征、目的和优点将变得更加明显。在附图中:Other features, objects and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings. In the attached image:

图1示出根据本公开一实施方式的报文处理系统的示意性结构框图。FIG. 1 shows a schematic structural block diagram of a message processing system according to an embodiment of the present disclosure.

图2示出根据本公开一实施方式的控制方法的流程图。FIG. 2 shows a flowchart of a control method according to an embodiment of the present disclosure.

图3示出根据本公开一实施方式的报文处理系统的示意性结构框图。FIG. 3 shows a schematic structural block diagram of a message processing system according to an embodiment of the present disclosure.

图4示出根据本公开一实施方式的控制方法的流程图。FIG. 4 shows a flowchart of a control method according to an embodiment of the present disclosure.

图5示出根据本公开一实施方式的控制装置的结构框图。FIG. 5 shows a structural block diagram of a control device according to an embodiment of the present disclosure.

图6示出根据本公开一实施方式的控制装置的结构框图。FIG. 6 shows a structural block diagram of a control device according to an embodiment of the present disclosure.

图7示出根据本公开一实施方式的电子设备的结构框图。FIG. 7 shows a structural block diagram of an electronic device according to an embodiment of the present disclosure.

图8是适于用来实现根据本公开实施方式的方法的计算机系统的结构示意图。FIG. 8 is a schematic structural diagram of a computer system suitable for implementing a method according to an embodiment of the present disclosure.

具体实施方式Detailed ways

下文中,将参考附图详细描述本公开的示例性实施方式,以使本领域技术人员可容易地实现它们。此外,为了清楚起见,在附图中省略了与描述示例性实施方式无关的部分。Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. Also, for the sake of clarity, parts unrelated to describing the exemplary embodiments are omitted from the drawings.

在本公开中,应理解,诸如“包括”或“具有”等的术语旨在指示本说明书中所公开的标签、数字、步骤、行为、部件、部分或其组合的存在,并且不欲排除一个或多个其他标签、数字、步骤、行为、部件、部分或其组合存在或被添加的可能性。In the present disclosure, it should be understood that terms such as "comprising" or "having" are intended to indicate the presence of labels, numbers, steps, acts, components, parts, or combinations thereof disclosed in this specification, and are not intended to exclude a or multiple other labels, numbers, steps, acts, parts, sections, or combinations thereof may exist or be added.

另外还需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的标签可以相互组合。下面将参考附图并结合实施例来详细说明本公开。In addition, it should be noted that the embodiments in the present disclosure and the tags in the embodiments may be combined with each other under the condition of no conflict. The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

如背景技术所述,现有技术中存在报文转发慢的问题,发明人发现,出现这种情况的原因是,在对网络服务产品售卖时,考虑到负载均衡等因素,需要对各个网关的带宽进行限制,即限制相应的源对象传输报文的速度,因此作为网络接入点的网关会具备限速的功能,即限制网关转发报文的带宽。在某些场景(例如云计算场景)下,网关可以分布式部署,通过根据源对象所传输报文所属的数据流,将源对象所传输报文均分给不同的网关,由多个网关对报文进行转发。其中,通过均匀的限制该多个网关中每个网关的带宽,可以达到限制源对象发送报文的速度的目的。As described in the background art, there is a problem of slow packet forwarding in the prior art. The inventor found that the reason for this is that when selling network service products, considering factors such as load balancing, it is necessary to The bandwidth is limited, that is, the speed at which the corresponding source object transmits the message is limited. Therefore, the gateway serving as the network access point has the function of limiting the speed, that is, limiting the bandwidth of the gateway to forward the message. In some scenarios (such as cloud computing scenarios), gateways can be deployed in a distributed manner. By dividing the packets transmitted by the source object to different gateways according to the data stream to which the packets transmitted by the source object belong, multiple gateways The message is forwarded. Wherein, by uniformly limiting the bandwidth of each gateway in the multiple gateways, the purpose of limiting the speed of the source object sending packets can be achieved.

然而,由于源对象所传输报文所属的数据流的数量并非固定不变的,当源对象所传输报文所属的数据流较少时,源对象所传输报文可能会被分配给数量较少的几个网关,导致源对象所传输报文仅由这几个网关进行转发。由于这几个网关的总带宽小于被分配用于转发源对象所传输报文的所有网关的总带宽,因此会出现网关转发报文的带宽小于源对象的带宽需求,即网关转发报文的速度过慢的问题,从而使相应源对象的报文无法被及时转发,损害了用户体验。However, since the number of data streams to which the packets transmitted by the source object belong is not fixed, when the packets transmitted by the source object belong to fewer data streams, the packets transmitted by the source object may be allocated to a smaller number of data streams. several gateways, so that the packets transmitted by the source object are only forwarded by these gateways. Since the total bandwidth of these gateways is less than the total bandwidth of all gateways allocated for forwarding packets transmitted by the source object, the bandwidth of the gateways forwarding packets is less than the bandwidth requirement of the source object, that is, the speed at which the gateway forwards packets. The problem is too slow, so that the packets of the corresponding source object cannot be forwarded in time, which damages the user experience.

考虑以上方案的缺点,本公开发明人提出了新的应用于交换机的方案:通过获取待处理报文,并向第一网关发送待处理报文,第一网关用于获取待处理报文的源对象标识,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及待处理报文;接收第二网关指示信息以及待处理报文,并根据第二网关指示信息向第二网关转发待处理报文,第二网关用于转发待处理报文。其中,考虑到用于转发待处理报文的第二网关的带宽满足与第二网关对应的源对象的带宽需求,因此即使第二网关对应的源对象所传输的报文所属的数据流较少,也不会对第二网关转发报文的带宽,即用于转发第二网关对应的源对象所传输报文的总带宽产生任何影响,即确保相应网关转发报文的带宽能够满足该网关对应的源对象的带宽需求,确保源对象的报文可以被及时转发,改善了用户体验。Considering the shortcomings of the above solutions, the inventor of the present disclosure proposes a new solution applied to switches: by acquiring the to-be-processed message and sending the to-be-processed message to the first gateway, the first gateway is used to acquire the source of the to-be-processed message object identifier, obtain the second gateway indication information for indicating the second gateway according to the source object identifier and the corresponding relationship between the source object and the gateway, and send the second gateway indication information and the message to be processed to the switch; receive the second gateway the indication information and the to-be-processed message, and forward the to-be-processed message to the second gateway according to the second gateway indication information, and the second gateway is used to forward the to-be-processed message. Wherein, considering that the bandwidth of the second gateway for forwarding the to-be-processed message meets the bandwidth requirement of the source object corresponding to the second gateway, even if the message transmitted by the source object corresponding to the second gateway belongs to fewer data streams , it will not have any impact on the bandwidth of the packets forwarded by the second gateway, that is, the total bandwidth used to forward the packets transmitted by the source object corresponding to the second gateway, that is, to ensure that the bandwidth of the packets forwarded by the corresponding gateway can meet the corresponding bandwidth of the gateway. The bandwidth requirements of the source object can be determined to ensure that the packets of the source object can be forwarded in time, which improves the user experience.

图1示出根据本公开一实施方式的报文处理系统的示意性结构框图,如图1所述,报文处理系统包括交换机101以及至少一个网关102。FIG. 1 shows a schematic structural block diagram of a message processing system according to an embodiment of the present disclosure. As shown in FIG. 1 , the message processing system includes a switch 101 and at least one gateway 102 .

交换机101,可以理解为具备交换机(Switch)功能的网元。交换机101可以为交换机,也可以为虚拟交换机(Virtual Switch),示例性的,交换机101可以为上联交换机集群。The switch 101 can be understood as a network element with a switch (Switch) function. The switch 101 may be a switch, or a virtual switch (Virtual Switch). Exemplarily, the switch 101 may be an uplink switch cluster.

网关102,可以为具备网关(Gateway)功能的网元,网关102可以为网关,也可以为虚拟网关(Virtual Gateway)。示例性的,网关102可以为部署在上联交换机集群下的多个网关中的任一网关。The gateway 102 may be a network element with a gateway (Gateway) function, and the gateway 102 may be a gateway or a virtual gateway (Virtual Gateway). Exemplarily, the gateway 102 may be any gateway among multiple gateways deployed under the upstream switch cluster.

其中,交换机,可以理解为用于数据中转的网络设备,交换机可以为接入自身的任意两个网络节点提供的传输通道。虚拟交换机,可以理解为基于物理机虚拟得到虚拟机后,由虚拟机虚拟出的虚拟交换机,通过该虚拟交换机可以与其他虚拟机或物理机进行通信。The switch can be understood as a network device used for data transfer, and the switch can provide a transmission channel for any two network nodes accessing itself. The virtual switch can be understood as a virtual switch virtualized by the virtual machine after the virtual machine is obtained based on the physical machine, and communication with other virtual machines or physical machines can be performed through the virtual switch.

网关,可以理解为用于实现网络互联的网络设备,网关可以用于在不同的通信协议、数据格式或语言、系统之间提供转换服务。虚拟网关,可以理解为基于物理机虚拟得到虚拟机后,由虚拟机虚拟出的虚拟网关,通过该虚拟网关可以与其他虚拟机或物理机进行通信。A gateway can be understood as a network device used to realize network interconnection, and a gateway can be used to provide conversion services between different communication protocols, data formats or languages, and systems. The virtual gateway can be understood as a virtual gateway virtualized by the virtual machine after the virtual machine is obtained based on the physical machine, and communication with other virtual machines or physical machines can be performed through the virtual gateway.

虚拟机,可以被理解为运行在虚拟化平台的虚拟化层。示例性的,在云计算平台,虚拟机可以是在集群服务器上通过所述虚拟化技术划分出来的一个或多个独立主机(即云主机)或者一个或多个独立服务器(即云服务器);在其他虚拟化系统或者平台中,虚拟机可以是一个或者多个物理主机上采用所述虚拟化技术实现的一个或多个虚拟主机,或者可以是一个或者多个物理服务器上采用所述虚拟化技术实现的一个或多个虚拟专用服务器。物理机,可以理解为是相对于虚拟机而言对实体计算机的命名。物理机可以提供给虚拟机以硬件环境。A virtual machine can be understood as a virtualization layer running on a virtualization platform. Exemplarily, on a cloud computing platform, the virtual machine may be one or more independent hosts (ie cloud hosts) or one or more independent servers (ie cloud servers) divided by the virtualization technology on the cluster server; In other virtualization systems or platforms, the virtual machine may be one or more virtual hosts implemented by using the virtualization technology on one or more physical hosts, or may be one or more physical servers using the virtualization technology One or more virtual private servers implemented by technology. A physical machine can be understood as a name for a physical computer relative to a virtual machine. A physical machine can provide a hardware environment to a virtual machine.

为了解决上述问题,本公开提出控制方法、系统、设备及介质。In order to solve the above problems, the present disclosure proposes a control method, system, device and medium.

图2示出根据本公开一实施方式的控制方法的流程图,该方法应用于图1中所示的交换机。如图2所示,该控制方法包括步骤S101-S102。FIG. 2 shows a flowchart of a control method according to an embodiment of the present disclosure, which is applied to the switch shown in FIG. 1 . As shown in FIG. 2 , the control method includes steps S101-S102.

在步骤S101中,获取待处理报文,并向第一网关发送待处理报文。In step S101, a to-be-processed packet is acquired, and the to-be-processed packet is sent to the first gateway.

其中,第一网关用于获取待处理报文的源对象标识,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及待处理报文,第二网关的带宽满足与第二网关对应的源对象的带宽需求。The first gateway is used to obtain the source object identifier of the to-be-processed message, obtains the second gateway indication information used to indicate the second gateway according to the source object identifier and the corresponding relationship between the source object and the gateway, and sends the second gateway indication information to the switch. Two gateway indication information and to-be-processed packets, the bandwidth of the second gateway meets the bandwidth requirement of the source object corresponding to the second gateway.

在步骤S102中,接收第二网关指示信息以及待处理报文,并根据第二网关指示信息向第二网关转发待处理报文。In step S102, the indication information of the second gateway and the to-be-processed packet are received, and the to-be-processed packet is forwarded to the second gateway according to the indication information of the second gateway.

其中,第二网关用于转发待处理报文。Wherein, the second gateway is used for forwarding the to-be-processed message.

在本公开一实施方式中,待处理报文可以理解为源对象所传输的报文,其中源对象可以理解为使用相应的网络服务产品的租户或服务。其中,该相应的网络服务产品可以为租户或服务所购买的网络服务产品。In an embodiment of the present disclosure, the message to be processed may be understood as a message transmitted by a source object, where the source object may be understood as a tenant or service using a corresponding network service product. The corresponding network service product may be a network service product purchased by a tenant or a service.

在本公开一实施方式中,获取待处理报文,可以理解为接收其他装置或系统发送的待处理报文,也可以为读写事先获取的待处理报文。In an embodiment of the present disclosure, acquiring a to-be-processed message may be understood as receiving a to-be-processed message sent by another device or system, or may be reading or writing a pre-acquired to-be-processed message.

在本公开一实施方式中,第一网关以及第二网关可以理解为属于与交换机对应的网关,示例性的,当交换机为上联交换机集群时,第一网关以及第二网关可以为部署在上联交换机集群下的网关。In an embodiment of the present disclosure, the first gateway and the second gateway may be understood as belonging to gateways corresponding to switches. Exemplarily, when the switch is an uplink switch cluster, the first gateway and the second gateway may be deployed on the switch. The gateway under the connected switch cluster.

在本公开一实施方式中,待处理报文的源对象标识,可以理解为用于指示传输该待处理报文的源对象。获取待处理报文的源对象标识,可以理解为从待处理报文中的指定字段中读取该源对象标识。In an embodiment of the present disclosure, the source object identifier of the to-be-processed packet may be understood as indicating a source object for transmitting the to-be-processed packet. Obtaining the source object identifier of the to-be-processed packet can be understood as reading the source object identifier from a specified field in the to-be-processed packet.

在本公开一实施方式中,源对象与网关之间的对应关系,可以理解为用于指示至少一个网关中,与每个网关对应的源对象,其中每个网关可以对应一个或多个源对象。对象与网关之间的对应关系,可以为数据库,也可以为表单,本公开不对对象与网关之间的对应关系的实现方式进行具体限定。In an embodiment of the present disclosure, the correspondence between source objects and gateways can be understood as indicating a source object corresponding to each gateway in at least one gateway, where each gateway may correspond to one or more source objects . The corresponding relationship between the object and the gateway may be a database or a form, and the present disclosure does not specifically limit the implementation of the corresponding relationship between the object and the gateway.

在本公开一实施方式中,根据源对象标识以及源对象与网关之间的对应关系获取第二网关指示信息,可以理解为在源对象与网关之间的对应关系中查找与该源对象标识所指示的源对象对应的网关即第二网关,并生成用于指示该第二网关的第二网关指示信息。In an embodiment of the present disclosure, obtaining the second gateway indication information according to the source object identifier and the corresponding relationship between the source object and the gateway can be understood as searching for the source object identifier in the corresponding relationship between the source object and the gateway. The gateway corresponding to the indicated source object is the second gateway, and second gateway indication information for indicating the second gateway is generated.

在本公开一实施方式中,第二网关的带宽满足与第二网关对应的源对象的带宽需求,可以理解为第二网关的带宽,大于或等于该第二网关对应的一个或多个源对象所使用或购买的网络服务产品的总带宽。In an embodiment of the present disclosure, the bandwidth of the second gateway meets the bandwidth requirement of the source object corresponding to the second gateway, which can be understood as the bandwidth of the second gateway, which is greater than or equal to one or more source objects corresponding to the second gateway The total bandwidth of the network service product used or purchased.

在本公开一实施方式中,向交换机发送第二网关指示信息以及待处理报文,可以为直接向交换机发送第二网关指示信息以及待处理报文,也可以为将第二网关指示信息以及待处理报文进行封装,并向交换机发送封装后的报文。In an embodiment of the present disclosure, sending the second gateway indication information and the to-be-processed message to the switch may be directly sending the second gateway indication information and the to-be-processed message to the switch, or it may be to send the second gateway indication information and the to-be-processed message to the switch. Process packets for encapsulation, and send the encapsulated packets to the switch.

本公开实施例提供的技术方案应用于交换机,根据该技术方案,通过获取待处理报文,并向第一网关发送待处理报文,第一网关用于获取待处理报文的源对象标识,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及待处理报文;接收第二网关指示信息以及待处理报文,并根据第二网关指示信息向第二网关转发待处理报文,第二网关用于转发待处理报文。其中,考虑到用于转发待处理报文的第二网关的带宽满足与第二网关对应的源对象的带宽需求,因此即使第二网关对应的源对象所传输的报文所属的数据流较少,也不会对第二网关转发报文的带宽,即用于转发第二网关对应的源对象所传输报文的总带宽产生任何影响,即确保相应网关转发报文的带宽能够满足该网关对应的源对象的带宽需求,确保源对象的报文可以被及时转发,改善了用户体验。The technical solution provided by the embodiment of the present disclosure is applied to a switch. According to the technical solution, by acquiring the to-be-processed packet and sending the to-be-processed packet to the first gateway, the first gateway is used to acquire the source object identifier of the to-be-processed packet, Obtain the second gateway indication information for indicating the second gateway according to the source object identifier and the corresponding relationship between the source object and the gateway, and send the second gateway indication information and the message to be processed to the switch; receive the second gateway indication information and The to-be-processed packet is forwarded to the second gateway according to the indication information of the second gateway, and the second gateway is used to forward the to-be-processed packet. Wherein, considering that the bandwidth of the second gateway for forwarding the to-be-processed message meets the bandwidth requirement of the source object corresponding to the second gateway, even if the message transmitted by the source object corresponding to the second gateway belongs to fewer data streams , it will not have any impact on the bandwidth of the packets forwarded by the second gateway, that is, the total bandwidth used to forward the packets transmitted by the source object corresponding to the second gateway, that is, to ensure that the bandwidth of the packets forwarded by the corresponding gateway can meet the corresponding bandwidth of the gateway. The bandwidth requirements of the source object can be determined to ensure that the packets of the source object can be forwarded in time, which improves the user experience.

在本公开一实现方式中,第一网关发送待处理报文之前,所述方法还包括如下步骤:In an implementation manner of the present disclosure, before the first gateway sends the to-be-processed message, the method further includes the following steps:

获取待处理报文的报文属性信息,报文属性信息包括待处理报文的源IP地址以及目的IP地址中至少一项;Obtain packet attribute information of the to-be-processed packet, where the packet attribute information includes at least one of a source IP address and a destination IP address of the to-be-processed packet;

根据报文属性信息以及报文属性信息与网关之间的对应关系获取用于指示第一网关的第一网关指示信息;Obtain first gateway indication information for indicating the first gateway according to the message attribute information and the correspondence between the message attribute information and the gateway;

向第一网关发送待处理报文,可以通过如下步骤实现:Sending the pending packet to the first gateway can be implemented by the following steps:

根据第一网关指示信息向第一网关发送待处理报文。Send the to-be-processed packet to the first gateway according to the first gateway indication information.

在本公开一实施方式中,待处理报文的报文属性信息,可以包括待处理报文的源IP地址以及目的IP地址中至少一项,待处理报文的报文属性信息还可以包括待处理报文的源端口号、目的端口号、接口索引、协议号、上一跳IP地址、下一跳IP地址中至少一项。In an embodiment of the present disclosure, the packet attribute information of the packet to be processed may include at least one of the source IP address and the destination IP address of the packet to be processed, and the packet attribute information of the packet to be processed may also include the packet to be processed. At least one of the source port number, destination port number, interface index, protocol number, last-hop IP address, and next-hop IP address of the processing packet.

在本公开一实施方式中,报文属性信息与网关之间的对应关系,可以理解为用于指示至少一个网关中,与每个网关对应的报文属性信息,其中每个网关可以对应一种报文属性信息,每个网关也可以对应多种不同的报文属性信息。报文属性信息与网关之间的对应关系,可以为数据库也可以为表单,本公开不对报文属性信息与网关之间的对应关系的实现方式进行具体限定。In an embodiment of the present disclosure, the correspondence between the packet attribute information and the gateway can be understood as indicating the packet attribute information corresponding to each gateway in at least one gateway, wherein each gateway may correspond to a Packet attribute information, each gateway can also correspond to a variety of different packet attribute information. The corresponding relationship between the message attribute information and the gateway may be a database or a form, and the present disclosure does not specifically limit the implementation of the corresponding relationship between the message attribute information and the gateway.

在本公开一实施方式中,根据报文属性信息以及报文属性信息与网关之间的对应关系获取第一网关指示信息,可以理解为在报文属性信息与网关之间的对应关系中查找与该报文属性信息对应的网关即第一网关,并生成用于指示该第一网关的第一网关指示信息。In an embodiment of the present disclosure, obtaining the first gateway indication information according to the packet attribute information and the corresponding relationship between the packet attribute information and the gateway can be understood as searching for the corresponding relationship between the packet attribute information and the gateway. The gateway corresponding to the packet attribute information is the first gateway, and first gateway indication information for indicating the first gateway is generated.

根据本公开实施例提供的技术方案,通过获取待处理报文的报文属性信息,根据报文属性信息以及报文属性信息与网关之间的对应关系获取用于指示第一网关的第一网关指示信息,并根据第一网关指示信息向第一网关发送待处理报文,可以依据预先设定的报文属性信息与网关之间的对应关系,基于待处理报文的报文属性信息获取第一网关指示信息,便于管理该第一网关具体为那个网关。According to the technical solutions provided by the embodiments of the present disclosure, by acquiring the packet attribute information of the to-be-processed packet, the first gateway used to indicate the first gateway is acquired according to the packet attribute information and the corresponding relationship between the packet attribute information and the gateway. indication information, and send the to-be-processed message to the first gateway according to the first gateway indication information, according to the preset correspondence between the message attribute information and the gateway, and obtain the first A gateway indication information is convenient for managing which gateway the first gateway is specifically.

在本公开一实现方式中,向第一网关发送待处理报文之前,所述方法还包括如下步骤:In an implementation manner of the present disclosure, before sending the to-be-processed message to the first gateway, the method further includes the following steps:

获取用于指示第一网关的第一网关指示信息,第一网关为交换机对应的多个网关中的任一网关;acquiring first gateway indication information for indicating a first gateway, where the first gateway is any one of multiple gateways corresponding to the switch;

向第一网关发送待处理报文,可以通过如下步骤实现:Sending the pending packet to the first gateway can be implemented by the following steps:

根据第一网关指示信息向第一网关发送待处理报文。Send the to-be-processed packet to the first gateway according to the first gateway indication information.

根据本公开实施例提供的技术方案,通过获取用于指示第一网关的第一网关指示信息,并根据第一网关指示信息向第一网关发送待处理报文,其中由于第一网关为交换机对应的多个网关中的任一网关,因此可以无需管理该第一网关具体为那个网关,减少了所消耗的处理资源。According to the technical solutions provided by the embodiments of the present disclosure, the first gateway indication information used to indicate the first gateway is obtained, and the to-be-processed packet is sent to the first gateway according to the first gateway indication information, wherein because the first gateway corresponds to the switch Therefore, there is no need to manage which gateway the first gateway is specifically, which reduces the consumed processing resources.

在本公开一实现方式中,向交换机发送第二网关指示信息以及待处理报文之前,所述方法还包括如下步骤:In an implementation manner of the present disclosure, before sending the second gateway indication information and the to-be-processed message to the switch, the method further includes the following steps:

对第二网关指示信息以及待处理报文进行封装,以获取第一封装报文;Encapsulating the indication information of the second gateway and the to-be-processed message to obtain the first encapsulated message;

向交换机发送第二网关指示信息以及待处理报文,可以通过如下步骤实现:Sending the second gateway indication information and the message to be processed to the switch can be implemented by the following steps:

向交换机发送第一封装报文:Send the first encapsulated packet to the switch:

接收第二网关指示信息以及待处理报文,可以通过如下步骤实现:Receiving the indication information of the second gateway and the to-be-processed message can be implemented by the following steps:

接收第一封装报文。A first encapsulated packet is received.

在本公开一实施方式中,对第二网关指示信息以及待处理报文进行封装,可以理解为,将第二网关指示信息以及待处理报文封装在同一个报文即第一封装报文中,示例性的,可以使第二网关指示信息被封装在第一封装报文的报头,并使待处理报文被封装在第一封装报文的数据负载部分。In an embodiment of the present disclosure, encapsulating the second gateway indication information and the to-be-processed message can be understood as encapsulating the second gateway indication information and the to-be-processed message in the same message, that is, the first encapsulated message , Exemplarily, the indication information of the second gateway may be encapsulated in the header of the first encapsulated packet, and the to-be-processed packet may be encapsulated in the data load part of the first encapsulated packet.

根据本公开实施例提供的技术方案,通过使第一网关对第二网关指示信息以及待处理报文进行封装,以获取第一封装报文,并向交换机发送第一封装报文,使交换机可以接收第一封装报文,可以便于对第一封装报文进行发送。According to the technical solutions provided by the embodiments of the present disclosure, by causing the first gateway to encapsulate the indication information of the second gateway and the to-be-processed message, the first encapsulated message is obtained, and the first encapsulated message is sent to the switch, so that the switch can Receiving the first encapsulated packet may facilitate sending the first encapsulated packet.

在本公开一实现方式中,源对象与网关之间的对应关系包括源对象与导流IP地址之间的对应关系,导流IP地址与源对象对应的网关的IP地址属于同一网段,第二网关指示信息包括第二导流IP地址;In an implementation of the present disclosure, the correspondence between the source object and the gateway includes the correspondence between the source object and the diversion IP address, the diversion IP address and the IP address of the gateway corresponding to the source object belong to the same network segment, and the first The second gateway indication information includes the second diversion IP address;

根据第二网关指示信息向第二网关转发待处理报文,可以通过如下步骤实现:Forwarding the to-be-processed packet to the second gateway according to the indication information of the second gateway can be implemented by the following steps:

根据第二导流IP地址以及路由表,获取用于指示IP地址与第二导流IP地址属于同一网段的第二网关的第二网关指示信息,并根据第二网关指示信息向第二网关转发待处理报文。According to the second diversion IP address and the routing table, obtain the second gateway indication information for indicating the second gateway whose IP address and the second diversion IP address belong to the same network segment, and report to the second gateway according to the second gateway indication information Forward pending packets.

在本公开一实施方式中,源对象与导流IP地址之间的对应关系,可以理解为用于指示与每个源对象对应的导流IP地址。源对象与导流IP地址之间的对应关系,可以为数据库也可以为表单,本公开不对源对象与导流IP地址之间的对应关系的实现方式进行具体限定。In an embodiment of the present disclosure, the correspondence between the source object and the diversion IP address can be understood as indicating the diversion IP address corresponding to each source object. The correspondence between the source object and the diversion IP address may be a database or a form, and the present disclosure does not specifically limit the implementation of the correspondence between the source object and the diversion IP address.

在本公开一实施方式中,路由表,可以理解为用于至少一个网关与网关的IP地址之间的对应关系,其中,网关可以周期性向交换机发送路由更新信息,交换机可以根据路由更新信息对路由表进行更新,以确保路由表中的网关为最近一段时间内正常工作的网关。In an embodiment of the present disclosure, the routing table can be understood as a correspondence between at least one gateway and the IP addresses of the gateways, wherein the gateway can periodically send routing update information to the switch, and the switch can update the routing information according to the routing update information. The table is updated to ensure that the gateway in the routing table is the one that has been working properly for the most recent period.

在本公开一实施方式中,根据第二导流IP地址以及路由表,获取第二网关指示信息,可以理解为根据第二导流IP地址在路由表中进行查询,以确定与该第二导流IP地址属于同一网段的网关及第二网关的IP地址,并生成用于指示该第二网关的第二网关指示信息。In an embodiment of the present disclosure, obtaining the indication information of the second gateway according to the second diversion IP address and the routing table can be understood as querying the routing table according to the second diversion IP address to determine the connection with the second diversion IP address. The flow IP address belongs to the gateway of the same network segment and the IP address of the second gateway, and second gateway indication information for indicating the second gateway is generated.

根据本公开实施例提供的技术方案,通过将源对象与网关之间的对应关系限定为包括源对象与导流IP地址之间的对应关系,将导流IP地址限定为与源对象对应的网关的IP地址属于同一网段,将第二网关指示信息限定为包括第二导流IP地址,并通过根据第二导流IP地址以及路由表,获取用于指示IP地址与第二导流IP地址属于同一网段的第二网关的第二网关指示信息,并根据第二网关指示信息向第二网关转发待处理报文,可以便于对第二网关具体为哪一个网关进行管理。According to the technical solutions provided by the embodiments of the present disclosure, by defining the correspondence between the source object and the gateway to include the correspondence between the source object and the diversion IP address, the diversion IP address is limited to the gateway corresponding to the source object The IP address belongs to the same network segment, the second gateway indication information is limited to include the second diversion IP address, and by obtaining the indication IP address and the second diversion IP address according to the second diversion IP address and the routing table The second gateway indication information of the second gateway belonging to the same network segment, and forwarding the to-be-processed message to the second gateway according to the second gateway indication information, can facilitate the management of which gateway the second gateway is.

在本公开一实现方式中,根据第二导流IP地址以及路由表,获取用于指示IP地址与第二导流IP地址属于同一网段的第二网关的第二网关指示信息,可以通过如下步骤实现:In an implementation manner of the present disclosure, according to the second diversion IP address and the routing table, the second gateway indication information for indicating the second gateway whose IP address and the second diversion IP address belong to the same network segment can be obtained through the following Steps to achieve:

根据第二导流IP地址以及路由表获取第二导流IP地址所属的多个网段,并获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息,第一网段为多个网段中子网掩码最长的网段。Acquire multiple network segments to which the second diversion IP address belongs according to the second diversion IP address and the routing table, and acquire second gateway indication information for indicating that the IP address belongs to the second gateway of the first network segment. The segment is the network segment with the longest subnet mask among multiple network segments.

根据本公开实施例提供的技术方案,通过根据第二导流IP地址以及路由表获取第二导流IP地址所属的多个网段,并获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息,其中由于第一网段为多个网段中子网掩码最长的网段,因此可以使第二网关指示信息所指示的第二网关唯一,确保不会由多个网关转发该待处理报文,避免进行重复转发,减少了所消耗的处理资源。According to the technical solutions provided by the embodiments of the present disclosure, the multiple network segments to which the second diversion IP address belongs are obtained according to the second diversion IP address and the routing table, and the second diversion IP address used to indicate that the IP address belongs to the first network segment is obtained. The second gateway indication information of the gateway, wherein since the first network segment is the network segment with the longest subnet mask among the multiple network segments, the second gateway indicated by the second gateway indication information can be unique to ensure that no Multiple gateways forward the to-be-processed message to avoid repeated forwarding and reduce the consumption of processing resources.

在本公开一实现方式中,获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息,可以通过如下步骤实现:In an implementation manner of the present disclosure, obtaining the second gateway indication information for indicating that the IP address belongs to the second gateway of the first network segment can be achieved by the following steps:

响应于根据路由表确定至少一个网关的IP地址属于第一网段,获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息;In response to determining that the IP address of the at least one gateway belongs to the first network segment according to the routing table, acquiring second gateway indication information for indicating that the IP address belongs to the second gateway of the first network segment;

所述方法还包括如下步骤:The method also includes the steps of:

响应于根据路由表确定任一网关的IP地址均不属于第一网段,且至少一个网关的IP地址属于第二网段,获取用于指示IP地址属于第二网段的第二网关的第二网关指示信息,第二网段为多个网段中子网掩码次长的网段。In response to determining according to the routing table that none of the IP addresses of the gateways belong to the first network segment, and that the IP address of at least one gateway belongs to the second network segment, obtain the second gateway used to indicate that the IP address belongs to the second network segment. Second gateway indication information, the second network segment is the network segment with the second longest subnet mask among the multiple network segments.

在本公开一实施方式中,根据路由表确定任一网关的IP地址均不属于第一网段,可以理解为IP地址均属于第一网段的一个或多个网关可能出现了故障,该网关未能向路由表发送相应的路由更新信息,使交换机在根据收到的路由更新信息对路由表进行更新后,路由表未包括属于第一网段的一个或多个网关的IP地址。In an embodiment of the present disclosure, it is determined according to the routing table that the IP address of any gateway does not belong to the first network segment. It can be understood that one or more gateways whose IP addresses belong to the first network segment Failing to send the corresponding routing update information to the routing table, so that after the switch updates the routing table according to the received routing update information, the routing table does not include the IP addresses of one or more gateways belonging to the first network segment.

图3示出根据本公开一实施方式的报文处理系统的示意性结构框图,如图3所述,报文处理系统包括交换机101以及至少网关112、网关122、网关132以及网关142。其中,网关112的IP地址所属的网段包括192.168.0.0/26、192.168.0.0/25、192.168.0.0/24,网关122的IP地址所属的网段包括192.168.0.64/26、192.168.0.0/25、192.168.0.0/24,网关132的IP地址所属的网段包括192.168.0.128/26、192.168.0.128/25、192.168.0.0/24,网关142的IP地址所属的网段包括192.168.0.196/26、192.168.0.128/25、192.168.0.0/24。导流IP地址为192.168.0.1,则该导流IP地址所属的多个网段中子网掩码最长的第一导流网段为192.168.0.0/26。其中,当因网关112出现故障而导致根据路由表确定任一网关的IP地址均不属于192.168.0.0/26时,可以确定则该导流IP地址所属的多个网段中子网掩码次长的网段即192.168.0.0/25为第二网段,并获取用于指示IP地址属于192.168.0.0/25的第二网关即网关122的第二网关指示信息。FIG. 3 shows a schematic structural block diagram of a message processing system according to an embodiment of the present disclosure. As shown in FIG. 3 , the message processing system includes a switch 101 and at least a gateway 112 , a gateway 122 , a gateway 132 and a gateway 142 . The network segment to which the IP address of the gateway 112 belongs includes 192.168.0.0/26, 192.168.0.0/25, 192.168.0.0/24, and the network segment to which the IP address of the gateway 122 belongs includes 192.168.0.64/26, 192.168.0.0/ 25, 192.168.0.0/24, the network segment to which the IP address of gateway 132 belongs includes 192.168.0.128/26, 192.168.0.128/25, 192.168.0.0/24, and the network segment to which the IP address of gateway 142 belongs includes 192.168.0.196/ 26, 192.168.0.128/25, 192.168.0.0/24. If the diversion IP address is 192.168.0.1, the first diversion network segment with the longest subnet mask among the multiple network segments to which the diversion IP address belongs is 192.168.0.0/26. Among them, when it is determined according to the routing table that the IP address of any gateway does not belong to 192.168.0.0/26 due to the failure of the gateway 112, it can be determined that the subnet mask of the multiple network segments to which the diversion IP address belongs is the second The long network segment, that is, 192.168.0.0/25 is the second network segment, and second gateway indication information for indicating that the second gateway whose IP address belongs to 192.168.0.0/25, that is, the gateway 122, is obtained.

根据本公开实施例提供的技术方案,通过响应于根据路由表确定至少一个网关的IP地址属于第一网段,并获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息,其中在根据路由表确定至少一个网关的IP地址属于第一网段,可以理解为IP地址被设置为属于第一网段的至少一个网关未出现故障,从而可以确保用于转发待处理报文的第二网关为未出现故障的网关;通过响应于根据路由表确定任一网关的IP地址均不属于第一网段,且至少一个网关的IP地址属于多个网段中子网掩码次长的第二网段,获取用于指示IP地址属于第二网段的第二网关的第二网关指示信息,其中在根据路由表确定任一网关的IP地址均不属于第一网段时,可以理解为IP地址被设置为属于第一网段的网关可能出现了故障,因此上述方案可以确保在部分网关出现故障时,也可以由相应的网关即IP地址属于第二网段的网关作为第二网关对待处理报文进行转发,提高了对待处理报文进行转发的可靠性。According to the technical solutions provided by the embodiments of the present disclosure, in response to determining that the IP address of at least one gateway belongs to the first network segment according to the routing table, and obtaining a second gateway indication for indicating that the IP address belongs to the second gateway of the first network segment information, in which it is determined according to the routing table that the IP address of at least one gateway belongs to the first network segment. The second gateway of the text is a gateway that does not fail; by responding to the routing table, it is determined that the IP address of any gateway does not belong to the first network segment, and the IP address of at least one gateway belongs to the subnet mask in the multiple network segments The second network segment with the second longest, obtains the second gateway indication information used to indicate that the IP address belongs to the second gateway of the second network segment, wherein when it is determined according to the routing table that the IP address of any gateway does not belong to the first network segment , it can be understood that the gateway whose IP address is set to belong to the first network segment may be faulty, so the above solution can ensure that when some gateways fail, the corresponding gateway, that is, the gateway whose IP address belongs to the second network segment, can also be used as the corresponding gateway. The second gateway forwards the to-be-processed message, which improves the reliability of forwarding the to-be-processed message.

在本公开一实现方式中,根据第二导流IP地址以及路由表,获取用于指示IP地址与第二导流IP地址属于同一网段的第二网关的第二网关指示信息,可以通过如下步骤实现:In an implementation manner of the present disclosure, according to the second diversion IP address and the routing table, the second gateway indication information for indicating the second gateway whose IP address and the second diversion IP address belong to the same network segment can be obtained through the following Steps to achieve:

根据第二导流IP地址以及路由表获取第二导流IP地址所属的多个网段,并获取用于指示IP地址属于第三网段的第二网关的第二网关指示信息,第三网段为多个网段中路由路径长度最短的网段。Acquire multiple network segments to which the second diversion IP address belongs according to the second diversion IP address and the routing table, and acquire second gateway indication information for indicating that the IP address belongs to the second gateway of the third network segment, and the third network A segment is the network segment with the shortest routing path length among multiple network segments.

在本公开一实施方式中,多个网段中路由路径长度最短的网段,可以理解在该多个网段中,与交换机之间的路由路径长度最短的网段。In an embodiment of the present disclosure, the network segment with the shortest routing path length among the multiple network segments can be understood as the network segment with the shortest routing path length among the multiple network segments.

根据本公开实施例提供的技术方案,通过根据第二导流IP地址以及路由表获取第二导流IP地址所属的多个网段,并获取用于指示IP地址属于第三网段的第二网关的第二网关指示信息,其中由于第三网段为多个网段中路由路径长度最短的网段,因此可以使第二网关指示信息所指示的第二网关唯一,确保不会由多个网关转发该待处理报文,避免进行重复转发,减少了所消耗的处理资源。According to the technical solutions provided by the embodiments of the present disclosure, the multiple network segments to which the second diversion IP address belongs are obtained according to the second diversion IP address and the routing table, and the second diversion IP address used to indicate that the IP address belongs to the third network segment is obtained. The second gateway indication information of the gateway, wherein since the third network segment is the network segment with the shortest routing path length among the multiple network segments, the second gateway indicated by the second gateway indication information can be unique to ensure that multiple network segments cannot be used by multiple network segments. The gateway forwards the to-be-processed message to avoid repeated forwarding, thereby reducing the processing resources consumed.

在本公开一实现方式中,获取用于指示IP地址属于第三网段的第二网关的第二网关指示信息,可以通过如下步骤实现:In an implementation manner of the present disclosure, acquiring the second gateway indication information for indicating that the IP address belongs to the second gateway of the third network segment may be implemented by the following steps:

响应于根据路由表确定第三网段内包括至少一个网关的IP地址,获取用于指示第三网段内的第二网关的第二网关指示信息;In response to determining according to the routing table that the IP address of the at least one gateway is included in the third network segment, acquiring second gateway indication information for indicating the second gateway in the third network segment;

所述方法还包括:The method also includes:

响应于根据路由表确定任一网关的IP地址均不属于第三网段,且至少一个网关的IP地址属于第四网段,获取用于指示IP地址属于第四网段的第二网关的第二网关指示信息,第四网段为多个网段中路径长度次短的网段。In response to determining according to the routing table that none of the IP addresses of the gateways belong to the third network segment, and that the IP address of at least one gateway belongs to the fourth network segment, obtain the second gateway used to indicate that the IP address belongs to the fourth network segment. Second gateway indication information, the fourth network segment is the network segment with the next shortest path length among the multiple network segments.

在本公开一实施方式中,根据路由表确定任一网关的IP地址均不属于第三网段,可以理解为IP地址均属于第三网段的一个或多个网关可能出现了故障,该网关未能向路由表发送相应的路由更新信息,使交换机在根据收到的路由更新信息对路由表进行更新后,路由表未包括属于第三网段的一个或多个网关的IP地址。In an embodiment of the present disclosure, it is determined according to the routing table that the IP address of any gateway does not belong to the third network segment. It can be understood that one or more gateways whose IP addresses belong to the third network segment Failing to send the corresponding routing update information to the routing table, so that after the switch updates the routing table according to the received routing update information, the routing table does not include the IP addresses of one or more gateways belonging to the third network segment.

根据本公开实施例提供的技术方案,响应于根据路由表确定第三网段内包括至少一个网关的IP地址,获取用于指示第三网段内的第二网关的第二网关指示信息,其中在根据路由表确定至少一个网关的IP地址属于第三网段,可以理解为IP地址被设置为属于第三网段的至少一个网关未出现故障,从而可以确保用于转发待处理报文的第二网关为未出现故障的网关;通过响应于根据路由表确定任一网关的IP地址均不属于第三网段,且至少一个网关的IP地址属于第四网段,获取用于指示IP地址属于第四网段的第二网关的第二网关指示信息,其中在根据路由表确定任一网关的IP地址均不属于第三网段时,可以理解为IP地址被设置为属于第三网段的网关可能出现了故障,因此上述方案可以确保在部分网关出现故障时,也可以由相应的网关即IP地址属于第四网段的网关作为第二网关对待处理报文进行转发,提高了对待处理报文进行转发的可靠性。According to the technical solutions provided by the embodiments of the present disclosure, in response to determining the IP address of at least one gateway in the third network segment according to the routing table, second gateway indication information for indicating the second gateway in the third network segment is obtained, wherein When it is determined according to the routing table that the IP address of at least one gateway belongs to the third network segment, it can be understood that at least one gateway whose IP address is set to belong to the third network segment is not faulty, so as to ensure that the first gateway for forwarding the to-be-processed packet is not faulty. The second gateway is a gateway that has not failed; in response to determining according to the routing table that none of the IP addresses of the gateways belong to the third network segment, and that the IP address of at least one gateway belongs to the fourth network segment, the information used to indicate that the IP address belongs to the third network segment is obtained. The second gateway indication information of the second gateway of the fourth network segment, wherein when it is determined according to the routing table that the IP address of any gateway does not belong to the third network segment, it can be understood that the IP address is set to belong to the third network segment. The gateway may be faulty, so the above solution can ensure that when some gateways are faulty, the corresponding gateway, that is, the gateway whose IP address belongs to the fourth network segment, can be used as the second gateway to forward the to-be-processed packets, which improves the number of to-be-processed packets. The reliability of the forwarding of the text.

图4示出根据本公开一实施方式的控制方法的流程图,该方法应用于图1中所示的网关。如图4所示,控制方法包括步骤S201-S203。FIG. 4 shows a flowchart of a control method according to an embodiment of the present disclosure, which is applied to the gateway shown in FIG. 1 . As shown in FIG. 4 , the control method includes steps S201-S203.

在步骤S201中,接收交换机发送的第一待处理报文,并获取第一待处理报文的源对象标识。In step S201, a first to-be-processed packet sent by the switch is received, and a source object identifier of the first to-be-processed packet is acquired.

在步骤S202中,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及第一待处理报文。In step S202, the second gateway indication information for indicating the second gateway is obtained according to the source object identifier and the corresponding relationship between the source object and the gateway, and the second gateway indication information and the first to-be-processed message are sent to the switch.

其中,第二网关的带宽满足与第二网关对应的源对象的带宽需求;Wherein, the bandwidth of the second gateway meets the bandwidth requirement of the source object corresponding to the second gateway;

在步骤S203中,接收交换机发送的第二待处理报文,并转发第二待处理报文。In step S203, the second to-be-processed packet sent by the switch is received, and the second to-be-processed packet is forwarded.

在本公开一实施方式中,第一待处理报文可以理解为源对象所传输的报文,其中源对象可以理解为使用相应的网络服务产品的租户或服务。其中,该相应的网络服务产品可以为租户或服务所购买的网络服务产品。In an embodiment of the present disclosure, the first packet to be processed may be understood as a packet transmitted by a source object, where the source object may be understood as a tenant or service using a corresponding network service product. The corresponding network service product may be a network service product purchased by a tenant or a service.

在本公开一实施方式中,获取第一待处理报文,可以理解为接收其他装置或系统发送的第一待处理报文,也可以为读写事先获取的待处理报文。In an embodiment of the present disclosure, acquiring the first to-be-processed message may be understood as receiving the first to-be-processed message sent by other devices or systems, or may be to read and write the to-be-processed message acquired in advance.

在本公开一实施方式中,第二网关可以理解为属于与交换机对应的网关,示例性的,当交换机为上联交换机集群时,第二网关可以为部署在上联交换机集群下的网关。In an embodiment of the present disclosure, the second gateway may be understood as belonging to a gateway corresponding to a switch. Exemplarily, when the switch is an uplink switch cluster, the second gateway may be a gateway deployed under the uplink switch cluster.

在本公开一实施方式中,第一待处理报文的源对象标识,可以理解为用于指示传输该第一待处理报文的源对象。获取第一待处理报文的源对象标识,可以理解为从第一待处理报文中的指定字段中读取该源对象标识。In an embodiment of the present disclosure, the source object identifier of the first to-be-processed packet may be understood to be used to indicate a source object that transmits the first to-be-processed packet. Obtaining the source object identifier of the first packet to be processed may be understood as reading the source object identifier from a specified field in the first packet to be processed.

在本公开一实施方式中,源对象与网关之间的对应关系,可以理解为用于指示至少一个网关中,与每个网关对应的源对象,其中每个网关可以对应一个或多个源对象。对象与网关之间的对应关系,可以为数据库,也可以为表单,本公开不对对象与网关之间的对应关系的实现方式进行具体限定。In an embodiment of the present disclosure, the correspondence between source objects and gateways can be understood as indicating a source object corresponding to each gateway in at least one gateway, where each gateway may correspond to one or more source objects . The corresponding relationship between the object and the gateway may be a database or a form, and the present disclosure does not specifically limit the implementation of the corresponding relationship between the object and the gateway.

在本公开一实施方式中,根据源对象标识以及源对象与网关之间的对应关系获取第二网关指示信息,可以理解为在源对象与网关之间的对应关系中查找与该源对象标识所指示的源对象对应的网关即第二网关,并生成用于指示该第二网关的第二网关指示信息。In an embodiment of the present disclosure, obtaining the second gateway indication information according to the source object identifier and the corresponding relationship between the source object and the gateway can be understood as searching for the source object identifier in the corresponding relationship between the source object and the gateway. The gateway corresponding to the indicated source object is the second gateway, and second gateway indication information for indicating the second gateway is generated.

在本公开一实施方式中,第二网关的带宽满足与第二网关对应的源对象的带宽需求,可以理解为第二网关的带宽,大于或等于该第二网关对应的一个或多个源对象所使用或购买的网络服务产品的总带宽。In an embodiment of the present disclosure, the bandwidth of the second gateway meets the bandwidth requirement of the source object corresponding to the second gateway, which can be understood as the bandwidth of the second gateway, which is greater than or equal to one or more source objects corresponding to the second gateway The total bandwidth of the network service product used or purchased.

在本公开一实施方式中,第二待处理报文可以理解为源对象所传输的报文,其中,根据第二待处理报文的源对象标示以及源对象与网关之间的对应关系,可以获取用于指示网关自身的网关指示信息。In an embodiment of the present disclosure, the second packet to be processed may be understood as a packet transmitted by the source object, wherein, according to the source object identifier of the second packet to be processed and the corresponding relationship between the source object and the gateway, the Get the gateway indication information used to indicate the gateway itself.

本公开实施例提供的技术方案应用于网关,根据该技术方案,通过接收交换机发送的第一待处理报文,并获取第一待处理报文的源对象标识;根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及第一待处理报文;接收交换机发送的第二待处理报文,并转发第二待处理报文。其中,考虑到用于转发待处理报文的第二网关的带宽满足与第二网关对应的源对象的带宽需求,因此即使第二网关对应的源对象所传输的报文所属的数据流较少,也不会对第二网关转发报文的带宽,即用于转发第二网关对应的源对象所传输报文的总带宽产生任何影响,即确保相应网关转发报文的带宽能够满足该网关对应的源对象的带宽需求,确保源对象的报文可以被及时转发,改善了用户体验。The technical solution provided by the embodiment of the present disclosure is applied to a gateway. According to the technical solution, the first message to be processed sent by the switch is received, and the source object identifier of the first message to be processed is obtained; according to the source object identifier and the source object and the source object The correspondence between gateways acquires the second gateway indication information used to indicate the second gateway, and sends the second gateway indication information and the first to-be-processed packet to the switch; receives the second to-be-processed packet sent by the switch, and forwards it The second to-be-processed message. Wherein, considering that the bandwidth of the second gateway for forwarding the to-be-processed message meets the bandwidth requirement of the source object corresponding to the second gateway, even if the message transmitted by the source object corresponding to the second gateway belongs to fewer data streams , it will not have any impact on the bandwidth of the packets forwarded by the second gateway, that is, the total bandwidth used to forward the packets transmitted by the source object corresponding to the second gateway, that is, to ensure that the bandwidth of the packets forwarded by the corresponding gateway can meet the corresponding bandwidth of the gateway. The bandwidth requirements of the source object can be determined to ensure that the packets of the source object can be forwarded in time, which improves the user experience.

以下参照图1描述根据本公开一实施方式的报文处理系统,如图1所示,所述报文处理系统包括交换机101以及至少一个网关102,交换机101用于实现图1对应的实施例的方法步骤,网关102用于实现图3对应的实施例的方法步骤。The following describes a message processing system according to an embodiment of the present disclosure with reference to FIG. 1 . As shown in FIG. 1 , the message processing system includes a switch 101 and at least one gateway 102 . The switch 101 is used to implement the For the method steps, the gateway 102 is configured to implement the method steps of the embodiment corresponding to FIG. 3 .

本公开实施例提供的技术方案,通过使交换机获取待处理报文,并向第一网关发送待处理报文,第一网关用于获取待处理报文的源对象标识,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及待处理报文;由交换机接收第二网关指示信息以及待处理报文,并根据第二网关指示信息向第二网关转发待处理报文,第二网关用于转发待处理报文。其中,考虑到用于转发待处理报文的第二网关的带宽满足与第二网关对应的源对象的带宽需求,因此即使第二网关对应的源对象所传输的报文所属的数据流较少,也不会对第二网关转发报文的带宽,即用于转发第二网关对应的源对象所传输报文的总带宽产生任何影响,即确保相应网关转发报文的带宽能够满足该网关对应的源对象的带宽需求,确保源对象的报文可以被及时转发,改善了用户体验。In the technical solution provided by the embodiments of the present disclosure, the switch acquires the to-be-processed packet and sends the to-be-processed packet to the first gateway, and the first gateway is used to acquire the source object identifier of the to-be-processed packet, according to the source object identifier and the source object identifier. The correspondence between the object and the gateway acquires the second gateway indication information used to indicate the second gateway, and sends the second gateway indication information and the to-be-processed message to the switch; the switch receives the second gateway indication information and the to-be-processed message , and forward the to-be-processed packet to the second gateway according to the indication information of the second gateway, and the second gateway is used to forward the to-be-processed packet. Wherein, considering that the bandwidth of the second gateway for forwarding the to-be-processed message meets the bandwidth requirement of the source object corresponding to the second gateway, even if the message transmitted by the source object corresponding to the second gateway belongs to fewer data streams , it will not have any impact on the bandwidth of the packets forwarded by the second gateway, that is, the total bandwidth used to forward the packets transmitted by the source object corresponding to the second gateway, that is, to ensure that the bandwidth of the packets forwarded by the corresponding gateway can meet the corresponding bandwidth of the gateway. The bandwidth requirements of the source object can be determined to ensure that the packets of the source object can be forwarded in time, which improves the user experience.

以下参照图5描述根据本公开一实施方式的控制装置。图5示出根据本公开一实施方式的控制装置的结构框图。A control device according to an embodiment of the present disclosure will be described below with reference to FIG. 5 . FIG. 5 shows a structural block diagram of a control device according to an embodiment of the present disclosure.

如图5所示,控制装置200包括:As shown in FIG. 5, the control device 200 includes:

第一报文发送模块201,被配置为获取待处理报文,并向第一网关发送待处理报文,第一网关用于获取待处理报文的源对象标识,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及待处理报文,第二网关的带宽满足与第二网关对应的源对象的带宽需求;The first message sending module 201 is configured to obtain the to-be-processed message and send the to-be-processed message to the first gateway, where the first gateway is used to obtain the source object identifier of the to-be-processed message, according to the source object identifier and the source object Correspondence with the gateway Obtain the second gateway indication information used to indicate the second gateway, and send the second gateway indication information and the message to be processed to the switch, the bandwidth of the second gateway satisfies the source object corresponding to the second gateway bandwidth requirements;

第一报文接收模块202,被配置为接收第二网关指示信息以及待处理报文,并根据第二网关指示信息向第二网关转发待处理报文,第二网关用于转发待处理报文。The first message receiving module 202 is configured to receive the indication information of the second gateway and the to-be-processed message, and forward the to-be-processed message to the second gateway according to the indication information of the second gateway, and the second gateway is configured to forward the to-be-processed message .

根据本公开实施例提供的技术方案,通过获取待处理报文,并向第一网关发送待处理报文,第一网关用于获取待处理报文的源对象标识,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及待处理报文;接收第二网关指示信息以及待处理报文,并根据第二网关指示信息向第二网关转发待处理报文,第二网关用于转发待处理报文。其中,考虑到用于转发待处理报文的第二网关的带宽满足与第二网关对应的源对象的带宽需求,因此即使第二网关对应的源对象所传输的报文所属的数据流较少,也不会对第二网关转发报文的带宽,即用于转发第二网关对应的源对象所传输报文的总带宽产生任何影响,即确保相应网关转发报文的带宽能够满足该网关对应的源对象的带宽需求,确保源对象的报文可以被及时转发,改善了用户体验。According to the technical solutions provided by the embodiments of the present disclosure, by acquiring the to-be-processed packet and sending the to-be-processed packet to the first gateway, the first gateway is used to acquire the source object identifier of the to-be-processed packet, according to the source object identifier and the source object identifier. Correspondence with the gateway Obtain the second gateway indication information for indicating the second gateway, and send the second gateway indication information and the message to be processed to the switch; receive the second gateway indication information and the message to be processed, and according to the The second gateway instructs the information to forward the to-be-processed packet to the second gateway, and the second gateway is configured to forward the to-be-processed packet. Wherein, considering that the bandwidth of the second gateway for forwarding the to-be-processed message meets the bandwidth requirement of the source object corresponding to the second gateway, even if the message transmitted by the source object corresponding to the second gateway belongs to fewer data streams , it will not have any impact on the bandwidth of the packets forwarded by the second gateway, that is, the total bandwidth used to forward the packets transmitted by the source object corresponding to the second gateway, that is, to ensure that the bandwidth of the packets forwarded by the corresponding gateway can meet the corresponding bandwidth of the gateway. The bandwidth requirements of the source object can be determined to ensure that the packets of the source object can be forwarded in time, which improves the user experience.

本领域技术人员可以理解,参照图5描述的技术方案的可以与参照上述图2对应的实施例结合,从而具备图2对应的实施例所实现的技术效果。具体内容可以参照图2对应的实施例的描述,其具体内容在此不再赘述。Those skilled in the art can understand that the technical solution described with reference to FIG. 5 can be combined with the embodiment corresponding to FIG. 2 above, so as to have the technical effect achieved by the embodiment corresponding to FIG. 2 . For specific content, reference may be made to the description of the embodiment corresponding to FIG. 2 , and the specific content thereof will not be repeated here.

以下参照图6描述根据本公开一实施方式的控制装置。图6示出根据本公开一实施方式的控制装置的结构框图。A control device according to an embodiment of the present disclosure will be described below with reference to FIG. 6 . FIG. 6 shows a structural block diagram of a control device according to an embodiment of the present disclosure.

如图6所示,控制装置300包括:As shown in FIG. 6, the control device 300 includes:

第二报文接收模块301,被配置为接收交换机发送的第一待处理报文,并获取第一待处理报文的源对象标识;The second packet receiving module 301 is configured to receive the first to-be-processed packet sent by the switch, and to acquire the source object identifier of the first to-be-processed packet;

第二报文发送模块302,被配置为根据所述源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向所述交换机发送所述第二网关指示信息以及所述第一待处理报文,所述第二网关的带宽满足与所述第二网关对应的源对象的带宽需求;The second packet sending module 302 is configured to obtain second gateway indication information for indicating the second gateway according to the source object identifier and the corresponding relationship between the source object and the gateway, and send the second gateway indication information to the switch. Two gateway indication information and the first message to be processed, the bandwidth of the second gateway meets the bandwidth requirement of the source object corresponding to the second gateway;

第三报文发送模块303,被配置为接收所述交换机发送的第二待处理报文,并转发所述第二待处理报文。The third packet sending module 303 is configured to receive the second to-be-processed packet sent by the switch, and to forward the second to-be-processed packet.

根据本公开实施例提供的技术方案,通过接收交换机发送的第一待处理报文,并获取第一待处理报文的源对象标识;根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及第一待处理报文;接收交换机发送的第二待处理报文,并转发第二待处理报文。其中,考虑到用于转发待处理报文的第二网关的带宽满足与第二网关对应的源对象的带宽需求,因此即使第二网关对应的源对象所传输的报文所属的数据流较少,也不会对第二网关转发报文的带宽,即用于转发第二网关对应的源对象所传输报文的总带宽产生任何影响,即确保相应网关转发报文的带宽能够满足该网关对应的源对象的带宽需求,确保源对象的报文可以被及时转发,改善了用户体验。According to the technical solutions provided by the embodiments of the present disclosure, the first to-be-processed packet sent by the switch is received, and the source object identifier of the first to-be-processed packet is acquired; and the source object identifier and the corresponding relationship between the source object and the gateway are acquired. Used to indicate the second gateway indication information of the second gateway, and send the second gateway indication information and the first to-be-processed message to the switch; receive the second to-be-processed message sent by the switch, and forward the second to-be-processed message. Wherein, considering that the bandwidth of the second gateway for forwarding the to-be-processed message meets the bandwidth requirement of the source object corresponding to the second gateway, even if the message transmitted by the source object corresponding to the second gateway belongs to fewer data streams , it will not have any impact on the bandwidth of the packets forwarded by the second gateway, that is, the total bandwidth used to forward the packets transmitted by the source object corresponding to the second gateway, that is, to ensure that the bandwidth of the packets forwarded by the corresponding gateway can meet the corresponding bandwidth of the gateway. The bandwidth requirements of the source object can be determined to ensure that the packets of the source object can be forwarded in time, which improves the user experience.

图7示出根据本公开一实施方式的电子设备的结构框图。FIG. 7 shows a structural block diagram of an electronic device according to an embodiment of the present disclosure.

本公开实施方式还提供了一种电子设备,如图7所示,电子设备400包括至少一个处理器401。以及与至少一个处理器401通信连接的存储器402。其中,存储器402存储有可被至少一个处理器401执行的指令,指令可以被至少一个处理器401执行以实现以下步骤:An embodiment of the present disclosure further provides an electronic device. As shown in FIG. 7 , the electronic device 400 includes at least one processor 401 . and memory 402 in communication with at least one processor 401 . Wherein, the memory 402 stores instructions that can be executed by at least one processor 401, and the instructions can be executed by at least one processor 401 to implement the following steps:

第一方面,本公开实施例中提供了一种控制方法,所述方法应用于交换机,所述方法包括:In a first aspect, an embodiment of the present disclosure provides a control method, the method is applied to a switch, and the method includes:

获取待处理报文,并向第一网关发送待处理报文,第一网关用于获取待处理报文的源对象标识,根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及待处理报文,第二网关的带宽满足与第二网关对应的源对象的带宽需求;Acquire the to-be-processed message, and send the to-be-processed message to the first gateway, where the first gateway is used to obtain the source object identifier of the to-be-processed message, and obtains the source object identifier and the corresponding relationship between the source object and the gateway for indicating The second gateway indication information of the second gateway, and the second gateway indication information and the message to be processed are sent to the switch, and the bandwidth of the second gateway meets the bandwidth requirement of the source object corresponding to the second gateway;

接收第二网关指示信息以及待处理报文,并根据第二网关指示信息向第二网关转发待处理报文,第二网关用于转发待处理报文。Receive the indication information of the second gateway and the to-be-processed packet, and forward the to-be-processed packet to the second gateway according to the second gateway indication information, and the second gateway is used to forward the to-be-processed packet.

在本公开一实现方式中,向第一网关发送待处理报文之前,所述方法还包括:In an implementation manner of the present disclosure, before sending the to-be-processed message to the first gateway, the method further includes:

获取待处理报文的报文属性信息,报文属性信息包括待处理报文的源IP地址以及目的IP地址中至少一项;Obtain packet attribute information of the to-be-processed packet, where the packet attribute information includes at least one of a source IP address and a destination IP address of the to-be-processed packet;

根据报文属性信息以及报文属性信息与网关之间的对应关系获取用于指示第一网关的第一网关指示信息;Obtain first gateway indication information for indicating the first gateway according to the message attribute information and the correspondence between the message attribute information and the gateway;

向第一网关发送待处理报文,包括:Send the pending packet to the first gateway, including:

根据第一网关指示信息向第一网关发送待处理报文。Send the to-be-processed packet to the first gateway according to the first gateway indication information.

在本公开一实现方式中,向第一网关发送待处理报文之前,所述方法还包括:In an implementation manner of the present disclosure, before sending the to-be-processed message to the first gateway, the method further includes:

获取用于指示第一网关的第一网关指示信息,第一网关为交换机对应的多个网关中的任一网关;acquiring first gateway indication information for indicating a first gateway, where the first gateway is any one of multiple gateways corresponding to the switch;

向第一网关发送待处理报文,包括:Send the pending packet to the first gateway, including:

根据第一网关指示信息向第一网关发送待处理报文。Send the to-be-processed packet to the first gateway according to the first gateway indication information.

在本公开一实现方式中,向交换机发送第二网关指示信息以及待处理报文之前,所述方法还包括:In an implementation manner of the present disclosure, before sending the second gateway indication information and the to-be-processed message to the switch, the method further includes:

对第二网关指示信息以及待处理报文进行封装,以获取第一封装报文;Encapsulating the indication information of the second gateway and the to-be-processed message to obtain the first encapsulated message;

向交换机发送第二网关指示信息以及待处理报文,包括:Send the second gateway indication information and to-be-processed packets to the switch, including:

向交换机发送第一封装报文:Send the first encapsulated packet to the switch:

接收第二网关指示信息以及待处理报文,包括:Receiving the indication information of the second gateway and the message to be processed, including:

接收第一封装报文。A first encapsulated packet is received.

在本公开一实现方式中,源对象与网关之间的对应关系包括源对象与导流IP地址之间的对应关系,导流IP地址与源对象对应的网关的IP地址属于同一网段,第二网关指示信息包括第二导流IP地址;In an implementation of the present disclosure, the correspondence between the source object and the gateway includes the correspondence between the source object and the diversion IP address, the diversion IP address and the IP address of the gateway corresponding to the source object belong to the same network segment, and the first The second gateway indication information includes the second diversion IP address;

根据第二网关指示信息向第二网关转发待处理报文,包括:Forwarding the to-be-processed packet to the second gateway according to the second gateway indication information includes:

根据第二导流IP地址以及路由表,获取用于指示IP地址与第二导流IP地址属于同一网段的第二网关的第二网关指示信息,并根据第二网关指示信息向第二网关转发待处理报文。According to the second diversion IP address and the routing table, obtain the second gateway indication information for indicating the second gateway whose IP address and the second diversion IP address belong to the same network segment, and report to the second gateway according to the second gateway indication information Forward pending packets.

在本公开一实现方式中,根据第二导流IP地址以及路由表,获取用于指示IP地址与第二导流IP地址属于同一网段的第二网关的第二网关指示信息,包括:In an implementation manner of the present disclosure, according to the second diversion IP address and the routing table, the second gateway indication information for indicating the second gateway whose IP address and the second diversion IP address belong to the same network segment are obtained, including:

根据第二导流IP地址以及路由表获取第二导流IP地址所属的多个网段,并获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息,第一网段为多个网段中子网掩码最长的网段。Acquire multiple network segments to which the second diversion IP address belongs according to the second diversion IP address and the routing table, and acquire second gateway indication information for indicating that the IP address belongs to the second gateway of the first network segment. The segment is the network segment with the longest subnet mask among multiple network segments.

在本公开一实现方式中,获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息,包括:In an implementation manner of the present disclosure, acquiring second gateway indication information for indicating that the IP address belongs to the second gateway of the first network segment includes:

响应于根据路由表确定至少一个网关的IP地址属于第一网段,获取用于指示IP地址属于第一网段的第二网关的第二网关指示信息;In response to determining that the IP address of the at least one gateway belongs to the first network segment according to the routing table, acquiring second gateway indication information for indicating that the IP address belongs to the second gateway of the first network segment;

所述方法还包括:The method also includes:

响应于根据路由表确定任一网关的IP地址均不属于第一网段,且至少一个网关的IP地址属于第二网段,获取用于指示IP地址属于第二网段的第二网关的第二网关指示信息,第二网段为多个网段中子网掩码次长的网段。In response to determining according to the routing table that none of the IP addresses of the gateways belong to the first network segment, and that the IP address of at least one gateway belongs to the second network segment, obtain the second gateway used to indicate that the IP address belongs to the second network segment. Second gateway indication information, the second network segment is the network segment with the second longest subnet mask among the multiple network segments.

在本公开一实现方式中,根据第二导流IP地址以及路由表,获取用于指示IP地址与第二导流IP地址属于同一网段的第二网关的第二网关指示信息,包括:In an implementation manner of the present disclosure, according to the second diversion IP address and the routing table, the second gateway indication information for indicating the second gateway whose IP address and the second diversion IP address belong to the same network segment are obtained, including:

根据第二导流IP地址以及路由表获取第二导流IP地址所属的多个网段,并获取用于指示IP地址属于第三网段的第二网关的第二网关指示信息,第三网段为多个网段中路由路径长度最短的网段。Acquire multiple network segments to which the second diversion IP address belongs according to the second diversion IP address and the routing table, and acquire second gateway indication information for indicating that the IP address belongs to the second gateway of the third network segment, and the third network A segment is the network segment with the shortest routing path length among multiple network segments.

在本公开一实现方式中,获取用于指示IP地址属于第三网段的第二网关的第二网关指示信息,包括:In an implementation manner of the present disclosure, acquiring second gateway indication information for indicating that the IP address belongs to the second gateway of the third network segment includes:

响应于根据路由表确定第三网段内包括至少一个网关的IP地址,获取用于指示第三网段内的第二网关的第二网关指示信息;In response to determining according to the routing table that the IP address of the at least one gateway is included in the third network segment, acquiring second gateway indication information for indicating the second gateway in the third network segment;

所述方法还包括:The method also includes:

响应于根据路由表确定任一网关的IP地址均不属于第三网段,且至少一个网关的IP地址属于第四网段,获取用于指示IP地址属于第四网段的第二网关的第二网关指示信息,第四网段为多个网段中路径长度次短的网段。In response to determining according to the routing table that none of the IP addresses of the gateways belong to the third network segment, and that the IP address of at least one gateway belongs to the fourth network segment, obtain the second gateway used to indicate that the IP address belongs to the fourth network segment. Second gateway indication information, the fourth network segment is the network segment with the next shortest path length among the multiple network segments.

第二方面,本公开实施例中提供了一种控制方法,其中,该方法应用于网关,该方法包括:In a second aspect, an embodiment of the present disclosure provides a control method, wherein the method is applied to a gateway, and the method includes:

接收交换机发送的第一待处理报文,并获取第一待处理报文的源对象标识;receiving the first to-be-processed message sent by the switch, and acquiring the source object identifier of the first to-be-processed message;

根据源对象标识以及源对象与网关之间的对应关系获取用于指示第二网关的第二网关指示信息,并向交换机发送第二网关指示信息以及第一待处理报文,第二网关的带宽满足与第二网关对应的源对象的带宽需求;Obtain the second gateway indication information for indicating the second gateway according to the source object identifier and the correspondence between the source object and the gateway, and send the second gateway indication information and the first to-be-processed packet to the switch, the bandwidth of the second gateway satisfying the bandwidth requirement of the source object corresponding to the second gateway;

接收交换机发送的第二待处理报文,并转发第二待处理报文。The second to-be-processed packet sent by the switch is received, and the second to-be-processed packet is forwarded.

如图8所示,计算机系统500包括处理单元501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储部分508加载到随机访问存储器(RAM)503中的程序而执行上述附图所示的实施方式中的各种处理。在RAM503中,还存储有系统500操作所需的各种程序和数据。CPU501、ROM502以及RAM503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。As shown in FIG. 8, the computer system 500 includes a processing unit 501 that can execute the above-mentioned appendixes according to a program stored in a read only memory (ROM) 502 or a program loaded from a storage section 508 into a random access memory (RAM) 503 Various processes in the embodiment shown in the figure. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501 , the ROM 502 , and the RAM 503 are connected to each other through a bus 504 . An input/output (I/O) interface 505 is also connected to bus 504 .

以下部件连接至I/O接口505:包括键盘、鼠标等的输入部分506。包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分507。包括硬盘等的存储部分508。以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分509。通信部分509经由诸如因特网的网络执行通信处理。驱动器510也根据需要连接至I/O接口505。可拆卸介质511,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器510上,以便于从其上读出的计算机程序根据需要被安装入存储部分508。其中,所述处理单元501可实现为CPU、GPU、TPU、FPGA、NPU等处理单元。The following components are connected to the I/O interface 505: an input section 506 including a keyboard, mouse, and the like. An output section 507 such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc. is included. A storage section 508 including a hard disk or the like. And a communication section 509 including network interface cards such as LAN cards, modems, and the like. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed. The processing unit 501 may be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, and an NPU.

特别地,根据本公开的实施方式,上文参考附图描述的方法可以被实现为计算机软件程序。例如,本公开的实施方式包括一种计算机程序产品,其包括有形地包含在及其可读介质上的计算机程序,所述计算机程序包含用于执行附图中的方法的程序代码。在这样的实施方式中,该计算机程序可以通过通信部分509从网络上被下载和安装,和/或从可拆卸介质511被安装。例如,本公开的实施方式包括一种可读存储介质,其上存储有计算机指令,该计算机指令被处理器执行时实现用于执行附图中的方法的程序代码。In particular, according to embodiments of the present disclosure, the methods described above with reference to the accompanying drawings may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a readable medium thereof, the computer program containing program code for performing the methods of the accompanying drawings. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 509 and/or installed from the removable medium 511 . For example, embodiments of the present disclosure include a readable storage medium having stored thereon computer instructions that, when executed by a processor, implement program code for performing the methods in the figures.

附图中的流程图和框图,图示了按照本公开各种实施方式的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,路程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the diagram or block diagram may represent a module, segment, or portion of code that contains one or more functions for implementing the specified logical function. executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.

描述于本公开实施方式中所涉及到的单元或模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元或模块也可以设置在处理器中,这些单元或模块的名称在某种情况下并不构成对该单元或模块本身的限定。The units or modules involved in the embodiments of the present disclosure can be implemented in software or hardware. The described units or modules may also be provided in the processor, and the names of these units or modules do not constitute a limitation on the units or modules themselves in certain circumstances.

作为另一方面,本公开还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施方式中所述节点中所包含的计算机可读存储介质。也可以是单独存在,未装配入设备中的计算机可读存储介质。计算机可读存储介质存储有一个或者一个以上程序,所述程序被一个或者一个以上的处理器用来执行描述于本公开的方法。As another aspect, the present disclosure also provides a computer-readable storage medium, and the computer-readable storage medium may be the computer-readable storage medium included in the nodes described in the foregoing embodiments. It can also be a separate computer-readable storage medium that is not incorporated into the device. The computer-readable storage medium stores one or more programs used by one or more processors to perform the methods described in the present disclosure.

以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离所述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, and should also cover the above-mentioned technical features without departing from the inventive concept. Other technical solutions formed by any combination of its equivalent features. For example, a technical solution is formed by replacing the above features with the technical features disclosed in the present disclosure (but not limited to) with similar functions.

Claims (11)

1. A control method, wherein the method is applied to a switch, the method comprising:
acquiring a message to be processed, and sending the message to be processed to a first gateway, wherein the first gateway is used for acquiring a source object identifier of the message to be processed, acquiring second gateway indication information for indicating a second gateway according to the source object identifier and a corresponding relation between a source object and a gateway, and sending the second gateway indication information and the message to be processed to the switch, and the bandwidth of the second gateway meets the bandwidth requirement of a source object corresponding to the second gateway;
and receiving the second gateway indication information and the message to be processed, and forwarding the message to be processed to the second gateway according to the second gateway indication information, wherein the second gateway is used for forwarding the message to be processed.
2. The control method according to claim 1, wherein before the sending the second gateway indication information and the pending packet to the switch, the method further comprises:
packaging the second gateway indication information and the message to be processed to obtain a first packaged message;
the sending the second gateway indication information and the to-be-processed packet to the switch includes:
sending the first encapsulation packet to the switch:
the receiving the second gateway indication information and the to-be-processed packet includes:
and receiving the first encapsulation message.
3. The control method according to claim 1 or 2, wherein the correspondence between the source object and the gateway includes a correspondence between the source object and a diversion IP address, the diversion IP address and an IP address of the gateway corresponding to the source object belong to a same network segment, and the second gateway indication information includes a second diversion IP address;
the forwarding the message to be processed to the second gateway according to the second gateway indication information includes:
and acquiring second gateway indication information of a second gateway for indicating that the IP address and the second diversion IP address belong to the same network segment according to the second diversion IP address and a routing table, and forwarding the message to be processed to the second gateway according to the second gateway indication information.
4. The control method according to claim 3, wherein the obtaining, according to the second diversion IP address and a routing table, second gateway indication information for indicating that the IP address and the second diversion IP address belong to a second gateway in the same network segment includes:
and acquiring a plurality of network segments to which the second diversion IP addresses belong according to the second diversion IP addresses and the routing table, and acquiring second gateway indication information for indicating a second gateway to which the IP addresses belong to a first network segment, wherein the first network segment is the network segment with the longest subnet mask in the network segments.
5. The control method according to claim 4, wherein the obtaining second gateway indication information indicating that the IP address belongs to the second gateway of the first network segment includes:
responding to the fact that the IP address of at least one gateway belongs to the first network segment according to the routing table, and obtaining second gateway indication information of a second gateway used for indicating that the IP address belongs to the first network segment;
the method further comprises the following steps:
and in response to the fact that the IP address of any gateway does not belong to the first network segment and the IP address of at least one gateway belongs to a second network segment according to the routing table, acquiring second gateway indication information of the second gateway for indicating that the IP address belongs to the second network segment, wherein the second network segment is the network segment with the sub-mask code length in the plurality of network segments.
6. The control method according to claim 3, wherein the obtaining, according to the second diversion IP address and a routing table, second gateway indication information for indicating that the IP address and the second diversion IP address belong to a second gateway in the same network segment includes:
and acquiring a plurality of network segments to which the second diversion IP addresses belong according to the second diversion IP addresses and the routing table, and acquiring second gateway indication information for indicating a second gateway to which the IP addresses belong in a third network segment, wherein the third network segment is the network segment with the shortest routing path length in the network segments.
7. The control method according to claim 6, wherein the obtaining second gateway indication information indicating that the IP address belongs to the second gateway of the third network segment includes:
responding to the IP address of at least one gateway in the third network segment determined according to the routing table, and acquiring second gateway indication information for indicating a second gateway in the third network segment;
the method further comprises the following steps:
and in response to the fact that the IP address of any gateway does not belong to the third network segment and the IP address of at least one gateway belongs to a fourth network segment according to the routing table, acquiring second gateway indication information of a second gateway for indicating that the IP address belongs to the fourth network segment, wherein the fourth network segment is the network segment with the second shortest path length in the plurality of network segments.
8. A control method, wherein the method is applied to a gateway, and the method comprises the following steps:
receiving a first message to be processed sent by a switch, and acquiring a source object identifier of the first message to be processed;
acquiring second gateway indication information for indicating a second gateway according to the source object identifier and the corresponding relation between the source object and the gateway, and sending the second gateway indication information and the first message to be processed to the switch, wherein the bandwidth of the second gateway meets the bandwidth requirement of the source object corresponding to the second gateway;
and receiving a second message to be processed sent by the switch, and forwarding the second message to be processed.
9. A message processing system, wherein the message processing system comprises a switch for implementing the method steps of any of claims 1-7 and at least one gateway for implementing the method steps of claim 8.
10. An electronic device comprising a memory and at least one processor;
wherein the memory is to store one or more computer instructions, wherein the one or more computer instructions are to be executed by the at least one processor to implement the method steps of any one of claims 1-8.
11. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, carry out the method steps of any of claims 1-8.
CN202210349412.0A 2022-04-01 2022-04-01 Control method, system, device and medium Active CN114900560B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210349412.0A CN114900560B (en) 2022-04-01 2022-04-01 Control method, system, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210349412.0A CN114900560B (en) 2022-04-01 2022-04-01 Control method, system, device and medium

Publications (2)

Publication Number Publication Date
CN114900560A true CN114900560A (en) 2022-08-12
CN114900560B CN114900560B (en) 2024-11-05

Family

ID=82715987

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210349412.0A Active CN114900560B (en) 2022-04-01 2022-04-01 Control method, system, device and medium

Country Status (1)

Country Link
CN (1) CN114900560B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101577722A (en) * 2009-06-03 2009-11-11 中兴通讯股份有限公司 Method for realizing MAC forced forwarding function and device
CN101772084A (en) * 2008-12-29 2010-07-07 华为技术有限公司 Media stream control method, related equipment and network system
CN106161283A (en) * 2015-03-31 2016-11-23 杭州华三通信技术有限公司 Message transmitting method and device
CN107147581A (en) * 2017-06-26 2017-09-08 杭州迪普科技股份有限公司 The maintaining method and device of route table items
CN108353022A (en) * 2015-11-05 2018-07-31 华为技术有限公司 Method, device and system for processing data message
CN109314909A (en) * 2016-07-29 2019-02-05 华为技术有限公司 Anchor gateway switching method, device and system
CN110166375A (en) * 2019-05-27 2019-08-23 杭州迪普科技股份有限公司 A kind of message forwarding method and device
CN111030932A (en) * 2019-12-04 2020-04-17 锐捷网络股份有限公司 Method, device and system for anchoring data message
CN111585896A (en) * 2020-03-30 2020-08-25 华为技术有限公司 A data forwarding method, device and readable storage medium
CN112600720A (en) * 2021-03-08 2021-04-02 北京金山云网络技术有限公司 Method and apparatus for limiting bandwidth group, electronic device, and storage medium
CN112751691A (en) * 2019-10-29 2021-05-04 北京金山云网络技术有限公司 Network flow rate limiting method and device, central control equipment and gateway
CN113162857A (en) * 2016-01-18 2021-07-23 华为技术有限公司 Method and gateway for acquiring route on demand

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101772084A (en) * 2008-12-29 2010-07-07 华为技术有限公司 Media stream control method, related equipment and network system
CN101577722A (en) * 2009-06-03 2009-11-11 中兴通讯股份有限公司 Method for realizing MAC forced forwarding function and device
CN106161283A (en) * 2015-03-31 2016-11-23 杭州华三通信技术有限公司 Message transmitting method and device
CN108353022A (en) * 2015-11-05 2018-07-31 华为技术有限公司 Method, device and system for processing data message
US20180254921A1 (en) * 2015-11-05 2018-09-06 Huawei Technologies Co., Ltd. Packet processing method, apparatus, and system
CN113162857A (en) * 2016-01-18 2021-07-23 华为技术有限公司 Method and gateway for acquiring route on demand
CN109314909A (en) * 2016-07-29 2019-02-05 华为技术有限公司 Anchor gateway switching method, device and system
CN107147581A (en) * 2017-06-26 2017-09-08 杭州迪普科技股份有限公司 The maintaining method and device of route table items
CN110166375A (en) * 2019-05-27 2019-08-23 杭州迪普科技股份有限公司 A kind of message forwarding method and device
CN112751691A (en) * 2019-10-29 2021-05-04 北京金山云网络技术有限公司 Network flow rate limiting method and device, central control equipment and gateway
WO2021083269A1 (en) * 2019-10-29 2021-05-06 北京金山云网络技术有限公司 Network traffic rate limiting method and device, central control equipment and gateways
CN111030932A (en) * 2019-12-04 2020-04-17 锐捷网络股份有限公司 Method, device and system for anchoring data message
CN111585896A (en) * 2020-03-30 2020-08-25 华为技术有限公司 A data forwarding method, device and readable storage medium
CN112600720A (en) * 2021-03-08 2021-04-02 北京金山云网络技术有限公司 Method and apparatus for limiting bandwidth group, electronic device, and storage medium

Also Published As

Publication number Publication date
CN114900560B (en) 2024-11-05

Similar Documents

Publication Publication Date Title
CN108293022B (en) Method, device and system for message transmission
US12468657B2 (en) Message forwarding method and apparatus based on remote direct data storage, and network card and device
CN104579695B (en) A kind of data forwarding device and method
US8954992B2 (en) Distributed and scaled-out network switch and packet processing
CN110290506B (en) Edge cloud mobility management method and device
JP6014254B2 (en) Communication method and system
WO2021135468A1 (en) Segment identifier determining method and device
US20120117563A1 (en) Overload control in a cloud computing environment
WO2022078415A1 (en) Packet forwarding method and network device
US12052171B2 (en) Communication system and communication method
CN108270878A (en) Method, the VTEP equipment of ARP messages are sent in VXLAN
WO2024093064A1 (en) Identifier management and forwarding optimization method and apparatus in large-scale multi-modal network
CN114050998A (en) Method, device, electronic equipment and medium for realizing remote direct memory access
US10587507B2 (en) Routing between software defined networks and physical networks
CN108512779A (en) Control information transmitting methods, server and system
CN111654559B (en) Container data transmission method and device
CN115567441A (en) Method, device and system for generating forwarding information
JP2022136267A (en) Message generation method and device and message processing method and device
CN117255046A (en) A communication method and related equipment
CN116938829A (en) Data forwarding method and related equipment
CN114900560B (en) Control method, system, device and medium
WO2022057487A1 (en) Path identifier allocation method, system, apparatus and device, and storage medium
CN114982201B (en) Automatic configuration and connection of heterogeneous bandwidth managed multicast architectures
CN114079670B (en) Method, device and communication system for transmitting route information
CN116233014B (en) A method and device for implementing cluster services in container network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant