WO2014183521A1 - Packet processing method and device - Google Patents

Packet processing method and device Download PDF

Info

Publication number
WO2014183521A1
WO2014183521A1 PCT/CN2014/075409 CN2014075409W WO2014183521A1 WO 2014183521 A1 WO2014183521 A1 WO 2014183521A1 CN 2014075409 W CN2014075409 W CN 2014075409W WO 2014183521 A1 WO2014183521 A1 WO 2014183521A1
Authority
WO
WIPO (PCT)
Prior art keywords
link
packet processing
port
links
packet
Prior art date
Application number
PCT/CN2014/075409
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 WO2014183521A1 publication Critical patent/WO2014183521A1/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/14Multichannel or multilink protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Definitions

  • the present invention relates to the field of communications, and in particular to a packet processing method and apparatus.
  • BACKGROUND With the rapid development of network systems, intermediate devices of network systems have experienced the development stages of general-purpose processors, application-specific integrated circuits (ASICs), and general-purpose network processors. Due to the low cost and programmable flexibility of network processors, network processors are becoming more widely used. It is not enough for the network processor to have only the above two advantages, and it has to have higher performance than conventional ASIC chips. For example, the role of the network processor is mainly to control the processing of the package in software. Therefore, in addition to the design of the hardware itself, a good software design can also improve the packet processing performance of the network processor.
  • FIG. 1 is a flowchart of a packet processing method of a network processor according to the related art.
  • the following steps are mainly included: (1) entering all physical links/channels in a physical link module.
  • a legal packet enters the packet search matching identification module through a unique port; (2)
  • the packet search matching identification module has prepared the service or channel corresponding entry in advance according to the configuration of the control software, and the packet search matches.
  • the search engine or the HASH engine in the identification module searches and matches the internal entries one by one according to the characteristics of the incoming legal packets, and sends the matched legal packets to the packet processing module; (3) the packet processing module uses and The packet processing method associated with the entry processes the package.
  • the present invention provides a packet processing method and apparatus to solve at least the above problems.
  • a packet processing method including: receiving packet data from a first link through a first port corresponding to a first link of a plurality of links; using a plurality of packet processing manners Medium and first end
  • the first packet processing mode corresponding to the port performs packet processing on the packet data, where the number of multiple packet processing modes is the same as the number of multiple links.
  • the type of the first link includes: a physical link or a physical channel.
  • the types of the links other than the first link of the plurality of links are physical links
  • the other links include: the second link
  • the second link of the plurality of links corresponds to the second port of the plurality of preset ports, wherein the multiple ports include: the first port and the second port, the second port and the first port The ports are not the same.
  • the second port corresponds to a second packet processing manner of the plurality of packet processing modes.
  • the packet data includes: a legal message.
  • a packet processing apparatus comprising: a receiving module, configured to receive packet data from a first link through a first port corresponding to a first link of the plurality of links;
  • the processing module is configured to perform packet processing on the packet data by using a first packet processing manner that matches the first port in the multiple packet processing manner, where the number of the multiple packet processing modes is the same as the number of the multiple links.
  • the type of the first link includes: a physical link or a physical channel.
  • the types of the links other than the first link of the plurality of links are physical links
  • the other links include: the second link
  • the second link of the plurality of links corresponds to the second port of the plurality of preset ports, wherein the multiple ports include: the first port and the second port, the second port and the first port The ports are not the same.
  • the second port corresponds to a second packet processing manner of the plurality of packet processing modes.
  • the packet data includes: a legal message.
  • the packet processing mode can directly use the packet processing mode corresponding to the port to enter the legal packet.
  • the method of processing the packet processing solves the problem that the packet processing capability of the network processor in the related art is relatively low, thereby achieving the effect of saving packet search and matching time and improving the packet processing efficiency of the network processor.
  • FIG. 1 is a schematic flowchart of a packet processing method of a network processor according to the related art
  • FIG. 2 is a flowchart of a packet processing method according to an embodiment of the present invention
  • FIG. 3 is a packet processing apparatus according to an embodiment of the present invention
  • 4 is a schematic diagram of a process of a packet processing method according to a preferred embodiment of the present invention
  • FIG. 1 is a schematic flowchart of a packet processing method of a network processor according to the related art
  • FIG. 2 is a flowchart of a packet processing method according to an embodiment of the present invention
  • FIG. 3 is a packet processing apparatus according to an embodiment of the present invention
  • 4 is a schematic diagram of a process of a packet processing method according to a preferred embodiment of the present invention
  • FIG. 5 is a schematic diagram of a control relationship between modules in a packet processing apparatus according to a preferred embodiment of the present invention.
  • BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
  • This embodiment provides a packet processing method.
  • 2 is a flowchart of a packet processing method according to an embodiment of the present invention. As shown in FIG. 2, the method mainly includes the following steps (step S202-step S204): Step S202, by using a first link with multiple links. The corresponding first port receives packet data from the first link.
  • Step S204 Perform packet processing on the packet data by using a first packet processing manner corresponding to the first port in the multiple packet processing manners, where the number of the multiple packet processing modes is the same as the number of the multiple links.
  • the packet processing operation of the legal packet can be directly performed by using the packet processing mode corresponding to the port for the packet after the port is configured for the physical link or the physical channel.
  • the type of the first link may include: a physical link or a physical channel.
  • the above-mentioned multiple links may be physical links or physical channels. Of course, in practical applications, some links use physical links, and some links use physical channels.
  • the second link of the multiple links corresponds to the second port of the plurality of ports that are preset, wherein the multiple ports may include: a first port and a second port, and a second The port is not the same as the first port.
  • the second port corresponds to a second packet processing manner of the plurality of packet processing modes.
  • the packet data may include: a legal message.
  • the apparatus is used to implement the packet processing method provided by the foregoing embodiment.
  • the apparatus includes: a receiving module 10 and a processing module 20.
  • the receiving module 10 is configured to receive packet data from the first link by using a first port corresponding to the first link of the multiple links;
  • the processing module 20 is connected to the receiving module 10, and is configured to use multiple
  • the first packet processing mode that matches the first port in the packet processing mode performs packet processing on the packet data, where the number of multiple packet processing modes is the same as the number of multiple links.
  • the type of the first link may include: a physical link or a physical channel.
  • the types of the links other than the first link of the plurality of links are physical links
  • the other links include: the second link
  • the second link of the plurality of links corresponds to the second port of the plurality of ports that are preset, wherein the multiple ports include: the first port and the second port Port, the second port is different from the first port.
  • the second port corresponds to the second packet processing mode of the multiple packet processing modes.
  • the packet data may include: a legal message.
  • the packet processing method provided by the above embodiment will be described in more detail below with reference to FIG. 4 and FIG. 5 and a preferred embodiment. In the following preferred embodiment, the entire packet processing flow will be described on the basis of four functional modules. First, the functions of the four function modules used below are appropriately explained:
  • the control software module is responsible for controlling the process of packet processing by means of control software.
  • the built-in software of the module integrates: physical link setting, message lookup Matches the settings that identify hardware entries, as well as the settings of the package processing and processes.
  • Physical link module the module includes: physical layer (Physical Layer, referred to as PHY) chip, Field-Programmable Gate Array (FPGA), or UFE3.
  • the message search matching module the module mainly includes some hardware entries inside the network processor, and a search and hash algorithm (Hash Function, referred to as HASH) engine.
  • Packet processing module which mainly contains some software resources inside the network processor, such as: buffer, queue, etc., mainly used to modify, add, delete operations.
  • FIG. 4 is a schematic diagram of a process of a packet processing method according to a preferred embodiment of the present invention. As shown in FIG. 4, the process mainly includes: (1) for each link or channel of the physical link module, the packet is illegal.
  • the legal packet After being discarded, the legal packet is sent to a corresponding port (port) pre-allocated on the packet matching module.
  • the port represents the channel and indirectly represents the processing requirements of the legal packet in the channel.
  • the packet search matching module does not have to waste a lot of time to search and match in a large number of hardware tables, and can directly send the legal message to the packet processing module; (3) the packet processing module directly uses the corresponding transmission law.
  • the packet processing mode of the port of the packet (that is, the packet processing mode associated with the port) performs packet processing operations on the legal packet (that is, the packet is modified, added, deleted). Please refer to FIG. 5 at the same time.
  • FIG. 5 is a schematic diagram of a control relationship between modules in a packet processing apparatus according to a preferred embodiment of the present invention.
  • the control software module issues control commands to other three modules as needed.
  • the entire packet processing process is controlled.
  • the physical link module configures physical attributes, receives legal packets (ie, legitimate packets) from the physical link or channel, and discards illegal packets (illegal packets).
  • the message search matching module accepts the control command of the control software module, prepare the corresponding hardware entry and the search, HASH engine, and once the package enters from the port, the package is not searched, matched, etc., but Direct package Sending to the packet processing module; the packet processing module directly processes the packet using a packet processing manner corresponding to a port (corresponding to each physical link or physical channel) that is preset in the packet search matching module terminal.
  • the configuration of the network processor can be controlled by the control software, wherein, for each channel service, the control software is configured.
  • the process can include:
  • the physical channel is configured, mainly PHY chip, FPGA, UFE3, and the like.
  • the packet processing method adds, deletes, and modifies the packet, and completes the packet processing process.
  • the packet processing method and device provided by the foregoing embodiments can associate the physical channel and the packet processing method by using the added port, thereby avoiding the problem that the packet processing performance is relatively low due to the association method of finding the matching entry. Improve the packet processing efficiency of the network processor.
  • the present invention achieves the following technical effects: After a port having a corresponding relationship is set for each physical link or physical channel in advance, the packet after passing the port can be directly used and The packet processing mode corresponding to the port performs the packet processing operation on the legal packet, which solves the problem that the packet processing capability of the network processor in the related art is relatively low, thereby saving the time for packet search and matching, and improving network processing. The effect of the package processing efficiency.
  • a port having a corresponding relationship may be set for each physical link or physical channel in advance, and the packet processing method corresponding to the port may be directly used for the packet passing through the port. The packet is processed by a packet.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Abstract

