A head gap calculation method, switch and product for flow control process

By detecting switch port optical module replacement events and updating the wire harness length in the SONiC system, the problem of head gap calculation errors caused by manual configuration errors is solved, and the accuracy of buffer configuration and network performance are improved.

CN118282986BActive Publication Date: 2024-10-01INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410703153.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-10-01
Estimated Expiration
2044-05-31

AI Technical Summary

Technical Problem

In the SONiC system, manual configuration of the switch port harness length can easily lead to errors in the head gap calculation results, which in turn affects buffer performance and packet transmission, leading to increased packet loss.

Method used

By detecting switch port optical module replacement events, reading the real-time wire harness length and updating the configuration database, the head gap value is recalculated based on the latest wire harness length to ensure the accuracy of the buffer configuration.

Benefits of technology

It improves the accuracy of head gap calculation, reduces the possibility of PFC failure, and improves network performance and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118282986B_ABST
    Figure CN118282986B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method for calculating the head gap of a flow control process, a switch, and a product, the method comprising: when a connection event of an optical module replacement is detected in the target port of the switch, the port management resident program reads the real-time harness length corresponding to the target port in the digital diagnostic monitoring information of the optical module; when the real-time harness length is inconsistent with the current harness length corresponding to the target port in the configuration database, the port management resident program replaces the current harness length in the configuration database with the real-time harness length; the buffer management resident program obtains the current harness length in the configuration database in response to the harness length update event; the buffer management resident program generates the latest head gap value according to the current harness length, updates the buffer configuration, and the buffer configuration is applied to the flow control process of the target port. The embodiment of the present application aims to improve the accuracy of the head gap calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of data processing, and in particular, to a method for calculating a head gap in a flow control process, a switch, and a product. Background Art

[0002] In data centers and cloud computing environments, high-performance and high-reliability network infrastructure is crucial. As the complexity of network devices continues to increase, the control and management of network traffic faces more and more challenges.

[0003] Priority-based Flow Control (PFC) is a network flow control mechanism that can reduce or avoid packet loss. To achieve the control effect of PFC, a suitable buffer needs to be set.

[0004] The setting value of a lossless priority queue (buffer priority group) buffer in the SONiC system (Software for Open Networking in the Cloud, an open source network operating system) includes the head gap. The port harness length of the switch will directly affect the calculation result of the head gap. In the current application of the SONiC system, the administrator manually adds the harness length of the switch port to the configuration database, and obtains the port harness length from the configuration database when calculating the head gap. However, the manual configuration of the harness length is prone to errors. For example, when the harness length changes, you may forget to update the harness length in the configuration in time, or set the harness length incorrectly. Inaccurate harness length configuration will cause a large error in the calculation result of the head gap, thereby causing the performance of the buffer to deteriorate and increase the loss of data packets. Summary of the invention

[0005] The embodiments of the present application provide a method for calculating the head gap in a flow control process, a switch, and a product, aiming to improve the accuracy of the head gap calculation.

[0006] In a first aspect, an embodiment of the present application provides a method for calculating a header gap in a flow control process, which is applied to a switch based on a SONiC system. The method includes:

[0007] When a connection event of optical module replacement occurs at the target port of the switch, the port management resident program reads the real-time harness length corresponding to the target port from the digital diagnostic monitoring information of the optical module;

[0008] When the real-time harness length is inconsistent with the current harness length corresponding to the target port in the configuration database, the port management resident program replaces the current harness length in the configuration database with the real-time harness length;

[0009] The buffer management resident program obtains the current harness length in the configuration database in response to a harness length update event;

[0010] The buffer management resident program generates the latest head gap value according to the current wire harness length and updates the buffer configuration, and the buffer configuration is applied to the flow control process of the target port.

[0011] Optionally, after detecting that a connection event of optical module replacement occurs at the target port of the switch, the method further includes:

[0012] Acquire digital diagnostic monitoring information of the optical module, and detect whether the digital diagnostic monitoring information of the optical module includes information on the real-time wire harness length;

