WO2015165270A1 - 一种数据包处理方法及设备 - Google Patents

一种数据包处理方法及设备 Download PDF

Info

Publication number
WO2015165270A1
WO2015165270A1 PCT/CN2014/095242 CN2014095242W WO2015165270A1 WO 2015165270 A1 WO2015165270 A1 WO 2015165270A1 CN 2014095242 W CN2014095242 W CN 2014095242W WO 2015165270 A1 WO2015165270 A1 WO 2015165270A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
flow table
priority
newly created
created data
Prior art date
Application number
PCT/CN2014/095242
Other languages
English (en)
French (fr)
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 WO2015165270A1 publication Critical patent/WO2015165270A1/zh
Priority to US15/337,081 priority Critical patent/US10230647B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2441Traffic characterised by specific attributes, e.g. priority or QoS relying on flow classification, e.g. using integrated services [IntServ]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/64Routing or path finding of packets in data switching networks using an overlay routing layer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/38Flow based routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Definitions

  • the present application relates to the field of network communications, and in particular, to a data packet processing method and device.
  • OpenFlow technology was proposed by Stanford University to solve the bottlenecks of the current network facing new services based on the existing TCP/IP technology conditions and the innovative network interconnection concept. Its core idea is to transform the packet forwarding process, which was originally controlled by the switch/router, into an independent process completed by the OpenFlow switch and the controller respectively.
  • the OpenFlow switch executes commands from the controller in the OpenFlow network, and matches the received data packets with the flow table in the OpenFlow switch.
  • the OpenFlow switch forwards the successfully matched data packet to the corresponding port, and forwards the unmatched data packet to the controller, and the controller determines the forwarding action of the data packet.
  • the OpenFlow switch Invalid portions will not match successful packets, and invalid packets may contain more important packets, causing important packets to be discarded.
  • the purpose of the embodiments of the present invention is to provide a data packet processing method and device, which are used to solve the problem of discarding important data packets when the number of unsuccessfully matched data packets is excessive and the forwarding load exceeds the forwarding capability of the OpenFlow switch. .
  • a data packet processing method including:
  • the received data packet is matched by the flow table in the flow table, and the received data packet is determined to be a newly created data packet, where the newly created data packet is a data packet that needs to be reported to the controller to determine a processing manner;
  • the information reported to the controller includes target priority information of the newly created data packet, so that the controller receives the target according to the target priority
  • the new data packet is processed.
  • the determining a target priority of the newly created data packet includes:
  • the method before the matching the data packet to the flow table, the method further includes:
  • the initial priority is set for the received data packet.
  • the flow table is a multi-level flow table, and if the new data is found in the flow table The priority update instruction in the flow entry is executed, and the priority of the newly created data packet is updated according to the priority update command, specifically:
  • the initial priority of the newly created data packet is taken as the target priority
  • the priority level determined by the previous flow table of the current flow table is determined as the target priority.
  • the method further includes:
  • the reporting the new data packet to the controller according to the target priority includes:
  • a data packet processing apparatus including:
  • a matching unit configured to perform a flow table matching on the received data packet in the flow table, and determine that the received data packet is a newly created data packet, where the newly created data packet is a data packet that needs to be reported to the controller to determine a processing manner;
  • a determining unit connected to the matching unit, configured to determine a target priority of the newly created data packet
  • the reporting unit is configured to report the newly created data packet to the controller according to the target priority.
  • the information reported by the reporting unit to the controller includes target priority information of the newly created data packet, so that the controller preferentially according to the target The level processes the received new data packet.
  • the determining unit includes:
  • a first determining sub-unit configured to: when a flow entry matching the new data packet is found in the flow table, perform a priority update instruction in the flow entry, and update according to the priority The command updates the priority of the newly created data packet, and determines that the updated priority is a target priority of the newly created data packet;
  • a second determining subunit configured to determine, when the flow table entry that matches the newly created data packet is not found in the flow table, that the target priority of the newly created data packet is an initial priority.
  • the method further includes:
  • a setting unit connected to the matching unit, configured to set the initial priority for the received data packet.
  • the flow table is a multi-level flow table
  • the first determining sub-unit is configured to: when the flow entry matching the new data packet is found in the current flow table in the multi-level flow table, perform priority in the flow entry a level update instruction, updating a priority of the newly created data packet according to the priority update instruction;
  • the current flow table is a non-first flow table in the multi-level flow table, and the priority determined by the previous flow table of the current flow table for the newly created data packet is taken as the target priority.
  • the method further includes:
  • a receiving unit configured to receive a flow table processing command sent by the controller, where the flow table processing command includes the priority update command;
  • an establishing unit configured to be connected to the receiving unit, configured to establish the flow entry in the flow table according to the flow table processing command, where the instruction set of the flow entry is the priority update command.
  • the reporting unit includes:
  • a package subunit configured to encapsulate information about the newly created data packet and a target priority corresponding to the newly created data packet, to obtain a data packet message
  • the reporting subunit is connected to the encapsulating subunit, and is configured to report the data packet message to the controller according to the target priority.
  • a data packet processing method determines a target priority of a final newly created data packet in a process of matching a flow table by a data packet, and prioritizes according to the target.
  • the class forwards the packet to the controller.
  • the data packet processing method provided by the embodiment of the present invention determines the priority of the data packet that enters the OpenFlow switch, and forwards the priority of the data packet that has not been successfully matched according to the priority of the data packet. Packets with a high priority are not discarded.
  • FIG. 1 is a flowchart of a method for processing a data packet according to an embodiment of the present invention
  • FIG. 2 is a flowchart of still another method for processing a data packet according to an embodiment of the present invention
  • FIG. 3 is a flowchart of still another method for processing a data packet according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of still another method for processing a data packet according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of still another method for processing a data packet according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a data packet processing device according to an embodiment of the present disclosure.
  • FIG. 7 is still another schematic structural diagram of a data packet processing device according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of a hardware of a data packet processing device according to an embodiment of the present invention.
  • the embodiment of the invention provides a data packet processing method, which is applied to an OpenFlow switch.
  • the OpenFlow switch consists of a flow table, a secure channel, and an OpenFlow protocol.
  • the flow table is used to store the forwarding rules of the data packet.
  • the secure channel is the interface connecting the OpenFlow switch to the controller.
  • the OpenFlow protocol is used to describe the standard of information used for interaction between the controller and the switch.
  • the OpenFlow switch receives the flow forwarding rules sent by the OpenFlow controller and stores them in a device called a flow table.
  • Each entry in the flow table is a flow rule.
  • the flow rule is composed of a matching field Match Field, a counter, and an instruction set, wherein the matching field is used to match the received data packet, the counter records the statistical information that the entry matches the data packet, and the instruction set determines how the packet is forwarded. .
  • the matching domain is divided into two categories, one is called exact matching, that is, the data packet needs to be exactly equal to the matching domain to be successfully matched; the other is called the wildcard matching, that is, a part of the data packet and the matching.
  • the corresponding part of the matching domain is equal, the matching is successful, and the rest can be ignored in the matching process.
  • the negating rule is determined by the masking bit in the matching domain.
  • the data packet processing method provided by the embodiment of the present invention is mainly directed to the flow table structure in the OpenFlow switch, and the execution body of the method may be an OpenFlow switch, and the flowchart of the method is as shown in FIG. 1 , and includes:
  • Step S101 Perform a flow table matching on the received data packet in the flow table, and determine that the received data packet is a newly created data packet, where the newly created data packet is a data packet that needs to be reported to the controller to determine a processing manner;
  • the OpenFlow switch performs the flow table matching on the received data packet in the flow table, and determines that the received data packet is a newly created data packet, and the newly created data packet is not matched in the flow table.
  • the data packet of the flow entry is matched by the flow entry, and the matching result is the data packet forwarded to the controller.
  • Step S102 determining a target priority of the newly created data packet
  • the same initial priority is set for each received data packet, and the data packet is matched in the flow table. Matching the result, determining the target priority of the newly created data packet.
  • Step S103 Report the newly created data packet to the controller according to the target priority.
  • the target priority in the embodiment of the present invention is the updated priority of the newly created data packet, and each data packet is sorted according to the target priority, and the newly created data packet is directed according to the target priority of each newly created data packet.
  • the controller performs reporting.
  • the information reported to the controller includes target priority information of the newly created data packet, so that the control server processes the received new data packet according to the target priority.
  • the OpenFlow switch sets the initial priority of each data packet received, and the OpenFlow switch sets the initial priority value of the same data type for each data packet.
  • the data type of the initial priority value may be an enumerated type.
  • the initial priority description of the data packet can be preset in the OpenFlow switch and the OpenFlow controller, and the priority of the received data packet is predefined to be 5 levels, and the priority of the data packet is divided into the highest priority, the high priority, and the medium priority. Level, low priority, and lowest priority, and prioritize for each level The level of the corresponding enumeration value is set.
  • the enumeration value of the highest priority is 4, the enumeration value of the high priority is 3, and the enumeration value of the medium priority is 2, and the enumeration of the low priority is The value is 1, and the lowest priority enumeration value is 0.
  • the initial priority of each received data packet is set to a medium priority, and the initial priority value of each data packet is 2.
  • the OpenFlow switch sets an initial priority of the same value for each received data packet, and each data packet that has been updated by the priority has different on the basis of having the same initial priority. Priority, the priority of some packets is updated to the highest priority, the priority of some packets is updated to low priority, and then the packets that do not match successfully are sorted according to their respective corresponding updated priorities.
  • the high-priority data packet is preferentially sent to the OpenFlow controller.
  • the data packet with high priority represents an important data packet, thereby avoiding important data packets being discarded.
  • a flowchart of determining a target priority of the newly created data packet includes:
  • Step S201 Perform matching of the received data packet in the flow table, and determine that the received data packet is a newly created data packet.
  • Step S202 determining whether the flow table entry matching the new data packet is found in the flow table, if not found step S203; otherwise, executing step S204;
  • Step S203 determining that the target priority of the newly created data packet is an initial priority
  • the target priority of the newly created data packet is determined as an initial priority of the newly created data packet.
  • the OpenFlow switch when receiving the data packet, sets an identical initial priority for each received data packet.
  • Step S204 Perform a priority update instruction in the flow entry.
  • Step S205 Update the priority of the newly created data packet according to the priority update instruction.
  • Step S206 Determine that the updated priority is the target priority of the newly created data packet.
  • the OpenFlow protocol 1.2 and above specifies the multi-flow table structure of the OpenFlow switch. That is, there are multiple flow tables in the switch, which respectively store the flow rules of different contents. For the received data packets, the matching is started from the first flow table Table0, according to the entries. The instruction set in the subsequent flow table Line serial lookup.
  • the process of determining the target priority of the data packet includes:
  • Step S301 setting an initial priority for the received data packet
  • Step S302 Perform matching of the received data packet in the flow table, and determine that the received data packet is a newly created data packet.
  • Step S303 determining whether the flow table entry matching the new data packet is found in the flow table; if found, step S304 is performed; otherwise, step S306 is performed;
  • Step S304 Perform a priority update instruction in the flow entry, and update a priority of the newly created data packet according to the priority update instruction.
  • Step S305 determining that the updated priority is a target priority of the newly created data packet
  • Step S306 determining whether the current flow table is the first flow table in the multi-level flow table; if yes, executing step S307; otherwise, executing step S308;
  • Step S307 The initial priority of the newly created data packet is taken as a target priority
  • Step S308 The priority level determined by the previous level flow table of the current flow table is determined as the target priority.
  • Each flow table in the OpenFlow switch has an associative sequence, and the OpenFlow switch searches the received data packet by each of the flow tables in the multi-level flow table in the order of association of the multi-level flow table. .
  • a flowchart of a method for establishing a flow entry in a flow table includes:
  • Step S401 Receive a flow table processing command sent by the controller, where the flow table processing command includes the priority update command;
  • Step S402 The flow entry is established in the flow table according to the flow table processing command, and the instruction set of the flow entry is the priority update instruction.
  • the data packet received by the OpenFlow switch includes various information of the data packet, where the data packet information includes a source IP address of the data packet and a specific content in the data packet;
  • the controller pre-processes a packet downstream table processing command that may be received by the OpenFlow switch, where the flow table processing command includes a priority update instruction.
  • the priority of the data packet sent by the important IP address is defined as a high priority, and the corresponding priority increasing instruction is sent, and the priority of the data packet sent by the ordinary IP address is delivered. Defined as low priority, the corresponding priority reduction instruction is issued.
  • the OpenFlow switch creates a flow entry in the flow table according to the flow table processing command sent by the controller, where the instruction set of the flow entry is the priority update command.
  • the OpenFlow switch When the OpenFlow switch receives a packet, it sets the same initial priority for each packet it receives.
  • the OpenFlow switch searches for the flow entry from the first flow table in the order of the multi-level flow table, and performs the priority in the flow entry when the flow entry corresponding to the data packet is found.
  • a level update instruction updating an initial priority of the data packet, and forwarding the data packet to a corresponding port according to a forwarding instruction in the flow entry, or forwarding the data packet to a next-level flow table, Continue to find the flow table entry in the next level flow table.
  • the data packet is The initial priority is used as the target priority of the data packet. If the initial priority value of the data packet is the enumeration value 2, the target priority of the data packet is 2.
  • the upper-level flow table of the current flow table is determined as the priority of the data packet as the target of the data packet.
  • a priority that is, the priority of the upper-level flow table of the current flow table is 3 for the data packet, and when the flow entry corresponding to the data packet is not found in the current flow table, The target priority of the packet is determined to be 3.
  • the data packets that are not matched successfully are cached in the data pool, and the forwarding order of each data packet is sorted according to the target priority corresponding to each data packet, and the data packet with high priority is preferentially reported to the OpenFlow control. Device.
  • a flowchart of reporting a data packet in an embodiment of the present invention includes:
  • Step S501 Encapsulating the information of the newly created data packet and the target priority corresponding to the newly created data packet to obtain a data packet message;
  • Step S502 Report the data packet message to the controller according to the target priority.
  • the OpenFlow switch When the newly created data packet is matched with the flow table of the multi-level flow table in the OpenFlow switch, and the flow entry corresponding to the newly created data packet is not found in the flow table, the OpenFlow switch will information about the newly created data packet. And encapsulating the target priority corresponding to the newly created data packet, generating packet in information, sending the packet in information to the controller, and determining, by the controller, a forwarding port of the data packet.
  • the information of the newly created data packet may be all the data packet information in the newly created data packet, or may be part of the information of the newly created data packet.
  • the packet in information includes packet information such as header, buffer_id, total_len, reason, table_id, match, pad, data, etc., where:
  • Header indicates the header of the packet in message
  • Buffer_id indicates the ID value of the OpenFlow switch cache packet
  • Total_len indicates the total length of this message, and the length unit is byte
  • the table_id indicates that the current message is processed by the internal flow table of the OpenFlow switch.
  • Match represents a series of matching fields related to packet matching, including the port of the OpenFlow switch, the source MAC address of the data packet, the destination MAC address, the source IP address, and the destination IP address.
  • Pad represents the padding byte
  • Data represents the specific data content in the packet.
  • the information of the newly created data packet and the target priority corresponding to the newly created data packet are encapsulated.
  • a priority field may be added to the sent packet in message, and the new data is added.
  • the information of the packet is sent to the control server together with the target priority corresponding to the newly created data packet.
  • the embodiment of the present invention provides a data packet processing device, where the data packet processing device may be an OpenFlow switch, and is mainly configured for a flow table structure in an OpenFlow switch, and the structure of the device is as follows: As shown in Figure 6, it includes:
  • the matching unit 601 is configured to perform the flow table matching on the received data packet in the flow table, and determine that the received data packet is a newly created data packet, where the newly created data packet is a data packet that needs to be reported to the controller to determine a processing manner. ;
  • a determining unit 602 connected to the matching unit, configured to determine a target priority of the newly created data packet
  • the reporting unit 603 is configured to report the newly created data packet to the controller according to the target priority.
  • the information reported by the reporting unit 603 to the controller includes target priority information of the newly created data packet, so that the controller receives the new received according to the target priority. Create a packet for processing.
  • the embodiment of the present invention provides a detailed structure diagram of a data packet processing device, where the specific determining unit includes:
  • a first determining sub-unit 605 configured to: when a flow entry matching the new data packet is found in the flow table, perform a priority update instruction in the flow entry, according to the priority
  • the update instruction updates the priority of the newly created data packet, and determines that the updated priority is the target priority of the newly created data packet;
  • the second determining sub-unit 606 is configured to determine, when the flow table entry that matches the newly created data packet is not found in the flow table, that the target priority of the newly created data packet is an initial priority.
  • the first determining sub-unit 605 is specifically configured to: if the current flow table in the multi-level flow table is found, match the newly created data packet.
  • the second determining sub-unit 606 is specifically configured to: If the current flow table in the multi-level flow table does not find the flow entry matching the new data packet, determine whether the current flow table is the first flow table in the multi-level flow table, if The current flow table is the first flow table in the multi-level flow table, and the initial priority of the newly created data packet is used as a target priority; if the current flow table is in the multi-level flow table If the flow table is not the first, the priority of the previous flow table of the current flow table is determined by using the priority determined by the new data packet as the target priority.
  • the packet processing device shown in FIG. 6 further includes:
  • the setting unit 604 is connected to the matching unit, and is configured to set the initial priority for the received data packet.
  • the receiving unit 610 is configured to receive a flow table processing command sent by the controller, where the flow table processing command includes the priority update command;
  • the establishing unit 609 is connected to the receiving unit, and configured to establish, according to the flow table processing command, the flow entry in the flow table, where the instruction set of the flow entry is the priority update command .
  • the reporting unit includes:
  • the encapsulating subunit 607 is configured to encapsulate information about the newly created data packet and a target priority corresponding to the newly created data packet to obtain a data packet message.
  • the reporting sub-unit 608 is connected to the encapsulating sub-unit, and is configured to report the data packet message to the controller according to the target priority.
  • the data packet processing device provided by the embodiment of the present invention is applied to an OpenFlow switch, and is directed to The flow table structure in the OpenFlow switch, the setting unit 604 assigns an identical initial priority to each received data packet, and the matching unit 601 matches the received data packet in the flow table to determine the flow table.
  • the received data packet is a newly created data packet, and the newly created data packet is a data packet that needs to be reported to the controller to determine a processing manner.
  • the determining unit 602 determines the target priority of the newly created data packet, and the reporting unit 603 reports the newly created data packet to the controller according to the target priority. Applying the device provided by the embodiment of the present invention, the priority of the data packet entering the OpenFlow switch is determined.
  • the priority with the highest priority is forwarded according to the priority of the data packet, and the priority is ensured.
  • the high data packet is not discarded.
  • the data type of the initial priority value may be an enumerated type.
  • the initial priority description of the data packet may be preset in the OpenFlow switch and the controller, and the priority of the received data packet is predefined to be 5 levels, and the priority of the data packet is divided into the highest priority and the high priority. Priority, medium priority, low priority, and lowest priority, and the corresponding enumeration value is set for the priority of each level.
  • the highest priority enumeration value is 4, and the high priority is The enumeration value is 3, the medium priority enumeration value is 2, the low priority enumeration value is 1, and the lowest priority enumeration value is 0.
  • the initial priority of each received data packet is set to a medium priority, and the initial priority value of each data packet is 2.
  • the data packet processing device provided by the embodiment of the present invention sets an initial priority of the same value for each received data packet.
  • each data packet updated by the priority has different priorities.
  • the priority of some packets is updated to the highest priority, the priority of some packets is updated to low priority, and then the packets that do not match successfully are sorted according to their respective updated priorities, which will be prioritized.
  • the data packets of the high level are preferentially sent to the OpenFlow controller.
  • the data packets with high priority represent important data packets, thereby avoiding important data packets being discarded.
  • FIG. 8 is a schematic structural diagram of still another data packet processing device according to an embodiment of the present invention.
  • the device 701 may include a CPU 702 and a memory 703 in hardware.
  • the CPU 702 can at least perform the following steps by running the software program 704 stored in the memory 703 and calling the data stored in the memory 705:
  • the received data packet is matched by the flow table in the flow table, and the received data packet is determined to be a newly created data packet, where the newly created data packet is a data packet that needs to be reported to the controller to determine a processing manner;
  • the CPU 702 and the memory 703 can be integrated in the same chip, or can be two independent devices.
  • the program 704 in the embodiment of the present invention may specifically include: a matching unit, a determining unit, and a reporting unit.
  • the structure and function of the matching unit, the determining unit, and the reporting unit may be specifically referred to in the foregoing description, and details are not described herein again.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules is only a logical function division.
  • there may be another division manner for example, multiple modules or components may be combined or Can be integrated into another device, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some communication interface, device or module, and may be in an electrical, mechanical or other form.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules 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 modules may be selected according to actual needs to implement the objectives of the solution of the embodiment.
  • each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. In the block.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请公开了一种数据包处理方法,包括:将接收到的数据包在流表中进行流表匹配,确定所述接收到的数据包为新建数据包,所述新建数据包为需要上报控制器确定处理方式的数据包;确定所述新建数据包的目标优先级;将所述新建数据包按所述目标优先级向所述控制器进行上报。本发明实施例提供的数据包处理方法,确定了进入OpenFlow交换机中的数据包的优先级,对于未匹配成功的数据包,依据其优先级的高低,将优先级高的优先进行转发,保证了优先级高的数据不被丟弃。