Disclosed are a packet processing method and device. The packet processing method comprises: receiving packet data from a first link via a first port corresponding to the first link of a plurality of links; and performing packet processing on the packet data by using a first packet processing manner corresponding to the first port of a plurality of packet processing manners, wherein the number of the plurality of packet processing manners is the same as that of the plurality of links. By means of the present invention, the effects of saving time for message search and matching and improving the packet processing efficiency of a network processor are achieved.

Description

包处理方法及装置  Packet processing method and device
技术领域 本发明涉及通信领域, 具体而言, 涉及一种包处理方法及装置。 背景技术 随着网络系统的高速发展, 网络系统的中间设备先后经历了通用处理器、 专用集 成电路 (Application Specific Integrated Circuit, 简称为 ASIC) 芯片, 通用网络处理器 的发展阶段。 由于网络处理器具有成本低和可编程的灵活性特点, 得到越来越广泛的 应用。 网络处理器如果仅具有上述两个优点是不够的, 还得具有超出常规 ASIC芯片的 高性能。 例如, 网络处理器的作用主要是以软件方式控制包的处理过程, 因此, 除了 硬件本身的设计外, 一个好的软件设计, 也可以提高网络处理器的包处理性能。 图 1是根据相关技术的网络处理器的包处理方法流程图, 在该包处理流程中, 主 要包括以下几个步骤: ( 1 )进入到物理链路模块中的所有物理链路 /通道中的合法报文, 通过唯一的端口 (port) 进入报文查找匹配识别模块; (2) 报文查找匹配识别模块根 据控制软件的配置已经预先准备好了业务或者通道对应的表项, 报文查找匹配识别模 块中的搜索引擎或者 HASH引擎根据进入的合法报文的特征, 对内部表项一一查找、 匹配, 并将匹配出来的合法报文发送给包处理模块; (3 ) 包处理模块使用与表项相关 联的包处理方法对包进行处理。 这种软件设计方式中需要对报文进行大量的查找、 匹 配工作, 因此导致网络处理器的包处理能力比较低。 可以看出, 目前的网络处理器的 软件设计性能方面无法满足在包处理方面的高性能要求, 导致其包处理能力比较低。 针对相关技术中网络处理器的包处理能力比较低的问题, 目前尚未提出有效的解 决方案。 发明内容 本发明提供了一种包处理方法及装置, 以至少解决上述问题。 根据本发明的一个方面, 提供了一种包处理方法, 包括: 通过与多条链路中的第 一链路对应的第一端口接收来自第一链路的包数据; 使用多个包处理方式中与第一端 口对应的第一包处理方式对包数据进行包处理, 其中, 多个包处理方式的数目与多条 链路的数目是相同的。 优选地, 第一链路的类型包括: 物理链路或物理通道。 优选地, 当第一链路的类型为物理链路时, 多条链路中除第一链路之外的其它链 路的类型为物理链路, 其中, 其它链路包括: 第二链路; 当第一链路的类型为物理通 道时, 多条链路中除第一链路之外的其它链路的类型为物理通道, 其中, 其它链路包 括: 第二链路。 优选地, 多条链路中的第二链路与预先设置的多个端口中的第二端口是对应的, 其中, 多个端口包括: 第一端口和第二端口, 第二端口与第一端口是不相同的。 优选地, 第二端口与多个包处理方式中的第二包处理方式是对应的。 优选地, 包数据包括: 合法报文。 根据本发明的另一方面, 提供了一种包处理装置, 包括: 接收模块, 设置为通过 与多条链路中的第一链路对应的第一端口接收来自第一链路的包数据; 处理模块, 设 置为使用多个包处理方式中与第一端口匹配的第一包处理方式对包数据进行包处理, 其中, 多个包处理方式的数目与多条链路的数目是相同的。 优选地, 第一链路的类型包括: 物理链路或物理通道。 优选地, 当第一链路的类型为物理链路时, 多条链路中除第一链路之外的其它链 路的类型为物理链路, 其中, 其它链路包括: 第二链路; 当第一链路的类型为物理通 道时, 多条链路中除第一链路之外的其它链路的类型为物理通道, 其中, 其它链路包 括: 第二链路。 优选地, 多条链路中的第二链路与预先设置的多个端口中的第二端口是对应的, 其中, 多个端口包括: 第一端口和第二端口, 第二端口与第一端口是不相同的。 优选地, 第二端口与多个包处理方式中的第二包处理方式是对应的。 优选地, 包数据包括: 合法报文。 通过本发明, 采用预先为每条物理链路或物理通道设置一个具有对应关系的端口 后, 对于通过该端口后的报文可以直接使用与该端口对应的包处理方式对合法报文进 行包处理操作的方式, 解决了相关技术中网络处理器的包处理能力比较低的问题, 进 而达到了节省报文查找、 匹配的时间, 提高网络处理器的包处理效率的效果。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部分, 本发 明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不当限定。 在附图 中- 图 1是根据相关技术的网络处理器的包处理方法的过程示意图; 图 2是根据本发明实施例的包处理方法流程图; 图 3是根据本发明实施例的包处理装置的结构框图; 图 4是根据本发明优选实施例的包处理方法的过程示意图; 以及 图 5是根据本发明优选实施例的包处理装置中各个模块间的控制关系示意图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不冲突的 情况下, 本申请中的实施例及实施例中的特征可以相互组合。 本实施例提供了一种包处理方法。图 2是根据本发明实施例的包处理方法流程图, 如图 2所示, 该方法主要包括以下步骤 (步骤 S202-步骤 S204): 步骤 S202,通过与多条链路中的第一链路对应的第一端口接收来自第一链路的包 数据。 步骤 S204,使用多个包处理方式中与第一端口对应的第一包处理方式对包数据进 行包处理, 其中, 多个包处理方式的数目与多条链路的数目是相同的。 通过上述两个步骤, 对于通过预先为物理链路或物理通道设置的端口后的报文, 可以直接使用与该端口对应的包处理方式对合法报文进行包处理操作。 在本实施例中, 第一链路的类型可以包括: 物理链路或物理通道。 上述多条链路 可以都是物理链路, 也可以都是物理通道, 当然在实际应用中, 在多条链路中, 一部 分链路采用物理链路, 一部分链路采用物理通道也是可行的。 在本实施例中, (1 ) 当 第一链路的类型为物理链路时, 多条链路中除第一链路之外的其它链路的类型为物理 链路, 其中, 其它链路包括: 第二链路; (2) 当第一链路的类型为物理通道时, 多条 链路中除第一链路之外的其它链路的类型为物理通道, 其中, 其它链路包括: 第二链 路。 在本实施例中, 多条链路中的第二链路与预先设置的多个端口中的第二端口是对 应的, 其中, 多个端口可以包括: 第一端口和第二端口, 第二端口与第一端口是不相 同的。 优选地, 第二端口与多个包处理方式中的第二包处理方式是对应的。 在本实施例中, 包数据可以包括: 合法报文。 在实际应用中, 对于一个物理链路 或物理通道而言, 其在接收到所有的报文时, 会将非法报文丢弃掉, 只传输合法报文。 这使得到的与该物理链路或物理通道对应的端口的报文均是合法报文。 当对应于每个物理链路或物理通道的端口接收到合法报文时, 其不用再像现有包 处理方式一样对需要采用的包处理方式与合法报文进行查找匹配, 这是因为在设置端 口时, 已经在端口和包处理方式之间建立了对应关系, 这样, 可以直接采用相应的包 处理方式对被端口传输后的合法报文进行包处理操作, 省去了查找匹配流程, 提高了 包处理的效率。 本实施例提供了一种包处理装置。 图 3是根据本发明实施例的包处理装置的结构 框图, 该装置用于实现上述实施例提供的包处理方法, 如图 3所示, 该装置包括: 接 收模块 10和处理模块 20。 其中, 接收模块 10, 设置为通过与多条链路中的第一链路 对应的第一端口接收来自第一链路的包数据; 处理模块 20, 连接至接收模块 10, 设置 为使用多个包处理方式中与第一端口匹配的第一包处理方式对包数据进行包处理, 其 中, 多个包处理方式的数目与多条链路的数目是相同的。 在本实施例中, 第一链路的类型可以包括: 物理链路或物理通道。 优选地, 当第 一链路的类型为物理链路时, 多条链路中除第一链路之外的其它链路的类型为物理链 路, 其中, 其它链路包括: 第二链路; 当第一链路的类型为物理通道时, 多条链路中 除第一链路之外的其它链路的类型为物理通道, 其中, 其它链路包括: 第二链路。 当 然在实际应用中, 在多条链路中, 一部分链路采用物理链路, 一部分链路采用物理通 道也是可行的。 在本实施例提供的包处理装置中, 多条链路中的第二链路与预先设置的多个端口 中的第二端口是对应的, 其中, 多个端口包括: 第一端口和第二端口, 第二端口与第 一端口是不相同的。其中,第二端口与多个包处理方式中的第二包处理方式是对应的。 优选地, 包数据可以包括: 合法报文。 下面结合图 4和图 5以及优选实施例对上述实施例提供的包处理方法进行更详细 的说明。 在以下优选实施例中, 将以四个功能模块为基础对整个包处理流程进行描述。 首先, 对以下用的四个功能模块的功能进行适当说明: 控制软件模块, 负责通过控制软件的方式控制包处理的过程, 该模块内置的软件 中集成有: 物理链路的设置、 报文查找匹配识别硬件表项的设置, 以及包处理过程和 流程的设置等。 物理链路模块, 该模块包括: 物理层 (Physical Layer, 简称为 PHY) 片、 现场可 编程门阵列 (Field— Programmable Gate Array, 简称为 FPGA), 或者 UFE3等。 报文查找匹配模块, 该模块中主要包含有网络处理器内部的一些硬件表项, 和搜 索、 散列算法 (Hash Function, 简称为 HASH) 引擎等。 包处理模块, 该模块中主要包含有网络处理器内部的一些软件资源, 例如: 缓冲 区, 队列等, 主要用来对包进行修改, 增加, 删除操作。 图 4是根据本发明优选实施例的包处理方法的过程示意图, 如图 4所示, 该过程 主要包括: (1 ) 对于物理链路模块的每一个链路或者通道, 其在将非法报文丢弃后将 合法报文发送给在报文查找匹配模块上预先分配的一个对应的端口(port),其中, port 就代表了通道, 间接代表了该通道中的合法报文的处理需求; (2) 报文查找匹配模块 不必再浪费大量的时间在大量的硬件表里查找、 匹配等操作了, 可以直接将合法报文 发送给包处理模块; (3 ) 包处理模块直接使用对应于上述传输合法报文的端口的包处 理方式 (即与 port相关联的包处理方式) 对合法报文进行包处理操作 (即: 对包进行 修改, 增加, 删除操作)。 请同时参考图 5, 图 5是根据本发明优选实施例的包处理装置中各个模块间的控 制关系示意图, 如图 5所示: 控制软件模块根据需要向其它三个模块下发控制命令, 以控制整个包处理流程; 物理链路模块接受控制软件模块的控制命令后, 配置物理属 性, 从物理链路或者通道上接收合法的包(即合法报文), 并丢弃掉非法的包(非法报 文);报文查找匹配模块接受控制软件模块的控制命令后,准备相应的硬件表项和搜索、 HASH引擎, 一旦有包从 port进入时不再对包进行查找、 匹配等操作, 而是将包直接 发给包处理模块; 包处理模块直接使用对应于预先设置在报文查找匹配模块终端的端 口 (对应于每物理链路或物理通道) 的包处理方式对包进行处理。 在实现本优选实施例 (即实现网络处理器的包处理性能) 的过程中, 可以通过控 制软件来控制对网络处理器的配置来实现, 其中, 对于每条通道业务而言, 控制软件 配置的过程可以包括: TECHNICAL FIELD The present invention relates to the field of communications, and in particular to a packet processing method and apparatus. BACKGROUND With the rapid development of network systems, intermediate devices of network systems have experienced the development stages of general-purpose processors, application-specific integrated circuits (ASICs), and general-purpose network processors. Due to the low cost and programmable flexibility of network processors, network processors are becoming more widely used. It is not enough for the network processor to have only the above two advantages, and it has to have higher performance than conventional ASIC chips. For example, the role of the network processor is mainly to control the processing of the package in software. Therefore, in addition to the design of the hardware itself, a good software design can also improve the packet processing performance of the network processor. 1 is a flowchart of a packet processing method of a network processor according to the related art. In the packet processing flow, the following steps are mainly included: (1) entering all physical links/channels in a physical link module. A legal packet enters the packet search matching identification module through a unique port; (2) The packet search matching identification module has prepared the service or channel corresponding entry in advance according to the configuration of the control software, and the packet search matches. The search engine or the HASH engine in the identification module searches and matches the internal entries one by one according to the characteristics of the incoming legal packets, and sends the matched legal packets to the packet processing module; (3) the packet processing module uses and The packet processing method associated with the entry processes the package. In this software design mode, a large number of search and matching operations of the message are required, so that the packet processing capability of the network processor is relatively low. It can be seen that the software design performance of the current network processor cannot meet the high performance requirements in the packet processing, resulting in a relatively low packet processing capability. Aiming at the problem that the packet processing capability of the network processor in the related art is relatively low, an effective solution has not been proposed yet. SUMMARY OF THE INVENTION The present invention provides a packet processing method and apparatus to solve at least the above problems. According to an aspect of the present invention, a packet processing method is provided, including: receiving packet data from a first link through a first port corresponding to a first link of a plurality of links; using a plurality of packet processing manners Medium and first end The first packet processing mode corresponding to the port performs packet processing on the packet data, where the number of multiple packet processing modes is the same as the number of multiple links. Preferably, the type of the first link includes: a physical link or a physical channel. Preferably, when the type of the first link is a physical link, the types of the links other than the first link of the plurality of links are physical links, and the other links include: the second link When the type of the first link is a physical channel, the types of the links other than the first link in the multiple links are physical channels, and the other links include: the second link. Preferably, the second link of the plurality of links corresponds to the second port of the plurality of preset ports, wherein the multiple ports include: the first port and the second port, the second port and the first port The ports are not the same. Preferably, the second port corresponds to a second packet processing manner of the plurality of packet processing modes. Preferably, the packet data includes: a legal message. According to another aspect of the present invention, a packet processing apparatus is provided, comprising: a receiving module, configured to receive packet data from a first link through a first port corresponding to a first link of the plurality of links; The processing module is configured to perform packet processing on the packet data by using a first packet processing manner that matches the first port in the multiple packet processing manner, where the number of the multiple packet processing modes is the same as the number of the multiple links. Preferably, the type of the first link includes: a physical link or a physical channel. Preferably, when the type of the first link is a physical link, the types of the links other than the first link of the plurality of links are physical links, and the other links include: the second link When the type of the first link is a physical channel, the types of the links other than the first link in the multiple links are physical channels, and the other links include: the second link. Preferably, the second link of the plurality of links corresponds to the second port of the plurality of preset ports, wherein the multiple ports include: the first port and the second port, the second port and the first port The ports are not the same. Preferably, the second port corresponds to a second packet processing manner of the plurality of packet processing modes. Preferably, the packet data includes: a legal message. According to the present invention, after a port having a corresponding relationship is set for each physical link or a physical channel, the packet processing mode can directly use the packet processing mode corresponding to the port to enter the legal packet. The method of processing the packet processing solves the problem that the packet processing capability of the network processor in the related art is relatively low, thereby achieving the effect of saving packet search and matching time and improving the packet processing efficiency of the network processor. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are set to illustrate,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 1 is a schematic flowchart of a packet processing method of a network processor according to the related art; FIG. 2 is a flowchart of a packet processing method according to an embodiment of the present invention; FIG. 3 is a packet processing apparatus according to an embodiment of the present invention; 4 is a schematic diagram of a process of a packet processing method according to a preferred embodiment of the present invention; and FIG. 5 is a schematic diagram of a control relationship between modules in a packet processing apparatus according to a preferred embodiment of the present invention. BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict. This embodiment provides a packet processing method. 2 is a flowchart of a packet processing method according to an embodiment of the present invention. As shown in FIG. 2, the method mainly includes the following steps (step S202-step S204): Step S202, by using a first link with multiple links. The corresponding first port receives packet data from the first link. Step S204: Perform packet processing on the packet data by using a first packet processing manner corresponding to the first port in the multiple packet processing manners, where the number of the multiple packet processing modes is the same as the number of the multiple links. Through the above two steps, the packet processing operation of the legal packet can be directly performed by using the packet processing mode corresponding to the port for the packet after the port is configured for the physical link or the physical channel. In this embodiment, the type of the first link may include: a physical link or a physical channel. The above-mentioned multiple links may be physical links or physical channels. Of course, in practical applications, some links use physical links, and some links use physical channels. In this embodiment, (1) when When the type of the first link is a physical link, the type of the link other than the first link in the multiple links is a physical link, and the other links include: a second link; When the type of the first link is a physical channel, the types of the links other than the first link are physical channels, and the other links include: the second link. In this embodiment, the second link of the multiple links corresponds to the second port of the plurality of ports that are preset, wherein the multiple ports may include: a first port and a second port, and a second The port is not the same as the first port. Preferably, the second port corresponds to a second packet processing manner of the plurality of packet processing modes. In this embodiment, the packet data may include: a legal message. In a practical application, for a physical link or a physical channel, when all the packets are received, the illegal packets are discarded and only legitimate packets are transmitted. The packets of the port corresponding to the physical link or the physical channel are legal packets. When a port corresponding to each physical link or physical channel receives a legal packet, it does not need to look up and match the packet processing mode and the legal packet as in the existing packet processing mode. When a port is configured, a mapping relationship between the port and the packet processing mode is established. Therefore, the packet processing operation of the legal packet transmitted by the port can be directly performed by using the corresponding packet processing mode, thereby eliminating the search matching process and improving the processing. The efficiency of packet processing. This embodiment provides a packet processing apparatus. FIG. 3 is a structural block diagram of a packet processing apparatus according to an embodiment of the present invention. The apparatus is used to implement the packet processing method provided by the foregoing embodiment. As shown in FIG. 3, the apparatus includes: a receiving module 10 and a processing module 20. The receiving module 10 is configured to receive packet data from the first link by using a first port corresponding to the first link of the multiple links; the processing module 20 is connected to the receiving module 10, and is configured to use multiple The first packet processing mode that matches the first port in the packet processing mode performs packet processing on the packet data, where the number of multiple packet processing modes is the same as the number of multiple links. In this embodiment, the type of the first link may include: a physical link or a physical channel. Preferably, when the type of the first link is a physical link, the types of the links other than the first link of the plurality of links are physical links, and the other links include: the second link When the type of the first link is a physical channel, the types of the links other than the first link in the multiple links are physical channels, and the other links include: the second link. Of course, in practical applications, in a plurality of links, some links adopt physical links, and some links use physical channels are also feasible. In the packet processing apparatus provided in this embodiment, the second link of the plurality of links corresponds to the second port of the plurality of ports that are preset, wherein the multiple ports include: the first port and the second port Port, the second port is different from the first port. The second port corresponds to the second packet processing mode of the multiple packet processing modes. Preferably, the packet data may include: a legal message. The packet processing method provided by the above embodiment will be described in more detail below with reference to FIG. 4 and FIG. 5 and a preferred embodiment. In the following preferred embodiment, the entire packet processing flow will be described on the basis of four functional modules. First, the functions of the four function modules used below are appropriately explained: The control software module is responsible for controlling the process of packet processing by means of control software. The built-in software of the module integrates: physical link setting, message lookup Matches the settings that identify hardware entries, as well as the settings of the package processing and processes. Physical link module, the module includes: physical layer (Physical Layer, referred to as PHY) chip, Field-Programmable Gate Array (FPGA), or UFE3. The message search matching module, the module mainly includes some hardware entries inside the network processor, and a search and hash algorithm (Hash Function, referred to as HASH) engine. Packet processing module, which mainly contains some software resources inside the network processor, such as: buffer, queue, etc., mainly used to modify, add, delete operations. FIG. 4 is a schematic diagram of a process of a packet processing method according to a preferred embodiment of the present invention. As shown in FIG. 4, the process mainly includes: (1) for each link or channel of the physical link module, the packet is illegal. After being discarded, the legal packet is sent to a corresponding port (port) pre-allocated on the packet matching module. The port represents the channel and indirectly represents the processing requirements of the legal packet in the channel. The packet search matching module does not have to waste a lot of time to search and match in a large number of hardware tables, and can directly send the legal message to the packet processing module; (3) the packet processing module directly uses the corresponding transmission law. The packet processing mode of the port of the packet (that is, the packet processing mode associated with the port) performs packet processing operations on the legal packet (that is, the packet is modified, added, deleted). Please refer to FIG. 5 at the same time. FIG. 5 is a schematic diagram of a control relationship between modules in a packet processing apparatus according to a preferred embodiment of the present invention. As shown in FIG. 5, the control software module issues control commands to other three modules as needed. The entire packet processing process is controlled. After receiving the control command of the control software module, the physical link module configures physical attributes, receives legal packets (ie, legitimate packets) from the physical link or channel, and discards illegal packets (illegal packets). After the message search matching module accepts the control command of the control software module, prepare the corresponding hardware entry and the search, HASH engine, and once the package enters from the port, the package is not searched, matched, etc., but Direct package Sending to the packet processing module; the packet processing module directly processes the packet using a packet processing manner corresponding to a port (corresponding to each physical link or physical channel) that is preset in the packet search matching module terminal. In implementing the preferred embodiment (ie, implementing packet processing performance of the network processor), the configuration of the network processor can be controlled by the control software, wherein, for each channel service, the control software is configured. The process can include:
( 1 )根据一条通道业务的需求,配置该物理通道, 主要是 PHY片, FPGA, UFE3 等。 (1) According to the requirements of a channel service, the physical channel is configured, mainly PHY chip, FPGA, UFE3, and the like.
(2)由于一条通道业务的需求决定该通道上包的处理方法, 因此在包处理模块中 为该通道增加一个包处理方法。 (3 )在报文查找匹配模块里建立一个 port,用该 port把物理通道和增加的包处理 方法关联起来。 (2) Since the demand of one channel service determines the processing method of the packet on the channel, a packet processing method is added to the channel in the packet processing module. (3) Establish a port in the message lookup matching module, and use the port to associate the physical channel with the added packet processing method.
(4) 有报文进入物理通道时, 非法包会被丢弃, 合法包进入 port。 (4) When a packet enters the physical channel, the illegal packet is discarded and the legal packet enters the port.
(5) port上进入查找匹配流程的开关关闭,包直接进入与 port关联的包处理方法。 (5) The switch that enters the search matching process on the port is closed, and the packet directly enters the packet processing method associated with the port.
(6) 包处理方法对包进行增加、 删除、 修改操作, 完成了包处理过程。 采用上述实施例提供的包处理方法及装置, 可以通过增加的 port将物理通道和包 处理方法进行关联的方式, 避免了采用查找匹配表项来关联方式导致的包处理性能比 较低的问题, 从而提高了网络处理器的包处理效率。 从以上的描述中, 可以看出, 本发明实现了如下技术效果: 采用预先为每条物理 链路或物理通道设置一个具有对应关系的端口后, 对于通过该端口后的报文可以直接 使用与该端口对应的包处理方式对合法报文进行包处理操作的方式, 解决了相关技术 中网络处理器的包处理能力比较低的问题, 进而达到了节省报文查找、 匹配的时间, 提高网络处理器的包处理效率的效果。 工业实用性 本发明提供的技术方案, 可以预先为每条物理链路或物理通道设置一个具有对应 关系的端口, 对于通过该端口后的报文可以直接使用与该端口对应的包处理方式对合 法报文进行包处理操作。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以用通用 的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多个计算装置所 组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码来实现, 从而, 可以 将它们存储在存储装置中由计算装置来执行, 并且在某些情况下, 可以以不同于此处 的顺序执行所示出或描述的步骤, 或者将它们分别制作成各个集成电路模块, 或者将 它们中的多个模块或步骤制作成单个集成电路模块来实现。 这样, 本发明不限制于任 何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领域的技 术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和原则之内, 所作的 任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。 (6) The packet processing method adds, deletes, and modifies the packet, and completes the packet processing process. The packet processing method and device provided by the foregoing embodiments can associate the physical channel and the packet processing method by using the added port, thereby avoiding the problem that the packet processing performance is relatively low due to the association method of finding the matching entry. Improve the packet processing efficiency of the network processor. From the above description, it can be seen that the present invention achieves the following technical effects: After a port having a corresponding relationship is set for each physical link or physical channel in advance, the packet after passing the port can be directly used and The packet processing mode corresponding to the port performs the packet processing operation on the legal packet, which solves the problem that the packet processing capability of the network processor in the related art is relatively low, thereby saving the time for packet search and matching, and improving network processing. The effect of the package processing efficiency. Industrial Applicability According to the technical solution provided by the present invention, a port having a corresponding relationship may be set for each physical link or physical channel in advance, and the packet processing method corresponding to the port may be directly used for the packet passing through the port. The packet is processed by a packet. Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software. The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Claims

