WO2024037296A1 - Protocol family-based quic data transmission method and device - Google Patents

Protocol family-based quic data transmission method and device Download PDF

Info

Publication number
WO2024037296A1
WO2024037296A1 PCT/CN2023/109099 CN2023109099W WO2024037296A1 WO 2024037296 A1 WO2024037296 A1 WO 2024037296A1 CN 2023109099 W CN2023109099 W CN 2023109099W WO 2024037296 A1 WO2024037296 A1 WO 2024037296A1
Authority
WO
WIPO (PCT)
Prior art keywords
quic
data
ring
data processing
shared memory
Prior art date
Application number
PCT/CN2023/109099
Other languages
French (fr)
Chinese (zh)
Inventor
陈建
Original Assignee
上海哔哩哔哩科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海哔哩哔哩科技有限公司 filed Critical 上海哔哩哔哩科技有限公司
Publication of WO2024037296A1 publication Critical patent/WO2024037296A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/12Protocol engines
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Definitions

  • the present disclosure relates to the field of Internet technology, and in particular to a QUIC data transmission method based on a protocol suite.
  • the present disclosure also relates to a QUIC data transmission device based on the protocol suite, a computing device, and a computer-readable storage medium.
  • the QUIC protocol is a low-latency Internet transport layer protocol based on the UDP protocol (User Data Packet Protocol). It is a connectionless transmission protocol.
  • the QUIC protocol improves the efficiency of network transmission and meets the application needs of more scenarios. It can handle more connections and achieve lower delays, etc.
  • servers that use the QUIC protocol to communicate often bring problems. More performance overhead will consume machine computing resources to a greater extent, leading to increased costs, thus reducing the use of the QUIC protocol in larger-scale production scenarios.
  • embodiments of the present disclosure provide a QUIC data transmission method based on the protocol suite.
  • the present disclosure also relates to a QUIC data transmission device based on the protocol suite, a computing device, and a computer-readable storage medium, so as to solve the problem of high resource overhead existing in the prior art.
  • a QUIC data transmission method based on a protocol suite including:
  • a QUIC data processing path ring is formed based on shared memory and protocol family sockets
  • QUIC data is transmitted according to the QUIC data processing thread and QUIC data processing path ring.
  • Transmission devices including:
  • the creation module is configured to create a QUIC data processing thread, the protocol family socket and shared memory corresponding to the QUIC data processing thread;
  • the component module is configured to form a QUIC data processing path ring based on shared memory and protocol family sockets;
  • the transmission module is configured to transmit QUIC data according to the QUIC data processing thread and the QUIC data processing path ring.
  • a computing device including a memory, a processor, and computer instructions stored in the memory and executable on the processor.
  • the processor executes the computer instructions, the desired Describe the steps of the QUIC data transmission method based on the protocol suite.
  • a non-volatile computer-readable storage medium which stores computer instructions.
  • the computer instructions are executed by a processor, the QUIC data transmission method based on the protocol family is implemented. step.
  • a computer program product including a computing program stored on the above-mentioned non-volatile computer-readable storage medium.
  • the QUIC data transmission method based on the protocol family creates a QUIC data processing thread, a protocol family socket and shared memory corresponding to the QUIC data processing thread; a QUIC data processing path ring is formed based on the shared memory and the protocol family socket; ;Transmit QUIC data according to the QUIC data processing thread and QUIC data processing path ring.
  • a QUIC data processing path ring By constructing a QUIC data processing path ring, a ring buffer for processing QUIC data is generated, and the QUIC protocol stack and AF_XDP-based network data transmission are combined. There is no need to send QUIC data to the Linux kernel network protocol stack, thus reducing the CPU load of the terminal. , improving data transmission efficiency.
  • Figure 1 is a flow chart of a QUIC data transmission method based on a protocol suite provided by an embodiment of the present disclosure
  • Figure 2 is an architectural schematic diagram of the QUIC data transmission method based on the protocol suite provided by an embodiment of the present disclosure
  • Figure 3 is a processing flow chart of a protocol family-based QUIC data transmission method applied to the scenario of receiving data packets provided by an embodiment of the present disclosure
  • Figure 4 is a processing flow chart of a protocol family-based QUIC data transmission method applied to the scenario of sending data packets provided by an embodiment of the present disclosure
  • Figure 5 is a diagram of a QUIC data transmission device based on the protocol suite provided by an embodiment of the present disclosure. Structural diagram;
  • FIG. 6 is a structural block diagram of a computing device provided by an embodiment of the present disclosure.
  • first, second, etc. may be used to describe various information in one or more embodiments of the present disclosure, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other.
  • the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
  • word "if” as used herein may be interpreted as "when” or “when” or “in response to determining.”
  • UDP User Datagram Protocol
  • a connectionless transport protocol a connectionless transport protocol
  • QUIC A low-latency Internet transport layer protocol based on UDP.
  • eBPF An extended version of the Berkeley Packet Filter, a user-written program that can run in the Linux kernel.
  • XDP Fast Data Path is an eBPF hook in the Linux network processing process. It can mount the eBPF program and process the network data packets when they arrive at the network card driver layer.
  • AF_XDP is a set of protocol suites designed for high-performance data processing based on XDP.
  • QUIC Quick UDP Internet Connection
  • the implementation of the QUIC protocol requires a lot of interaction between the user layer, user space and system kernel space, which leads to an increase in system load.
  • a large number of encryption and reliability delivery processes when the QUIC protocol is running also increases the load on the CPU. Therefore, most servers currently implementing the QUIC protocol suffer from excessive CPU load.
  • the overhead of sending and receiving UDP packets is high: Especially for large file downloads, SendMsg accounts for a high proportion, which may reach more than 35%-40%.
  • the protocol stack has high overhead: mainly affected by the protocol stack implementation, such as ACK processing, MTU detection and packet size, memory management and copying, etc.
  • eBPF Extended Berkeley Packet Filter
  • XDP can be used in the network Data packets are processed when they arrive at the network card driver layer.
  • AF_XDP is a new protocol family implemented based on XDP, which can achieve fast and efficient data reception and transmission.
  • a QUIC data transmission method based on the protocol family is provided.
  • the disclosure also relates to a QUIC data transmission device based on the protocol family, a computing device, and a computer-readable storage medium.
  • a QUIC data transmission device based on the protocol family, a computing device, and a computer-readable storage medium.
  • Figure 1 shows a flow chart of a QUIC data transmission method based on the protocol suite provided according to an embodiment of the present application, which specifically includes the following steps:
  • Step 102 Create a QUIC data processing thread, the protocol family socket and shared memory corresponding to the QUIC data processing thread.
  • the QUIC data processing thread specifically refers to the thread used to process QUIC data.
  • the QUIC data processing thread usually includes a QUIC data packet receiving module, a QUIC core protocol stack, and a QUIC data packet sending module.
  • the QUIC data packet receiving module is used to receive QUIC data packets and send the data packets to the QUIC core protocol stack for processing.
  • the QUIC core protocol stack When the QUIC data packet needs to be sent out, the QUIC core protocol stack generates a UDP message, which is generated by the QUIC data packet.
  • the sending module sends it out.
  • the number of QUIC data processing threads can be one, two or more.
  • each QUIC data thread corresponds to a protocol family socket (AF_XDP Socket).
  • AF_XDP Socket is created by the basic socket() system call and includes 2 ring buffers (ring): RX ring (receiving ring) and TX ring (transmitting ring).
  • Rx ring and TX ring are responsible for receiving and sending socket data packets respectively, and are registered and allocated sizes by setsockopts XDP_RX_RING and XDP_TX_RING respectively.
  • the Rx ring and TX ring descriptors point to a data cache called UMEM in memory, which is the shared memory.
  • UMEM data cache
  • the Rx ring and TX ring can share the same UMEM so that packets do not need to be copied between the Rx ring and TX ring.
  • UMEM Shared memory
  • the descriptor in the ring refers to the data frame by referencing the address of the data frame, and this address is the offset in the entire UMEM memory domain.
  • the application uses the Fill ring to send the address to the kernel to fill it with data packets. Once the data packet is received, these data frames The reference will appear in the RX ring.
  • the Completion ring contains the address of the data frame that has been transferred by the kernel and can be used by user space.
  • the QUIC data transmission method based on the protocol family provided by this disclosure applies AF_XDP technology to the data transmission process in the QUIC server and combines the AF_XDP technology to improve the transmission efficiency of QUIC data packets and reduce the CPU load.
  • the server that deploys QUIC data processing threads usually adopts a multi-threaded architecture, that is, multiple QUIC data processing threads are set up in one server. Since it is used to process the transmission task of QUIC data, it needs to use
  • the settings of the QUIC data processing thread are related to the network card. Specifically, create the QUIC data processing thread, the protocol family socket and shared memory corresponding to the QUIC data processing thread, including:
  • the network card hardware queue is a technology used to solve the problem of network IO service quality.
  • bandwidth of network IO continues to increase, a single-core CPU cannot fully meet the needs of the network card.
  • multi-queue network card drivers Through the support of multi-queue network card drivers, each Queues are bound to different cores through interrupts to meet the needs of the network card.
  • the number of QUIC data processing threads is usually determined based on the total number of network card hardware queues. For example, if there are 8 network card hardware queues, 8 QUIC data processing threads can be set; if the number of network card hardware queues is 4 , you can set up 4 QUIC data processing thread.
  • QUIC thread 1 After creating a corresponding number of QUIC data processing threads based on the number of network card hardware queues, create a shared memory and protocol family socket for each QUIC data processing thread. Take for example that there are two QUIC data processing threads, namely QUIC thread 1 and QUIC thread 2. Create corresponding UMEM1 and AF_XDP socket 1 for QUIC thread 1, and create corresponding UMEM2 and AF_XDP socket 2 for QUIC thread 2. .
  • UMEM is a shared memory
  • each QUIC thread can use the same UMEM, different QUIC threads can use different UMEM, or several QUIC threads can use one
  • the number of shared memories is not limited in this disclosure, and the actual reference shall prevail. In this disclosure, it is necessary to ensure that there is a one-to-one correspondence between the QUIC data processing thread and the protocol family socket.
  • 8 QUIC data processing threads are created, and corresponding protocol family sockets are created for each QUIC data processing thread, for a total of 8 AF_XDP, divides 8 shared memories at the same time, and allocates one shared memory to each QUIC data processing thread, for a total of 8 UMEMs.
  • 8 QUIC data processing threads are created, and corresponding protocol family sockets are created for each QUIC data processing thread, for a total of 8 AF_XDP, 1 shared memory is divided at the same time, 8 QUIC data processing threads share this 1 UMEM, a total of 1 UMEM.
  • 8 QUIC data processing threads are created, and corresponding protocol family sockets are created for each QUIC data processing thread, for a total of 8 AF_XDP is divided into 2 shared memories, and every 4 QUIC data processing threads share 1 UMEM, for a total of 2 UMEMs.
  • Step 104 Form a QUIC data processing path ring based on shared memory and protocol family sockets.
  • the QUIC data processing path ring specifically refers to the ring used to process QUIC data.
  • QUIC data transmission processing includes two categories, one is to receive QUIC data, and the other is to send QUIC data. Receiving and sending are two different QUIC data processing paths.
  • the QUIC data processing path ring is composed of shared memory and protocol family sockets, including:
  • the filling ring is used to receive the position offset information of the QUIC received data expected to be saved in the shared memory, and the completion ring It is used to receive the position offset information in the shared memory after the QUIC sent data is successfully sent.
  • the receiving ring is used to receive the position offset information of the QUIC received data in the shared memory.
  • the sending ring is used to receive the position offset information of QUIC sending data in the shared memory;
  • the QUIC data receiving path ring is formed according to the filling ring and the receiving ring, and the QUIC data transmitting path ring is formed according to the completion ring and the sending ring.
  • the filling ring and completion ring in the shared memory specifically refer to the Fill ring (filling ring) and Completion ring (completion ring) in UMEM; the receiving ring and sending ring in the protocol family socket specifically refer to the AF_XDP Socket.
  • Fill ring, completion ring, receive ring and send ring are all ring buffers, which are a data structure used to represent a fixed-size, end-to-end buffer, suitable for caching data streams. The characteristic of a circular buffer is that when one data element is used, the remaining data elements do not need to move their storage locations.
  • the filling ring is used to receive the position offset information of the QUIC received data that is expected to be saved in the shared memory.
  • the completion ring is used to receive the position offset information in the shared memory after the QUIC sent data is successfully sent.
  • the receiving ring is used to receive the QUIC received data.
  • the position offset information in the shared memory, the sending ring is used to receive the position offset information of the QUIC sent data in the shared memory.
  • the Fill ring (filling ring) and the RX ring (receiving ring) form the QUIC data receiving path ring for receiving QUIC data
  • the Completion ring (completion ring) and the TX ring (transmitting ring) form the QUIC data receiving path ring for sending QUIC data transmission path ring for QUIC data.
  • the QUIC data receiving path ring is used to receive QUIC data.
  • the QUIC data can be received into the QUIC core protocol stack through this path.
  • the QUIC data sending path ring is used to send QUIC data.
  • QUIC data is generated through the QUIC core protocol stack, the QUIC data is sent to the network through this path.
  • Step 106 Transmit QUIC data according to the QUIC data processing thread and QUIC data processing path ring.
  • the architecture provided by the embodiment of the present disclosure is completed, and QUIC data can be transmitted through the QUIC data processing thread and QUIC data processing path ring.
  • Figure 2 shows a schematic architectural diagram of a QUIC data transmission method based on a protocol suite provided by an embodiment of the present disclosure.
  • the schematic diagram uses two QUIC data processing threads as an example for explanation.
  • a corresponding QUIC data processing thread is created for each network card queue, namely thread 1 and thread 2.
  • Each thread includes a QUIC data packet receiving module. , QUIC core protocol stack, QUIC data packet sending module.
  • a corresponding UMEM and XDP Socket are created for each thread. There are RX ring and TX ring set in XDP Socket, and Fill ring and Completion ring set in UMEM.
  • Fill ring filling ring
  • RX ring receiving ring
  • the QUIC data receiving path ring is the receiving rule of QUIC data
  • Completion ring( The completion ring) and the TX ring (transmission ring) form the QUIC data transmission path ring used to send QUIC data, in which the QUIC data reception path ring is the transmission rule of QUIC data.
  • QUIC data can be received and QUIC data can be sent out according to these two path rings.
  • the transmission of QUIC data according to the QUIC data processing thread and QUIC data processing path ring will be further explained below by receiving QUIC data and sending QUIC data respectively.
  • QUIC data needs to be processed.
  • QUIC data specifically refers to the data required for QUIC services.
  • This implementation The data that the example needs to target is QUIC data, so the QUIC data needs to be filtered out in advance.
  • the method before receiving the QUIC data according to the QUIC data processing thread and the QUIC data receiving path ring, the method also includes:
  • the data to be processed is transmitted to the kernel protocol stack.
  • the data to be processed specifically refers to the data received by the terminal. In actual applications, all data will be received by the network card and then assigned to the network card queue.
  • the XDP program is an eBPF hook that can be received at the network card driver layer.
  • the data to be processed is obtained before the network card driver distributes the data to be processed to the kernel protocol stack, and determines whether the data to be processed is QUIC received data.
  • the QUIC received data refers to the data required by the above QUIC service.
  • the QUIC received data will be redirected to the QUIC data receiving loop path, and the data transmission process of the method provided by this disclosure will be executed; if it is determined that the data to be processed is not QUIC
  • the data to be processed is normally transmitted to the CPU core protocol stack for processing, which will not be described again here.
  • determining whether the data to be processed is QUIC received data includes:
  • each data to be processed arriving at the terminal network card from the network will include data header information.
  • the data header information will carry the service port corresponding to the data to be processed.
  • Multiple devices will be deployed in the terminal.
  • Data service ports such as port 3306, port 1433, port 1521, port 80, etc. Each port corresponds to a different business service.
  • the QUIC service will also have a corresponding service port in the terminal. For example, in this disclosure Make sure that the service port used by the QUIC data processing thread corresponding to the QUIC service is port A, then all data sent to port A is QUIC received data.
  • the data header of the data to be processed needs to be parsed to obtain the data service port carried in the data to be processed.
  • the data service port specifically refers to the service port in the terminal to which the data to be processed needs to be sent. , after obtaining the data service port, just determine whether the data service port matches the service port corresponding to the QUIC data processing thread. If the data service port matches the service port corresponding to the QUIC data processing thread, it means that the data to be processed is QUIC Receive data, otherwise, the data to be processed is not QUIC received data.
  • the service port corresponding to the QUIC service as the A port as an example, if the data service port carried in the data to be processed is the A port, it means that the data to be processed is QUIC receiving data; If the data service port carried in the processed data is port B, it means that the data to be processed is not QUIC received data.
  • QUIC data is received according to the QUIC data processing thread and QUIC data receiving path ring, including R1-R4:
  • the QUIC reception data needs to be redirected to the QUIC data reception path ring.
  • the QUIC data packet receiving module in the QUIC data processing thread needs to put the first address descriptor of the packet to be received into the Fill ring in UMEM.
  • the first address descriptor is specifically the address of the data frame in UMEM. offset information.
  • the first address descriptor is specifically an offset in the entire UMEM memory domain, and the first address descriptor is used to instruct the system into which data frame in UMEM to store the QUIC received data.
  • the QUIC thread is the producer of the Fill ring. What is saved in the Fill ring is the location information where the QUIC thread expects QUIC to receive the data to be saved.
  • the QUIC data packet receiving module in the QUIC data processing thread puts the first address descriptor a that is to receive the QUIC received data into the Fill ring in advance.
  • the kernel driver consumes the Fill ring, obtains the first address descriptor in the Fill ring, collects QUIC data, and writes the QUIC data into UMEM according to the first address descriptor. .
  • the kernel driver is the consumer of the Fill ring.
  • the kernel driver writes the QUIC received data into the data frame corresponding to the first address descriptor a in the shared memory based on the first address descriptor a.
  • the reference of the corresponding data frame will be written to the RX ring, which stores the actual data memory address of the QUIC received data in the shared memory.
  • the size occupied by QUIC received data may occupy one or more data frames in UMEM, which will be recorded in the RX ring.
  • this step of operation is also performed by the kernel driver. That is, after the kernel driver completely writes the QUIC data into UMEM, it will write the data memory address in UMEM into the RX ring for The QUIC thread reads the data memory address.
  • the kernel driver when the kernel driver writes QUIC data to UMEM and completes it, the data memory address of the QUIC data in UMEM will be written to the RX ring, and the first address in the Fill ring will be described. symbol is deleted. During this process, the kernel driver is the producer of the RX ring.
  • the starting position of QUIC received data is a, which occupies 4 data frames, and the ending position is b.
  • the kernel driver writes the QUIC received data into the data memory corresponding to Addresses a-b are written to the RX ring. Used to determine the actual location of QUIC received data in UMEM.
  • the QUIC data processing thread can read the QUIC reception data from the shared memory according to the data memory address.
  • the specific QUIC data packet reception module in the QUIC data processing thread Read the data memory address in the RX ring through the calling method provided by libbpf. And obtain the QUIC reception data from the shared memory according to the data memory address. It should be noted that at this time the QUIC data processing thread is the consumer of the RX ring. When the QUIC data processing thread reads the data memory address from the RX ring, the data memory address will be deleted from the RX ring.
  • the QUIC data processing thread After receiving the QUIC received data, the QUIC data processing thread decapsulates the QUIC received data according to the Ethernet layer, IP layer, and UDP layer, and passes it to the QUIC core protocol stack for further processing. During this process, the QUIC data processing thread is the consumer of the RX ring.
  • the processing flow of QUIC receiving data is completed.
  • the QUIC data is redirected to the QUIC data receiving path ring for data reception processing.
  • the Linux kernel network protocol stack which effectively reduces the CPU load of the terminal. , improving data transmission efficiency.
  • QUIC data is sent according to the QUIC data processing thread and QUIC data sending path ring, including S1-S4:
  • the QUIC service When the QUIC service needs to send QUIC data, it needs to generate QUIC sending data in the QUIC data processing thread. Further, the QUIC data is generated by the QUIC core protocol stack, and the QUIC data is encapsulated through the UDP layer, IP layer, and Ethernet layer. Generate QUIC send data.
  • the QUIC data processing thread writes the QUIC transmission data into UMEM. After the writing is completed, the second address descriptor of the QUIC transmission data in UMEM is written into the TX ring. During this process, the QUIC data processing thread is the producer of the TX ring.
  • the second address descriptor specifically refers to the position offset information of the QUIC sent data in the shared memory.
  • the kernel driver reads the second address descriptor in the TX ring, calls sendto to notify the network card driver to read the QUIC send data according to the address descriptor, and the network card driver reads the QUIC send data packet in UMEM according to the address descriptor, and sends the QUIC Send data to the network.
  • the kernel driver is the consumer of the TX ring.
  • the kernel driver After the kernel driver has sent all the QUIC send data to the network, it has completed sending the QUIC send data and needs to write back the second address descriptor to the Completion ring for marking. It is recognized that the QUIC send data has been sent. During this process, the kernel driver is the producer of the Completion ring.
  • the QUIC data processing thread can read the address descriptor in the Completion ring and know that the QUIC data has been sent. During this process, the QUIC data processing thread is the consumer of the Completion ring.
  • the processing flow of QUIC sending data is completed.
  • the QUIC protocol when sending data, the QUIC protocol encapsulates and generates QUIC sending data packets according to the protocol stack hierarchy, and cooperates with the kernel driver to send the QUIC sending data packets to the network card driver, and sends QUIC through the network card
  • the Linux kernel network protocol stack When data is sent to the network, there is also no need to send QUIC data through the Linux kernel network protocol stack, which effectively reduces the CPU load of the terminal and improves data transmission efficiency.
  • the QUIC data transmission method based on the protocol family creates a QUIC data processing thread, a protocol family socket and shared memory corresponding to the QUIC data processing thread; a QUIC data processing path is formed based on the shared memory and the protocol family socket Ring; transmits QUIC data according to the QUIC data processing thread and QUIC data processing path ring.
  • a QUIC data processing path ring By building a QUIC data processing path ring, a ring buffer for processing QUIC data is generated, and the QUIC protocol stack and AF_XDP-based network data transmission are combined. There is no need to send QUIC data to the Linux kernel network protocol stack, thus reducing the CPU load of the terminal. , improving data transmission efficiency.
  • Figure 3 shows a processing flow chart of a QUIC data transmission method based on the protocol suite applied to the scenario of receiving data packets provided by an embodiment of the present disclosure, which specifically includes the following steps:
  • Step 302 Receive data to be processed.
  • the network card queue receives the data to be processed, and the XDP program obtains the data to be processed before the network card driver distributes the data to be processed to the kernel protocol stack.
  • Step 304 Parse the data to be processed and obtain the data service port carried in the data to be processed.
  • the kernel driver parses the data to be processed and obtains that the data service port carried in the data to be processed is 443.
  • Step 306 Determine whether the data service port is the service port corresponding to the QUIC service. If not, execute step 308. If yes, execute step 310.
  • the kernel driver determines whether port 443 is the service port corresponding to the QUIC service. If so, the operation of step 310 is performed. If not, the operation of step 308 is performed.
  • Step 308 Pass the data to be processed to the kernel protocol stack.
  • the data to be processed is not data corresponding to the QUIC service, the data Passed to the kernel protocol stack through normal processing.
  • Step 310 Redirect the data to be processed to the QUIC data receiving path ring.
  • the kernel driver redirects the data to be processed to the pre-established QUIC data receiving path ring.
  • Step 312 Control the RX ring and Fill ring to collect the data to be processed, and store the data to be processed in UMEM.
  • the data packet receiving module in the QUIC thread stores the packet receiving address in UMEM used to receive the data to be processed in the Fill ring in advance, and the kernel driver notifies the network card driver to collect the data to be processed through system calls such as poll. operation, the kernel driver stores the data to be processed into the packet receiving address in UMEM. When the data to be processed is completely received into UMEM, the kernel driver will write the memory address of the data to be processed into the RX ring.
  • Step 314 The QUIC data packet receiving module reads the data to be processed from UMEM.
  • the data packet receiving module reads the memory address in the RX ring through the calling method provided by libbpf, and reads the data to be processed into the QUIC thread.
  • Step 316 Decapsulate the data to be processed, and pass the decapsulated data to the QUIC core protocol stack.
  • the data packet receiving module decapsulates the data to be processed according to the Ethernet layer, IP layer, and UDP layer, and transfers the data obtained after decapsulation to the QUIC core protocol stack for further processing.
  • the QUIC data is redirected to the QUIC data receiving path ring for data reception processing.
  • the Linux kernel network protocol stack which effectively reduces the CPU load of the terminal. , improving data transmission efficiency.
  • Figure 4 shows a processing flow chart of a QUIC data transmission method based on the protocol suite applied to the scenario of sending data packets provided by an embodiment of the present disclosure, which specifically includes the following steps:
  • Step 402 The QUIC core protocol stack generates QUIC data packets.
  • a QUIC data packet is generated through the QUIC core protocol stack.
  • Step 404 Encapsulate the QUIC data packet to generate data to be sent.
  • the QUIC service passes QUIC data packets through the UDP layer, IP layer, and Ethernet
  • the layer encapsulates the data and obtains the data to be sent.
  • Step 406 Write the data to be sent into UMEM, and write the address descriptor of the data to be sent in UMEM into the TX ring.
  • the data packet sending module in the QUIC thread writes the data to be sent into UMEM. After the writing is completed, the address descriptor of the data to be sent in UMEM is written into the TX ring.
  • Step 408 Read the address descriptor in the TX ring, and publish the data to be sent to the network based on the address descriptor.
  • the kernel driver reads the address descriptor in the TX ring, calls sendto to notify the network card driver to read the data to be sent based on the address descriptor, and the network card driver reads the data to be sent in UMEM based on the address descriptor. data and sends the data to be sent to the network.
  • Step 410 After the data to be sent is sent, write the address descriptor to the Completion ring.
  • the kernel driver After detecting that the data to be sent has been sent, the kernel driver writes the address descriptor into the Completion ring to identify that the data to be sent has been sent.
  • the QUIC data processing thread reads that the address descriptor exists in the Completion ring, it can know that the data to be sent has been sent successfully.
  • the QUIC protocol when sending data, the QUIC protocol encapsulates and generates QUIC sending data packets according to the protocol stack hierarchy, and cooperates with the kernel driver to send the QUIC sending data packets to the network card driver, and sends QUIC through the network card
  • the kernel driver when data is sent to the network, there is also no need to send QUIC data through the Linux kernel network protocol stack, which effectively reduces the CPU load of the terminal and improves data transmission efficiency.
  • the present disclosure also provides an embodiment of the QUIC data transmission device based on the protocol family.
  • Figure 5 shows a QUIC data transmission device based on the protocol family provided by an embodiment of the present disclosure. Structural diagram of data transmission device. As shown in Figure 5, the device includes:
  • the creation module 502 is configured to create a QUIC data processing thread, a protocol family socket and shared memory corresponding to the QUIC data processing thread;
  • the composition module 504 is configured to form a QUIC data processing path ring based on shared memory and protocol family sockets;
  • the transmission module 506 is configured to transmit QUIC data according to the QUIC data processing thread and the QUIC data processing path ring.
  • the creation module 502 is further configured as:
  • component module 504 is further configured as:
  • the filling ring is used to receive the position offset information of the QUIC received data expected to be saved in the shared memory, and the completion ring It is used to receive the position offset information of the QUIC sent data in the shared memory after it is successfully sent.
  • the receiving ring is used to receive the position offset information of the QUIC received data in the shared memory.
  • the sending ring is used to receive the position offset information of the QUIC sent data in the shared memory. Position offset information;
  • the QUIC data receiving path ring is formed according to the filling ring and the receiving ring, and the QUIC data transmitting path ring is formed according to the completion ring and the sending ring.
  • the transmission module 506 includes:
  • the receiving unit is configured to receive QUIC data according to the QUIC data processing thread and the QUIC data receiving path ring, where the QUIC data receiving path ring is the receiving rule of QUIC data;
  • the sending unit is configured to send QUIC data according to the QUIC data processing thread and the QUIC data sending path ring, where the QUIC data receiving path ring is the sending rule of QUIC data.
  • the receiving unit is also configured to:
  • the data to be processed is transmitted to the kernel protocol stack.
  • the receiving unit is further configured as:
  • the receiving unit is further configured as:
  • the first address descriptor is the address offset information of the shared memory
  • the data memory address in the receiving ring is read and processed according to the data content.
  • the storage address reads QUIC receive data from shared memory.
  • the sending unit is further configured as:
  • the second address descriptor is written to the completion ring.
  • the QUIC data transmission device based on the protocol family creates a QUIC data processing thread, a protocol family socket and a shared memory corresponding to the QUIC data processing thread; a QUIC data processing path is formed based on the shared memory and the protocol family socket Ring; transmits QUIC data according to the QUIC data processing thread and QUIC data processing path ring.
  • a QUIC data processing path ring By constructing a QUIC data processing path ring, a ring buffer for processing QUIC data is generated, and the QUIC protocol stack and AF_XDP-based network data transmission are combined. There is no need to send QUIC data to the Linux kernel network protocol stack, thus reducing the CPU load of the terminal. , improving data transmission efficiency.
  • the above is a schematic solution of a QUIC data transmission device based on the protocol suite in this embodiment.
  • the technical solution of the protocol family-based QUIC data transmission device belongs to the same concept as the above-mentioned technical solution of the protocol family-based QUIC data transmission method.
  • the technical solution of the protocol family-based QUIC data transmission device is not described in detail. For details, please refer to the description of the technical solution of the QUIC data transmission method based on the protocol suite mentioned above.
  • FIG. 6 shows a structural block diagram of a computing device 600 according to an embodiment of the present disclosure.
  • Components of the computing device 600 include, but are not limited to, memory 610 and processor 620 .
  • the processor 620 and the memory 610 are connected through a bus 630, and the database 650 is used to save data.
  • Computing device 600 also includes an access device 640 that enables computing device 600 to communicate via one or more networks 660 .
  • networks include the Public Switched Telephone Network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communications networks such as the Internet.
  • Access device 640 may include one or more of any type of network interface (eg, a network interface card (NIC)), wired or wireless, such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interconnection for Microwave Access (WLAN) Wi-MAX) interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, Bluetooth interface, Near Field Communication (NFC) interface, etc.
  • NIC network interface card
  • the above-mentioned components of the computing device 600 and other components not shown in FIG. 6 may also be connected to each other, such as through a bus. It should be understood that the calculation shown in Figure 6
  • the device structure block diagram is for illustrative purposes only and does not limit the scope of the present disclosure. Those skilled in the art can add or replace other components as needed.
  • Computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet computer, personal digital assistant, laptop computer, notebook computer, netbook, etc.), a mobile telephone (e.g., smartphone ), a wearable computing device (e.g., smart watch, smart glasses, etc.) or other type of mobile device, or a stationary computing device such as a desktop computer or PC.
  • a mobile computer or mobile computing device e.g., tablet computer, personal digital assistant, laptop computer, notebook computer, netbook, etc.
  • a mobile telephone e.g., smartphone
  • a wearable computing device e.g., smart watch, smart glasses, etc.
  • stationary computing device such as a desktop computer or PC.
  • Computing device 600 may also be a mobile or stationary server.
  • the processor 620 executes the computer instructions, the steps of the QUIC data transmission method based on the protocol suite are implemented.
  • the above is a schematic solution of a computing device in this embodiment. It should be noted that the technical solution of the computing device and the above-mentioned technical solution of the QUIC data transmission method based on the protocol family belong to the same concept. For details that are not described in detail in the technical solution of the computing device, please refer to the above-mentioned QUIC protocol family-based method. Description of technical solutions for data transmission methods.
  • An embodiment of the present disclosure also provides a non-volatile computer-readable storage medium, which stores computer instructions.
  • the computer instructions are executed by a processor, the steps of the QUIC data transmission method based on the protocol suite are implemented.
  • the above is a schematic solution of a computer-readable storage medium in this embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the QUIC data transmission method based on the protocol family mentioned above. For details that are not described in detail in the technical solution of the storage medium, please refer to the QUIC protocol family-based method mentioned above. Description of technical solutions for data transmission methods.
  • Computer instructions include computer program code, which can be in the form of source code, object code, executable file or some intermediate form.
  • Computer-readable media may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, mobile hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM, Read-Only Memory), random access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electrical carrier signals telecommunications signals
  • software distribution media etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include Electrical carrier signals and telecommunications signals.