Description

一种数据包处理方法及设备 技术领域
本申请涉及网络通信领域,特别是涉及一种数据包处理方法及设备。
背景技术
OpenFlow技术由斯坦福大学提出,旨在基于现有TCP/IP技术条件,以创新的网络互联理念解决当前网络面对新业务产生的种种瓶颈。它的核心思想就是将原本完全由交换机/路由器控制的数据包转发过程,转化为OpenFlow交换机和控制器分别完成的独立过程。
OpenFlow交换机在OpenFlow网络中执行来自控制器的命令,将接收到的数据包与OpenFlow交换机中的流表进行流表匹配。OpenFlow交换机将匹配成功的数据包转发至相应端口,将未匹配成功的数据包转发给控制器,由控制器决定该数据包的转发动作。
发明人经过研究发现,OpenFlow交换机在将所述大量未匹配成功的数据包转发给控制器的过程中,当未匹配成功的数据包数量过多,转发负载超过OpenFlow交换机的转发能力时,OpenFlow交换机会无效部分未匹配成功的数据包,而被无效的数据包中可能会包含比较重要的数据包,从而导致重要的数据包被丢弃。
发明内容
有鉴于此,本发明实施例的目的在于提供一种数据包处理方法及设备,以解决当未匹配成功的数据包数量过多,转发负载超过OpenFlow交换机的转发能力时,丢弃重要数据包的问题。
根据本发明实施例的第一方面,提供一种数据包处理方法,包括:
将接收到的数据包在流表中进行流表匹配,确定所述接收到的数据包为新建数据包,所述新建数据包为需要上报控制器确定处理方式的数据包;
确定所述新建数据包的目标优先级;
将所述新建数据包按所述目标优先级向所述控制器进行上报。
结合第一方面,在第一种可能的实现方式中,向所述控制器上报的信息中包括所述新建数据包的目标优先级信息,以便所述控制器根据所述目标优先级对收到的所述新建数据包进行处理。
结合第一方面,在第二种可能的实现方式中,所述确定所述新建数据包的目标优先级,包括:
若在所述流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新,确定所述更新后的优先级为所述新建数据包的目标优先级;
若在所述流表中未找到与所述新建数据包相匹配的流表项时,确定所述新建数据包的目标优先级为初始优先级。
结合第一方面的第二种可能的实现方式,在第三种可能的实现方式中,所述将接收到的数据包进行流表匹配之前,所述方法还包括:
为所述接收到的数据包设置所述初始优先级。
结合第一方面的第二种可能的实现方式,在第四种可能的实现方式中,所述流表为多级流表,则所述若在所述流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新,具体为:
若在所述多级流表中的当前流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新;
所述若在所述流表中未找到与所述新建数据包相匹配的流表项时,确定所述新建数据包的目标优先级为初始优先级,具体为:
若在所述多级流表中的当前流表中未找到与所述新建数据包相匹配的流表项时,确定所述当前流表是否为所述多级流表中的首个流表,若所述当前流表为所述多级流表中的首个流表,则将所述新建数据包的初始优先级作为目标优先级;
若所述当前流表为所述多级流表中的非首个流表,则将所述当前流表的前一级流表为所述新建数据包确定的优先级作为目标优先级。
结合第一方面的第二种可能的实现方式,在第五种可能的实现方式中,所述方法还包括:
接收所述控制器下发的流表处理命令,所述流表处理命令中包含所述优 先级更新指令;
根据所述流表处理命令,在所述流表中建立所述流表项,所述流表项的指令集为所述优先级更新指令。
结合第一方面,在第六种可能的实现方式中,所述将所述新建数据包按所述目标优先级向所述控制器进行上报包括:
对所述新建数据包的信息及所述新建数据包对应的目标优先级进行封装,获得数据包消息;
将所述数据包消息按所述目标优先级向所述控制器进行上报。
根据本发明实施例的第二方面,提供一种数据包处理设备,包括:
匹配单元,用于将接收到的数据包在流表中进行流表匹配,确定所述接收到的数据包为新建数据包,所述新建数据包为需要上报控制器确定处理方式的数据包;
确定单元,与所述匹配单元相连接,用于确定所述新建数据包的目标优先级;
上报单元,用于将所述新建数据包按所述目标优先级向所述控制器进行上报。
结合第二方面,在第一种可能的实现方式中,所述上报单元向所述控制器上报的信息中包括所述新建数据包的目标优先级信息,以便所述控制器根据所述目标优先级对收到的所述新建数据包进行处理。
结合第二方面,在第二种可能的实现方式中,所述确定单元包括:
第一确定子单元,用于若在所述流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新,确定所述更新后的优先级为所述新建数据包的目标优先级;
第二确定子单元,用于若在所述流表中未找到与所述新建数据包相匹配的流表项时,确定所述新建数据包的目标优先级为初始优先级。
结合第二方面的第二种可能的实现方式,在第三种可能的实现方式中,其特征在于,还包括:
设置单元,与所述匹配单元相连接,用于为所述接收到的数据包设置所述初始优先级。
结合第二方面的第一种可能的实现方式,在第四种可能的实现方式中, 所述流表为多级流表,则
所述第一确定子单元,具体用于若在所述多级流表中的当前流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新;
所述第二确定子单元,具体用于:若在所述多级流表中的当前流表中未找到与所述新建数据包相匹配的流表项时,确定所述当前流表是否为所述多级流表中的首个流表,若所述当前流表为所述多级流表中的首个流表,则将所述新建数据包的初始优先级作为目标优先级;若所述当前流表为所述多级流表中的非首个流表,则将所述当前流表的前一级流表为所述新建数据包确定的优先级作为目标优先级。
结合第二方面的第一种可能的实现方式,在第五种可能的实现方式中,还包括:
接收单元,用于接收所述控制器下发的流表处理命令,所述流表处理命令中包含所述优先级更新指令;
建立单元,与所述接收单元相连接,用于根据所述流表处理命令,在所述流表中建立所述流表项,所述流表项的指令集为所述优先级更新指令。
结合第二方面,在第六种可能的实现方式中,所述上报单元包括:
封装子单元,用于对所述新建数据包的信息及所述新建数据包对应的目标优先级进行封装,获得数据包消息;
上报子单元,与所述封装子单元相连接,用于将所述数据包消息按所述目标优先级向所述控制器进行上报。
由以上本发明实施例提供的技术方案可见,本发明实施例提供的一种数据包处理方法,在数据包进行流表匹配的过程确定最终新建数据包的目标优先级,并依据所述目标优先级将所述数据包转发至控制器中。本发明实施例提供的数据包处理方法,确定了进入OpenFlow交换机中的数据包的优先级,对于未匹配成功的数据包,依据其优先级的高低,将优先级高的优先进行转发,保证了优先级高的数据包不被丢弃。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有 技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种数据包处理方法的方法流程图;
图2为本发明实施例提供的一种数据包处理方法的又一方法流程图;
图3为本发明实施例提供的一种数据包处理方法的又一方法流程图;
图4为本发明实施例提供的一种数据包处理方法的又一方法流程图;
图5为本发明实施例提供的一种数据包处理方法的又一方法流程图;
图6为本发明实施例提供的一种数据包处理设备的结构示意图;
图7为本发明实施例提供的一种数据包处理设备的又一结构示意图;
图8为本发明实施例提供的一种数据包处理设备的一硬件结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案。下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
本发明实施例提供一种数据包处理方法,该方法应用于OpenFlow交换机。OpenFlow交换机由流表、安全通道和OpenFlow协议三部分组成。其中,流表用来存储数据包的转发规则,安全通道是连接OpenFlow交换机到控制器的接口,OpenFlow协议用来描述控制器和交换机之间交互所用信息的标准。
OpenFlow交换机接收OpenFlow控制器所下发的流转发规则,并将其存储在称为流表的装置中,流表的每一个表项即为一个流规则。流规则由匹配域Match Field、计数器和指令集组成,其中,匹配域用来与接收到的数据包进行匹配,计数器记录了该表项与数据包匹配的统计信息,指令集决定报文如何转发。
其中,匹配域分为两类,一类称作精确匹配,即数据包需要与该匹配域完全相等才作为匹配成功;一类称作通配匹配项,即数据包的一部分与该匹 配域中的对应部分相等即为匹配成功,其余部分可以在匹配过程中忽略,该忽略规则由匹配域中的掩码位决定。
本发明实施例提供的数据包处理方法,主要针对OpenFlow交换机中的流表结构,该方法的执行主体可以为OpenFlow交换机,所述方法的流程图如图1所示,包括:
步骤S101:将接收到的数据包在流表中进行流表匹配,确定所述接收到的数据包为新建数据包,所述新建数据包为需要上报控制器确定处理方式的数据包;
本发明实施例中,OpenFlow交换机将接收到的数据包在流表中进行流表匹配,并确定所述接收到的数据包为新建数据包,所述新建数据包为在流表中未匹配到流表项的数据包或经过流表项匹配,匹配结果为转发给控制器处理的数据包。
步骤S102:确定所述新建数据包的目标优先级;
本发明实施例中,将接收到的数据包在流表中进行流表匹配之前,为所述接收到的每一个数据包设置相同的初始优先级,数据包进行流表匹配的过程中,依据匹配结果,确定所述新建数据包的目标优先级。
步骤S103:将所述新建数据包按所述目标优先级向所述控制器进行上报。
本发明实施例中的目标优先级为新建数据包经过更新后的优先级,针对所述目标优先级对各个数据包进行排序,依据每一个新建数据包的目标优先级将所述新建数据包向所述控制器进行上报。
本发明实施例中,向所述控制器上报的信息中包括所述新建数据包的目标优先级信息,以便所述控制服务器根据所述目标优先级对收到的所述新建数据包进行处理。
本发明实施例提供的数据包处理方法中,OpenFlow交换机为接收到的每一个数据包设置的初始优先级相同,OpenFlow交换机为每一个数据包设置相同数据类型的初始优先级数值。
本发明实施例中,所述初始优先级数值的数据类型可以为枚举类型。可以在OpenFlow交换机及OpenFlow控制器中预先设置数据包的初始优先级描述,将接收的数据包的优先级预定义为5级,数据包的优先级分为最高优先级、高优先级、中等优先级、低优先级及最低优先级,并且为每一级的优先 级设置相应的枚举数值,本发明实施例中,最高优先级的枚举数值为4,高优先级的枚举数值为3,中等优先级的枚举数值为2,低优先级的枚举数值为1,最低优先级的枚举数值为0。
本发明实施例中,将接收到的每一个数据包的初始优先级设置为中等优先级,每一个数据包的初始优先级数值为2。
本发明实施例提供的数据包处理方法,OpenFlow交换机为接收到的每一个数据包设置相同数值的初始优先级,在具有相同初始优先级的基础上,经过优先级更新的各个数据包会具有不同的优先级,有些数据包的优先级被更新为最高优先级,有些数据包的优先级被更新为低优先级,然后对未匹配成功的数据包依据其各自对应的经过更新的优先级进行排序,将优先级高的数据包优先发送至OpenFlow控制器,本发明实施例中,优先级高的数据包代表重要的数据包,从而避免了重要的数据包被丢弃。
参考图2,示出本发明实施例确定所述新建数据包的目标优先级的流程图,包括:
步骤S201:将接收到的数据包在流表中进行流表匹配,确定所述接收到的数据包为新建数据包;
步骤S202:判断在所述流表中是否查找到与所述新建数据包相匹配的流表项,如果未查找到执行步骤S203;否则,执行步骤S204;
步骤S203:确定所述新建数据包的目标优先级为初始优先级;
本发明实施例中,当接收到数据包,在流表中对所述数据包进行流表匹配时,若在流表中未查找到与所述新建数据包相匹配的流表项时,将所述新建数据包的目标优先级确定为所述新建数据包的初始优先级。
本发明实施例中,OpenFlow交换机接收到数据包时,为接收到的每一个数据包均设置一相同的初始优先级。
步骤S204:执行所述流表项中的优先级更新指令;
步骤S205:依据所述优先级更新指令对所述新建数据包的优先级进行更新;
步骤S206:确定所述更新后的优先级为所述新建数据包的目标优先级。
OpenFlow协议1.2及以上版本规定了OpenFlow交换机的多流表结构,即交换机中存在多张流表,分别存储不同内容的流规则,对于接收到的数据包,从第一张流表Table0开始进行匹配,根据表项中的指令集对后续流表进 行串行查找。
本发明实施例中,当OpenFlow交换机中的流表为多级流表时,确定数据包的目标优先级的过程,如本发明实施例图3所示,包括:
步骤S301:为接收到的数据包设置初始优先级;
步骤S302:将接收到的数据包在流表中进行流表匹配,确定所述接收到的数据包为新建数据包;
步骤S303:判断在所述流表中是否查找到与所述新建数据包相匹配的流表项;如果查找到,执行步骤S304;否则,执行步骤S306;
步骤S304:执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新;
步骤S305:确定所述更新后的优先级为所述新建数据包的目标优先级;
步骤S306:判断当前流表是否为多级流表中的首个流表;如果是,执行步骤S307;否则,执行步骤S308;
步骤S307:将所述新建数据包的初始优先级作为目标优先级;
步骤S308:将所述当前流表的前一级流表为所述新建数据包确定的优先级作为目标优先级。
OpenFlow交换机中的各个流表之间具有关联顺序,OpenFlow交换机将接收到的数据包按所述多级流表的关联顺序,逐次与所述多级流表中的每一个流表查找流表项。
参考图4,示出了本发明实施例中在流表中建立流表项的方法流程图,包括:
步骤S401:接收所述控制器下发的流表处理命令,所述流表处理命令中包含所述优先级更新指令;
步骤S402:根据所述流表处理命令,在所述流表中建立所述流表项,所述流表项的指令集为所述优先级更新指令。
本发明实施例提供的数据包处理方法中,OpenFlow交换机接收到的数据包中包含有数据包的各种信息,所述数据包信息包括数据包的源IP地址及数据包中的具体内容等;控制器预先对OpenFlow交换机可能接收到的数据包下流表处理命令,所述流表处理命令中包含有优先级更新指令。例如根据数据包的源IP地址进行下发,将重要IP地址发送的数据包的优先级定义为高优先级,下发相应的优先级增加指令,对普通IP地址发送的数据包的优先级 定义为低优先级,下发相应的优先级减少指令。
OpenFlow交换机,根据所述控制器下发的流表处理命令,在流表中建立流表项,所述流表项的指令集为所述优先级更新指令。
当OpenFlow交换机接收到数据包时,为接收到的每一个数据包设置相同的初始优先级。OpenFlow交换机将每一个数据包按多级流表的顺序,从第一流表开始查找流表项,当查找到与所述数据包相对应的流表项时,执行所述流表项中的优先级更新指令,对所述数据包的初始优先级进行更新,并依据所述流表项中的转发指令将所述数据包转发至相应端口或将所述数据包转发至下一级流表,在下一级流表中继续查找流表项。
当在某一流表中未查找到与所述数据包相对应的流表项时,判断当前匹配的流表是否多级流表中的第一个流表,如果是,将所述数据包的初始优先级作为所述数据包的目标优先级,如所述数据包的初始优先级数值为枚举数值2,则所述数据包的目标优先级为2.
当所述当前匹配的流表不是所述多级流表中的第一流表时,将所述当前流表的上一级流表为所述数据包确定的优先级作为所述数据包的目标优先级,如所述当前流表的上一级流表为所述数据包确定的优先级为3,在当前流表中未查找到与所述数据包相对应的流表项时,将所述数据包的目标优先级确定为3。
本发明实施例中,将未匹配成功的数据包缓存至数据池中,依据各个数据包对应的目标优先级对各个数据包的转发顺序进行排序,将优先级高的数据包优先上报至OpenFlow控制器。
参考图5,示出了本发明实施例中数据包上报的流程图,包括:
步骤S501:对所述新建数据包的信息及所述新建数据包对应的目标优先级进行封装,获得数据包消息;
步骤S502:将所述数据包消息按所述目标优先级向所述控制器进行上报。
当新建数据包与OpenFlow交换机中的多级流表进行流表匹配,在流表中未查找到与所述新建数据包相对应的流表项时,OpenFlow交换机会将所述新建数据包的信息及所述新建数据包对应的目标优先级进行封装,生成packet in信息,将所述packet in信息发送至控制器,由所述控制器决定所述数据包的转发端口。
本发明实施例中,封装的新建数据包的信息可以为新建数据包中的全部数据包信息,也可以为新建数据包的部分信息。
所述packet in信息中包含了header、buffer_id、total_len、reason、table_id、match、pad、data等数据包信息;其中:
header表示packet in消息的头部;
buffer_id表示OpenFlow交换机缓存数据包的ID值;
total_len表示本消息的总长度,长度单位为字节;
reason表示OpenFlow交换机上报本消息的来源;
table_id表示本消息是经过OpenFlow交换机内部的哪个流表处理后上报的;
match表示与数据包匹配相关的一系列匹配域,其中包括了数据包进行OpenFlow交换机的端口、数据包的源MAC地址、目的MAC地址、源IP地址、目的IP地址等;
pad表示填充字节;
data表示数据包中具体的数据内容。
本发明实施例中,对所述新建数据包的信息及所述新建数据包对应的目标优先级进行封装,具体的实现方式可以在发送的packet in消息中增加优先级字段,将所述新建数据包的信息与所述新建数据包对应的目标优先级一同发送给控制服务器。
与图1所示的方法相对应,本发明实施例提供一种数据包处理设备,所述数据包处理设备可以为OpenFlow交换机,主要针对OpenFlow交换机中的流表结构,所述设备的结构示意图如图6所示,包括:
匹配单元601,用于将接收到的数据包在流表中进行流表匹配,确定所述接收到的数据包为新建数据包,所述新建数据包为需要上报控制器确定处理方式的数据包;
确定单元602,与所述匹配单元相连接,用于确定所述新建数据包的目标优先级;
上报单元603,用于将所述新建数据包按所述目标优先级向所述控制器进行上报。
进一步的,上报单元603向所述控制器上报的信息中包括所述新建数据包的目标优先级信息,以便所述控制器根据所述目标优先级对收到的所述新 建数据包进行处理。
在图6的基础上,本发明实施例提供了数据包处理设备的一详细结构示意图,具体的所述确定单元包括:
第一确定子单元605,用于若在所述流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新,确定所述更新后的优先级为所述新建数据包的目标优先级;
第二确定子单元606,用于若在所述流表中未找到与所述新建数据包相匹配的流表项时,确定所述新建数据包的目标优先级为初始优先级。
当所述流表为多级流表时,优选的,第一确定子单元605,具体用于若在所述多级流表中的当前流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新;第二确定子单元606,具体用于:若在所述多级流表中的当前流表中未找到与所述新建数据包相匹配的流表项时,确定所述当前流表是否为所述多级流表中的首个流表,若所述当前流表为所述多级流表中的首个流表,则将所述新建数据包的初始优先级作为目标优先级;若所述当前流表为所述多级流表中的非首个流表,则将所述当前流表的前一级流表为所述新建数据包确定的优先级作为目标优先级。
图6所示的数据包处理设备中,还包括:
设置单元604,与所述匹配单元相连接,用于为所述接收到的数据包设置所述初始优先级。
接收单元610,用于接收所述控制器下发的流表处理命令,所述流表处理命令中包含所述优先级更新指令;
建立单元609,与所述接收单元相连接,用于根据所述流表处理命令,在所述流表中建立所述流表项,所述流表项的指令集为所述优先级更新指令。
图6所示的数据包处理设备中,所述上报单元包括:
封装子单元607,用于对所述新建数据包的信息及所述新建数据包对应的目标优先级进行封装,获得数据包消息;
上报子单元608,与所述封装子单元相连接,用于将所述数据包消息按所述目标优先级向所述控制器进行上报。
本发明实施例提供的数据包处理设备,应用于OpenFlow交换机,针对 OpenFlow交换机中的流表结构,设置单元604为接收到的每一个数据包均赋予一相同的最初优先级,所述匹配单元601将接收到的数据包在流表中进行流表匹配,确定所述接收到的数据包为新建数据包,所述新建数据包为需要上报控制器确定处理方式的数据包。确定单元602确定新建数据包的目标优先级,上报单元603将所述新建数据包按所述目标优先级向所述控制器进行上报。应用本发明实施例提供的设备,确定了进入OpenFlow交换机中的数据包的优先级,对于未匹配成功的数据包,依据其优先级的高低,将优先级高的优先进行转发,保证了优先级高的数据包不被丢弃本发明实施例中,所述初始优先级数值的数据类型可以为枚举类型。
本发明实施例中,可以在OpenFlow交换机及控制器中预先设置数据包的初始优先级描述,将接收的数据包的优先级预定义为5级,数据包的优先级分为最高优先级、高优先级、中等优先级、低优先级及最低优先级,并且为每一级的优先级设置相应的枚举数值,本发明实施例中,最高优先级的枚举数值为4,高优先级的枚举数值为3,中等优先级的枚举数值为2,低优先级的枚举数值为1,最低优先级的枚举数值为0。
本发明实施例中,将接收到的每一个数据包的初始优先级设置为中等优先级,每一个数据包的初始优先级数值为2。
本发明实施例提供的数据包处理设备为接收到的每一个数据包设置相同数值的初始优先级,在具有相同初始优先级的基础上,经过优先级更新的各个数据包会具有不同的优先级,有些数据包的优先级被更新为最高优先级,有些数据包的优先级被更新为低优先级,然后对未匹配成功的数据包依据其各自对应的经过更新的优先级进行排序,将优先级高的数据包优先发送至OpenFlow控制器,本发明实施例中,优先级高的数据包代表重要的数据包,从而避免了重要的数据包被丢弃。
图8为本发明实施例提供的又一种数据包处理设备的结构示意图,该设备701在硬件上可以包括CPU702和存储器703。其中,CPU702通过运行存储在存储器703内的软件程序704以及调用存储在存储器705内的数据,至少可执行如下步骤:
将接收到的数据包在流表中进行流表匹配,确定所述接收到的数据包为新建数据包,所述新建数据包为需要上报控制器确定处理方式的数据包;
确定所述新建数据包的目标优先级;
将所述新建数据包按所述目标优先级向所述控制器进行上报。
上述步骤的具体细节请参见本文前述记载,在此不作赘述。
同理,CPU702和存储器703可集成于同一芯片内,也可为独立的两个器件。
本发明实施例中程序704具体可以包括:匹配单元、确定单元和上报单元,所述匹配单元、确定单元和上报单元的结构与功能具体可参见本文前述记载,在此不再赘述。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的设备和模块的具体工作过程,可以参考前述方法实施例中的对应过程描述,在此不再赘述。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的设备和模块的具体工作过程,可以参考前述方法实施例中的对应过程描述,在此不再赘述。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个设备中,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部,模块来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模 块中。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (14)

  1. 一种数据包处理方法,其特征在于,包括:
    将接收到的数据包在流表中进行流表匹配,确定所述接收到的数据包为新建数据包,所述新建数据包为需要上报控制器确定处理方式的数据包;
    确定所述新建数据包的目标优先级;
    将所述新建数据包按所述目标优先级向所述控制器进行上报。
  2. 根据权利要求1所述的方法,其特征在于,向所述控制器上报的信息中包括所述新建数据包的目标优先级信息,以便所述控制器根据所述目标优先级对收到的所述新建数据包进行处理。
  3. 根据权利要求1所述的方法,其特征在于,所述确定所述新建数据包的目标优先级,包括:
    若在所述流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新,确定所述更新后的优先级为所述新建数据包的目标优先级;
    若在所述流表中未找到与所述新建数据包相匹配的流表项时,确定所述新建数据包的目标优先级为初始优先级。
  4. 根据权利要求3所述的方法,其特征在于,所述将接收到的数据包进行流表匹配之前,所述方法还包括:
    为所述接收到的数据包设置所述初始优先级。
  5. 根据权利要求3所述的方法,其特征在于,所述流表为多级流表,则所述若在所述流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新,具体为:
    若在所述多级流表中的当前流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新;
    所述若在所述流表中未找到与所述新建数据包相匹配的流表项时,确定所述新建数据包的目标优先级为初始优先级,具体为:
    若在所述多级流表中的当前流表中未找到与所述新建数据包相匹配的流表项时,确定所述当前流表是否为所述多级流表中的首个流表,若所述当前流表为所述多级流表中的首个流表,则将所述新建数据包的初始优先级作为目标优先级;
    若所述当前流表为所述多级流表中的非首个流表,则将所述当前流表的前一级流表为所述新建数据包确定的优先级作为目标优先级。
  6. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    接收所述控制器下发的流表处理命令,所述流表处理命令中包含所述优先级更新指令;
    根据所述流表处理命令,在所述流表中建立所述流表项,所述流表项的指令集为所述优先级更新指令。
  7. 根据权利要求1所述的方法,其特征在于,所述将所述新建数据包按所述目标优先级向所述控制器进行上报包括:
    对所述新建数据包的信息及所述新建数据包对应的目标优先级进行封装,获得数据包消息;
    将所述数据包消息按所述目标优先级向所述控制器进行上报。
  8. 一种数据包处理设备,其特征在于,包括:
    匹配单元,用于将接收到的数据包在流表中进行流表匹配,确定所述接收到的数据包为新建数据包,所述新建数据包为需要上报控制器确定处理方式的数据包;
    确定单元,与所述匹配单元相连接,用于确定所述新建数据包的目标优先级;
    上报单元,用于将所述新建数据包按所述目标优先级向所述控制器进行上报。
  9. 根据权利要求8所述的设备,其特征在于,所述上报单元向所述控制器上报的信息中包括所述新建数据包的目标优先级信息,以便所述控制器根据所述目标优先级对收到的所述新建数据包进行处理。
  10. 根据权利要求8所述的设备,其特征在于,所述确定单元包括:
    第一确定子单元,用于若在所述流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新,确定所述更新后的优先级为所述新 建数据包的目标优先级;
    第二确定子单元,用于若在所述流表中未找到与所述新建数据包相匹配的流表项时,确定所述新建数据包的目标优先级为初始优先级。
  11. 根据权利要求9所述的设备,其特征在于,还包括:
    设置单元,与所述匹配单元相连接,用于为所述接收到的数据包设置所述初始优先级。
  12. 根据权利要求9所述的设备,其特征在于,所述流表为多级流表,则
    所述第一确定子单元,具体用于:若在所述多级流表中的当前流表中查找到与所述新建数据包相匹配的流表项时,执行所述流表项中的优先级更新指令,依据所述优先级更新指令对所述新建数据包的优先级进行更新;
    所述第二确定子单元,具体用于:若在所述多级流表中的当前流表中未找到与所述新建数据包相匹配的流表项时,确定所述当前流表是否为所述多级流表中的首个流表,若所述当前流表为所述多级流表中的首个流表,则将所述新建数据包的初始优先级作为目标优先级;若所述当前流表为所述多级流表中的非首个流表,则将所述当前流表的前一级流表为所述新建数据包确定的优先级作为目标优先级。
  13. 根据权利要求9所述的设备,其特征在于,还包括:
    接收单元,用于接收所述控制器下发的流表处理命令,所述流表处理命令中包含所述优先级更新指令;
    建立单元,与所述接收单元相连接,用于根据所述流表处理命令,在所述流表中建立所述流表项,所述流表项的指令集为所述优先级更新指令。
  14. 根据权利要求8所述的设备,其特征在于,所述上报单元包括:
    封装子单元,用于对所述新建数据包的信息及所述新建数据包对应的目标优先级进行封装,获得数据包消息;
    上报子单元,与所述封装子单元相连接,用于将所述数据包消息按所述目标优先级向所述控制器进行上报。