权 利 要 求 书 Claim
1. 一种包处理方法, 包括: A packet processing method, comprising:
通过与多条链路中的第一链路对应的第一端口接收来自所述第一链路的包 数据;  Receiving packet data from the first link through a first port corresponding to a first one of the plurality of links;
使用多个包处理方式中与所述第一端口对应的第一包处理方式对所述包数 据进行包处理, 其中, 所述多个包处理方式的数目与所述多条链路的数目是相 同的。  And performing packet processing on the packet data by using a first packet processing manner corresponding to the first port in a plurality of packet processing manners, where a number of the multiple packet processing manners and a number of the multiple links are identical.
2. 根据权利要求 1所述的方法, 其中, 所述第一链路的类型包括: 物理链路或物 理通道。 2. The method according to claim 1, wherein the type of the first link comprises: a physical link or a physical channel.
3. 根据权利要求 2所述的方法, 其中, 当所述第一链路的类型为所述物理链路时, 所述多条链路中除所述第一链 路之外的其它链路的类型为所述物理链路, 其中, 所述其它链路包括: 第二链 路; The method according to claim 2, wherein when the type of the first link is the physical link, other links of the plurality of links except the first link The type is the physical link, where the other link includes: a second link;
当所述第一链路的类型为所述物理通道时, 所述多条链路中除所述第一链 路之外的其它链路的类型为所述物理通道, 其中, 所述其它链路包括: 第二链 路。  When the type of the first link is the physical channel, the type of the link other than the first link of the multiple links is the physical channel, where the other chain The road includes: The second link.
4. 根据权利要求 1所述的方法, 其中, 所述多条链路中的第二链路与预先设置的 多个端口中的第二端口是对应的, 其中, 所述多个端口包括: 所述第一端口和 所述第二端口, 所述第二端口与所述第一端口是不相同的。 The method according to claim 1, wherein the second link of the plurality of links corresponds to a second port of the plurality of ports that are preset, wherein the multiple ports include: The first port and the second port are different from the first port.
5. 根据权利要求 4所述的方法, 其中, 所述第二端口与所述多个包处理方式中的 第二包处理方式是对应的。 The method according to claim 4, wherein the second port corresponds to a second packet processing manner of the plurality of packet processing modes.
6. 根据权利要求 1至 5中任一项所述的方法, 其中, 所述包数据包括: 合法报文。 The method according to any one of claims 1 to 5, wherein the packet data comprises: a legal message.
7. —种包处理装置, 包括: 接收模块, 设置为通过与多条链路中的第一链路对应的第一端口接收来自 所述第一链路的包数据; 处理模块, 设置为使用多个包处理方式中与所述第一端口匹配的第一包处 理方式对所述包数据进行包处理, 其中, 所述多个包处理方式的数目与所述多 条链路的数目是相同的。 7. A packet processing apparatus, comprising: a receiving module, configured to receive packet data from the first link through a first port corresponding to a first one of the plurality of links; a processing module, configured to perform packet processing on the packet data by using a first packet processing manner that matches the first port in a plurality of packet processing manners, where the number of the multiple packet processing manners is different from the multiple The number of links is the same.
8. 根据权利要求 7所述的装置, 其中, 所述第一链路的类型包括: 物理链路或物 理通道。 8. The apparatus according to claim 7, wherein the type of the first link comprises: a physical link or a physical channel.
9. 根据权利要求 8所述的装置, 其中, 9. The device according to claim 8, wherein
当所述第一链路的类型为所述物理链路时, 所述多条链路中除所述第一链 路之外的其它链路的类型为所述物理链路, 其中, 所述其它链路包括: 第二链 路;  When the type of the first link is the physical link, the type of the link other than the first link of the multiple links is the physical link, where Other links include: a second link;
当所述第一链路的类型为所述物理通道时, 所述多条链路中除所述第一链 路之外的其它链路的类型为所述物理通道, 其中, 所述其它链路包括: 第二链 路。  When the type of the first link is the physical channel, the type of the link other than the first link of the multiple links is the physical channel, where the other chain The road includes: The second link.
10. 根据权利要求 7所述的装置, 其中, 所述多条链路中的第二链路与预先设置的 多个端口中的第二端口是对应的, 其中, 所述多个端口包括: 所述第一端口和 所述第二端口, 所述第二端口与所述第一端口是不相同的。 The device according to claim 7, wherein the second link of the plurality of links corresponds to a second port of the plurality of ports that are preset, wherein the multiple ports include: The first port and the second port are different from the first port.
11. 根据权利要求 10所述的装置,其中,所述第二端口与所述多个包处理方式中的 第二包处理方式是对应的。 11. The apparatus of claim 10, wherein the second port corresponds to a second packet processing mode of the plurality of packet processing modes.
12. 根据权利要求 7至 11中任一项所述的装置,其中,所述包数据包括:合法报文。 The apparatus according to any one of claims 7 to 11, wherein the packet data comprises: a legal message.
PCT/CN2014/075409 2013-05-15 2014-04-15 Packet processing method and device WO2014183521A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310182462.5 2013-05-15
CN201310182462.5A CN104168199B (en) 2013-05-15 2013-05-15 Packet processing method and device

