Traffic control method and apparatus for a communication device, and communication device
Patent Information
- Application Number
- CN202310477659.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2043-04-27
AI Technical Summary
[0008]本申请实施例提供了通信设备的流量控制方法、装置以及通信设备,可以解决现有方法在实现流量控制时所需的通信设备的成本较高的问题
[0021]本申请实施例中,在通信设备的通信场景具备传输层可靠性机制的情况下,若检测到通信设备的输入端口的输入缓冲区数据量大于或等于预设的高水位线,则以预设的第一间隔时间获取通信设备的输入端口所属的通信模型,并在输入端口所属的通信模型为一对多模型时,以预设的第二间隔时间获取通信设备的流量特征,并根据该流量特征选择是否开启输入端口的流量控制。由于通信设备所在的通信场景具备传输层可靠性机制,因此,在输入端口的输入缓冲区数据量大于或等于预设的高水位线后,即使关闭输入端口的流量控制也能够在一定程度上实现数据的可靠传输,即在此情况下可结合通信设备的流量特征选择是否开启输入端口的流量控制。同时,由于通信模型以预设的第一间隔时间获取,且流量特征以预设的第二间隔时间获取,因此,保证了获取的通信模型和流量特征的及时性,从而在根据获取的流量特征进行流量控制时,能够保证流量控制的及时性。并且,由于只有在输入端口所属的通信模型为一对多模型时,才获取流量特征,以及,根据获取的流量特征选择是否开启该输入端口的流量控制,因此,能够保证该输入端口的流量控制的准确度。此外,由于流量特征包括以下至少任一种信息:丢包率、理论数据转发速率、实际转发速率以及带宽利用率,而通信设备在获取上述流量特征时所需的计算量较少,因此,获取上述流量特征对通信设备的性能要求较低,从而能够保证以较低的成本实现对输入端口的流量控制。
Smart Images