PCT/CN2014/095242 2014-04-30 2014-12-29 一种数据包处理方法及设备 WO2015165270A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/337,081 US10230647B2 (en) 2014-04-30 2016-10-28 Data packet processing method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410182161.7 2014-04-30
CN201410182161.7A CN105099942B (zh) 2014-04-30 2014-04-30 一种数据包处理方法及设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/337,081 Continuation US10230647B2 (en) 2014-04-30 2016-10-28 Data packet processing method and device

Publications (1)

Publication Number Publication Date
WO2015165270A1 true WO2015165270A1 (zh) 2015-11-05

Family

ID=54358129

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/095242 WO2015165270A1 (zh) 2014-04-30 2014-12-29 一种数据包处理方法及设备

Country Status (3)

Country Link
US (1) US10230647B2 (zh)
CN (1) CN105099942B (zh)
WO (1) WO2015165270A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105553880B (zh) * 2015-12-24 2018-11-16 北京邮电大学 一种软件定义网络中的数据处理方法及装置
CN109768931B (zh) * 2017-11-09 2020-10-13 中国移动通信集团公司 处理数据包的方法、交换机、装置及计算机可读存储介质
JP7387563B2 (ja) * 2020-09-14 2023-11-28 株式会社東芝 無線通信装置、無線通信システム、無線通信方法及びプログラム
US11658903B2 (en) * 2021-04-06 2023-05-23 Arista Networks, Inc. Network device route programming

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103457878A (zh) * 2013-09-05 2013-12-18 电子科技大学 一种基于流的网络接入控制方法
CN103685310A (zh) * 2013-12-27 2014-03-26 上海恒为信息科技有限公司 一种用于虚拟专用拨号网中动态数据注入的装置及其方法
CN103685009A (zh) * 2012-08-31 2014-03-26 华为技术有限公司 数据包的处理方法、控制器及系统
CN103746892A (zh) * 2013-11-27 2014-04-23 北京邮电大学 一种基于OpenFlow的SDN虚拟化平台上行信令流标签处理方法
US20140112130A1 (en) * 2012-10-23 2014-04-24 Electronics And Telecommunications Research Institute Method for setting packet forwarding rule and control apparatus using the method

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010021762A (ja) * 2008-07-10 2010-01-28 Toshiba Corp 送信装置、中継装置、及び通信システム
US9450870B2 (en) * 2011-11-10 2016-09-20 Brocade Communications Systems, Inc. System and method for flow management in software-defined networks
CN102868645A (zh) * 2012-09-26 2013-01-09 盛科网络(苏州)有限公司 Openflow交换机系统及其报文处理方法
EP2800304A1 (en) * 2013-04-30 2014-11-05 Telefonaktiebolaget L M Ericsson (Publ) Technique for configuring a Software-Defined Network
US9461967B2 (en) * 2013-07-18 2016-10-04 Palo Alto Networks, Inc. Packet classification for network routing
US9680738B2 (en) * 2013-09-15 2017-06-13 Nicira, Inc. Tracking prefixes of values associated with different rules to generate flows
US9674087B2 (en) * 2013-09-15 2017-06-06 Nicira, Inc. Performing a multi-stage lookup to classify packets
CN103618679A (zh) * 2013-11-25 2014-03-05 上海华为技术有限公司 服务质量控制方法、装置和系统
WO2015152436A1 (ko) * 2014-03-31 2015-10-08 쿨클라우드㈜ Sdn 기반의 서비스 체이닝 시스템

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685009A (zh) * 2012-08-31 2014-03-26 华为技术有限公司 数据包的处理方法、控制器及系统
US20140112130A1 (en) * 2012-10-23 2014-04-24 Electronics And Telecommunications Research Institute Method for setting packet forwarding rule and control apparatus using the method
CN103457878A (zh) * 2013-09-05 2013-12-18 电子科技大学 一种基于流的网络接入控制方法
CN103746892A (zh) * 2013-11-27 2014-04-23 北京邮电大学 一种基于OpenFlow的SDN虚拟化平台上行信令流标签处理方法
CN103685310A (zh) * 2013-12-27 2014-03-26 上海恒为信息科技有限公司 一种用于虚拟专用拨号网中动态数据注入的装置及其方法

