A method and device for distributing traffic
By determining the message group information from the path information and protocol information of traffic messages, and combining real-time traffic and fixed bandwidth to intelligently allocate, the problems of low traffic allocation efficiency and packet loss in the existing technology are solved, and more efficient is achieved traffic management.
Patent Information
- Application Number
- CN202210809370.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-11
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-07-11
AI Technical Summary
The prior art can easily lead to packet loss, traffic port overload and low distribution efficiency in traffic allocation, especially during switching between fixed bandwidth and real-time traffic ports.
By determining the message group information from the path information and protocol information of the traffic message, determining whether there is a corresponding first traffic port or second traffic port, and allocating it based on real-time traffic and fixed bandwidth, the traffic report is distributed using load balancing method avoid packet loss and port overload.
It realizes reasonable allocation management of traffic, avoids packet loss, overload of traffic ports, and low allocation efficiency, and improves the stability and efficiency of traffic allocation.
Smart Images

Figure CN115208827B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for flow distribution. Background Art
[0002] There are generally multiple types of traffic ports in a computer room, such as fixed bandwidth traffic ports or real-time traffic ports.
[0003] At present, the following distribution methods are generally adopted when distributing traffic: (1) Distributing traffic evenly to various types of ports, which may cause port overload and thus cause problems such as message loss; (2) Manually monitoring traffic and switching between different types of traffic ports according to traffic changes, which leads to low traffic distribution efficiency; (3) Setting speed limits for traffic ports with fixed bandwidth. When the traffic exceeds the speed limit, real-time traffic ports are used, which may increase the probability of disorder and affect business stability. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a method and device for traffic distribution, which allocates traffic ports to traffic messages from the perspective of message group information, and determines the traffic port to be allocated to the traffic message based on whether there is a corresponding first traffic port in the message group information corresponding to the traffic message. This can provide a reasonable traffic distribution management method, and according to different management methods, avoid problems such as message loss, traffic port overload and low distribution efficiency.
[0005] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for traffic distribution is provided.
[0006] A method for distributing traffic in an embodiment of the present invention includes:
[0007] Obtain a traffic message; determine the message group information corresponding to the traffic message according to the path information and protocol information of the traffic message; determine whether there is a first traffic port corresponding to the message group information, and the first traffic port is managed according to the real-time traffic; if so, assign the traffic message to the first traffic port; if not, assign the traffic message to a target second traffic port, and the target second traffic port is managed according to a fixed bandwidth, and the real-time traffic of the target second traffic port is less than the preset first fixed bandwidth.
[0008] Optionally, when there is no first traffic port corresponding to the message group information and the real-time traffic is not less than the preset first fixed bandwidth, it also includes: determining whether there is a synchronization sequence number in the traffic message; if so, allocating the traffic message to the first traffic port; if not, allocating a traffic port to the traffic message according to the real-time traffic of one or more second traffic ports and the preset second fixed bandwidths corresponding to the one or more second traffic ports; the preset second fixed bandwidth is greater than the preset first fixed bandwidth.
[0009] Optionally, when there is no synchronization sequence number in the traffic message, allocating a traffic port to the traffic message includes: when the real-time traffic of any second traffic port is less than or equal to the corresponding preset second fixed bandwidth, using the second traffic port whose real-time traffic is less than or equal to the corresponding preset second fixed bandwidth as the traffic port.
[0010] Optionally, when the real-time traffic of all the second traffic ports is greater than the corresponding preset second fixed bandwidth, the traffic message is allocated to the first traffic port.
[0011] Optionally, determining the message group information corresponding to the flow message based on the path information and protocol information of the flow message includes: determining the message group information to which the flow message belongs based on the source IP, destination IP, source port, destination port and protocol type in the flow message.
[0012] Optionally, determining whether there is a first traffic port corresponding to the message group information includes: calculating a summary value of the traffic message based on the source IP, destination IP, source port, destination port and protocol type; determining whether there is a target summary value that is the same as the summary value in a preset flow table; wherein the summary value in the preset flow table is calculated based on the source IP, destination IP, source port, destination port and protocol type of historical traffic messages; if so, determining that the first traffic port exists.
[0013] Optionally, when there are multiple first traffic ports or multiple target second traffic ports, the traffic packets are distributed by load balancing.
[0014] Optionally, the method also includes: adding an identifier of the first traffic port or an identifier of the target second traffic port to the traffic message, and sending the traffic message with the identifier to the egress switch, so that the egress switch determines the first traffic port or the target second traffic port according to the identifier.
[0015] Optionally, the traffic distribution method is implemented based on a programmable switch or an architecture server.
[0016] To achieve the above objective, according to another aspect of an embodiment of the present invention, a flow distribution device is provided.
[0017] A flow distribution device according to an embodiment of the present invention includes:
[0018] An acquisition module, used to acquire traffic messages;
[0019] A determination module, used to determine the message group information corresponding to the flow message according to the path information and protocol information of the flow message;
[0020] An allocation module is used to determine whether there is a first flow port corresponding to the message group information, and the first flow port is managed according to real-time flow; if so, the flow message is allocated to the first flow port; if not, the flow message is allocated to a target second flow port, the target second flow port is managed according to a fixed bandwidth, and the real-time flow of the target second flow port is less than a preset first fixed bandwidth.
[0021] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device for flow distribution is provided.
[0022] An electronic device for traffic distribution according to an embodiment of the present invention comprises: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a method for traffic distribution according to an embodiment of the present invention.
[0023] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided.
[0024] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a method for traffic distribution according to an embodiment of the present invention is implemented.
[0025] An embodiment of the above invention has the following advantages or beneficial effects: The embodiment of the present invention provides a method and device for traffic distribution, which allocates traffic ports to traffic messages from the perspective of message group information, and determines the traffic port to be allocated to the traffic message based on whether there is a corresponding first traffic port in the message group information corresponding to the traffic message. It can provide a reasonable traffic distribution management method and avoid problems such as message loss, traffic port overload and low distribution efficiency based on different management methods.
[0026] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0028] Figure 1 is a schematic diagram of main steps of a method for traffic distribution according to an embodiment of the present invention;
[0029] Figure 2 It is a schematic diagram of the main steps of determining whether there is a first traffic port corresponding to the message group information according to an embodiment of the present invention;
[0030] Figure 3 is a schematic diagram of main steps in a case where the target second flow port does not exist according to an embodiment of the present invention;
[0031] Figure 4 is a schematic diagram of an interaction process between an egress switch and a programmable switch according to an embodiment of the present invention;
[0032] Figure 5 is a schematic diagram of a specific method for traffic distribution according to an embodiment of the present invention;
[0033] Figure 6 is a schematic diagram of main modules of a flow distribution device according to an embodiment of the present invention;
[0034] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0035] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0037] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.
[0038] Figure 1 It is a schematic diagram of main steps of the method for traffic distribution according to an embodiment of the present invention.
[0039] like Figure 1 As shown, the flow distribution method of the embodiment of the present invention mainly includes the following steps:
[0040] Step S101: Obtaining traffic messages;
[0041] Step S102: determining the message group information corresponding to the flow message according to the path information and protocol information of the flow message;
[0042] Step S103: determining whether there is a first flow port corresponding to the message group information, and managing the first flow port according to the real-time flow;
[0043] If yes, executing step S104: allocating the traffic message to the first traffic port;
[0044] If not, execute step S104: distribute the traffic message to the target second traffic port, the target second traffic port is managed according to the fixed bandwidth, and the real-time traffic of the target second traffic port is less than the preset first fixed bandwidth.
[0045] In the existing traffic distribution field, there are usually two types of traffic output ports, namely ordinary traffic ports (first traffic ports) and fixed bandwidth traffic ports (second traffic ports), and operators use different billing methods for different traffic ports. Among them, ordinary traffic ports are managed according to real-time traffic, that is, they are charged according to the amount of output traffic, while fixed bandwidth traffic ports are charged according to fixed bandwidth, that is, a fixed fee is charged within a specific time. Therefore, for users of traffic, in order to reduce costs as much as possible and ensure the stability of running services, fixed bandwidth traffic ports will be used as much as possible. The embodiment of the present invention achieves the purpose of reasonably allocating traffic ports for different message group information on the basis of giving priority to fixed bandwidth traffic ports as much as possible.
[0046] It should be noted that there are usually multiple first flow ports and second flow ports, and the target second flow port is a flow port whose real-time flow is less than the preset first fixed bandwidth among the second flow ports, and is a part of the second flow ports. In an optional embodiment, the preset first fixed bandwidth can be set to 90% of the total bandwidth to ensure the normal operation of the flow port and avoid problems such as data packet loss.
[0047] Message group information, which can be understood as a data stream, is a group of ordered data sequences of bytes with a start point and an end point. It usually includes one or more traffic messages during the same connection. For each message group information, only the first traffic message is used to establish a connection with the target interface, and a SYN (Synchronize Sequence Numbers) is generated. Subsequent messages do not need to repeatedly establish connections. Among them, the synchronization sequence number is a handshake message used when TCP / IP establishes a connection. When a normal TCP network connection is established between a client and a server, the client first sends a SYN message, and the server uses a SYN+ACK response to indicate that the message has been received. Finally, the client responds with an ACK message. In this way, a reliable TCP connection can be established between the client and the server, and data can be transmitted between the client and the server. In other words, among multiple traffic messages belonging to the same message group information, only the first traffic message has a synchronization sequence number, and there is no synchronization sequence number in subsequent traffic messages.
[0048] In the embodiment of the present invention, since the second flow port is preferentially used for flow output, if there is a first flow port corresponding to the message group information, it means that the current flow message is not the first time to allocate the port, and it also means that the second flow port has reached the load, so the flow message can be directly allocated to the first flow port. If there is no first flow port corresponding to the message group information, it is necessary to re-determine the real-time flow of the second flow port. The embodiment of the present invention uses the message group information as the allocation standard of the flow port, and can uniformly allocate messages of the same message group information without the need to allocate ports separately for messages of the same message group information, which is convenient and fast.
[0049] Regarding the step of determining the message group information corresponding to the flow message based on the path information and protocol information of the flow message in step S102, in an optional embodiment, it includes: determining the message group information to which the flow message belongs based on the source IP, destination IP, source port, destination port and protocol type in the flow message.
[0050] Among them, the source IP, destination IP, source port, destination port and protocol type in the traffic message are usually called quintuple information, which is a set composed of the above five quantities and can represent the path information and protocol information of the traffic message.
[0051] Regarding the step of determining whether there is a first flow port corresponding to the message group information in step S103, in an optional embodiment, Figure 2 As shown, including:
[0052] Step S201: Calculate the summary value of the traffic message according to the source IP, destination IP, source port, destination port and protocol type;
[0053] Step S202: Determine whether there is a target summary value that is the same as the summary value in the preset flow table; wherein the summary value in the preset flow table is calculated based on the source IP, destination IP, source port, destination port and protocol type of the historical traffic message;
[0054] If yes, execute step S203: determine whether the first flow port exists; if not, execute step S204: determine whether the first flow port does not exist.
[0055] In an embodiment of the present invention, a preset flow table is set to store summary values of traffic packets output from the first traffic outlet, that is, all packet group information output from the first traffic outlet is stored. Therefore, by judging the summary value, it is possible to know whether the packet group information to which the current packet belongs has been output from the first traffic outlet.
[0056] In an optional embodiment, when there is no first flow port corresponding to the message group information, that is, no match to the preset flow table, and the real-time traffic is greater than the preset first fixed bandwidth, that is, there is no target second flow port, such as Figure 3 As shown, it may include:
[0057] Step S301: Determine whether there is a synchronization sequence number in the traffic message;
[0058] If yes, execute step S302: assign the traffic message to the first traffic port;
[0059] If not, execute step S303: allocate traffic ports to traffic packets according to the real-time traffic of one or more second traffic ports and the preset second fixed bandwidths corresponding to the one or more second traffic ports; the preset second fixed bandwidth is greater than the preset first fixed bandwidth.
[0060] When the first traffic port corresponding to the message group information does not exist, that is, the preset flow table is not matched, it means that there is no record of the message group information being output from the first traffic outlet. There may be two situations. One is that the current message is the first traffic message of the message group information, and the other is that the second traffic outlet has not yet reached saturation, and the message group information has always been output from the second traffic outlet. Therefore, it is necessary to first determine the synchronization sequence number. If it exists, the traffic message is assigned to the first traffic port and the summary value of the message group information is added to the preset flow table. If it does not exist, it is further determined whether it is greater than the preset second fixed bandwidth. Among them, the preset second fixed bandwidth can be set to 99% of the total bandwidth to ensure that data is not lost.
[0061] In the case where there is no synchronization sequence number, in some optional embodiments, the flow port is allocated to the flow message, including: when the real-time flow of any second flow port is less than or equal to the corresponding preset second fixed bandwidth, the second flow port whose real-time flow is less than or equal to the corresponding preset second fixed bandwidth is used as the flow port; in other optional embodiments, when the real-time flow of all second flow ports is greater than the corresponding preset second fixed bandwidth, the flow message is allocated to the first flow port. In other words, when all second flow ports have reached the preset second fixed bandwidth, it means that all second flow ports are running at full capacity and cannot output more flow, then the flow message is allocated to the first flow port.
[0062] In actual application, there may be multiple first flow ports and / or second flow ports. In an optional embodiment, when there are multiple first flow ports, flow packets are distributed through load balancing; in another optional embodiment, when there are multiple target second flow ports, flow packets are also distributed through load balancing.
[0063] In an optional embodiment, the above-mentioned traffic distribution method can be implemented based on a programmable switch or an architecture server. For example, a p4 programmable switch or an X86 server. For an X86 server, due to the limitation of the server's bandwidth and forwarding capacity, it is unable to meet the Tb-level bandwidth and data packet line speed processing capacity. Therefore, the server implementation software development cost and equipment cost are relatively high, and it is preferably implemented based on a programmable switch.
[0064] After the traffic port is allocated, the egress switch is usually required to send the traffic, so the programmable switch is required to pass the determined port to the egress switch in the form of an identifier, including: adding the identifier of the first traffic port or the identifier of the target second traffic port to the traffic message, and sending the traffic message with the identifier to the egress switch, so that the egress switch determines the first traffic port or the target second traffic port according to the identifier. Among them, the added identifier can be represented by DSCP (Differentiated Services Code Point), which is usually present in the IP header and can distinguish the priority by the encoding value.
[0065] It should be noted that the interaction process between the egress switch and the programmable switch is as follows: Figure 4 As shown, the route at the egress switch corresponds one-to-one to the traffic port connected to the operator. For the route interaction between the egress switch and the programmable switch, in an optional embodiment, a source-in-source-out method is adopted. When a fault occurs, the route is directly disconnected without affecting the normal forwarding of business traffic.
[0066] Figure 5 A specific method for distributing traffic according to an embodiment of the present invention is as follows: Figure 4 As shown, including:
[0067] Step S501: Obtaining traffic messages;
[0068] Step S502: Determine corresponding quintuple information according to the message group information of the traffic message;
[0069] Step S503: Calculate the summary value corresponding to the traffic message through the five-tuple information, and determine whether the summary value exists in the preset flow table;
[0070] If yes, executing step S504: allocating the traffic message to the first traffic port;
[0071] If not, executing step S505: determining whether the real-time traffic of the second traffic port is less than the preset first fixed bandwidth;
[0072] If the bandwidth is less than the preset first bandwidth, executing step S506: allocating the traffic message to the second traffic port;
[0073] In the case that the bandwidth is greater than or equal to the preset first bandwidth, step S507 is executed: determining whether there is a synchronization sequence number in the traffic message; if yes, step S508 is executed: allocating the traffic message to the first traffic port; if not, steps S509 and S510 are executed;
[0074] Step S509: when the real-time traffic of the second traffic port is less than the preset second fixed bandwidth, allocating the traffic message to the second traffic port;
[0075] Step S510: when the real-time traffic of all second traffic ports is greater than the corresponding preset second fixed bandwidth, the traffic message is allocated to the first traffic port.
[0076] According to the method for traffic distribution in an embodiment of the present invention, a traffic port is allocated to a traffic message from the perspective of message group information, and the traffic port to be allocated to the traffic message is determined based on whether there is a corresponding first traffic port in the message group information corresponding to the traffic message. This can be a reasonable traffic distribution management method, and according to different management methods, problems such as message loss, traffic port overload and low distribution efficiency can be avoided.
[0077] Figure 6 4 is a schematic diagram of main modules of a flow distribution device according to an embodiment of the present invention.
[0078] like Figure 6 As shown, the flow distribution device 600 of the embodiment of the present invention includes:
[0079] The acquisition module 601 is used to acquire the flow message;
[0080] A determination module 602 is used to determine the message group information corresponding to the flow message according to the path information and protocol information of the flow message;
[0081] The allocation module 603 is used to determine whether there is a first flow port corresponding to the message group information, and the first flow port is managed according to the real-time flow; if so, the flow message is allocated to the first flow port; if not, the flow message is allocated to the target second flow port, the target second flow port is managed according to the fixed bandwidth, and the real-time flow of the target second flow port is less than the preset first fixed bandwidth.
[0082] In an optional embodiment, the allocation module 603 is also used to determine whether there is a synchronization sequence number in the traffic message when there is no first traffic port corresponding to the message group information and the real-time traffic is not less than the preset first fixed bandwidth; if yes, allocate the traffic message to the first traffic port; if not, allocate a traffic port to the traffic message based on the real-time traffic of one or more second traffic ports and the preset second fixed bandwidth corresponding to the one or more second traffic ports; the preset second fixed bandwidth is greater than the preset first fixed bandwidth.
[0083] In an optional embodiment, the allocation module 603 is also used to, when the real-time traffic of any second traffic port is less than or equal to the corresponding preset second fixed bandwidth, use the second traffic port whose real-time traffic is less than or equal to the corresponding preset second fixed bandwidth as the traffic port.
[0084] In an optional embodiment, the allocation module 603 is further configured to allocate the traffic message to the first traffic port when the real-time traffic of all the second traffic ports is greater than the corresponding preset second fixed bandwidth.
[0085] In an optional embodiment, the determination module 602 is further used to determine the message group information to which the flow message belongs according to the source IP, destination IP, source port, destination port and protocol type in the flow message.
[0086] In an optional embodiment, the allocation module 603 is also used to calculate the summary value of the traffic message based on the source IP, destination IP, source port, destination port and protocol type; determine whether there is a target summary value that is the same as the summary value in the preset flow table; wherein the summary value in the preset flow table is calculated based on the source IP, destination IP, source port, destination port and protocol type of the historical traffic message; if so, determine that the first traffic port exists.
[0087] In an optional embodiment, the allocation module 603 is further used to allocate the traffic packets in a load balancing manner when there are multiple first traffic ports or multiple target second traffic ports.
[0088] In an optional embodiment, the allocation module 603 is also used to add the identifier of the first traffic port or the identifier of the target second traffic port to the traffic message, and send the traffic message with the identifier to the egress switch, so that the egress switch determines the first traffic port or the target second traffic port according to the identifier.
[0089] In an optional embodiment, the traffic distribution device implements the traffic distribution method based on a programmable switch or an architecture server.
[0090] According to the device for traffic distribution in an embodiment of the present invention, a traffic port is allocated to a traffic message from the perspective of message group information, and the traffic port to be allocated to the traffic message is determined based on whether there is a corresponding first traffic port in the message group information corresponding to the traffic message. This can provide a reasonable traffic distribution management method, and according to different management methods, avoid problems such as message loss, traffic port overload, and low distribution efficiency.
[0091] Figure 7 An exemplary system architecture 700 is shown to which the method or apparatus for traffic distribution according to an embodiment of the present invention can be applied.
[0092] like Figure 7 As shown, the system architecture 700 may include a server 701, a programmable switch 702, an egress switch 703, a network 704, and servers 705, 706, and 707. The network 704 is used to provide a medium for communication links between the programmable switch 702 and the egress switch 703, and between the egress switch 703 and the servers 705, 706, and 707. The network 704 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0093] The server 701 may be a server providing various services, such as a background management server for distributing traffic messages. The background management server may analyze and process the received access traffic and other data, and send the processing result (such as the traffic distribution port) to the egress switch 703.
[0094] Servers 705, 706, and 707 may also be servers that provide various services, such as servers used by operators, and may calculate traffic charges based on received traffic.
[0095] It should be noted that the traffic distribution method provided in the embodiment of the present invention is generally executed by the server 701 or the programmable switch 702. Accordingly, the traffic distribution device is generally arranged in the server 701 or the programmable switch 702.
[0096] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0097] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention. Figure 8 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0098] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) first interface 805 is also connected to the bus 804.
[0099] The following components are connected to the I / O first interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network first interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O first interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0100] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.
[0101] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0102] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0103] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor includes an acquisition module, a determination module, and an allocation module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the acquisition module may also be described as a "module for acquiring traffic messages."
[0104] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining a flow message; determining the message group information to which the flow message belongs; determining whether there is a first flow port corresponding to the message group information, and the first flow port is managed according to real-time flow; if yes, the flow message is assigned to the first flow port; if not, the flow message is assigned to a target second flow port, and the target second flow port is managed according to a fixed bandwidth, and the real-time flow of the target second flow port is less than the preset first fixed bandwidth.
[0105] According to the technical solution of the embodiment of the present invention, a traffic port is allocated to a traffic message from the perspective of message group information, and the traffic port to be allocated to the traffic message is determined based on whether there is a corresponding first traffic port in the message group information corresponding to the traffic message. This can be a reasonable traffic allocation management method, and according to different management methods, it can avoid the problems of message loss, traffic port overload and low allocation efficiency.
[0106] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for traffic distribution, characterized in that: include: Get traffic packets; Determine the message group information corresponding to the flow message according to the path information and protocol information of the flow message; Determine whether there is a first flow port corresponding to the message group information according to the preset flow table, and the first flow port is managed according to real-time traffic; wherein the message group information includes one or more flow messages during the same connection; if yes, assign the flow message to the first flow port; if not, assign the flow message to a target second flow port, the target second flow port is managed according to a fixed bandwidth, and the real-time traffic of the target second flow port is less than the preset first fixed bandwidth; the preset flow table is used to store the summary value of the flow message output from the first flow port; In the case where there is no first traffic port corresponding to the message group information and the real-time traffic is not less than the preset first fixed bandwidth, it also includes: determining whether there is a synchronization sequence number in the traffic message; if so, assigning the traffic message to the first traffic port, and adding the summary value of the message group information to the preset flow table; if not, assigning a traffic port to the traffic message according to the real-time traffic of one or more second traffic ports and the preset second fixed bandwidths corresponding to the one or more second traffic ports; the preset second fixed bandwidth is greater than the preset first fixed bandwidth.
2. The method according to claim 1, characterized in that In a case where the synchronization sequence number does not exist in the traffic message, allocating a traffic port to the traffic message includes: In the case where the real-time traffic of any second traffic port is less than or equal to the corresponding preset second fixed bandwidth, the second traffic port where the real-time traffic is less than or equal to the corresponding preset second fixed bandwidth is used as the traffic port; or, When the real-time traffic of all the second traffic ports is greater than the corresponding preset second fixed bandwidth, the traffic message is allocated to the first traffic port.
3. The method according to claim 1, characterized in that: The determining, according to the path information and protocol information of the flow message, message group information corresponding to the flow message includes: The message group information to which the flow message belongs is determined according to the source IP, destination IP, source port, destination port and protocol type in the flow message.
4. The method according to claim 3, characterized in that Determining whether there is a first traffic port corresponding to the message group information includes: Calculate the summary value of the traffic message according to the source IP, destination IP, source port, destination port and protocol type; Determine whether there is a target summary value that is the same as the summary value in the preset flow table; wherein the summary value in the preset flow table is calculated based on the source IP, destination IP, source port, destination port and protocol type of the historical traffic message; If yes, it is determined that the first flow port exists.
5. The method according to claim 1, characterized in that When there are multiple first traffic ports or multiple target second traffic ports, the traffic packets are distributed in a load balancing manner.
6. The method according to claim 1, characterized in that Also includes: Add the identifier of the first traffic port or the identifier of the target second traffic port to the traffic message, and send the traffic message with the identifier to the egress switch, so that the egress switch determines the first traffic port or the target second traffic port according to the identifier.
7. The method according to any one of claims 1 to 6, characterized in that: The method for implementing the traffic distribution is based on a programmable switch or an architecture server.
8. A flow distribution device, characterized in that: include: An acquisition module, used to acquire traffic messages; A determination module, configured to determine the message group information corresponding to the flow message according to the path information and protocol information of the flow message; wherein the message group information includes one or more flow messages during the same connection period; An allocation module, used to determine whether there is a first flow port corresponding to the message group information according to a preset flow table, and the first flow port is managed according to real-time traffic; if yes, the flow message is allocated to the first flow port; if not, the flow message is allocated to a target second flow port, the target second flow port is managed according to a fixed bandwidth, and the real-time traffic of the target second flow port is less than the preset first fixed bandwidth; the preset flow table is used to store the summary value of the flow message output from the first flow port; In the case that there is no first traffic port corresponding to the message group information and the real-time traffic is not less than the preset first fixed bandwidth, the allocation module is also used to determine whether there is a synchronization sequence number in the traffic message; if so, the traffic message is allocated to the first traffic port, and the summary value of the message group information is added to the preset flow table; if not, the traffic port is allocated to the traffic message according to the real-time traffic of one or more second traffic ports and the preset second fixed bandwidths corresponding to the one or more second traffic ports; the preset second fixed bandwidth is greater than the preset first fixed bandwidth.
9. An electronic device for flow distribution, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Traffic scheduling method and device, electronic equipment and computer readable medium
CN113037657A