Abstract

The present invention provides a protocol family-based QUIC data transmission method and device. The protocol family-based QUIC data transmission method comprises: creating a QUIC data processing thread, a protocol family socket corresponding to the QUIC data processing thread, and a shared memory; forming a QUIC data processing path loop according to the shared memory and the protocol family socket; and transmitting QUIC data according to the QUIC data processing thread and the QUIC data processing path loop.

Description

基于协议族的QUIC数据传输方法及装置QUIC data transmission method and device based on protocol suite
相关申请的交叉参考Cross-references to related applications
本申请要求于2022年8月17日提交中国专利局、申请号为2022109883828、名称为“基于协议族的QUIC数据传输方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on August 17, 2022, with application number 2022109883828 and titled "QUIC data transmission method and device based on protocol family", the entire content of which is incorporated herein by reference. Applying.
技术领域Technical field
本公开涉及互联网技术领域,特别涉及基于协议族的QUIC数据传输方法。本公开同时涉及基于协议族的QUIC数据传输装置,一种计算设备,以及一种计算机可读存储介质。The present disclosure relates to the field of Internet technology, and in particular to a QUIC data transmission method based on a protocol suite. The present disclosure also relates to a QUIC data transmission device based on the protocol suite, a computing device, and a computer-readable storage medium.
背景技术Background technique
随着计算机技术的发展,网络数据传送一直都备受学术界和工业界的关注,目前在互联网领域,以TCP协议为基础的网络数据传输协议架构一直处于主流地位,但是随着技术的演进和应用场景逐渐丰富,涌现出了一些新的网络传输协议,其中就包括QUIC协议,QUIC协议是一种基于UDP协议(用户数据包协议)的低时延的互联网传输层协议,是一种无连接的传输协议。With the development of computer technology, network data transmission has always attracted attention from academia and industry. Currently, in the Internet field, the network data transmission protocol architecture based on TCP protocol has always been in the mainstream position. However, with the evolution of technology and Application scenarios are gradually enriching, and some new network transmission protocols have emerged, including the QUIC protocol. The QUIC protocol is a low-latency Internet transport layer protocol based on the UDP protocol (User Data Packet Protocol). It is a connectionless transmission protocol.
相比TCP而言,QUIC协议提升了网络传输的效率,并且满足了更多场景的应用需求,可以处理更多连接,实现更低的延时等,但是使用QUIC协议通信的服务器往往会带来更多的性能开销,会较大程度消耗机器算力资源,导致成本增加,因而降低了QUIC协议在更大规模的生产场景下的使用。Compared with TCP, the QUIC protocol improves the efficiency of network transmission and meets the application needs of more scenarios. It can handle more connections and achieve lower delays, etc. However, servers that use the QUIC protocol to communicate often bring problems. More performance overhead will consume machine computing resources to a greater extent, leading to increased costs, thus reducing the use of the QUIC protocol in larger-scale production scenarios.
发明内容Contents of the invention
有鉴于此,本公开实施例提供了基于协议族的QUIC数据传输方法。本公开同时涉及基于协议族的QUIC数据传输装置,一种计算设备,以及一种计算机可读存储介质,以解决现有技术中存在的资源开销大的问题。In view of this, embodiments of the present disclosure provide a QUIC data transmission method based on the protocol suite. The present disclosure also relates to a QUIC data transmission device based on the protocol suite, a computing device, and a computer-readable storage medium, so as to solve the problem of high resource overhead existing in the prior art.
根据本公开实施例的第一方面,提供了一种基于协议族的QUIC数据传输方法,包括:According to a first aspect of an embodiment of the present disclosure, a QUIC data transmission method based on a protocol suite is provided, including:
创建QUIC数据处理线程、QUIC数据处理线程对应的协议族套接字和共享内存;Create the QUIC data processing thread, the protocol family socket and shared memory corresponding to the QUIC data processing thread;
根据共享内存和协议族套接字组成QUIC数据处理路径环;A QUIC data processing path ring is formed based on shared memory and protocol family sockets;
根据QUIC数据处理线程和QUIC数据处理路径环传输QUIC数据。QUIC data is transmitted according to the QUIC data processing thread and QUIC data processing path ring.
根据本公开实施例的第二方面,提供了一种基于协议族的QUIC数据传 输装置,包括:According to a second aspect of the embodiment of the present disclosure, a protocol family-based QUIC data transmission method is provided. Transmission devices, including:
创建模块,被配置为创建QUIC数据处理线程、QUIC数据处理线程对应的协议族套接字和共享内存;The creation module is configured to create a QUIC data processing thread, the protocol family socket and shared memory corresponding to the QUIC data processing thread;
组成模块,被配置为根据共享内存和协议族套接字组成QUIC数据处理路径环;The component module is configured to form a QUIC data processing path ring based on shared memory and protocol family sockets;
传输模块,被配置为根据QUIC数据处理线程和QUIC数据处理路径环传输QUIC数据。The transmission module is configured to transmit QUIC data according to the QUIC data processing thread and the QUIC data processing path ring.
根据本公开实施例的第三方面,提供了一种计算设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机指令,所述处理器执行所述计算机指令时实现所述基于协议族的QUIC数据传输方法的步骤。According to a third aspect of an embodiment of the present disclosure, a computing device is provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor. When the processor executes the computer instructions, the desired Describe the steps of the QUIC data transmission method based on the protocol suite.
根据本公开实施例的第四方面,提供了一种非易失性计算机可读存储介质,其存储有计算机指令,该计算机指令被处理器执行时实现所述基于协议族的QUIC数据传输方法的步骤。According to a fourth aspect of the embodiment of the present disclosure, a non-volatile computer-readable storage medium is provided, which stores computer instructions. When the computer instructions are executed by a processor, the QUIC data transmission method based on the protocol family is implemented. step.
根据本公开实施例的第五方面,提供了一种计算机程序产品,该计算机程序产品包括存储在上述非易失性计算机可读存储介质上的计算程序。According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, the computer program product including a computing program stored on the above-mentioned non-volatile computer-readable storage medium.
本公开提供的基于协议族的QUIC数据传输方法,创建QUIC数据处理线程、QUIC数据处理线程对应的协议族套接字和共享内存;根据共享内存和协议族套接字组成QUIC数据处理路径环;;根据QUIC数据处理线程和QUIC数据处理路径环传输QUIC数据。通过构建QUIC数据处理路径环,生成了处理QUIC数据的环形缓冲区,将QUIC协议栈和基于AF_XDP的网络数据发送结合,无需将QUIC数据发送至Linux内核网络协议栈,从而降低了终端的CPU负载,提升了数据传输效率。The QUIC data transmission method based on the protocol family provided by this disclosure creates a QUIC data processing thread, a protocol family socket and shared memory corresponding to the QUIC data processing thread; a QUIC data processing path ring is formed based on the shared memory and the protocol family socket; ;Transmit QUIC data according to the QUIC data processing thread and QUIC data processing path ring. By constructing a QUIC data processing path ring, a ring buffer for processing QUIC data is generated, and the QUIC protocol stack and AF_XDP-based network data transmission are combined. There is no need to send QUIC data to the Linux kernel network protocol stack, thus reducing the CPU load of the terminal. , improving data transmission efficiency.
附图概述Figure overview
图1是本公开一实施例提供的一种基于协议族的QUIC数据传输方法的流程图;Figure 1 is a flow chart of a QUIC data transmission method based on a protocol suite provided by an embodiment of the present disclosure;
图2是本公开一实施例提供的基于协议族的QUIC数据传输方法的架构示意图;Figure 2 is an architectural schematic diagram of the QUIC data transmission method based on the protocol suite provided by an embodiment of the present disclosure;
图3是本公开一实施例提供的一种应用于接收数据包场景的基于协议族的QUIC数据传输方法的处理流程图;Figure 3 is a processing flow chart of a protocol family-based QUIC data transmission method applied to the scenario of receiving data packets provided by an embodiment of the present disclosure;
图4是本公开一实施例提供的一种应用于发送数据包场景的基于协议族的QUIC数据传输方法的处理流程图;Figure 4 is a processing flow chart of a protocol family-based QUIC data transmission method applied to the scenario of sending data packets provided by an embodiment of the present disclosure;
图5是本公开一实施例提供的一种基于协议族的QUIC数据传输装置的 结构示意图;以及Figure 5 is a diagram of a QUIC data transmission device based on the protocol suite provided by an embodiment of the present disclosure. Structural diagram; and
图6是本公开一实施例提供的一种计算设备的结构框图。FIG. 6 is a structural block diagram of a computing device provided by an embodiment of the present disclosure.
本公开的较佳实施方式Preferred embodiments of the present disclosure
在下面的描述中阐述了很多具体细节以便于充分理解本公开。但是本公开能够以很多不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本公开内涵的情况下做类似推广,因此本公开不受下面公开的具体实施的限制。In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure. However, the present disclosure can be implemented in many other ways different from those described here. Those skilled in the art can make similar generalizations without violating the connotation of the present disclosure. Therefore, the present disclosure is not limited by the specific implementation disclosed below.
在本公开一个或多个实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开一个或多个实施例。在本公开一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本公开一个或多个实施例中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in one or more embodiments of the present disclosure is for the purpose of describing particular embodiments only and is not intended to limit the one or more embodiments of the present disclosure. As used in one or more embodiments of this disclosure and the appended claims, the singular forms "a," "" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that the term "and/or" as used in one or more embodiments of the present disclosure refers to and includes any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本公开一个或多个实施例中可能采用术语第一、第二等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开一个或多个实施例范围的情况下,第一也可以被称为第二,类似地,第二也可以被称为第一。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present disclosure, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of the present disclosure, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to determining."
首先,对本公开一个或多个实施例涉及的名词术语进行解释。First, noun terms involved in one or more embodiments of the present disclosure are explained.
UDP:用户数据包协议,一种无连接的传输协议。UDP: User Datagram Protocol, a connectionless transport protocol.
QUIC:一种基于UDP的低时延的互联网传输层协议。QUIC: A low-latency Internet transport layer protocol based on UDP.
eBPF:伯克利包过滤器的扩展版本,是一种可以在Linux内核中运行用户编写的程序。eBPF: An extended version of the Berkeley Packet Filter, a user-written program that can run in the Linux kernel.
XDP:快速数据路径,是Linux网络处理流程中的一个eBPF钩子,能够挂载eBPF程序,能够在网络数据包到达网卡驱动层时对其进行处理。XDP: Fast Data Path is an eBPF hook in the Linux network processing process. It can mount the eBPF program and process the network data packets when they arrive at the network card driver layer.
AF_XDP:AF_XDP是在XDP的基础上,为了高性能数据数据处理而设计的一套协议族。AF_XDP: AF_XDP is a set of protocol suites designed for high-performance data processing based on XDP.
QUIC(Quick UDP Internet Connection)是一套基于UDP的传输协议,实现的是可靠的UDP传输,目的是保证可靠性的同时降低网络延迟,因为UDP是一个简单传输协议,基于UDP可以摆脱TCP传输确认、重传慢启动等因素,只需要一RTT(Round-Trip Time)的延迟就可以建立可靠安全的连 接,QUIC是在UDP的基础上由客户端自由发挥,只要有服务器能对接就可以。QUIC (Quick UDP Internet Connection) is a set of transmission protocols based on UDP, which implements reliable UDP transmission. The purpose is to ensure reliability while reducing network delay, because UDP is a simple transmission protocol, and based on UDP, you can get rid of TCP transmission confirmation. , retransmission slow start and other factors, only one RTT (Round-Trip Time) delay is needed to establish a reliable and secure connection. QUIC is freely used by the client based on UDP, as long as there is a server that can connect.
QUIC协议的实现是在用户层,用户空间和系统内核空间之间需要大量的交互,导致了系统的负载增加,另外,QUIC协议运行时大量的加密和可靠性交付等过程也增加了对CPU的使用,因此,当前大多数QUIC协议实现的服务器都存在CPU负载过高的缺陷。The implementation of the QUIC protocol requires a lot of interaction between the user layer, user space and system kernel space, which leads to an increase in system load. In addition, a large number of encryption and reliability delivery processes when the QUIC protocol is running also increases the load on the CPU. Therefore, most servers currently implementing the QUIC protocol suffer from excessive CPU load.
在实际应用中,通过对QUIC协议的性能进行分析,发现QUIC存下以下问题:In practical applications, by analyzing the performance of the QUIC protocol, we found that QUIC has the following problems:
1、密码相关算法的开销大:对于小数据包来说,RAS算法(非对称加密算法)的计算占比很高,对于大数据包来说,对称加解密也会占用系统15%左右的开销。1. Password-related algorithms have high overhead: For small data packets, the RAS algorithm (asymmetric encryption algorithm) accounts for a high proportion of calculations. For large data packets, symmetric encryption and decryption will also occupy about 15% of the system overhead. .
2、UDP收发包的开销大:特别是对于大文件下载来说,SendMsg占比很高,可能达到35%-40%以上。2. The overhead of sending and receiving UDP packets is high: Especially for large file downloads, SendMsg accounts for a high proportion, which may reach more than 35%-40%.
3、协议栈开销大:主要受协议栈实现,如ACK的处理,MTU探测和发包大小,内存管理和拷贝等。3. The protocol stack has high overhead: mainly affected by the protocol stack implementation, such as ACK processing, MTU detection and packet size, memory management and copying, etc.
eBPF全称叫做“扩展伯克利包过滤器”,是一种可以在Linux内核中运行用户编写的程序,其中eBPF程序在内核代码中网络处理流程中的一个钩子就是XDP,也就是说,XDP可以在网络数据包在到达网卡驱动层时对其进行处理,AF_XDP则是基于XDP实现的一套新的协议族,可以实现快速高效的数据接收和发送。The full name of eBPF is "Extended Berkeley Packet Filter". It is a program written by users that can be run in the Linux kernel. One of the hooks of the eBPF program in the network processing flow in the kernel code is XDP. In other words, XDP can be used in the network Data packets are processed when they arrive at the network card driver layer. AF_XDP is a new protocol family implemented based on XDP, which can achieve fast and efficient data reception and transmission.
基于此,在本公开中,提供了基于协议族的QUIC数据传输方法,本公开同时涉及基于协议族的QUIC数据传输装置,一种计算设备,以及一种计算机可读存储介质,在下面的实施例中逐一进行详细说明。Based on this, in the present disclosure, a QUIC data transmission method based on the protocol family is provided. The disclosure also relates to a QUIC data transmission device based on the protocol family, a computing device, and a computer-readable storage medium. In the following implementation Each example is explained in detail.
图1示出了根据本申请一实施例提供的一种基于协议族的QUIC数据传输方法的流程图,具体包括以下步骤:Figure 1 shows a flow chart of a QUIC data transmission method based on the protocol suite provided according to an embodiment of the present application, which specifically includes the following steps:
步骤102:创建QUIC数据处理线程、QUIC数据处理线程对应的协议族套接字和共享内存。Step 102: Create a QUIC data processing thread, the protocol family socket and shared memory corresponding to the QUIC data processing thread.
其中,QUIC数据处理线程具体是指用于处理QUIC数据的线程,QUIC数据处理线程中通常会包括QUIC数据包接收模块、QUIC核心协议栈、QUIC数据包发送模块。QUIC数据包接收模块用于接收QUIC数据包,并将数据包发送至QUIC核心协议栈进行处理,当需要将QUIC数据包发送出去的时候,由QUIC核心协议栈生成UDP报文,由QUIC数据包发送模块发送出去。在实际应用中,QUIC数据处理线程的数量可以为一个、两个或多个。 Among them, the QUIC data processing thread specifically refers to the thread used to process QUIC data. The QUIC data processing thread usually includes a QUIC data packet receiving module, a QUIC core protocol stack, and a QUIC data packet sending module. The QUIC data packet receiving module is used to receive QUIC data packets and send the data packets to the QUIC core protocol stack for processing. When the QUIC data packet needs to be sent out, the QUIC core protocol stack generates a UDP message, which is generated by the QUIC data packet. The sending module sends it out. In actual applications, the number of QUIC data processing threads can be one, two or more.
相应地,每个QUIC数据线程均会对应一个协议族套接字(AF_XDP Socket),AF_XDP Socket由基本的socket()系统调用创建,其包括有2个环形缓冲区(ring):RX ring(接收环)和TX ring(发送环)。Rx ring和TX ring分别负责套接字数据包的接收和发送,分别由setsockopts XDP_RX_RING和XDP_TX_RING注册和分配大小。Correspondingly, each QUIC data thread corresponds to a protocol family socket (AF_XDP Socket). AF_XDP Socket is created by the basic socket() system call and includes 2 ring buffers (ring): RX ring (receiving ring) and TX ring (transmitting ring). Rx ring and TX ring are responsible for receiving and sending socket data packets respectively, and are registered and allocated sizes by setsockopts XDP_RX_RING and XDP_TX_RING respectively.
Rx ring和TX ring描述符指向内存中一个叫UMEM的数据缓存区,该数据缓存区即共享内存。Rx ring和TX ring可以共享相同的UMEM,这样数据包就不用在Rx ring和TX ring之间复制。The Rx ring and TX ring descriptors point to a data cache called UMEM in memory, which is the shared memory. The Rx ring and TX ring can share the same UMEM so that packets do not need to be copied between the Rx ring and TX ring.
共享内存(UMEM)由许多相同大小的块(chunks)组成,在ring中的描述符通过引用数据帧的地址来引用该数据帧,而这一地址就是整个UMEM内存域中的偏移量。UMEM中同样有两个ring,分别为Fill ring(填充环)和Completion ring(完成环),应用程序用Fill ring发送地址到内核,以向其填充数据包,一旦数据包被接收,这些数据帧的引用会出现在RX ring中。而Completion ring包含着内核已经传输完成、并可以在此由用户空间使用的数据帧的地址。Shared memory (UMEM) consists of many chunks of the same size. The descriptor in the ring refers to the data frame by referencing the address of the data frame, and this address is the offset in the entire UMEM memory domain. There are also two rings in UMEM, namely the Fill ring and the Completion ring. The application uses the Fill ring to send the address to the kernel to fill it with data packets. Once the data packet is received, these data frames The reference will appear in the RX ring. The Completion ring contains the address of the data frame that has been transferred by the kernel and can be used by user space.
本公开提供的基于协议族的QUIC数据传输方法,通过将AF_XDP技术应用于QUIC服务端中的数据传输过程,通过结合AF_XDP技术,达到提升QUIC数据包的传输效率,减少CPU负载。The QUIC data transmission method based on the protocol family provided by this disclosure applies AF_XDP technology to the data transmission process in the QUIC server and combines the AF_XDP technology to improve the transmission efficiency of QUIC data packets and reduce the CPU load.
在实际应用中,在部署QUIC数据处理线程的服务端通常采用的是多线程架构,即在一个服务端中会设置多个QUIC数据处理线程,由于是用于处理QUIC数据的传输任务,需要用到网卡,QUIC数据处理线程的设置与网卡相关。具体地,创建QUIC数据处理线程、QUIC数据处理线程对应的协议族套接字和共享内存,包括:In actual applications, the server that deploys QUIC data processing threads usually adopts a multi-threaded architecture, that is, multiple QUIC data processing threads are set up in one server. Since it is used to process the transmission task of QUIC data, it needs to use To the network card, the settings of the QUIC data processing thread are related to the network card. Specifically, create the QUIC data processing thread, the protocol family socket and shared memory corresponding to the QUIC data processing thread, including:
确定网卡中的网卡硬件队列数量;Determine the number of network card hardware queues in the network card;
基于网卡硬件队列数量创建对应数量的QUIC数据处理线程;Create a corresponding number of QUIC data processing threads based on the number of network card hardware queues;
创建每个QUIC数据处理线程对应的协议族套接字和共享内存。Create protocol family sockets and shared memory corresponding to each QUIC data processing thread.
其中,网卡硬件队列是一种技术,用于解决网络IO服务质量的问题,随着网络IO的带宽不断提升,单核CPU不能完全处理满足网卡的需求,通过多队列网卡驱动的支持,将各个队列通过中断绑定到不同的核上,以满足网卡的需求。Among them, the network card hardware queue is a technology used to solve the problem of network IO service quality. As the bandwidth of network IO continues to increase, a single-core CPU cannot fully meet the needs of the network card. Through the support of multi-queue network card drivers, each Queues are bound to different cores through interrupts to meet the needs of the network card.
在实际应用中,通常会根据网卡硬件队列的总数来确定QUIC数据处理线程的数量,例如网卡硬件队列数量有8个,则可以设置有8个QUIC数据处理线程;若网卡硬件队列数量有4个,则可以设置有4个QUIC数据处理 线程。In practical applications, the number of QUIC data processing threads is usually determined based on the total number of network card hardware queues. For example, if there are 8 network card hardware queues, 8 QUIC data processing threads can be set; if the number of network card hardware queues is 4 , you can set up 4 QUIC data processing thread.
在根据网卡硬件队列数量来创建对应数量的QUIC数据处理线程之后,针对每个QUIC数据处理线程对应创建共享内存和协议族套接字。以QUIC数据处理线程有2个为例,分别为QUIC线程1和QUIC线程2,为QUIC线程1创建对应的UMEM1和AF_XDP套接字1,为QUIC线程2创建对应的UMEM2和AF_XDP套接字2。After creating a corresponding number of QUIC data processing threads based on the number of network card hardware queues, create a shared memory and protocol family socket for each QUIC data processing thread. Take for example that there are two QUIC data processing threads, namely QUIC thread 1 and QUIC thread 2. Create corresponding UMEM1 and AF_XDP socket 1 for QUIC thread 1, and create corresponding UMEM2 and AF_XDP socket 2 for QUIC thread 2. .
需要注意的是,由于UMEM是共享内存,在实际应用中,可以是每个QUIC线程可以使用相同的UMEM,也可以是不同的QUIC线程之间使用不同的UMEM,也可以几个QUIC线程使用一个相同的UMEM,共享内存数量的在本公开中不做限制,以实际引用为准。在本公开中,需要保证QUIC数据处理线程和协议族套接字之间是一一对应的。It should be noted that since UMEM is a shared memory, in actual applications, each QUIC thread can use the same UMEM, different QUIC threads can use different UMEM, or several QUIC threads can use one For the same UMEM, the number of shared memories is not limited in this disclosure, and the actual reference shall prevail. In this disclosure, it is necessary to ensure that there is a one-to-one correspondence between the QUIC data processing thread and the protocol family socket.
在本公开提供的一具体实施方式中,以网卡硬件队列数量为8个为例,则创建8个QUIC数据处理线程,为每个QUIC数据处理线程创建对应的协议族套接字,共计8个AF_XDP,同时划分8个共享内存,为每个QUIC数据处理线程分配一个共享内存,共计8个UMEM。In a specific implementation provided by the present disclosure, taking the number of network card hardware queues as 8 as an example, 8 QUIC data processing threads are created, and corresponding protocol family sockets are created for each QUIC data processing thread, for a total of 8 AF_XDP, divides 8 shared memories at the same time, and allocates one shared memory to each QUIC data processing thread, for a total of 8 UMEMs.
在本公开提供的另一具体实施方式中,以网卡硬件队列数量为8个为例,则创建8个QUIC数据处理线程,为每个QUIC数据处理线程创建对应的协议族套接字,共计8个AF_XDP,同时划分1个共享内存,8个QUIC数据处理线程共享这1个UMEM,共计1个UMEM。In another specific implementation provided by the present disclosure, taking the number of network card hardware queues as 8 as an example, 8 QUIC data processing threads are created, and corresponding protocol family sockets are created for each QUIC data processing thread, for a total of 8 AF_XDP, 1 shared memory is divided at the same time, 8 QUIC data processing threads share this 1 UMEM, a total of 1 UMEM.
在本公开提供的又一具体实施方式中,以网卡硬件队列数量为8个为例,则创建8个QUIC数据处理线程,为每个QUIC数据处理线程创建对应的协议族套接字,共计8个AF_XDP,划分2个共享内存,每4个QUIC数据处理线程共享1个UMEM,共计2个UMEM。In another specific implementation provided by the present disclosure, taking the number of network card hardware queues as 8 as an example, 8 QUIC data processing threads are created, and corresponding protocol family sockets are created for each QUIC data processing thread, for a total of 8 AF_XDP is divided into 2 shared memories, and every 4 QUIC data processing threads share 1 UMEM, for a total of 2 UMEMs.
步骤104:根据共享内存和协议族套接字组成QUIC数据处理路径环。Step 104: Form a QUIC data processing path ring based on shared memory and protocol family sockets.
其中,QUIC数据处理路径环具体是指用于处理QUIC数据的ring,在实际应用中,QUIC数据的传输处理包括两类,一类是接收QUIC数据,一类是发送QUIC数据。接收和发送是两个不同的QUIC数据处理路径。Among them, the QUIC data processing path ring specifically refers to the ring used to process QUIC data. In practical applications, QUIC data transmission processing includes two categories, one is to receive QUIC data, and the other is to send QUIC data. Receiving and sending are two different QUIC data processing paths.
具体地,根据共享内存和协议族套接字组成QUIC数据处理路径环,包括:Specifically, the QUIC data processing path ring is composed of shared memory and protocol family sockets, including:
获取共享内存中的填充环和完成环,获取协议族套接字中的接收环和发送环,其中,填充环用于接收QUIC接收数据期望被保存在共享内存中的位置偏移信息,完成环用于接收QUIC发送数据发送成功后在共享内存中的位置偏移信息,接收环用于接收QUIC接收数据在共享内存中的位置偏移信息, 发送环用于接收QUIC发送数据在共享内存中的位置偏移信息;Obtain the filling ring and completion ring in the shared memory, and obtain the receiving ring and sending ring in the protocol family socket. The filling ring is used to receive the position offset information of the QUIC received data expected to be saved in the shared memory, and the completion ring It is used to receive the position offset information in the shared memory after the QUIC sent data is successfully sent. The receiving ring is used to receive the position offset information of the QUIC received data in the shared memory. The sending ring is used to receive the position offset information of QUIC sending data in the shared memory;
根据填充环和接收环组成QUIC数据接收路径环,根据完成环和发送环组成QUIC数据发送路径环。The QUIC data receiving path ring is formed according to the filling ring and the receiving ring, and the QUIC data transmitting path ring is formed according to the completion ring and the sending ring.
其中,共享内存中的填充环和完成环具体是指UMEM中的为Fill ring(填充环)和Completion ring(完成环);协议族套接字中的接收环和发送环具体是指AF_XDP Socket中的RX ring(接收环)和TX ring(发送环)。填充环、完成环、接收环和发送环均为环形缓冲区,是一种用于表示一个固定尺寸、头尾相连的缓冲区的数据结构,适合缓存数据流。圆形缓冲区的特性是:当一个数据元素被用掉后,其余数据元素不需要移动其存储位置。Among them, the filling ring and completion ring in the shared memory specifically refer to the Fill ring (filling ring) and Completion ring (completion ring) in UMEM; the receiving ring and sending ring in the protocol family socket specifically refer to the AF_XDP Socket. RX ring (receiving ring) and TX ring (transmitting ring). Fill ring, completion ring, receive ring and send ring are all ring buffers, which are a data structure used to represent a fixed-size, end-to-end buffer, suitable for caching data streams. The characteristic of a circular buffer is that when one data element is used, the remaining data elements do not need to move their storage locations.
填充环用于接收QUIC接收数据期望被保存在共享内存中的位置偏移信息,完成环用于接收QUIC发送数据发送成功后在共享内存中的位置偏移信息,接收环用于接收QUIC接收数据在共享内存中的位置偏移信息,发送环用于接收QUIC发送数据在共享内存中的位置偏移信息。The filling ring is used to receive the position offset information of the QUIC received data that is expected to be saved in the shared memory. The completion ring is used to receive the position offset information in the shared memory after the QUIC sent data is successfully sent. The receiving ring is used to receive the QUIC received data. The position offset information in the shared memory, the sending ring is used to receive the position offset information of the QUIC sent data in the shared memory.
在实际应用中,Fill ring(填充环)和RX ring(接收环)组成了用于接收QUIC数据的QUIC数据接收路径环;Completion ring(完成环)和TX ring(发送环)组成了用于发送QUIC数据的QUIC数据发送路径环。In practical applications, the Fill ring (filling ring) and the RX ring (receiving ring) form the QUIC data receiving path ring for receiving QUIC data; the Completion ring (completion ring) and the TX ring (transmitting ring) form the QUIC data receiving path ring for sending QUIC data transmission path ring for QUIC data.
QUIC数据接收路径环用于接收QUIC数据,当有QUIC数据抵达时,可以通过该路径将QUIC数据接收至QUIC核心协议栈中。The QUIC data receiving path ring is used to receive QUIC data. When QUIC data arrives, the QUIC data can be received into the QUIC core protocol stack through this path.
QUIC数据发送路径环用于发送QUIC数据,当有QUIC数据通过QUIC核心协议栈生成之后,通过该路径将QUIC数据发送至网络中。The QUIC data sending path ring is used to send QUIC data. When QUIC data is generated through the QUIC core protocol stack, the QUIC data is sent to the network through this path.
步骤106:根据QUIC数据处理线程和QUIC数据处理路径环传输QUIC数据。Step 106: Transmit QUIC data according to the QUIC data processing thread and QUIC data processing path ring.
在构建了上述的QUIC数据处理路径之后,搭建完成了本公开实施例提供的架构,通过QUIC数据处理线程和QUIC数据处理路径环即可对QUIC数据进行传输。After constructing the above-mentioned QUIC data processing path, the architecture provided by the embodiment of the present disclosure is completed, and QUIC data can be transmitted through the QUIC data processing thread and QUIC data processing path ring.
参见图2,图2示出本公开一实施例提供的基于协议族的QUIC数据传输方法的架构示意图,该示意图以2个QUIC数据处理线程为例进行解释说明。Referring to Figure 2, Figure 2 shows a schematic architectural diagram of a QUIC data transmission method based on a protocol suite provided by an embodiment of the present disclosure. The schematic diagram uses two QUIC data processing threads as an example for explanation.
在本实施方式中,获取网卡中的网卡队列数量为2,则为每个网卡队列创建一个对应的QUIC数据处理线程,分别为线程1和线程2,每个线程中均包括QUIC数据包接收模块、QUIC核心协议栈、QUIC数据包发送模块。同时为每个线程创建一个对应的UMEM以及XDP Socket。在XDP Socket中设置有RX ring和TX ring,在UMEM中设置有Fill ring和Completion ring。 In this implementation, if the number of network card queues in the network card is 2, a corresponding QUIC data processing thread is created for each network card queue, namely thread 1 and thread 2. Each thread includes a QUIC data packet receiving module. , QUIC core protocol stack, QUIC data packet sending module. At the same time, a corresponding UMEM and XDP Socket are created for each thread. There are RX ring and TX ring set in XDP Socket, and Fill ring and Completion ring set in UMEM.
以线程1为例,Fill ring(填充环)和RX ring(接收环)组成了用于接收QUIC数据的QUIC数据接收路径环,其中,QUIC数据接收路径环为QUIC数据的接收规则;Completion ring(完成环)和TX ring(发送环)组成了用于发送QUIC数据的QUIC数据发送路径环,其中,QUIC数据接收路径环为QUIC数据的发送规则。Taking thread 1 as an example, Fill ring (filling ring) and RX ring (receiving ring) form a QUIC data receiving path ring for receiving QUIC data. Among them, the QUIC data receiving path ring is the receiving rule of QUIC data; Completion ring( The completion ring) and the TX ring (transmission ring) form the QUIC data transmission path ring used to send QUIC data, in which the QUIC data reception path ring is the transmission rule of QUIC data.
在生成了QUIC数据接收路径环和QUIC数据发送路径环之后,即可根据这两个路径环来分别接收QUIC数据和将QUIC数据发送出去。After the QUIC data receiving path ring and the QUIC data sending path ring are generated, QUIC data can be received and QUIC data can be sent out according to these two path rings.
下面分别通过接收QUIC数据和发送QUIC数据两个方面来对根据QUIC数据处理线程和QUIC数据处理路径环传输QUIC数据做进一步解释说明。The transmission of QUIC data according to the QUIC data processing thread and QUIC data processing path ring will be further explained below by receiving QUIC data and sending QUIC data respectively.
下面将通过实施例1对接收QUIC数据时,如何根据QUIC数据处理线程和QUIC数据接收路径环接收QUIC数据进行解释说明。The following will explain how to receive QUIC data according to the QUIC data processing thread and the QUIC data receiving path ring when receiving QUIC data through Embodiment 1.
需要注意的是,在本公开提供的实施例中,需要对QUIC数据进行处理,QUIC数据具体是指QUIC服务所需要的数据,在实际应用中,终端接收到的数据的类型有很多,本实施例所需要针对的数据时QUIC数据,因此需要预先将QUIC数据筛选出来。It should be noted that in the embodiments provided by the present disclosure, QUIC data needs to be processed. QUIC data specifically refers to the data required for QUIC services. In practical applications, there are many types of data received by the terminal. This implementation The data that the example needs to target is QUIC data, so the QUIC data needs to be filtered out in advance.
基于此,在根据QUIC数据处理线程和QUIC数据接收路径环接收QUIC数据之前,方法还包括:Based on this, before receiving the QUIC data according to the QUIC data processing thread and the QUIC data receiving path ring, the method also includes:
接收待处理数据;Receive data to be processed;
判断待处理数据是否为QUIC接收数据;Determine whether the data to be processed is QUIC received data;
若是,则将QUIC接收数据重定向至QUIC数据接收路径环;If so, redirect the QUIC receive data to the QUIC data receive path ring;
若否,则传输待处理数据至内核协议栈。If not, the data to be processed is transmitted to the kernel protocol stack.
其中,待处理数据具体是指终端接收到的数据,在实际应用中,所有的数据均会由网卡接收到,然后分配到网卡队列中,XDP程序是一个eBPF钩子,可以在网卡驱动层接收到待处理数据,在网卡驱动还未将待处理数据分配到内核协议栈之前获取到待处理数据,并判断待处理数据是否为QUIC接收数据,其中,QUIC接收数据就是指上述QUIC服务所需要的数据,经过判断在确定了待处理数据为QUIC接收数据的情况下,则将QUIC接收数据重新定向至QUIC数据接收环路径中,执行本公开提供方法的数据传输流程中;若确定待处理数据不是QUIC服务所需要的数据时,则将该待处理数据正常的传输至CPU内核协议栈中进行处理,在此就不再赘述。Among them, the data to be processed specifically refers to the data received by the terminal. In actual applications, all data will be received by the network card and then assigned to the network card queue. The XDP program is an eBPF hook that can be received at the network card driver layer. The data to be processed is obtained before the network card driver distributes the data to be processed to the kernel protocol stack, and determines whether the data to be processed is QUIC received data. Among them, the QUIC received data refers to the data required by the above QUIC service. , after judgment, if it is determined that the data to be processed is QUIC received data, the QUIC received data will be redirected to the QUIC data receiving loop path, and the data transmission process of the method provided by this disclosure will be executed; if it is determined that the data to be processed is not QUIC When the data required by the service is served, the data to be processed is normally transmitted to the CPU core protocol stack for processing, which will not be described again here.
下面,将对如何确定待处理数据时否是QUIC数据进行进一步解释说明。具体地,判断待处理数据是否为QUIC接收数据,包括:Next, how to determine whether the data to be processed is QUIC data will be further explained. Specifically, determining whether the data to be processed is QUIC received data includes:
解析待处理数据,获得待处理数据中携带的数据服务端口; Parse the data to be processed and obtain the data service port carried in the data to be processed;
判断数据服务端口是否是QUIC数据处理线程对应的服务端口。Determine whether the data service port is the service port corresponding to the QUIC data processing thread.
在实际应用中,每个从网络中抵达终端网卡中的待处理数据中均会包括数据头信息,在数据头信息中会携带有该待处理数据对应的服务端口,在终端中会部署有多个数据服务端口,例如3306端口、1433端口、1521端口、80端口等等,每个端口对应不同的业务服务,同样地,QUIC服务在终端中也会有相应的服务端口,例如在本公开中确定QUIC服务对应的QUIC数据处理线程所使用的服务端口为A端口,则所有发往A端口的数据均为QUIC接收数据。In actual applications, each data to be processed arriving at the terminal network card from the network will include data header information. The data header information will carry the service port corresponding to the data to be processed. Multiple devices will be deployed in the terminal. Data service ports, such as port 3306, port 1433, port 1521, port 80, etc. Each port corresponds to a different business service. Similarly, the QUIC service will also have a corresponding service port in the terminal. For example, in this disclosure Make sure that the service port used by the QUIC data processing thread corresponding to the QUIC service is port A, then all data sent to port A is QUIC received data.
因此,在获得待处理数据之后,需要对待处理数据的数据头进行解析,获得待处理数据中携带的数据服务端口,该数据服务端口具体是指该待处理数据需要发送到终端中的那个服务端口,在获得数据服务端口之后,判断该数据服务端口是否与QUIC数据处理线程对应的服务端口匹配即可,若数据服务端口与QUIC数据处理线程对应的服务端口匹配,则说明该待处理数据是QUIC接收数据,反之,该待处理数据就不是QUIC接收数据。Therefore, after obtaining the data to be processed, the data header of the data to be processed needs to be parsed to obtain the data service port carried in the data to be processed. The data service port specifically refers to the service port in the terminal to which the data to be processed needs to be sent. , after obtaining the data service port, just determine whether the data service port matches the service port corresponding to the QUIC data processing thread. If the data service port matches the service port corresponding to the QUIC data processing thread, it means that the data to be processed is QUIC Receive data, otherwise, the data to be processed is not QUIC received data.
在本公开提供的具体实施方式中,以QUIC服务对应的服务端口为A端口为例,若待处理数据中携带的数据服务端口为A端口,则说明该待处理数据为QUIC接收数据;若待处理数据中携带的数据服务端口为B端口,则说明该待处理数据不是QUIC接收数据。In the specific implementation provided by this disclosure, taking the service port corresponding to the QUIC service as the A port as an example, if the data service port carried in the data to be processed is the A port, it means that the data to be processed is QUIC receiving data; If the data service port carried in the processed data is port B, it means that the data to be processed is not QUIC received data.
在确定了哪些数据时QUIC接收数据之后,即用本公开提供的方法来接收QUIC接收数据,具体地,根据QUIC数据处理线程和QUIC数据接收路径环接收QUIC数据,包括R1-R4:After determining which data QUIC receives data, the method provided by this disclosure is used to receive QUIC received data. Specifically, QUIC data is received according to the QUIC data processing thread and QUIC data receiving path ring, including R1-R4:
R1、基于QUIC数据处理线程将第一地址描述符填充至填充环,其中,第一地址描述符为共享内存的地址偏移信息。R1. Fill the first address descriptor into the filling ring based on the QUIC data processing thread, where the first address descriptor is the address offset information of the shared memory.
在确定了QUIC接收数据之后,需要将QUIC接收数据重定向至QUIC数据接收路径环中。具体地,需要由QUIC数据处理线程中的QUIC数据包接收模块将要收包的第一地址描述符放入到UMEM中的Fill ring中,该第一地址描述符具体为UMEM中的数据帧的地址偏移信息。该第一地址描述符具体为整个UMEM内存域中的偏移量,将第一地址描述符用于指示系统将QUIC接收数据存入到UMEM中的哪个数据帧中。在此过程中,QUIC线程是Fill ring的生产者,在Fill ring中保存的是QUIC线程期望QUIC接收数据被保存的位置信息。After determining the QUIC reception data, the QUIC reception data needs to be redirected to the QUIC data reception path ring. Specifically, the QUIC data packet receiving module in the QUIC data processing thread needs to put the first address descriptor of the packet to be received into the Fill ring in UMEM. The first address descriptor is specifically the address of the data frame in UMEM. offset information. The first address descriptor is specifically an offset in the entire UMEM memory domain, and the first address descriptor is used to instruct the system into which data frame in UMEM to store the QUIC received data. In this process, the QUIC thread is the producer of the Fill ring. What is saved in the Fill ring is the location information where the QUIC thread expects QUIC to receive the data to be saved.
在本实施例中,QUIC数据处理线程中的QUIC数据包接收模块预先将要接收QUIC接收数据的第一地址描述符a放入Fill ring中。 In this embodiment, the QUIC data packet receiving module in the QUIC data processing thread puts the first address descriptor a that is to receive the QUIC received data into the Fill ring in advance.
R2、根据第一地址描述符将QUIC接收数据写入到共享内存。R2. Write the QUIC received data to the shared memory according to the first address descriptor.
当将QUIC接收数据重定向至QUIC数据接收路径环中,具体是指需要将QUIC接收数据重定向至预先分配的UMEM中,哪具体是要写入到UMEM中的什么位置呢?就需要根据第一地址描述符来确定,即根据Fill ring中的第一地址描述符将QUIC接收数据写入到UMEM中的数据帧中。在实际应用中,是由内核驱动程序消费Fill ring(填充环),获取到Fill ring中的第一地址描述符,收取QUIC数据,并将QUIC数据根据该第一地址描述符写入到UMEM中。在此过程中,内核驱动程序是Fill ring的消费者。When redirecting QUIC receive data to the QUIC data receive path ring, specifically it means that the QUIC receive data needs to be redirected to the pre-allocated UMEM. Which location in the UMEM should be written specifically? It needs to be determined based on the first address descriptor, that is, the QUIC received data is written into the data frame in UMEM according to the first address descriptor in the Fill ring. In actual applications, the kernel driver consumes the Fill ring, obtains the first address descriptor in the Fill ring, collects QUIC data, and writes the QUIC data into UMEM according to the first address descriptor. . In this process, the kernel driver is the consumer of the Fill ring.
在本实施例中,内核驱动程序根据第一地址描述符a,将QUIC接收数据写入到共享内存中第一地址描述符a对应的数据帧中。In this embodiment, the kernel driver writes the QUIC received data into the data frame corresponding to the first address descriptor a in the shared memory based on the first address descriptor a.
R3、在QUIC接收数据写入完成的情况下,将QUIC接收数据在共享内存中的数据内存地址写入到接收环。R3. When the writing of the QUIC received data is completed, write the data memory address of the QUIC received data in the shared memory to the receiving ring.
当QUIC接收数据写入共享内存的操作完成之后,对应的数据帧的引用就会写入到RX ring中,在RX ring中保存了QUIC接收数据在共享内存中的实际数据内存地址。需要注意的是,QUIC接收数据占据的大小可能会占据UMEM中的一个或多个数据帧,在RX ring中均会对其进行记录。在实际应用中,这一步的操作也是由内核驱动程序执行的,即内核驱动程序在将QUIC数据完全写入到UMEM中之后,会将UMEM中的数据内存地址写入到RX ring中,以供QUIC线程读取该数据内存地址。需要注意的是,当内核驱动程序将QUIC数据写入到UMEM中并完成之后,会将QUIC数据在UMEM中的数据内存地址写入到RX ring中,同时会将Fill ring中的第一地址描述符删除。在此过程中,内核驱动程序是RX ring的生产者。When the operation of writing the QUIC received data into the shared memory is completed, the reference of the corresponding data frame will be written to the RX ring, which stores the actual data memory address of the QUIC received data in the shared memory. It should be noted that the size occupied by QUIC received data may occupy one or more data frames in UMEM, which will be recorded in the RX ring. In actual applications, this step of operation is also performed by the kernel driver. That is, after the kernel driver completely writes the QUIC data into UMEM, it will write the data memory address in UMEM into the RX ring for The QUIC thread reads the data memory address. It should be noted that when the kernel driver writes QUIC data to UMEM and completes it, the data memory address of the QUIC data in UMEM will be written to the RX ring, and the first address in the Fill ring will be described. symbol is deleted. During this process, the kernel driver is the producer of the RX ring.
在本实施例中,QUIC接收数据的起始位置为a,其占用了4个数据帧,结束位置为b,内核驱动程序在QUIC数据写入到UMEM中之后,将QUIC接收数据对应的数据内存地址a-b写入到RX ring中。用于确定QUIC接收数据在UMEM中的实际位置。In this embodiment, the starting position of QUIC received data is a, which occupies 4 data frames, and the ending position is b. After the QUIC data is written into UMEM, the kernel driver writes the QUIC received data into the data memory corresponding to Addresses a-b are written to the RX ring. Used to determine the actual location of QUIC received data in UMEM.
R4、基于QUIC数据处理线程读取接收环中的数据内存地址,并根据数据内存地址从共享内存中读取QUIC接收数据。R4. Based on the QUIC data processing thread, read the data memory address in the receiving ring, and read the QUIC receiving data from the shared memory according to the data memory address.
当内核驱动程序将数据内存地址写入到RX ring中后,QUIC数据处理线程即可根据该数据内存地址从共享内存中读取QUIC接收数据,具体的QUIC数据处理线程中的QUIC数据包接收模块通过libbpf提供的调用方法读取RX ring中的数据内存地址。并根据该数据内存地址从共享内存中获取QUIC接收数据。需要注意的是,在此时QUIC数据处理线程是RX ring的消费者, 当QUIC数据处理线程从RX ring中读取到该数据内存地址之后,该数据内存地址就会从RX ring中删除。QUIC数据处理线程在接收到QUIC接收数据之后,按照以太网层、IP层、UDP层对QUIC接收数据进行解封装,并传递到QUIC核心协议栈中做进一步处理。在此过程中,QUIC数据处理线程是RX ring的消费者。When the kernel driver writes the data memory address to the RX ring, the QUIC data processing thread can read the QUIC reception data from the shared memory according to the data memory address. The specific QUIC data packet reception module in the QUIC data processing thread Read the data memory address in the RX ring through the calling method provided by libbpf. And obtain the QUIC reception data from the shared memory according to the data memory address. It should be noted that at this time the QUIC data processing thread is the consumer of the RX ring. When the QUIC data processing thread reads the data memory address from the RX ring, the data memory address will be deleted from the RX ring. After receiving the QUIC received data, the QUIC data processing thread decapsulates the QUIC received data according to the Ethernet layer, IP layer, and UDP layer, and passes it to the QUIC core protocol stack for further processing. During this process, the QUIC data processing thread is the consumer of the RX ring.
至此,QUIC接收数据的处理流程完成。通过本公开提供的方法,当QUIC接收数据抵达终端后,将QUIC数据重定向至QUIC数据接收路径环进行数据接收处理,无需将QUIC接收数据经过Linux内核网络协议栈,有效降低了终端的CPU负载,提升了数据传输效率。At this point, the processing flow of QUIC receiving data is completed. Through the method provided by this disclosure, when the QUIC received data arrives at the terminal, the QUIC data is redirected to the QUIC data receiving path ring for data reception processing. There is no need to pass the QUIC received data through the Linux kernel network protocol stack, which effectively reduces the CPU load of the terminal. , improving data transmission efficiency.
下面将通过实施例2对发送QUIC数据时,如何根据QUIC数据处理线程和QUIC数据发送路径环发送QUIC数据进行解释说明。The following will explain how to send QUIC data according to the QUIC data processing thread and the QUIC data sending path ring when sending QUIC data through Embodiment 2.
具体地,根据QUIC数据处理线程和QUIC数据发送路径环发送QUIC数据,包括S1-S4:Specifically, QUIC data is sent according to the QUIC data processing thread and QUIC data sending path ring, including S1-S4:
S1、基于QUIC数据处理线程生成QUIC发送数据。S1. Generate QUIC sending data based on the QUIC data processing thread.
当QUIC服务需要发送QUIC数据时,需要在QUIC数据处理线程中生成QUIC发送数据,进一步地,由QUIC核心协议栈生成QUIC数据,并经过UDP层、IP层、以太网层对QUIC数据进行封装,生成QUIC发送数据。When the QUIC service needs to send QUIC data, it needs to generate QUIC sending data in the QUIC data processing thread. Further, the QUIC data is generated by the QUIC core protocol stack, and the QUIC data is encapsulated through the UDP layer, IP layer, and Ethernet layer. Generate QUIC send data.
S2、将QUIC发送数据写入至共享内存,并将QUIC发送数据在共享内存中的第二地址描述符写入到发送环。S2. Write the QUIC send data to the shared memory, and write the second address descriptor of the QUIC send data in the shared memory to the sending ring.
QUIC数据处理线程将QUIC发送数据写入到UMEM中,在写入完成之后,将QUIC发送数据在UMEM中的第二地址描述符写入到TX ring中。在此过程中,QUIC数据处理线程是TX ring的生产者。第二地址描述符具体是指QUIC发送数据在共享内存中的位置偏移信息。The QUIC data processing thread writes the QUIC transmission data into UMEM. After the writing is completed, the second address descriptor of the QUIC transmission data in UMEM is written into the TX ring. During this process, the QUIC data processing thread is the producer of the TX ring. The second address descriptor specifically refers to the position offset information of the QUIC sent data in the shared memory.
S3、读取发送环中的第二地址描述符,根据第二地址描述符读取并发送QUIC发送数据。S3. Read the second address descriptor in the sending ring, read and send the QUIC sending data according to the second address descriptor.
内核驱动程序读取TX ring中的第二地址描述符,调用sendto通知网卡驱动根据地址描述符读取QUIC发送数据,网卡驱动根据地址描述符在UMEM中读取到QUIC发送数据包,并将QUIC发送数据发送到网络中。在此过程中,内核驱动程序是TX ring的消费者。The kernel driver reads the second address descriptor in the TX ring, calls sendto to notify the network card driver to read the QUIC send data according to the address descriptor, and the network card driver reads the QUIC send data packet in UMEM according to the address descriptor, and sends the QUIC Send data to the network. During this process, the kernel driver is the consumer of the TX ring.
S4、在QUIC发送数据发送完成的情况下,将第二地址描述符写入至完成环。S4. When the QUIC transmission data is completed, write the second address descriptor to the completion ring.
内核驱动程序在将QUIC发送数据全部发送至网络中之后,完成了QUIC发送数据的发送,需要把第二地址描述符回写到Completion ring中,用于标 识该QUIC发送数据已经发送完成,在此过程中,内核驱动程序是Completion ring的生产者。After the kernel driver has sent all the QUIC send data to the network, it has completed sending the QUIC send data and needs to write back the second address descriptor to the Completion ring for marking. It is recognized that the QUIC send data has been sent. During this process, the kernel driver is the producer of the Completion ring.
之后,QUIC数据处理线程可以读取Completion ring中的地址描述符,可以知晓QUIC发送数据已经发送完成,在此过程中,QUIC数据处理线程是Completion ring的消费者。Afterwards, the QUIC data processing thread can read the address descriptor in the Completion ring and know that the QUIC data has been sent. During this process, the QUIC data processing thread is the consumer of the Completion ring.
至此,QUIC发送数据的处理流程完成。通过本公开提供的方法,在发送数据时,QUIC协议按照协议栈层次结构,封装生成QUIC发送数据包,与内核驱动程序共同协作,将QUIC发送数据包发送至网卡驱动,并通过网卡将QUIC发送数据发送到网络中,同样无需将QUIC发送数据经过Linux内核网络协议栈,有效降低了终端的CPU负载,提升了数据传输效率。At this point, the processing flow of QUIC sending data is completed. Through the method provided by this disclosure, when sending data, the QUIC protocol encapsulates and generates QUIC sending data packets according to the protocol stack hierarchy, and cooperates with the kernel driver to send the QUIC sending data packets to the network card driver, and sends QUIC through the network card When data is sent to the network, there is also no need to send QUIC data through the Linux kernel network protocol stack, which effectively reduces the CPU load of the terminal and improves data transmission efficiency.
本公开实施例提供的基于协议族的QUIC数据传输方法,创建QUIC数据处理线程、QUIC数据处理线程对应的协议族套接字和共享内存;根据共享内存和协议族套接字组成QUIC数据处理路径环;根据QUIC数据处理线程和QUIC数据处理路径环传输QUIC数据。通过构建QUIC数据处理路径环,生成了处理QUIC数据的环形缓冲区,将QUIC协议栈和基于AF_XDP的网络数据发送结合,无需将QUIC数据发送至Linux内核网络协议栈,从而降低了终端的CPU负载,提升了数据传输效率。The QUIC data transmission method based on the protocol family provided by the embodiment of the present disclosure creates a QUIC data processing thread, a protocol family socket and shared memory corresponding to the QUIC data processing thread; a QUIC data processing path is formed based on the shared memory and the protocol family socket Ring; transmits QUIC data according to the QUIC data processing thread and QUIC data processing path ring. By building a QUIC data processing path ring, a ring buffer for processing QUIC data is generated, and the QUIC protocol stack and AF_XDP-based network data transmission are combined. There is no need to send QUIC data to the Linux kernel network protocol stack, thus reducing the CPU load of the terminal. , improving data transmission efficiency.
下述结合附图3,以本公开提供的基于协议族的QUIC数据传输方法在接收数据包场景下的应用为例,对基于协议族的QUIC数据传输方法进行进一步说明。其中,图3示出了本公开一实施例提供的一种应用于接收数据包场景的基于协议族的QUIC数据传输方法的处理流程图,具体包括以下步骤:The QUIC data transmission method based on the protocol family will be further described below with reference to Figure 3, taking the application of the QUIC data transmission method based on the protocol family provided by the present disclosure in the scenario of receiving data packets as an example. Among them, Figure 3 shows a processing flow chart of a QUIC data transmission method based on the protocol suite applied to the scenario of receiving data packets provided by an embodiment of the present disclosure, which specifically includes the following steps:
步骤302:接收待处理数据。Step 302: Receive data to be processed.
在本实施例中,网卡队列接收到待处理数据,由XDP程序在网卡驱动还未将待处理数据分配到内核协议栈之前获取到待处理数据。In this embodiment, the network card queue receives the data to be processed, and the XDP program obtains the data to be processed before the network card driver distributes the data to be processed to the kernel protocol stack.
步骤304:解析待处理数据,获得待处理数据中携带的数据服务端口。Step 304: Parse the data to be processed and obtain the data service port carried in the data to be processed.
在本实施例中,内核驱动程序解析该待处理数据,获得待处理数据中携带的数据服务端口为443。In this embodiment, the kernel driver parses the data to be processed and obtains that the data service port carried in the data to be processed is 443.
步骤306:判断数据服务端口是否是QUIC服务对应的服务端口,若否,则执行步骤308,若是,则执行步骤310。Step 306: Determine whether the data service port is the service port corresponding to the QUIC service. If not, execute step 308. If yes, execute step 310.
在本实施例中,内核驱动程序判断443端口是否是QUIC服务对应的服务端口,若是,则执行步骤310的操作,若否,则执行步骤308的操作。In this embodiment, the kernel driver determines whether port 443 is the service port corresponding to the QUIC service. If so, the operation of step 310 is performed. If not, the operation of step 308 is performed.
步骤308:将待处理数据传递给内核协议栈。Step 308: Pass the data to be processed to the kernel protocol stack.
在本实施例中,若待处理数据不是QUIC服务对应的数据,则将该数据 通过常规处理,传递至内核协议栈。In this embodiment, if the data to be processed is not data corresponding to the QUIC service, the data Passed to the kernel protocol stack through normal processing.
步骤310:将待处理数据重定向至QUIC数据接收路径环。Step 310: Redirect the data to be processed to the QUIC data receiving path ring.
在本实施例中,若待处理数据时QUIC服务对应的数据,则内核驱动程序将该待处理数据重新定向至预先建立的QUIC数据接收路径环。In this embodiment, if the data to be processed is data corresponding to the QUIC service, the kernel driver redirects the data to be processed to the pre-established QUIC data receiving path ring.
步骤312:控制RX ring和Fill ring收取待处理数据,并将待处理数据存入UMEM中。Step 312: Control the RX ring and Fill ring to collect the data to be processed, and store the data to be processed in UMEM.
在本实施例中,QUIC线程中的数据包接收模块预先将用于接收待处理数据的UMEM中收包地址存入Fill ring中,内核驱动程序通过poll等系统调用通知网卡驱动进行收取待处理数据的操作,内核驱动程序将待处理数据存入到UMEM中的收包地址中。当待处理数据完全收入到UMEM中之后,内核驱动程序会将该待处理数据的内存地址写入到RX ring中。In this embodiment, the data packet receiving module in the QUIC thread stores the packet receiving address in UMEM used to receive the data to be processed in the Fill ring in advance, and the kernel driver notifies the network card driver to collect the data to be processed through system calls such as poll. operation, the kernel driver stores the data to be processed into the packet receiving address in UMEM. When the data to be processed is completely received into UMEM, the kernel driver will write the memory address of the data to be processed into the RX ring.
步骤314:QUIC数据包接收模块从UMEM中读取待处理数据。Step 314: The QUIC data packet receiving module reads the data to be processed from UMEM.
在本实施例中,数据包接收模块通过libbpf提供的调用方法读取RX ring中的内存地址,将待处理数据读取到QUIC线程中。In this embodiment, the data packet receiving module reads the memory address in the RX ring through the calling method provided by libbpf, and reads the data to be processed into the QUIC thread.
步骤316:解封装该待处理数据,并将解封装后的数据传递给QUIC核心协议栈。Step 316: Decapsulate the data to be processed, and pass the decapsulated data to the QUIC core protocol stack.
在本实施例中,数据包接收模块按照以太网层、IP层、UDP层对待处理数据进行解封装,并将解封装之后获得的数据传递到QUIC核心协议栈中做进一步处理。In this embodiment, the data packet receiving module decapsulates the data to be processed according to the Ethernet layer, IP layer, and UDP layer, and transfers the data obtained after decapsulation to the QUIC core protocol stack for further processing.
通过本公开提供的方法,当QUIC接收数据抵达终端后,将QUIC数据重定向至QUIC数据接收路径环进行数据接收处理,无需将QUIC接收数据经过Linux内核网络协议栈,有效降低了终端的CPU负载,提升了数据传输效率。Through the method provided by this disclosure, when the QUIC received data arrives at the terminal, the QUIC data is redirected to the QUIC data receiving path ring for data reception processing. There is no need to pass the QUIC received data through the Linux kernel network protocol stack, which effectively reduces the CPU load of the terminal. , improving data transmission efficiency.
下述结合附图4,以本公开提供的基于协议族的QUIC数据传输方法在发送数据包场景下的应用为例,对基于协议族的QUIC数据传输方法进行进一步说明。其中,图4示出了本公开一实施例提供的一种应用于发送数据包场景的基于协议族的QUIC数据传输方法的处理流程图,具体包括以下步骤:The QUIC data transmission method based on the protocol family will be further described below with reference to Figure 4, taking the application of the QUIC data transmission method based on the protocol family provided by the present disclosure in the scenario of sending data packets as an example. Among them, Figure 4 shows a processing flow chart of a QUIC data transmission method based on the protocol suite applied to the scenario of sending data packets provided by an embodiment of the present disclosure, which specifically includes the following steps:
步骤402:QUIC核心协议栈生成QUIC数据包。Step 402: The QUIC core protocol stack generates QUIC data packets.
在本实施例中,当QUIC服务想要发送数据时,通过QUIC核心协议栈生成QUIC数据包。In this embodiment, when the QUIC service wants to send data, a QUIC data packet is generated through the QUIC core protocol stack.
步骤404:将QUIC数据包进行封装,生成待发送数据。Step 404: Encapsulate the QUIC data packet to generate data to be sent.
在本实施例中,QUIC服务将QUIC数据包通过UDP层、IP层、以太网 层进行数据封装,获得待发送数据。In this embodiment, the QUIC service passes QUIC data packets through the UDP layer, IP layer, and Ethernet The layer encapsulates the data and obtains the data to be sent.
步骤406:将待发送数据写入UMEM中,并将待发送数据在UMEM中的地址描述符写入到TX ring。Step 406: Write the data to be sent into UMEM, and write the address descriptor of the data to be sent in UMEM into the TX ring.
在本实施例中,QUIC线程中的数据包发送模块将待发送数据写入到UMEM中,在写入完成之后,将待发送数据在UMEM中的地址描述符写入到TX ring中。In this embodiment, the data packet sending module in the QUIC thread writes the data to be sent into UMEM. After the writing is completed, the address descriptor of the data to be sent in UMEM is written into the TX ring.
步骤408:读取TX ring中的地址描述符,并根据该地址描述符将待发送数据发布至网络。Step 408: Read the address descriptor in the TX ring, and publish the data to be sent to the network based on the address descriptor.
在本实施例中,内核驱动程序读取TX ring中的地址描述符,调用sendto通知网卡驱动根据该地址描述符读取待发送数据,网卡驱动根据该地址描述符在UMEM中读取到待发送数据,并将待发送数据发送至网络中。In this embodiment, the kernel driver reads the address descriptor in the TX ring, calls sendto to notify the network card driver to read the data to be sent based on the address descriptor, and the network card driver reads the data to be sent in UMEM based on the address descriptor. data and sends the data to be sent to the network.
步骤410:在待发送数据发送完成后,将该地址描述符写入到Completion ring。Step 410: After the data to be sent is sent, write the address descriptor to the Completion ring.
在本实施例中,内核驱动程序在检测到待发送数据已经发送完成之后,将该地址描述符写入到Completion ring中,用于标识该待发送数据已经发送完成。QUIC数据处理线程在读取到Completion ring中存在该地址描述符的情况下,可以得知该待发送数据已经发送成功。In this embodiment, after detecting that the data to be sent has been sent, the kernel driver writes the address descriptor into the Completion ring to identify that the data to be sent has been sent. When the QUIC data processing thread reads that the address descriptor exists in the Completion ring, it can know that the data to be sent has been sent successfully.
通过本公开提供的方法,在发送数据时,QUIC协议按照协议栈层次结构,封装生成QUIC发送数据包,与内核驱动程序共同协作,将QUIC发送数据包发送至网卡驱动,并通过网卡将QUIC发送数据发送到网络中,同样无需将QUIC发送数据经过Linux内核网络协议栈,有效降低了终端的CPU负载,提升了数据传输效率。Through the method provided by this disclosure, when sending data, the QUIC protocol encapsulates and generates QUIC sending data packets according to the protocol stack hierarchy, and cooperates with the kernel driver to send the QUIC sending data packets to the network card driver, and sends QUIC through the network card When data is sent to the network, there is also no need to send QUIC data through the Linux kernel network protocol stack, which effectively reduces the CPU load of the terminal and improves data transmission efficiency.
与上述基于协议族的QUIC数据传输方法实施例相对应,本公开还提供了基于协议族的QUIC数据传输装置实施例,图5示出了本公开一实施例提供的一种基于协议族的QUIC数据传输装置的结构示意图。如图5所示,该装置包括:Corresponding to the above embodiment of the QUIC data transmission method based on the protocol family, the present disclosure also provides an embodiment of the QUIC data transmission device based on the protocol family. Figure 5 shows a QUIC data transmission device based on the protocol family provided by an embodiment of the present disclosure. Structural diagram of data transmission device. As shown in Figure 5, the device includes:
创建模块502,被配置为创建QUIC数据处理线程、QUIC数据处理线程对应的协议族套接字和共享内存;The creation module 502 is configured to create a QUIC data processing thread, a protocol family socket and shared memory corresponding to the QUIC data processing thread;
组成模块504,被配置为根据共享内存和协议族套接字组成QUIC数据处理路径环;The composition module 504 is configured to form a QUIC data processing path ring based on shared memory and protocol family sockets;
传输模块506,被配置为根据QUIC数据处理线程和QUIC数据处理路径环传输QUIC数据。The transmission module 506 is configured to transmit QUIC data according to the QUIC data processing thread and the QUIC data processing path ring.
可选地,创建模块502,进一步被配置为: Optionally, the creation module 502 is further configured as:
确定网卡中的网卡硬件队列数量;Determine the number of network card hardware queues in the network card;
基于网卡硬件队列数量创建对应数量的QUIC数据处理线程;Create a corresponding number of QUIC data processing threads based on the number of network card hardware queues;
创建每个QUIC数据处理线程对应的协议族套接字和共享内存。Create protocol family sockets and shared memory corresponding to each QUIC data processing thread.
可选地,组成模块504,进一步被配置为:Optionally, component module 504 is further configured as:
获取共享内存中的填充环和完成环,获取协议族套接字中的接收环和发送环,其中,填充环用于接收QUIC接收数据期望被保存在共享内存中的位置偏移信息,完成环用于接收QUIC发送数据发送成功后在共享内存中的位置偏移信息,接收环用于接收QUIC接收数据在共享内存中的位置偏移信息,发送环用于接收QUIC发送数据在共享内存中的位置偏移信息;Obtain the filling ring and completion ring in the shared memory, and obtain the receiving ring and sending ring in the protocol family socket. The filling ring is used to receive the position offset information of the QUIC received data expected to be saved in the shared memory, and the completion ring It is used to receive the position offset information of the QUIC sent data in the shared memory after it is successfully sent. The receiving ring is used to receive the position offset information of the QUIC received data in the shared memory. The sending ring is used to receive the position offset information of the QUIC sent data in the shared memory. Position offset information;
根据填充环和接收环组成QUIC数据接收路径环,根据完成环和发送环组成QUIC数据发送路径环。The QUIC data receiving path ring is formed according to the filling ring and the receiving ring, and the QUIC data transmitting path ring is formed according to the completion ring and the sending ring.
可选地,传输模块506,包括:Optionally, the transmission module 506 includes:
接收单元,被配置为根据QUIC数据处理线程和QUIC数据接收路径环接收QUIC数据,其中,QUIC数据接收路径环为QUIC数据的接收规则;The receiving unit is configured to receive QUIC data according to the QUIC data processing thread and the QUIC data receiving path ring, where the QUIC data receiving path ring is the receiving rule of QUIC data;
发送单元,被配置为根据QUIC数据处理线程和QUIC数据发送路径环发送QUIC数据,其中,QUIC数据接收路径环为QUIC数据的发送规则。The sending unit is configured to send QUIC data according to the QUIC data processing thread and the QUIC data sending path ring, where the QUIC data receiving path ring is the sending rule of QUIC data.
可选地,接收单元,还被配置为:Optionally, the receiving unit is also configured to:
接收待处理数据;Receive data to be processed;
判断待处理数据是否为QUIC接收数据;Determine whether the data to be processed is QUIC received data;
若是,则将QUIC接收数据重定向至QUIC数据接收路径环;If so, redirect the QUIC receive data to the QUIC data receive path ring;
若否,则传输待处理数据至内核协议栈。If not, the data to be processed is transmitted to the kernel protocol stack.
可选地,接收单元,进一步被配置为:Optionally, the receiving unit is further configured as:
解析待处理数据,获得待处理数据中携带的数据服务端口;Parse the data to be processed and obtain the data service port carried in the data to be processed;
判断数据服务端口是否是QUIC数据处理线程对应的服务端口。Determine whether the data service port is the service port corresponding to the QUIC data processing thread.
可选地,接收单元,进一步被配置为:Optionally, the receiving unit is further configured as:
基于QUIC数据处理线程将第一地址描述符填充至填充环,其中,第一地址描述符为共享内存的地址偏移信息;Fill the first address descriptor into the filling ring based on the QUIC data processing thread, where the first address descriptor is the address offset information of the shared memory;
根据第一地址描述符将QUIC接收数据写入到共享内存;Write the QUIC received data to the shared memory according to the first address descriptor;
在QUIC接收数据写入完成的情况下,将QUIC接收数据在共享内存中的数据内存地址写入到接收环;When the writing of QUIC receiving data is completed, write the data memory address of the QUIC receiving data in the shared memory to the receiving ring;
基于QUIC数据处理线程读取接收环中的数据内存地址,并根据数据内 存地址从共享内存中读取QUIC接收数据。Based on the QUIC data processing thread, the data memory address in the receiving ring is read and processed according to the data content. The storage address reads QUIC receive data from shared memory.
可选地,发送单元,进一步被配置为:Optionally, the sending unit is further configured as:
基于QUIC数据处理线程生成QUIC发送数据;Generate QUIC sending data based on the QUIC data processing thread;
将QUIC发送数据写入至共享内存,并将QUIC发送数据在共享内存中的第二地址描述符写入到发送环;Write the QUIC send data to the shared memory, and write the second address descriptor of the QUIC send data in the shared memory to the send ring;
读取发送环中的第二地址描述符,根据第二地址描述符读取并发送QUIC发送数据;Read the second address descriptor in the sending ring, read and send QUIC sending data according to the second address descriptor;
在QUIC发送数据发送完成的情况下,将第二地址描述符写入至完成环。When the QUIC transmission data transmission is completed, the second address descriptor is written to the completion ring.
本公开实施例提供的基于协议族的QUIC数据传输装置,创建QUIC数据处理线程、QUIC数据处理线程对应的协议族套接字和共享内存;根据共享内存和协议族套接字组成QUIC数据处理路径环;根据QUIC数据处理线程和QUIC数据处理路径环传输QUIC数据。通过构建QUIC数据处理路径环,生成了处理QUIC数据的环形缓冲区,将QUIC协议栈和基于AF_XDP的网络数据发送结合,无需将QUIC数据发送至Linux内核网络协议栈,从而降低了终端的CPU负载,提升了数据传输效率。The QUIC data transmission device based on the protocol family provided by the embodiment of the present disclosure creates a QUIC data processing thread, a protocol family socket and a shared memory corresponding to the QUIC data processing thread; a QUIC data processing path is formed based on the shared memory and the protocol family socket Ring; transmits QUIC data according to the QUIC data processing thread and QUIC data processing path ring. By constructing a QUIC data processing path ring, a ring buffer for processing QUIC data is generated, and the QUIC protocol stack and AF_XDP-based network data transmission are combined. There is no need to send QUIC data to the Linux kernel network protocol stack, thus reducing the CPU load of the terminal. , improving data transmission efficiency.
上述为本实施例的一种基于协议族的QUIC数据传输装置的示意性方案。需要说明的是,该基于协议族的QUIC数据传输装置的技术方案与上述的基于协议族的QUIC数据传输方法的技术方案属于同一构思,基于协议族的QUIC数据传输装置的技术方案未详细描述的细节内容,均可以参见上述基于协议族的QUIC数据传输方法的技术方案的描述。The above is a schematic solution of a QUIC data transmission device based on the protocol suite in this embodiment. It should be noted that the technical solution of the protocol family-based QUIC data transmission device belongs to the same concept as the above-mentioned technical solution of the protocol family-based QUIC data transmission method. The technical solution of the protocol family-based QUIC data transmission device is not described in detail. For details, please refer to the description of the technical solution of the QUIC data transmission method based on the protocol suite mentioned above.
图6示出了根据本公开一实施例提供的一种计算设备600的结构框图。该计算设备600的部件包括但不限于存储器610和处理器620。处理器620与存储器610通过总线630相连接,数据库650用于保存数据。FIG. 6 shows a structural block diagram of a computing device 600 according to an embodiment of the present disclosure. Components of the computing device 600 include, but are not limited to, memory 610 and processor 620 . The processor 620 and the memory 610 are connected through a bus 630, and the database 650 is used to save data.
计算设备600还包括接入设备640,接入设备640使得计算设备600能够经由一个或多个网络660通信。这些网络的示例包括公用交换电话网(PSTN)、局域网(LAN)、广域网(WAN)、个域网(PAN)或诸如因特网的通信网络的组合。接入设备640可以包括有线或无线的任何类型的网络接口(例如,网络接口卡(NIC))中的一个或多个,诸如IEEE802.11无线局域网(WLAN)无线接口、全球微波互联接入(Wi-MAX)接口、以太网接口、通用串行总线(USB)接口、蜂窝网络接口、蓝牙接口、近场通信(NFC)接口,等等。Computing device 600 also includes an access device 640 that enables computing device 600 to communicate via one or more networks 660 . Examples of these networks include the Public Switched Telephone Network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communications networks such as the Internet. Access device 640 may include one or more of any type of network interface (eg, a network interface card (NIC)), wired or wireless, such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interconnection for Microwave Access (WLAN) Wi-MAX) interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, Bluetooth interface, Near Field Communication (NFC) interface, etc.
在本公开的一个实施例中,计算设备600的上述部件以及图6中未示出的其他部件也可以彼此相连接,例如通过总线。应当理解,图6所示的计算 设备结构框图仅仅是出于示例的目的,而不是对本公开范围的限制。本领域技术人员可以根据需要,增添或替换其他部件。In one embodiment of the present disclosure, the above-mentioned components of the computing device 600 and other components not shown in FIG. 6 may also be connected to each other, such as through a bus. It should be understood that the calculation shown in Figure 6 The device structure block diagram is for illustrative purposes only and does not limit the scope of the present disclosure. Those skilled in the art can add or replace other components as needed.
计算设备600可以是任何类型的静止或移动计算设备,包括移动计算机或移动计算设备(例如,平板计算机、个人数字助理、膝上型计算机、笔记本计算机、上网本等)、移动电话(例如,智能手机)、可佩戴的计算设备(例如,智能手表、智能眼镜等)或其他类型的移动设备,或者诸如台式计算机或PC的静止计算设备。计算设备600还可以是移动式或静止式的服务器。Computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet computer, personal digital assistant, laptop computer, notebook computer, netbook, etc.), a mobile telephone (e.g., smartphone ), a wearable computing device (e.g., smart watch, smart glasses, etc.) or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 600 may also be a mobile or stationary server.
其中,处理器620执行所述计算机指令时实现所述的基于协议族的QUIC数据传输方法的步骤。When the processor 620 executes the computer instructions, the steps of the QUIC data transmission method based on the protocol suite are implemented.
上述为本实施例的一种计算设备的示意性方案。需要说明的是,该计算设备的技术方案与上述的基于协议族的QUIC数据传输方法的技术方案属于同一构思,计算设备的技术方案未详细描述的细节内容,均可以参见上述基于协议族的QUIC数据传输方法的技术方案的描述。The above is a schematic solution of a computing device in this embodiment. It should be noted that the technical solution of the computing device and the above-mentioned technical solution of the QUIC data transmission method based on the protocol family belong to the same concept. For details that are not described in detail in the technical solution of the computing device, please refer to the above-mentioned QUIC protocol family-based method. Description of technical solutions for data transmission methods.
本公开一实施例还提供一种非易失性计算机可读存储介质,其存储有计算机指令,该计算机指令被处理器执行时实现如前基于协议族的QUIC数据传输方法的步骤。An embodiment of the present disclosure also provides a non-volatile computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the steps of the QUIC data transmission method based on the protocol suite are implemented.
上述为本实施例的一种计算机可读存储介质的示意性方案。需要说明的是,该存储介质的技术方案与上述的基于协议族的QUIC数据传输方法的技术方案属于同一构思,存储介质的技术方案未详细描述的细节内容,均可以参见上述基于协议族的QUIC数据传输方法的技术方案的描述。The above is a schematic solution of a computer-readable storage medium in this embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the QUIC data transmission method based on the protocol family mentioned above. For details that are not described in detail in the technical solution of the storage medium, please refer to the QUIC protocol family-based method mentioned above. Description of technical solutions for data transmission methods.
上述对本公开特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desired results. Additionally, the processes depicted in the figures do not necessarily require the specific order shown, or sequential order, to achieve desirable results. Multitasking and parallel processing are also possible or may be advantageous in certain implementations.
计算机指令包括计算机程序代码,计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。计算机可读介质可以包括:能够携带计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。 Computer instructions include computer program code, which can be in the form of source code, object code, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, mobile hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM, Read-Only Memory), random access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include Electrical carrier signals and telecommunications signals.
需要说明的是,对于前述的各方法实施例,为了简便描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本公开并不受所描述的动作顺序的限制,因为依据本公开,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定都是本公开所必须的。It should be noted that for the convenience of description, each of the foregoing method embodiments is expressed as a series of action combinations. However, those skilled in the art should know that the present disclosure is not limited by the described action sequence. Because in accordance with the present disclosure, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily necessary for the present disclosure.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。In the above embodiments, each embodiment is described with its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
以上公开的本公开优选实施例只是用于帮助阐述本公开。可选实施例并没有详尽叙述所有的细节,也不限制该发明仅为的具体实施方式。显然,根据本公开的内容,可作很多的修改和变化。本公开选取并具体描述这些实施例,是为了更好地解释本公开的原理和实际应用,从而使所属技术领域技术人员能很好地理解和利用本公开。本公开仅受权利要求书及其全部范围和等效物的限制。 The preferred embodiments of the present disclosure disclosed above are only used to help explain the present disclosure. The alternative embodiments are not exhaustive in all their details, nor do they limit the invention to the specific implementation thereof. Obviously, many modifications and variations are possible in light of this disclosure. These embodiments are selected and described in detail in order to better explain the principles and practical applications of the disclosure, so that those skilled in the art can better understand and utilize the disclosure. This disclosure is limited only by the claims and their full scope and equivalents.

