Method and system for updating flow table of virtual switch in enterprise website

By dynamically adjusting the timeout time of virtual switch flow table entries and optimizing flow table management based on throughput and matching frequency, the problem of network latency and efficiency decrease when corporate website visits increase, achieving higher throughput and lower Delay.

CN119276813AInactive Publication Date: 2025-01-07YANGZHOU ANFENG HIGH-TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411425557.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-13
Publication Date
2025-01-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When the number of visits of enterprise websites increases, the frequency and complexity of virtual switch stream table updates increase, resulting in a decrease in network latency and transmission efficiency, affecting response speed and user experience. It is difficult for the existing technology to improve the function of stream table and ensure the network under limited hardware conditions. Stable performance.

Method used

By counting the throughput of the virtual switch and the packet matching failure ratio, dynamically adjust the hard timeout and idle timeout of the flow table entry, determine the timeout time of the newly generated flow table entry based on the matching frequency and throughput, optimize the flow table management to improve throughput and reduce delay.

Benefits of technology

It effectively improves the throughput of virtual switches, reduces network latency and packet loss rate, and improves the response speed and user experience of corporate websites.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276813A_ABST
    Figure CN119276813A_ABST
Patent Text Reader

Abstract

The invention relates to the field of virtual switches, in particular to a method and a system for updating a flow table of a virtual switch in an enterprise website, and the method specifically comprises the following steps: when a controller newly generates a flow table item deleted in the virtual switch, counting the throughput of the virtual switch and the ratio of matching failure of a data packet of the virtual switch; if the deletion reason is hard timeout, acquiring the successful matching frequency of the flow table item within the hard timeout time, and determining the hard timeout and idle timeout of the newly generated flow table item based on the matching frequency and the throughput; if the deletion reason is idle timeout, determining hard timeout and idle timeout of the newly generated flow table item based on the throughput and the ratio; and deleting the flow table item from the flow table of the virtual switch and sending the deleted flow table item and deletion information to the controller for storage when the existence time of the flow table item in the flow table of the virtual switch reaches hard timeout or the flow table item is not matched with any data packet in the idle time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of virtual switches, and in particular to a method and system for updating a flow table of a virtual switch in an enterprise website. Background Art

[0002] The corporate website can be said to be the facade or business card of the enterprise. Users can learn about the company information and the products or services provided by the company through the corporate website. With the expansion of corporate business and the increase of online users, the network architecture behind the corporate website needs to be able to efficiently handle a large number of concurrent accesses and data requests, but due to limitations such as budget, it is impossible to update the equipment at any time. As the core component in the virtualized network environment, the virtual switch (vSwitch) is responsible for managing the data flow and communication between virtual networks. The flow table is an important part of the virtual switch, which is used to determine the forwarding path and processing rules of data packets. However, with the continuous increase in the number of visits to corporate websites, the frequency and complexity of flow table updates are also increasing, which not only increases latency, but also causes the transmission efficiency of the entire network to decrease, thereby affecting the response speed and user experience of the corporate website. How to improve the role of the flow table based on the existing hardware while ensuring the stability of network performance is an urgent problem to be solved in this field. Summary of the invention

[0003] In order to solve the above problem, the present invention provides a method for updating a virtual switch flow table in an enterprise website, the method comprising the following steps: When the controller newly generates a flow table entry that has been deleted in the virtual switch, the throughput of the virtual switch and the ratio of the virtual switch data packet matching failure are counted; if the deletion reason is a hard timeout, the frequency of successful matching of the flow table entry within the hard timeout period is obtained, and the hard timeout and idle timeout of the newly generated flow table entry are determined based on the matching frequency and the throughput; if the deletion reason is an idle timeout, the hard timeout and idle timeout of the newly generated flow table entry are determined based on the throughput and the ratio; When the flow entry exists in the flow table of the virtual switch for a hard timeout, or when the flow entry does not match any data packet during the idle time, the flow entry is deleted from the flow table of the virtual switch and the deleted flow entry and deletion information are sent to the controller and stored.

[0004] Preferably, the hard timeout and idle timeout of the newly generated flow entry are determined based on the matching frequency and throughput, specifically: Determine a value corresponding to an interval according to the interval in which the matching frequency is located; Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; Subtract the load from the value corresponding to the interval as the hard timeout weight, and obtain the hard timeout of the newly generated flow entry based on the hard timeout weight and the hard timeout of the flow entry when it was last deleted; If the load is greater than the threshold, the idle timeout is reduced, otherwise the idle timeout is kept unchanged.

