CN116962256A - Method, terminal, electronic equipment and medium for determining TCP congestion window - Google Patents

Method, terminal, electronic equipment and medium for determining TCP congestion window Download PDF

Info

Publication number
CN116962256A
CN116962256A CN202211336228.9A CN202211336228A CN116962256A CN 116962256 A CN116962256 A CN 116962256A CN 202211336228 A CN202211336228 A CN 202211336228A CN 116962256 A CN116962256 A CN 116962256A
Authority
CN
China
Prior art keywords
message
field
messages
determining
data
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.)
Pending
Application number
CN202211336228.9A
Other languages
Chinese (zh)
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.)
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
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 China Mobile Communications Group Co Ltd, China Mobile Communications Ltd Research Institute filed Critical China Mobile Communications Group Co Ltd
Priority to CN202211336228.9A priority Critical patent/CN116962256A/en
Publication of CN116962256A publication Critical patent/CN116962256A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0882Utilisation of link capacity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures

Abstract

The application provides a method, a terminal, electronic equipment and a medium for determining a TCP congestion window, wherein the method comprises the following steps: under the condition that a terminal sends a first message carrying payload data and based on TCP protocol, determining a second message in the last opposite direction received by the terminal before the first message is sent from a message in the opposite direction of a session where the first message is located, and associating a second message index number to message information of the first message; sequencing the first message and a plurality of third messages to obtain a sequencing result, wherein the third messages are messages which are required to be sent by the terminal after receiving the second messages; and determining the value of the congestion window associated with the sequencing result from the TCP serial number of the first message, the payload data length of the first message and the TCP acknowledgement serial number of the second message. By the method and the device, the accuracy of congestion window determination is ensured.

Description

