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
- CN202311029412.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-15
- Publication Date
- 2025-02-25
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 CN119519905A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] Network packet loss is the phenomenon that data packets are lost in the channel due to various reasons. There are many reasons for network packet loss, including but not limited to: switch congestion, switch failure, network card failure, and host operating system stop responding (Hang).
[0003] Data needs to be retransmitted after network packet loss. The retransmission backoff algorithm is a commonly used retransmission method. The retransmission backoff algorithm is that after the node on the network sends data packet loss, it waits for a certain period of time before sending again. The waiting time increases exponentially, thereby avoiding frequent triggering of network packet loss. For example, assuming that the first retransmission interval is 200 milliseconds (ms), the retransmission waiting time increases exponentially, namely: 200ms, 400ms, 800ms, 1.6 seconds (s), 3.2s, etc. If the same connection loses packets three times in a row, there will be a network interruption of more than 1s, affecting the service quality. Since the packet retransmission delay has an important impact on the service quality, it is particularly important to prevent the network service quality from further deteriorating. Summary of the invention
[0004] Multiple aspects of the present application provide a data transmission method, device, system and storage medium to increase network retransmission speed and reduce network retransmission delay.
[0005] In a first aspect, an embodiment of the present application provides a data transmission method, including:
[0006] Receive data packets to be transmitted sent by the sender;
[0007] Acquire retransmission identification information from the data packet to be transmitted;
[0008] 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.
[0009] In a second aspect, an embodiment of the present application further provides a data transmission method, including:
[0010] Get the data to be transmitted;
[0011] Determining retransmission identification information according to the number of times the data to be transmitted is sent in the same network connection;
[0012] Encapsulating the retransmission identification information and the data to be transmitted into a data packet to be transmitted;
[0013] 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.
[0014] In a third aspect, an embodiment of the present application further provides a data transmission method, including:
[0015] Receive data packets to be transmitted sent by the sender;
[0016] Acquire quintuple information and a sequence identifier from the data packet to be transmitted; the sequence identifier is used to mark the sequence of the data packet to be transmitted in the same network connection;
[0017] 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;
[0018] 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.
[0019] 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;
[0020] The switch is used to execute the steps of the data transmission method provided in the first aspect and / or the third aspect of the claim;
[0021] The first device is used to execute the steps in the data transmission method provided in the second aspect above.
[0022] 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;
[0023] The processor is coupled to the memory and is configured to execute the computer program to execute the steps in the data transmission method provided by the above aspects.
[0024] 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 of the method executed by the switch and / or the first device in the network system provided in the fourth aspect above.
[0025] In the embodiment of the present application, the switch is improved so that 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 with 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
[0026] 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:
[0027] Figure 1 A schematic diagram of the structure of a network system and a schematic diagram of the process of data transmission of the network system provided in an embodiment of the present application;
[0028] Figure 2 A schematic diagram of the process of establishing a network connection provided in an embodiment of the present application;
[0029] Figure 3 A schematic diagram of the structure of the protocol header of a data packet provided in an embodiment of the present application;
[0030] Figure 4 A schematic diagram of a data packet sent for the first time and a retransmitted data packet provided in an embodiment of the present application;
[0031] Figure 5 A schematic diagram of another process of data transmission by the network system provided in an embodiment of the present application;
[0032] Figure 6 A schematic diagram of a process of data transmission performed by a switch provided in an embodiment of the present application;
[0033] Figure 7-Figure 9 A flowchart of a data transmission method provided in an embodiment of the present application;
[0034] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0036] In some embodiments of the present application, the switch is improved so that 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 on a priority basis, 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.
[0037] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0038] 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.
[0039] Figure 1 This is a schematic diagram of the structure of the network system provided in the embodiment of the present application. Figure 1 As shown, 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.
[0040] 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 (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.
[0041] The switch 30 is a network device for signal forwarding. It can provide a signal path for any two network nodes (such as the first device 10 and the second device 20) connected to the switch. In the embodiment of the present application, the switch 30 may be a programmable switch, etc. The programmable switch has a built-in operating system, and the programmable switch can be programmed through the operating system to expand the function of the switch. For example, in some embodiments, the packet processing logic can be programmed and configured through the operating system of the programmable switch to perform data processing on the received data packets before forwarding the data packets.
[0042] 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 Connections (QUIC) protocol. Of course, the network protocol can also be a custom network protocol, such as a custom reliable transmission protocol based on the UDP protocol.
[0043] The purpose of establishing a network connection between the first device 10 and the second device 20 through a handshake is to track and negotiate the amount of data sent each time, ensure the synchronization of sending and receiving data segments, confirm when to cancel the connection after the data is sent and received according to the amount of data received, and establish a virtual connection. For example, for the TCP protocol, a network connection can be established between the first device 10 and the second device 20 through a three-way handshake. The following takes the first device 10 as the sending end and the second device 20 as the receiving end as an example to exemplify the method of establishing a network connection between the first device 10 and the second device 20 through a three-way handshake.
[0044] like Figure 2 As shown, the first handshake: the first device 10 sends a request message to establish a TCP network connection (corresponding to Figure 2 Step 1). The request message contains a sequence number (SEQ) of X. The sequence number (SEQ) X is used to identify the byte stream sent from the first device 10 to the second device 20, and X is randomly generated by the sender (i.e., the first device 10). The first device 10 also sets the synchronous connection establishment (SYN) field in the request message to 1, indicating that a TCP network connection needs to be established.
[0045] 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 Figure 2Step 2). The response message includes SEQ 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, and the ACK field value is based on the sequence number (SEQ) X included 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 receiving the response message.
[0046] Third handshake: After the first device 10 receives the response message sent by the second device 20 to establish the TCP network connection, it replies with a confirmation message to the second device 20 (corresponding to Figure 2 Step 3). The sequence number (SEQ) in the confirmation message is 1 plus the sequence number X sent in the first handshake, that is, SEQ=X+1. The ACK field in the confirmation message is set to the response message replied by the second device 20 containing the sequence number Y plus 1, that is, ACK=Y+1. The SYN field in the confirmation message is set to 1.
[0047] 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.
[0048] 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. When data is transmitted between the first device 10 and the second device 20, data packet loss may occur. When the sending end detects data packet loss, the lost data will be retransmitted. The following is an exemplary description using the first device 10 as the data sending end and the second device 20 as the data receiving end.
[0049] The first device 10 can encapsulate the data to be transmitted into a data packet and send the data packet to the switch 30, and the switch 30 forwards the data packet to the second device 20. In the case of normal data transmission, the second device 20 receives the data packet and verifies the data packet, and returns a response data packet of the data packet if the verification passes.
[0050] 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.
[0051] Data packets follow network protocols. The protocol header of a 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 according to this field to obtain complete data.
[0052] In an 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 and 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.
[0053] Of course, the field (sequence field) used to mark the order of data packets in the same network connection can also be in other forms, such as digital serial numbers. For example, assuming that the data is divided into multiple data fragments, the sequence number carrying the data fragment can be determined according to the order of the data fragments in the data. Assuming that the data fragment is the Nth data fragment, the field in the data packet used to mark the order of data packets in the same network connection is set to (N-1), etc. N is a positive integer.
[0054] The above embodiment exemplifies the implementation form of the field used to mark the order of data packets in the same network connection, but does not constitute a limitation.
[0055] 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, and 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 length, it is determined that the data packet A has a network packet loss, and data packet A 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.
[0056] In the conventional scheme, the retransmitted data packets are identical to the first transmitted data packets, and the switch 30 cannot distinguish the retransmitted data packets from the first transmitted data packets. The switch 30 will store the received data packets in the cache queue in the order in which the data packets are received, and then send the data packets in the storage queue to the receiving end (such as the second device 20) in order according to the first input first output (FIFO) order.
[0057] 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 first device 10 sending packet A and retransmitting packet B. Among them, packet B and packet C are the packets sent for the first time. On the switch 30 side, since packet B and packet C are received first, and packet B and packet C in the cache queue have not yet been forwarded to the second device 20, the switch 30 first stores the retransmitted packet A in the cache queue, and according to the FIFO principle, forwards packet B and packet C to the second device 20 first, and then forwards the retransmitted packet A, which undoubtedly increases the waiting time of the retransmitted packet A, that is, increases 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.
[0058] In the embodiment of the present application, in order to reduce the forwarding delay of the retransmitted data packet, the switch 30 is improved so that the switch 30 has the function of identifying the retransmitted data packet. In some embodiments, the switch 30 has an operating system, and the switch 30 can be configured with the function of identifying the retransmitted data packet through the operating system programming.
[0059] In some embodiments, the retransmission identification field can be set in the network protocol by modifying the network protocol followed by the data packet. The first device 10 (transmitter) 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 extended and configured as a retransmission identification field for recording the retransmission identification information. For example, Figure 3 As shown, the TCP protocol can expand the TCP option field in the TCP protocol header and add the TCP option field as a retransmission identification field for recording the retransmission identification information.
[0060] For example, Figure 3 As shown, the data packet complies with a custom network protocol, and a custom field can be added to the protocol header of the custom network protocol as a retransmission identification field for recording retransmission identification information.
[0061] Accordingly, the switch 30 may be configured with a retransmission identification information recognition function through the operating system of the switch 30. The switch 30 may identify the retransmission data packet according to the retransmission identification information. Figure 1 The data transmission method provided in the embodiment of the present application is exemplified.
[0062] like Figure 1 As shown, the first device 10 (sender) can obtain the data to be transmitted (corresponding to Figure 1 Step 1); and determine the retransmission identification information (corresponding to Figure 1 Step 2).
[0063] 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 the retransmission identification information and written into the retransmission identification field. Figure 4 As shown, when the data to be transmitted is sent for the first time, the retransmission identification information is 0 or 1. After that, each time the number of retransmissions increases by 1, the retransmission identification information increases by 1 based on the previous value. Figure 4 The example in which the retransmission identification information of the data packet sent for the first time is 0 is used for illustration only, but it does not constitute a limitation.
[0064] 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.
[0065] In an embodiment of the present application, the first device 10 can record the number of times M that the data to be transmitted is sent, and start timing from the time when the data packet A carrying the data to be transmitted is sent. If the response data packet of the data packet A is not received within the set time, it is determined that the data packet A is lost, and the data to be transmitted is retransmitted. The number of times the data to be transmitted is sent is M+1. Among them, M≥0, and it 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.
[0066] Accordingly, if the first device 10 determines that the data to be transmitted is 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 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 retransmission identification information is the number of times the data to be transmitted is transmitted in the same network connection, or the retransmission identification information is the above-mentioned set character, etc.
[0067] 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. Figure 4 As shown, 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.
[0068] Further, if Figure 1 As shown, 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 Figure 1 Step 3). Specifically, the first device 10 may encapsulate the retransmission identification information into a retransmission identification field specified in the network protocol, and encapsulate the data to be transmitted into a data field of the network protocol to obtain a data packet to be transmitted. Figure 5 As shown, the first device 10 can write retransmission identification information in the retransmission identification field corresponding to the protocol header of the data packet to be transmitted. The specified retransmission identification field is a custom field in the network protocol. For the setting of the retransmission identification field, refer to the relevant content of the above embodiment, which will not be repeated here.
[0069] 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, namely, a source Internet Protocol (IP) address, a source port, a destination IP address, a destination port, and a 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.
[0070] Of course, the data packet to be transmitted may also include: the field for marking the order of the data packet in the data stream (i.e., the sequence field) shown in the above embodiment, such as the SEQ field of the TCP protocol, etc. The information of each field (i.e., the field value) is written into the corresponding field according to the specification of the network protocol followed by the data packet to be transmitted.
[0071] 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 Figure 1 Step 4). The switch 30 may receive the data packet to be transmitted, and perform retransmission data packet identification on the data packet to be transmitted.
[0072] Specifically, combined Figure 1 Step 5 and Figure 5 , the switch 30 can obtain the 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 the field identification contained in the data packet to be transmitted; according to the identification of the pre-set retransmission identification field, identify the retransmission identification field from the field identification contained in the data packet to be transmitted; and then read the information recorded in the retransmission identification field as the retransmission identification information.
[0073] In other embodiments, in order to improve the speed of obtaining the retransmission identification information, the offset address of the retransmission identification field may be stored in the switch 30 in advance. The offset address of the retransmission identification field may be the offset of the retransmission identification field compared 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. According to the offset address of the retransmission identification field, the retransmission identification information is read from the data packet to be transmitted, without the need to perform protocol parsing and field identification matching on the data packet to be transmitted, which helps to improve the reading speed of the retransmission identification information, and further helps to improve the subsequent processing speed of the retransmission data packet.
[0074] After obtaining the retransmission identification information of the data packet to be transmitted, the switch 30 can determine whether the data packet to be transmitted is a retransmission data packet (corresponding to Figure 1 Step 6).
[0075] 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, and the switch 30 can determine whether the data packet to be transmitted is a retransmission 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 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, a non-retransmission data packet. Figure 5 Taking the preset number of times corresponding to the first transmission as 0, it can be determined whether the retransmission identification information is equal to 0; if equal, it is determined that the data packet to be transmitted is the data packet sent for the first time; if not equal to 0, it is determined that the data packet to be transmitted is a retransmission data packet.
[0076] In other embodiments, if the retransmission identification information is a set character, the switch 30 can determine whether the character stored in the retransmission identification field is a character corresponding to a preset retransmission data packet; if the judgment result is yes, the data packet to be transmitted is determined to be a retransmission data packet. Correspondingly, if the character stored in the retransmission identification field is a character corresponding to the preset first transmission data, the data packet to be transmitted is determined to be a first transmission data packet, that is, a non-retransmission data packet.
[0077] The method for determining whether a data packet to be transmitted is a retransmission data packet shown in the above embodiment is only for illustrative purposes and does not constitute a limitation.
[0078] Further, in order to improve the processing speed of the retransmitted data packets, when it is determined that 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 Figure 1 Step 7). The destination is the receiving end of the data packet to be transmitted, which is generally determined by the destination IP address of the retransmitted data packet.
[0079] Prioritizing sending the data packets to be transmitted to the destination mainly means giving priority to sending the data packets to be transmitted to the destination over the non-retransmitted data packets (i.e., the data packets sent for the first time) received by the switch 30 before receiving the retransmitted data packets (i.e., the data packets to be transmitted) but not yet sent to the destination.
[0080] In this embodiment, by extending the network protocol, the switch can identify the retransmitted data packets according to the extended retransmission identification information, and preferentially send 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.
[0081] On the other hand, this embodiment extends the network protocol process, sets retransmission identification information in the data packet, and identifies the retransmission data packet based on the extended retransmission identification information, without maintaining the five-tuple and sequence identification (such as a sequence number) of the data packet in the switch, which can reduce the occupation of the switch memory for identifying the retransmission data packet. When identifying the retransmission data packet, there is no need to use the five-tuple and sequence identification (such as a sequence number) to query the five-tuple and sequence identification maintained by the switch, which can improve the speed of identifying the retransmission data packet.
[0082] In order to give priority to sending the data packets to be transmitted (i.e., retransmitted data packets) to the destination, combined with Figure 5 and Figure 6 , the switch 30 may store the to-be-transmitted data packets determined as retransmitted data packets into the first queue; wherein other data packets sent for the first time (i.e., non-retransmitted data packets) are stored into the second queue, and the scheduling priority of the first queue is higher than that of the second queue. Afterwards, the to-be-transmitted data packets stored in the first queue may be sent to the destination end in accordance with the order of First Input First Output (FIFO) in priority to other data packets stored in the second queue. Since the scheduling priority of the first queue is higher than that of the second queue, during the switch scheduling process, the first queue may be sent to the destination end faster than the second queue, and will not be blocked by the non-retransmitted data packets received by the switch earlier than the to-be-transmitted data packets (i.e., retransmitted data packets). Therefore, the sending speed of the retransmitted data packets may be increased, and the delay of the retransmitted data packets may be prevented from further deteriorating, which helps to improve the quality of network services.
[0083] For example, Figure 6 As shown, the order in which the switch 30 receives data packet 1, data packet 2, and data packet 3 is: data packet 1 is earlier than data packet 2, and data packet 2 is earlier than data packet 3. The switch 30 performs retransmission data packet identification on data packet 1, data packet 2, and data packet 3 respectively, and determines that data packets 1 and 2 are data packets sent for the first time, and data packet 3 is a retransmission data packet, then stores data packets 1 and 2 in the second queue, and stores data packet 3 in the first queue. The scheduling priority of the first queue is higher than that of the second queue, so when the switch 30 performs data packet scheduling, it will give priority to sending data packet 3 stored in the first queue to the destination end, until there are no data packets in the first queue, and then start to schedule the data packets in the second queue in FIFO order, and send data packets 1 and 2 to the destination end in sequence.
[0084] In addition to the above-mentioned embodiment providing the method of extending the network protocol to realize the identification of retransmitted data packets, the present application embodiment also provides other methods for identifying retransmitted data packets. The following is an exemplary description of another method for identifying retransmitted data packets provided in the present application embodiment.
[0085] like Figure 6 As shown, in this embodiment, the network protocol followed by the data packet is not expanded. When data is transmitted between the first device 10 and the second device 20, data packet loss may occur. When the sending end detects data packet loss, it will retransmit the lost data. For the specific implementation method of the first device 10 monitoring data packet loss and retransmitting data, please refer to the relevant content of the above embodiment, which will not be repeated here.
[0086] The switch 30 can receive the data packet to be transmitted sent by the first device 10 (i.e., the transmitting end); and obtain the five-tuple information and the sequence identifier from the data packet to be transmitted; wherein the sequence identifier is used to mark the sequence of the data packet to be transmitted in the same network connection. For the description of the sequence identifier, please refer to the relevant content of the above embodiment, which will not be repeated here.
[0087] In this embodiment, the switch 30 may also record and store the five-tuple information and sequence identifier of the sent data packet. The sent data packet refers to a data packet sent by the same network connection as the data packet to be transmitted, and is sent by the first device 10 to the switch 30 and forwarded to the second device 20 (i.e., the receiving end) via the switch 30.
[0088] 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.
[0089] Specifically, the switch 30 can use the five-tuple information and sequence identifier of the data packet to be transmitted to query the five-tuple information and sequence identifier of the stored 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 there is no transmitted data packet with the same five-tuple information and sequence identifier as the data packet to be transmitted in the five-tuple information and sequence identifier of the transmitted data packet, 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.
[0090] 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, which will not be repeated here.
[0091] 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 as a 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.
[0092] In each embodiment of the present application, Figure 5 As shown, the switch 30 can also record the five-tuple information of the retransmitted data packet. Specifically, when the data packet to be transmitted is a retransmitted data packet, the switch 30 can record the five-tuple information of the data packet to be transmitted. Of course, the switch 30 can also monitor and record the five-tuple information of other retransmitted data packets.
[0093] In some embodiments, Figure 5 As shown, the switch 30 can also perform data analysis based on the five-tuple information of the data packet to be transmitted (when the data packet to be transmitted is a retransmission data packet) and the five-tuple information of other retransmission data packets to obtain data analysis results, and output the data analysis results. In the embodiment of the present application, the specific implementation method of the switch 30 performing data analysis based on the five-tuple information of the data packet to be transmitted (when the data packet to be transmitted is a retransmission data packet) and the five-tuple information of other data packets is not limited.
[0094] Optionally, the switch 30 may perform retransmission feature analysis 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 to obtain the retransmission feature. The retransmission feature is used to reflect the 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 the quintuple retransmission.
[0095] Since the retransmission characteristics reflect the network quality of the network associated with the five-tuple information to a certain extent, the switch 30 can determine the potential abnormal network according to the retransmission characteristics and output the identification of the potential abnormal network. In this way, the equipment maintenance personnel can check the potential abnormal network.
[0096] In some embodiments, the retransmission feature is the number of retransmissions of the quintuple. The switch 30 can count the number of retransmissions of each quintuple information 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 device corresponding to the source IP address and the destination IP address in the target quintuple information is 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 device 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 the identification 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 information and the network between the devices.
[0097] In the embodiment of the present application, the switch 30 can also send the five-tuple information of the data packet to be transmitted (when the data packet to be transmitted is a retransmission data packet) and the five-tuple 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, or a cloud server array, or a virtual machine (Virtual Machine, VM) running in a cloud server array. In addition, the data analysis device can also refer to other computing devices with corresponding service capabilities, such as terminal devices such as computers (running service programs), etc.
[0098] The data analysis device can perform data analysis based on the five-tuple information of the data packet to be transmitted (when 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 (when 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 determine the potential abnormal network based on the retransmission characteristics, and then output the identification of the potential abnormal network. 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 (when the data packet to be transmitted is a retransmission data packet) and the five-tuple information of other retransmission data packets can be found in the relevant content of the switch performing retransmission feature analysis based on the five-tuple information of the data packet to be transmitted (when 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.
[0099] In addition to the above network system embodiment, the embodiment of the present application also provides a data transmission method. The data transmission method provided by the embodiment of the present application is exemplarily described below.
[0100] Figure 7 The following is a flow chart of a data transmission method provided in an embodiment of the present application. Figure 7 As shown, the data transmission method mainly includes:
[0101] 701. Obtain data to be transmitted.
[0102] 702. Determine retransmission identification information according to the number of times the data to be transmitted is sent in the same network connection.
[0103] 703. Encapsulate the retransmission identification information and the data to be transmitted into the data packet to be transmitted.
[0104] 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 be transmitted to the destination end.
[0105] Figure 8 FIG. 1 is a flow chart of another data transmission method provided in an embodiment of the present application. Figure 8 As shown, the data transmission method mainly includes:
[0106] 801. Receive a data packet to be transmitted sent by a transmitter.
[0107] 802. Obtain retransmission identification information from the data packet to be transmitted.
[0108] 803. When 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.
[0109] In the embodiment of the present application, in order to reduce the forwarding delay of the retransmitted data packet, the switch is improved so that the switch has the function of identifying the retransmitted data packet. In some embodiments, the switch has an operating system, and the switch can be configured with the function of identifying the retransmitted data packet through the operating system programming.
[0110] 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.
[0111] Accordingly, the switch can be configured with a retransmission identification information recognition function through the operating system of the switch, and the switch can identify the retransmission data packet according to the retransmission identification information.
[0112] like Figure 7 As shown, for the sending end, in step 701, the data to be transmitted can be obtained; and in step 702, the retransmission identification information is determined according to the number of times the data to be transmitted is sent in the same network connection.
[0113] 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 the retransmission identification information and written into the retransmission identification field.
[0114] In other embodiments, a set character may 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.
[0115] In an embodiment of the present application, the transmitting end may record the number of times M that the data to be transmitted is sent, and start timing from the time when the data packet A carrying the data to be transmitted is sent. If the response data packet of the data packet A is not received within the set time length, it is determined that the data packet A is lost, and the data to be transmitted is retransmitted. The number of times the data to be transmitted is sent is M+1. Among them, M≥0, and it 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.
[0116] 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 retransmission identification information is the number of times the data to be transmitted is transmitted in the same network connection, or the retransmission identification information is the above-mentioned set character, etc.
[0117] For the 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.
[0118] Further, if Figure 7 As shown in step 703, the retransmission identification information and the data to be transmitted may be encapsulated into a data packet to be transmitted (corresponding to Figure 1Step 3). 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 a data packet to be transmitted.
[0119] The data packet to be transmitted may also include other protocol header fields, such as a five-tuple. Of course, the data packet to be transmitted may also include: the field for marking the order of the data packet in the data stream (i.e., the order field) shown in the above embodiment, etc. The information of each field (i.e., the field value) is written into the corresponding field according to the specification of the network protocol followed by the data packet to be transmitted.
[0120] After obtaining the data packet to be transmitted, the data packet to be transmitted may be sent to the switch in step 704. Accordingly, for the switch, in step 801, the data packet to be transmitted may be received, and retransmission data packet identification may be performed on the data packet to be transmitted.
[0121] 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 a field identification contained in the data packet to be transmitted; the retransmission identification field may be identified from the field identification contained in the data packet to be transmitted according to the identification of the pre-set retransmission identification field; and then, the information recorded in the retransmission identification field may be read as the retransmission identification information.
[0122] In other embodiments, in order to improve the speed of obtaining retransmission identification information, the offset address of the retransmission identification field may be stored in the switch in advance. The offset address of the retransmission identification field may be the offset of the retransmission identification field compared 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 the need to perform protocol parsing and field identification matching on the data packet to be transmitted, which helps to improve the reading speed of the retransmission identification information, and further helps to improve the subsequent processing speed of the retransmission data packet.
[0123] After the retransmission identification information of the data packet to be transmitted is obtained, it can be determined whether the data packet to be transmitted is a retransmission data packet according to the retransmission identification information.
[0124] 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. Then, it can be determined whether the data packet to be transmitted is a retransmission 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 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, a non-retransmission data packet.
[0125] In other embodiments, if the retransmission identification information is a set character, it can be determined whether the character is a preset character corresponding to the retransmission data packet according to the character stored in the retransmission identification field; if the judgment result is yes, it is determined that the data packet to be transmitted is a retransmission data packet. Correspondingly, if the character stored in the retransmission identification field is a preset character corresponding to the first transmission data, it is determined that the data packet to be transmitted is a first transmission data packet, that is, a non-retransmission data packet.
[0126] The method for determining whether a data packet to be transmitted is a retransmission data packet shown in the above embodiment is only for illustrative purposes and does not constitute a limitation.
[0127] Further, in order to improve the processing speed of the retransmitted data packet, when 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, which is generally determined by the destination IP address of the retransmitted data packet.
[0128] Prioritizing the transmission of data packets to the destination end mainly means that the data packets to be transmitted are sent to the destination end in priority to 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.
[0129] In this embodiment, by extending the network protocol, the switch can identify the retransmitted data packets according to the extended retransmission identification information, and preferentially send 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.
[0130] On the other hand, this embodiment extends the network protocol process, sets retransmission identification information in the data packet, and identifies the retransmission data packet based on the extended retransmission identification information, without maintaining the five-tuple and sequence identification (such as a sequence number) of the data packet in the switch, which can reduce the occupation of the switch memory for identifying the retransmission data packet. When identifying the retransmission data packet, there is no need to use the five-tuple and sequence identification (such as a sequence number) to query the five-tuple and sequence identification maintained by the switch, which can improve the speed of identifying the retransmission data packet.
[0131] In order to give priority to sending the data packets to be transmitted (i.e., retransmitted data packets) to the destination, the data packets to be transmitted that are determined to be retransmitted data packets can be stored in the first queue; wherein, other data packets sent for the first time (i.e., non-retransmitted data packets) are stored in the second queue, and the scheduling priority of the first queue is higher than that of the second queue. Afterwards, the data packets to be transmitted stored in the first queue can be sent to the destination in priority to other data packets stored in the second queue in the order of First Input First Output (FIFO). Since the scheduling priority of the first queue is higher than that of 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 the non-retransmitted data packets received by the switch earlier than the data packets to be transmitted (i.e., retransmitted data packets). Therefore, 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] In addition to the above-mentioned embodiment providing the method of extending the network protocol to realize the identification of retransmitted data packets, the present application embodiment also provides other methods for identifying retransmitted data packets. The following is an exemplary description of another method for identifying retransmitted data packets provided in the present application embodiment.
[0133] Fig. 9 A flowchart of another data transmission method provided in an embodiment of the present application is shown below. Figure 8 As shown, the data transmission method mainly includes:
[0134] 901. Receive a data packet to be transmitted sent by a transmitter.
[0135] 902. Acquire quintuple information and a 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.
[0136] 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.
[0137] 904. When the data packet to be transmitted is a retransmission data packet, the data packet to be transmitted is preferentially sent to the destination end.
[0138] In this embodiment, the network protocol followed by the data packet is not expanded. When the sending end detects data packet loss, it will retransmit the lost data. For the specific implementation method of the sending end monitoring data packet loss and retransmitting data, please refer to the relevant content of the above embodiment, which will not be repeated here.
[0139] For the switch, in step 901, a data packet to be transmitted sent by a transmitting end may be received; and in step 902, five-tuple information and a sequence identifier may be obtained from the data packet to be transmitted; wherein the sequence identifier is used to mark the sequence of the data packets to be transmitted in the same network connection. For the description of the sequence identifier, please refer to the relevant content of the above embodiment, which will not be repeated here.
[0140] 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 by 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.
[0141] Based on the stored quintuple 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 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.
[0142] Specifically, the five-tuple information and sequence identifier of the data packet to be transmitted can be used to query the five-tuple information and sequence identifier of the stored sent data packets; if the five-tuple information and sequence identifier of the same sent 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 there is no sent data packet with the same five-tuple information and sequence identifier as the data packet to be transmitted in the five-tuple information and sequence identifier of the sent data packet, 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.
[0143] 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 contents of the above embodiment, which will not be repeated here.
[0144] 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 as a 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.
[0145] In each embodiment of the present application, the switch may also record the five-tuple information of the retransmitted data packet. Specifically, when the data packet to be transmitted is a retransmitted data packet, the switch may record the five-tuple information of the data packet to be transmitted. Of course, the switch may also monitor and record the five-tuple information of other retransmitted data packets.
[0146] In some embodiments, the switch may also perform data analysis based on the five-tuple information of the data packet to be transmitted (when the data packet to be transmitted is a retransmission data packet) and the five-tuple information of other retransmission data packets to obtain data analysis results, 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 five-tuple information of the data packet to be transmitted (when the data packet to be transmitted is a retransmission data packet) and the five-tuple information of other data packets is not limited.
[0147] Optionally, retransmission feature analysis can be performed 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 to obtain retransmission features. The retransmission features are used to reflect feature 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 the quintuple retransmission.
[0148] Since the retransmission characteristics reflect the network quality of the network associated with the five-tuple information to a certain extent, the potential abnormal network can be determined based on the retransmission characteristics as the data analysis result, and the identification of the potential abnormal network can be output. In this way, equipment maintenance personnel can check the potential abnormal network.
[0149] In some embodiments, if the retransmission feature 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, and then 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 the identification 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 information and the network between the devices.
[0150] In an embodiment of the present application, the switch may also send 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 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 (when 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 (when 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 determine the potential abnormal network based on the retransmission features, and then output the identifier of the potential abnormal network.
[0151] 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 retransmission 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 retransmission data packet) and the quintuple information of other retransmission data packets, which will not be repeated here.
[0152] It should be noted that the execution subject 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 subject of steps 701 and 702 can be device A; for another example, the execution subject of step 701 can be device A, and the execution subject of step 702 can be device B; and so on.
[0153] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations appearing in a specific order are included, but 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, and the sequence numbers of the operations, such as 701, 702, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel.
[0154] Accordingly, an embodiment of the present application also 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.
[0155] Fig.10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.10 As shown, 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;
[0156] 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 used to execute a computer program for: obtaining 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; and sending the data packet to be transmitted to the switch through 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 in the case where the data packet to be transmitted is a retransmission data packet, preferentially sending the data packet to be transmitted to the destination.
[0157] 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.
[0158] 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 in the custom protocol.
[0159] Optionally, when the processor 100b determines the retransmission identification information according to the number of times the data to be transmitted is sent in the same network connection, it 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.
[0160] 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 used to execute a computer program for: receiving a data packet to be transmitted sent by a transmitting end through the communication component 100c; obtaining retransmission identification information from the data packet to be transmitted; and when the retransmission identification information indicates that the data packet to be transmitted is a retransmission data packet, preferentially sending the data packet to be transmitted to the destination end through the communication component 100c.
[0161] 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 used to: determine whether the data packet to be transmitted is a retransmission 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 transmission, determine that the data packet to be transmitted is a retransmission data packet.
[0162] Optionally, when the processor 100b obtains the retransmission identification information from the data packet to be transmitted, it is specifically used 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.
[0163] 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; and in a first-in-first-out order, send the data packets to be transmitted stored in the first queue to the destination through the communication component 100c, in priority to other data packets stored in the second queue.
[0164] In some embodiments, the processor 100b is also used for: in the case where the data packet to be transmitted is a retransmission data packet, recording the five-tuple information of the data packet to be transmitted; and monitoring the five-tuple information of other retransmission data packets; performing 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 the retransmission feature, and determining the potential abnormal network based on the retransmission feature; and outputting the identification of the potential abnormal network; and / or, sending 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 performs 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 determines the potential abnormal network based on the retransmission feature; and outputting the identification of the potential abnormal network.
[0165] In some embodiments, the processor 100b is also used to: receive a data packet to be transmitted sent by a transmitter through the communication component 100c; obtain five-tuple 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; determine whether the data packet to be transmitted is a retransmission 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; 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 through the communication component 100c.
[0166] 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 they 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.
[0167] In some optional embodiments, such as Fig.10 As shown, the electronic device may further include: a power supply component 100d and other components. For an embodiment in which the electronic device is implemented as a terminal device such as a computer or a mobile phone, it may further include: a display component 100e and an audio component 100f and other components. Fig.10 Some components are shown schematically, and it does not mean that electronic devices must include Fig.10 The components shown do not necessarily mean that the electronic device can only include Fig.10 Components shown.
[0168] 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 with 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.
[0169] In an embodiment of the present application, the memory is used to store a computer program and can be configured to store various other data to support operations on the device where it is located. Among them, 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 (Static Random-Access Memory, SRAM), electrically erasable programmable read only memory (Electrically Erasable Programmable Read Only Memory, EEPROM), erasable programmable read only memory (Electrical Programmable Read Only Memory, EPROM), programmable read only memory (Programmable Read Only Memory, PROM), read only memory (Read Only Memory, ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0170] 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 field programmable gate array (FPGA), a programmable array logic device (PAL), a general array logic device (GAL), a complex programmable logic device (CPLD) and other programmable devices; 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 not limited to this.
[0171] 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.
[0172] 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 touch, slide, and gestures on the touch panel. The touch sensor may 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.
[0173] In an embodiment of the present application, a power supply component is configured to provide power to various components of the device in which it is located. The power supply component 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 component is located.
[0174] 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 (Microphone, MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal may be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal. For example, for a device with a language interaction function, voice interaction with a user can be achieved through an audio component.
[0175] 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 the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0176] 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.
[0177] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage, etc.) that contain computer-usable program code.
[0178] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (or systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0179] These computer program instructions may also be stored in a computer-readable memory capable of directing 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 an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0180] 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, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0181] In a typical configuration, a computing device includes one or more processors (such as a CPU, etc.), an input / output interface, a network interface, and a memory.
[0182] Memory may include non-permanent storage in a computer-readable medium, random-access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0183] The storage medium of a computer is a readable storage medium, which may also be referred to as a readable medium. The readable storage medium includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be a computer-readable instruction, a data structure, a module of a program, 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, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic cassettes, 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.
[0184] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the above elements.
[0185] The above contents are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle 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 the data packet 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 the data packet 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
Method and system for transmitting data frame as well as base station subsystem device
CN101765194A
Message parser and design method thereof
CN111131159A
Data transmission method and device, base station and storage medium
CN112865934A
Data message transmission method and device, electronic equipment and computer storage medium
CN113992307A
Data transmission method and system, electronic equipment and storage medium
CN114979023A