[0005] Preferably, the determining of the hard timeout and idle timeout of the newly generated flow entry based on the throughput and the ratio is specifically: Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; The idle timeout of the newly generated flow table entry is calculated based on the idle timeout ratio weight coefficient and the load weight coefficient; If the load is greater than the threshold, the hard timeout is reduced, otherwise the hard timeout is kept unchanged.

[0006] Preferably, the idle timeout of the newly generated flow entry is calculated based on the idle timeout ratio weight coefficient and the load weight coefficient, specifically: The load is calculated and multiplied by the load weight coefficient to obtain a first value, and the ratio is calculated and multiplied by the ratio weight coefficient to obtain a second value. The result of subtracting the first value and the second value from 1 is used as the adjustment coefficient. The adjustment coefficient and the idle timeout of the flow table entry at the time of the last deletion are used to obtain the idle timeout of the newly generated flow table entry.

[0007] Preferably, the method further comprises: If the controller generates a new flow entry according to the configuration rule, the newly generated flow entry uses the default hard timeout and idle timeout; If the flow table entry in the virtual switch is deleted through a controller instruction, the deleted flow table entry and deletion information are not stored in the controller.

[0008] In addition, the present invention also provides a virtual switch flow table update system in an enterprise website, the system comprising the following modules: A flow table generation module, used for counting the throughput of the virtual switch and the ratio of failed matching of virtual switch data packets when the controller newly generates a flow table entry that has been deleted in the virtual switch; if the deletion reason is a hard timeout, obtaining the frequency of successful matching of the flow table entry within the hard timeout period, and determining the hard timeout and idle timeout of the newly generated flow table entry based on the matching frequency and throughput; if the deletion reason is an idle timeout, determining the hard timeout and idle timeout of the newly generated flow table entry based on the throughput and the ratio; The flow table deletion module is used to delete the flow table entry from the flow table of the virtual switch when the flow table entry exists in the flow table of the virtual switch for a hard timeout, or when the flow table entry does not match any data packet during the idle time, and send the deleted flow table entry and deletion information to the controller for storage.

[0009] Preferably, the hard timeout and idle timeout of the newly generated flow entry are determined based on the matching frequency and throughput, specifically: Determine a value corresponding to an interval according to the interval in which the matching frequency is located; Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; Subtract the load from the value corresponding to the interval as the hard timeout weight, and obtain the hard timeout of the newly generated flow entry based on the hard timeout weight and the hard timeout of the flow entry when it was last deleted; If the load is greater than the threshold, the idle timeout is reduced, otherwise the idle timeout is kept unchanged.

[0010] Preferably, the determining of the hard timeout and idle timeout of the newly generated flow entry based on the throughput and the ratio is specifically: Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; The idle timeout of the newly generated flow table entry is calculated based on the idle timeout ratio weight coefficient and the load weight coefficient; If the load is greater than the threshold, the hard timeout is reduced, otherwise the hard timeout is kept unchanged.

[0011] Preferably, the idle timeout of the newly generated flow entry is calculated based on the idle timeout ratio weight coefficient and the load weight coefficient, specifically: The load is calculated and multiplied by the load weight coefficient to obtain a first value, and the ratio is calculated and multiplied by the ratio weight coefficient to obtain a second value. The result of subtracting the first value and the second value from 1 is used as the adjustment coefficient. The adjustment coefficient and the idle timeout of the flow table entry at the time of the last deletion are used to obtain the idle timeout of the newly generated flow table entry.

[0012] Preferably, the system further comprises: If the controller generates a new flow entry according to the configuration rule, the newly generated flow entry uses the default hard timeout and idle timeout; If the flow table entry in the virtual switch is deleted through a controller instruction, the deleted flow table entry and deletion information are not stored in the controller.

[0013] Aiming at the problem that the hardware resources of enterprise websites are limited and the delay is obvious when the traffic is large, the present invention determines that the controller newly generates a flow table entry that has been deleted in the virtual switch. If the deletion reason is a hard timeout, the frequency of successful matching of the flow table entry within the hard timeout period is obtained, and the hard timeout and idle timeout of the newly generated flow table entry are determined based on the matching frequency and throughput; if the deletion reason is an idle timeout, the hard timeout and idle timeout of the newly generated flow table entry are determined based on the throughput and the ratio. The throughput of the virtual switch is improved by managing the flow table, and the network delay and packet loss rate are reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 This is a flow chart of Embodiment 1; Figure 2 The architecture diagram of the corporate website; Figure 3 This is a structural diagram of the second embodiment. DETAILED DESCRIPTION

