WO2017156908A1 - 一种报文转发的方法和装置 - Google Patents
一种报文转发的方法和装置 Download PDFInfo
- Publication number
- WO2017156908A1 WO2017156908A1 PCT/CN2016/086739 CN2016086739W WO2017156908A1 WO 2017156908 A1 WO2017156908 A1 WO 2017156908A1 CN 2016086739 W CN2016086739 W CN 2016086739W WO 2017156908 A1 WO2017156908 A1 WO 2017156908A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- packet
- acceleration entry
- hardware acceleration
- forwarding
- entry
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0823—Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/66—Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
Definitions
- the present application relates to, but is not limited to, the field of communications, and in particular, to a method and apparatus for message forwarding.
- gateway products have increased dramatically.
- CPU Central Processing Unit
- the performance of the CPU has been greatly improved, the processing power is still not compared with a large number of packets.
- the packet needs to be modified, such as MAC (Media Access Control) address translation, NAT (Network Address Translation), adding and deleting VLANs of the service type (Virtual Local Area Network, virtual LAN) and the addition and deletion of PPPoE (Point to Point Protocol over Ethernet) headers, which greatly consume CPU resources and increase the burden on the CPU.
- MAC Media Access Control
- NAT Network Address Translation
- PPPoE Point to Point Protocol over Ethernet
- the present application provides a packet forwarding method and apparatus to solve the problem that the related art gateway product cannot meet the user's needs.
- an embodiment of the present invention provides a packet forwarding method, including:
- the second packet that needs to be forwarded is forwarded according to the hardware acceleration entry.
- the step of acquiring the software acceleration entry for modifying the attribute information of the first packet during the process of forwarding the first packet includes:
- the step of configuring the hardware acceleration entry for the second packet that needs to be forwarded according to the first quantity includes:
- a hardware acceleration entry is configured for the second message that needs to be forwarded.
- the first preset threshold is increased.
- the method for forwarding the packet further includes:
- the hardware acceleration entry configured for the second packet is deleted.
- the method for forwarding the packet further includes:
- the hardware acceleration entry configured for the second packet is deleted.
- the method for forwarding the packet further includes:
- the application further provides a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
- an embodiment of the present invention provides a packet forwarding apparatus, including:
- the first obtaining module is configured to obtain a software acceleration entry that is modified to modify the attribute information of the first packet during the process of forwarding the first packet;
- a second acquiring module configured to acquire, according to a first predetermined time after forwarding the first packet, a first quantity of the second packet that needs to be forwarded according to the software acceleration entry;
- Configuring a module configured to configure hardware for the second packet that needs to be forwarded according to the first quantity Accelerate the entry
- the forwarding module is configured to forward the second packet that needs to be forwarded according to the hardware acceleration entry.
- the first obtaining module includes:
- the processing unit is configured to acquire the feature information of the first message recorded and the record of modifying the attribute information of the first message in the process of forwarding the first message, and accelerate the entry according to the software formed by the record.
- the configuration module includes:
- the configuration unit is configured to configure a hardware acceleration entry for the second packet that needs to be forwarded when the first quantity is greater than the first preset threshold.
- the first preset threshold is increased.
- the device for forwarding the packet further includes:
- the first deleting module is configured to delete the hardware acceleration entry configured for the second packet if the second number of the second packet configured with the hardware acceleration entry is less than the first preset threshold in the second predetermined time.
- the device for forwarding the packet further includes:
- the second deletion module is configured to delete the hardware acceleration entry configured for the second packet if the second packet configured with the hardware acceleration entry is no longer received within the second predetermined time.
- the device for forwarding the packet further includes:
- the third deleting module is configured to obtain routing information of the gateway that forwards the first packet and the second packet; when the routing information changes, the software acceleration entry and the hardware acceleration entry are deleted.
- the technical solution of the present application implements software and hardware cooperation, and by extracting the feature information of the packet, configuring the hardware acceleration entry, and modifying and forwarding the message by using the packet processor, the gateway performance can be greatly improved. Upgrades to meet the performance requirements of gateway products while reducing hardware costs.
- FIG. 1 is a schematic flowchart of a method for forwarding a packet according to an embodiment of the present invention
- FIG. 2 is a schematic structural diagram of an apparatus for forwarding a packet according to an embodiment of the present invention
- FIG. 3 is a flowchart of steps of configuring a hardware acceleration entry according to an embodiment of the present invention
- FIG. 4 is a flowchart of a step of querying whether to retain a hardware acceleration entry according to an embodiment of the present invention.
- the embodiment of the present invention provides a packet forwarding method.
- the PP Packet Processor
- the PP is dynamically configured, and the PP is used to modify and forward the packet, so that the gateway performance can be greatly improved.
- PP can support IPv4 (Internet Protocol Version 4, Internet Protocol Version 4), IPv6 (Internet Protocol Version 6), PPPoE packet identification, and source IP address, source port, destination IP address, destination port, and transport layer protocol. Matching; support for modifying MAC address, NAT translation, VLAN addition and deletion, and addition and deletion of PPPoE headers; support for matching the number of statistics packets for software query.
- IPv4 Internet Protocol Version 4, Internet Protocol Version 4
- IPv6 Internet Protocol Version 6
- PPPoE packet identification and source IP address, source port, destination IP address, destination port, and transport layer protocol. Matching; support for modifying MAC address, NAT translation, VLAN addition and deletion, and addition and deletion of PPPoE headers; support for matching the number of statistics packets for software query.
- FIG. 1 is a schematic flowchart of a method for forwarding a packet according to an embodiment of the present invention.
- the method for forwarding a packet according to an embodiment of the present invention includes:
- Step 101 Acquire a software acceleration entry that is modified to modify attribute information of the first packet during the process of forwarding the first packet.
- the attribute of the first message recorded during the process of forwarding the first message by the CPU is obtained.
- a software acceleration entry for information modification According to the obtained software acceleration entry, for the message with the same attribute, that is, the message conforming to the software acceleration entry, the software acceleration entry may be matched and forwarded.
- Step 102 Acquire a first quantity of the second packet that needs to be forwarded according to the software acceleration entry within a first predetermined time after forwarding the first packet.
- the first predetermined time may be set according to the actual user scenario, for example, 1 second, that is, the first number of the second packet that needs to be forwarded according to the software acceleration entry acquired within 1 second after forwarding the first packet. That is, the packet traffic of the second packet that meets the software acceleration entry is obtained.
- the step 102 includes: after forwarding the first packet, acquiring the number of packets of the second packet that needs to be forwarded according to the software acceleration entry in a unit time.
- Step 103 Configure a hardware acceleration entry for the second packet that needs to be forwarded according to the first quantity.
- a hardware acceleration entry set to PP forwarding is configured for the second message that needs to be forwarded.
- the configuration of the hardware acceleration entry can be configured according to the record of the software acceleration entry.
- Step 104 Forward the second packet that needs to be forwarded according to the hardware acceleration entry.
- the second packet that needs to be forwarded is forwarded by the PP.
- step 101 the step of acquiring the software acceleration entry for modifying the attribute information of the first packet during the process of forwarding the first packet includes:
- the feature information of the packet is recorded in the ingress direction, and the record of modifying the attribute information of the first packet after the first packet is processed through the protocol stack is recorded in the egress. And then based on these records form a software acceleration entry for the first message.
- the attribute information includes, but is not limited to, a MAC address, a NAT, a VLAN, and a PPPoE.
- the feature information includes a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol.
- step 103 the step of configuring a hardware acceleration entry for the second packet that needs to be forwarded according to the first quantity includes:
- a hardware acceleration entry is configured for the second message that needs to be forwarded.
- the working principle of the PP is based on packet matching to complete the modification and forwarding, and the number of hardware acceleration entries is closely related to the capacity of the PP, the capacity of the PP is limited. Therefore, when the packet traffic (the number of packets) is large enough, Configure hardware acceleration entries for packets and then use PP acceleration. In this way, low-traffic packets can be used for CPU forwarding without taking up too much CPU resources to ensure gateway performance. At the same time, hardware acceleration entries can be saved.
- the first preset threshold can be configured according to actual needs to adapt to different scenarios.
- the hardware acceleration entry is configured for the second packet that needs to be forwarded, and the PP acceleration is enabled; otherwise, the second packet is enabled.
- the first predetermined time is 1 second
- the first preset threshold is 40.
- the second packet to be forwarded has a packet traffic of 50 (unit: bar/second) within 1 second, it is required.
- the second packet to be forwarded is configured with a hardware acceleration entry.
- the second packet to be forwarded has a packet traffic of 30 (unit: bar/second), the second packet continues to be forwarded by the CPU.
- the steps of configuring a hardware acceleration entry include:
- step 301 it is determined whether there is a matching software acceleration entry.
- a message that needs to be forwarded has a matching software acceleration entry; if there is a matching software acceleration entry, step 302 is performed, and if there is no matching software acceleration entry, proceed to step 303.
- step 302 a software acceleration entry is formed.
- the feature information of the message is extracted, and the modification of the attribute information of the message through the series of processing of the protocol stack is recorded to form a software acceleration entry.
- Step 303 Determine whether the packet traffic reaches a hardware acceleration threshold of the configured hardware acceleration amount entry.
- the software acceleration entry that matches the packet is determined, whether the matched packet traffic (the first number) in the unit time reaches the hardware acceleration threshold (the first preset threshold) of the configured hardware acceleration entry; if the hardware acceleration threshold is reached Then, proceed to step 304. If the hardware acceleration threshold is not reached, proceed to step 305.
- Step 304 configuring a hardware acceleration entry.
- step 305 the packet is forwarded.
- the packet is forwarded, and the hardware accelerated entry is matched and forwarded on the PP starting from the next packet with the same attribute as the packet.
- the first preset threshold is increased and adjusted.
- the CPU utilization can be obtained, and when the CPU utilization exceeds a preset value, the first preset threshold is increased.
- the method for forwarding the packet further includes:
- the hardware acceleration entry configured for the second packet is deleted.
- the step includes deleting the hardware acceleration entry configured for the second packet if the second number of the second packet matching the hardware acceleration entry is less than the first preset threshold in the unit time.
- the steps to query whether to retain the hardware acceleration entry are as follows:
- Step 401 starting timing
- Step 402 stopping timing
- Step 403 Acquire the number of hits of the hardware acceleration entry in the timeout period; here, obtain the number of hits of the hardware acceleration entry of the PP feedback, that is, the number of the packets matching the hardware acceleration entry.
- step 404 the chip load is acquired, and the hardware acceleration threshold is dynamically adjusted.
- the chip load (the load value of the CPU) is acquired, and the hardware acceleration threshold (the first preset threshold) is dynamically adjusted according to the chip load.
- Step 405 Determine whether the hardware acceleration threshold is less than the hardware acceleration threshold in the unit time; here, calculate the packet traffic (the second number) of the hardware acceleration entry that matches the unit time, and determine whether the packet traffic is lower than the hardware acceleration threshold, if less than the hardware Accelerating the threshold, proceeding to step 406, if greater than or equal to the hardware acceleration threshold, then returning to step 401;
- step 406 the hardware acceleration entry is deleted.
- the method for forwarding the packet further includes:
- the hardware acceleration entry configured for the second packet is deleted.
- the load value (CPU utilization) of the CPU that forwards the packet without the hardware acceleration entry is less than or equal to the preset value
- the second packet matching the hardware acceleration entry is no longer received within the second predetermined time, That is, if the number of packets matching the second packet of the hardware acceleration entry is 0, the hardware acceleration entry configured for the second packet is deleted.
- the second predetermined time may be set according to the actual user scenario, for example, 1 second, when the packet traffic of the second packet matching the hardware acceleration entry in 1 second is 0 (unit: bar/second), the deletion is Hardware acceleration entry configured for the second message.
- the method for forwarding the packet further includes:
- the routing information of the gateway that forwards the first packet and the second packet is changed, if the hardware acceleration entry and the software acceleration entry are not deleted, the same message as the first packet and the second packet is still forwarded from the PP or the CPU.
- the text forms an exception message. Therefore, when the routing information of the gateway changes, the software acceleration entry and the hardware acceleration entry are deleted.
- the packet forwarding method provided by the embodiment of the present invention implements the cooperation between the software and the hardware. By extracting the feature information of the packet, configuring the hardware acceleration entry, and using the PP to modify and forward the packet, the gateway performance can be greatly improved and can be satisfied. The performance requirements of the gateway product while reducing hardware costs.
- Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
- Embodiments of the present invention also provide an apparatus for implementing the method.
- FIG. 2 is a schematic structural diagram of a device for forwarding a packet according to an embodiment of the present invention.
- the device for forwarding a packet according to the embodiment of the present invention includes: a first acquiring module 210, a second acquiring module 220, and a configuration. Module 230 and forwarding module 240.
- the first obtaining module 210 is configured to acquire, in the process of forwarding the first packet, the recorded pair a software acceleration entry for modifying the attribute information of a message;
- the second obtaining module 220 is configured to acquire, according to a first predetermined time after forwarding the first packet, a first quantity of the second packet that needs to be forwarded according to the software acceleration entry;
- the configuration module 230 is configured to configure, according to the first quantity, a hardware acceleration entry for the second packet that needs to be forwarded;
- the forwarding module 240 is configured to forward the second packet that needs to be forwarded according to the hardware acceleration entry.
- the first obtaining module 210 includes: a processing unit,
- the processing unit is configured to acquire, during the process of forwarding the first message, the feature information of the first message recorded and the record of modifying the attribute information of the first message, and the software acceleration entry formed according to the record.
- the configuration module 230 includes: a configuration unit,
- the configuration unit is configured to configure a hardware acceleration entry for the second packet that needs to be forwarded when the first quantity is greater than the first preset threshold.
- the first preset threshold is increased.
- the device for forwarding the packet further includes: a first deleting module,
- the first deleting module is configured to delete the hardware acceleration entry configured for the second packet if the second number of the second packet configured with the hardware acceleration entry is less than the first preset threshold in the second predetermined time.
- the device for forwarding the packet further includes: a second deletion module,
- the second deletion module is configured to delete the hardware acceleration entry configured for the second packet if the second number of the second packet configured with the hardware acceleration entry is no longer received within the second predetermined time.
- the device for forwarding the packet further includes: a third deletion module,
- the third deleting module is configured to obtain routing information of a gateway that forwards the first packet and the second packet; when the routing information changes, the software acceleration entry and the hardware acceleration entry are deleted.
- the device for forwarding a packet according to the embodiment of the present invention is the same as the method for forwarding a packet according to the embodiment of the present invention.
- the apparatus for forwarding a packet implements software and hardware cooperation, and extracts the feature information of the packet, configures the hardware acceleration entry, and uses the PP to modify and forward the packet, so that the gateway performance can be greatly improved and can be satisfied.
- the performance requirements of the gateway product while reducing hardware costs.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present application, or the part contributing to the related art, or the part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including several The instructions are for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
- the instructions are related to hardware (eg, a processor) that can be stored in a computer readable storage medium, such as a read only memory, a magnetic disk, or an optical disk.
- a computer readable storage medium such as a read only memory, a magnetic disk, or an optical disk.
- all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits.
- each module/unit in the above embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program stored in the memory by a processor. / instruction to achieve its corresponding function.
- Embodiments of the invention are not limited to any specific form of combination of hardware and software.
- a packet forwarding method which implements software and hardware cooperation. By extracting the feature information of the packet, configuring the hardware acceleration entry, and using the PP to modify and forward the packet, the gateway performance can be greatly improved, and the gateway product can be satisfied. Performance requirements while reducing hardware costs.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
公开了一种报文转发的方法和装置,其中,所述方法包括:获取在转发第一报文的过程中,记录的对第一报文的属性信息进行修改的软件加速条目;在转发第一报文之后的第一预定时间内,获取符合软件加速条目的需要进行转发的第二报文的第一数量;根据第一数量,为需要进行转发的第二报文配置硬件加速条目;根据硬件加速条目,对需要进行转发的第二报文进行转发。所述方法和装置实现了软件和硬件协作,通过提取报文的特征信息,配置硬件加速条目,使用报文处理器修改及转发报文,使网关性能可以得到大幅提升,能够满足网关产品的性能要求,同时降低了硬件成本。
Description
本申请涉及但不限于通信领域,特别是一种报文转发的方法和装置。
网关产品的数据负荷急剧增加。在处理网络报文时,很多都是经过协议栈软件处理,虽然目前CPU(Central Processing Unit,中央处理器)的性能已经得到很大的提升,但是相对于大量的报文而言处理能力还是不充足;另外,报文还需要进行修改,如MAC(Media Access Control,硬件地址)地址转换,NAT(Network Address Translation,网络地址转换),增加和删除业务服务类型的VLAN(Virtual Local Area Network,虚拟局域网)以及增加和删除PPPoE(Point to Point Protocol over Ethernet,以太网上的点对点协议)头等,这极大地消耗CPU资源,更是加剧CPU的负担。可以看出,相关技术的网关产品的数据性能远远不能满足需求。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本申请提供一种报文转发的方法和装置,以解决相关技术的网关产品不能满足用户需求的问题。
第一方面,本发明的实施例提供一种报文转发的方法,包括:
获取在转发第一报文的过程中,记录的对第一报文的属性信息进行修改的软件加速条目;
在转发第一报文之后的第一预定时间内,获取符合软件加速条目的需要进行转发的第二报文的第一数量;
根据第一数量,为需要进行转发的第二报文配置硬件加速条目;
根据硬件加速条目,对需要进行转发的第二报文进行转发。
可选地,获取在转发第一报文的过程中,记录的对第一报文的属性信息进行修改的软件加速条目的步骤包括:
获取在转发第一报文的过程中,记录的第一报文的特征信息以及对第一报文的属性信息进行修改的记录,并依据记录形成的软件加速条目。
可选地,根据第一数量,为需要进行转发的第二报文配置硬件加速条目的步骤包括:
当第一数量大于第一预设阈值,为需要进行转发的第二报文配置硬件加速条目。
可选地,当转发没有配置硬件加速条目的报文的中央处理器CPU的负荷值大于预设值时,对第一预设阈值进行增大。
可选地,所述报文转发的方法还包括:
若配置硬件加速条目的第二报文的第二数量在第二预定时间内小于第一预设阈值,删除为第二报文配置的硬件加速条目。
可选地,所述报文转发的方法还包括:
若配置硬件加速条目的第二报文在第二预定时间内不再被接收,删除为第二报文配置的硬件加速条目。
可选地,所述报文转发的方法还包括:
获取转发第一报文和第二报文的网关的路由信息;当路由信息改变时,删除软件加速条目和硬件加速条目。
本申请另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现所述方法。
第二方面,本发明的实施例提供一种报文转发的装置,包括:
第一获取模块,设置成获取在转发第一报文的过程中,记录的对第一报文的属性信息进行修改的软件加速条目;
第二获取模块,设置成在转发第一报文之后的第一预定时间内,获取符合软件加速条目的需要进行转发的第二报文的第一数量;
配置模块,设置成根据第一数量,为需要进行转发的第二报文配置硬件
加速条目;
转发模块,设置成根据硬件加速条目,对需要进行转发的第二报文进行转发。
可选地,第一获取模块包括:
处理单元,设置成获取在转发第一报文的过程中,记录的第一报文的特征信息以及对第一报文的属性信息进行修改的记录,并依据记录形成的软件加速条目。
可选地,配置模块包括:
配置单元,设置成当第一数量大于第一预设阈值,为需要进行转发的第二报文配置硬件加速条目。
可选地,当转发没有配置硬件加速条目的报文的中央处理器CPU的负荷值大于预设值时,对第一预设阈值进行增大。
可选地,所述报文转发的装置还包括:
第一删除模块,设置成若配置硬件加速条目的第二报文的第二数量在第二预定时间内小于第一预设阈值,删除为第二报文配置的硬件加速条目。
可选地,所述报文转发的装置,还包括:
第二删除模块,设置成若配置硬件加速条目的第二报文在第二预定时间内不再被接收,删除为第二报文配置的硬件加速条目。
可选地,所述报文转发的装置,还包括:
第三删除模块,设置成获取转发第一报文和第二报文的网关的路由信息;当路由信息改变时,删除软件加速条目和硬件加速条目。
本申请的所述技术方案至少包括以下有益效果:
与相关技术相比,本申请的所述技术方案实现了软件和硬件协作,通过提取报文的特征信息,配置硬件加速条目,使用报文处理器修改及转发报文,使网关性能可以得到大幅提升,能够满足网关产品的性能要求,同时降低了硬件成本。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例提供的报文转发的方法的流程示意图;
图2是本发明实施例提供的报文转发的装置的结构示意图;
图3是本发明一个实施例提供的配置硬件加速条目的步骤的流程图;
图4是本发明一个实施例提供的查询是否保留硬件加速条目的步骤的流程图。
本发明的较佳实施方式
为使本申请要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。
本发明实施例提供一种报文转发的方法,通过提取报文的特征信息,动态配置PP(Packet Processor,报文处理器),使用PP修改及转发报文,使网关性能可以得到大幅提升。
PP能够支持IPv4(Internet Protocol Version 4,互联网协议版本4),IPv6(Internet Protocol Version 6),PPPoE报文的识别,并使源IP地址、源端口、目的IP地址、目的端口、以及传输层协议匹配;支持修改MAC地址,NAT转换,VLAN增加和删除以及PPPoE头的增加和删除;支持统计报文的匹配次数,供软件查询。
请参见图1,图1是本发明实施例提供的报文转发的方法的流程示意图,本发明实施例提供的报文转发的方法,包括:
步骤101,获取在转发第一报文的过程中,记录的对第一报文的属性信息进行修改的软件加速条目。
这里,获取通过CPU转发第一报文的过程中,记录的对第一报文的属性
信息进行修改的软件加速条目。其中,根据获取的软件加速条目,对于属性相同的报文,即符合该软件加速条目的报文,可以匹配该软件加速条目进行转发。
步骤102,在转发第一报文之后的第一预定时间内,获取符合软件加速条目的需要进行转发的第二报文的第一数量。
第一预定时间可以根据实际用户场景进行设定,例如1秒,即在转发第一报文之后的1秒内,获取的符合软件加速条目的需要进行转发的第二报文的第一数量,即获取符合软件加速条目的第二报文的报文流量。可选地,所述步骤102包括:在转发第一报文之后,获取符合软件加速条目的需要进行转发的第二报文在单位时间内的报文条数。
步骤103,根据第一数量,为需要进行转发的第二报文配置硬件加速条目。
这里,根据获取的第一数量,为需要进行转发的第二报文配置设置成PP转发的硬件加速条目。其中,硬件加速条目的配置可以根据软件加速条目的记录进行配置。
步骤104,根据硬件加速条目,对需要进行转发的第二报文进行转发。
根据配置的硬件加速条目,将需要进行转发的第二报文由PP进行转发。
可选地,在步骤101中,获取在转发第一报文的过程中,记录的对第一报文的属性信息进行修改的软件加速条目的步骤包括:
获取在转发第一报文的过程中,记录的第一报文的特征信息以及对第一报文的属性信息进行修改的记录,并依据记录形成的软件加速条目。
这里,在第一报文进入CPU转发时,在入口方向记录报文的特征信息,并在出口记录第一报文经过协议栈一系列处理后的对第一报文的属性信息进行修改的记录,然后依据这些记录形成第一报文的软件加速条目。具体的,属性信息包括但不限于:MAC地址、NAT、VLAN以及PPPoE,特征信息包括源IP地址、源端口、目的IP地址、目的端口和传输层协议。
可选地,在步骤103中,根据第一数量,为需要进行转发的第二报文配置硬件加速条目的步骤包括:
当第一数量大于第一预设阈值,为需要进行转发的第二报文配置硬件加速条目。
由于PP的工作原理是基于报文匹配以完成修改和转发,且硬件加速条目的数量与PP的容量大小息息相关,PP的容量有限,因此当报文流量(报文条数)足够大时,才为报文配置硬件加速条目,然后采用PP加速,这样,低流量的报文采用CPU转发不会占用太多CPU资源,保证网关性能,同时还可以节省硬件加速条目。第一预设阈值可以根据实际需求进行配置,以适应不同场景。在转发第一报文之后的第一预定时间内,当第一数量大于第一预设阈值,则为需要进行转发的第二报文配置硬件加速条目,启用PP加速;否则,第二报文继续由CPU转发。例如,第一预定时间为1秒,第一预设阈值为40条,则当需要进行转发的第二报文在1秒内的报文流量为50(单位:条/秒)时,为需要进行转发的第二报文配置硬件加速条目;当需要进行转发的第二报文在1秒内的报文流量为30(单位:条/秒)时,则第二报文继续由CPU转发。
参见图3,在一个实施例中,配置硬件加速条目的步骤包括:
步骤301,确定是否有匹配的软件加速条目。这里,判断当前需要转发的一条报文是否有匹配的软件加速条目;若有匹配的软件加速条目,则执行步骤302,若没有匹配的软件加速条目,则进行到步骤303。
步骤302,形成软件加速条目。这里,提取报文的特征信息,并记录报文经协议栈一系列处理后的属性信息的修改,形成一条软件加速条目。
步骤303,确定报文流量是否达到配置硬件加速额条目的硬件加速阈值。这里,判断所述报文匹配的软件加速条目,在单位时间内匹配的报文流量(第一数量)是否达到配置硬件加速条目的硬件加速阈值(第一预设阈值);若达到硬件加速阈值,则进行到步骤304,若未达到硬件加速阈值,则进行到步骤305。
步骤304,配置硬件加速条目。
步骤305,转发报文。这里,将所述报文进行转发,从与所述报文属性相同的下一条报文开始,匹配硬件加速条目并在PP上进行转发。
当转发没有配置硬件加速条目的报文的中央处理器CPU的负荷值大于预设值时,对第一预设阈值进行增大调整。
考虑转发没有配置硬件加速条目的报文的CPU的负荷值,对第一预设阈值进行动态调整,以保证网关性能。例如,可以获取CPU利用率,当该CPU利用率超过预设值,将第一预设阈值进行增大。
可选地,所述报文转发的方法,还包括:
若配置硬件加速条目的第二报文的第二数量在第二预定时间内小于第一预设阈值,删除为第二报文配置的硬件加速条目。
当转发没有配置硬件加速条目的报文的CPU的负荷值(CPU利用率)超过预设值时,如果在第二预定时间内,匹配硬件加速条目的第二报文的第二数量小于第一预设阈值,删除为第二报文配置的硬件加速条目,后续的第二报文采用CPU转发。其中,第二预定时间可以根据实际用户场景进行设定,例如1秒,则当1秒内匹配硬件加速条目的第二报文的报文流量小于第一预设阈值时,删除为第二报文配置的硬件加速条目。可选地,所述步骤包括:若匹配硬件加速条目的第二报文的第二数量在单位时间内小于第一预设阈值,删除为第二报文配置的硬件加速条目。
参见图4,在一个实施例中,查询是否保留硬件加速条目的步骤如下:
步骤401,开始计时;
步骤402,停止计时;
步骤403,获取在计时时间内硬件加速条目击中次数;这里,获取PP反馈的硬件加速条目的击中次数,即匹配硬件加速条目的报文的条数。
步骤404,获取芯片负荷,动态调整硬件加速阈值;这里,获取芯片负荷(CPU的负荷值),并根据该芯片负荷对硬件加速阈值(第一预设阈值)动态调整。
步骤405,判断在单位时间内是否小于硬件加速阈值;这里,计算单位时间的匹配硬件加速条目的报文流量(第二数量),并判断该报文流量是否低于硬件加速阈值,若小于硬件加速阈值,则进行到步骤406,若大于或等于硬件加速阈值,则返回到步骤401;
步骤406,删除硬件加速条目。
可选地,所述报文转发的方法,还包括:
若配置硬件加速条目的第二报文在第二预定时间内不再被接收,删除为第二报文配置的硬件加速条目。
当转发没有配置硬件加速条目的报文的CPU的负荷值(CPU利用率)小于或者等于预设值时,如果在第二预定时间内,匹配硬件加速条目的第二报文不再被接收,即匹配硬件加速条目的第二报文的报文条数为0,则删除为第二报文配置的硬件加速条目。其中,第二预定时间可以根据实际用户场景进行设定,例如1秒,则当1秒内匹配硬件加速条目的第二报文的报文流量为0(单位:条/秒)时,删除为第二报文配置的硬件加速条目。
可选地,所述报文转发的方法,还包括:
获取转发第一报文和第二报文的网关的路由信息;当路由信息改变时,删除软件加速条目和硬件加速条目。
当转发第一报文和第二报文的网关的路由信息改变,如果不删除硬件加速条目和软件加速条目,则仍然从PP或者CPU转发与第一报文和第二报文属性相同的报文,则形成异常报文。因此当网关的路由信息改变时,删除软件加速条目和硬件加速条目。
本发明实施例提供的报文转发的方法,实现了软件和硬件协作,通过提取报文的特征信息,配置硬件加速条目,使用PP修改及转发报文,使网关性能可以得到大幅提升,能够满足网关产品的性能要求,同时降低了硬件成本。
本发明实施例另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现所述方法。
本发明实施例还提供一种用以实施所述方法的装置。
请参见图2,图2是本发明实施例提供的报文转发的装置的结构示意图,本发明实施例提供的报文转发的装置,包括:第一获取模块210、第二获取模块220、配置模块230以及转发模块240。
第一获取模块210,设置成获取在转发第一报文的过程中,记录的对第
一报文的属性信息进行修改的软件加速条目;
第二获取模块220,设置成在转发第一报文之后的第一预定时间内,获取符合软件加速条目的需要进行转发的第二报文的第一数量;
配置模块230,设置成根据第一数量,为需要进行转发的第二报文配置硬件加速条目;
转发模块240,设置成根据硬件加速条目,对需要进行转发的第二报文进行转发。
可选地,第一获取模块210包括:处理单元,
所述处理单元设置成获取在转发第一报文的过程中,记录的第一报文的特征信息以及对第一报文的属性信息进行修改的记录,并依据记录形成的软件加速条目。
可选地,配置模块230包括:配置单元,
所述配置单元设置成当第一数量大于第一预设阈值,为需要进行转发的第二报文配置硬件加速条目。
可选地,当转发没有配置硬件加速条目的报文的中央处理器CPU的负荷值大于预设值时,对第一预设阈值进行增大。
可选地,所述报文转发的装置,还包括:第一删除模块,
所述第一删除模块设置成若配置硬件加速条目的第二报文的第二数量在第二预定时间内小于第一预设阈值,删除为第二报文配置的硬件加速条目。
可选地,所述报文转发的装置,还包括:第二删除模块,
所述第二删除模块设置成若配置硬件加速条目的第二报文的第二数量在第二预定时间内不再被接收,删除为第二报文配置的硬件加速条目。
可选地,所述报文转发的装置,还包括:第三删除模块,
所述第三删除模块设置成获取转发第一报文和第二报文的网关的路由信息;当路由信息改变时,删除软件加速条目和硬件加速条目。
本发明实施例提供的报文转发的装置与本发明实施例提供的报文转发的方法属于同一构思,其具体实现过程详见方法实施例,为避免重复,这里不
再赘述。
本发明实施例提供的报文转发的装置,实现了软件和硬件协作,通过提取报文的特征信息,配置硬件加速条目,使用PP修改及转发报文,使网关性能可以得到大幅提升,能够满足网关产品的性能要求,同时降低了硬件成本。
对于前述的方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作并不一定是本申请所必需的。
需要说明的是,在发明实施例中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序
来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储于存储器中的程序/指令来实现其相应功能。本发明实施例不限制于任何特定形式的硬件和软件的结合。
以上所述是本发明的可选实施例,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。
提供了一种报文转发的方法,实现了软件和硬件协作,通过提取报文的特征信息,配置硬件加速条目,使用PP修改及转发报文,使网关性能可以得到大幅提升,能够满足网关产品的性能要求,同时降低了硬件成本。
Claims (14)
- 一种报文转发的方法,包括:获取在转发第一报文的过程中,记录的对第一报文的属性信息进行修改的软件加速条目;在转发第一报文之后的第一预定时间内,获取符合所述软件加速条目的需要进行转发的第二报文的第一数量;根据所述第一数量,为所述需要进行转发的第二报文配置硬件加速条目;根据所述硬件加速条目,对需要进行转发的第二报文进行转发。
- 根据权利要求1所述的方法,其中,获取在转发第一报文的过程中,记录的对第一报文的属性信息进行修改的软件加速条目的步骤包括:获取在转发第一报文的过程中,记录的第一报文的特征信息以及对第一报文的属性信息进行修改的记录,并依据所述记录形成的软件加速条目。
- 根据权利要求1所述的方法,其中,所述根据所述第一数量,为所述需要进行转发的第二报文配置硬件加速条目的步骤包括:当所述第一数量大于第一预设阈值,为所述需要进行转发的第二报文配置硬件加速条目。
- 根据权利要求3所述的方法,其中,当转发没有配置硬件加速条目的报文的中央处理器CPU的负荷值大于预设值时,对所述第一预设阈值进行增大。
- 根据权利要求1所述的方法,所述方法还包括:若配置硬件加速条目的第二报文的第二数量在第二预定时间内小于第一预设阈值,删除为第二报文配置的硬件加速条目。
- 根据权利要求1所述的方法,所述方法还包括:若配置硬件加速条目的第二报文在第二预定时间内不再被接收,删除为第二报文配置的硬件加速条目。
- 根据权利要求1所述的方法,所述方法还包括:获取转发第一报文和第二报文的网关的路由信息;当所述路由信息改变时,删除所述软件加速条目和所述硬件加速条目。
- 一种报文转发的装置,包括:第一获取模块,设置成获取在转发第一报文的过程中,记录的对第一报文的属性信息进行修改的软件加速条目;第二获取模块,设置成在转发第一报文之后的第一预定时间内,获取符合所述软件加速条目的需要进行转发的第二报文的第一数量;配置模块,设置成根据所述第一数量,为所述需要进行转发的第二报文配置硬件加速条目;转发模块,设置成根据所述硬件加速条目,对需要进行转发的第二报文进行转发。
- 根据权利要求8所述的装置,其中,第一获取模块包括:处理单元,设置成获取在转发第一报文的过程中,记录的第一报文的特征信息以及对第一报文的属性信息进行修改的记录,并依据所述记录形成的软件加速条目。
- 根据权利要求8所述的装置,其中,配置模块包括:配置单元,设置成当所述第一数量大于第一预设阈值,为所述需要进行转发的第二报文配置硬件加速条目。
- 根据权利要求10所述的装置,其中,当转发没有配置硬件加速条目的报文的中央处理器CPU的负荷值大于预设值时,对所述第一预设阈值进行增大。
- 根据权利要求8所述的装置,所述装置还包括:第一删除模块,设置成若配置硬件加速条目的第二报文的第二数量在第二预定时间内小于第一预设阈值,删除为第二报文配置的硬件加速条目。
- 根据权利要求8所述的装置,所述装置还包括:第二删除模块,设置成若配置硬件加速条目的第二报文在第二预定时间内不再被接收,删除为第二报文配置的硬件加速条目。
- 根据权利要求8所述的装置,所述装置还包括:第三删除模块,设置成获取转发第一报文和第二报文的网关的路由信息;当所述路由信息改变时,删除所述软件加速条目和所述硬件加速条目。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610142798.2 | 2016-03-14 | ||
CN201610142798.2A CN107196776A (zh) | 2016-03-14 | 2016-03-14 | 一种报文转发的方法和装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017156908A1 true WO2017156908A1 (zh) | 2017-09-21 |
Family
ID=59852015
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/086739 WO2017156908A1 (zh) | 2016-03-14 | 2016-06-22 | 一种报文转发的方法和装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107196776A (zh) |
WO (1) | WO2017156908A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020134415A1 (zh) * | 2018-12-25 | 2020-07-02 | 深圳市中兴微电子技术有限公司 | 一种通过硬件、软件快速报文转发的方法和系统 |
CN111510513A (zh) * | 2020-01-03 | 2020-08-07 | 普联国际有限公司 | 一种map-e链路加速方法、装置、存储介质及网络设备 |
CN112448889A (zh) * | 2019-08-28 | 2021-03-05 | 北京新能源汽车股份有限公司 | 一种网关控制器路由配置方法、装置、设备及汽车 |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111371909B (zh) * | 2018-12-25 | 2022-04-26 | 深圳市中兴微电子技术有限公司 | 实现4in6 DS Lite数据流转发方法、系统 |
CN109802872B (zh) * | 2019-03-19 | 2021-07-30 | 北京信而泰科技股份有限公司 | 一种报文捕获方法、装置及设备 |
CN113132262B (zh) * | 2020-01-15 | 2024-05-03 | 阿里巴巴集团控股有限公司 | 一种数据流处理及分类方法、装置和系统 |
CN111447301A (zh) * | 2020-03-27 | 2020-07-24 | 深圳市三旺通信股份有限公司 | 一种采用外挂式cpu的轨交车车载nat的方法 |
CN111641530B (zh) * | 2020-04-08 | 2022-11-11 | 上海联虹技术有限公司 | 实现加速转发的方法、装置、终端及存储介质 |
CN111787435A (zh) * | 2020-06-12 | 2020-10-16 | 芯河半导体科技(无锡)有限公司 | 一种基于gpon路由器的网络加速系统 |
CN114024887B (zh) * | 2021-11-10 | 2024-06-14 | 北京天融信网络安全技术有限公司 | 转发表项的处理方法、装置、设备及存储介质 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1708959A (zh) * | 2002-10-30 | 2005-12-14 | 帕克特弗兰特瑞典股份公司 | 软件和硬件包流转发的方法、路由器或交换机 |
CN102938782A (zh) * | 2012-10-30 | 2013-02-20 | 中兴通讯股份有限公司 | 一种报文处理方法、装置和系统 |
CN104488229A (zh) * | 2012-07-31 | 2015-04-01 | 惠普发展公司,有限责任合伙企业 | 网络业务处理系统 |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101588299B (zh) * | 2009-07-07 | 2012-01-04 | 杭州华三通信技术有限公司 | 分布式设备的报文转发方法及分布式设备和该设备的单板 |
CN103220219B (zh) * | 2013-04-16 | 2016-03-02 | 杭州华三通信技术有限公司 | 一种报文转发方法和设备 |
-
2016
- 2016-03-14 CN CN201610142798.2A patent/CN107196776A/zh active Pending
- 2016-06-22 WO PCT/CN2016/086739 patent/WO2017156908A1/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1708959A (zh) * | 2002-10-30 | 2005-12-14 | 帕克特弗兰特瑞典股份公司 | 软件和硬件包流转发的方法、路由器或交换机 |
CN104488229A (zh) * | 2012-07-31 | 2015-04-01 | 惠普发展公司,有限责任合伙企业 | 网络业务处理系统 |
CN102938782A (zh) * | 2012-10-30 | 2013-02-20 | 中兴通讯股份有限公司 | 一种报文处理方法、装置和系统 |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020134415A1 (zh) * | 2018-12-25 | 2020-07-02 | 深圳市中兴微电子技术有限公司 | 一种通过硬件、软件快速报文转发的方法和系统 |
CN112448889A (zh) * | 2019-08-28 | 2021-03-05 | 北京新能源汽车股份有限公司 | 一种网关控制器路由配置方法、装置、设备及汽车 |
CN112448889B (zh) * | 2019-08-28 | 2022-04-19 | 北京新能源汽车股份有限公司 | 一种网关控制器路由配置方法、装置、设备及汽车 |
CN111510513A (zh) * | 2020-01-03 | 2020-08-07 | 普联国际有限公司 | 一种map-e链路加速方法、装置、存储介质及网络设备 |
CN111510513B (zh) * | 2020-01-03 | 2022-08-30 | 普联国际有限公司 | 一种map-e链路加速方法、装置、存储介质及网络设备 |
Also Published As
Publication number | Publication date |
---|---|
CN107196776A (zh) | 2017-09-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017156908A1 (zh) | 一种报文转发的方法和装置 | |
US11005752B2 (en) | Packet transmission | |
EP3720057A1 (en) | Message processing method and device | |
US10237130B2 (en) | Method for processing VxLAN data units | |
WO2017000878A1 (zh) | 报文处理 | |
CN104618194B (zh) | 软件定义网络报文监控方法和sdn控制器、交换设备 | |
WO2016192686A1 (zh) | 数据报文转发 | |
US10313154B2 (en) | Packet forwarding | |
WO2012167559A1 (zh) | 一种快速转发数据包的方法及三层设备 | |
WO2016045608A1 (en) | Processing a flow entry in vxlan | |
WO2021017930A1 (zh) | 报文转发 | |
US11283645B2 (en) | Forwarding packet | |
WO2016115698A1 (zh) | 数据报文的转发方法、装置及设备 | |
WO2014166073A1 (zh) | 报文转发方法和网络设备 | |
JP6595698B2 (ja) | クラウドプラットフォームのセキュリティの実現 | |
EP2924926B1 (en) | Lookup table creation method and query method, and controller, forwarding device and system therefor | |
WO2015106623A1 (zh) | 一种配置、下发流表项的方法及装置 | |
WO2016131422A1 (en) | Flow entry generating and packet processing based on flow entry | |
US20200136967A1 (en) | Forwarding packet | |
US20180091446A1 (en) | Packet forwarding | |
US9749262B2 (en) | Packet processing method and forwarding element | |
CN110752989A (zh) | 一种东西向流量转发方法与装置 | |
JP6783501B2 (ja) | 情報伝送システム、情報通信装置、情報伝送装置、及びプログラム | |
WO2015124015A1 (zh) | 一种数据包转发方法及设备 | |
CN110224932B (zh) | 一种数据快速转发的方法及系统 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16894070 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16894070 Country of ref document: EP Kind code of ref document: A1 |