Method, terminal, electronic equipment and medium for determining TCP congestion window
Technical Field
The application relates to the field of computers and provides a method, a terminal, electronic equipment and a medium for determining a TCP congestion window.
Background
In measuring a TCP (Transmission Control Protocol ) session, the number of bytes in transit (Byte in flight), i.e. the number of bytes that have been sent out but have not yet been acknowledged, is typically used as the congestion window. The congestion window determining mode is directly related to the message obtaining and measuring positions of communication networks through which the two receiving and transmitting sides pass. As shown in fig. 1, a mobile phone is taken as a receiving party, a server is taken as a sending party, and DPI (Deep Packet Inspection ) equipment in a network is taken as a measuring point, so that the time sequence of a message of the sending party is inconsistent with the time sequence of the receiving party. Because the time sequence of the message of the sender and the message of the receiver is inconsistent with the point of the congestion window measurement, a larger error exists between the congestion window measurement result and the real congestion window size of the sender, and the error becomes larger as the distance between the measurement point and the communication node of the sender increases.
There is currently no effective solution to the above-described problems in the related art.
Disclosure of Invention
The embodiment of the application provides a method, a terminal, electronic equipment and a medium for determining a TCP congestion window, which are used for solving the problem that the congestion window measurement result and the real congestion window size of a sender have larger errors due to inconsistent message time sequences of the sender and the receiver in the related technology.
In order to solve the technical problems, the application is realized as follows:
in a first aspect, an embodiment of the present application provides a method for determining a congestion window of a transmission control protocol TCP, which is applied to a terminal, where the method includes: under the condition that the terminal sends a first message carrying payload data and based on TCP protocol, determining a second message in the last opposite direction received by the terminal before the first message is sent from a message in the opposite direction of a session where the first message is located, and associating the second message index number to message information of the first message; sequencing the first message and a plurality of third messages to obtain a sequencing result, wherein the third messages are messages which are required to be sent by the terminal after the terminal receives the second messages; and determining the value of a congestion window associated with the sequencing result according to the TCP sequence number of the first message, the payload data length of the first message and the TCP acknowledgement sequence number of the second message.
In a second aspect, an embodiment of the present application provides a terminal, including: the first processing module is used for determining a second message in the last opposite direction received before the first message is sent from the messages in the opposite direction of the session where the first message is located under the condition of sending a first message based on TCP protocol carrying payload data, and associating the second message index number to the message information of the first message; the ordering module is used for ordering the first message and a plurality of third messages to obtain an ordering result, wherein the third messages are messages which the terminal needs to send after receiving the second messages; and the first determining module is used for determining the value of the congestion window associated with the sequencing result according to the TCP sequence number of the first message, the payload data length of the first message and the TCP acknowledgement sequence number of the second message.
In a third aspect, an embodiment of the present application provides an electronic device, including a transceiver and a processor, where the transceiver is configured to receive and send a packet; the processor is configured to determine, when the terminal sends a first packet based on a TCP protocol and carrying payload data, a second packet in a last opposite direction received by the terminal before the first packet is sent from a packet in an opposite direction of a session in which the first packet is located, and associate the second packet index number to packet information of the first packet; sequencing the first message and a plurality of third messages to obtain a sequencing result, wherein the third messages are messages which are required to be sent by the terminal after the terminal receives the second messages; and determining the value of a congestion window associated with the sequencing result according to the TCP sequence number of the first message, the payload data length of the first message and the TCP acknowledgement sequence number of the second message.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor performs the steps as described in the first aspect above.
In a fifth aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps as described in the first aspect above.
In the embodiment of the application, after the terminal receives the first message, the last message in the received direction, namely the second message, can be searched, and then the third message between the second message and the first message is sequenced in time, so that the value of the congestion window associated with the sequencing result is determined based on the TCP sequence number of the first message, the payload data length of the first message and the TCP acknowledgement sequence number of the second message, namely the congestion window between the second message and the first message is determined. Therefore, the method ensures the accuracy of congestion window determination by sequencing and then determining the corresponding congestion window, and solves the problem that the congestion window measurement result and the real congestion window size of the sender have larger errors due to inconsistent message time sequences of the sender and the receiver in the related technology.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort to a person of ordinary skill in the art.
FIG. 1 is a flow chart of the transceiving of messages in the related art;
fig. 2 is a flowchart of a method for determining a TCP congestion window according to an embodiment of the present application;
fig. 3 is a flowchart of another method for determining a TCP congestion window according to an embodiment of the application;
FIG. 4 is a schematic diagram of a neural network model according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an electronic device according to an embodiment of the present application;
fig. 7 is a schematic diagram of another electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
TCP is a connection-oriented, reliable, byte stream based transport layer communication protocol. The method comprises the steps that reliable communication is provided through a retransmission mechanism, specifically, TCP sets a Sequence Number (SEQ) for each data packet, when a receiving end successfully receives the data packet A, an acknowledgement packet (ACK) of the data packet A is sent to a sending end, the acknowledgement packet carries the Sequence Number of the data packet A, and if the sending end does not receive the acknowledgement packet of the data packet A within a certain time, the sending end considers that the data packet A is lost, and then retransmits the data packet A. To avoid network congestion, TCP uses a sliding window throttling, bulk transport mechanism. Specifically, the transmitting end transmits a plurality of data packets (i.e. packet groups) in batches according to bytes specified by a Sliding Window (SW), after the packet group transmission of one batch is completed, the transmitting end stops transmitting the data packets until a Round-Trip Time (RTT) is reached, that is, after the transmitting end receives a confirmation packet sent by the receiving end to the packet group of the previous batch, the transmitting end starts the packet group transmission of the new batch again.
As can be seen from the above transmission mechanism, in addition to the round trip delay, the size of the sliding window and the mechanism and algorithm for increasing or adjusting the sliding window are also important indicators for determining the transmission rate of TCP, and a transmission window is generally used to measure the maximum amount of data that can be transmitted by the sender in one round trip delay. The sending window is generally determined by the congestion status of the network (congestion window), the maximum transmission capacity of the sender, the maximum receiving capacity of the receiver (receiving window), and the mechanism and algorithm for adjusting the sending window when the sender should congestion in the network, and the minimum value of the relevant window is taken when the window is limited.
In the related art, as shown in fig. 1, it can be seen that the server is used as a sender, and the message sequence is as follows:
d1-d2-d3-d4-a1-d5-a2-d6-a3-d7-a4-d8-a5-a6-a7-a8;
and the mobile phone is used as a receiving party, and the message sequence is as follows:
d1-a1-d2-a2-d3-a3-d4-a4-d5-a5-d6-a6-d7-a7-d8-a8
the message sequence in the DPI equipment is as follows:
d1-d2-d3-d4-a1-a2-a3-a4-d5-d6-d7-d8-a5-a6-a7-a8
it can be seen that the message sequence of the sender, the receiver and the measurement point is different. Because the point for measuring the congestion window is inconsistent with the message time sequence of the sender and the receiver, a larger error exists between the congestion window measurement result and the real congestion window size of the sender.
In view of the above problems in the related art, the present application provides a method for determining a TCP congestion window, referring to fig. 2, fig. 2 is a flowchart of a method for determining a TCP congestion window provided in an embodiment of the present application, and the method is applied to a terminal, as shown in fig. 2, and includes the following steps:
step 201, under the condition that the terminal sends a first message based on TCP protocol carrying payload data, determining a second message in the last opposite direction received by the terminal before the first message is sent from the messages in the opposite direction of the session where the first message is located, and associating the second message index number to the message information of the first message;
it should be noted that, the second message in the last opposite direction received by the terminal refers to a message in the opposite direction closest to the first message in time received before the first message is sent. The number of second messages in the last object direction may be plural, i.e. a plurality of second messages are sent in the same object direction at the same time. Further, taking fig. 1 as an example, if the terminal is a mobile phone, the mobile phone is a server as a sender, the server is a receiver of the terminal, the first message is sent from the mobile phone to the server, the second message is sent from the server to the mobile phone, and the opposite direction is a direction in which the server sends the message to the mobile phone.
Step 202, ordering the first message and a plurality of third messages to obtain an ordering result, wherein the third messages are messages which are required to be sent by the terminal after receiving the second messages;
step 203, determining the value of the congestion window associated with the sequencing result according to the TCP sequence number of the first message, the payload data length of the first message, and the TCP acknowledgement sequence number of the second message.
Through steps 101 to 103, after the terminal receives the first message, the last message in the received forward direction, that is, the second message, may be found, and then the third message between the second message and the first message is sequenced in time, so that the value of the congestion window associated with the sequencing result is determined based on the TCP sequence number of the first message, the payload data length of the first message, and the TCP acknowledgement sequence number of the second message, that is, the congestion window between the second message and the first message is determined. Therefore, the method ensures the accuracy of congestion window determination by sequencing and then determining the corresponding congestion window, and solves the problem that the congestion window measurement result and the real congestion window size of the sender have larger errors due to inconsistent message time sequences of the sender and the receiver in the related technology.
In an optional implementation manner of the embodiment of the present application, for the message in the opposite direction of the session where the first message is located, which is referred to in the step 201, the determining, before the first message is sent, the manner of determining the last second message in the opposite direction received by the terminal may further include:
step 11, a first field in a first message is obtained, and a second field in a message in a opposite direction is obtained, wherein the first field is used for representing a sender timestamp of the message, and the second field is used for representing a return display timestamp of the message;
step 12, comparing the time represented by the first field with the time represented by the second field;
and step 13, under the condition that the time represented by the first field is smaller than the time represented by the second field, continuously searching the second field in the messages in the opposite direction until the time represented by the first field is larger than or equal to the time represented by the second field, and determining the message corresponding to the second field with the time represented by the first field larger than the first field as the second message.
In the embodiment of the application, the acquisition and analysis of the first message and the second message can be realized by DPI equipment or unpacking software in a specific example, namely, when the network message of one TCP protocol is acquired, the data analysis is carried out on the network message. The specific modes can be as follows: extracting the message quintuple information (source IP, destination IP, source port number, destination port number, transport layer protocol), TCP layer protocol stack information element and IP layer protocol stack information element, matching the quintuple information with the quintuple in the non-aged quintuple flow table recorded by the current DPI equipment, identifying and recording the message direction, and carrying out session marking, indexing and message information storage (at least the indexes of session identification, message index number, message direction, message capturing time, message payload length, message TCP sequence number, message TCP acknowledgement sequence number, tsval and tsecr record in the TCP protocol selectable item are required to be stored) on the message, thereby updating the state of the session in the quintuple flow table.
Based on this, for the above steps 11 to 13, in a specific example, the first field may be a tsval (TimeStamp of sender) field, and the second field may be tsecr (TimeStamp echo reply: time stamp of echo), based on which, in a specific example, the value of tsecr of the first message is extracted, the forward search is started from the same session received last time on the first message, the forward search is sequentially compared with tsval of the opposite message, and if tsecr of the first message is smaller than tsval, the forward search is continued; if the tsecr of the first message is greater than or equal to tsval, stopping searching, and recording the index number of the opposite message (the second message) to the stored information of the first message to complete the message association operation.
Further, for the manner of comparing the time represented by the first field with the time represented by the second field in step 12, the method may further include:
step 31, determining whether a wrap-around exists in the first field and the second field;
step 32, in the case that the first field has a wrap-around, comparing the time represented by the first field with the time represented by the second field after adding the maximum value of the first field;
step 33, in the case that the second field has a wrap-around, comparing the time represented by the second field plus the maximum value of the second field with the time represented by the first field.
Note that, the wrapping means that recording is restarted from 0 after tsval and tsecr reach the field recordable maximum value. Therefore, when there is a wrapping and a message association is needed, the wrapped index is compared with the unrepeaked index after adding the field maximum value. And under the condition that the wrapping exists, the current field true value can be represented after the field maximum value is added, and the second message related to the first message can be accurately determined.
In an optional implementation manner of the embodiment of the present application, the manner of ordering the first packet and the plurality of third packets in step 202 to obtain an ordering result may further include:
step 41, sorting the first message and the plurality of third messages based on a preset rule to obtain a sorting result;
the preset rule is to compare first fields of the first message and the third message, sort the messages with smaller time represented by the first fields before, compare TCP serial numbers of the first message and the third message if the times represented by the first fields of the first message and the third message are equal, sort the messages with smaller TCP serial numbers before, compare acknowledgement character ACK serial numbers of the first message and the third message if the TCP serial numbers of the first message and the third message are equal, sort the messages with smaller ACK serial numbers before, compare IP ID serial numbers of the first message and the third message if the acknowledgement character ACK serial numbers of the first message and the third message are equal, sort the messages with smaller IP ID serial numbers before, and sort the messages according to capturing time of the messages if the acknowledgement character IP ID serial numbers of the first message and the third message are equal.
It can be seen that, in the embodiment of the present application, the ordering of the messages is to restore the actual order of the messages on the data sender side. Also taking tsval as an example, the specific manner may be: firstly, the message is placed in the associated opposite message, and then the comparison and sequencing are sequentially carried out on the message and the same-direction message after the opposite message. The message sequence in the same direction is firstly confirmed by TCP tsval, and the messages with smaller tsval values are sequenced before; if the tsval values are the same, comparing TCP SEQ serial numbers, and sequencing messages with smaller SEQ serial numbers before; if the TCP SEQ sequence numbers are the same, comparing the TCP ACK sequence numbers, and sequencing the messages with smaller ACK sequence number values before; if the TCP ACK sequence numbers are the same and the IP layer adopts the IPv4 protocol, the IP ID sequence numbers can be adopted for comparison, and the messages with smaller IP ID sequence numbers are ordered before; if the sorting can not be performed according to the IP ID, the sorting can be performed according to the message capturing time. By the method, after various conditions are considered, the messages can be accurately sequenced.
In an optional implementation manner of the embodiment of the present application, for the manner of determining the value of the congestion window associated with the ordering result by using the TCP sequence number of the first packet, the payload data length of the first packet, and the TCP acknowledgement sequence number of the second packet in step 103, the method may further include:
step 51, summing the TCP serial number of the first message and the payload data length of the first message to obtain a summation result;
and step 52, determining the difference between the summation result and the TCP acknowledgement sequence number of the second message as the value of the congestion window.
It should be noted that, in the embodiment of the present application, the value of the congestion window refers to the number of bytes of data in the congestion window.
In the embodiment of the present application, after determining the value of the congestion window associated with the ordering result, as shown in fig. 3, the method of the embodiment of the present application may further include:
step 301, detecting time sequence data in a congestion window of a congestion control behavior to be detected based on a trained neural network model;
step 302, determining time sequence data input when a loss value output by the neural network model is larger than a preset threshold value as a starting point, determining time sequence data with a preset length from the starting point as a first congestion control behavior, and adding 1 to a congestion control behavior count of a session;
step 303, in the case that the time series data in the congestion window of the congestion control behavior to be detected has been fully input into the neural network model, determining the ratio of the minimum value of the congestion window to the maximum value of the congestion window in the time series data in the congestion window of the congestion control behavior to be detected as the contraction amplitude of the congestion window.
As can be seen from the above steps 301 to 302, congestion window timing data required to detect congestion control behavior is detected. The specific method is to detect time sequence data with congestion control behavior, when the loss value is larger than the congestion control detection threshold value, the point is used as the start, and the data of the subsequent time sequence is marked as one congestion control behavior. And deriving the time sequence data corresponding to the congestion control behavior, and calculating the congestion avoidance count of the session and the congestion window shrinkage amplitude, namely, the congestion control behavior count+1 of the session, wherein the congestion window shrinkage amplitude is the result of dividing the minimum value of the congestion window in the congestion control detection data by the maximum value of the congestion window.
The neural network model is built in a network according to a target model, and in a specific example, an AutoEncoder self-encoder deep learning network is adopted to detect congestion control. The specific network model is shown in fig. 4, wherein the parameters of the convolutional layer configuration in the neural network model are in_channels, and the channel number of the input signal; out_channels, convolving the resulting channels; kernel_size, the size of the convolution kernel; stride, convolution step size.
Model training, namely training the training data after data preprocessing according to the configured neural network model. Wherein, the training data should select congestion window data without congestion control behavior. Optimizing by adopting a minimum loss method, calculating a loss value by using MSeloss, configuring epoch_num=200, batch_size=128 and learning_rate=0.001, performing model training, and recording a final loss value after training is finished, and multiplying the loss value by 1.5 to be used as a threshold value for congestion control behavior detection.
In the embodiment of the present application, before detecting the time sequence data in the congestion window of the congestion control behavior to be detected based on the trained neural network model, the method of the embodiment of the present application may further include:
step 61, preprocessing data in the initial data set to obtain a training set;
step 62, training the initial neural network model based on the training set to obtain a trained neural network model;
the pretreatment method comprises the following steps: sampling data in an initial data set with a preset granularity, wherein the data in the initial data set is data in a congestion window;
under the condition that data are not collected in the current preset granularity period, carrying out weighted average processing on the data collected before the current preset granularity period and the data collected after the current preset granularity period, and determining the data in the current preset granularity period according to the result of the weighted average processing;
and under the condition that more than or equal to 2 data are acquired in the current preset granularity period, processing the data acquired in the current preset granularity period based on an averaging mode, and determining a processing result as the data in the current preset granularity period.
It can be seen that in the embodiment of the present application, data sampling is based on the data for which the congestion window has been generated. In a specific example, congestion window data is sampled at a time granularity of 1 millisecond (a preset granularity period). If no data record exists in a certain 1 millisecond period, adopting a linear interpolation method, and carrying out weighted average filling by utilizing the data record of the last and the next data moment; if there are 2 or more data records within a certain 1 millisecond period, the 1 millisecond period is valued by averaging. The congestion window data should be processed into periodic time series data through data preprocessing, and the sampling period is 1 millisecond.
Therefore, in the embodiment of the application, the time sequence of the network message at the sender side is restored through the first field (tsval) and the second field (tsecr) of the message in the TCP protocol stack, so that the congestion window is measured, and the congestion control behavior executed by the sender in the transmission process is identified based on the anomaly detection algorithm of deep learning, so that the network problem is positioned more accurately.
Corresponding to the method in fig. 2, the embodiment of the present application further provides a terminal, as shown in fig. 5, where the apparatus includes:
the first processing module 52 is configured to determine, from a message in a direction opposite to a session in which the first message is located, a second message in a last direction opposite to the first message received by the terminal before the first message is sent, and associate a second message index number with message information of the first message, where the first message is sent by the terminal;
the ordering module 54 is configured to order the first packet and a plurality of third packets to obtain an ordering result, where the third packet is a packet that the terminal needs to send after receiving the second packet;
the first determining module 56 is configured to determine a value of a congestion window associated with the ordering result from the TCP sequence number of the first packet, the payload data length of the first packet, and the TCP acknowledgement sequence number of the second packet.
Optionally, the first processing module 52 in the embodiment of the present application may further include: the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring a first field in a first message and acquiring a second field in a message in a opposite direction, wherein the first field is used for representing a sender timestamp of the message, and the second field is used for representing a return display timestamp of the message; a comparison unit for comparing the time characterized by the first field with the time characterized by the second field; and the first determining unit is used for continuously searching the second field in the messages in the opposite direction under the condition that the time represented by the first field is smaller than the time represented by the second field until the time represented by the first field is larger than or equal to the time represented by the second field, and determining the message corresponding to the second field with the time represented by the first field larger than the first field as the second message.
Optionally, the comparing unit in the embodiment of the present application may further include: a determining subunit configured to determine whether a wrapping exists in the first field and the second field; the first comparing subunit is used for comparing the time represented by the first field with the time represented by the second field after adding the maximum value of the first field under the condition that the first field has wrapping; and the second comparison subunit is used for comparing the time represented by the second field with the time represented by the first field after adding the maximum value of the second field under the condition that the second field has wrapping.
Optionally, the ranking module 54 in the embodiment of the present application may further include: the ordering unit is used for ordering the first message and the plurality of third messages based on a preset rule to obtain an ordering result; the preset rule is to compare first fields of the first message and the third message, sort the messages with smaller time represented by the first fields before, compare TCP serial numbers of the first message and the third message if the times represented by the first fields of the first message and the third message are equal, sort the messages with smaller TCP serial numbers before, compare acknowledgement character ACK serial numbers of the first message and the third message if the TCP serial numbers of the first message and the third message are equal, sort the messages with smaller ACK serial numbers before, compare IP ID serial numbers of the first message and the third message if the acknowledgement character ACK serial numbers of the first message and the third message are equal, sort the messages with smaller IP ID serial numbers before, and sort the messages according to capturing time of the messages if the acknowledgement character IP ID serial numbers of the first message and the third message are equal.
Optionally, the first determining module 56 in the embodiment of the present application may further include: the processing unit is used for summing the TCP serial number of the first message and the payload data length of the first message to obtain a summation result; and the second determining unit is used for determining the difference value between the summation result and the TCP acknowledgement sequence number of the second message as the value of the congestion window.
Optionally, as shown in fig. 6, the terminal in the embodiment of the present application may further include:
a detection module 62, configured to detect time-series data in a congestion window of a congestion control behavior to be detected based on a trained neural network model after determining a value of the congestion window associated with the ordering result;
a second processing module 64, configured to determine, as a starting point, time series data input when a loss value output by the neural network model is greater than a preset threshold, and determine, as a congestion control action, time series data of a preset length from the starting point, and increment a congestion control action count of a session by 1;
the second determining module 66 is configured to determine, as the contraction amplitude of the congestion window, a ratio of a minimum value of the congestion window to a maximum value of the congestion window in the time-series data in the congestion window in which the congestion control behavior is to be detected, in a case where the time-series data in the congestion window in which the congestion control behavior is to be detected has been all input into the neural network model.
After the terminal receives the first message, the last message in the received direction, namely the second message, can be found, and then the third message between the second message and the first message is sequenced in time, so that the value of the congestion window associated with the sequencing result is determined based on the TCP serial number of the first message, the payload data length of the first message and the TCP acknowledgement serial number of the second message, namely the congestion window between the second message and the first message is determined. Therefore, the method ensures the accuracy of congestion window determination by sequencing and then determining the corresponding congestion window, and solves the problem that the congestion window measurement result and the real congestion window size of the sender have larger errors due to inconsistent message time sequences of the sender and the receiver in the related technology.
Optionally, the terminal in the embodiment of the present application may further include: the third processing module is used for preprocessing data in the initial data set before detecting time sequence data in a congestion window of the congestion control behavior to be detected based on the trained neural network model to obtain a training set; the training module is used for training the initial neural network model based on the training set to obtain a trained neural network model; the pretreatment method comprises the following steps: sampling data in an initial data set with a preset granularity, wherein the data in the initial data set is data in a congestion window; under the condition that data are not collected in the current preset granularity period, carrying out weighted average processing on the data collected before the current preset granularity period and the data collected after the current preset granularity period, and determining the data in the current preset granularity period according to the result of the weighted average processing; and under the condition that more than or equal to 2 data are acquired in the current preset granularity period, processing the data acquired in the current preset granularity period based on an averaging mode, and determining a processing result as the data in the current preset granularity period.
It should be noted that, if the terminal provided in the embodiment of the present application is a terminal capable of executing the method for determining a TCP congestion window in the embodiment of fig. 2, all the implementation manners in the embodiment of the method for determining a TCP congestion window are applicable to the terminal, and the same or similar beneficial effects can be achieved.
Specifically, referring to fig. 7, an embodiment of the present application further provides an electronic device, including a bus 701, a transceiver 702, an antenna 703, a bus interface 704, a processor 705, and a memory 706.
A transceiver 702 for receiving and transmitting messages;
the transceiver 702 or the processor 705 is configured to, in a case where a terminal sends a first packet based on a TCP protocol that carries payload data, determine, from a packet in a direction opposite to a session in which the first packet is located, a second packet in a last direction opposite to the first packet received by the terminal before the first packet is sent, and associate the second packet index number to packet information of the first packet; sequencing the first message and a plurality of third messages to obtain a sequencing result, wherein the third messages are messages which are required to be sent by the terminal after the terminal receives the second messages; and determining the value of a congestion window associated with the sequencing result according to the TCP sequence number of the first message, the payload data length of the first message and the TCP acknowledgement sequence number of the second message.
In FIG. 7, a bus architecture (represented by bus 701), the bus 701 may include any number of interconnected buses and bridges, with the bus 701 linking together various circuits, including one or more processors, represented by the processor 705, and memory, represented by the memory 706. The bus 701 may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are well known in the art and, therefore, will not be described further herein. Bus interface 704 provides an interface between bus 701 and transceiver 702. The transceiver 702 may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 705 is transmitted over a wireless medium via the antenna 703, and further, the antenna 703 receives and transmits data to the processor 705.
The processor 705 is responsible for managing the bus 701 and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 706 may be used to store data used by processor 705 in performing operations.
Alternatively, the processor 705 may be a CPU, ASIC, FPGA or CPLD.
It should be noted that, the electronic device provided in the embodiment of the present application is a device capable of executing the method for determining a TCP congestion window in the embodiment of fig. 2, and all the implementation manners in the embodiment of the method for determining a TCP congestion window are applicable to the electronic device, and the same or similar beneficial effects can be achieved.
The embodiment of the application also provides electronic equipment, which comprises: the program is executed by the processor to implement each process of the embodiment of the method for determining the TCP congestion window shown in fig. 2, and the same technical effects can be achieved, so that repetition is avoided and no further description is given here.
The embodiment of the present application further provides a computer readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements each process of the above-mentioned embodiment of the method for determining a TCP congestion window shown in fig. 2, and achieves the same technical effects, so that repetition is avoided, and no further description is given here. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (11)