[0015] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure 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 disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0016] In the technical solutions disclosed in this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the relevant laws and regulations and do not violate public order and good morals. In the technical solutions disclosed in this disclosure, the user's authorization or consent is obtained before obtaining or collecting user personal information.

[0017] The technical solution provided by the present disclosure will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0018] Figure 1 The present invention is a flowchart of a method for updating a virtual switch flow table in an enterprise website according to an embodiment of the present disclosure.

[0019] Figure 1The S1 step is used to newly generate a flow table for a virtual switch, specifically, to generate a hard timeout and an idle timeout for a flow table entry. S1 is specifically as follows: when the controller newly generates a flow table entry that has been deleted from the virtual switch, the throughput of the virtual switch and the ratio of failed data packet matches of the virtual switch are counted; if the deletion reason is a hard timeout, the frequency of successful matches of the flow table entry within the hard timeout period is obtained, and the hard timeout and the idle timeout of the newly generated flow table entry are determined based on the matching frequency and the throughput; if the deletion reason is an idle timeout, the hard timeout and the idle timeout of the newly generated flow table entry are determined based on the throughput and the ratio; Figure 2 The diagram shows a server of an enterprise website, including a physical network card, a virtual switch, a virtual network card and a virtual machine (or Pod). The virtual switch is created by the controller, and the flow table of the virtual switch comes from the controller. When a new virtual switch is created, the controller will generate flow table items based on the configuration information, and then send the flow table items to the virtual switch; in addition, during the operation of the virtual switch, if a data packet does not find a matching flow table item, all or part of the information of the data packet will be sent to the controller, and the controller will generate a new flow table item and send it to the virtual switch. Due to the limited memory of the virtual switch, it is impossible to accommodate all flow table items, which involves the deletion of flow table items. Generally speaking, there are two ways to delete flow table items. One is to delete according to the hard timeout and idle timeout of the flow table item, and the other is to delete according to the instructions of the controller.

[0020] Each flow entry will have a hard timeout and an idle timeout. If a flow entry exists in the virtual switch for a longer time than the hard timeout, the flow entry will be directly deleted; if no data packet matches the flow entry within the idle timeout, the flow entry will also be deleted. Generally speaking, the length of the hard timeout is longer than the idle timeout. Both the hard timeout and the idle timeout are fixed and the same for all flow entries, which lacks flexibility, especially for corporate websites, and cannot maximize the performance of the virtual switch according to traffic. In the present invention, if the newly generated flow entry of the controller has been deleted in the virtual switch, the throughput of the virtual switch and the ratio of the virtual switch data packet matching failure are counted, wherein the throughput is the current throughput, and the ratio is the ratio of the data packet matching failure within a period of time. The so-called data packet matching failure means that there is no flow entry matching this data packet in the virtual machine switch, that is, no flow entry matches the data packet. In addition, the deleted flow entry mentioned here refers to the flow entry being deleted from the virtual switch due to the hard timeout or idle timeout of the flow entry.

[0021] Determine the last deletion reason of the deleted flow table entry. There are two reasons for deletion. One is that the flow table entry is deleted from the virtual switch due to a hard timeout, and the other is that the flow table entry is deleted from the virtual machine due to an idle timeout. For flow table entries deleted due to a hard timeout, further obtain the frequency of successful matching of the flow table entry within the hard timeout period, and determine the hard timeout and idle timeout of the newly generated flow table entry based on the matching frequency and throughput. If the frequency of successful matching of the flow table entry within the hard timeout period is high, the existence time of the flow table entry in the virtual switch should be increased. If it remains unchanged or the existence time in the virtual switch is reduced, the flow table entry will be deleted from the virtual switch when the hard timeout is reached, which reduces the efficiency of the virtual switch. In addition, throughput is also an important factor that affects the existence of flow table entries in the virtual switch. If the throughput is large, the load of the virtual switch is large, and the traffic is large, it is necessary to increase the update speed of the flow table entry.

[0022] In one embodiment, the hard timeout and idle timeout of the newly generated flow entry are determined based on the matching frequency and throughput, specifically: Determine a value corresponding to an interval according to the interval in which the matching frequency is located; Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; Subtract the load from the value corresponding to the interval as the hard timeout weight, and obtain the hard timeout of the newly generated flow entry based on the hard timeout weight and the hard timeout of the flow entry when it was last deleted; If the load is greater than the threshold, the idle timeout is reduced, otherwise the idle timeout is kept unchanged.