[0013] When the digital diagnosis monitoring information of the optical module does not include the information of the real-time wire harness length, the real-time wire harness length corresponding to the target port is estimated and determined.

[0014] Optionally, when the digital diagnostic monitoring information of the optical module does not include the information of the real-time wire harness length, estimating and determining the real-time wire harness length corresponding to the target port includes:

[0015] When the digital diagnostic monitoring information of the optical module does not include the information of the real-time wire harness length, detecting whether the digital diagnostic monitoring information of the optical module includes information of the receiving power and the transmitting power corresponding to the target port;

[0016] When the digital diagnostic monitoring information of the optical module includes the information of the receiving power and the transmitting power, the receiving power and the transmitting power are obtained, and the real-time harness length corresponding to the target port is estimated and determined according to the receiving power and the transmitting power.

[0017] Optionally, estimating and determining a real-time wire harness length corresponding to the target port according to the receiving power and the transmitting power includes:

[0018] Determining a difference between the received power and the transmitted power;

[0019] The real-time wire bundle length corresponding to the target port is calculated according to the difference value and the attenuation rate of the optical fiber of the target port.

[0020] Optionally, the method further comprises:

[0021] Obtaining the optical fiber type of the target port from the digital diagnostic monitoring information of the optical module;

[0022] The attenuation rate of the optical fiber of the target port is determined according to the optical fiber type of the target port and a preset attenuation rate database, wherein the preset attenuation rate database stores attenuation rates corresponding to different optical fiber types.

[0023] Optionally, after detecting whether the digital diagnostic monitoring information of the optical module includes information on the receiving power and the transmitting power corresponding to the target port, the method further includes:

[0024] When the digital diagnosis monitoring information of the optical module does not include the information of the receiving power and the transmitting power, the real-time harness length corresponding to the target port is set to a default value.

[0025] Optionally, the buffer management resident program generates the latest head gap value according to the current harness length, including:

[0026] Determining the amount of data stored in the harness according to the current harness length and port rate corresponding to the target port;

[0027] Determine the transmission delay according to the amount of data stored in the wiring harness, the maximum length of the data packet transmission of the switch, the transmission delay from the data link layer MAC to the physical layer PHY, and the response delay of the opposite end;

[0028] The latest header gap value is calculated according to the transmission delay.

[0029] Optionally, according to the current harness length and port rate corresponding to the target port, the formula for determining the amount of data stored in the harness is:

[0030] kb_on_cable=(cable_length / speed of light)*port_speed

[0031] Among them, kb_on_cable is the amount of data stored in the cable bundle; cable_length is the current cable bundle length; speed of light is the speed of light; and port_speed is the port rate.

[0032] Optionally, according to the amount of data stored in the wiring harness, the maximum length of the data packet transmission of the switch, the transmission delay from the data link layer MAC to the physical layer PHY, and the response delay of the opposite end, the formula for determining the transmission delay is:

[0033] propagation_delay=mtu+2*kb_on_cable+mac / phy_delay+peer_response

[0034] Among them, propagation_delay is the transmission delay; mtu is the maximum length of the data packet transmission; kb_on_cable is the amount of data stored in the cable harness; mac / phy_delay is the transmission delay from the data link layer MAC to the physical layer PHY; peer_response is the response delay of the other end.

[0035] Optionally, according to the transmission delay, a formula for calculating the latest header gap value is:

[0036] headroom=lossless_mtu+propagation_delay*cell occupancy

[0037] Among them, headroom is the latest headroom value; lossless_mtu is the maximum length of lossless transmission of data packets; propagation_delay is the transmission delay; cell occupancy is the occupied space of the minimum unit of the buffer.

[0038] In a second aspect, an embodiment of the present application provides a switch, which is based on a SONiC system and is used to execute the header gap calculation method of the flow control process described in the first aspect of the embodiment.