1. A method for determining a transmission control protocol TCP congestion window, applied to a terminal, the method comprising:
under the condition that the terminal sends a first message carrying payload data and based on TCP protocol, determining a second message in the last opposite direction received by the terminal before the first message is sent from a message in the opposite direction of a session where the first message is located, and associating the second message index number to message information of the first message;
sequencing the first message and a plurality of third messages to obtain a sequencing result, wherein the third messages are messages which are required to be sent by the terminal after the terminal receives the second messages;
and determining the value of a congestion window associated with the sequencing result according to the TCP sequence number of the first message, the payload data length of the first message and the TCP acknowledgement sequence number of the second message.
2. The method according to claim 1, wherein determining, from the messages in the opposite direction of the session in which the first message is located, the last second message in the opposite direction received by the terminal before the first message is sent includes:
acquiring a first field in the first message and acquiring a second field in the message in the opposite direction, wherein the first field is used for representing a sender timestamp of the message, and the second field is used for representing a return display timestamp of the message;
comparing the time characterized by the first field with the time characterized by the second field;
and under the condition that the time represented by the first field is smaller than the time represented by the second field, continuously searching the second field in the messages in the opposite direction until the time represented by the first field is larger than or equal to the time represented by the second field, and determining the message corresponding to the second field with the time represented by the second field larger than the first field as the second message.
3. The method of claim 2, wherein comparing the time characterized by the first field with the time characterized by the second field comprises:
determining whether a wrap-around exists in the first field and the second field;
comparing the time characterized by the first field with the time characterized by the second field after adding a first field maximum value under the condition that the first field has wrapping;
and in the case that the second field has a wrapping, comparing the time represented by the second field with the time represented by the first field after adding a second field maximum value.
4. The method of claim 2, wherein the ordering the first message and the plurality of third messages to obtain an ordering result comprises:
sequencing the first message and a plurality of third messages based on a preset rule to obtain a sequencing result;
the preset rule is to compare a first message with a first field of the third message, sort the message with smaller time represented by the first field before, compare the TCP serial numbers of the first message with the third message if the time represented by the first field of the first message is equal, sort the message with smaller TCP serial numbers before, compare the acknowledgement character ACK serial numbers of the first message with the third message if the TCP serial numbers of the first message with the third message are equal, sort the message with smaller ACK serial numbers before, compare the acknowledgement character ACK serial numbers of the first message with the third message if the acknowledgement character ACK serial numbers of the first message with the third message are equal, compare the IP ID serial numbers of the first message with the third message, sort the message with smaller IP ID serial numbers before, and capture time according to the message.
5. The method of claim 1, wherein determining the value of the congestion window associated with the ordering result from the TCP sequence number of the first message, the payload data length of the first message, and the TCP acknowledgement sequence number of the second message comprises:
summing the TCP serial number of the first message and the payload data length of the first message to obtain a summation result;
and determining the difference value between the summation result and the TCP acknowledgement sequence number of the second message as the value of the congestion window.
6. The method of claim 1, wherein after determining the value of the congestion window associated with the ordering result, the method further comprises:
detecting time sequence data in a congestion window of the congestion control behavior to be detected based on the trained neural network model;
determining time sequence data input when a loss value output by the neural network model is larger than a preset threshold value as a starting point, determining time sequence data with a preset length from the starting point as a congestion control behavior, and adding 1 to the congestion control behavior count of a session;
and under the condition that time sequence data in a congestion window of the congestion control behavior to be detected is completely input into the neural network model, determining the ratio of the minimum value of the congestion window to the maximum value of the congestion window in the time sequence data in the congestion window of the congestion control behavior to be detected as the contraction amplitude of the congestion window.
7. The method of claim 6, wherein prior to detecting time series data in a congestion window for congestion control behavior to be detected based on a trained neural network model, the method further comprises:
preprocessing data in an initial data set to obtain a training set;
training an initial neural network model based on the training set to obtain a trained neural network model;
the pretreatment method comprises the following steps: sampling data in the initial data set with a preset granularity, wherein the data in the initial data set is data in a congestion window;
under the condition that data are not collected in the current preset granularity period, carrying out weighted average processing on the data collected before the current preset granularity period and the data collected after the current preset granularity period, and determining the data in the current preset granularity period according to the result of the weighted average processing;
and under the condition that more than or equal to 2 data are acquired in the current preset granularity period, processing the data acquired in the current preset granularity period based on an averaging mode, and determining a processing result as the data in the current preset granularity period.
8. A terminal, comprising:
the first processing module is used for determining a second message in the last opposite direction received before the first message is sent from the messages in the opposite direction of the session where the first message is located under the condition of sending a first message based on TCP protocol carrying payload data, and associating the second message index number to the message information of the first message;
the ordering module is used for ordering the first message and a plurality of third messages to obtain an ordering result, wherein the third messages are messages which the terminal needs to send after receiving the second messages;
and the first determining module is used for determining the value of the congestion window associated with the sequencing result according to the TCP sequence number of the first message, the payload data length of the first message and the TCP acknowledgement sequence number of the second message.
9. An electronic device comprising a transceiver and a processor,
the transceiver is used for receiving and transmitting messages;
the processor is configured to determine, when the terminal sends a first packet based on a TCP protocol and carrying payload data, a second packet in a last opposite direction received by the terminal before the first packet is sent from a packet in an opposite direction of a session in which the first packet is located, and associate the second packet index number to packet information of the first packet; sequencing the first message and a plurality of third messages to obtain a sequencing result, wherein the third messages are messages which are required to be sent by the terminal after the terminal receives the second messages; and determining the value of a congestion window associated with the sequencing result according to the TCP sequence number of the first message, the payload data length of the first message and the TCP acknowledgement sequence number of the second message.
10. An electronic device, comprising: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor performs the method steps of any one of claims 1 to 7.
11. A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN202211336228.9A 2022-10-28 2022-10-28 Method, terminal, electronic equipment and medium for determining TCP congestion window Pending CN116962256A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211336228.9A CN116962256A (en) 2022-10-28 2022-10-28 Method, terminal, electronic equipment and medium for determining TCP congestion window

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211336228.9A CN116962256A (en) 2022-10-28 2022-10-28 Method, terminal, electronic equipment and medium for determining TCP congestion window