[0023] The matching frequency is pre-divided into multiple intervals, such as 0-100, 101-300, and 301-500. The values ​​corresponding to each interval are 0.3, 0.5, and 0.7, respectively. If the matching frequency of the deleted flow table entry is 419, it corresponds to the third interval, and its value is 0.7. Then, the load of the virtual switch is calculated. The load is measured by the ratio of the current throughput to the maximum throughput of the virtual switch. If the current throughput is 400Mbps and the maximum throughput is 1000Mbps, the load is 0.4. The value corresponding to the interval minus the load is subtracted to get the hard timeout weight of 0.3. Based on 0.3 and the hard timeout of the flow table entry when it was last deleted, assuming 60s, the hard timeout of the newly generated flow table entry is obtained. In a preferred embodiment, the hard timeout of the newly generated flow table entry is obtained according to the hard timeout weight and the hard timeout of the flow table entry when it was last deleted, specifically: the sum of the hard timeout weight and 1 is calculated, and then the hard timeout of the flow table entry when it was last deleted is multiplied to obtain the hard timeout of the newly generated flow table entry. Still taking the above data as an example, the hard timeout of the newly generated flow table entry is 78s.

[0024] For the idle timeout, the load situation is further judged. If the load is greater than the threshold, for example, the threshold is 0.8, the idle timeout is reduced. The idle timeout can be reduced to 0.9 times of the original value. Of course, the reduction ratio can also be determined based on the gap between the load and the threshold. The larger the gap, the larger the reduction ratio. For example, if the gap is 0.2, the idle timeout is reduced by 0.2 times based on the original idle timeout. If the idle timeout is 10s, it is reduced by 0.2 times to 8s.

[0025] If the deletion reason is idle timeout, it means that the matching success rate of the last deleted flow entry is very low, and the hard timeout and idle timeout of the newly generated flow entry are further determined based on the throughput and the ratio. In a specific embodiment, specifically: Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; The load is determined in the same manner as in the previous embodiment, which will not be described again here.

[0026] The idle timeout of the newly generated flow table entry is calculated based on the idle timeout ratio weight coefficient and the load weight coefficient; Two weight coefficients are pre-set, which are the weight coefficient a of the ratio and the weight coefficient b of the load, and then the idle timeout of the newly generated flow table entry is determined according to the weight coefficients a, b and the ratio and the load. Specifically, the load is calculated by multiplying the load weight coefficient to obtain the first value, and the ratio is calculated by multiplying the ratio weight coefficient to obtain the second value. The result of subtracting the first value and the second value from 1 is used as the adjustment coefficient, and the idle timeout of the flow table entry at the time of the last deletion is used to obtain the idle timeout of the newly generated flow table entry. Among them, 1 minus the first value and the second value is 1-first value-second value. If the load is 0.4, the ratio is 0.6, a=0.3, b=0.6, then the first value is 0.24, the second value is 0.18, the adjustment coefficient is 0.58, and if the idle timeout is 10s, it is adjusted to 5.8s.

[0027] If the load is greater than the threshold, the hard timeout is reduced, otherwise the hard timeout is kept unchanged.

[0028] For the hard timeout, whether to reduce or keep it unchanged is determined according to the load situation. If the load is large, for example, greater than the threshold, the hard timeout is reduced, otherwise the hard timeout is kept unchanged. The hard timeout can be reduced to 0.9 times of the original value. Of course, the reduction ratio can also be determined according to the difference between the load and the threshold. The larger the difference, the larger the reduction ratio. For example, if the difference is 0.2, the original hard timeout is reduced by 0.2 times. If the hard timeout is 60s, it is reduced by 0.2 times to 48s.

[0029] It should be understood by those skilled in the art that variable parameters or pre-set parameters can be adjusted according to the network and the physical host where the virtual switch is located. Any modification, equivalent replacement and improvement made within the spirit and principle of this disclosure shall be included in the protection scope of this disclosure.

[0030] Figure 1 The S2 step is used to delete the flow table in the virtual switch. Specifically, the flow table entry is deleted from the virtual switch according to the hard timeout and the idle timeout. S2 is specifically: when the flow table entry exists in the flow table of the virtual switch for a hard timeout, or when the flow table entry does not match any data packet during the idle time, the flow table entry is deleted from the flow table of the virtual switch and the deleted flow table entry and deletion information are sent to the controller and stored.