[0039] In a third aspect, an embodiment of the present application provides a computer device, comprising: at least one processor, and a memory, wherein the memory stores a computer program that can be run on the processor, wherein when the processor executes the computer program, the head gap calculation method of the flow control process described in the first aspect of the embodiment is executed.

[0040] In a fourth aspect, an embodiment of the present application provides a non-volatile readable storage medium, wherein the non-volatile readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the head gap calculation method of the flow control process described in the first aspect of the embodiment is performed.

[0041] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the head gap calculation method of the flow control process described in the first aspect of the embodiment.

[0042] Beneficial effects:

[0043] When a connection event of optical module replacement occurs at the target port of the switch, the port management resident program reads the real-time harness length corresponding to the target port from the digital diagnostic monitoring information of the optical module; when the real-time harness length is inconsistent with the current harness length corresponding to the target port in the configuration database, the port management resident program replaces the current harness length in the configuration database with the real-time harness length; the buffer management resident program obtains the current harness length in the configuration database in response to a harness length update event; the buffer management resident program generates the latest head gap value based on the current harness length, updates the buffer configuration, and the buffer configuration is applied to the PFC flow control process of the target port.

[0044] The head gap calculation method for the flow control process provided by the present embodiment can, in a switch based on the SONiC system, read the real-time harness length from the digital diagnostic monitoring information of the optical module when the optical module of the switch port is replaced. When the actual harness length is inconsistent with the current harness length in the configuration database, the current harness length in the configuration database is updated to the real-time harness length, and the accurate and latest head gap value is recalculated based on the updated current harness length. Compared with the method of manually setting the harness length in the configuration database, the head gap value can be adjusted in time according to the change of the harness length, so that the buffer configuration adapts to all priority queues of the target port, reducing the possibility of PFC failure. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art.

[0046] Figure 1 A schematic diagram of flow buffering in the related art is shown;

[0047] Figure 2 A flowchart showing the steps of a head clearance calculation method in a flow control process provided by an embodiment of the present application is shown;

[0048] Figure 3 A flow chart of the head gap calculation method of the flow control process provided by an embodiment of the present application is shown;

[0049] Figure 4 A schematic diagram of a computer device provided in an embodiment of the present application is shown;

[0050] Figure 5 A schematic diagram of a non-volatile readable storage medium provided in an embodiment of the present application is shown;

[0051] Figure 6 A schematic diagram of a computer program product provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0052] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0053] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, each embodiment of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in each embodiment of the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not constitute any limitation, and the various embodiments can be combined with each other and referenced to each other without contradiction.

[0054] SONiC system: Software for Open Networking in the Cloud, an open source network operating system;

[0055] SFP (Small Form Pluggable) optical module is an interface device that converts gigabit electrical signals into optical signals and can be hot-swapped.

[0056] Portmgrd: Port management resident program used to control ports in the SONiC system;

[0057] Buffermgrd: Buffer management resident program used to manage buffers in SONiC system;

[0058] DDM: Digital Diagnostic Monitoring, digital diagnostic monitoring;

[0059] MAC: Media Access Control Address, media access control address;

[0060] PHY: Port Physical Layer, which can be called port physical layer in Chinese.

[0061] In data centers and cloud computing environments, high-performance and high-reliability network infrastructure is crucial. As the complexity of network devices continues to increase, the control and management of network traffic faces more and more challenges.

[0062] PFC (Priority-based Flow Control) is a network flow control mechanism that can reduce or avoid packet loss. For example, the sender's egress port sends a data packet to the receiver's ingress port. At the sender's egress port, the data packet is queued and sent in up to eight queues that are independent of each other in the data transmission process. Each queue corresponds to a priority. At the receiving port, the message is buffered in the corresponding ingress port queue. The core principle of PFC is that the downstream device controls a certain channel of the upstream device to start and stop sending data packets. The control method is to send PFCPause frames and Resume frames. If the switch uses the PFC function, it sends a PFC Pause frame to the upstream device to control a certain priority channel to pause sending messages. For the messages in transit after the switch sends Pause to the upstream device, a certain buffer needs to be reserved for processing. Buffer plays an important role in network devices. Appropriate buffer configuration can avoid packet loss.