Publications (1)

Publication Number Publication Date
CN116962256A true CN116962256A (en) 2023-10-27

Family

ID=88443284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211336228.9A Pending CN116962256A (en) 2022-10-28 2022-10-28 Method, terminal, electronic equipment and medium for determining TCP congestion window

Country Status (1)

Country Link
CN (1) CN116962256A (en)

Similar Documents

Publication Publication Date Title
CN100583785C (en) Method and apparatus for characterizing an end-to-end path of a packet-based network
CN111817875B (en) Method and device for detecting network fault
US6757255B1 (en) Apparatus for and method of measuring communication performance
EP2562972B1 (en) Usable bandwidth measurement system, transmission device, usable bandwidth measurement method and recording medium
US6614763B1 (en) Method of and apparatus for measuring network communication performances, as well as computer readable record medium having network communication performance measuring program stored therein
US20090116402A1 (en) Communication quality measuring apparatus and communication quality measuring method
US20020169880A1 (en) Method and device for robust real-time estimation of the bottleneck bandwidth in the internet
US7944849B2 (en) Transmission path quality measuring device, communication system, quality measurement method, and quality measuring program
US20060209702A1 (en) Method for evaluating the bandwith of a digital link
KR101468624B1 (en) Terminal, system and method for measuring network state using the same
US6795401B1 (en) Band width measuring method and apparatus for a packet switching network
US9379989B2 (en) Congestion avoidance and control for UDP-based protocols
CN103259696A (en) Network bandwidth detecting method and device and network devices
CN104901851B (en) A kind of method and system of detection network quality
CN113259886B (en) Industrial edge data transmission method and device
US20150249589A1 (en) Method and apparatus for determining automatic scanning action
US9847920B2 (en) Communication control device, communication control method, and computer readable storage medium for specifying an upper limit of a network connection
CN116962256A (en) Method, terminal, electronic equipment and medium for determining TCP congestion window
JPWO2008004616A1 (en) Estimation method, apparatus and program, and network measurement system
US10680756B2 (en) Packet classification apparatus, packet classification method and storage medium
CN109067503B (en) Data retransmission method and device
TWI678084B (en) Network frequency band measuring device and network frequency band measuring method
JP6048102B2 (en) Information processing system
CN112230880B (en) Data transmission control method and device, FPGA and medium
JP6568662B2 (en) Data collection system, data collection method, client device, server device, and program

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