[0031] When a flow entry exists in the virtual switch for a hard timeout, the virtual switch will delete the flow entry. Similarly, if no data packet successfully matches the flow entry during the idle time, the flow entry will also be deleted from the virtual switch. If the flow entry is deleted from the virtual switch due to a hard timeout or an idle timeout, the deleted flow entry and deletion information will be sent to the controller, which stores this information. The deletion information includes the deletion reason, deletion time, etc. The deletion reasons include hard timeout and idle timeout.

[0032] When the controller generates a new flow entry according to the configuration rules, the newly generated flow entry adopts the default hard timeout and idle timeout; In another embodiment, if the flow table entry in the virtual switch is deleted by a controller instruction, the deleted flow table entry and deletion information are not stored in the controller, that is, the controller only stores the flow table entry deleted due to hard timeout or idle timeout and related information.

[0033] Figure 3 The structure diagram of the virtual switch flow table update system in the enterprise website is shown, and the system includes the following modules: A flow table generation module, used for counting the throughput of the virtual switch and the ratio of failed matching of virtual switch data packets when the controller newly generates a flow table entry that has been deleted in the virtual switch; if the deletion reason is a hard timeout, obtaining the frequency of successful matching of the flow table entry within the hard timeout period, and determining the hard timeout and idle timeout of the newly generated flow table entry based on the matching frequency and throughput; if the deletion reason is an idle timeout, determining the hard timeout and idle timeout of the newly generated flow table entry based on the throughput and the ratio; The flow table deletion module is used to delete the flow table entry from the flow table of the virtual switch when the flow table entry exists in the flow table of the virtual switch for a hard timeout, or when the flow table entry does not match any data packet during the idle time, and send the deleted flow table entry and deletion information to the controller for storage.

[0034] Preferably, the hard timeout and idle timeout of the newly generated flow entry are determined based on the matching frequency and throughput, specifically: Determine a value corresponding to an interval according to the interval in which the matching frequency is located; Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; Subtract the load from the value corresponding to the interval as the hard timeout weight, and obtain the hard timeout of the newly generated flow entry based on the hard timeout weight and the hard timeout of the flow entry when it was last deleted; If the load is greater than the threshold, the idle timeout is reduced, otherwise the idle timeout is kept unchanged.

[0035] Preferably, the determining of the hard timeout and idle timeout of the newly generated flow entry based on the throughput and the ratio is specifically: Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; The idle timeout of the newly generated flow table entry is calculated based on the idle timeout ratio weight coefficient and the load weight coefficient; If the load is greater than the threshold, the hard timeout is reduced, otherwise the hard timeout is kept unchanged.

[0036] Preferably, the idle timeout of the newly generated flow entry is calculated based on the idle timeout ratio weight coefficient and the load weight coefficient, specifically: The load is calculated and multiplied by the load weight coefficient to obtain a first value, and the ratio is calculated and multiplied by the ratio weight coefficient to obtain a second value. The result of subtracting the first value and the second value from 1 is used as the adjustment coefficient. The adjustment coefficient and the idle timeout of the flow table entry at the time of the last deletion are used to obtain the idle timeout of the newly generated flow table entry.

[0037] Preferably, the system further comprises: If the controller generates a new flow entry according to the configuration rule, the newly generated flow entry uses the default hard timeout and idle timeout; If the flow table entry in the virtual switch is deleted through a controller instruction, the deleted flow table entry and deletion information are not stored in the controller.

[0038] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, including at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned virtual switch flow table update method in the enterprise website.

[0039] According to an embodiment of the present disclosure, the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the above-mentioned method for updating a virtual switch flow table in an enterprise website.

[0040] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0041] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0042] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0043] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0044] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for updating a virtual switch flow table in an enterprise website, characterized in that: The method comprises the following steps: When the controller newly generates a flow table entry that has been deleted in the virtual switch, the throughput of the virtual switch and the ratio of the virtual switch data packet matching failure are counted; if the deletion reason is a hard timeout, the frequency of successful matching of the flow table entry within the hard timeout period is obtained, and the hard timeout and idle timeout of the newly generated flow table entry are determined based on the matching frequency and the throughput; if the deletion reason is an idle timeout, the hard timeout and idle timeout of the newly generated flow table entry are determined based on the throughput and the ratio; When the flow entry exists in the flow table of the virtual switch for a hard timeout, or when the flow entry does not match any data packet during the idle time, the flow entry is deleted from the flow table of the virtual switch and the deleted flow entry and deletion information are sent to the controller and stored.