[0063] Reference Figure 1 , shows a schematic diagram of traffic buffering in the related technology, where the switch is connected to an upstream device. When the switch sends a PFC Pause frame to the upstream device at time t1, but the upstream device receives the PFC Pause frame at time t2, the upstream device may have sent some messages during the time period from time t1 to time t2, and it is necessary to buffer the in-transit messages to avoid data loss.

[0064] Dynamic headroom calculating is a method to automatically generate lossless buffer values ​​in SONiC systems. The setting values ​​of a lossless priority group buffer include: reserve buffer size, shared buffer size, and headroom. Headroom is directly related to the flow control function of PFC. Its function is to buffer the traffic sent by the upstream device to the switch during the period from the PFC Pause frame sent by the switch to the Pause frame received by the upstream device. Therefore, if the headroom is not set properly, the PFC function may fail, which in turn leads to a decrease in network performance and an increase in packet loss.

[0065] In the dynamic head gap calculation method, the port harness length of the switch will directly affect the calculation result of the head gap. In the current application of the SONiC system, the administrator manually adds the harness length of the switch port to the configuration database, and obtains the port harness length from the configuration database when calculating the head gap. However, the manual configuration of the harness length is prone to errors. For example, after replacing the optical module, you may forget to update the harness length in the configuration in time, or set the harness length incorrectly. Inaccurate harness length configuration will lead to a decrease in buffer performance, resulting in a decrease in network performance and an increase in data packet loss.

[0066] Therefore, in order to solve the problem of inaccurate buffer configuration caused by manual configuration errors or omissions, an embodiment of the present application provides a head gap calculation method for a flow control process, which can improve the accuracy of the head gap calculation to ensure the accuracy of the buffer configuration and improve the stability and performance of the network.

[0067] Reference Figure 2 , shows a flowchart of the steps of a head gap calculation method of a flow control process provided by an embodiment of the present application, the method is applied to a switch based on a SONiC system, and the method may include the following steps:

[0068] S101: When a connection event of optical module replacement occurs at a target port of the switch, a port management resident program reads a real-time harness length corresponding to the target port from digital diagnostic monitoring information of the optical module.

[0069] In actual application, when an optical module is replaced at a port of a switch, the length of the wiring harness connected to the port may change, and the length of the wiring harness will directly affect the calculation result of the head gap. Therefore, the head gap needs to be adjusted in time according to the changed wiring harness length. For example, the optical module can be an SFP optical module, which is an interface device that converts gigabit electrical signals into optical signals and supports hot-swappable use.

[0070] In a feasible implementation, when the target port of the switch replaces the optical module, the port management resident program Portmgrd will detect a connection event, i.e., a link up event. After the port management resident program Portmgrd detects the link up event, the port management resident program Portmgrd can obtain digital diagnostic monitoring information of the optical module, i.e., DDM information, and detect whether the digital diagnostic monitoring information of the optical module includes real-time wire harness length information.

[0071] When the digital diagnostic monitoring information of the optical module, that is, the DDM information, contains the information of the real-time harness length, the port management resident program Portmgrd can directly read the real-time harness length.

[0072] When the digital diagnosis monitoring information of the optical module, ie, the DDM information, does not include the information of the real-time wire harness length, the port management resident program Portmgrd estimates and determines the real-time wire harness length corresponding to the target port.

[0073] In a feasible implementation manner, when the digital diagnostic monitoring information of the optical module does not include the information of the real-time wire harness length, the process of estimating and determining the real-time wire harness length corresponding to the target port by the port management resident program Portmgrd includes:

[0074] Detect whether the digital diagnostic monitoring information of the optical module contains information on the receiving power and the transmitting power corresponding to the target port; when the digital diagnostic monitoring information of the optical module contains information on the receiving power and the transmitting power, obtain the receiving power and the transmitting power, and estimate and determine the real-time harness length corresponding to the target port based on the receiving power and the transmitting power.

