CN115426317B - Data transmission rate control method and device and electronic equipment - Google Patents

Data transmission rate control method and device and electronic equipment Download PDF

Info

Publication number
CN115426317B
CN115426317B CN202211368991.XA CN202211368991A CN115426317B CN 115426317 B CN115426317 B CN 115426317B CN 202211368991 A CN202211368991 A CN 202211368991A CN 115426317 B CN115426317 B CN 115426317B
Authority
CN
China
Prior art keywords
client
port number
port
server
fast retransmission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211368991.XA
Other languages
Chinese (zh)
Other versions
CN115426317A (en
Inventor
姚涵毅
石峰
王国锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Information Technologies Co Ltd
Original Assignee
New H3C Information Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Information Technologies Co Ltd filed Critical New H3C Information Technologies Co Ltd
Priority to CN202211368991.XA priority Critical patent/CN115426317B/en
Publication of CN115426317A publication Critical patent/CN115426317A/en
Application granted granted Critical
Publication of CN115426317B publication Critical patent/CN115426317B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/19Flow control; Congestion control at layers above the network layer
    • H04L47/193Flow control; Congestion control at layers above the network layer at the transport layer, e.g. TCP related
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/27Evaluation or update of window size, e.g. using information derived from acknowledged [ACK] packets
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

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

Abstract

The embodiment of the application provides a data transmission rate control method and device and electronic equipment. In this embodiment, the port numbers at both ends of the target TCP connection for mirror mount, which are established between the client and the server and acquired in the user mode, are sent to the kernel mode, so that the kernel mode monitors the ACK packet according to the port numbers at both ends, and when the density of the fast retransmission packet DUP ACK is greater than the set density threshold, the current notification receiving window of the target TCP connection is adjusted, so that the client sends the packet according to the adjusted notification receiving window, thereby only adjusting the receiving window of the target TCP connection, controlling the direct data transmission rate of the target TCP connection, and not affecting the normal data transmission of other TCP connections.

Description

Data transmission rate control method and device and electronic equipment
Technical Field
The present application relates to the field of data transmission, and in particular, to a method and an apparatus for controlling a data transmission rate, and an electronic device.
Background
When a System is installed in an Operating System (OS) of a server, a client (e.g., a keyboard, a video mouse, a network file System, etc.) is often required to send an image data packet to a Baseboard Management Controller (BMC) of the server through a shared network card of the server, and then the BMC transmits the image data packet to the OS, where the process of transmitting the image data packet from the client to the OS is called image mounting. In the mirror image mounting process, the shared Network card sends a mirror image data packet to the BMC through a Network Controller-side Interface (NC-SI) channel, the NC-SI is a communication protocol only supporting hundreds of megabytes, when the client is connected with the shared Network card through a gigabit Network, the speed of sending the mirror image data packet to the shared Network card is far faster than the speed of sending a message to the BMC through the NC-SI channel by the shared Network card, so that a buffer area provided for the BMC in the shared Network card is subjected to message accumulation, and further, the storage space of the buffer area is small, so that the message overflow and the packet loss are caused.
Currently, mirror mount is often implemented based on Transmission Control Protocol (TCP). In order to reduce the packet loss, the notification receiving window is modified in the TCP system file corresponding to the TCP protocol (i.e. equivalent to the notification receiving window with the modified TCP protocol), so that the client sends the packet according to the modified notification receiving window. In addition to the mirror image data packet, other data may be included in the data transmitted by using the TCP protocol, so that modifying the advertisement receiving window in the TCP system file corresponding to the TCP protocol may affect normal transmission of the other data.
Disclosure of Invention
In view of this, embodiments of the present application provide a data transmission rate control method to control a data transmission rate without affecting normal data transmission of other TCP connections.
According to a first aspect of the embodiments of the present application, a method for controlling a data transmission rate is provided, where the method is applied to a baseboard management controller BMC of a server, and the method includes:
acquiring port numbers of two ends of a target TCP connection which is established between a client and a server and used for mirror image mounting in a user mode, and sending the port numbers of the two ends from the user mode to a kernel mode; the first port number in the port numbers of the two ends is the port number corresponding to the port on the client, and the second port number is the port number corresponding to the port on the server;
monitoring a rapid retransmission repeat acknowledgement character (DUP ACK) message transmitted to the client by the server through the target TCP connection based on the port numbers at the two ends in a kernel state; the DUPACK message is sent by the server when the server confirms that the mirror image data packet sent by the client is lost;
if the situation that the set packet loss condition is not met currently is determined, calculating the fast retransmission density of the client based on the monitored DUP ACK message; when the density of the fast retransmission is larger than the set density threshold, adjusting the current notification receiving window of the target TCP connection to a target notification receiving window, so that the client transmits a message according to the target notification receiving window, wherein the target notification receiving window is smaller than the current notification receiving window.
According to a second aspect of the embodiments of the present application, there is provided a data transmission rate control apparatus, where the method is applied to a baseboard management controller BMC of a server, and the apparatus includes:
the port number acquisition module is used for acquiring port numbers of two ends of a target TCP connection which is established between a client and a server and used for mirror image mounting in a user mode, and sending the port numbers of the two ends from the user mode to a kernel mode; the first port number in the port numbers of the two ends is the port number corresponding to the port on the client, and the second port number is the port number corresponding to the port on the server;
the monitoring module is used for monitoring a rapid retransmission repeat acknowledgement character (DUP) ACK message transmitted to the client by the server through the target TCP connection in a kernel mode based on the port numbers at the two ends; the DUPACK message is sent by the server when the server confirms that the mirror image data packet sent by the client is lost;
the notification receiving window adjusting module is used for calculating the fast retransmission density of the client based on the monitored DUP ACK message if the current set packet loss condition is not met; when the density of the fast retransmission is larger than the set density threshold, adjusting the current notification receiving window of the target TCP connection to a target notification receiving window, so that the client transmits a message according to the target notification receiving window, wherein the target notification receiving window is smaller than the current notification receiving window.
According to a third aspect of embodiments of the present application, there is provided an electronic apparatus including: a processor and a memory;
wherein the memory is to store machine executable instructions;
the processor is configured to read and execute the machine executable instructions stored by the memory to implement the method of the first aspect.
In this embodiment, the port numbers at both ends of the target TCP connection for mirror mount, which are established between the client and the server and acquired in the user mode, are sent to the kernel mode, so that the kernel mode monitors the ACK packet according to the port numbers at both ends, and when the density of the fast retransmission packet DUP ACK is greater than the set density threshold, the current notification receiving window of the target TCP connection is adjusted, so that the client sends the packet according to the adjusted notification receiving window, thereby only adjusting the receiving window of the target TCP connection, controlling the direct data transmission rate of the target TCP connection, and not affecting the normal data transmission of other TCP connections.
Drawings
Fig. 1 is a schematic diagram of system installation networking provided in an embodiment of the present application.
Fig. 2 is a flowchart of a method provided by an embodiment of the present application.
Fig. 3 is a flow chart of port number acquisition when a client is an NFS according to an embodiment of the present application.
Fig. 4 is a diagram of an example of a determination process for when to acquire a first port number and a second port number according to an embodiment of the present application.
Fig. 5 is a flowchart of calculating density of fast retransmission according to an embodiment of the present disclosure.
Fig. 6 is an exemplary diagram of fast packet retransmission provided in the embodiment of the present application.
Fig. 7 is a diagram of an apparatus provided in an embodiment of the present application.
Fig. 8 is a schematic diagram of a hardware structure of an apparatus according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if," as used herein, may be interpreted as "at \8230; \8230when" or "when 8230; \823030when" or "in response to a determination," depending on the context.
In order to make the technical solutions provided in the embodiments of the present application better understood and make the above objects, features and advantages of the embodiments of the present application more comprehensible, the technical solutions in the embodiments of the present application are described in further detail below with reference to the accompanying drawings.
In order to solve the packet loss, as an embodiment, the mirror image mount is usually implemented based on a Transmission Control Protocol (TCP), and specifically, after receiving a mirror image packet sent by a client, a server sends a size (i.e., an advertised receiving window) of a message that the server can receive the message to the client through an Acknowledgement Character (ACK) message, so that the client sends the message according to the advertised receiving window. When the packet loss occurs, modifying the notice receiving window (namely, the notice receiving window equivalent to the modified TCP protocol) in the TCP system file corresponding to the TCP protocol, and sending the modified notice receiving window to the client, so that the client sends a message according to the modified notice receiving window. In addition to the mirror image data packet, other data may be included in the data transmitted by using the TCP protocol, so that modifying the advertisement receiving window in the TCP system file corresponding to the TCP protocol may affect normal transmission of the other data.
Therefore, the embodiment of the present application provides a data transmission rate control method to realize the control of the data transmission rate without affecting the normal data transmission of other TCP connections.
The method provided by the embodiments of the present application is described below:
as shown in fig. 1, fig. 1 is a schematic diagram of system installation and networking according to an embodiment of the present application. In this embodiment, the client may be a Keyboard Video Mouse (KVM), an H5 KVM, an encrypted H5 KVM, a Network File System (NFS), a Common Internet File System (CIFS), and the like, which is not limited in this embodiment. Here, H5 is a language description HTML5 for building Web contents of a new generation.
In the networking shown in fig. 1, the networking further includes a server shown in fig. 1, where the server includes: sharing network card, OS and BMC. Here, the shared network card refers to a network card shared by the BMC and the OS of the server. The shared Network Interface provided by the shared Network card can be used as a service Interface to be directly connected with the OS, and can also be connected to the BMC through a Network Controller-side Interface (NC-SI) channel to support substrate management. Here, NC-SI is a communication protocol supporting only one hundred megabytes between Ethernet and BMC.
In this embodiment, the sharing network card may be: i350, the embodiments of the present application are not particularly limited.
Based on the networking shown in fig. 1, the method provided by the embodiment of the present application is described below with reference to fig. 2, and is applied to a baseboard management controller BMC of a server. As shown in fig. 1, the process may include the following steps:
s210: acquiring port numbers at two ends of a target TCP connection which is established between a client and a server and used for mirror image mounting in a user mode, and sending the port numbers at the two ends from the user mode to a kernel mode; the first port number in the port numbers of the two ends is the port number corresponding to the first port on the client, and the second port number is the port number corresponding to the first port on the server.
Illustratively, in this embodiment, the user mode and the kernel mode are two operating states of the BMC.
In this embodiment, the first port of the TCP connection is a port on the client, and the second port number is a port on the server. The port on the server is a port fixedly used for mirror mount, and the port on the client may be a port configured randomly, which is not limited in this embodiment of the present application.
For example, in this embodiment, the target TCP connection may be a connection that is monitored by the server to upload the system image file to the client.
For example, in this embodiment, in this step S210, there are many methods for obtaining port numbers at two ends in the target TCP connection in the user mode, and the method may be determined according to different clients, and this embodiment of the present application is not particularly limited.
For example, when the client is the KVM, the H5 KVM, the encrypted H5 KVM, or the like, in the user mode, the related library function may be directly called to obtain the first port number and the second port number, for example, the conventional getpeername function is used to obtain the first port number, and the conventional getsockname function is used to obtain the second port number.
For another example, when the client is the NFS, how to obtain the port numbers of the two ends of the target TCP connection for mirror mount, which is established between the client and the server in the user mode, may refer to the following description of the example in the embodiment, which is not repeated herein.
In this embodiment, in this step S210, for a specific implementation of sending the port numbers at the two ends from the user mode to the kernel mode, reference may be made to the following description of examples, which is not repeated herein.
S220: and in the kernel mode, monitoring a rapid retransmission repeat acknowledgement character (DUP ACK) message transmitted to the client by the server through the target TCP connection based on the port numbers of the two ends.
Illustratively, in this embodiment, the DUP ACK packet is sent by the server when it is confirmed that the mirror packet sent by the client is lost. In this embodiment, the kernel monitors the DUP ACK packet transmitted between a port on the client and a port on the server based on port numbers at both ends.
S230: if the situation that the set packet loss condition is not met currently is determined, calculating the fast retransmission density of the client based on the monitored DUP ACK message; when the density of the fast retransmission is larger than the set density threshold value, the current notification receiving window of the target TCP connection is adjusted to be a target notification receiving window, so that the client transmits the message according to the target notification receiving window, and the target notification receiving window is smaller than the current notification receiving window.
For example, the set density threshold may be set in advance in a user mode and a kernel mode, and may be set through an Intelligent Platform Management Interface (IPMI) command, for example. It should be noted that, initially, after the density threshold is set, the density threshold may be modified subsequently by an IPMI command.
For example, in this embodiment, in this step S230, when the density of fast retransmission is greater than the set density threshold, it is recorded that the set packet loss condition is currently achieved, and the current notification receiving window of the target TCP connection is adjusted to the target notification receiving window, and the operation of calculating the density of fast retransmission of the client based on the monitored DUP ACK packet is not performed any more. Here, the target advertisement reception window is smaller than the current advertisement reception window; and when the density of the fast retransmission is smaller than or equal to the set density threshold value, keeping the current notification receiving window of the target TCP connection unchanged, recording that the current packet loss condition is not reached, and returning to execute the step of calculating the density of the fast retransmission of the client based on the monitored DUP ACK message if the current packet loss condition is not reached.
Correspondingly, in this embodiment, in step S230, when it is determined that the set packet loss condition is not met, the packet loss condition may be directly obtained from the record.
In this embodiment, the target advertisement receiving window may be set in advance according to experience, and may be directly invoked when the current advertisement receiving window is adjusted. It should be noted that, in the actual process, the target advertisement receiving window may be modified by the IPMI command.
For example, in this embodiment, in this step S230, the adjusting the current advertised receiving window of the target TCP connection to the target advertised receiving window may specifically be adjusting the current advertised receiving window corresponding to the advertised receiving window field in the ACK packet sent to the client to the target advertised receiving window.
For how to calculate the density of the fast retransmission, reference may be made to the following detailed description of the embodiments, which is not repeated here.
Thus, the flow shown in fig. 1 is completed.
As can be seen from the flow of fig. 1, in the embodiment of the present application, the two port numbers of the target TCP connection for mirror image mounting, which are acquired between the client and the server in the user state, are sent to the kernel state, so that the kernel state monitors an ACK packet according to the two port numbers, and when the density of the fast retransmission packet DUP ACK is greater than the set density threshold, the current notification receiving window of the target TCP connection is adjusted, so that the client sends a packet according to the adjusted notification receiving window, so as to only adjust the receiving window of the target TCP connection, control the direct data transmission rate of the target TCP connection, and do not affect the normal data transmission of other TCP connections.
For the NFS client, due to its own function implementation mechanism, when acquiring the first port number and the second port number, remote Procedure Call (rpc) is invoked in a kernel mode to complete the acquisition, and the first port number and the second port number cannot be directly acquired in a user mode. Therefore, an optional implementation manner of the embodiment of the present application provides a method for indirectly acquiring a first port number and a second port number, and how to acquire port numbers of two ends of a target TCP connection for mirror mount, which is established between a client and a server in a user mode when the client is a network file system NFS, is described below:
referring to fig. 3, fig. 3 is a flow chart of port number obtaining when a client is an NFS according to an embodiment of the present application. As shown in fig. 3, the process may include the following steps:
s310: and acquiring the first port number and the client IP address from the acquired NFS system file in the user mode.
Exemplarily, in this embodiment, the NFS system file may be a/proc/fs/nfsfs/servers file, where the/proc/fs/nfsfs/servers file is automatically generated and maintained by the linux system, and the/proc/fs/nfsfs/servers file includes a first port number and a client IP address. In step S310, the first port number and the client IP address are directly obtained from the/proc/fs/nfsfs/servers file.
S320: and searching a second port number corresponding to the keyword in the obtained TCP system file by taking the first port number and the IP address of the client as the keywords.
For example, in this embodiment, the TCP system file may be a/proc/net/TCP file or a/proc/net/TCP 6 file, where the TCP system file stores corresponding relationships between client port numbers and corresponding client IP addresses of all TCP connections, and between client IP addresses and server port numbers and server IP addresses. In this embodiment, after the first port number and the client IP address are obtained, the second port number corresponding to the keyword is searched in the obtained/proc/net/tcp file or/proc/net/tcp 6 file by using the first port number and the client IP address as the keyword.
So far, the description of the flow shown in fig. 3 is completed.
The flow of fig. 3 realizes that the first port number and the second port number in the target TCP connection are obtained when the client is the network file system NFS.
Referring to fig. 4, fig. 4 is a diagram illustrating an example of a determination process for when to acquire a first port number and a second port number according to an embodiment of the present application. As shown in fig. 4, the process may include the following steps:
s410: when detecting the mirror image mounting in the user mode, detecting whether the mirror image mounting process meets the specified packet loss detection condition and whether the server side starts the speed control function.
For example, in this embodiment, the specified packet loss detection condition may be: the working mode of using the designated type of the shared network card, using the shared network port and using the shared network card is giga and above giga, that is, the working mode of simultaneously satisfying the designated type of the shared network card, using the shared network port and using the shared network card is giga and above giga, the condition of satisfying the designated packet loss detection can be confirmed.
In this embodiment, the specified type of the shared network card may be an I350 network card, and of course, the specified type of the shared network card may also be a network card of another type, which is not specifically limited in this embodiment of the application.
For the detection using the designated sharing network card, the designated network card is described as an I350 network card, and may be obtained through a first preset command (for example, an NC-SI 0x15 command provided in an NC-SI manual). For example, when a command NC-SI 0x15 is input in the BMC user mode and 49 35 is received, the network card is indicated to be an I350 network card. The first preset command is not specifically limited in the embodiment of the present application, and may be set according to an actual situation.
For detection using a shared portal, conventional getifaddrs functions may be used for acquisition.
For the detection that the working model of the used shared network card is giga or more, in this embodiment, the negotiation rate may be obtained through a second preset command (for example, an NC-SI 0X0A command provided in an NC-SI manual), and if the negotiation rate is giga or ten trillion, it is determined that the used shared network card is giga or more.
Illustratively, in this embodiment, the rate control function is configured in advance in the user mode and the kernel mode, and may be set by an IPMI command, for example.
It should be noted that, the determination of the specified packet loss condition and the detection of the start of the rate control function may be performed simultaneously, or first determine whether the specified packet loss condition is met, and then detect whether the rate control function is started, or first detect whether the rate control function is started, and then determine whether the specified packet loss condition is met, which is not specifically limited in the embodiment of the present application.
S420: if the mirror image mounting process meets the specified packet loss condition and the server side has started the speed control function, executing the step of acquiring port numbers of two ends of the target TCP connection for mirror image mounting established between the client side and the server side in the user mode.
For example, in this embodiment, if it is detected that the current mirror mount process satisfies the specified packet loss condition and the server has started the rate control function, the step of obtaining port numbers at two ends of the target TCP connection for mirror mount, which is already established between the client and the server, in the user state is executed, and if it is detected that the current mirror mount process does not satisfy the specified packet loss condition and/or the server does not start the rate control function, the step of obtaining port numbers at two ends of the target TCP connection for mirror mount, which is already established between the client and the server, in the user state is not required to be executed, and the client is directly notified to send the mirror data packet.
Thus, the description of the flow shown in fig. 4 is completed.
The determination of when to acquire the first port number and the second port number is accomplished by FIG. 4.
Referring to fig. 5, fig. 5 is a flowchart for calculating the density of fast retransmissions according to an embodiment of the present application. As shown in fig. 5, the process may include the following steps:
s510: when a quick retransmission event is initiated, if the times of the quick retransmission event are not recorded at present, recording the times of the quick retransmission event, setting the times of the quick retransmission event as a set value, and recording a first sending timestamp of a first DUP ACK message in the quick retransmission event; and if the number of the rapid retransmission events is recorded currently, increasing a set value on the recorded number of the rapid retransmission events.
For example, in this embodiment, one fast retransmission event is to send a preset number of consecutive and same DUP ACK messages, where the preset number may be 3, and this embodiment is not limited in particular.
For example, as shown in fig. 6, when the packet 3 sent by the client is lost, the server respectively feeds back a DUP ACK3 packet after receiving the packet 4, the packet 5, and the packet 6, and when the client receives 3 identical DUP ACK3 packets, the server sends the packet 3 again. Here, when 3 DUP ACK3 s are continuously fed back, it is recorded as a fast retransmission event.
In this embodiment, the kernel mode records the number of fast retransmit events. When a fast retransmission event is initiated, if the number of times of the fast retransmission event is not recorded at present, the number of times of the fast retransmission event is not recorded at present as a set value (for example, 1), and a first sending timestamp of a first DUP ACK message in the fast retransmission event is recorded at the same time; if the number of the fast retransmission events is recorded currently, the set value is increased on the number of the recorded fast retransmission events.
S520: and if the current quick retransmission event frequency is a preset retransmission frequency threshold value, recording a second sending timestamp of the first DUP ACK message in the last quick retransmission event.
For example, in this embodiment, the preset retransmission number threshold may be obtained through a test in advance, for example, the preset number may be 50 times or 60 times, and this embodiment of the present application is not particularly limited and may be determined according to an actual situation.
In this embodiment, in step S520, when the number of the current fast retransmission events is the preset retransmission number threshold, the second sending timestamp of the first DUP ACK packet in the last fast retransmission event is recorded.
S530: a difference between the timestamps of the first and second timestamps is calculated.
S540: and determining the density of the fast retransmission according to the difference of the timestamps and a preset retransmission time threshold value.
For example, in this embodiment, there may be a plurality of implementation methods for determining the density of the fast retransmission according to the difference between the timestamps and the threshold of the number of retransmissions.
The above-specified calculation formula may be the following formula:
Figure 489086DEST_PATH_IMAGE002
wherein,
Figure 343910DEST_PATH_IMAGE004
indicating the density of fast retransmissions;
Figure DEST_PATH_IMAGE006
representing a preset retransmission time threshold;
Figure DEST_PATH_IMAGE008
indicating the difference in time stamps.
It should be noted that, when the density of the fast retransmission is less than or equal to the set density threshold, the recorded number of the currently unrecorded fast retransmission events is cleared from 0, and the number of the fast retransmission events is recorded again.
This completes the description of the flow shown in fig. 5.
The density of fast retransmissions is calculated by the procedure shown in fig. 5.
As an optional implementation manner of this embodiment, in step S210, sending the port numbers at the two ends from the user mode to the kernel mode includes:
and writing the first port number and the second port number into the newly added file system in the kernel mode in the user mode so as to transmit the first port number and the second port number to the kernel mode.
Exemplarily, in this embodiment, before the above steps are performed, a file system is newly added under the proc directory in the kernel state, that is, a global variable is defined, and the file system is used for implementing the transfer of the first port number and the second port number. The file system comprises a tcp _ cd _ local _ port file and a tcp _ cd _ destination _ port file, wherein the tcp _ cd _ local _ port file is used for writing a second port number, and the tcp _ cd _ destination _ port file is used for writing a first port number.
In this embodiment, the newly added file system is opened by calling a related function in the user mode, and then the first port number is written into the tcp _ cd _ destination _ port file of the newly added file system, and the second port number is written into the tcp _ cd _ local _ port file of the newly added file system.
For the kernel mode, the tcp _ cd _ local _ port file and the tcp _ cd _ destination _ port file are global variables defined in the kernel mode, so that the global variables of the kernel mode can be modified by a file writing method in the user mode, and port number transmission is realized.
Corresponding to the embodiments of the method, the present specification also provides embodiments of the apparatus and the terminal applied thereto.
As shown in fig. 7, fig. 7 is a block diagram of a data transmission rate control device applied to a baseboard management controller BMC of a server according to an exemplary embodiment, where the data transmission rate control device includes:
the port number acquisition module is used for acquiring port numbers at two ends of a target TCP connection which is established between a client and a server and used for mirror image mounting in a user mode, and sending the port numbers at the two ends from the user mode to a kernel mode; the first port number in the port numbers of the two ends is the port number corresponding to the first port on the client, and the second port number is the port number corresponding to the first port on the server;
the monitoring module is used for monitoring a rapid retransmission repeat acknowledgement character (DUP ACK) message transmitted to the client by the server through the target TCP connection based on port numbers of two ends in the kernel state; the DUP ACK message is sent by the server side when the mirror image data packet sent by the client side is confirmed to be lost;
the notification receiving window adjusting module is used for calculating the fast retransmission density of the client based on the monitored DUP ACK message if the current set packet loss condition is not met; when the density of the fast retransmission is larger than the set density threshold value, the current notification receiving window of the target TCP connection is adjusted to be a target notification receiving window, so that the client transmits the message according to the target notification receiving window, and the target notification receiving window is smaller than the current notification receiving window.
As an optional implementation manner of this embodiment, when the client is a network file system NFS, the port number obtaining module is specifically configured to:
acquiring a first port number and a client IP address from an obtained NFS system file in a user mode;
and searching a second port number corresponding to the keyword in the obtained TCP system file by taking the first port number and the IP address of the client as the keywords.
As an optional implementation manner of this embodiment, the data transmission rate control apparatus further includes:
the first recording module is used for keeping a current notification receiving window of the target TCP connection unchanged when the density of the quick retransmission is smaller than or equal to a set density threshold value, recording that the set packet loss condition is not reached currently, and returning to the step of calculating the density of the quick retransmission of the client based on the monitored DUP ACK message if the fact that the set packet loss condition is not reached currently is determined;
and the second recording module is used for recording that the current packet loss condition is reached and finishing the operation of monitoring the DUP ACK message when the density of the quick retransmission is greater than the set density threshold value.
As an optional implementation manner of this embodiment, the data transmission rate control apparatus further includes:
the detection module is used for detecting whether the mirror mounting process meets specified packet loss detection conditions and whether a server side starts a rate control function or not when the mirror mounting is detected in a user mode, wherein the specified packet loss detection conditions are as follows: the working modes of using the sharing network card with the designated model, using the sharing network port and using the sharing network card are kilomega and above kilomega;
and the execution module is used for executing the step of acquiring port numbers at two ends of the target TCP connection for mirror mounting established between the client and the server in a user mode if the mirror mounting process meets the specified packet loss detection condition and the server is started with a rate control function.
As an optional implementation manner of this embodiment, the notification reception window adjusting module is specifically configured to:
when a quick retransmission event is initiated, if the number of times of the quick retransmission event is not recorded at present, recording the number of times of the quick retransmission event, setting the number of times of the quick retransmission event as a set value, and recording a first sending timestamp of a first DUP ACK message in the quick retransmission event; if the number of the fast retransmission events is recorded at present, a set value is added to the recorded number of the fast retransmission events;
if the current fast retransmission event frequency is a preset retransmission frequency threshold value, recording a second sending timestamp of a first DUP ACK message in the last fast retransmission event;
calculating a difference between the timestamps of the first timestamp and the second timestamp;
and determining the density of the fast retransmission according to the difference of the timestamps and a preset retransmission time threshold value.
As an optional implementation manner of the embodiment of the present application, the port number obtaining module is specifically configured to:
and writing the first port number and the second port number into the newly added file system in the kernel mode in the user mode so as to transmit the first port number and the second port number to the kernel mode.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
Correspondingly, an embodiment of the present application further provides a hardware structure diagram of the apparatus shown in fig. 7, and specifically as shown in fig. 8, the electronic device may be a device for implementing the method described above. As shown in fig. 8, the hardware structure includes: a processor and a memory.
Wherein the memory is to store machine executable instructions;
the processor is configured to read and execute the machine executable instructions stored in the memory to implement the corresponding method embodiments of data transfer rate control as shown above.
For one embodiment, the memory may be any electronic, magnetic, optical, or other physical storage device that may contain or store information such as executable instructions, data, and the like. For example, the memory may be: volatile memory, non-volatile memory, or similar storage media. In particular, the Memory may be a RAM (random Access Memory), a flash Memory, a storage drive (e.g., a hard disk drive), a solid state disk, any type of storage disk (e.g., an optical disk, a DVD, etc.), or similar storage medium, or a combination thereof.
Up to this point, the description of the electronic apparatus shown in fig. 8 is completed.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Other embodiments of the present description will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.
It will be understood that the present description is not limited to the precise arrangements described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (9)

1. A data transmission rate control method is characterized in that the method is applied to a Baseboard Management Controller (BMC) of a server side, and the method comprises the following steps:
acquiring port numbers of two ends of a target TCP connection which is established between a client and a server and used for mirror image mounting in a user mode, and sending the port numbers of the two ends from the user mode to a kernel mode; the first port number in the port numbers of the two ends is the port number corresponding to the port on the client, and the second port number is the port number corresponding to the port on the server;
monitoring a rapid retransmission repeat acknowledgement character (DUP ACK) message transmitted to the client by the server through the target TCP connection based on the port numbers at the two ends in a kernel state; the DUPACK message is sent by the server when the server confirms that the mirror image data packet sent by the client is lost;
if the packet loss condition is not met currently, when a fast retransmission event is initiated, if the fast retransmission event times are not recorded currently, recording the fast retransmission event times, setting the fast retransmission event times as a set value, and recording a first sending timestamp of a first DUP ACK message in the fast retransmission event; if the number of the fast retransmission events is recorded currently, the set value is added to the recorded number of the fast retransmission events; if the current fast retransmission event frequency is a preset retransmission frequency threshold value, recording a second sending timestamp of a first DUP ACK message in the last fast retransmission event; calculating a timestamp difference between the first transmission timestamp and the second transmission timestamp; determining the density of the fast retransmission according to the difference of the timestamps and the preset retransmission time threshold; when the density of the fast retransmission is larger than the set density threshold, adjusting the current notification receiving window of the target TCP connection to a target notification receiving window, so that the client transmits a message according to the target notification receiving window, wherein the target notification receiving window is smaller than the current notification receiving window.
2. The method according to claim 1, wherein the client is a network file system NFS, and the obtaining, in the user mode, port numbers of two ends of a target TCP connection for mirror mount that has been established between the client and the server includes:
acquiring a first port number and a client IP address from the acquired NFS system file in the user mode;
and searching a second port number corresponding to the keyword in the obtained TCP system file by taking the first port number and the IP address of the client as keywords.
3. The method of claim 1, further comprising:
when the density of the fast retransmission is smaller than or equal to a set density threshold value, keeping a current notification receiving window of the target TCP connection unchanged, recording that a set packet loss condition is not reached currently, and returning to the step of calculating the density of the fast retransmission of the client based on the monitored DUP ACK message if the fact that the set packet loss condition is not reached currently is determined;
and when the fast retransmission density is larger than the set density threshold value, recording that the set packet loss condition is reached currently, and finishing the operation of calculating the fast retransmission density of the client based on the monitored DUP ACK message.
4. The method according to claim 1, wherein before obtaining port numbers of two ends of a target TCP connection for mirror mount already established between the client and the server in the user mode, the method further comprises:
when detecting the mirror image mounting in the user mode, detecting whether the mirror image mounting process meets a specified packet loss detection condition and whether the server side starts a rate control function, wherein the specified packet loss detection condition is as follows: the working modes of using the shared network card with the appointed model, using the shared network port and using the shared network card are kilomega and above kilomega;
and if the mirror image mounting process is detected to meet the specified packet loss detection condition and the server side is started with the rate control function, executing a step of acquiring port numbers of two ends of the target TCP connection for mirror image mounting established between the client side and the server side in a user mode.
5. The method of claim 1, wherein sending the port numbers from the user mode to the kernel mode comprises:
and writing the first port number and the second port number into a file system which is newly added in the kernel mode in the user mode so as to transmit the first port number and the second port number to the kernel mode.
6. A data transmission rate control device is characterized in that the device is applied to a Baseboard Management Controller (BMC) of a server side, and the device comprises:
the port number acquisition module is used for acquiring port numbers of two ends of a target TCP connection which is established between a client and a server and used for mirror image mounting in a user mode, and sending the port numbers of the two ends from the user mode to a kernel mode; the first port number in the port numbers of the two ends is the port number corresponding to the port on the client, and the second port number is the port number corresponding to the port on the server;
the monitoring module is used for monitoring a rapid retransmission repeat acknowledgement character (DUP) ACK message transmitted to the client by the server through the target TCP connection in a kernel mode based on the port numbers at the two ends; the DUPACK message is sent by the server when the server confirms that the mirror image data packet sent by the client is lost;
a notification receiving window adjusting module, configured to, if it is determined that a set packet loss condition is not met currently, when initiating a fast retransmission event, if the number of times of the fast retransmission event is not recorded currently, record the number of times of the fast retransmission event and set the number of times of the fast retransmission event as a set value, and record a first sending timestamp of a first DUP ACK packet in the fast retransmission event; if the number of the fast retransmission events is recorded currently, the set value is added to the recorded number of the fast retransmission events; if the current fast retransmission event frequency is a preset retransmission frequency threshold value, recording a second sending timestamp of a first DUP ACK message in the last fast retransmission event; calculating a difference between timestamps of the first transmission timestamp and the second transmission timestamp; determining the density of the fast retransmission according to the difference of the timestamps and the preset retransmission time threshold; when the density of the fast retransmission is larger than the set density threshold, adjusting the current notification receiving window of the target TCP connection to a target notification receiving window, so that the client transmits a message according to the target notification receiving window, wherein the target notification receiving window is smaller than the current notification receiving window.
7. The apparatus according to claim 6, wherein the client is a network file system NFS, and the port number obtaining module is specifically configured to:
acquiring a first port number and a client IP address from the acquired NFS system file in the user mode;
and searching a second port number corresponding to the keyword in an obtained TCP system file by taking the first port number and the client IP address as keywords, wherein the TCP system file is used for storing the corresponding relation of the first port number, the client IP address, the second port number and the server IP address determined based on the target TCP connection.
8. The apparatus of claim 6, further comprising:
a first recording module, configured to, when the density of the fast retransmission is smaller than or equal to a set density threshold, keep a current notification receiving window of the target TCP connection unchanged, record that a set packet loss condition is not currently reached, and return to perform a step of calculating the density of the fast retransmission of the client based on the monitored DUP ACK packet if it is determined that the set packet loss condition is not currently reached;
and the second recording module is used for recording that the current set packet loss condition is reached when the density of the quick retransmission is greater than the set density threshold value, finishing the operation of calculating the density of the quick retransmission of the client based on the monitored DUP ACK message.
9. An electronic device, characterized in that the electronic device comprises: a processor and a memory;
wherein the memory is to store machine executable instructions;
the processor is configured to read and execute the machine-executable instructions stored in the memory to implement the method of any one of claims 1 to 5.
CN202211368991.XA 2022-11-03 2022-11-03 Data transmission rate control method and device and electronic equipment Active CN115426317B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211368991.XA CN115426317B (en) 2022-11-03 2022-11-03 Data transmission rate control method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211368991.XA CN115426317B (en) 2022-11-03 2022-11-03 Data transmission rate control method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN115426317A CN115426317A (en) 2022-12-02
CN115426317B true CN115426317B (en) 2023-03-24

Family

ID=84207820

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211368991.XA Active CN115426317B (en) 2022-11-03 2022-11-03 Data transmission rate control method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115426317B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116208495B (en) * 2022-12-26 2024-09-20 超聚变数字技术有限公司 Network performance tuning method, BMC and server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222311A (en) * 2008-01-29 2008-07-16 杭州华三通信技术有限公司 Real-time packet loss recovery method, system and receiving terminal unit
CN110505533A (en) * 2019-07-09 2019-11-26 杭州亿圣信息技术有限公司 A kind of method that TCP transmission of video carries out error code Retransmission control
CN111786748A (en) * 2019-08-29 2020-10-16 北京京东尚科信息技术有限公司 Data retransmission method and system, network card, device, server and storage medium
CN112491655A (en) * 2020-11-20 2021-03-12 中国建设银行股份有限公司 Method and device for determining TCP transmission exception type, electronic equipment and storage medium
WO2022116178A1 (en) * 2020-12-04 2022-06-09 华为技术有限公司 Tcp mss adjustment method, apparatus, and system

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6219713B1 (en) * 1998-07-07 2001-04-17 Nokia Telecommunications, Oy Method and apparatus for adjustment of TCP sliding window with information about network conditions
JP3637389B2 (en) * 2001-11-21 2005-04-13 独立行政法人情報通信研究機構 Packet communication method and proposed node
US7912060B1 (en) * 2006-03-20 2011-03-22 Agere Systems Inc. Protocol accelerator and method of using same
AU2007210948A1 (en) * 2006-02-01 2007-08-09 Bob Tang Immediate ready implementation of virtually congestion free guaranteed service capable network: external internet NextGenTCP NextGenFTP NextGenUDPs
US8509080B2 (en) * 2009-06-29 2013-08-13 The Chinese University Of Hong Kong Network traffic accelerator
CN102006283B (en) * 2010-10-21 2013-07-17 意法·爱立信半导体(北京)有限公司 Data transmission method and device
US8724471B2 (en) * 2011-03-02 2014-05-13 Mobidia Technology, Inc. Methods and systems for sliding bubble congestion control
CN102355462B (en) * 2011-10-09 2015-05-20 大唐移动通信设备有限公司 Method and device for realizing TCP (Transmission Control Protocol) transmission
US9118569B2 (en) * 2013-04-06 2015-08-25 Citrix System, Inc. Systems and methods for TCP Westwood hybrid approach
US9350663B2 (en) * 2013-09-19 2016-05-24 Connectivity Systems Incorporated Enhanced large data transmissions and catastrophic congestion avoidance over TCP/IP networks
US9749340B2 (en) * 2015-04-28 2017-08-29 Arbor Networks, Inc. System and method to detect and mitigate TCP window attacks
CN108270682B (en) * 2016-12-30 2022-06-24 华为技术有限公司 Message transmission method, terminal, network equipment and communication system
CN112583874B (en) * 2019-09-30 2024-02-20 中兴通讯股份有限公司 Message forwarding method and device of heterogeneous network
CN113765626B (en) * 2020-06-01 2022-11-11 大唐移动通信设备有限公司 Data transmission method and device of mobile communication system
CN114301996B (en) * 2021-12-10 2024-06-28 山石网科通信技术股份有限公司 Transmission data processing method and device
CN114302451A (en) * 2021-12-31 2022-04-08 网络通信与安全紫金山实验室 Data transmission method, system and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222311A (en) * 2008-01-29 2008-07-16 杭州华三通信技术有限公司 Real-time packet loss recovery method, system and receiving terminal unit
CN110505533A (en) * 2019-07-09 2019-11-26 杭州亿圣信息技术有限公司 A kind of method that TCP transmission of video carries out error code Retransmission control
CN111786748A (en) * 2019-08-29 2020-10-16 北京京东尚科信息技术有限公司 Data retransmission method and system, network card, device, server and storage medium
CN112491655A (en) * 2020-11-20 2021-03-12 中国建设银行股份有限公司 Method and device for determining TCP transmission exception type, electronic equipment and storage medium
WO2022116178A1 (en) * 2020-12-04 2022-06-09 华为技术有限公司 Tcp mss adjustment method, apparatus, and system

Also Published As

Publication number Publication date
CN115426317A (en) 2022-12-02

Similar Documents

Publication Publication Date Title
US8135979B2 (en) Collecting network-level packets into a data structure in response to an abnormal condition
RU2527756C1 (en) Apparatus and method for executing function of dns resolution agent
KR101028639B1 (en) Managed object replication and delivery
CN115004673B (en) Message pushing method, device, electronic equipment and computer readable medium
CN106411629B (en) Method and equipment for monitoring state of CDN node
CN108933798B (en) Data storage method, storage server and system
WO2009021318A1 (en) Cache expiry in multiple-server environment
CN115426317B (en) Data transmission rate control method and device and electronic equipment
US20170153909A1 (en) Methods and Devices for Acquiring Data Using Virtual Machine and Host Machine
EP3331213A1 (en) Access to data on a remote device
US9727394B2 (en) Establishing causality order of computer trace records
JP2019016042A (en) Data acquisition program, device, and method
KR100671635B1 (en) Service management using multiple service location managers
CN111556135A (en) Request scheduling method, system and device and electronic equipment
US20170134532A1 (en) Method and apparatus for serving and managing storage of data streams in a surveillance and/or monitoring system
CN111787256B (en) Management method, device, medium and electronic equipment for pre-alarm video
EP3852363A1 (en) Device state monitoring method and apparatus
WO2023221947A1 (en) Data transmission method for cloud application, and computing device and computer storage medium
CN110677683B (en) Video storage and video access method and distributed storage and video access system
CN114301872B (en) Domain name based access method and device, electronic equipment and storage medium
CN114827017B (en) Communication method and device of Kafka cluster, electronic equipment and storage medium
CN111367921A (en) Data object refreshing method and device
US8615548B1 (en) System and method for deferred data downloading
CN104580276A (en) Information pushing method, device and system, as well as information access device
CN112653731A (en) Video monitoring storage node addressing method, system and storage medium

Legal Events

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