Figure CN116405439B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technology, and in particular relates to flow control methods, apparatus, communication equipment, and computer-readable storage media for communication devices. Background Technology
[0002] In current enterprise and park network applications, there are "many-to-one" and "one-to-many" communication models. In the "many-to-one" communication model, it usually manifests as "multiple servers to the same receiver" or "multiple receivers to the same server".
[0003] In practical applications, "one-to-many" and "many-to-one" communication models coexist; that is, if "many-to-one" exists, "one-to-many" also exists, and vice versa. While "one-to-many" or "many-to-one" communication models can increase network throughput, they are prone to congestion and packet loss when faced with sudden traffic surges.
[0004] To prevent packet loss due to network congestion, flow control can be enabled on switch ports. However, flow control is not a one-size-fits-all solution. Taking a typical one-to-many communication model as an example, when flow control is enabled on input ports, if only one output port becomes congested, causing the input buffer to reach a predefined "high water mark," a PAUSE frame with a non-zero pause-time value (this PAUSE frame is a type of Media Access Control Address (MAC) control frame) is sent. This allows the switch to prevent frames from being dropped at the input due to insufficient input buffer space. When the number of frames in the buffer falls below the predefined "low water mark," flow control can be canceled by sending a PAUSE frame with a pause-time value of 0, and normal operation can resume. This ensures that the switch does not drop any frames. However, after enabling flow control, ports that are not congested in the one-to-many communication model will face a synchronous decrease in packet transmission rate, resulting in wasted bandwidth destined for other ports. In other words, while enabling flow control can prevent packet loss, it cannot solve the end-of-line blocking (HOLB) problem, which severely affects the performance of switches in the "one-to-many" communication model.
[0005] In summary, in a "one-to-many" communication model, enabling flow control would drastically reduce the actual performance of the switch, therefore, it is undesirable to enable flow control at the input end. However, in actual communication, the communication model state of a switch port may be dynamically changing; that is, the same switch port may be in one-to-many, many-to-one, or one-to-one states at different times. Mechanically enabling or disabling flow control for a particular switch port cannot adequately adapt to the variability of switch port communication states in large-scale networks.
[0006] To address the issue of a sharp decline in switch performance after enabling flow control in a "one-to-many" communication model, when a blockage is detected at a specific output port, the switch determines the MAC address of the corresponding egress port based on its maintained ARP table and extends the PAUSE frame to include the destination MAC address. When the upstream switch receives the PAUSE frame containing the destination MAC address, it suspends the transmission of data frames whose destination MAC address is the one carried by the PAUSE frame. This achieves flow control for a specific destination port. (In this scheme, the sender—the upstream switch—needs to respond quickly after receiving the PAUSE frame carrying the destination MAC address and compare and match the destination MAC addresses of the data frames to be sent one by one. This process also places extremely high demands on the switch's computing speed.)
[0007] In summary, current mainstream flow control schemes require checking the destination MAC address of each data frame during high-speed data forwarding. Previously, switches would forward data immediately after checking the destination MAC address. However, with the above schemes, a matching check is required after checking the destination MAC address before deciding whether to continue sending to the corresponding port, thus drastically increasing the performance burden on the switch. Summary of the Invention
[0008] This application provides a method, apparatus, and communication device for flow control of communication devices, which can solve the problem that the communication devices required for flow control in existing methods are costly.
[0009] In a first aspect, embodiments of this application provide a flow control method for a communication device, comprising:
[0010] In the case that the communication scenario of the communication device has a transport layer reliability mechanism, if the amount of data in the input buffer of the input port of the communication device is detected to be greater than or equal to a preset high watermark, the communication model to which the input port of the communication device belongs is obtained at a preset first interval, wherein the communication model includes a one-to-many model, a many-to-one model and a one-to-one model.
[0011] If the communication model to which the input port belongs is the one-to-many model, then the traffic characteristics of the communication device are obtained at a preset second interval. The traffic characteristics include at least one of the following: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization.
[0012] Select whether to enable flow control for the input port based on the flow characteristics.
[0013] Secondly, embodiments of this application provide a flow control device for a communication device, comprising:
[0014] The communication model acquisition module is used to acquire the communication model to which the input port of the communication device belongs at a preset first interval if the amount of data in the input buffer of the input port of the communication device is greater than or equal to a preset high watermark when the communication scenario of the communication device has a transport layer reliability mechanism. The communication model includes a one-to-many model, a many-to-one model and a one-to-one model.
[0015] The traffic feature acquisition module is used to acquire the traffic features of the communication device at a preset second interval if the communication model to which the input port belongs is the one-to-many model. The traffic features include at least one of the following: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization.
[0016] The flow control module is used to select whether to enable flow control of the input port based on the flow characteristics.
[0017] Thirdly, embodiments of this application provide a communication device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect.
[0018] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0019] Fifthly, embodiments of this application provide a computer program product that, when run on a communication device, causes the communication device to execute the method described in the first aspect above.
[0020] The beneficial effects of the embodiments in this application compared with the prior art are:
[0021] In this embodiment, when the communication scenario of the communication device has a transport layer reliability mechanism, if the amount of data in the input buffer of the input port of the communication device is detected to be greater than or equal to a preset high watermark, the communication model to which the input port of the communication device belongs is obtained at a preset first interval. If the communication model to which the input port belongs is a one-to-many model, the traffic characteristics of the communication device are obtained at a preset second interval, and the flow control of the input port is selected based on these traffic characteristics. Since the communication scenario of the communication device has a transport layer reliability mechanism, even if the flow control of the input port is turned off after the amount of data in the input buffer of the input port is greater than or equal to the preset high watermark, reliable data transmission can still be achieved to a certain extent. That is, in this case, the flow control of the input port can be selected based on the flow characteristics of the communication device. Simultaneously, since the communication model is obtained at a preset first interval and the traffic characteristics are obtained at a preset second interval, the timeliness of the obtained communication model and traffic characteristics is guaranteed, thus ensuring the timeliness of flow control when performing flow control based on the obtained traffic characteristics. Furthermore, since traffic characteristics are only acquired when the communication model to which the input port belongs is a one-to-many model, and whether to enable traffic control for that input port is selected based on the acquired traffic characteristics, the accuracy of traffic control for that input port can be guaranteed. In addition, since traffic characteristics include at least one of the following: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization, and the computational load required for communication equipment to acquire these traffic characteristics is relatively small, the performance requirements for communication equipment are low, thus ensuring that traffic control for the input port can be implemented at a lower cost. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0023] Figure 1 This is a schematic flowchart of a flow control method for a communication device provided in an embodiment of this application;
[0024] Figure 2 This is a schematic flowchart of another flow control method for a communication device provided in an embodiment of this application;
[0025] Figure 3 This is a schematic diagram of the structure of a flow control device for a communication equipment according to an embodiment of this application;
[0026] Figure 4 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application. Detailed Implementation
[0027] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0028] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0029] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0030] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0031] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0032] Example 1:
[0033] Before implementing flow control on the input ports of communication equipment, if it is necessary to check the destination MAC address of each data frame and respond promptly during high-speed data forwarding, the performance requirements of the communication equipment are extremely high, resulting in high costs for implementing flow control.
[0034] To achieve flow control of input ports at a lower cost, this application provides a flow control method for a communication device. In this method, when the communication model to which the input port of the communication device belongs is one-to-many, flow control of the input port is selected by acquiring the flow characteristics of the communication device. Since the computational load required for the communication device to acquire the flow characteristics is relatively small, the required performance of the communication device is lower when using the method provided in this application for flow control, thereby enabling flow control of the input port at a lower cost.
[0035] The flow control method for communication equipment provided in the embodiments of this application is described below with reference to the accompanying drawings.
[0036] Figure 1 A flowchart illustrating a flow control method for a communication device according to an embodiment of this application is shown below:
[0037] Step S11: In the case that the communication scenario of the communication device has a transport layer reliability mechanism, if the amount of data in the input buffer of the input port of the communication device is detected to be greater than or equal to the preset high watermark, the communication model to which the input port of the communication device belongs is obtained at a preset first interval, wherein the communication model includes a one-to-many model, a many-to-one model and a one-to-one model.
[0038] The aforementioned communication equipment includes switches, routers, etc.
[0039] The aforementioned transport layer reliability mechanism refers to a mechanism that can reduce packet loss rate, such as a timeout retransmission mechanism. In some embodiments, the communication scenario also accepts packet loss risk and retransmission risk. Here, packet loss risk and retransmission risk mean that the communication scenario allows a certain degree of packet loss and retransmission events, such as allowing the number of lost packets to be less than a preset packet loss threshold, or allowing the number of retransmissions to be less than a preset retransmission number threshold, etc. Considering that there may be some packet loss and retransmission events after disabling flow control of the input port, applying the flow control method of this application embodiment to flow control in a communication scenario that accepts packet loss and retransmission risks can ensure user satisfaction after flow control is implemented in the communication scenario.
[0040] In this embodiment, if the communication protocol used by the transport layer is the Transmission Control Protocol (TCP), and the TCP protocol has a reliable mechanism for timeout retransmission, that is, the TCP protocol requires that a timer be started and an acknowledgment message be waited for after each segment is sent by the sending end. After the receiving end successfully receives new data, it returns an acknowledgment message. If the data is not acknowledged before the timer expires, TCP considers that the data in the segment has been lost or corrupted, and the data in the segment needs to be reorganized and retransmitted. Due to the existence of this reliable mechanism for timeout retransmission in the TCP protocol, the potential packet loss problem in most communication scenarios can be solved, that is, packet loss is cleverly transformed into delay, ensuring that data frames that should be forwarded are not discarded. Therefore, when it is determined that the communication protocol used by the transport layer is the TCP protocol, it can be considered that the corresponding communication scenario has a reliable mechanism. It should be noted that in certain scenarios with high reliability requirements (such as industrial networks which typically have very high reliability requirements), even with connection-oriented TCP transmission, if it is clearly stated in advance that even a small amount of delay caused by packet loss and retransmission is unacceptable, then when it is determined that the communication protocol used by the input port is TCP, it is also considered that the communication scenario in which the input port is located does not have a reliability mechanism.
[0041] In this embodiment, after data is cached in the input buffer, the amount of data cached in the input buffer is counted and compared with a preset high-water mark (i.e., a preset maximum cacheable data amount). If the data is greater than or equal to the high-water mark, it indicates a potential risk of packet loss. In this case, the communication model to which the input port belongs is obtained at a preset first interval. The preset first interval can be set according to actual conditions, such as 1 second, 2 seconds, etc. In some embodiments, the first interval can be flexibly set according to the current time. For example, when the current time is during a network congestion period, the first interval can be set to a shorter value, while when the current time is not during a network congestion period, the first interval can be set to a longer value. By setting it in this way, the communication model to which the input port belongs can be obtained in a timely manner.
[0042] In this embodiment of the application, by monitoring the communication status between various network nodes during the network operation process (i.e., the process in which the input port (or output port) of the communication device has started forwarding data), traffic forwarding information between different network devices or ports of the same network device can be obtained, thereby determining the communication model to which the input port of the communication device belongs.
[0043] In some embodiments, traffic forwarding information can be obtained based on network topology discovery technologies, such as network topology measurement technology based on Simple Network Management Protocol (SNMP), network topology measurement technology based on traceroute, and network topology discovery technology based on Label Distribution Protocol (LDP).
[0044] In some embodiments, if the communication device is an access layer communication device, the communication device can determine the role of the input port by combining the PoE power supply status of the input port, that is, determine the communication model to which the input port belongs by combining the PoE power supply status. For example, if the input port is in a PoE power supply state, it indicates that the input port belongs to the port connecting the terminal device or the wireless access point (AP). At this time, it can be determined that the input port belongs to the "many-to-one" communication model.
[0045] In some embodiments, taking a switch as an example, if the switch is a core switch, and the core switch typically contains many ports connected to servers, the role of the port can be determined by detecting the types of packets historically forwarded by the port. For example, if a large number of RADIUS packets are detected passing through the port, since RADIUS packet interaction is generally between the authentication gateway (usually the egress router or core switch) and the AAA or PPPoE proxy gateway, and the communication between the proxy gateway and the AAA is one-to-one, such ports are determined to belong to a "one-to-one" communication model. Of course, if it can be determined from the beginning that the port is connected to the AAA, then the port is determined to belong to a "one-to-one" communication model. In some embodiments, if the port connected to the server on the core switch is located as a server port by tracing the start and end points of FTP or HTTP requests, the server port usually belongs to a typical "one-to-many" communication model.
[0046] In some embodiments, taking a switch as an example of a communication device, considering that in large enterprise or campus networks, various types of servers are usually directly connected to the core switch. Different resource servers will be assigned different IP addresses or domain names. By tracking the IP address or the corresponding domain name, it is possible to determine which ports are server ports, and server ports usually belong to a typical "one-to-many" communication model.
[0047] Step S12: If the communication model to which the input port belongs is a one-to-many model, then the traffic characteristics of the communication device are obtained at a preset second interval. The traffic characteristics include at least one of the following: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization.
[0048] In this embodiment of the application, the preset second interval time can be set according to the actual situation. The second interval time can be equal to the first interval time mentioned above, or it can be different from the first interval time mentioned above.
[0049] In some embodiments, the second interval can be flexibly set according to the current time. For example, when the current time is during a period of network congestion, the second interval can be set to a shorter value, while when the current time is not during a period of network congestion, the second interval can be set to a longer value. By setting it in this way, the traffic characteristics of the communication device can be obtained in a timely manner.
[0050] It should be noted that the traffic characteristics of communication equipment include at least one of the following: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization. This can refer to the information corresponding to a certain port of the communication equipment, or it can refer to the information corresponding to all ports of the communication equipment. For example, bandwidth utilization can refer to the bandwidth utilization of all ports of the communication equipment.
[0051] Step S13: Select whether to enable flow control for the input port based on the flow characteristics.
[0052] Specifically, when traffic characteristics include the theoretical data forwarding rate, the communication device selects whether to enable flow control for the input port based on the theoretical data forwarding rate. Similarly, when traffic characteristics include both packet loss rate and actual forwarding rate, the communication device selects whether to enable flow control for the input port based on these two parameters. Of course, when traffic characteristics include packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization, the selection of whether to enable flow control for the input port is based on the corresponding traffic characteristics, which will not be elaborated upon here.
[0053] In this embodiment, when the communication scenario of the communication device has a transport layer reliability mechanism, if the amount of data in the input buffer of the input port of the communication device is detected to be greater than or equal to a preset high watermark, the communication model to which the input port of the communication device belongs is obtained at a preset first interval. If the communication model to which the input port belongs is a one-to-many model, the traffic characteristics of the communication device are obtained at a preset second interval, and the flow control of the input port is selected based on these traffic characteristics. Since the communication scenario of the communication device has a transport layer reliability mechanism, even if the flow control of the input port is turned off after the amount of data in the input buffer of the input port is greater than or equal to the preset high watermark, reliable data transmission can still be achieved to a certain extent. That is, in this case, the flow control of the input port can be selected based on the flow characteristics of the communication device. Simultaneously, since the communication model is obtained at a preset first interval and the traffic characteristics are obtained at a preset second interval, the timeliness of the obtained communication model and traffic characteristics is guaranteed, thus ensuring the timeliness of flow control when performing flow control based on the obtained traffic characteristics. Furthermore, since traffic characteristics are only acquired when the communication model to which the input port belongs is a one-to-many model, and whether to enable traffic control for that input port is selected based on the acquired traffic characteristics, the accuracy of traffic control for that input port can be guaranteed. In addition, since traffic characteristics include at least one of the following: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization, and the computational load required for communication equipment to acquire these traffic characteristics is relatively small, the performance requirements for communication equipment are low, thus ensuring that traffic control for the input port can be implemented at a lower cost.
[0054] In some embodiments, if the communication scenario of the communication device does not accept the risk of packet loss and retransmission, or does not have a transport layer reliability mechanism, then flow control is enabled for all input ports in the communication device.
[0055] In this embodiment, considering that a communication scenario that cannot tolerate packet loss and retransmission risks indicates extremely high reliability requirements, or that a communication scenario lacking a transport layer reliability mechanism indicates a need to ensure reliability, flow control of all ports in the communication device must be enabled in either case to avoid packet loss events, thus ensuring the reliability of the communication scenario. Here, "all ports" refers to all input and output ports of the communication device, i.e., all physical or logical ports present in the communication device. This is because in full-duplex mode, all ports are both input and output ports.
[0056] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0057] Example 2:
[0058] In some embodiments, the flow control method for communication devices provided in this application further includes:
[0059] If the communication model to which the input port belongs is a many-to-one model, or a one-to-one model, then flow control for that input port is enabled.
[0060] Since enabling flow control on a certain port (such as an input port) of a communication device will not affect the performance of other ports in both many-to-one and one-to-one models, and enabling flow control can prevent packet loss caused by network congestion, when it is determined that the communication model to which the input port belongs is a many-to-one model or a one-to-one model, flow control on that input port is selected to be enabled.
[0061] Example 3:
[0062] In some embodiments of this application, the traffic characteristics include packet loss rate. In this case, step S13 above includes:
[0063] A1. Determine whether the packet loss rate is greater than the preset packet loss rate threshold.
[0064] The packet loss rate threshold can be set as needed, for example, to a value close to 0, or to 0. Of course, if the packet loss rate threshold is set to 0, it means that packet loss events cannot be tolerated.
[0065] In this embodiment of the application, the obtained packet loss rate is compared with a preset packet loss rate threshold to determine whether the packet loss rate is greater than the packet loss rate threshold.
[0066] A2. If the packet loss rate is greater than the preset packet loss rate threshold, then enable flow control for the input port.
[0067] Since a higher packet loss rate indicates a lower network reliability, enabling flow control on the input port after determining that the packet loss rate exceeds a preset packet loss rate threshold can ensure network reliability, that is, ensure the accuracy of flow control.
[0068] In the embodiments of this application, if it is determined that the packet loss rate is not greater than the packet loss rate threshold, the flow control of the input port may be disabled, or it may be further determined whether to enable the flow control of the input port in combination with the theoretical data forwarding rate of the communication device. That is, when the traffic characteristics include the theoretical data forwarding rate in addition to the packet loss rate, the embodiments of this application may further include the following after the above step A1:
[0069] B1. If the packet loss rate is not greater than the preset packet loss rate threshold, determine whether the theoretical data forwarding rate of the input port of the communication device is greater than the theoretical data forwarding rate of the output port of the communication device.
[0070] The theoretical data forwarding rate is related to the channel bandwidth and the adopted coding technology.
[0071] Since the channel bandwidth and the coding technology are usually fixed, the communication device may pre-calculate the theoretical data forwarding rate corresponding to the input port (or the output port) according to the channel bandwidth and the coding technology of the input port (or the output port).
[0072] B2. If the theoretical data forwarding rate of the input port is greater than the theoretical data forwarding rate of the output port, enable the flow control of the input port.
[0073] Specifically, the theoretical data forwarding rates of the input port and the output port of the communication device are acquired in advance. Assume that the theoretical data forwarding rate of the input port is V1, and the theoretical data forwarding rate of the output port is V2, V1 is compared with V2, and then it is selected whether to enable the flow control of the input port according to the obtained comparison result. For example, if the communication device is in a full traffic load state and V1>V2 (that is, the packet receiving rate of the communication device is greater than the packet sending rate), the input buffer of the input port will most likely overflow. At this time, the flow control of the input port is enabled to prevent the occurrence of packet loss events. Conversely, if it is determined that V1=V2 or V1<V2, the flow control of the input port may be disabled, or it may be further determined whether to enable the flow control of the input port in combination with other traffic characteristics.
[0074] In the embodiments of this application, after it is determined that the packet loss rate is not greater than the preset packet loss rate threshold, it is further determined whether to enable the flow control of the input port according to the theoretical data forwarding rates of the input port and the output port. When the theoretical data forwarding rate of the input port is greater than the theoretical data forwarding rate of the output port, the input buffer of the input port will most likely overflow, and the overflow of the input buffer will cause a packet loss event. Therefore, after it is determined that the theoretical data forwarding rate of the input port is greater than the theoretical data forwarding rate of the output port, enabling the flow control of the input port can further improve the accuracy of flow control.
[0075] In some embodiments, considering that whether the input buffer overflows is also related to the actual forwarding rate of the communication device, the actual forwarding rate can also be used to determine whether to enable flow control of the input port. That is, in addition to packet loss rate and theoretical data forwarding rate, the flow characteristics also include actual forwarding rate. In this case, after step B1 above, the following may also be included:
[0076] C1. If the theoretical data forwarding rate of the above input port is not greater than the theoretical data forwarding rate of the above output port, then check whether the data volume of the input buffer of the above input port is greater than or equal to the above high watermark.
[0077] In some embodiments, if the amount of data in the input buffer of the input port is detected to be less than the high watermark, the process can return to step A1 (i.e., the step of determining whether the packet loss rate is greater than the preset packet loss rate threshold) and subsequent steps.
[0078] C2. If the data volume of the input buffer of the above input port is greater than or equal to the above high water level, then the actual average forwarding rate of the input port of the above communication device in at least two recent historical time periods is calculated, wherein the actual average forwarding rate is the average of the actual forwarding rates, and the above at least two historical time periods are at least two adjacent time periods.
[0079] The input buffer data volume equaling the preset high-water mark indicates that the input buffer data volume has reached a critical value; continuing to store data in the input buffer may lead to data overflow, which could potentially cause packet loss. Conversely, if the input buffer data volume exceeds the high-water mark, it also indicates a high probability of packet loss.
[0080] In this embodiment, it is possible to detect in real time whether the input buffer reaches or exceeds a preset high watermark. If, after determining that the theoretical data forwarding rate of the input port is not greater than the theoretical data forwarding rate of the output port, the data volume in the input buffer reaches or exceeds the preset high watermark, then the actual average forwarding rate over at least two recent historical time periods is calculated. Specifically, the actual forwarding rate of the input port over multiple recent historical time periods can be calculated, and then the actual average forwarding rate can be calculated based on these multiple actual forwarding rates and their corresponding durations.
[0081] It should be noted that "recent" here refers to a time interval within a preset time period relative to the current time. For example, the start time of a historical time period can be the current time, while the end time can be determined based on the preset duration of the historical time period.
[0082] In some embodiments, the durations corresponding to the various historical time periods in this application may be the same or different. For example, one historical time period may be set to have a longer duration, while another historical time period may be set to have a shorter duration.
[0083] C3. Based on at least two of the above-mentioned actual average forwarding rates of the above-mentioned input ports and the bandwidth of the above-mentioned input ports, select whether to enable flow control for the above-mentioned input ports.
[0084] Specifically, considering that the bandwidth of the input port is usually fixed, the bandwidth of the input port can be obtained in advance.
[0085] In this embodiment, at least two actual average forwarding rates of the input port are compared with the bandwidth of the input port. If the bandwidth utilization of the input port is high for a long period of time (e.g., longer than a first preset duration) (e.g., the bandwidth occupied by the input port in multiple historical time periods is close to the bandwidth of the input port), then the input port is determined to be in a continuous and widespread high-traffic forwarding scenario. Otherwise, if the bandwidth occupied by the input port in one or a few historical time periods (the total duration of the few historical time periods is at least less than half the total duration of all historical time periods) is much less than the bandwidth of the input port (e.g., less than 30% of the bandwidth that the input port can use), then the input port is determined to be in a localized and occasional high-traffic surge scenario. In some embodiments, when it is determined that the input port is in a continuous and widespread high-traffic forwarding scenario, in order to ensure the network performance of the communication device, the flow control of the port can be turned off. After turning off the flow control of the port, the steps of determining whether the packet loss rate is greater than the preset packet loss rate threshold and subsequent steps are returned. Of course, if the flow control of the input port itself is already turned off, then it remains turned off at this time. When it is determined that the input port is in a localized, occasional high-volume surge scenario, flow control for that input port can be enabled to ensure the reliability of data forwarding by the communication equipment.
[0086] In some embodiments, considering that bandwidth utilization also affects the overall performance of the communication device, when dynamically regulating the traffic of the input port, bandwidth utilization can also be used to determine whether to enable traffic control of the input port. That is, traffic characteristics can simultaneously include packet loss rate and bandwidth utilization, or simultaneously include packet loss rate, theoretical data forwarding rate, and bandwidth utilization, or simultaneously include packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization. In this case, the traffic control method for the communication device provided in this application embodiment further includes:
[0087] D1. If you choose to enable flow control for the above input ports, then check whether the output ports of the above communication devices are blocked.
[0088] Since output port blockage may trigger the activation of flow control on the input port, after determining that the flow control on the input port is enabled, it will be checked whether the output port is blocked.
[0089] D2. If the above output port is blocked, check whether the amount of data in the input buffer of the above input port is greater than or equal to the above high watermark.
[0090] After one or more output ports of a communication device are blocked, the amount of data that needs to be buffered in the input buffer of the input port of the communication device will usually increase, that is, the amount of data already buffered in the buffer may reach or exceed the preset high watermark.
[0091] D3. If the amount of data in the input buffer is greater than or equal to the high watermark, then select whether to continue to enable the flow control of the input port based on the bandwidth utilization.
[0092] The selection of flow control for enabling input ports includes the following situations: determining whether flow control can be enabled for input ports based on packet loss rate; determining whether flow control can be enabled for input ports based on packet loss rate and theoretical data forwarding rate; and determining whether flow control can be enabled for input ports based on packet loss rate, theoretical data forwarding rate, and actual forwarding rate.
[0093] In this embodiment, the decision to continue enabling the flow control of the input port can be made based on the current bandwidth utilization rate, or based on the decrease in bandwidth utilization rate calculated before and after enabling the flow control of the input port. For example, if the decrease in bandwidth utilization rate is greater than a preset threshold, the flow control of the input port can be disabled; otherwise, the flow control of the input port can be enabled.
[0094] The following example illustrates how to determine whether to continue enabling flow control for an input port based on the decrease in bandwidth utilization calculated before and after enabling flow control:
[0095] Suppose that in the current "one-to-many" communication model there is one input port port0 and four output ports port1 to port4. Before the flow control of the input port is enabled, the bandwidth utilization of ports2 to 4 is 90%. However, because port1 is suddenly blocked, it triggers the flow control of port0. Therefore, the actual forwarding rate of ports0, ports2 to 4 will inevitably decrease accordingly (because the upstream communication equipment stops sending packets to the input port).
[0096] Assume that before flow control is enabled on port0, the bandwidth utilization rates of ports 1 through 4 are r2, r3, and r4, respectively; after flow control is enabled on port0, the bandwidth utilization rates are R2, R3, and R4, respectively. Assume a threshold of 30% is set. If R / r is less than 70% (i.e., the bandwidth degradation rate exceeds 30%), it is considered that the bandwidth degradation is too high. In this case, disabling flow control on the input ports can guarantee the bandwidth utilization rates of ports 2 through 4.
[0097] It should be noted that the above embodiments provide a scheme for selecting whether to enable traffic control of the input port based on different combinations of traffic characteristics (such as only considering packet loss rate as a combination, considering packet loss rate and theoretical data forwarding efficiency as a combination, considering packet loss rate, theoretical data forwarding efficiency and actual forwarding rate as a combination, etc.). In actual practice, other combinations of traffic characteristics (such as considering theoretical data forwarding rate and actual forwarding rate as a combination) can also be used to select whether to enable traffic control of the input port, which will not be elaborated here.
[0098] Example 4:
[0099] In some embodiments, the flow control method for communication devices provided in this application further includes:
[0100] After selecting to disable flow control on the input port, the buffer of the aforementioned communication device is reallocated, wherein the input buffer of the aforementioned input port will be increased after reallocation.
[0101] By disabling flow control at the input port, the problem of severe performance degradation in the entire switching network caused by the blockage of a single link in a "one-to-many" communication model can be effectively solved.
[0102] In this embodiment of the application, in order to reduce the risk of packet loss and minimize timeout retransmissions, in a one-to-many communication model, the buffer of the input port can be increased after disabling flow control. Specifically, the output buffer of the output port can be reduced (e.g., the buffer of the output port at the actual forwarding rate can be reduced), and the additional buffer created by reducing the output buffer can be used as part of the input buffer of the input port to increase the input buffer.
[0103] In some embodiments, the flow control method for communication devices provided in this application further includes:
[0104] E1. During the network configuration phase (i.e., before the network is running), obtain the communication model to which the input port of the aforementioned communication device belongs.
[0105] In this embodiment, the communication scenario of the communication device needs to meet the following conditions: it must have a transport layer reliability mechanism. That is, if the communication scenario meets the above conditions, the communication model to which the input port belongs is determined before the network starts operating. Specifically, before the network starts operating, since no traffic is generated in the entire network system, the node information of the network topology of the network where the communication device is located can be obtained first. Based on the connection status of the network nodes, it can be determined which ports are uplink ports and which are downlink ports. Then, based on the connection status and number of uplink and downlink ports, the communication model to which the port belongs is determined. In some embodiments, the above communication scenario also accepts packet loss risk and retransmission risk.
[0106] E2. If the communication model to which the above input port belongs is the one-to-many model, then disable the flow control of the above input port; otherwise, enable the flow control of the above input port.
[0107] In this embodiment, during the network configuration phase, if it is determined that the communication model to which the input port belongs is a one-to-many model, then the flow control of that input port is first disabled; if it is determined that the communication model to which the input port belongs is a one-to-one model or a many-to-one model, then the flow control of that input port is first enabled. Since enabling flow control of the input port in a one-to-many communication model may cause a sharp decline in the performance of the communication device, disabling flow control of the input port in the one-to-many communication model during the configuration phase can avoid this situation. Meanwhile, since enabling flow control of the input port in a one-to-one or many-to-one communication model does not cause a sharp decline in the performance of the communication device, enabling flow control of the input ports in these communication models first can reduce packet loss events and thus improve network reliability.
[0108] In some embodiments, considering that current communication devices already support simple statistics on traffic volume and message type, the communication device can synchronize this information to the cloud. Simultaneously, the cloud currently supports directly issuing configuration information to the communication device or controlling the communication device to issue relevant commands. Therefore, to further reduce the computational burden on the communication device, the required computation is transferred to the cloud. In this case, the traffic control method for the communication device provided in this application embodiment further includes:
[0109] The communication device synchronizes the port information (such as port number, transmission protocol, etc.) and the data information transmitted between ports to the cloud. The cloud determines the communication model to which the input port belongs based on the received information, and calculates any of the following information of the communication device: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization.
[0110] Correspondingly, in step S11 above, the communication device receives the communication model sent by the cloud, and in step S12 above, the communication device receives the traffic characteristics sent by the cloud. The traffic characteristics include at least one of the following information: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization.
[0111] In this embodiment, bidirectional synchronization between the cloud and local machine is implemented because the communication device itself bears significant pressure during high-volume forwarding. The cloud, with its powerful computing capabilities, synchronizes the basic traffic and port information obtained by the communication device to the cloud, where it participates in complex calculations and returns the results to the communication device. The communication device then responds accordingly (e.g., enabling or disabling flow control at the input port). In other words, since the computational load required for the communication model, packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization of the input port is all implemented in the cloud, the computational load required by the communication device is reduced, thereby further lowering the cost of the communication device implementing the flow control method provided in this embodiment.
[0112] To more clearly describe the flow control method for the communication device provided in the embodiments of this application, the following is combined with... Figure 2 Describe it.
[0113] Step S201: Determine whether the communication scenario in which the communication device is located can accept a certain risk of packet loss and retransmission. If not, proceed to step S203; if yes, proceed to step S202.
[0114] Step S202: Determine whether the communication scenario has a transport layer reliability mechanism. If yes, proceed to step S204; otherwise, proceed to step S203.
[0115] Step S203: Enable traffic control for all ports.
[0116] Here, "all ports" refers to all input and output ports of the communication device.
[0117] Step S204: Obtain network node information and determine the communication model to which the input port belongs based on the network node information.
[0118] Specifically, communication scenarios that can accept a certain level of packet loss and retransmission risk, and that possess transport layer reliability mechanisms, include:
[0119] For example, (1) when students access the internet on campus, the TCP protocol used by the transport layer protocol to request resources can minimize the impact of packet loss as long as the average speed is fast enough. Furthermore, the TCP retransmission mechanism can ensure that in most cases there is only a certain delay, which has little impact on students' internet experience. In addition, since this type of communication scenario has a high tolerance for packet loss and retransmission, flow control with the input ports closed can be maintained as long as there is no large-scale packet loss and retransmission that causes a sharp drop in the overall actual forwarding efficiency of the switching network.
[0120] For example, (2) in places like scenic spots, shopping malls, and airports, users only need basic internet access, and their acceptance of packet loss and retransmission is relatively high. The internet access scenario for students on campus can be referenced; in reality, this scenario may have an even higher acceptance of packet loss and retransmission. That is, in these communication scenarios, when TCP protocol is used for transmission, the default communication scenario has a reliability mechanism, which can first disable the flow control of the input port, and then dynamically adjust the flow control of the input port according to the flow characteristics of the communication device.
[0121] For example, (3) office networks, enterprise intranet resource services, and campus intranet services have a lower tolerance for packet loss and retransmission compared to (1) and (2). However, in general, the transport layer protocol during internet access is also TCP, which has a reliability mechanism. Flow control on the input port can be turned off first, and then turned on again if actual packet loss has already occurred.
[0122] Specifically, communication scenarios that cannot accept a certain level of packet loss and retransmission risk, and / or lack transport layer reliability mechanisms, include:
[0123] (4) Industrial-grade networks, such as those used in mining, exploration, transportation, and smart factories, involve a large number of industrial-grade devices with extremely high security requirements. These scenarios often use UDP as the industrial-grade communication transport layer protocol, meaning they lack a default reliability mechanism. The tolerance for packet loss in these scenarios is almost zero. Therefore, flow control on the input ports needs to be enabled to prevent packet loss. Furthermore, these industrial-grade scenarios generally do not have peak or off-peak network periods, so the risk of large-volume surges is relatively low given a defined network specification. Therefore, enabling flow control will, in a sense, have almost no long-term adverse impact on the performance of the switching network.
[0124] Step S205: Determine whether the communication model is a one-to-many communication model. If yes, proceed to step S206; otherwise, proceed to step S207.
[0125] Step S206: Disable flow control on the input port.
[0126] Step S207: Enable flow control for the input port.
[0127] Step S208: Determine whether the amount of data in the input buffer of the input port is greater than or equal to the preset high water level. If yes, proceed to step S209; otherwise, end the dynamic flow control adjustment process.
[0128] Step S209: Obtain the traffic characteristics obtained during network operation, and recalculate the communication model to which the input port belongs based on the traffic characteristics.
[0129] Step S210: Determine whether the recalculated communication model belongs to a one-to-many communication model. If yes, proceed to step S212; otherwise, proceed to step S211.
[0130] Step S211: Enable flow control for the input port.
[0131] Step S212: Disable flow control on the input port.
[0132] Step S213: When the traffic characteristics include packet loss rate, determine whether the packet loss rate is greater than the preset packet loss rate threshold. If yes, proceed to step S211; otherwise, proceed to step S214.
[0133] Step S214: Determine whether the theoretical data forwarding rate of the input port is greater than the theoretical data forwarding rate of the output port. If yes, it indicates that this is a high-speed to low-speed situation. In this case, execute step S211. If no, execute step S215.
[0134] Step S215: Determine whether the data volume in the input buffer of the input port is greater than or equal to the preset high watermark. If yes, proceed to step S216; otherwise, proceed to step S212.
[0135] Step S216: Calculate the actual average forwarding rate of the input port in at least two recent historical time periods, and determine whether the input port is in a continuous and widespread high-traffic forwarding scenario or a localized and occasional high-traffic impact scenario based on the actual average forwarding rate of at least two historical time periods and the bandwidth of the input port.
[0136] Step S217: Determine that the input port is in a continuous and widespread high-traffic forwarding scenario.
[0137] Step S218: Determine that the input port is in a localized, occasional high-volume surge scenario.
[0138] Step S19: If it is determined that the input port is in a continuous and widespread high-traffic forwarding scenario, and the priority of performance is determined to be higher than the priority of reliability, then proceed to step S222.
[0139] Step S220: If it is determined that the input port is in a localized, occasional high-volume surge scenario, and the priority of reliability is determined to be higher than the priority of performance, then step S221 is executed.
[0140] Step S221: Enable flow control for the input port.
[0141] Step S222: Disable flow control on the input port.
[0142] Step S223: Based on enabling flow control of the input port, dynamically adjust the flow control of the input port according to the bandwidth utilization.
[0143] Step S224: Determine if the output port is blocked. If yes, proceed to step S225; otherwise, proceed to step S226.
[0144] Step S225: Determine whether the amount of data in the input buffer is greater than or equal to the preset high watermark. If not, proceed to step S226.
[0145] Step S226: Maintain flow control for the open input port.
[0146] Step S227: Determine that flow control is in effect.
[0147] Specifically, flow control taking effect means that when a port is determined to belong to a "one-to-many" communication model, and after a series of judgments, flow control has been enabled (such as when the packet loss rate is high), flow control will act on the input port whose input buffer has reached the high watermark. The input port sends a non-zero PAUSE frame to the upstream communication device, informing the upstream communication device to suspend sending data frames to the input port. In this case, it may cause a significant drop in the overall bandwidth utilization of the communication device, or it may not drop significantly. Therefore, it is necessary to make another judgment on the overall bandwidth utilization of the communication device afterward.
[0148] Step S228: Determine whether the overall bandwidth utilization has decreased significantly (e.g., determine the decrease in overall bandwidth utilization based on the bandwidth utilization before and after enabling the flow control of the input port). If yes, proceed to step S229; otherwise, proceed to step S230.
[0149] Step S229: Disable flow control on the input port.
[0150] Step S230: Optimize the network performance, and return to step S212 after optimization.
[0151] Example 5:
[0152] Corresponding to the flow control methods of the communication devices described in the various embodiments above, Figure 3 A structural block diagram of a flow control device for a communication device provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0153] Reference Figure 3 The flow control device 3 of the communication equipment includes: a communication model acquisition module 31, a flow characteristic acquisition module 32, and a flow control module 33. Wherein:
[0154] The communication model acquisition module 31 is used to acquire the communication model to which the input port of the communication device belongs at a preset first interval if the amount of data in the input buffer of the input port of the communication device is detected to be greater than or equal to a preset high watermark when the communication scenario of the communication device has a transport layer reliability mechanism. The communication model includes a one-to-many model, a many-to-one model and a one-to-one model.
[0155] The traffic feature acquisition module 32 is used to acquire the traffic features of the communication device at a preset second interval if the communication model to which the input port belongs is the one-to-many model. The traffic features include at least one of the following: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization.
[0156] The flow control module 33 is used to select whether to enable flow control of the input port based on the above flow characteristics.
[0157] In this embodiment, when the communication scenario of the communication device has a transport layer reliability mechanism, if the amount of data in the input buffer of the input port of the communication device is detected to be greater than or equal to a preset high watermark, the communication model to which the input port of the communication device belongs is obtained at a preset first interval. If the communication model to which the input port belongs is a one-to-many model, the traffic characteristics of the communication device are obtained at a preset second interval, and the flow control of the input port is selected based on these traffic characteristics. Since the communication scenario of the communication device has a transport layer reliability mechanism, even if the flow control of the input port is turned off after the amount of data in the input buffer of the input port is greater than or equal to the preset high watermark, reliable data transmission can still be achieved to a certain extent. That is, in this case, the flow control of the input port can be selected based on the flow characteristics of the communication device. Simultaneously, since the communication model is obtained at a preset first interval and the traffic characteristics are obtained at a preset second interval, the timeliness of the obtained communication model and traffic characteristics is guaranteed, thus ensuring the timeliness of flow control when performing flow control based on the obtained traffic characteristics. Furthermore, since traffic characteristics are only acquired when the communication model to which the input port belongs is a one-to-many model, and whether to enable traffic control for that input port is selected based on the acquired traffic characteristics, the accuracy of traffic control for that input port can be guaranteed. In addition, since traffic characteristics include at least one of the following: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization, and the computational load required for communication equipment to acquire these traffic characteristics is relatively small, the performance requirements for communication equipment are low, thus ensuring that traffic control for the input port can be implemented at a lower cost.
[0158] In some embodiments, the flow control device 3 of the communication device provided in this application further includes:
[0159] The flow control module for non-one-to-many models is used to enable flow control for the input port if the communication model to which the input port belongs is either the many-to-one model or the one-to-one model.
[0160] In some embodiments, the traffic characteristics include the packet loss rate, and the traffic control module 33 includes:
[0161] The packet loss rate comparison unit is used to determine whether the above packet loss rate is greater than the preset packet loss rate threshold.
[0162] The first flow control activation unit is used to activate the flow control of the input port if the packet loss rate is greater than the preset packet loss rate threshold.
[0163] In some embodiments, the above-mentioned traffic characteristics also include the above-mentioned theoretical data forwarding rate. The traffic control device 3 of the communication device provided in this application embodiment further includes:
[0164] The comparison result determination unit is used to determine whether the theoretical data forwarding rate of the input port of the communication device is greater than the theoretical data forwarding rate of the output port of the communication device if the packet loss rate is not greater than the preset packet loss rate threshold.
[0165] The first flow control activation unit is used to activate the flow control of the input port if the theoretical data forwarding rate of the input port is greater than the theoretical data forwarding rate of the output port.
[0166] In some embodiments, the above-mentioned traffic characteristics also include the above-mentioned actual forwarding rate. The traffic control device 3 of the communication device provided in this application embodiment further includes:
[0167] The data volume comparison unit is used to detect whether the data volume of the input buffer of the input port is greater than or equal to the high watermark if the theoretical data forwarding rate of the input port is not greater than the theoretical data forwarding rate of the output port.
[0168] The actual average forwarding rate determination unit is used to calculate the actual average forwarding rate of the input port of the communication device in at least two recent historical time periods if the amount of data in the input buffer of the input port is greater than or equal to the high watermark. The actual average forwarding rate is the average of the actual forwarding rates, and the at least two recent historical time periods are at least two adjacent time periods.
[0169] The flow control enable / disable first selection unit is used to select whether to continue disabling flow control of the input port based on at least two of the actual average forwarding rates of the input port and the bandwidth of the input port.
[0170] In some embodiments, the above-mentioned traffic characteristics also include the above-mentioned bandwidth utilization. The traffic control device 3 of the communication device provided in this application embodiment further includes:
[0171] The output port blocking detection unit is used to detect whether the output port of the communication device is blocked if flow control of the input port is selected to be enabled.
[0172] The water level detection unit is used to detect whether the amount of data in the input buffer of the input port is greater than or equal to the high water level if the output port is blocked.
[0173] The flow control second selection unit is used to select whether to continue to enable the flow control of the input port based on the bandwidth utilization if the amount of data in the input buffer is greater than or equal to the high water level.
[0174] In some embodiments, the flow control device 3 of the communication device provided in this application further includes:
[0175] The input buffer enlargement module is used to reallocate the buffer of the communication device after selecting to disable flow control of the input port, wherein the input buffer of the input port will be enlarged after reallocation.
[0176] In some embodiments, the flow control device 3 of the communication device provided in this application further includes:
[0177] The initial model information acquisition module is used to acquire the communication model to which the input port of the aforementioned communication device belongs during the network configuration phase.
[0178] The flow control configuration module is used to disable the flow control of the input port if the communication model to which the input port belongs is the one-to-many model, and otherwise enable the flow control of the input port.
[0179] In some embodiments, considering that current communication devices already support simple statistics on traffic volume and message type, the communication device can synchronize this information to the cloud. Simultaneously, the cloud currently supports directly issuing configuration information to the communication device or controlling the communication device to issue relevant commands. Therefore, to further reduce the computational burden on the communication device, the required computation is transferred to the cloud. In this case, the traffic control device 3 for the communication device provided in this application embodiment further includes:
[0180] The communication device synchronizes the port information (such as port number, transmission protocol, etc.) and the data information transmitted between ports to the cloud. The cloud determines the communication model to which the input port belongs based on the received information, and calculates any of the following information of the communication device: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization.
[0181] Correspondingly, the communication model acquisition module 31 described above is specifically used for:
[0182] If the amount of data in the input buffer of the input port of the aforementioned communication device is detected to be greater than or equal to a preset high watermark, the communication model to which the input port of the aforementioned communication device belongs is obtained from the cloud at a preset first interval.
[0183] Correspondingly, the traffic feature acquisition module 32 mentioned above is specifically used for:
[0184] If the communication model to which the above input port belongs is the one-to-many model, then the traffic characteristics of the communication device sent by the cloud are received at a preset second interval. The traffic characteristics include at least one of the following: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization.
[0185] In this embodiment, bidirectional synchronization between the cloud and local machine is implemented because the communication device itself bears significant pressure during high-volume forwarding. The cloud, with its powerful computing capabilities, synchronizes the basic traffic and port information obtained by the communication device to the cloud, where it participates in complex calculations and returns the results to the communication device. The communication device then responds accordingly (e.g., enabling or disabling flow control at the input port). In other words, since the computational load required for the communication model, packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization of the input port is all implemented in the cloud, the computational load required by the communication device is reduced, thereby further lowering the cost of the communication device implementing the flow control method provided in this embodiment.
[0186] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0187] Example 6:
[0188] Figure 4 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application. Figure 4 As shown, the communication device 4 in this embodiment includes: at least one processor 40 ( Figure 4 The diagram shows only one processor, memory 41, and computer program 42 stored in the memory 41 and executable on at least one processor 40. When the processor 40 executes the computer program 42, it implements the steps in any of the above method embodiments.
[0189] The aforementioned communication device 4 may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will understand that... Figure 4 This is merely an example of communication device 4 and does not constitute a limitation on communication device 4. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0190] The processor 40 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0191] In some embodiments, the aforementioned memory 41 may be an internal storage unit of the communication device 4, such as a hard disk or memory of the communication device 4. In other embodiments, the aforementioned memory 41 may be an external storage device of the communication device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the communication device 4. Furthermore, the aforementioned memory 41 may include both internal storage units and external storage devices of the communication device 4. The aforementioned memory 41 is used to store operating systems, applications, bootloaders, data, and other programs, such as the program code of the aforementioned computer programs. The aforementioned memory 41 may also be used to temporarily store data that has been output or will be output.
[0192] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0193] This application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, it implements the steps in any of the above method embodiments.
[0194] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the various method embodiments described above.
[0195] This application provides a computer program product that, when run on a communication device, enables the communication device to implement the steps described in the above-described method embodiments.
[0196] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0197] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0198] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0199] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0200] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0201] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A flow control method for a communication device, characterized in that, include: In the case that the communication scenario of the communication device has a transport layer reliability mechanism, if the amount of data in the input buffer of the input port of the communication device is detected to be greater than or equal to a preset high watermark, the communication model to which the input port of the communication device belongs is obtained at a preset first interval. The communication model includes a one-to-many model, a many-to-one model and a one-to-one model. The transport layer reliability mechanism refers to a mechanism that can reduce the packet loss rate. If the communication model to which the input port belongs is the one-to-many model, then the traffic characteristics of the communication device are obtained at a preset second interval. The traffic characteristics include at least one of the following: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization. Select whether to enable flow control for the input port based on the flow characteristics.
2. The flow control method for a communication device as described in claim 1, characterized in that, Also includes: If the communication model to which the input port belongs is the many-to-one model, or the one-to-one model, then flow control of the input port is enabled.
3. The flow control method for a communication device as described in claim 1, characterized in that, The traffic characteristics include the packet loss rate, and the step of selecting whether to enable traffic control for the input port based on the traffic characteristics includes: Determine whether the packet loss rate is greater than a preset packet loss rate threshold; If the packet loss rate is greater than the preset packet loss rate threshold, then the flow control of the input port is enabled.
4. The flow control method for a communication device as described in claim 3, characterized in that, The traffic characteristics also include the theoretical data forwarding rate, and after determining whether the packet loss rate is greater than a preset packet loss rate threshold, the following is also included: If the packet loss rate is not greater than the preset packet loss rate threshold, then determine whether the theoretical data forwarding rate of the input port of the communication device is greater than the theoretical data forwarding rate of the output port of the communication device. If the theoretical data forwarding rate of the input port is greater than the theoretical data forwarding rate of the output port, then flow control of the input port is enabled.
5. The flow control method for a communication device as described in claim 4, characterized in that, The traffic characteristics also include the actual forwarding rate. After determining whether the theoretical data forwarding rate of the input port of the communication device is greater than the theoretical data forwarding rate of the output port of the communication device, the method further includes: If the theoretical data forwarding rate of the input port is not greater than the theoretical data forwarding rate of the output port, then it is detected whether the data volume of the input buffer of the input port is greater than or equal to the high watermark. If the amount of data in the input buffer of the input port is greater than or equal to the high watermark, then the actual average forwarding rate of the input port of the communication device in at least two recent historical time periods is calculated, wherein the actual average forwarding rate is the average value of the actual forwarding rate, and the at least two recent historical time periods are at least two adjacent time periods. Based on at least two actual average forwarding rates of the input port and the bandwidth of the input port, select whether to enable flow control for the input port.
6. The flow control method for a communication device as described in any one of claims 3 to 5, characterized in that, The traffic characteristics also include the bandwidth utilization rate, and the traffic control method of the communication device further includes: If flow control of the input port is enabled, then the output port of the communication device is checked for blockage. If the output port is blocked, then check whether the amount of data in the input buffer of the input port is greater than or equal to the high watermark. If the amount of data in the input buffer is greater than or equal to the high watermark, then the decision is made on whether to continue enabling flow control of the input port based on the bandwidth utilization rate.
7. The flow control method for a communication device as described in claim 4 or 5, characterized in that, Also includes: After selecting to disable flow control of the input port, the buffer of the communication device is reallocated, wherein the input buffer of the input port will be increased after reallocation.
8. The flow control method for a communication device as described in any one of claims 1 to 5, characterized in that, Also includes: During the network configuration phase, the communication model to which the input port of the communication device belongs is obtained; If the communication model to which the input port belongs is the one-to-many model, then the flow control of the input port is turned off; otherwise, the flow control of the input port is turned on.
9. A flow control device for a communication equipment, characterized in that, include: The communication model acquisition module is used to acquire the communication model to which the input port of the communication device belongs at a preset first interval if the amount of data in the input buffer of the input port of the communication device is detected to be greater than or equal to a preset high watermark when the communication scenario of the communication device has a transport layer reliability mechanism. The communication model includes a one-to-many model, a many-to-one model and a one-to-one model. The transport layer reliability mechanism refers to a mechanism that can reduce the packet loss rate. The traffic feature acquisition module is used to acquire the traffic features of the communication device at a preset second interval if the communication model to which the input port belongs is the one-to-many model. The traffic features include at least one of the following: packet loss rate, theoretical data forwarding rate, actual forwarding rate, and bandwidth utilization. The flow control module is used to select whether to enable flow control of the input port based on the flow characteristics.
10. A communication device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 8.
11. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Flow rate control method, system, switch and router
CN101945037A
Broadcast multicast service flow control method and related equipment thereof
CN104093130A