[0075] Specifically, when estimating and determining the real-time bundle length corresponding to the target port, the difference between the received power and the transmitted power is first determined; then, based on the difference and the attenuation rate of the optical fiber of the target port, the real-time bundle length corresponding to the target port is calculated.

[0076] For example, according to the received power and the transmitted power, the formula for estimating and determining the real-time wire harness length corresponding to the target port is:

[0077] cable_length1=(tx_power-rx_power) / decay_rate

[0078] Among them, cable_length1 is the real-time cable length; tx_power is the transmit power; rx_power is the receive power; decay_rate is the attenuation rate of the optical fiber of the target port.

[0079] Different optical fiber types have corresponding attenuation rates that are different. For example, the attenuation rate of a single-mode optical fiber is typically 0.5 dB / km.

[0080] Since other types of optical fibers may be replaced when an optical module is replaced, a preset attenuation rate database may be established to facilitate timely knowledge of the attenuation rate of the optical fiber of the target port. The preset attenuation rate database stores the attenuation rates corresponding to different optical fiber types. When the port management resident program Portmgrd estimates the real-time harness length corresponding to the target port, it can obtain the optical fiber type of the target port from the digital diagnostic monitoring information of the optical module, and then query the preset attenuation rate database based on the optical fiber type of the target port, thereby determining the attenuation rate corresponding to the optical fiber type of the target port.

[0081] In another feasible implementation, when the port management resident program Portmgrd detects whether the digital diagnostic monitoring information of the optical module contains the information of the receiving power and the transmitting power corresponding to the target port, when the digital diagnostic monitoring information of the optical module does not contain the information of the receiving power and the transmitting power, the real-time bundle length corresponding to the target port is set to a default value; the default value can be set to the attenuation rate corresponding to the most commonly used optical fiber type in the actual application scenario, which is not limited in this embodiment.

[0082] S102: When the real-time harness length is inconsistent with the current harness length corresponding to the target port in the configuration database, the port management resident program replaces the current harness length in the configuration database with the real-time harness length.

[0083] After determining the real-time harness length cable_length1 of the target port, the port management resident program Portmgrd compares it with the current harness length cable_length corresponding to the target port in the configuration database (config_db). If the real-time harness length is different from the current harness length in the configuration database, the current harness length in the configuration database is overwritten with the changed real-time harness length, that is, the value of the current harness length in the configuration database is updated to the value of the changed real-time harness length, so that the harness length in the configuration database can be updated in time.

[0084] If the real-time harness length is different from the current harness length in the configuration database, the port management resident program Portmgrd continues to monitor the next link up event of replacing the optical module.

[0085] S103: The buffer management resident program obtains the current harness length from the configuration database in response to the harness length update event.

[0086] The buffer management resident program Buffermgrd is registered in the configuration database. When the current harness length cable_length in the configuration database is updated, the buffer management resident program Buffermgrd can detect the harness length update event. In response to the harness length update event, the buffer management resident program Buffermgrd obtains the current harness length in the configuration database.

[0087] S104: The buffer management resident program generates the latest head gap value according to the current wire harness length, and updates the buffer configuration, and the buffer configuration is applied to the flow control process of the target port.

[0088] In a feasible implementation manner, the process of generating the latest head gap value according to the current harness length by the buffer management resident program Buffermgrd may include the following process:

[0089] A1: Determine the amount of data stored in the harness according to the current harness length and port rate corresponding to the target port.

[0090] For example, according to the current harness length and port rate corresponding to the target port, the formula for determining the amount of data stored in the harness is:

[0091] kb_on_cable=(cable_length / speed of light)*port_speed

[0092] Among them, kb_on_cable is the amount of data stored in the cable bundle; cable_length is the current cable bundle length; speed of light is the speed of light; and port_speed is the port rate.