Claims (12)

  1. 一种基于协议族的QUIC数据传输方法,其特征在于,包括:A QUIC data transmission method based on the protocol family, which is characterized by including:
    创建QUIC数据处理线程、所述QUIC数据处理线程对应的协议族套接字和共享内存;Create a QUIC data processing thread, the protocol family socket and shared memory corresponding to the QUIC data processing thread;
    根据所述共享内存和所述协议族套接字组成QUIC数据处理路径环;A QUIC data processing path ring is formed according to the shared memory and the protocol family socket;
    根据所述QUIC数据处理线程和所述QUIC数据处理路径环传输QUIC数据。QUIC data is loop-transmitted according to the QUIC data processing thread and the QUIC data processing path.
  2. 如权利要求1所述的方法,其特征在于,所述创建QUIC数据处理线程、所述QUIC数据处理线程对应的协议族套接字和共享内存,进一步包括:The method of claim 1, wherein said creating a QUIC data processing thread, a protocol family socket and shared memory corresponding to the QUIC data processing thread further includes:
    确定网卡中的网卡硬件队列数量;Determine the number of network card hardware queues in the network card;
    基于所述网卡硬件队列数量创建对应数量的QUIC数据处理线程;Create a corresponding number of QUIC data processing threads based on the number of network card hardware queues;
    创建每个QUIC数据处理线程对应的协议族套接字和共享内存。Create protocol family sockets and shared memory corresponding to each QUIC data processing thread.
  3. 如权利要求1所述的方法,其特征在于,所述根据所述共享内存和所述协议族套接字组成QUIC数据处理路径环,进一步包括:The method of claim 1, wherein the QUIC data processing path loop is composed of the shared memory and the protocol family socket, further comprising:
    获取所述共享内存中的填充环和完成环,获取所述协议族套接字中的接收环和发送环,其中,所述填充环用于接收QUIC接收数据期望被保存在所述共享内存中的位置偏移信息,所述完成环用于接收QUIC发送数据发送成功后在所述共享内存中的位置偏移信息,所述接收环用于接收QUIC接收数据在所述共享内存中的位置偏移信息,所述发送环用于接收QUIC发送数据在所述共享内存中的位置偏移信息;Obtain the filling ring and completion ring in the shared memory, and obtain the receiving ring and sending ring in the protocol family socket, wherein the filling ring is used to receive QUIC reception data and is expected to be saved in the shared memory The position offset information, the completion ring is used to receive the position offset information in the shared memory after the QUIC sending data is successfully sent, and the receiving ring is used to receive the position offset of the QUIC receiving data in the shared memory. Shift information, the sending ring is used to receive the position offset information of QUIC sending data in the shared memory;
    根据所述填充环和所述接收环组成QUIC数据接收路径环,根据所述完成环和所述发送环组成QUIC数据发送路径环。The filling ring and the receiving ring form a QUIC data receiving path ring, and the completion ring and the sending ring form a QUIC data transmitting path ring.
  4. 如权利要求3所述的方法,其特征在于,所述根据所述QUIC数据处理线程和所述QUIC数据处理路径环传输QUIC数据,进一步包括:The method of claim 3, wherein the ring-transmitting QUIC data according to the QUIC data processing thread and the QUIC data processing path further includes:
    根据所述QUIC数据处理线程和所述QUIC数据接收路径环接收QUIC数据,其中,所述QUIC数据接收路径环为QUIC数据的接收规则;Receive QUIC data according to the QUIC data processing thread and the QUIC data receiving path ring, wherein the QUIC data receiving path ring is a receiving rule for QUIC data;
    根据所述QUIC数据处理线程和所述QUIC数据发送路径环发送QUIC数据,其中,所述QUIC数据接收路径环为QUIC数据的发送规则。QUIC data is sent according to the QUIC data processing thread and the QUIC data sending path ring, where the QUIC data receiving path ring is a sending rule for QUIC data.
  5. 如权利要求4所述的方法,其特征在于,在所述根据所述QUIC数据处理线程和所述QUIC数据接收路径环接收QUIC数据之前,所述方法还包括: The method of claim 4, wherein before receiving QUIC data according to the QUIC data processing thread and the QUIC data receiving path ring, the method further includes:
    接收待处理数据;Receive data to be processed;
    判断所述待处理数据是否为QUIC接收数据;Determine whether the data to be processed is QUIC received data;
    若是,则将所述QUIC接收数据重定向至所述QUIC数据接收路径环;If so, redirect the QUIC receive data to the QUIC data receive path ring;
    若否,则传输所述待处理数据至内核协议栈。If not, the data to be processed is transmitted to the kernel protocol stack.
  6. 如权利要求5所述的方法,其特征在于,所述判断所述待处理数据是否为QUIC接收数据,进一步包括:The method of claim 5, wherein determining whether the data to be processed is QUIC received data further includes:
    解析所述待处理数据,获得所述待处理数据中携带的数据服务端口;Parse the data to be processed and obtain the data service port carried in the data to be processed;
    判断所述数据服务端口是否是QUIC数据处理线程对应的服务端口。Determine whether the data service port is the service port corresponding to the QUIC data processing thread.
  7. 如权利要求4所述的方法,其特征在于,所述根据所述QUIC数据处理线程和所述QUIC数据接收路径环接收QUIC数据,进一步包括:The method of claim 4, wherein receiving QUIC data according to the QUIC data processing thread and the QUIC data receiving path ring further includes:
    基于QUIC数据处理线程将第一地址描述符填充至所述填充环,其中,所述第一地址描述符为所述共享内存的地址偏移信息;Fill the first address descriptor into the filling ring based on the QUIC data processing thread, where the first address descriptor is the address offset information of the shared memory;
    根据所述第一地址描述符将所述QUIC接收数据写入到共享内存;Write the QUIC received data to the shared memory according to the first address descriptor;
    在所述QUIC接收数据写入完成的情况下,将所述QUIC接收数据在所述共享内存中的数据内存地址写入到所述接收环;When the writing of the QUIC received data is completed, write the data memory address of the QUIC received data in the shared memory to the receiving ring;
    基于所述QUIC数据处理线程读取所述接收环中的数据内存地址,并根据所述数据内存地址从所述共享内存中读取所述QUIC接收数据。The QUIC data processing thread reads the data memory address in the receiving ring based on the QUIC data processing thread, and reads the QUIC receiving data from the shared memory based on the data memory address.
  8. 如权利要求4所述的方法,其特征在于,所述根据所述QUIC数据处理线程和所述QUIC数据发送路径环发送QUIC数据,进一步包括:The method of claim 4, wherein sending QUIC data according to the QUIC data processing thread and the QUIC data sending path ring further includes:
    基于所述QUIC数据处理线程生成QUIC发送数据;Generate QUIC transmission data based on the QUIC data processing thread;
    将QUIC发送数据写入至所述共享内存,并将QUIC发送数据在所述共享内存中的第二地址描述符写入到所述发送环;Write the QUIC transmission data to the shared memory, and write the second address descriptor of the QUIC transmission data in the shared memory to the transmission ring;
    读取所述发送环中的第二地址描述符,根据所述第二地址描述符读取并发送所述QUIC发送数据;Read the second address descriptor in the transmission ring, read and send the QUIC transmission data according to the second address descriptor;
    在所述QUIC发送数据发送完成的情况下,将所述第二地址描述符写入至所述完成环。When the QUIC transmission data transmission is completed, the second address descriptor is written to the completion ring.
  9. 一种基于协议族的QUIC数据传输装置,其特征在于,包括:A QUIC data transmission device based on the protocol suite, which is characterized by including:
    创建模块,被配置为创建QUIC数据处理线程、所述QUIC数据处理线程对应的协议族套接字和共享内存;A creation module configured to create a QUIC data processing thread, a protocol family socket and shared memory corresponding to the QUIC data processing thread;
    组成模块,被配置为根据所述共享内存和所述协议族套接字组成QUIC数据处理路径环; A component module configured to form a QUIC data processing path ring according to the shared memory and the protocol family socket;
    传输模块,被配置为根据所述QUIC数据处理线程和所述QUIC数据处理路径环传输QUIC数据。A transmission module configured to transmit QUIC data according to the QUIC data processing thread and the QUIC data processing path loop.
  10. 一种计算设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机指令,其特征在于,所述处理器执行所述计算机指令时实现权利要求1-8任意一项所述方法的步骤。A computing device, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that when the processor executes the computer instructions, it implements any one of claims 1-8. Describe the steps of the method.
  11. 一种非易失性计算机可读存储介质,其存储有计算机指令,其特征在于,该计算机指令被处理器执行时实现权利要求1-8任意一项所述方法的步骤。A non-volatile computer-readable storage medium that stores computer instructions, characterized in that when the computer instructions are executed by a processor, the steps of the method described in any one of claims 1-8 are implemented.
  12. 一种计算机程序产品,所述计算机程序产品包括存储在非易失性计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被所述处理器执行时实现权利要求1-8任意一项所述方法的步骤。 A computer program product including a computer program stored on a non-volatile computer-readable storage medium, the computer program including program instructions that when executed by the processor implement the rights The steps of the method described in any one of claims 1-8.
