Data transmission method, device and system, and storage medium
By identifying and prioritizing retransmission packets in the switch, the retransmission delay problem caused by network packet loss is solved, and the quality of network services is improved.
Patent Information
- Application Number
- PCT/CN2024/104322
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-15
- Filing Date
- 2024-07-08
- Publication Date
- 2025-02-20
AI Technical Summary
In the prior art, when processing network packet loss, the delay of retransmitting data packets is long, affecting the quality of network services.
By identifying the retransmitted data packets in the switch and sending them to the destination, the sending priority of the retransmitted data packets is increased.
Reduces the forwarding delay of retransmitted data packets and improves network service quality.
Smart Images

Figure CN2024104322_20022025_PF_FP_ABST
Abstract
Description
Data transmission method, device, system and storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on August 15, 2023, with application number 202311029412.3 and application name “Data transmission application method, device, system and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communication technology, and in particular to a data transmission method, device, system and storage medium. Background Art
[0003] Network packet loss occurs when data packets are lost in a communication channel due to various reasons. This can be caused by many factors, including but not limited to: switch congestion, switch failure, network card failure, and host operating system hangs.
[0004] Network packet loss requires data retransmission. A retransmission backoff algorithm is a commonly used retransmission method. A retransmission backoff algorithm requires that nodes on the network wait for a certain period of time after a packet is lost before retransmitting again. This wait time increases exponentially, thereby avoiding frequent packet loss. For example, assuming the initial retransmission interval is 200 milliseconds (ms), the retransmission wait time increases exponentially, namely: 200ms, 400ms, 800ms, 1.6 seconds (s), 3.2s, and so on. If a connection experiences three consecutive packet losses, a network outage of more than one second will occur, impacting service quality. Because packet retransmission delay significantly impacts service quality, preventing further deterioration in network service quality is crucial.
[0005] Summary of the Invention
[0006] Various aspects of the present application provide a data transmission method, device, system, and storage medium for increasing network retransmission speed and reducing network retransmission delay.
[0007] In a first aspect, an embodiment of the present application provides a data transmission method, including:
[0008] Receive the data packet to be transmitted sent by the sender;
[0009] Obtaining retransmission identification information from the data packet to be transmitted;
[0010] In a case where the retransmission identification information indicates that the data packet to be transmitted is a retransmission data packet, the data packet to be transmitted is preferentially sent to the destination end.
[0011] In a second aspect, an embodiment of the present application further provides a data transmission method, including:
[0012] Get the data to be transmitted;
[0013] Determining retransmission identification information according to the number of times the data to be transmitted is sent in the same network connection;
[0014] Encapsulating the retransmission identification information and the data to be transmitted into a data packet to be transmitted;
[0015] The data packet to be transmitted is sent to a switch, so that the switch can identify whether the data packet to be transmitted is a retransmission data packet based on the retransmission identification information, and if the data packet to be transmitted is a retransmission data packet, the switch preferentially sends the data packet to the destination end.
[0016] In a third aspect, an embodiment of the present application further provides a data transmission method, including:
[0017] Receive the data packet to be transmitted sent by the sender;
[0018] Acquire quintuple information and a sequence identifier from the data packet to be transmitted; the sequence identifier is used to mark the order of the data packet to be transmitted in the same network connection;
[0019] Determining whether the data packet to be transmitted is a retransmitted data packet based on the five-tuple information and sequence identifier of the data packet to be transmitted and the five-tuple information and sequence identifier of the stored sent data packet; the sent data packet and the data packet to be transmitted are data packets sent by the same network connection;
[0020] In the case that the data packet to be transmitted is a retransmission data packet, the data packet to be transmitted is preferentially sent to the destination end.
[0021] In a fourth aspect, an embodiment of the present application further provides a network system, comprising: a first device for sending data and a second device for receiving data; the network system further comprises: a switch disposed between the first device and the second device;
[0022] The switch is used to perform the steps of the data transmission method provided in the first aspect and / or the third aspect of the claim;
[0023] The first device is used to execute the steps in the data transmission method provided in the second aspect above.
[0024] In a fifth aspect, an embodiment of the present application further provides an electronic device, comprising: a memory, a processor, and a communication component; wherein the memory is used to store a computer program;
[0025] The processor is coupled to the memory and is configured to execute the computer program to perform the steps of the data transmission method provided in the above aspects.
[0026] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, causes the one or more processors to execute the steps in the method executed by the switch and / or first device in the network system provided in the fourth aspect above.
[0027] In an embodiment of the present application, by improving the switch, the switch has the ability to identify retransmitted data packets. For the identified retransmitted data packets, the retransmitted data packets can be sent to the destination end in priority, thereby improving the sending priority of the retransmitted data packets. Compared with the traditional method of queuing retransmitted data packets and non-retransmitted data packets on an equal basis, the sending speed of the retransmitted data packets can be increased, and the delay of the retransmitted data packets can be prevented from further deteriorating, which helps to improve the quality of network services. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0029] FIG1 is a schematic diagram of the structure of a network system and a schematic diagram of the process of data transmission in the network system according to an embodiment of the present application;
[0030] FIG2 is a schematic diagram of a process for establishing a network connection according to an embodiment of the present application;
[0031] FIG3 is a schematic diagram of the structure of a protocol header of a data packet provided in an embodiment of the present application;
[0032] FIG4 is a schematic diagram of a first-sent data packet and a retransmitted data packet provided in an embodiment of the present application;
[0033] FIG5 is a schematic diagram of another process of data transmission by the network system provided in an embodiment of the present application;
[0034] FIG6 is a schematic diagram of a process of data transmission performed by a switch according to an embodiment of the present application;
[0035] 7-9 are flowcharts of a data transmission method according to an embodiment of the present application;
[0036] FIG10 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0038] In some embodiments of the present application, by improving the switch, the switch has the ability to identify retransmitted data packets. For the identified retransmitted data packets, the retransmitted data packets can be sent to the destination end first, thereby improving the sending priority of the retransmitted data packets. Compared with the traditional method of queuing retransmitted data packets and non-retransmitted data packets on an equal basis, the sending speed of the retransmitted data packets can be increased, and the delay of the retransmitted data packets can be prevented from further deteriorating, which helps to improve the quality of network services.
[0039] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.
[0040] It should be noted that the same reference numerals denote the same objects in the following drawings and embodiments, and therefore, once an object is defined in one drawing or embodiment, it does not need to be further discussed in the subsequent drawings and embodiments.
[0041] Figure 1 is a schematic diagram of the structure of a network system provided in an embodiment of the present application. As shown in Figure 1, the network system includes: a first device 10, a second device 20, and a switch 30. The first device 10 and the second device 20 are connected to each other through the switch 30.
[0042] Among them, the first device 10 and the second device 20 refer to computing devices with communication functions, which can be a single server device, a cloud-based server array, or a virtual machine (VM) running in a cloud-based server array; or a terminal device, such as a computer, a mobile phone, and a wearable device.
[0043] The switch 30 is a network device used for signal forwarding. It can provide a signal path between any two network nodes connected to the switch (such as the first device 10 and the second device 20 described above). In the embodiments of the present application, the switch 30 may be a programmable switch, for example. A programmable switch has a built-in operating system, and the programmable switch can be programmed through the operating system to expand the switch's functionality. For example, in some embodiments, the programmable switch's operating system can be used to program and configure packet processing logic to perform data processing on received packets before forwarding them.
[0044] In an embodiment of the present application, the first device 10 and the second device 20 need to establish a network connection before exchanging data. In some embodiments, the first device 10 and the second device 20 can establish a network connection by handshaking based on the network protocol followed. Among them, the network protocol can be a standard network protocol, such as the Transmission Control Protocol (TCP), the Stream Control Transmission Protocol (SCTP), the User Datagram Protocol (UDP), and the Quick UDP Internet Connection (QUIC) protocol. Of course, the network protocol can also be a customized network protocol, such as a customized reliable transmission protocol based on the UDP protocol.
[0045] The network connection established between the first device 10 and the second device 20 through a handshake is designed to track and negotiate the amount of data sent each time, ensure the synchronization of the sending and receiving of data segments, confirm when to terminate the connection after data transmission and reception are completed based on the amount of data received, and establish a virtual connection. For example, with the TCP protocol, a three-way handshake can be used to establish a network connection between the first device 10 and the second device 20. The following example illustrates how the three-way handshake establishes a network connection between the first device 10 and the second device 20, using the first device 10 as the sender and the second device 20 as the receiver.
[0046] As shown in Figure 2, during the first handshake, the first device 10 sends a request message to establish a TCP network connection (corresponding to step 1 in Figure 2). This request message contains a sequence number (SEQ) of X. Sequence number (SEQ) X is used to identify the byte stream sent from the first device 10 to the second device 20. X is randomly generated by the sender (i.e., the first device 10). The first device 10 also sets the Synchronous (SYN) field in the request message to 1, indicating that a TCP network connection needs to be established.
[0047] Second handshake: The second device 20 replies to the request message sent by the first device 10, that is, returns a response message to the first device 10 (corresponding to step 2 in Figure 2). The response message contains a SEQ of Y, which is randomly generated by the second device 20. The second device 20 can also set the SYN field in the response message to 1. The response message also includes an acknowledgment (ACK) field. The ACK field value is the sequence number (SEQ) X contained in the request message plus 1, that is, ACK = X + 1. ACK = X + 1 allows the first device 10 to confirm that its request message has been responded to when it receives the response message.
[0048] Third handshake: After receiving the TCP network connection establishment response message sent by second device 20, first device 10 sends an acknowledgment message to second device 20 (corresponding to step 3 in Figure 2). The sequence number (SEQ) in this acknowledgment message is 1 plus the sequence number X sent in the first handshake, i.e., SEQ = X + 1. The ACK field in this acknowledgment message is set to the sequence number Y plus 1 in the response message sent by second device 20, i.e., ACK = Y + 1. The SYN field in the acknowledgment message is set to 1.
[0049] At this point, the three-way handshake between the first device 10 and the second device 20 is completed, and a network connection between the first device 10 and the second device 20 is established.
[0050] After the network connection between the first device 10 and the second device 20 is established, data can be exchanged between the first device 10 and the second device 20. During data transmission between the first device 10 and the second device 20, packet loss may occur. When the transmitting end detects packet loss, it retransmits the lost data. The following example uses the first device 10 as the data transmitting end and the second device 20 as the data receiving end as an example.
[0051] The first device 10 can encapsulate the data to be transmitted into a data packet and send the data packet to the switch 30, which then forwards the data packet to the second device 20. When the data transmission is normal, the second device 20 receives the data packet and verifies the data packet. If the verification is successful, it can return a response data packet.
[0052] The first device 10 may start timing from when the data packet is sent, and if no response data packet is received for the data packet within a set time period, it is determined that the data packet is lost.
[0053] Data packets follow the network protocol. The protocol header of the network protocol generally contains a field for marking the order of data packets on the same network connection (defined as a sequence field). This is because data is generally sent in batches according to data fragments, and each data packet contains one or more data fragments. Multiple means 2 or more. If the order of the data fragments carried by the data packet is disordered in the total data, data errors will occur. Therefore, a field for marking the order of data packets on the same network connection is set in the packet header to mark the order of data packets on the same network connection. The receiving end can sort the data fragments carried by the data packet based on this field to obtain complete data.
[0054] In the embodiment of the present application, the specific implementation form of the field used to mark the order of data packets in the same network connection (i.e., the sequence field) is not limited. Among them, the information recorded in the sequence field is the sequence identifier. The sequence identifier is used to mark the order of data packets in the same network connection. In some embodiments, the network protocol followed by the data packet is TCP or other protocols, and the sequence number (SEQ) field can be used to mark the order of data packets in the same network connection. Assume that SEQ=X in data packet 1, and the length of the data fragment carried by data packet 1 is Y. If data packet 1 is successfully sent to the receiving end, the sequence number of the next data packet sent by the sending end is SEQ=X+Y. The receiving end can sort the received data packets according to the sequence number to ensure data reliability.
[0055] Of course, the field used to mark the order of data packets within the same network connection (sequence field) can also take other forms, such as a numerical sequence number. For example, assuming the data is divided into multiple data fragments, the sequence number carrying each data fragment can be determined based on the order of the data fragments within the data. Assuming the data fragment is the Nth data fragment, the field in the data packet used to mark the order of data packets within the same network connection is set to (N-1), etc., where N is a positive integer.
[0056] The above embodiment exemplifies the implementation of the field for marking the order of data packets in the same network connection, but does not constitute a limitation.
[0057] The sequence field carried by the data packet A sent by the first device 10 (sender) is assumed to have a value of Q; the second device 20 successfully receives the data packet A and returns a response data packet B, the value of the sequence field carried by the response data packet B is also Q. The first device 10 can determine the response data packet corresponding to the received data packet based on the value of the sequence field carried by the response data packet. If the first device 10 does not receive a response data packet carrying a sequence field of Q within the set time, it is determined that the data packet A has been lost in the network and needs to be retransmitted. The value of the sequence field of the retransmitted data packet A is the same as that of the first sent data packet A.
[0058] In traditional solutions, retransmitted packets are identical to initially transmitted packets, and the switch 30 cannot distinguish between them. The switch 30 stores the received packets in a buffer queue in the order they were received. It then sends the packets in the buffer queue to the receiving end (e.g., the second device 20) in sequential order using a first-in, first-out (FIFO) order.
[0059] Assuming that packet A is lost during transmission, subsequent packets of packet A, such as packet B and packet C, will be sent between the time the first device 10 sends packet A and the time packet B is retransmitted. Packets B and C are the first packets sent. On the switch 30 side, since packets B and C are received first, packets B and C in the cache queue have not yet been forwarded to the second device 20. If the switch 30 first stores the retransmitted packet A in the cache queue and, in accordance with the FIFO principle, forwards packets B and C to the second device 20 before forwarding the retransmitted packet A, this will undoubtedly increase the waiting time for the retransmitted packet A, i.e., increase the delay of the retransmitted packet A. If the first device 10 does not receive a response packet to the retransmitted packet A after exceeding the set time threshold, the network connection with the second device 20 may be disconnected, affecting the quality of service.
[0060] In an embodiment of the present application, in order to reduce the forwarding delay of retransmitted data packets, the switch 30 is improved so that the switch 30 has the function of identifying retransmitted data packets. In some embodiments, the switch 30 has an operating system, and the function of identifying retransmitted data packets can be configured for the switch 30 through programming of the operating system.
[0061] In some embodiments, a retransmission identification field can be set in the network protocol by modifying the network protocol followed by the data packet. The first device 10 (sender) can write retransmission identification information in the retransmission identification field of the retransmission data packet to mark the data packet as a retransmission data packet. For example, if the data packet follows a standard network protocol, the custom field of the standard network protocol can be expanded and configured as a retransmission identification field for recording retransmission identification information. For example, as shown in Figure 3, the TCP protocol can expand the TCP option field in the TCP protocol header and add a TCP option field as a retransmission identification field for recording retransmission identification information.
[0062] For another example, as shown in FIG3 , the data packet complies with a custom network protocol. A custom field may be added to the protocol header of the custom network protocol as a retransmission identification field for recording retransmission identification information.
[0063] Accordingly, the switch 30 can be configured with a retransmission identification information recognition function through the operating system of the switch 30. The switch 30 can identify retransmission packets based on the retransmission identification information.
[0064] As shown in FIG1 , the first device 10 (sender) can obtain data to be transmitted (corresponding to step 1 in FIG1 ); and determine retransmission identification information according to the number of times the data to be transmitted is sent in the same network connection (corresponding to step 2 in FIG1 ).
[0065] In the embodiments of the present application, the specific implementation form of the retransmission identification information is not limited. In some embodiments, the number of times the data to be transmitted is sent in the same network connection can be used as retransmission identification information and written into the retransmission identification field. For example, as shown in Figure 4, when the data to be transmitted is sent for the first time, the retransmission identification information is 0 or 1. Thereafter, each time the number of retransmissions increases by 1, the retransmission identification information increases by 1 based on the previous value. Figure 4 only illustrates the example of the retransmission identification information of the first data packet sent being 0, but does not constitute a limitation.
[0066] In other embodiments, a set character can be used as retransmission identification information. For example, when the data to be transmitted is sent for the first time, the retransmission identification field of the data packet carrying the data to be transmitted is set to the first character, that is, when the data to be transmitted is sent for the first time, the retransmission identification information is the first character. When the data to be transmitted is not sent for the first time, the retransmission identification field of the data packet carrying the data to be transmitted is set to another character other than the first character, that is, when the data to be transmitted is not sent for the first time, the retransmission identification information of the data packet carrying the data to be transmitted is another set character. For example, when the data to be transmitted is sent for the first time, the retransmission identification field of the data packet carrying the data to be transmitted is set to 0, that is, the retransmission identification information is 0; when the data to be transmitted is not sent for the first time, the retransmission identification field of the data packet carrying the data to be transmitted is set to 1, that is, the retransmission identification information is 1. Of course, when the data to be transmitted is not sent for the first time, the retransmission identification field of the data packet carrying the data to be transmitted is set to other characters other than 0, such as letters or other numbers other than 0.
[0067] In an embodiment of the present application, the first device 10 may record the number of times M the data to be transmitted is sent, and start counting from the time when the data packet A carrying the data to be transmitted is sent. If no response data packet is received within the set time period, it is determined that data packet A has been lost, and the data to be transmitted is retransmitted. The number of times the data to be transmitted is sent is M+1. Here, M≥0 and is an integer. That is, when the data to be transmitted is sent for the first time, M=0; each time the data to be transmitted is retransmitted, the number of times the data to be transmitted is sent increases by 1.
[0068] Accordingly, if the first device 10 determines that the data to be transmitted is being transmitted for the first time based on the number of times the data to be transmitted is transmitted in the same network connection, the retransmission identification information is determined to be information identifying a non-retransmission data packet, such as the number of transmissions being 0. If the data to be transmitted is determined to be retransmission data based on the number of times the data to be transmitted is transmitted in the same network connection, the retransmission identification information is determined to be information identifying a retransmission data packet, such as the number of times the data to be transmitted is transmitted in the same network connection, or the retransmission identification information is the character set above.
[0069] For an embodiment in which the retransmission identification information is the number of times the data to be transmitted is sent in the same network connection, the first device 10 may use the number of times the data to be transmitted is sent in the same network connection as the retransmission identification information. For example, if the number of times the data to be transmitted is sent in the same network connection is 0, the retransmission identification information is 0; if the number of times the data to be transmitted is sent in the same network connection is 5, the retransmission identification information is 5, and so on. For example, as shown in FIG4 , when the data to be transmitted is sent for the first time, the retransmission identification field is set to 0; when the data to be transmitted is sent for the second time (i.e., the first retransmission), the retransmission identification field is set to 1; when the data to be transmitted is sent for the third time (i.e., the second retransmission), the retransmission identification field is set to 2, and so on.
[0070] Further, as shown in Figure 1, the first device 10 can encapsulate the retransmission identification information and the data to be transmitted into the data packet to be transmitted (corresponding to step 3 of Figure 1). Specifically, the first device 10 can encapsulate the retransmission identification information into the retransmission identification field specified in the network protocol, and encapsulate the data to be transmitted into the data field of the network protocol to obtain the data packet to be transmitted. For example, as shown in Figure 5, the first device 10 can write the retransmission identification information into the retransmission identification field corresponding to the protocol header of the data packet to be transmitted. Among them, the specified retransmission identification field is a custom field in the network protocol. Regarding the setting of the retransmission identification field, please refer to the relevant content of the above embodiment and will not be repeated here.
[0071] The data packet to be transmitted may also include other protocol header fields, such as a quintuple. A quintuple refers to a combination of five elements: the source Internet Protocol (IP) address, the source port, the destination IP address, the destination port, and the transport layer protocol. Data packets with the same quintuple belong to the data stream of the same network connection. In this embodiment, the source IP address and the source port number are the IP address and port number of the first device 10; the destination IP address and the destination port number are the IP address and port number of the second device 20. The transport layer protocol is the network protocol followed by the data packet to be transmitted, such as the TCP protocol, the UDP protocol, or a custom network protocol.
[0072] Of course, the data packet to be transmitted may also include the fields shown in the above embodiments for marking the order of the data packet in the data stream (i.e., sequence fields), such as the SEQ field of the TCP protocol. The information of each field (i.e., field value) is written into the corresponding field in accordance with the specifications of the network protocol followed by the data packet to be transmitted.
[0073] After obtaining the data packet to be transmitted, the first device 10 may send the data packet to be transmitted to the switch 30 (corresponding to step 4 in FIG1 ). The switch 30 may receive the data packet to be transmitted and perform retransmission data packet identification on the data packet to be transmitted.
[0074] Specifically, in conjunction with step 5 of Figure 1 and Figure 5 , the switch 30 can obtain retransmission identification information from the data packet to be transmitted. In some embodiments, the switch 30 can parse the data packet to be transmitted to obtain field identifiers contained in the data packet to be transmitted; identify the retransmission identification field from the field identifiers contained in the data packet to be transmitted based on a preset identifier of the retransmission identification field; and then read the information recorded in the retransmission identification field as the retransmission identification information.
[0075] In other embodiments, in order to increase the speed of obtaining retransmission identification information, the offset address of the retransmission identification field may be pre-stored in the switch 30. The offset address of the retransmission identification field may be the offset of the retransmission identification field relative to the first bit of the data packet to be transmitted. Based on the offset address of the retransmission identification field, the switch 30 may obtain the information stored in the retransmission identification field from the data packet to be transmitted according to the pre-stored offset address of the retransmission identification field as the retransmission identification information. According to the offset address of the retransmission identification field, the information stored in the field corresponding to the offset address is read from the data packet to be transmitted, which is the retransmission identification information. Reading the retransmission identification information from the data packet to be transmitted according to the offset address of the retransmission identification field eliminates the need for protocol parsing and field identification matching of the data packet to be transmitted, thereby helping to increase the speed of reading the retransmission identification information and, in turn, helping to increase the subsequent processing speed of the retransmitted data packet.
[0076] After obtaining the retransmission identification information of the data packet to be transmitted, the switch 30 may determine whether the data packet to be transmitted is a retransmission data packet according to the retransmission identification information (corresponding to step 6 in FIG. 1 ).
[0077] Specifically, in some embodiments, the retransmission identification information is the number of times the data packet to be transmitted is sent in the same network connection. The switch 30 can determine whether the data packet to be transmitted is a retransmission data packet based on the number of times the data packet to be transmitted is sent in the same network connection. If the number of times the data packet to be transmitted is sent in the same network connection is not the preset number of times corresponding to the first transmission (such as 0 or 1, etc.), the data packet to be transmitted is determined to be a retransmission data packet. Correspondingly, if the number of times the data packet to be transmitted is sent in the same network connection is the preset number of times corresponding to the first transmission (such as 0 or 1, etc.), the data packet to be transmitted is determined to be a data packet sent for the first time, that is, not a retransmission data packet. Figure 5 shows that the preset number of times corresponding to the first transmission is 0, so that it can be determined whether the retransmission identification information is equal to 0; if it is equal, it is determined that the data packet to be transmitted is a data packet sent for the first time; if it is not equal to 0, it is determined that the data packet to be transmitted is a retransmission data packet.
[0078] In other embodiments, if the retransmission identification information is a preset character, the switch 30 may determine, based on the character stored in the retransmission identification field, whether the character corresponds to a preset character for a retransmission packet. If so, the packet to be transmitted is determined to be a retransmission packet. Accordingly, if the character stored in the retransmission identification field corresponds to a preset character for initially transmitted data, the packet to be transmitted is determined to be an initially transmitted data packet, i.e., not a retransmission packet.
[0079] The method for determining whether a data packet to be transmitted is a retransmitted data packet shown in the above embodiment is merely an example and does not constitute a limitation.
[0080] Furthermore, to improve the processing speed of retransmitted data packets, if the retransmission identification information indicates that the data packet to be transmitted is a retransmitted data packet, the switch 30 may preferentially send the data packet to be transmitted (i.e., the retransmitted data packet) to the destination end (corresponding to step 7 of FIG. 1 ). The destination end is the receiving end of the data packet to be transmitted, and is generally determined by the destination IP address of the retransmitted data packet.
[0081] Prioritizing the transmission of data packets to the destination mainly means giving priority to sending the data packets to be transmitted to the destination before the non-retransmission data packets (i.e., the first data packets) received by the switch 30 before receiving the retransmission data packets (i.e., the data packets to be transmitted) but not yet sent to the destination.
[0082] In this embodiment, by extending the network protocol, the switch can identify the retransmitted data packets based on the extended retransmission identification information and give priority to sending the retransmitted data packets to the destination end, thereby improving the sending priority of the retransmitted data packets. Compared with the traditional method of queuing retransmitted data packets and non-retransmitted data packets on an equal basis, the sending speed of the retransmitted data packets can be increased, and the delay of the retransmitted data packets can be prevented from further deteriorating, which helps to improve the quality of network services.
[0083] Furthermore, this embodiment extends the network protocol process to include retransmission identification information in data packets. Retransmitted data packets are identified based on this extended retransmission identification information, eliminating the need to maintain information such as the data packet's quintuple and sequence identifier (e.g., sequence number) in the switch. This reduces the amount of switch memory required to identify retransmitted data packets. When identifying retransmitted data packets, there is no need to query the quintuple and sequence identifier (e.g., sequence number) within the quintuple and sequence identifier maintained by the switch, thereby improving the speed of identifying retransmitted data packets.
[0084] To prioritize the transmission of pending data packets (i.e., retransmitted data packets) to the destination, in conjunction with Figures 5 and 6 , the switch 30 may store pending data packets identified as retransmitted data packets in a first queue; other data packets being sent for the first time (i.e., non-retransmitted data packets) are stored in a second queue, with the first queue having a higher scheduling priority than the second queue. Subsequently, the pending data packets stored in the first queue may be sent to the destination in a first-in, first-out (FIFO) order, prioritizing other data packets stored in the second queue. Because the first queue has a higher scheduling priority than the second queue, during the switch scheduling process, the first queue can be sent to the destination more quickly than the second queue, without being blocked by non-retransmitted data packets received by the switch earlier than the pending data packets (i.e., retransmitted data packets). This improves the transmission speed of retransmitted data packets, prevents further delays in retransmitted data packets, and contributes to improved network service quality.
[0085] For example, as shown in Figure 6, switch 30 receives packets 1, 2, and 3 in the following order: packet 1 precedes packet 2, which in turn precedes packet 3. Switch 30 identifies packets 1, 2, and 3 as retransmitted packets, and determines that packets 1 and 2 are initially transmitted, while packet 3 is a retransmitted packet. It then stores packets 1 and 2 in the second queue and packet 3 in the first queue. The first queue has a higher scheduling priority than the second queue. Therefore, when scheduling packets, switch 30 prioritizes sending packet 3, stored in the first queue, to the destination. When the first queue is empty, switch 30 begins scheduling packets in the second queue in FIFO order, sending packets 1 and 2 to the destination in that order.
[0086] In addition to the above-mentioned embodiment of extending the network protocol to realize the identification of retransmitted data packets, the present embodiment also provides another method for identifying retransmitted data packets. The following is an exemplary description of another method for identifying retransmitted data packets provided in the present embodiment.
[0087] As shown in Figure 6, in this embodiment, the network protocol followed by the data packets is not expanded. During data transmission between the first device 10 and the second device 20, packet loss may occur. When the transmitting end detects packet loss, it retransmits the lost data. For the specific implementation of the first device 10 detecting packet loss and retransmitting data, please refer to the relevant content of the above embodiment and will not be repeated here.
[0088] The switch 30 receives a data packet to be transmitted from the first device 10 (i.e., the transmitting end) and obtains the five-tuple information and sequence identifier from the data packet to be transmitted. The sequence identifier is used to mark the order in which the data packets to be transmitted are connected to the same network. A description of the sequence identifier can be found in the relevant content of the above embodiment and is not repeated here.
[0089] In this embodiment, the switch 30 may also record and store the five-tuple information and sequence identifier of the sent data packets. A sent data packet refers to a data packet sent from the same network connection as the data packet to be transmitted, and is sent from the first device 10 to the switch 30 and forwarded by the switch 30 to the second device 20 (i.e., the receiving end).
[0090] Based on the stored five-tuple information and sequence identifier of the sent data packet, the switch 30 can determine whether the data packet to be transmitted is a retransmitted data packet according to the five-tuple information and sequence identifier of the data packet to be transmitted and the stored five-tuple information and sequence identifier of the sent data packet.
[0091] Specifically, the switch 30 may use the five-tuple information and sequence identifier of the packet to be transmitted to query the stored five-tuple information and sequence identifiers of previously transmitted packets. If the five-tuple information and sequence identifier of the previously transmitted packet are found to be identical to those of the packet to be transmitted, the packet to be transmitted is determined to be a retransmitted packet. Accordingly, if the five-tuple information and sequence identifier of the previously transmitted packets do not contain any previously transmitted packets that have the same five-tuple information and sequence identifier as those of the packet to be transmitted, the packet to be transmitted is determined to be a first-time transmitted packet, i.e., a non-retransmitted packet.
[0092] For the embodiment in which the data packet to be transmitted is a retransmission data packet, the data packet to be transmitted may be preferentially sent to the destination end. For the specific implementation method of preferentially sending the data packet to be transmitted to the destination end in the case in which the data packet to be transmitted is a retransmission data packet, please refer to the relevant content of the above embodiment and will not be repeated here.
[0093] In this embodiment, the five-tuple information and sequence identifier of the sent data packet are stored in the switch. Thereafter, the retransmitted data packet can be identified based on the five-tuple information and sequence identifier of the data packet to be transmitted and the five-tuple information and sequence identifier of the sent data packet, and the retransmitted data packet can be sent to the destination end in priority, thereby improving the sending priority of the retransmitted data packet. Compared with the traditional method of queuing retransmitted data packets and non-retransmitted data packets on an equal basis, the sending speed of the retransmitted data packet can be increased, and the delay of the retransmitted data packet can be prevented from further deteriorating, which helps to improve the quality of network services.
[0094] In various embodiments of the present application, as shown in FIG5 , the switch 30 may also record the quintuple information of retransmitted packets. Specifically, if the packet to be transmitted is a retransmitted packet, the switch 30 may record the quintuple information of the packet to be transmitted. Of course, the switch 30 may also monitor and record the quintuple information of other retransmitted packets.
[0095] In some embodiments, as shown in FIG5 , the switch 30 may further perform data analysis based on the quintuple information of the data packet to be transmitted (if the data packet to be transmitted is a retransmitted data packet) and the quintuple information of other retransmitted data packets to obtain and output the data analysis results. In the embodiments of the present application, the specific implementation method of the switch 30 performing data analysis based on the quintuple information of the data packet to be transmitted (if the data packet to be transmitted is a retransmitted data packet) and the quintuple information of other data packets is not limited.
[0096] Optionally, the switch 30 may perform retransmission feature analysis based on the quintuple information of the to-be-transmitted data packet (if the to-be-transmitted data packet is a retransmitted data packet) and the quintuple information of other retransmitted data packets to obtain a retransmission feature. The retransmission feature reflects characteristic information related to the quintuple information and retransmission, including but not limited to: the number of retransmissions of the quintuple information, the time when the quintuple information is retransmitted, and the frequency of quintuple retransmissions.
[0097] Because the retransmission characteristics reflect, to a certain extent, the quality of the network associated with the quintuple information, the switch 30 can identify a potential abnormal network based on the retransmission characteristics and output an identifier of the potential abnormal network. This allows equipment maintenance personnel to troubleshoot the potential abnormal network.
[0098] In some embodiments, the retransmission characteristic is the number of retransmissions of the quintuple. The switch 30 can count the number of retransmissions of each quintuple based on the quintuple information of the data packet to be transmitted (when the data packet to be transmitted is a retransmission data packet) and the quintuple information of other retransmission data packets; if there is a target quintuple whose retransmission count exceeds the set number, the device corresponding to the source IP address and the destination IP address in the target quintuple is determined based on the target quintuple that exceeds the set number, and the network between the devices corresponding to the source IP address and the destination IP address in the target quintuple is used as a potential abnormal network. After that, the device corresponding to the source IP address and the destination IP address in the target quintuple can be output. Among them, the device corresponding to the source IP address and the destination IP address in the target quintuple is used as an identifier of the potential abnormal network. In this way, the equipment maintenance personnel can check the devices corresponding to the source IP address and the destination IP address in the target quintuple and the network between the devices.
[0099] In the embodiment of the present application, the switch 30 can also send the quintuple information of the data packet to be transmitted (in the case where the data packet to be transmitted is a retransmission data packet) and the quintuple information of other data packets to the data analysis device. In the embodiment of the present application, the specific implementation form of the data analysis device is not limited. For example, the data analysis device can be a single server device, a cloud-based server array, or a virtual machine (VM) running in a cloud-based server array. In addition, the data analysis device can also refer to other computing devices with corresponding service capabilities, such as computers and other terminal devices (running service programs), etc.
[0100] The data analysis device can perform data analysis based on the five-tuple information of the data packet to be transmitted (in the case where the data packet to be transmitted is a retransmission data packet) and the five-tuple information of other data packets to obtain data analysis results, and output the data analysis results. For example, the data analysis device can perform retransmission feature analysis on the five-tuple information of the data packet to be transmitted (in the case where the data packet to be transmitted is a retransmission data packet) and the five-tuple information of other data packets to determine the retransmission characteristics; and based on the retransmission characteristics, determine the potential abnormal network, and then output the identifier of the potential abnormal network. For the specific implementation method of the data analysis device performing data analysis based on the five-tuple information of the data packet to be transmitted (in the case where the data packet to be transmitted is a retransmission data packet) and the five-tuple information of other retransmission data packets, please refer to the relevant content of the switch performing retransmission feature analysis based on the five-tuple information of the data packet to be transmitted (in the case where the data packet to be transmitted is a retransmission data packet) and the five-tuple information of other retransmission data packets, which will not be repeated here.
[0101] In addition to the above network system embodiment, the present invention also provides a data transmission method. The data transmission method provided in the embodiment of the present invention is exemplarily described below.
[0102] FIG7 is a flow chart of a data transmission method according to an embodiment of the present application. As shown in FIG7 , the data transmission method mainly includes:
[0103] 701. Obtain data to be transmitted.
[0104] 702. Determine retransmission identification information according to the number of times the data to be transmitted is sent in the same network connection.
[0105] 703. Encapsulate the retransmission identification information and the data to be transmitted into a data packet to be transmitted.
[0106] 704. Send the data packet to be transmitted to the switch, so that the switch can identify whether the data packet to be transmitted is a retransmission data packet based on the retransmission identification information, and if the data packet to be transmitted is a retransmission data packet, preferentially send the data packet to the destination end.
[0107] FIG8 is a flow chart of another data transmission method provided in an embodiment of the present application. As shown in FIG8 , the data transmission method mainly includes:
[0108] 801. Receive a data packet to be transmitted sent by a transmitter.
[0109] 802. Obtain retransmission identification information from the data packet to be transmitted.
[0110] 803. When the retransmission identification information indicates that the data packet to be transmitted is a retransmission data packet, preferentially send the data packet to be transmitted to the destination end.
[0111] In an embodiment of the present application, in order to reduce the forwarding delay of retransmitted data packets, the switch is improved so that the switch has the function of identifying retransmitted data packets. In some embodiments, the switch has an operating system, and the function of identifying retransmitted data packets can be configured for the switch through programming of the operating system.
[0112] In some embodiments, the network protocol followed by the data packet can be modified to set a retransmission identification field in the network protocol. The sender can write retransmission identification information in the retransmission identification field of the retransmission data packet to mark the data packet as a retransmission data packet.
[0113] Accordingly, the switch can be configured with a retransmission identification information recognition function through the switch operating system, and the switch can identify retransmission data packets based on the retransmission identification information.
[0114] As shown in FIG7 , for the sending end, in step 701 , data to be transmitted may be obtained; and in step 702 , retransmission identification information may be determined based on the number of times the data to be transmitted is sent in the same network connection.
[0115] In the embodiment of the present application, the specific implementation form of the retransmission identification information is not limited. In some embodiments, the number of times the data to be transmitted is sent in the same network connection can be used as the retransmission identification information and written into the retransmission identification field.
[0116] In other embodiments, a predetermined character may be used as retransmission identification information. For example, when sending data to be transmitted for the first time, the retransmission identification field of the data packet carrying the data to be transmitted is set to the first character. That is, when sending data to be transmitted for the first time, the retransmission identification information is the first character. When sending data to be transmitted for a non-first time, the retransmission identification field of the data packet carrying the data to be transmitted is set to another character other than the first character. That is, when sending data to be transmitted for a non-first time, the retransmission identification information of the data packet carrying the data to be transmitted is another predetermined character.
[0117] In an embodiment of the present application, the transmitting end may record the number of times M the data to be transmitted is sent, and start counting from the time when the data packet A carrying the data to be transmitted is sent. If no response data packet is received within the set time length, it is determined that the data packet A has been lost, and the data to be transmitted is retransmitted. The number of times the data to be transmitted is sent is M+1. Here, M≥0 and is an integer. That is, when the data to be transmitted is sent for the first time, M=0; each time the data to be transmitted is retransmitted, the number of times it is sent increases by 1.
[0118] Accordingly, if the data to be transmitted is determined to be transmitted for the first time based on the number of times the data to be transmitted is transmitted in the same network connection, the retransmission identification information is determined to be information identifying a non-retransmission data packet, such as the number of times the data to be transmitted is transmitted is 0. If the data to be transmitted is determined to be retransmission data based on the number of times the data to be transmitted is transmitted in the same network connection, the retransmission identification information is determined to be information identifying a retransmission data packet, such as the number of times the data to be transmitted is transmitted in the same network connection, or the retransmission identification information is the aforementioned set character.
[0119] For an embodiment in which the retransmission identification information is the number of times the data to be transmitted is sent in the same network connection, the number of times the data to be transmitted is sent in the same network connection may be used as the retransmission identification information.
[0120] Furthermore, as shown in step 703 of FIG7 , the retransmission identification information and the data to be transmitted may be encapsulated into a data packet to be transmitted (corresponding to step 3 of FIG1 ). Specifically, the retransmission identification information may be encapsulated into a retransmission identification field specified in the network protocol, and the data to be transmitted may be encapsulated into a data field of the network protocol to obtain the data packet to be transmitted.
[0121] The data packet to be transmitted may also include other protocol header fields, such as a quintuple. Of course, the data packet to be transmitted may also include the fields used to mark the order of the data packets in the data stream (i.e., the sequence field) as shown in the above embodiment. The information (i.e., the field value) of each field is written into the corresponding field in accordance with the specifications of the network protocol followed by the data packet to be transmitted.
[0122] After obtaining the data packet to be transmitted, the data packet to be transmitted may be sent to the switch in step 704. Accordingly, the switch may receive the data packet to be transmitted in step 801 and perform retransmission data packet identification on the data packet to be transmitted.
[0123] Specifically, in step 802, retransmission identification information may be obtained from the data packet to be transmitted. In some embodiments, the data packet to be transmitted may be parsed to obtain field identifiers contained in the data packet to be transmitted; based on a preset identifier of the retransmission identification field, the retransmission identification field may be identified from the field identifiers contained in the data packet to be transmitted; and then, information recorded in the retransmission identification field may be read as the retransmission identification information.
[0124] In other embodiments, in order to increase the speed of obtaining retransmission identification information, the offset address of the retransmission identification field may be pre-stored in the switch. The offset address of the retransmission identification field may be the offset of the retransmission identification field relative to the first bit of the data packet to be transmitted. Based on the offset address of the retransmission identification field, the information stored in the retransmission identification field may be obtained from the data packet to be transmitted according to the pre-stored offset address of the retransmission identification field as the retransmission identification information. According to the offset address of the retransmission identification field, the information stored in the field corresponding to the offset address is read from the data packet to be transmitted, which is the retransmission identification information. According to the offset address of the retransmission identification field, the retransmission identification information is read from the data packet to be transmitted without performing protocol parsing and field identification matching on the data packet to be transmitted, which helps to increase the reading speed of the retransmission identification information and further helps to increase the subsequent processing speed of the retransmission data packet.
[0125] After obtaining the retransmission identification information of the data packet to be transmitted, it can be determined whether the data packet to be transmitted is a retransmission data packet according to the retransmission identification information.
[0126] Specifically, in some embodiments, the retransmission identification information is the number of times the data packet to be transmitted is sent in the same network connection. Based on the number of times the data packet to be transmitted is sent in the same network connection, it can be determined whether the data packet to be transmitted is a retransmission data packet. If the number of times the data packet to be transmitted is sent in the same network connection is not a preset number corresponding to the first transmission (e.g., 0 or 1), the data packet to be transmitted is determined to be a retransmission data packet. Accordingly, if the number of times the data packet to be transmitted is sent in the same network connection is a preset number corresponding to the first transmission (e.g., 0 or 1), the data packet to be transmitted is determined to be a data packet sent for the first time, i.e., not a retransmission data packet.
[0127] In other embodiments, if the retransmission identification information is a set character, a determination can be made based on the character stored in the retransmission identification field to determine whether the character corresponds to a pre-set character for a retransmission packet. If so, the packet to be transmitted is determined to be a retransmission packet. Accordingly, if the character stored in the retransmission identification field corresponds to a pre-set character for initially transmitted data, the packet to be transmitted is determined to be an initially transmitted data packet, i.e., a non-retransmission data packet.
[0128] The method for determining whether a data packet to be transmitted is a retransmitted data packet shown in the above embodiment is only for illustrative purposes and does not constitute a limitation.
[0129] Furthermore, to improve the processing speed of retransmitted data packets, if it is determined that the retransmission identification information indicates that the data packet to be transmitted is a retransmitted data packet, the data packet to be transmitted (i.e., the retransmitted data packet) may be preferentially sent to the destination end in step 803. The destination end is the receiving end of the data packet to be transmitted, and is generally determined by the destination IP address of the retransmitted data packet.
[0130] Prioritizing the transmission of data packets to the destination end mainly means giving priority to sending the data packets to be transmitted to the destination end over the non-retransmission data packets (i.e., the data packets sent for the first time) received by the switch before receiving the retransmission data packets (i.e., the data packets to be transmitted) but not yet sent to the destination end.
[0131] In this embodiment, by extending the network protocol, the switch can identify the retransmitted data packets based on the extended retransmission identification information and give priority to sending the retransmitted data packets to the destination end, thereby improving the sending priority of the retransmitted data packets. Compared with the traditional method of queuing retransmitted data packets and non-retransmitted data packets on an equal basis, the sending speed of the retransmitted data packets can be increased, and the delay of the retransmitted data packets can be prevented from further deteriorating, which helps to improve the quality of network services.
[0132] Furthermore, this embodiment extends the network protocol process to include retransmission identification information in data packets. Retransmitted data packets are identified based on this extended retransmission identification information, eliminating the need to maintain information such as the data packet's quintuple and sequence identifier (e.g., sequence number) in the switch. This reduces the amount of switch memory required to identify retransmitted data packets. When identifying retransmitted data packets, there is no need to query the quintuple and sequence identifier (e.g., sequence number) within the quintuple and sequence identifier maintained by the switch, thereby improving the speed of identifying retransmitted data packets.
[0133] To prioritize the transmission of pending data packets (i.e., retransmitted data packets) to the destination, pending data packets identified as retransmitted data packets can be stored in a first queue; other data packets being sent for the first time (i.e., non-retransmitted data packets) can be stored in a second queue, with the first queue having a higher scheduling priority than the second queue. Subsequently, the pending data packets stored in the first queue can be sent to the destination in a first-in, first-out (FIFO) order, prioritizing other data packets stored in the second queue. Because the first queue has a higher scheduling priority than the second queue, during the switch scheduling process, the first queue can be sent to the destination faster than the second queue and will not be blocked by non-retransmitted data packets received by the switch earlier than the pending data packets (i.e., retransmitted data packets). This improves the transmission speed of retransmitted data packets, prevents further deterioration of retransmitted data packet delays, and helps improve network service quality.
[0134] In addition to the above-mentioned embodiment of extending the network protocol to realize the identification of retransmitted data packets, the present embodiment also provides another method for identifying retransmitted data packets. The following is an exemplary description of another method for identifying retransmitted data packets provided in the present embodiment.
[0135] FIG9 is a flow chart of another data transmission method provided in an embodiment of the present application. As shown in FIG8 , the data transmission method mainly includes:
[0136] 901. Receive a data packet to be transmitted sent by a transmitter.
[0137] 902. Acquire quintuple information and a sequence identifier from the data packet to be transmitted; the sequence identifier is used to mark the order of the data packets to be transmitted in the same network connection.
[0138] 903. Determine whether the data packet to be transmitted is a retransmitted data packet based on the five-tuple information and sequence identifier of the data packet to be transmitted and the five-tuple information and sequence identifier of the stored sent data packet; the sent data packet and the data packet to be transmitted are data packets sent by the same network connection.
[0139] 904. In the case that the data packet to be transmitted is a retransmission data packet, the data packet to be transmitted is preferentially sent to the destination end.
[0140] In this embodiment, the network protocol followed by the data packets is not expanded. When the sending end detects packet loss, it retransmits the lost data. The specific implementation of the sending end's monitoring of packet loss and retransmission of data can be found in the relevant content of the above embodiment and will not be repeated here.
[0141] In step 901, the switch receives a data packet to be transmitted from a transmitting end. In step 902, the switch obtains 5-tuple information and a sequence identifier from the data packet to be transmitted. The sequence identifier is used to mark the order in which the data packets to be transmitted are connected to the same network. A description of the sequence identifier can be found in the relevant content of the above embodiment and will not be repeated here.
[0142] In this embodiment, the five-tuple information and sequence identifier of the sent data packet can also be recorded and stored. The sent data packet refers to a data packet sent from the same network connection as the data packet to be transmitted, and is sent by the first device to the switch and forwarded to the destination end by the switch.
[0143] Based on the stored five-tuple information and sequence identifier of the sent data packet, in step 903, it can be determined whether the data packet to be transmitted is a retransmitted data packet based on the five-tuple information and sequence identifier of the data packet to be transmitted and the stored five-tuple information and sequence identifier of the sent data packet.
[0144] Specifically, the five-tuple information and sequence identifier of the data packet to be transmitted can be used to query the stored five-tuple information and sequence identifiers of the transmitted data packets; if the five-tuple information and sequence identifier of the same transmitted data packet are found to be the same as the five-tuple information and sequence identifier of the data packet to be transmitted, then the data packet to be transmitted is determined to be a retransmitted data packet. Correspondingly, if the five-tuple information and sequence identifier of the transmitted data packets do not contain a transmitted data packet that has the same five-tuple information and sequence identifier as the data packet to be transmitted, then the data packet to be transmitted is determined to be a data packet sent for the first time, that is, a non-retransmitted data packet.
[0145] For the embodiment in which the data packet to be transmitted is a retransmission data packet, the data packet to be transmitted may be preferentially sent to the destination end in step 904. For the specific implementation of preferentially sending the data packet to be transmitted to the destination end when the data packet to be transmitted is a retransmission data packet, please refer to the relevant content of the above embodiment and will not be repeated here.
[0146] In this embodiment, the five-tuple information and sequence identifier of the sent data packet are stored in the switch. Thereafter, the retransmitted data packet can be identified based on the five-tuple information and sequence identifier of the data packet to be transmitted and the five-tuple information and sequence identifier of the sent data packet, and the retransmitted data packet can be sent to the destination end in priority, thereby improving the sending priority of the retransmitted data packet. Compared with the traditional method of queuing retransmitted data packets and non-retransmitted data packets on an equal basis, the sending speed of the retransmitted data packet can be increased, and the delay of the retransmitted data packet can be prevented from further deteriorating, which helps to improve the quality of network services.
[0147] In various embodiments of the present application, the switch may also record the quintuple information of the retransmitted data packet. Specifically, if the data packet to be transmitted is a retransmitted data packet, the switch may record the quintuple information of the data packet to be transmitted. Of course, the switch may also monitor and record the quintuple information of other retransmitted data packets.
[0148] In some embodiments, the switch may further perform data analysis based on the quintuple information of the data packet to be transmitted (if the data packet to be transmitted is a retransmitted data packet) and the quintuple information of other retransmitted data packets to obtain and output the data analysis results. In the embodiments of the present application, the specific implementation method of the switch performing data analysis based on the quintuple information of the data packet to be transmitted (if the data packet to be transmitted is a retransmitted data packet) and the quintuple information of other data packets is not limited.
[0149] Optionally, retransmission characteristics analysis can be performed based on the quintuple information of the data packet to be transmitted (if the data packet to be transmitted is a retransmission data packet) and the quintuple information of other retransmission data packets to obtain retransmission characteristics. The retransmission characteristics are used to reflect characteristic information related to the quintuple information and retransmission, including but not limited to: the number of retransmissions of the quintuple information, the time when the quintuple information is retransmitted, and the frequency of quintuple retransmissions.
[0150] Because retransmission characteristics reflect the quality of the network associated with the quintuple information to a certain extent, they can be used to identify potential abnormal networks as data analysis results, and output the identifier of the potential abnormal network. This allows equipment maintenance personnel to investigate potential abnormal networks.
[0151] In some embodiments, the retransmission characteristic is the number of retransmissions of the quintuple. The number of retransmissions of each quintuple can be counted based on the quintuple information of the data packet to be transmitted (when the data packet to be transmitted is a retransmission data packet) and the quintuple information of other retransmission data packets. If there is a target quintuple information whose number of retransmissions exceeds the set number, the devices corresponding to the source IP address and the destination IP address in the target quintuple information are determined based on the target quintuple information that exceeds the set number, and the network between the devices corresponding to the source IP address and the destination IP address in the target quintuple information is used as a potential abnormal network. After that, the devices corresponding to the source IP address and the destination IP address in the target quintuple information can be output. Among them, the devices corresponding to the source IP address and the destination IP address in the target quintuple information are used as identifiers of potential abnormal networks. In this way, equipment maintenance personnel can check the devices corresponding to the source IP address and the destination IP address in the target quintuple information and the network between the devices.
[0152] In an embodiment of the present application, the switch may also send the quintuple information of the data packet to be transmitted (in the case where the data packet to be transmitted is a retransmission data packet) and the quintuple information of other data packets to a data analysis device. The data analysis device may perform data analysis based on the quintuple information of the data packet to be transmitted (in the case where the data packet to be transmitted is a retransmission data packet) and the quintuple information of other data packets to obtain data analysis results, and output the data analysis results. For example, the data analysis device may perform retransmission feature analysis on the quintuple information of the data packet to be transmitted (in the case where the data packet to be transmitted is a retransmission data packet) and the quintuple information of other data packets to determine the retransmission features; and based on the retransmission features, determine a potential abnormal network, and then output an identifier of the potential abnormal network.
[0153] For the specific implementation method of the data analysis device performing data analysis based on the quintuple information of the data packet to be transmitted (in the case where the data packet to be transmitted is a retransmitted data packet) and the quintuple information of other data packets, please refer to the relevant content of the switch performing retransmission feature analysis based on the quintuple information of the data packet to be transmitted (in the case where the data packet to be transmitted is a retransmitted data packet) and the quintuple information of other retransmitted data packets, which will not be repeated here.
[0154] It should be noted that the execution entity of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution entity of steps 701 and 702 can be device A; for another example, the execution entity of step 701 can be device A, and the execution entity of step 702 can be device B; and so on.
[0155] In addition, some of the processes described in the above embodiments and the accompanying drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. The sequence numbers of the operations, such as 701, 702, etc., are merely used to distinguish between different operations and do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel.
[0156] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps in the above-mentioned data transmission methods.
[0157] Figure 10 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. As shown in Figure 10, the electronic device mainly includes: a memory 100a, a processor 100b and a communication component 100c; wherein the memory 100a is used to store computer programs;
[0158] In some embodiments, the electronic device can be implemented as a computing device, such as a server, a computer, a mobile phone, etc. Accordingly, the processor 100b is coupled to the memory 100a and is configured to execute a computer program for: obtaining data to be transmitted; determining retransmission identification information based on the number of times the data to be transmitted is transmitted in the same network connection; encapsulating the retransmission identification information and the data to be transmitted into a data packet to be transmitted; and sending the data packet to be transmitted to the switch via the communication component 100c, so that the switch can identify whether the data packet to be transmitted is a retransmission data packet based on the retransmission identification information, and if the data packet to be transmitted is a retransmission data packet, preferentially sending the data packet to be transmitted to the destination.
[0159] Optionally, when the processor 100b encapsulates the number of retransmission identification information and the data to be transmitted into the data packet to be transmitted, it is specifically used to: encapsulate the retransmission identification information into the retransmission identification field specified in the network protocol, and encapsulate the data to be transmitted into the data field of the network protocol to obtain the data packet to be transmitted; the specified retransmission identification field is a custom field in the network protocol.
[0160] Optionally, the network protocol is a TCP protocol or a custom protocol. When the network protocol is a TCP protocol, the specified protocol field is a TCP option field; when the network protocol is a custom protocol, the specified protocol field is a custom field added to the custom protocol.
[0161] Optionally, when determining the retransmission identification information according to the number of times the data to be transmitted is sent in the same network connection, the processor 100b is specifically configured to: use the number of times the data to be transmitted is sent in the same network connection as the retransmission identification information.
[0162] In some embodiments of the present application, the electronic device may be implemented as a switch. Accordingly, the processor 100b is coupled to the memory 100a and is configured to execute a computer program to: receive, via the communication component 100c, a data packet to be transmitted from a transmitting end; obtain retransmission identification information from the data packet to be transmitted; and, if the retransmission identification information indicates that the data packet to be transmitted is a retransmission data packet, preferentially transmit the data packet to the destination end via the communication component 100c.
[0163] In some embodiments, the retransmission identification information is the number of times the data packet to be transmitted is sent in the same network connection. The processor 100b is further configured to: determine whether the data packet to be transmitted is a retransmission data packet based on the number of times the data packet to be transmitted is sent in the same network connection; and determine that the data packet to be transmitted is a retransmission data packet if the number of times the data packet to be transmitted is sent in the same network connection is not a preset number corresponding to the first transmission.
[0164] Optionally, when the processor 100b obtains the retransmission identification information from the data packet to be transmitted, it is specifically configured to: obtain information stored in the retransmission identification field from the data packet to be transmitted according to the offset address of the pre-stored retransmission identification field as the retransmission identification information.
[0165] Optionally, when the processor 100b gives priority to sending the data packets to be transmitted to the destination, it is specifically used to: store the data packets to be transmitted in a first queue; wherein, other data packets sent for the first time are stored in a second queue; the scheduling priority of the first queue is higher than that of the second queue; in accordance with the first-in-first-out order, the data packets to be transmitted stored in the first queue are sent to the destination through the communication component 100c, in priority to other data packets stored in the second queue.
[0166] In some embodiments, the processor 100b is also used to: when the data packet to be transmitted is a retransmission data packet, record the five-tuple information of the data packet to be transmitted; and monitor the five-tuple information of other retransmission data packets; perform retransmission feature analysis based on the five-tuple information of the data packet to be transmitted and the five-tuple information of other retransmission data packets to obtain retransmission features, and determine the potential abnormal network based on the retransmission features; and output the identification of the potential abnormal network; and / or, send the five-tuple information of the data packet to be transmitted and the five-tuple information of other retransmission data packets to the data analysis device through the communication component 100c, so that the data analysis device can perform retransmission feature analysis based on the five-tuple information of the data packet to be transmitted and the five-tuple information of other retransmission data packets, and determine the potential abnormal network based on the retransmission features; and output the identification of the potential abnormal network.
[0167] In some embodiments, the processor 100b is also used to: receive the data packet to be transmitted sent by the sending end through the communication component 100c; obtain the five-tuple information and sequence identifier from the data packet to be transmitted; the sequence identifier is used to mark the order of the data packets to be transmitted in the same network connection; determine whether the data packet to be transmitted is a retransmitted data packet based on the five-tuple information and sequence identifier of the data packet to be transmitted, and the five-tuple information and sequence identifier of the stored sent data packet; the sent data packet and the data packet to be transmitted are data packets sent from the same network connection; in the case that the data packet to be transmitted is a retransmitted data packet, the data packet to be transmitted is preferentially sent to the destination end through the communication component 100c.
[0168] In some embodiments, the processor 100b determines whether the data packet to be transmitted is a retransmitted data packet based on the quintuple information and sequence identifier of the data packet to be transmitted, and the stored quintuple information and sequence identifier of the sent data packet, including: using the quintuple information and sequence identifier of the data packet to be transmitted to query the quintuple information and sequence identifier of the sent data packet; if the quintuple information and sequence identifier of the same sent data packet are queried, and are the same as the quintuple information and sequence identifier of the data packet to be transmitted, then it is determined that the data packet to be transmitted is a retransmitted data packet.
[0169] In some optional embodiments, as shown in FIG10 , the electronic device may further include a power supply assembly 100d and other components. For embodiments in which the electronic device is implemented as a terminal device such as a computer or mobile phone, it may further include a display assembly 100e and an audio assembly 100f and other components. FIG10 schematically illustrates only some components, and does not necessarily mean that the electronic device must include all of the components shown in FIG10 , nor does it mean that the electronic device can only include the components shown in FIG10 .
[0170] The electronic device provided in this embodiment, when implemented as a switch, has the ability to identify retransmitted data packets. For the identified retransmitted data packets, the retransmitted data packets can be sent to the destination end in priority, thereby improving the sending priority of the retransmitted data packets. Compared with the traditional method of queuing retransmitted data packets and non-retransmitted data packets on an equal basis, the sending speed of the retransmitted data packets can be increased, and the delay of the retransmitted data packets can be prevented from further deteriorating, which helps to improve the quality of network services.
[0171] In an embodiment of the present application, the memory is used to store computer programs and can be configured to store various other data to support operations on the device where it is located. The processor can execute the computer program stored in the memory to implement the corresponding control logic. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0172] In the embodiment of the present application, the processor can be any hardware processing device that can execute the logic of the above method. Optionally, the processor can be a central processing unit (CPU), a graphics processing unit (GPU) or a microcontroller unit (MCU); it can also be a programmable device such as a field programmable gate array (FPGA), a programmable array logic device (PAL), a general array logic device (GAL), a complex programmable logic device (CPLD); or an application specific integrated circuit (ASIC) chip; or an advanced reduced instruction set (RISC) processor (Advanced RISC Machines, ARM) or a system on chip (SoC), etc., but is not limited thereto.
[0173] In an embodiment of the present application, the communication component is configured to facilitate wired or wireless communication between the device in which it is located and other devices. The device in which the communication component is located can access a wireless network based on a communication standard, such as Wireless Fidelity (WiFi), 2G or 3G, 4G, 5G or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component can also be based on Near Field Communication (NFC) technology, Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology or other technologies.
[0174] In an embodiment of the present application, the display component may include a liquid crystal display (LCD) and a touch panel (TP). If the display component includes a touch panel, the display component may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor can not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0175] In embodiments of the present application, a power supply assembly is configured to provide power to various components of the device in which it is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply assembly is located.
[0176] In an embodiment of the present application, the audio component may be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode, the microphone is configured to receive external audio signals. The received audio signal may be further stored in a memory or sent via a communication component. In some embodiments, the audio component further includes a speaker for outputting audio signals. For example, for a device with a language interaction function, voice interaction with the user can be achieved through the audio component.
[0177] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0178] It should also be noted that the descriptions such as "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent the order of precedence, nor do they limit "first" and "second" to different types.
[0179] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage, etc.) that contain computer-usable program code.
[0180] The present application is described with reference to the flow chart and / or block diagram of the method, device (or system) and computer program product according to the embodiment of the present application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart flow or multiple flows and / or one box or multiple boxes of the block diagram.
[0181] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0182] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0183] In a typical configuration, a computing device includes one or more processors (such as a CPU, etc.), input / output interfaces, network interfaces, and memory.
[0184] Memory may include non-permanent storage in a computer-readable medium, random-access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0185] Computer storage media is readable storage media, also known as readable media. Readable storage media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random-access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0186] It should also be noted that the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method, commodity or device comprising the above elements. The above content is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included within the scope of the claims of the present application.
Claims
1. A data transmission method, characterized in that: include: Receive data packets to be transmitted sent by the sender; Acquire retransmission identification information from the data packet to be transmitted; In the case where the retransmission identification information indicates that the data packet to be transmitted is a retransmission data packet, the data packet to be transmitted is preferentially sent to the destination end.
2. The method according to claim 1, characterized in that The retransmission identification information is the number of times the data packet to be transmitted is sent in the same network connection; the method further includes: Determining whether the data packet to be transmitted is a retransmitted data packet according to the number of times the data packet to be transmitted is sent in the same network connection; If the number of times the data packet to be transmitted is sent in the same network connection is not the preset number corresponding to the first sending, it is determined that the data packet to be transmitted is a retransmission data packet.
3. The method according to claim 1, characterized in that The obtaining retransmission identification information from the data packet to be transmitted includes: According to the pre-stored offset address of the retransmission identification field, the information stored in the retransmission identification field is obtained from the data packet to be transmitted as the retransmission identification information.
4. The method according to any one of claims 1 to 3, characterized in that: The step of preferentially sending the data packet to be transmitted to the destination end includes: The data packets to be transmitted are stored in a first queue; other data packets sent for the first time are stored in a second queue; the scheduling priority of the first queue is higher than that of the second queue; In a first-in-first-out order, the to-be-transmitted data packets stored in the first queue are sent to the destination end in priority to other data packets stored in the second queue.
5. The method according to any one of claims 1 to 3, characterized in that: Also includes: In the case where the data packet to be transmitted is a retransmitted data packet, recording quintuple information of the data packet to be transmitted; And monitor the quintuple information of other retransmitted data packets; Performing retransmission feature analysis according to the five-tuple information of the data packet to be transmitted and the five-tuple information of the other retransmitted data packets to obtain the retransmission feature; Determine a potential abnormal network according to the retransmission characteristics, and output an identifier of the potential abnormal network; and / or, The quintuple information of the data packet to be transmitted and the quintuple information of the other retransmitted data packets are sent to a data analysis device, so that the data analysis device performs retransmission feature analysis based on the quintuple information of the data packet to be transmitted and the quintuple information of the other retransmitted data packets, determines the potential abnormal network based on the retransmission features, and outputs the identifier of the potential abnormal network.
6. A data transmission method, characterized in that: include: Get the data to be transmitted; Determining retransmission identification information according to the number of times the data to be transmitted is sent in the same network connection; Encapsulating the retransmission identification information and the data to be transmitted into a data packet to be transmitted; The data packet to be transmitted is sent to a switch, so that the switch can identify whether the data packet to be transmitted is a retransmission data packet based on the retransmission identification information, and if the data packet to be transmitted is a retransmission data packet, the data packet to be transmitted is preferentially sent to a destination end.
7. The method according to claim 6, characterized in that The step of encapsulating the number of retransmission identification information and the data to be transmitted into a data packet to be transmitted includes: The retransmission identification information is encapsulated into a retransmission identification field specified in a network protocol, and the data to be transmitted is encapsulated into a data field of the network protocol to obtain the data packet to be transmitted; the specified retransmission identification field is a custom field in the network protocol.
8. The method according to claim 7, characterized in that The network protocol is TCP protocol or a custom protocol; When the network protocol is the TCP protocol, the specified retransmission identification field is a TCP option field; When the network protocol is a custom protocol, the specified retransmission identification field is a custom field added in the custom protocol.
9. The method according to any one of claims 6 to 8, characterized in that: The determining the retransmission identification information according to the number of times the data to be transmitted is sent in the same network connection includes: The number of times the data to be transmitted is sent in the same network connection is used as the retransmission identification information.
10. A data transmission method, characterized in that: include: Receive data packets to be transmitted sent by the sender; Acquire quintuple information and sequence identifier from the data packet to be transmitted; The sequence identifier is used to mark the sequence of the data packets to be transmitted in the same network connection; According to the five-tuple information and sequence identifier of the data packet to be transmitted, and the five-tuple information and sequence identifier of the stored sent data packet, it is determined whether the data packet to be transmitted is a retransmitted data packet; the sent data packet and the data packet to be transmitted are data packets sent by the same network connection; In the case that the data packet to be transmitted is a retransmission data packet, the data packet to be transmitted is preferentially sent to the destination end.
11. The method according to claim 10, characterized in that The step of determining whether the data packet to be transmitted is a retransmitted data packet according to the five-tuple information and sequence identifier of the data packet to be transmitted and the five-tuple information and sequence identifier of the stored sent data packet comprises: Using the five-tuple information and sequence identifier of the data packet to be transmitted, querying the five-tuple information and sequence identifier of the sent data packet; If the quintuple information and sequence identifier of the same sent data packet are found to be the same as the quintuple information and sequence identifier of the data packet to be transmitted, it is determined that the data packet to be transmitted is a retransmitted data packet.
12. A network system, characterized in that: include: a first device for sending data and a second device for receiving data; The network system further includes: a switch disposed between the first device and the second device; The switch is used to perform the steps in the method according to any one of claims 1 to 5 or 10 to 11; The first device is used to execute the steps in the method according to any one of claims 6 to 9.
13. An electronic device, characterized in that: include: Memory, processor and communication components; wherein the memory is used to store computer programs; The processor is coupled to the memory and the communication component, and is configured to execute the computer program to perform the steps in the method according to any one of claims 1 to 11.
14. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps in the method performed by the switch and / or the first device as claimed in claim 12 .
Citation Information
Patent Citations
Data transmission method and device, base station and storage medium
CN112865934A
Data message transmission method and device, electronic equipment and computer storage medium
CN113992307A
Device and method for packet transmission
JP2016103698A