2. The method according to claim 1, characterized in that The hard timeout and idle timeout of the newly generated flow entry are determined based on the matching frequency and throughput, specifically: Determine a value corresponding to an interval according to the interval in which the matching frequency is located; Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; Subtract the load from the value corresponding to the interval as the hard timeout weight, and obtain the hard timeout of the newly generated flow entry based on the hard timeout weight and the hard timeout of the flow entry when it was last deleted; If the load is greater than the threshold, the idle timeout is reduced, otherwise the idle timeout is kept unchanged.

3. The method according to claim 1, characterized in that The determining of the hard timeout and the idle timeout of the newly generated flow entry based on the throughput and the ratio is specifically: Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; The idle timeout of the newly generated flow table entry is calculated based on the idle timeout ratio weight coefficient and the load weight coefficient; If the load is greater than the threshold, the hard timeout is reduced, otherwise the hard timeout is kept unchanged.

4. The method according to claim 3, characterized in that The idle timeout of the newly generated flow entry is calculated based on the idle timeout ratio weight coefficient and the load weight coefficient, specifically: The load is calculated and multiplied by the load weight coefficient to obtain a first value, and the ratio is calculated and multiplied by the ratio weight coefficient to obtain a second value. The result of subtracting the first value and the second value from 1 is used as the adjustment coefficient. The adjustment coefficient and the idle timeout of the flow table entry at the time of the last deletion are used to obtain the idle timeout of the newly generated flow table entry.

5. The method according to claim 1, characterized in that The method further comprises: If the controller generates a new flow entry according to the configuration rule, the newly generated flow entry uses the default hard timeout and idle timeout; If the flow table entry in the virtual switch is deleted through a controller instruction, the deleted flow table entry and deletion information are not stored in the controller.

6. A virtual switch flow table update system in an enterprise website, characterized in that: The system includes the following modules: A flow table generation module, used for counting the throughput of the virtual switch and the ratio of failed matching of virtual switch data packets when the controller newly generates a flow table entry that has been deleted in the virtual switch; if the deletion reason is a hard timeout, obtaining the frequency of successful matching of the flow table entry within the hard timeout period, and determining the hard timeout and idle timeout of the newly generated flow table entry based on the matching frequency and throughput; if the deletion reason is an idle timeout, determining the hard timeout and idle timeout of the newly generated flow table entry based on the throughput and the ratio; The flow table deletion module is used to delete the flow table entry from the flow table of the virtual switch when the flow table entry exists in the flow table of the virtual switch for a hard timeout, or when the flow table entry does not match any data packet during the idle time, and send the deleted flow table entry and deletion information to the controller for storage.

7. The system according to claim 6, characterized in that The hard timeout and idle timeout of the newly generated flow entry are determined based on the matching frequency and throughput, specifically: Determine a value corresponding to an interval according to the interval in which the matching frequency is located; Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; Subtract the load from the value corresponding to the interval as the hard timeout weight, and obtain the hard timeout of the newly generated flow entry based on the hard timeout weight and the hard timeout of the flow entry when it was last deleted; If the load is greater than the threshold, the idle timeout is reduced, otherwise the idle timeout is kept unchanged.

8. The system according to claim 6, characterized in that The determining of the hard timeout and the idle timeout of the newly generated flow entry based on the throughput and the ratio is specifically: Obtaining a maximum throughput of the virtual switch, calculating a ratio of the throughput to the maximum throughput and using the ratio as the load of the virtual switch; The idle timeout of the newly generated flow table entry is calculated based on the idle timeout ratio weight coefficient and the load weight coefficient; If the load is greater than the threshold, the hard timeout is reduced, otherwise the hard timeout is kept unchanged.

9. The system according to claim 8, characterized in that The idle timeout of the newly generated flow entry is calculated based on the idle timeout ratio weight coefficient and the load weight coefficient, specifically: The load is calculated and multiplied by the load weight coefficient to obtain a first value, and the ratio is calculated and multiplied by the ratio weight coefficient to obtain a second value. The result of subtracting the first value and the second value from 1 is used as the adjustment coefficient. The adjustment coefficient and the idle timeout of the flow table entry at the time of the last deletion are used to obtain the idle timeout of the newly generated flow table entry.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 5.