PCT/CN2023/109099 2022-08-17 2023-07-25 Protocol family-based quic data transmission method and device WO2024037296A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210988382.8 2022-08-17
CN202210988382.8A CN115396528A (en) 2022-08-17 2022-08-17 Quic data transmission method and device based on protocol family

Publications (1)

Publication Number Publication Date
WO2024037296A1 true WO2024037296A1 (en) 2024-02-22

Family

ID=84121194

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/109099 WO2024037296A1 (en) 2022-08-17 2023-07-25 Protocol family-based quic data transmission method and device

Country Status (2)

Country Link
CN (1) CN115396528A (en)
WO (1) WO2024037296A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115396528A (en) * 2022-08-17 2022-11-25 上海哔哩哔哩科技有限公司 Quic data transmission method and device based on protocol family
CN116016295B (en) * 2022-12-14 2024-04-09 鹏城实验室 Ethernet performance monitoring method, system, industrial control equipment and storage medium
CN116996602B (en) * 2023-09-25 2024-01-26 苏州元脑智能科技有限公司 Data packet processing method and device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111490963A (en) * 2019-01-25 2020-08-04 上海哔哩哔哩科技有限公司 Data processing method, system, equipment and storage medium based on QUIC protocol stack
US20220247696A1 (en) * 2021-02-03 2022-08-04 Intel Corporation Reliable transport offloaded to network devices
CN115396528A (en) * 2022-08-17 2022-11-25 上海哔哩哔哩科技有限公司 Quic data transmission method and device based on protocol family

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10476800B2 (en) * 2017-10-16 2019-11-12 Verizon Digital Media Services Inc. Systems and methods for load balancing virtual connection traffic
US20190199835A1 (en) * 2018-11-28 2019-06-27 Manasi Deval Quick user datagram protocol (udp) internet connections (quic) packet offloading
CN111885093B (en) * 2020-09-27 2021-03-26 腾讯科技(深圳)有限公司 Event request transmission method and device, storage medium and electronic equipment
CN114095587A (en) * 2021-11-24 2022-02-25 恒安嘉新(北京)科技股份公司 Client, message sending and receiving method, device and storage medium
CN114500633B (en) * 2022-01-27 2023-11-03 北京百度网讯科技有限公司 Data forwarding method, related device, program product and data transmission system
CN114518969A (en) * 2022-02-18 2022-05-20 杭州朗和科技有限公司 Inter-process communication method, system, storage medium and computer device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111490963A (en) * 2019-01-25 2020-08-04 上海哔哩哔哩科技有限公司 Data processing method, system, equipment and storage medium based on QUIC protocol stack
US20220247696A1 (en) * 2021-02-03 2022-08-04 Intel Corporation Reliable transport offloaded to network devices
CN115396528A (en) * 2022-08-17 2022-11-25 上海哔哩哔哩科技有限公司 Quic data transmission method and device based on protocol family

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ANONYMOUS: "Detailed explanation of AF_XDP technology ", REXROCK, 3 March 2021 (2021-03-03), XP093140145, Retrieved from the Internet <URL:https://rexrock.github.io/post/af_xdp1/> [retrieved on 20240312] *

