WO2021143139A1 - 一种提高交换机性能的方法、系统、设备及介质 - Google Patents
一种提高交换机性能的方法、系统、设备及介质 Download PDFInfo
- Publication number
- WO2021143139A1 WO2021143139A1 PCT/CN2020/111236 CN2020111236W WO2021143139A1 WO 2021143139 A1 WO2021143139 A1 WO 2021143139A1 CN 2020111236 W CN2020111236 W CN 2020111236W WO 2021143139 A1 WO2021143139 A1 WO 2021143139A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data packet
- switch
- user mode
- layer
- bound socket
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/30—Definitions, standards or architectural aspects of layered protocol stacks
Definitions
- the present invention relates to the field of switches, and more specifically, to a method, system, computer equipment and readable medium for improving switch performance.
- Part of the L2 protocol and L3 protocol of the switch need to process the exchange protocol through the OS (system).
- PCIE peripheral component interconnect express, a high-speed serial computer expansion bus standard
- the protocol stack is passed up to the protocol processing logic through the processing of the protocol stack.
- the protocol stack is a necessary channel for the exchange protocol processing. Therefore, the TCP/IP protocol stack seriously affects the processing performance of the switch, and the current protocol stack has a bottleneck.
- the purpose of the embodiments of the present invention is to provide a method, system, computer equipment, and computer-readable storage medium for improving switch performance.
- an aspect of the embodiments of the present invention provides a method for improving the performance of a switch, including the following steps: in response to receiving a data packet, adjusting the protocol stack of the switch to a user mode; and in response to the completion of the user mode loading , Based on the number of CPU cores, start a different number of threads; determine the bound socket in the listening state in the thread, and establish a connection with the data packet based on the bound socket; and based on all The binding socket adds an additional hash layer to the basic hash layer, and processes the data packet based on the double-layer hash layer.
- the adjusting the protocol stack of the switch to the user mode includes: converting the configuration file of the protocol stack into a format suitable for the user mode.
- the determining the bound socket in the listening state in the thread includes: sending a reset signal, and determining the bound socket in a hash table.
- the determining the bound socket in the listening state in the thread includes: iterating the target port in the hash table to determine the matching bound socket.
- the processing the data packet based on the double-layer hash layer includes: determining the type of the data packet, and adopting a corresponding response based on the type.
- a system for improving the performance of a switch including: an adjustment module configured to adjust the protocol stack of the switch to a user mode in response to receiving a data packet; a thread module for configuration In response to the completion of the user mode loading, a different number of threads are started based on the number of CPU cores; the connection module is configured to determine the binding socket in the listening state in the thread, and based on the binding The socket establishes a connection with the data packet; and a hash module, configured to add an additional hash layer to the basic hash layer based on the bound socket, and to compare the data based on the double-layer hash layer The package is processed.
- the adjusting the protocol stack of the switch to the user mode includes: converting the configuration file of the protocol stack into a format suitable for the user mode.
- the determining the bound socket in the listening state in the thread includes: sending a reset signal, and determining the bound socket in a hash table.
- a computer device including: at least one processor; and a memory.
- the memory stores computer instructions that can run on the processor, and the instructions are executed by the processor.
- the processor implements the steps of the above method when executed.
- a computer-readable storage medium stores a computer program that implements the steps of the above method when executed by a processor.
- the invention has the following beneficial technical effects: by adjusting the protocol stack to the user mode and adding an additional hash layer, the switch performance is effectively improved.
- Figure 1 is a schematic diagram of an embodiment of a method for improving switch performance provided by the present invention
- Figure 2 is a schematic diagram of the hardware structure of an embodiment of the method for improving switch performance provided by the present invention.
- the first aspect of the embodiments of the present invention proposes an embodiment of a method for improving the performance of a switch.
- Figure 1 shows a schematic diagram of an embodiment of a method for improving switch performance provided by the present invention. As shown in Figure 1, the embodiment of the present invention includes the following steps:
- kernel bypass has attracted more and more attention.
- the main idea of kernel bypass is that Linux is only used to process control flow, and all data flows are processed in user space. Therefore, kernel bypass can avoid performance bottlenecks caused by kernel packet duplication, thread scheduling, system calls and interrupts. In addition, kernel bypass can achieve higher performance through a variety of optimization methods.
- TCP/IP Transmission Control Protocol/Internet Protocol, Transmission Control Protocol/Internet Protocol
- TCP/IP Transmission Control Protocol/Internet Protocol
- the TCP/IP protocol not only refers to the two protocols of TCP and IP, but refers to a protocol cluster composed of FTP, SMTP, TCP, UDP, IP and other protocols, just because the TCP protocol and the IP protocol in the TCP/IP protocol The most representative, so it is called the TCP/IP protocol.
- the protocol stack of the switch In response to receiving the data packet, the protocol stack of the switch is adjusted to the user mode.
- the TCP/IP protocol stack in the switch system can be modified, and the protocol stack can be adjusted from the kernel mode to the user mode.
- the adjusting the protocol stack of the switch to the user mode includes: converting the configuration file of the protocol stack into a format suitable for the user mode. For example, the configuration file of the protocol stack can be converted to ko.
- the determining the bound socket in the listening state in the thread includes: sending a reset signal, and determining the bound socket in a hash table. In some embodiments, the determining the bound socket in the listening state in the thread includes: iterating the target port in the hash table to determine the matching bound socket.
- the bound socket in the listening state is determined. If no bound socket in the listening state is found, a reset signal, such as RST, can be sent, and then the bound socket is found in the hash table. This can be achieved by using the target port as a hash, selecting an appropriate channel in the hash table, and then linearly iterating to determine the matching bound socket.
- a reset signal such as RST
- An additional hash layer is added to the basic hash layer based on the bound socket, and data packets are processed based on the double-layer hash layer.
- the processing the data packet based on the double-layer hash layer includes: determining the type of the data packet, and adopting a corresponding response based on the type. If the data packet is a SYN and a bound socket in the monitoring state exists, a SYN+ACK response can be used.
- a second aspect of the embodiments of the present invention proposes a system for improving switch performance, including: an adjustment module configured to adjust the protocol stack of the switch to a user mode in response to receiving a data packet; thread The module is configured to start a different number of threads based on the number of CPU cores in response to the completion of the user mode loading; the connection module is configured to determine the bound socket in the listening state in the thread, and based on The binding socket establishes a connection with the data packet; and a hash module configured to add an additional hash layer to the basic hash layer based on the binding socket, and based on the double-layer hash layer Process the data packet.
- the adjusting the protocol stack of the switch to the user mode includes: converting the configuration file of the protocol stack into a format suitable for the user mode.
- the determining the bound socket in the listening state in the thread includes: sending a reset signal, and determining the bound socket in a hash table.
- the determining the bound socket in the listening state in the thread includes: iterating the target port in the hash table to determine the matching bound socket.
- the processing the data packet based on the double-layer hash layer includes: determining the type of the data packet, and adopting a corresponding response based on the type.
- the third aspect of the embodiments of the present invention proposes a computer device, including: at least one processor; and a memory.
- the memory stores computer instructions that can run on the processor, and the instructions are executed by the processor.
- the following steps are implemented: S1, in response to receiving the data packet, adjust the protocol stack of the switch to the user mode; S2, in response to the completion of the user mode loading, start a different number of threads based on the number of CPU cores; S3, determine in the thread The binding socket in the listening state, and the connection with the data packet is established based on the binding socket; and S4, an additional hash layer is added to the basic hash layer based on the binding socket, and based on the double-layer hash The layer processes the data packet.
- the adjusting the protocol stack of the switch to the user mode includes: converting the configuration file of the protocol stack into a format suitable for the user mode.
- the determining the bound socket in the listening state in the thread includes: sending a reset signal, and determining the bound socket in a hash table.
- the determining the bound socket in the listening state in the thread includes: iterating the target port in the hash table to determine the matching bound socket.
- the processing the data packet based on the double-layer hash layer includes: determining the type of the data packet, and adopting a corresponding response based on the type.
- FIG. 2 it is a schematic diagram of the hardware structure of an embodiment of the above method for improving the performance of a switch provided by the present invention.
- the device includes a processor 301 and a memory 302, and may also include an input device 303 and an output device 304.
- the processor 301, the memory 302, the input device 303, and the output device 304 may be connected by a bus or in other ways. In FIG. 2, the connection by a bus is taken as an example.
- the memory 302 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, as corresponding to the method for improving switch performance in the embodiments of the present application Program instructions/modules.
- the processor 301 executes various functional applications and data processing of the server by running non-volatile software programs, instructions, and modules stored in the memory 302, that is, implements the method for improving the performance of the switch in the foregoing method embodiment.
- the memory 302 may include a storage program area and a storage data area.
- the storage program area may store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of methods for improving switch performance.
- the memory 302 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
- the memory 302 may optionally include a memory remotely provided with respect to the processor 301, and these remote memories may be connected to a local module through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
- the input device 303 can receive the input user name and password and other information.
- the output device 304 may include a display device such as a display screen.
- the program instructions/modules corresponding to one or more methods for improving switch performance are stored in the memory 302, and when executed by the processor 301, the method for improving switch performance in any of the foregoing method embodiments is executed.
- Any embodiment of the computer device that executes the foregoing method for improving the performance of a switch can achieve the same or similar effects as any of the foregoing corresponding method embodiments.
- the present invention also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program that executes the above method when executed by a processor.
- the method disclosed according to the embodiment of the present invention may also be implemented as a computer program executed by a processor, and the computer program may be stored in a computer-readable storage medium.
- the computer program executes the above-mentioned functions defined in the method disclosed in the embodiment of the present invention.
- the above method steps and system units can also be implemented by a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.
- non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory Memory.
- Volatile memory can include random access memory (RAM), which can act as external cache memory.
- RAM can be obtained in many forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchronous link DRAM (SLDRAM) and direct Rambus RAM (DRRAM).
- DRAM synchronous RAM
- DRAM dynamic RAM
- SDRAM synchronous DRAM
- DDR SDRAM double data rate SDRAM
- ESDRAM enhanced SDRAM
- SLDRAM Synchronous link DRAM
- DRRAM direct Rambus RAM
- the storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
- DSP digital signal processors
- ASIC application-specific integrated circuits
- FPGA Field Programmable Gate Array
- a general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine.
- the processor may also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in combination with a DSP, and/or any other such configuration.
- the steps of the method or algorithm described in combination with the disclosure herein may be directly included in hardware, a software module executed by a processor, or a combination of the two.
- the software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
- An exemplary storage medium is coupled to the processor such that the processor can read information from or write information to the storage medium.
- the storage medium may be integrated with the processor.
- the processor and the storage medium may reside in the ASIC.
- the ASIC can reside in the user terminal.
- the processor and the storage medium may reside as discrete components in the user terminal.
- functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted through the computer-readable medium.
- Computer-readable media include computer storage media and communication media, including any media that facilitates the transfer of a computer program from one location to another location.
- a storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
- the computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, or may be used for carrying or storing instructions in the form of Or any other medium that can be accessed by a general-purpose or special-purpose computer or general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium.
- coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave to send software from a website, server, or other remote source
- coaxial cable Cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media.
- magnetic disks and optical disks include compact disks (CDs), laser disks, optical disks, digital versatile disks (DVD), floppy disks, and Blu-ray disks. Disks usually reproduce data magnetically, while optical disks use lasers to optically reproduce data. . Combinations of the above content should also be included in the scope of computer-readable media.
- the program can be stored in a computer-readable storage medium.
- the storage medium can be a read-only memory, a magnetic disk or an optical disk, etc.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明公开了一种提高交换机性能的方法、系统、设备和存储介质,方法包括以下步骤:响应于接收到数据包,将交换机的协议栈调整为用户态;响应于用户态加载完成,基于CPU核心的数量,启动不同数量的线程;在线程中确定处于监听状态的绑定套接字,并基于绑定套接字建立与数据包的连接;以及基于绑定套接字在基础哈希层增加附加哈希层,并基于双层哈希层对数据包进行处理。本发明提出的提高交换机性能的方法、系统、设备及介质通过将协议栈调整为用户态,并且增加附加哈希层,有效提高了交换机性能。
Description
本申请要求于2020年1月19日提交中国国家知识产权局,申请号为202010060869.0,发明名称为“一种提高交换机性能的方法、系统、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及交换机领域,更具体地,特别是指一种提高交换机性能的方法、系统、计算机设备及可读介质。
随着网络带宽的逐渐增加,使用Linux内核处理数据包的性能下降,并且没有特别好的处理方法。目前硬件越来越廉价,但是当前Linux内核的TCP/IP协议处理能力并没有随着硬件性能提高成线性增长。内核协议栈PPS性能曲线呈现严重上凸,并且内核协议栈的CPS(TCP每秒新建连接数)随着CPU核数的增加几乎没有什么变化。
交换机的部分L2协议和L3协议需要通过OS(系统)处理交换协议,数据包自交换芯片通过PCIE(peripheral component interconnect express,一种高速串行计算机扩展总线标准)传输到OS后,首先经过OS层协议栈,通过协议栈的处理,向上交给协议处理逻辑,协议栈是交换协议处理必经通道,因此TCP/IP协议栈严重影响交换机的处理性能,当前的协议栈存在瓶颈。
发明内容
有鉴于此,本发明实施例的目的在于提出一种提高交换机性能的方法、系统、计算机设备及计算机可读存储介质,通过将协议栈调整为用户态,并且增加附加哈希层,有效提高了交换机性能。
基于上述目的,本发明实施例的一方面提供了一种提高交换机性能的方法,包括如下步骤:响应于接收到数据包,将交换机的协议栈调整为用户态;响应于所述用户态加载完成,基于CPU核心的数量,启动不同数量的线程;在所述线程中确定处于监听状态的绑定套接字,并基于所述绑定套接字建立与所述数据包的连接;以及基于所述绑定套接字在基础哈希层增加附加哈希层,并基于双层哈希层对所述数据包进行处理。
在一些实施方式中,所述将交换机的协议栈调整为用户态包括:将所述协议栈的配置文件转换成适合用户态的格式。
在一些实施方式中,所述在所述线程中确定处于监听状态的绑定套接字包括:发送复位信号,并在哈希表中确定所述绑定套接字。
在一些实施方式中,所述在所述线程中确定处于监听状态的绑定套接字包括:对哈希表中的目标端口进行迭代以确定匹配的绑定套接字。
在一些实施方式中,所述基于双层哈希层对所述数据包进行处理包括:确定所述数据包的类型,并基于所述类型采用相应的响应。
本发明实施例的另一方面,还提供了一种提高交换机性能的系统,包括:调整模块,配置用于响应于接收到数据包,将交换机的协议栈调整为用户态;线程模块,配置用于响应于所述用户态加载完成,基于CPU核心的数量,启动不同数量的线程;连接模块,配置用于在所述线程中确定处 于监听状态的绑定套接字,并基于所述绑定套接字建立与所述数据包的连接;以及哈希模块,配置用于基于所述绑定套接字在基础哈希层增加附加哈希层,并基于双层哈希层对所述数据包进行处理。
在一些实施方式中,所述将交换机的协议栈调整为用户态包括:将所述协议栈的配置文件转换成适合用户态的格式。
在一些实施方式中,所述在所述线程中确定处于监听状态的绑定套接字包括:发送复位信号,并在哈希表中确定所述绑定套接字。
本发明实施例的又一方面,还提供了一种计算机设备,包括:至少一个处理器;以及存储器,所述存储器存储有可在所述处理器上运行的计算机指令,所述指令由所述处理器执行时实现如上方法的步骤。
本发明实施例的再一方面,还提供了一种计算机可读存储介质,计算机可读存储介质存储有被处理器执行时实现如上方法步骤的计算机程序。
本发明具有以下有益技术效果:通过将协议栈调整为用户态,并且增加附加哈希层,有效提高了交换机性能。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。
图1为本发明提供的提高交换机性能的方法的实施例的示意图;
图2为本发明提供的提高交换机性能的方法的实施例的硬件结构示意图。
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。
需要说明的是,本发明实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”“第二”仅为了表述的方便,不应理解为对本发明实施例的限定,后续实施例对此不再一一说明。
基于上述目的,本发明实施例的第一个方面,提出了一种提高交换机性能的方法的实施例。图1示出的是本发明提供的提高交换机性能的方法的实施例的示意图。如图1所示,本发明实施例包括如下步骤:
S1、响应于接收到数据包,将交换机的协议栈调整为用户态;
S2、响应于用户态加载完成,基于CPU核心的数量,启动不同数量的线程;
S3、在线程中确定处于监听状态的绑定套接字,并基于绑定套接字建立与数据包的连接;以及
S4、基于绑定套接字在基础哈希层增加附加哈希层,并基于双层哈希层对数据包进行处理。
Internet的飞速发展需要高性能的网络处理能力,内核旁路引起了越来越多的关注。内核旁路的主要思想是Linux仅用于处理控制流,所有数据 流都在用户空间中处理。因此,内核旁路可以避免由于内核数据包复制,线程调度,系统调用和中断而导致的性能瓶颈。此外,内核旁路可以通过多种优化方法获得更高的性能。TCP/IP(Transmission Control Protocol/Internet Protocol,传输控制协议/网际协议)是指能够在多个不同网络间实现信息传输的协议簇。TCP/IP协议不仅仅指的是TCP和IP两个协议,而是指一个由FTP、SMTP、TCP、UDP、IP等协议构成的协议簇,只是因为在TCP/IP协议中TCP协议和IP协议最具代表性,所以被称为TCP/IP协议。
响应于接收到数据包,将交换机的协议栈调整为用户态。在接收到数据包后,可以修改交换机系统中的TCP/IP协议栈,可以将协议栈自内核态调整为用户态。在一些实施方式中,所述将交换机的协议栈调整为用户态包括:将所述协议栈的配置文件转换成适合用户态的格式。例如,可以将协议栈的配置文件转换成ko。
响应于用户态加载完成,基于CPU核心的数量,启动不同数量的线程。用户态加载完成后,根据CPU的核心数量,启动不同的线程,保证协议的处理能力。
在线程中确定处于监听状态的绑定套接字,并基于绑定套接字建立与数据包的连接。在一些实施方式中,所述在所述线程中确定处于监听状态的绑定套接字包括:发送复位信号,并在哈希表中确定所述绑定套接字。在一些实施方式中,所述在所述线程中确定处于监听状态的绑定套接字包括:对哈希表中的目标端口进行迭代以确定匹配的绑定套接字。
在协议处理时会确定处于监听状态的绑定套接字,如果没有找到处于 监听状态的绑定套接字,可以发送复位信号,例如RST,然后在哈希表中找到绑定套接字。可以通过将目标端口用作哈希来实现,并在哈希表中选择一个适当的通道,然后线性地进行迭代以确定匹配的绑定套接字。
基于绑定套接字在基础哈希层增加附加哈希层,并基于双层哈希层对数据包进行处理。在一些实施方式中,所述基于双层哈希层对所述数据包进行处理包括:确定所述数据包的类型,并基于所述类型采用相应的响应。如果数据包是SYN并且监听状态的绑定套接字存在,可以采用SYN+ACK响应。
需要特别指出的是,上述提高交换机性能的方法的各个实施例中的各个步骤均可以相互交叉、替换、增加、删减,因此,这些合理的排列组合变换之于提高交换机性能的方法也应当属于本发明的保护范围,并且不应将本发明的保护范围局限在实施例之上。
基于上述目的,本发明实施例的第二个方面,提出了一种提高交换机性能的系统,包括:调整模块,配置用于响应于接收到数据包,将交换机的协议栈调整为用户态;线程模块,配置用于响应于所述用户态加载完成,基于CPU核心的数量,启动不同数量的线程;连接模块,配置用于在所述线程中确定处于监听状态的绑定套接字,并基于所述绑定套接字建立与所述数据包的连接;以及哈希模块,配置用于基于所述绑定套接字在基础哈希层增加附加哈希层,并基于双层哈希层对所述数据包进行处理。
在一些实施方式中,所述将交换机的协议栈调整为用户态包括:将所述协议栈的配置文件转换成适合用户态的格式。
在一些实施方式中,所述在所述线程中确定处于监听状态的绑定套接 字包括:发送复位信号,并在哈希表中确定所述绑定套接字。
在一些实施方式中,所述在所述线程中确定处于监听状态的绑定套接字包括:对哈希表中的目标端口进行迭代以确定匹配的绑定套接字。
在一些实施方式中,所述基于双层哈希层对所述数据包进行处理包括:确定所述数据包的类型,并基于所述类型采用相应的响应。
基于上述目的,本发明实施例的第三个方面,提出了一种计算机设备,包括:至少一个处理器;以及存储器,存储器存储有可在处理器上运行的计算机指令,指令由处理器执行以实现如下步骤:S1、响应于接收到数据包,将交换机的协议栈调整为用户态;S2、响应于用户态加载完成,基于CPU核心的数量,启动不同数量的线程;S3、在线程中确定处于监听状态的绑定套接字,并基于绑定套接字建立与数据包的连接;以及S4、基于绑定套接字在基础哈希层增加附加哈希层,并基于双层哈希层对数据包进行处理。
在一些实施方式中,所述将交换机的协议栈调整为用户态包括:将所述协议栈的配置文件转换成适合用户态的格式。
在一些实施方式中,所述在所述线程中确定处于监听状态的绑定套接字包括:发送复位信号,并在哈希表中确定所述绑定套接字。
在一些实施方式中,所述在所述线程中确定处于监听状态的绑定套接字包括:对哈希表中的目标端口进行迭代以确定匹配的绑定套接字。
在一些实施方式中,所述基于双层哈希层对所述数据包进行处理包括:确定所述数据包的类型,并基于所述类型采用相应的响应。
如图2所示,为本发明提供的上述提高交换机性能的方法的一个实施例的硬件结构示意图。
以如图2所示的装置为例,在该装置中包括一个处理器301以及一个存储器302,并还可以包括:输入装置303和输出装置304。
处理器301、存储器302、输入装置303和输出装置304可以通过总线或者其他方式连接,图2中以通过总线连接为例。
存储器302作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施例中的提高交换机性能的方法对应的程序指令/模块。处理器301通过运行存储在存储器302中的非易失性软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例的提高交换机性能的方法。
存储器302可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据提高交换机性能的方法的使用所创建的数据等。此外,存储器302可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器302可选包括相对于处理器301远程设置的存储器,这些远程存储器可以通过网络连接至本地模块。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置303可接收输入的用户名和密码等信息。输出装置304可包括显示屏等显示设备。
一个或者多个提高交换机性能的方法对应的程序指令/模块存储在存储器302中,当被处理器301执行时,执行上述任意方法实施例中的提高交换机性能的方法。
执行上述提高交换机性能的方法的计算机设备的任何一个实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。
本发明还提供了一种计算机可读存储介质,计算机可读存储介质存储有被处理器执行时执行如上方法的计算机程序。
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,提高交换机性能的方法的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,程序的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。上述计算机程序的实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。
此外,根据本发明实施例公开的方法还可以被实现为由处理器执行的计算机程序,该计算机程序可以存储在计算机可读存储介质中。在该计算机程序被处理器执行时,执行本发明实施例公开的方法中限定的上述功能。
此外,上述方法步骤以及系统单元也可以利用控制器以及用于存储使得控制器实现上述步骤或单元功能的计算机程序的计算机可读存储介质实现。
此外,应该明白的是,本文的计算机可读存储介质(例如,存储器)可以是易失性存储器或非易失性存储器,或者可以包括易失性存储器和非 易失性存储器两者。作为例子而非限制性的,非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦写可编程ROM(EEPROM)或快闪存储器。易失性存储器可以包括随机存取存储器(RAM),该RAM可以充当外部高速缓存存储器。作为例子而非限制性的,RAM可以以多种形式获得,比如同步RAM(DRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据速率SDRAM(DDR SDRAM)、增强SDRAM(ESDRAM)、同步链路DRAM(SLDRAM)、以及直接Rambus RAM(DRRAM)。所公开的方面的存储设备意在包括但不限于这些和其它合适类型的存储器。
本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本发明实施例公开的范围。
结合这里的公开所描述的各种示例性逻辑块、模块和电路可以利用被设计成用于执行这里功能的下列部件来实现或执行:通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或其它可编程逻辑器件、分立门或晶体管逻辑、分立的硬件组件或者这些部件的任何组合。通用处理器可以是微处理器,但是可替换地,处理器可 以是任何传统处理器、控制器、微控制器或状态机。处理器也可以被实现为计算设备的组合,例如,DSP和微处理器的组合、多个微处理器、一个或多个微处理器结合DSP和/或任何其它这种配置。
结合这里的公开所描述的方法或算法的步骤可以直接包含在硬件中、由处理器执行的软件模块中或这两者的组合中。软件模块可以驻留在RAM存储器、快闪存储器、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、可移动盘、CD-ROM、或本领域已知的任何其它形式的存储介质中。示例性的存储介质被耦合到处理器,使得处理器能够从该存储介质中读取信息或向该存储介质写入信息。在一个替换方案中,存储介质可以与处理器集成在一起。处理器和存储介质可以驻留在ASIC中。ASIC可以驻留在用户终端中。在一个替换方案中,处理器和存储介质可以作为分立组件驻留在用户终端中。
在一个或多个示例性设计中,功能可以在硬件、软件、固件或其任意组合中实现。如果在软件中实现,则可以将功能作为一个或多个指令或代码存储在计算机可读介质上或通过计算机可读介质来传送。计算机可读介质包括计算机存储介质和通信介质,该通信介质包括有助于将计算机程序从一个位置传送到另一个位置的任何介质。存储介质可以是能够被通用或专用计算机访问的任何可用介质。作为例子而非限制性的,该计算机可读介质可以包括RAM、ROM、EEPROM、CD-ROM或其它光盘存储设备、磁盘存储设备或其它磁性存储设备,或者是可以用于携带或存储形式为指令或数据结构的所需程序代码并且能够被通用或专用计算机或者通用或专用处理器访问的任何其它介质。此外,任何连接都可以适当地称为计算机 可读介质。例如,如果使用同轴线缆、光纤线缆、双绞线、数字用户线路(DSL)或诸如红外线、无线电和微波的无线技术来从网站、服务器或其它远程源发送软件,则上述同轴线缆、光纤线缆、双绞线、DSL或诸如红外线、无线电和微波的无线技术均包括在介质的定义。如这里所使用的,磁盘和光盘包括压缩盘(CD)、激光盘、光盘、数字多功能盘(DVD)、软盘、蓝光盘,其中磁盘通常磁性地再现数据,而光盘利用激光光学地再现数据。上述内容的组合也应当包括在计算机可读介质的范围内。
以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。
上述本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本发明实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。
Claims (10)
- 一种提高交换机性能的方法,其特征在于,包括以下步骤:响应于接收到数据包,将交换机的协议栈调整为用户态;响应于所述用户态加载完成,基于CPU核心的数量,启动不同数量的线程;在所述线程中确定处于监听状态的绑定套接字,并基于所述绑定套接字建立与所述数据包的连接;以及基于所述绑定套接字在基础哈希层增加附加哈希层,并基于双层哈希层对所述数据包进行处理。
- 根据权利要求1所述的方法,其特征在于,所述将交换机的协议栈调整为用户态包括:将所述协议栈的配置文件转换成适合用户态的格式。
- 根据权利要求1所述的方法,其特征在于,所述在所述线程中确定处于监听状态的绑定套接字包括:发送复位信号,并在哈希表中确定所述绑定套接字。
- 根据权利要求1所述的方法,其特征在于,所述在所述线程中确定处于监听状态的绑定套接字包括:对哈希表中的目标端口进行迭代以确定匹配的绑定套接字。
- 根据权利要求1所述的方法,其特征在于,所述基于双层哈希层对所述数据包进行处理包括:确定所述数据包的类型,并基于所述类型采用相应的响应。
- 一种提高交换机性能的系统,其特征在于,包括:调整模块,配置用于响应于接收到数据包,将交换机的协议栈调整为用户态;线程模块,配置用于响应于所述用户态加载完成,基于CPU核心的数量,启动不同数量的线程;连接模块,配置用于在所述线程中确定处于监听状态的绑定套接字,并基于所述绑定套接字建立与所述数据包的连接;以及哈希模块,配置用于基于所述绑定套接字在基础哈希层增加附加哈希层,并基于双层哈希层对所述数据包进行处理。
- 根据权利要求6所述的系统,其特征在于,所述将交换机的协议栈调整为用户态包括:将所述协议栈的配置文件转换成适合用户态的格式。
- 根据权利要求6所述的系统,其特征在于,所述在所述线程中确定处于监听状态的绑定套接字包括:发送复位信号,并在哈希表中确定所述绑定套接字。
- 一种计算机设备,其特征在于,包括:至少一个处理器;以及存储器,所述存储器存储有可在所述处理器上运行的计算机指令,所述指令由所述处理器执行时实现权利要求1-5任意一项所述方法的步骤。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算 机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-5任意一项所述方法的步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010060869.0 | 2020-01-19 | ||
CN202010060869.0A CN111314311A (zh) | 2020-01-19 | 2020-01-19 | 一种提高交换机性能的方法、系统、设备及介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021143139A1 true WO2021143139A1 (zh) | 2021-07-22 |
Family
ID=71146843
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/111236 WO2021143139A1 (zh) | 2020-01-19 | 2020-08-26 | 一种提高交换机性能的方法、系统、设备及介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111314311A (zh) |
WO (1) | WO2021143139A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111314311A (zh) * | 2020-01-19 | 2020-06-19 | 苏州浪潮智能科技有限公司 | 一种提高交换机性能的方法、系统、设备及介质 |
CN115766044A (zh) * | 2021-08-31 | 2023-03-07 | 华为技术有限公司 | 一种基于用户态协议栈的通信方法及相应装置 |
CN117608818B (zh) * | 2023-10-20 | 2024-09-27 | 中科驭数(北京)科技有限公司 | 多线程数据处理方法、装置、设备及介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102143083A (zh) * | 2011-04-02 | 2011-08-03 | 南京邮电大学 | 一种阿瑞斯协议分析系统中双缓存的设计与实现方法 |
CN103533025A (zh) * | 2013-09-18 | 2014-01-22 | 北京航空航天大学 | 一种减少多核系统上tcp连接建立时锁竞争的方法 |
US20190095309A1 (en) * | 2017-09-28 | 2019-03-28 | Konstantin Levit-Gurevich | Techniques for performance analysis of processor instruction execution |
CN109672584A (zh) * | 2018-11-30 | 2019-04-23 | 广州市百果园信息技术有限公司 | 一种数据包检测方法、装置、系统、设备和存储介质 |
CN110096363A (zh) * | 2019-04-29 | 2019-08-06 | 亚信科技(成都)有限公司 | 一种网络事件与进程的关联方法及装置 |
CN111314311A (zh) * | 2020-01-19 | 2020-06-19 | 苏州浪潮智能科技有限公司 | 一种提高交换机性能的方法、系统、设备及介质 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101409715B (zh) * | 2008-10-22 | 2012-04-18 | 中国科学院计算技术研究所 | 一种利用InfiniBand网络进行通信的方法及系统 |
CN103312720B (zh) * | 2013-07-01 | 2016-05-25 | 华为技术有限公司 | 一种数据传输方法、设备及系统 |
US10587434B2 (en) * | 2017-07-14 | 2020-03-10 | Nicira, Inc. | In-band management interface with user space datapath |
CN108289063B (zh) * | 2017-09-11 | 2021-07-27 | 上海金融期货信息技术有限公司 | 一种低延迟通讯系统 |
CN109040207B (zh) * | 2018-07-20 | 2021-06-29 | 广东浪潮大数据研究有限公司 | 一种访问用户态网络文件系统的方法、装置及设备 |
-
2020
- 2020-01-19 CN CN202010060869.0A patent/CN111314311A/zh active Pending
- 2020-08-26 WO PCT/CN2020/111236 patent/WO2021143139A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102143083A (zh) * | 2011-04-02 | 2011-08-03 | 南京邮电大学 | 一种阿瑞斯协议分析系统中双缓存的设计与实现方法 |
CN103533025A (zh) * | 2013-09-18 | 2014-01-22 | 北京航空航天大学 | 一种减少多核系统上tcp连接建立时锁竞争的方法 |
US20190095309A1 (en) * | 2017-09-28 | 2019-03-28 | Konstantin Levit-Gurevich | Techniques for performance analysis of processor instruction execution |
CN109672584A (zh) * | 2018-11-30 | 2019-04-23 | 广州市百果园信息技术有限公司 | 一种数据包检测方法、装置、系统、设备和存储介质 |
CN110096363A (zh) * | 2019-04-29 | 2019-08-06 | 亚信科技(成都)有限公司 | 一种网络事件与进程的关联方法及装置 |
CN111314311A (zh) * | 2020-01-19 | 2020-06-19 | 苏州浪潮智能科技有限公司 | 一种提高交换机性能的方法、系统、设备及介质 |
Also Published As
Publication number | Publication date |
---|---|
CN111314311A (zh) | 2020-06-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021143139A1 (zh) | 一种提高交换机性能的方法、系统、设备及介质 | |
US12067427B2 (en) | Extending Berkeley packet filter semantics for hardware offloads | |
JP4722157B2 (ja) | ネットワークトラフィックのインテリジェントロードバランシング及びフェイルオーバー | |
JP4651692B2 (ja) | ネットワークトラフィックのインテリジェントロードバランシング及びフェイルオーバー | |
EP2854360B1 (en) | Method for connecting a first host and a second host within at least one communication network through a relay module, corresponding relay module. | |
WO2021047515A1 (zh) | 一种服务路由方法及装置 | |
WO2017071442A1 (zh) | 一种负载分担的方法、装置和系统 | |
US8472469B2 (en) | Configurable network socket aggregation to enable segmentation offload | |
US20170033992A1 (en) | METHOD FOR PROCESSING VxLAN DATA UNITS | |
CN110753095B (zh) | 一种网卡的数据处理方法、设备以及存储介质 | |
WO2023005747A1 (zh) | 数据传输方法、装置及分布式存储系统 | |
WO2019169556A1 (zh) | 一种报文发送的方法、装置和存储设备 | |
US20230153264A1 (en) | Data transmission method, chip, and device | |
JP2003333076A (ja) | ネットワークスタックをオフロードする方法 | |
WO2024037296A1 (zh) | 基于协议族的quic数据传输方法及装置 | |
JP2008295041A (ja) | ネットワークトラフィックのインテリジェントロードバランシング及びフェイルオーバー | |
WO2022089175A1 (zh) | 网络拥塞控制方法及装置 | |
US20140226665A1 (en) | Communication apparatus, control method therefor, and computer-readable storage medium | |
CN111211942A (zh) | 一种数据包的收发方法、设备及介质 | |
US11394776B2 (en) | Systems and methods for transport layer processing of server message block protocol messages | |
CN110691094A (zh) | 一种基于iscsi协议传输数据的方法、设备及介质 | |
US20070192433A1 (en) | Storage Area Network port based data transfer acceleration | |
WO2015124015A1 (zh) | 一种数据包转发方法及设备 | |
TW201911942A (zh) | 資料發送、資料重發、資料處理方法與裝置 | |
WO2015055008A1 (zh) | 一种存储控制芯片及磁盘报文传输方法 |
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: 20913321 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20913321 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20913321 Country of ref document: EP Kind code of ref document: A1 |