[0093] A2: Determine the transmission delay according to the amount of data stored in the wiring harness, the maximum length of the data packet transmission of the switch, the transmission delay from the data link layer MAC to the physical layer PHY, and the response delay of the other end.

[0094] For example, according to the amount of data stored in the wiring harness, the maximum length of the data packet transmission of the switch, the transmission delay from the data link layer MAC to the physical layer PHY, and the response delay of the opposite end, the formula for determining the transmission delay is:

[0095] propagation_delay=mtu+2*kb_on_cable+mac / phy_delay+peer_response

[0096] Among them, propagation_delay is the transmission delay; mtu is the maximum length of the data packet transmission; kb_on_cable is the amount of data stored in the cable harness; mac / phy_delay is the transmission delay from the data link layer MAC to the physical layer PHY; peer_response is the response delay of the other end.

[0097] A3: Calculate the latest header gap value according to the transmission delay.

[0098] For example, according to the transmission delay, the formula for calculating the latest header gap value is:

[0099] headroom=lossless_mtu+propagation_delay*cell occupancy

[0100] Among them, headroom is the latest headroom value; lossless_mtu is the maximum length of lossless transmission of data packets; propagation_delay is the transmission delay; cell occupancy is the occupied space of the minimum unit of buffer; lossless_mtu and cell occupancy are defined by chip manufacturers.

[0101] In a feasible implementation, a dynamic headroom calculating script (Dynamic headroom calculating lua) may be created in the buffer management resident program Buffermgrd. After obtaining the current harness length cable_length, the buffer management resident program Buffermgrd inputs the current harness length cable_length into the dynamic headroom calculating script, and the dynamic headroom calculating script outputs the latest headroom value.

[0102] Specifically, the dynamic header gap calculation script can obtain the port speed corresponding to the target port (port_speed), the maximum length of data packet transmission (mtu), the transmission delay from the data link layer MAC to the physical layer PHY (mac / phy_delay), the peer response delay (peer_response), the maximum length of lossless data packet transmission (lossless_mtu), and the cell occupancy of the minimum buffer unit. According to the input current cable length (cable_length), the following calculation process is performed:

[0103] kb_on_cable=(cable_length / speed of light)*port_speed

[0104] propagation_delay=mtu+2*kb_on_cable+(mac / phy_delay)+peer_response

[0105] headroom=lossless_mtu+propagation_delay*cell occupancy

[0106] Among them, kb_on_cable is the amount of data stored in the cable bundle; cable_length is the current cable bundle length; speed of light is the speed of light; propagation_delay is the transmission delay; headroom is the latest headroom value.

[0107] After calculating the latest header gap value, the buffer configuration is updated according to the latest header gap value to make the buffer configuration more accurate. The updated buffer configuration is applied to all priority queues (bufferpriority groups) of the target port, which can ensure that the PFC function of the switch is operating normally and the traffic is lossless, thereby improving the performance of the network.

[0108] Reference Figure 3 , shows a flow chart of a method for calculating head gap in a flow control process provided by an embodiment of the present application, wherein the method includes the following process:

[0109] S1: The port management resident program detects a connection event in which an optical module is replaced.

[0110] S2: The port management resident program reads the digital diagnostic monitoring information of the optical module.

[0111] S3: The port management resident program determines whether the digital diagnostic monitoring information includes the real-time harness length.

[0112] When the digital diagnostic monitoring information does not include the real-time harness length, step S4 is executed;

[0113] When the digital diagnostic monitoring information includes the real-time harness length, step S7 is executed;

[0114] S4: The port management resident program detects whether the digital diagnosis monitoring information of the optical module contains information on the receiving power and the transmitting power corresponding to the target port.

[0115] When the digital diagnostic monitoring information includes information on the receiving power and the transmitting power, executing step S5;

[0116] When the digital diagnostic monitoring information does not include the information of the receiving power and the transmitting power, executing step S6;

[0117] S5: The port management resident program estimates and determines the real-time wire harness length corresponding to the target port according to the receiving power and the transmitting power.