Also Published As

Publication number Publication date
CN115396528A (en) 2022-11-25

Similar Documents

Publication Publication Date Title
WO2024037296A1 (en) Protocol family-based quic data transmission method and device
CN108494817B (en) Data transmission method, related device and system
WO2021254330A1 (en) Memory management method and system, client, server and storage medium
US9473596B2 (en) Using transmission control protocol/internet protocol (TCP/IP) to setup high speed out of band data communication connections
WO2022148363A1 (en) Data transmission method and data transmission server
Laufer et al. Climb: Enabling network function composition with click middleboxes
WO2023005773A1 (en) Message forwarding method and apparatus based on remote direct data storage, and network card and device
US20070297334A1 (en) Method and system for network protocol offloading
WO2021068973A1 (en) Data communication method and device employing application layer protocol
US8539089B2 (en) System and method for vertical perimeter protection
US11809925B2 (en) Data processing method and apparatus
US8156209B1 (en) Aggregation devices processing keep-alive messages of point-to-point sessions
US20170048304A1 (en) Pre-boot file transfer system
CN111698275B (en) Data processing method, device and equipment
CN115202573A (en) Data storage system and method
CN114024910A (en) Extremely-low-delay reliable communication system and method for financial transaction system
WO2024067529A1 (en) Rdma-based link establishment method and apparatus, and device and storage medium
CN110798366B (en) Task logic processing method, device and equipment
WO2022148364A1 (en) Data sending method and apparatus, and method and system for establishing p2p connection
CN113271336B (en) DPDK-based robot middleware DDS data transmission method, electronic equipment and computer-readable storage medium
US20210360374A1 (en) Method and Apparatus for Proactive Data Hinting Through Dedicated Traffic Channel of Telecom Network
CN113810397A (en) Protocol data processing method and device
CN113497767A (en) Method and device for transmitting data, computing equipment and storage medium
CN115866010B (en) RDMA connection establishment method and device
WO2023202241A1 (en) Communication method and related product

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23854200

Country of ref document: EP

Kind code of ref document: A1