Also Published As

Publication number Publication date
US20170048153A1 (en) 2017-02-16
US10230647B2 (en) 2019-03-12
CN105099942A (zh) 2015-11-25
CN105099942B (zh) 2019-05-03

Similar Documents

Publication Publication Date Title
US10659342B2 (en) Flow entry configuration method, apparatus, and system
US11677851B2 (en) Accelerated network packet processing
US11422839B2 (en) Network policy implementation with multiple interfaces
US8311059B2 (en) Receive coalescing and automatic acknowledge in network interface controller
US9602428B2 (en) Method and apparatus for locality sensitive hash-based load balancing
WO2021043181A1 (zh) 一种数据传输方法及装置
CN108432194B (zh) 一种拥塞处理的方法、主机及系统
US9973400B2 (en) Network flow information collection method and apparatus
CN104052684A (zh) 动态适配计算机网络中的最大传输单元大小的方法和系统
EP3099032A1 (en) A load balancing method, device, system and computer storage medium
US10033619B2 (en) Data processing method and apparatus for OpenFlow network
WO2015165270A1 (zh) 一种数据包处理方法及设备
US20180324095A9 (en) Packet Processing Method and Device
WO2020043200A1 (zh) 建立快速转发表
WO2015113435A1 (zh) 基于并行协议栈实例的数据包处理方法和装置
US10587519B2 (en) Clos network load balancing method and apparatus
WO2014023098A1 (zh) 一种负载分担方法和流量转发设备
EP3589024A1 (en) Method and apparatus for processing message
US20150381775A1 (en) Communication system, communication method, control apparatus, control apparatus control method, and program
WO2016061985A1 (zh) 报文处理方法、装置及系统
US10291517B1 (en) Generating a dummy VLAN tag for indicating quality of service classification information in a distributed routing system
US9699072B2 (en) Packet handling in information centric networking networks
CN108810182B (zh) 一种基于openflow系统的NAT流表动态学习及配置方法
WO2016153477A1 (en) Compiling network policies

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

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

Country of ref document: EP

Kind code of ref document: A1