[0118] After estimating and determining the real-time harness length corresponding to the target port, step S7 is executed.

[0119] S6: The port management resident program sets the real-time harness length corresponding to the target port to a default value.

[0120] After the real-time harness length corresponding to the target port is set to a default value, step S7 is executed.

[0121] S7: The port management resident program determines whether the real-time harness length is consistent with the current harness length corresponding to the target port in the configuration database.

[0122] When the real-time harness length is consistent with the current harness length corresponding to the target port in the configuration database, the process ends;

[0123] When the real-time harness length is inconsistent with the current harness length corresponding to the target port in the configuration database, step S8 is executed.

[0124] S8: The port management daemon overwrites the current harness length in the configuration database with the real-time harness length.

[0125] S9: The buffer management resident program obtains the current harness length from the configuration database in response to the harness length update event.

[0126] S10: The buffer management resident program calculates the latest head gap value according to the dynamic head gap calculation script and the current harness length.

[0127] S11: Update the buffer configuration according to the latest header gap value.

[0128] The head gap calculation method of the flow control process provided by the present embodiment can, in a switch based on the SONiC system, read the real-time harness length or estimate the real-time harness length in the digital diagnostic monitoring information (DDM) when the optical module of the switch port is replaced. When the actual harness length is inconsistent with the current harness length in the configuration database, the current harness length in the configuration database is updated to the real-time harness length, and the accurate and latest head gap value is recalculated based on the updated current harness length. Compared with the method of manually setting the harness length in the configuration database, the head gap value can be adjusted in time according to the change of the harness length, so that the buffer configuration adapts to all priority queues of the target port, reducing the possibility of PFC failure.

[0129] An embodiment of the present application also provides a switch, which is based on a SONiC system and is used to execute the head gap calculation method of the flow control process described in the embodiment.

[0130] Reference Figure 4 , shows a schematic diagram of a computer device provided in an embodiment of the present application, the computer device comprising: at least one processor 401, and a memory 402, the memory 402 storing a computer program that can be run on the processor 401, wherein the processor 401 executes the head gap calculation method of the flow control process described in the embodiment when executing the computer program.

[0131] Reference Figure 5 , shows a schematic diagram of a non-volatile readable storage medium provided in an embodiment of the present application, wherein the non-volatile readable storage medium 500 stores a computer program 501, wherein when the computer program 501 is executed by a processor, the head gap calculation method of the flow control process described in the embodiment is executed.

[0132] Reference Figure 6 , shows a schematic diagram of a computer program product provided in an embodiment of the present application, wherein the computer program product 600 includes a computer program / instruction 601, which, when executed by a processor, implements the head gap calculation method of the flow control process described in the embodiment.

[0133] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0134] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0135] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0138] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0139] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0140] Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for calculating head clearance in a flow control process, It is characterized in that Applied to a switch based on a SONiC system, the method comprises: When a connection event of optical module replacement occurs at the target port of the switch, the port management resident program reads the real-time harness length corresponding to the target port from the digital diagnostic monitoring information of the optical module; When the real-time harness length is inconsistent with the current harness length corresponding to the target port in the configuration database, the port management resident program replaces the current harness length in the configuration database with the real-time harness length; The buffer management resident program obtains the current harness length in the configuration database in response to a harness length update event; The buffer management resident program generates the latest head gap value according to the current wire harness length and updates the buffer configuration, wherein the buffer configuration is applied to the flow control process of the target port; Among them, the buffer management resident program generates the latest header gap value according to the current harness length, including: determining the amount of data stored in the harness according to the current harness length and port rate corresponding to the target port; determining the transmission delay according to the amount of data stored in the harness, the maximum length of data packet transmission of the switch, the transmission delay from the data link layer MAC to the physical layer PHY, and the response delay of the opposite end; and calculating the latest header gap value according to the transmission delay.