Publications (1)

Publication Number Publication Date
WO2014183521A1 true WO2014183521A1 (en) 2014-11-20

Family

ID=51897672

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/075409 WO2014183521A1 (en) 2013-05-15 2014-04-15 Packet processing method and device

Country Status (2)

Country Link
CN (1) CN104168199B (en)
WO (1) WO2014183521A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113852555B (en) * 2021-09-26 2022-12-16 天翼数字生活科技有限公司 Gateway-based multi-channel route fast forwarding and intelligent routing method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567839A (en) * 2003-06-24 2005-01-19 华为技术有限公司 Port based network access control method
CN101847106A (en) * 2009-02-20 2010-09-29 株式会社日立制作所 Packet processing device and method by multiple processor cores
CN102984065A (en) * 2011-09-07 2013-03-20 盛科网络(苏州)有限公司 Message processing method of super-interface label space and message processing device of super-interface label space

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100512091C (en) * 2005-01-25 2009-07-08 华为技术有限公司 Multi-channel data signal processing method and apparatus
CN101047695A (en) * 2006-03-30 2007-10-03 西门子(中国)有限公司 Method for implementing selection of multi-service and dynamic service in digital customer line
US7925860B1 (en) * 2006-05-11 2011-04-12 Nvidia Corporation Maximized memory throughput using cooperative thread arrays
CN101626343B (en) * 2009-08-05 2012-04-04 华为技术有限公司 Method and apparatus for exchanging data packet, and communication device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567839A (en) * 2003-06-24 2005-01-19 华为技术有限公司 Port based network access control method
CN101847106A (en) * 2009-02-20 2010-09-29 株式会社日立制作所 Packet processing device and method by multiple processor cores
CN102984065A (en) * 2011-09-07 2013-03-20 盛科网络(苏州)有限公司 Message processing method of super-interface label space and message processing device of super-interface label space