2. The method according to claim 1, It is characterized in that After detecting that a connection event of optical module replacement occurs at the target port of the switch, the method further includes: Acquire digital diagnostic monitoring information of the optical module, and detect whether the digital diagnostic monitoring information of the optical module includes information on the real-time wire harness length; When the digital diagnosis monitoring information of the optical module does not include the information of the real-time wire harness length, the real-time wire harness length corresponding to the target port is estimated and determined.

3. The method according to claim 2, It is characterized in that When the digital diagnostic monitoring information of the optical module does not include the information of the real-time wire harness length, estimating and determining the real-time wire harness length corresponding to the target port includes: When the digital diagnostic monitoring information of the optical module does not include the information of the real-time wire harness length, detecting whether the digital diagnostic monitoring information of the optical module includes information of the receiving power and the transmitting power corresponding to the target port; When the digital diagnostic monitoring information of the optical module includes the information of the receiving power and the transmitting power, the receiving power and the transmitting power are obtained, and the real-time harness length corresponding to the target port is estimated and determined according to the receiving power and the transmitting power.

4. The method according to claim 3, It is characterized in that According to the receiving power and the transmitting power, estimating and determining the real-time wire harness length corresponding to the target port includes: Determining a difference between the received power and the transmitted power; The real-time wire bundle length corresponding to the target port is calculated according to the difference value and the attenuation rate of the optical fiber of the target port.

5. The method according to claim 4, It is characterized in that The method further comprises: Obtaining the optical fiber type of the target port from the digital diagnostic monitoring information of the optical module; The attenuation rate of the optical fiber of the target port is determined according to the optical fiber type of the target port and a preset attenuation rate database, wherein the preset attenuation rate database stores attenuation rates corresponding to different optical fiber types.

6. The method according to claim 3, It is characterized in that After detecting whether the digital diagnostic monitoring information of the optical module contains information on the receiving power and the transmitting power corresponding to the target port, the method further includes: When the digital diagnosis monitoring information of the optical module does not include the information of the receiving power and the transmitting power, the real-time harness length corresponding to the target port is set to a default value.

7. The method according to claim 1, It is characterized in that According to the current harness length and port rate corresponding to the target port, the formula for determining the amount of data stored in the harness is: kb_on_cable=(cable_length / speed of light)*port_speed Among them, kb_on_cable is the amount of data stored in the cable bundle; cable_length is the current cable bundle length; speed of light is the speed of light; and port_speed is the port rate.

8. The method according to claim 7, It is characterized in that According to the amount of data stored in the harness, the maximum length of the data packet transmission of the switch, the transmission delay from the data link layer MAC to the physical layer PHY, and the response delay of the other end, the formula for determining the transmission delay is: propagation_delay=mtu+2*kb_on_cable+mac / phy_delay+peer_response Among them, propagation_delay is the transmission delay; mtu is the maximum length of the data packet transmission; kb_on_cable is the amount of data stored in the cable harness; mac / phy_delay is the transmission delay from the data link layer MAC to the physical layer PHY; peer_response is the response delay of the other end.

9. The method according to claim 8, It is characterized in that According to the transmission delay, the formula for calculating the latest header gap value is: headroom=lossless_mtu+propagation_delay*cell occupancy Among them, headroom is the latest headroom value; lossless_mtu is the maximum length of lossless transmission of data packets; propagation_delay is the transmission delay; cell occupancy is the occupied space of the minimum unit of the buffer.

10. A computer device, It is characterized in that include: At least one processor, and a memory, wherein the memory stores a computer program that can be run on the processor, wherein when the processor executes the computer program, the head gap calculation method of the flow control process according to any one of claims 1-9 is executed.

11. A non-volatile readable storage medium, It is characterized in that The non-volatile readable storage medium stores a computer program, wherein the computer program, when executed by a processor, performs the head gap calculation method of the flow control process according to any one of claims 1 to 9.

12. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instruction is executed by a processor, the head clearance calculation method of the flow control process described in any one of claims 1-9 is implemented.