Also Published As

Publication number Publication date
CN104168199B (en) 2019-07-16
CN104168199A (en) 2014-11-26

Similar Documents

Publication Publication Date Title
US10659342B2 (en) Flow entry configuration method, apparatus, and system
Azzouni et al. Limitations of openflow topology discovery protocol
US9954791B2 (en) Network interface selection for network connections
WO2014101777A1 (en) Flow table matching method and device, and switch
US9246815B2 (en) Load reducing system and load reducing method
KR101938623B1 (en) Openflow communication method, system, controller, and service gateway
US10887280B2 (en) Cloud platform security achievement
KR102025680B1 (en) SDN based ARP implementation method and device
WO2019127134A1 (en) Data transmission method and virtual switch
US11646976B2 (en) Establishment of fast forwarding table
TWI455531B (en) Network processor
CN110381025B (en) Implementation method of software defined firewall system
CN112910793B (en) Method for connection multiplexing in seven-layer load balancing and load balancer
CN114745255B (en) Hardware chip, DPU, server, communication method and related device
US10313275B2 (en) Packet forwarding
CN107682267B (en) Network data forwarding method and system of Linux equipment
US10951520B2 (en) SDN, method for forwarding packet by SDN, and apparatus
WO2018014742A1 (en) Method and apparatus for configuring port of port extender
US9270593B2 (en) Prediction based methods for fast routing of IP flows using communication/network processors
WO2022028342A1 (en) Method for processing congestion flow and device
WO2015149367A1 (en) Method and device for processing packet
WO2015165270A1 (en) Data packet processing method and device
WO2014183521A1 (en) Packet processing method and device
WO2022100511A1 (en) Method and device for processing forwarding entry
CN105704023B (en) Message forwarding method and device of stacking system and stacking equipment

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: 14797030

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: 14797030

Country of ref document: EP

Kind code of ref document: A1