WO2019185051A1 - 一种基于集成流表转发报文的方法及装置 - Google Patents

一种基于集成流表转发报文的方法及装置 Download PDF

Info

Publication number
WO2019185051A1
WO2019185051A1 PCT/CN2019/080602 CN2019080602W WO2019185051A1 WO 2019185051 A1 WO2019185051 A1 WO 2019185051A1 CN 2019080602 W CN2019080602 W CN 2019080602W WO 2019185051 A1 WO2019185051 A1 WO 2019185051A1
Authority
WO
WIPO (PCT)
Prior art keywords
packet
packet header
message
flow table
header fields
Prior art date
Application number
PCT/CN2019/080602
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 WO2019185051A1 publication Critical patent/WO2019185051A1/zh
Priority to US16/725,247 priority Critical patent/US11496393B2/en

Links

Images

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • 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/741Routing in networks with a plurality of addressing schemes, e.g. with both IPv4 and IPv6
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • H04L49/3009Header conversion, routing tables or routing tags
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/35Switches specially adapted for specific applications
    • H04L49/354Switches specially adapted for specific applications for supporting virtual local area networks [VLAN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/70Virtual switches
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4604LAN interconnection over a backbone network, e.g. Internet, Frame Relay
    • H04L2012/4629LAN interconnection over a backbone network, e.g. Internet, Frame Relay using multilayer switching, e.g. layer 3 switching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables

Definitions

  • the present application relates to the field of communications, and in particular, to a method and an apparatus for forwarding a message based on an integrated flow table.
  • OVS Open Virtual Switch
  • the OVS After receiving the packet, the OVS needs to obtain multiple processing operations for processing the packet, where the multiple processing operations include forwarding operations for forwarding the packet and at least one other operation performed before the forwarding operation, and then according to the at least one An other operation processes the packet and forwards the processed packet.
  • the multiple processing operations include forwarding operations for forwarding the packet and at least one other operation performed before the forwarding operation, and then according to the at least one An other operation processes the packet and forwards the processed packet.
  • the OVS Since the OVS can only obtain one processing operation at a time, the OVS needs to find multiple tables after receiving the message, and obtain corresponding processing operations multiple times through different mapping relationships in these tables, so as to obtain multiple processing operations. It takes a long time to get all the operations, which is time consuming and inefficient for processing the message.
  • the embodiment of the present application provides a method and an apparatus for forwarding a message based on an integrated flow table.
  • the technical solution is as follows:
  • the application example provides a method for forwarding a message based on an integrated flow table, where the integrated flow table includes multiple flow entries, and each of the multiple flow entries includes a match.
  • the mapping relationship with the operation set, the matching item includes a plurality of message header fields, and the operation set includes a forwarding operation.
  • the first packet header field is extracted from the packet header of the first packet, where the multiple first packet header fields and the multiple flow tables are A plurality of packet header fields included in a flow entry of the item have the same category; and the target flow entry matching the plurality of first packet header fields is searched from the integrated flow table to determine
  • the operation set corresponding to the first packet, the operation set corresponding to the first packet further includes: between determining the operation set corresponding to the first packet and the forwarding operation, the first report Performing all other operations performed by the text; performing all the other operations in the operation set on the first packet to obtain a second packet corresponding to the first packet, and forwarding the second packet.
  • the target flow entry in the integrated flow table includes an operation set corresponding to the first packet, where the operation set includes all operations performed on the first packet, so that the first flow header field is searched according to the multiple first packet header fields.
  • the integrated flow table can find all the operations corresponding to the first packet, thereby improving the efficiency of processing and forwarding the first packet.
  • the operation corresponding to the operation set corresponding to the first packet may be: reading an operation set corresponding to the first packet or other processing circuit for causing the device based on the integrated flow table to forward the message to be ready to execute.
  • the operation in the operation set corresponding to the first packet that is, the operation included in the operation set corresponding to the first packet is for the field in the first packet (for example, it may be a packet header or a payload, or a packet header) And the operation of the field of the payload can achieve the effect that the information in the first packet is not required to be reused by other flow tables.
  • the operation set corresponding to the first packet further includes, after reading the operation set corresponding to the first packet and the forwarding operation, performing all the fields in the first packet Other operations refer to operations between forwarding operations after reading the operation set corresponding to the first packet.
  • the type of the field in the packet header is a type of information corresponding to the field or a position of the field in a header of the first packet.
  • the packet header of the first packet is compared with a string of masks to obtain the plurality of first packets in the first packet.
  • a header field, the mask indicating a location of the plurality of first packet header fields in a header of the first packet.
  • the first mask is generated, where the first mask has the same byte length as the packet header of the first packet, and the first mask The bit of Medium 0 is corresponding to a plurality of message header fields included in the target flow entry. In this way, the first mask can be used to parse the header of the first packet, which can improve the efficiency of parsing the first packet.
  • the multiple flow entry items are located in multiple rows of the integrated flow table, and each of the multiple rows of the integrated flow table corresponds to an expiration time.
  • the expiration time is used to indicate a time when the flow entry in the corresponding row of the expiration time is deleted from the integrated flow table, where the target flow entry is located in a row corresponding to the first expiration time.
  • the first expiration time is updated to a second expiration time. After the second expiration time is later than the first expiration time, after the target flow entry including the operation set corresponding to the first packet is found in the integrated flow table, the target flow entry may be extended in the integrated flow. The storage time in the table.
  • the target flow entry corresponding to the first packet further includes a time difference between the second expiration time and the first expiration time.
  • the third packet is obtained, and the second packet header field is extracted from the packet header of the third packet, where the multiple second packet
  • the header field has the same category as the plurality of packet header fields included in one of the plurality of flow entries; the second flow header field is not included in the integrated flow table.
  • a plurality of second packet header fields and at least one operation in a packet header of the third packet are obtained from the OVS, in the integrated flow table. And storing, in the obtained, the plurality of second packet header fields and the flow entry of the at least one operation.
  • the operation set corresponding to the third packet can be found from the integrated flow table at one time, and the next processing and forwarding are the same as the third packet. The efficiency of the packet in the header field.
  • the all other operations include one or more of the following operations: adding a field in a packet header, deleting a field in a packet header, and modifying the packet The operation of the contents of the fields in the header, setting the priority operation of the message and setting the operation of the connection tracking.
  • the application provides an apparatus for forwarding a message based on an integrated flow table, where the integrated flow table includes multiple flow entries, and each of the multiple flow entries includes a match and A mapping relationship between operation sets, the matching item includes a plurality of message header fields, the operation set includes a forwarding operation, and the apparatus includes a processing module and a transceiver module.
  • the processing module is configured to obtain a first packet, and extract a plurality of first packet header fields from the packet header of the first packet, where the multiple first packet header fields and the multiple A plurality of packet header fields included in one flow entry of the flow entry have the same category; and the target flow entry matching the multiple first header fields is searched from the integrated flow table, Determining, by the operation set corresponding to the first packet, the operation set corresponding to the first packet further includes: between determining the operation set corresponding to the first packet and the forwarding operation, Performing all other operations performed by the first packet; performing all other operations in the operation set on the first packet to obtain a second packet corresponding to the first packet; Forwarding the second message.
  • the target flow entry in the integrated flow table includes an operation set corresponding to the first packet, where the operation set includes all operations performed on the first packet, so that the first flow header field is searched according to the multiple first packet header fields.
  • the integrated flow table can find all the operations corresponding to the first packet, thereby improving the efficiency of processing and forwarding the first packet.
  • the processing module and the transceiver module in the apparatus may be further configured to perform the method in any one of the possible implementation manners of the first aspect.
  • the processing module and the transceiver module in the apparatus may be further configured to perform the method in any one of the possible implementation manners of the first aspect.
  • the application provides an apparatus for forwarding a message based on an integrated flow table, where the integrated flow table includes multiple flow entries, and each of the multiple flow entries includes a match and A mapping relationship between operation sets, the matching item includes a plurality of message header fields, the operation set includes a forwarding operation, and the apparatus includes a processing module and a transceiver module.
  • the processing module is configured to obtain a first packet, and extract a plurality of first packet header fields from the packet header of the first packet, where the multiple first packet header fields and the multiple A plurality of packet header fields included in one flow entry of the flow entry have the same category; and the integrated flow table is searched according to the multiple first header fields, and when the multiple entries are found And determining, by the target flow entry, a set of operations corresponding to the first packet according to the target flow entry, where the operation set corresponding to the first packet is further included in the determining Performing all other operations performed on the first packet between the operation set corresponding to the first packet and the forwarding operation, performing all other operations in the operation set on the first packet; And obtaining, by the open virtual switch OVS, at least one operation corresponding to the first packet, where the at least one operation includes a forwarding operation, where the target flow entry that matches the multiple first packet header fields is found; Performing the at least one operation on the first message .
  • the transceiver module is configured to forward the processed first packet.
  • the target flow entry in the integrated flow table includes an operation set corresponding to the first packet, where the operation set includes all operations on the first packet processing, so that when the target flow entry is included in the integrated flow table, According to the multiple first packet header fields, searching for the integrated flow table once can find all the operations corresponding to the first packet, thereby improving the efficiency of processing and forwarding the first packet.
  • at least one operation on the first packet may be obtained from the OVS, so that the first packet can be successfully processed and forwarded.
  • the processing module and the transceiver module in the device may also be used to perform the method in any one of the possible implementation manners of the first aspect.
  • the processing module and the transceiver module in the device may also be used to perform the method in any one of the possible implementation manners of the first aspect.
  • the application provides an apparatus for forwarding a message based on an integrated flow table, the apparatus comprising: a processing circuit and a storage medium; the storage medium storing one or more programs, the one or more programs It is configured to be executed by the processing circuit, the one or more programs comprising instructions for performing the method of any of the first aspect or the first aspect of the first aspect.
  • the present application provides an apparatus for forwarding a message based on an integrated flow table, the apparatus comprising a communication interface, a processing circuit, and a storage medium.
  • the processing circuit is respectively connected to the communication interface and the storage medium.
  • the storage medium is for storing a program, an instruction, or a code, the processing circuit for executing a program, an instruction, or a code in the storage medium, the method of the first aspect or any possible implementation of the first aspect.
  • an embodiment of the present application provides a computer program product, where the computer program product includes a computer program stored in a computer readable storage medium, and the computing program is loaded by a processor to implement the first aspect. Or a method of any of the possible implementations of the first aspect.
  • the embodiment of the present application provides a non-transitory computer readable storage medium for storing a computer program, the computer program being loaded by a processor to perform any of the first aspect or the first aspect The instructions of the method of implementation.
  • the embodiment of the present application provides a chip, the chip including programmable logic circuitry and/or program instructions for implementing any of the first aspect or the first aspect described above when the chip is in operation The way to implement it.
  • 1-1 is a schematic structural diagram of a system provided by an embodiment of the present application.
  • 1-2 is a schematic structural diagram of a system provided by an embodiment of the present application.
  • 1-3 are schematic diagrams of a virtual network system using OVS
  • 1-4 are schematic structural diagrams of a packet according to an embodiment of the present application.
  • 2-1 is a flowchart of a method for forwarding a message based on an integrated flow table according to an embodiment of the present application
  • FIG. 2-2 is a schematic structural diagram of a flow entry according to an embodiment of the present application.
  • 2-3 is a schematic structural diagram of another flow entry provided by an embodiment of the present application.
  • 2-4 are schematic structural diagrams of a packet header and a mask provided by an embodiment of the present application.
  • FIGS. 2-5 are schematic diagrams showing a first packet and multiple masks and operations in the embodiment of the present application.
  • 2-6 are schematic diagrams of a packet header and a mask and an operation process according to an embodiment of the present application
  • FIGS. 2-8 are schematic structural diagrams of rows in an integrated flow table according to an embodiment of the present application.
  • 2-9 are schematic diagrams showing the structure of a row in an integrated flow table using a linked list storage according to an embodiment of the present application
  • 3-1 is a flowchart of another method for forwarding a message based on an integrated flow table according to an embodiment of the present application
  • 3-3 is a schematic diagram of an OVS processing message according to an embodiment of the present application.
  • 3-4 is a schematic block diagram of a forwarding packet according to an embodiment of the present application.
  • 4-1 is a schematic structural diagram of an apparatus for forwarding a message according to an embodiment of the present application.
  • 4-2 is a structural block diagram of a device for forwarding a message and an OVS according to an embodiment of the present application
  • 4-3 is a structural block diagram of an apparatus for forwarding a message and an OVS integrated according to an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of an apparatus for forwarding a message based on an integrated flow table according to an embodiment of the present application.
  • an embodiment of the present application provides a system architecture, including:
  • the first device 1 and the second device 2 and a network connection may be established between the first device 1 and the second device 2.
  • the first device 1 may be a terminal or a server, and the first device 1 may include at least one virtual machine; the second device 2 may be a terminal or a server.
  • the first device 1 can send a message to the second device 2, which can be from a certain virtual machine in the first device 1.
  • the first device 1 may obtain a first packet of a virtual machine that is included in the first device, and obtain an operation for processing the first packet, where the obtained operation includes a forwarding operation and the forwarding At least one other operation performed before the operation, performing the at least one other operation on the first packet to obtain the second packet corresponding to the first packet, and forwarding the second packet to the second device 2.
  • the second device 2 can also send a message to a certain virtual machine of the first device 1.
  • the first device 1 receives the first packet from the second device 2, and obtains an operation for processing the first packet, where the obtained operation includes a forwarding operation and at least one other performed before the forwarding operation.
  • the operation is performed by performing the at least one other operation on the first packet to obtain the second packet corresponding to the first packet, and the second packet may be input to the virtual machine.
  • the first device 1 can be a switching device such as a router or a switch.
  • the system may further include a third device 3, and a network connection may also be established between the first device 1 and the third device 3.
  • the first device 1 can forward the message between the second device 2 and the third device 3.
  • the first device 1 may receive the first packet from the second device 2, and obtain an operation for processing the first packet, where the obtained operation includes a forwarding operation and performing the first packet before the forwarding operation. All the other operations are performed on the first packet to obtain the second packet, and the second packet can be forwarded to the third device 3.
  • the second device 2 may be a terminal, and the third device 3 may be a server; or the second device 2 may be a server, and the third device 3 may be a terminal; or the second device 2 and the third device 3 may both be For the terminal or server.
  • the first device 1 may forward the second packet according to the receiving end information in the packet header of the second packet, where the receiving end information may include the receiving end address, and may further include information such as the receiving port number.
  • the first device 1 inputs a second packet to the virtual machine; if the receiving end corresponding to the receiving end information is the second device 2, the first device 1 The second device 2 forwards the second packet. If the receiving end corresponding to the receiving end information is the third device 3, the first device forwards the second packet to the third device 3.
  • the packet (which is the first packet and/or the second packet), the packet includes a packet header and a packet content (also referred to as a payload), and the packet header includes multiple packet headers.
  • Field is the field that constitutes the header of the packet.
  • a packet header usually includes a source address, a source port number, a destination address, and a destination port number. These fields are packet header fields.
  • Any one of the first device, the second device, and the third device may include a device for implementing the method of the embodiment of the present application, and the device may perform operations of each step in the method for implementing forwarding packets, OVS is also used to forward messages, and the device can be considered to have the function of OVS.
  • the device may further include an OVS, that is, the device may also be integrated with the OVS, and the device communicates with the OVS, and can cooperate with the OVS to implement forwarding of the message.
  • OVS an OVS
  • the OVS is a part of the device, for example the OVS can be a module that makes up the device.
  • the first device may not include the OVS, and the OVS is located in a device other than the first device, and the device communicates with the other device, and can cooperate with the OVS on the other device to implement forwarding of the message.
  • a plurality of first packet header fields exist in the packet header of the first packet, and the plurality of first packet header fields and multiple packets included in one flow entry in the integrated flow table
  • the header fields have the same kind.
  • node 1 in the architecture diagram, node 2 and node 3 may correspond to the first device, the second device, and the first in an implementation manner in the foregoing.
  • Node 1, Node 2, and Node 3 are three physical hosts or servers with OVS software installed and network interface cards (NICs). Three nodes transmit information through physical switch 107. Each node has complete Software and hardware, for the sake of brevity, Figures 1-3 only exemplarily illustrate the software and hardware included in node 1.
  • the hardware of the node 1 includes a central processing unit (CPU), a memory 102, and a network card 103.
  • the software of the node 1 includes an OVS 104, a virtual machine (VM) 105, and a VM 106.
  • the VM 105 and VM 106 on Node 1 communicate with other nodes via OVS 104 and network card 103.
  • the apparatus for forwarding a message based on the integrated flow table described in the present application may be located in the OVS 104 as software; or may be independent of the OVS 104, for example, may be represented by a block diagram between the virtual machine (VM105, VM106) and the OVS 104 on the map.
  • the device first uses the device to perform forwarding.
  • the method of the present application may be performed using the hardware resources of the CPU 101, or the hardware resources of the network card 103 may be used to execute the application. Methods.
  • the foregoing virtual network system is only an example.
  • the virtual network system applicable to the present application is not limited thereto.
  • the node 1 may also install a container or other virtual operating system software, and the number of nodes may also be other numbers, and each node includes The hardware is also not limited to the hardware shown in Figures 1-3.
  • VXLAN Virtual Extensible LAN
  • the packet header includes an outer media access control layer (MAC) header, an internet protocol (IP) header, and a user datagram protocol (UDP) header.
  • MAC media access control layer
  • IP internet protocol
  • UDP user datagram protocol
  • the packet header fields included in the outer MAC header are the destination MAC address, the source MAC address, the virtual LAN (VLAN) type, and the VLAN ID tag (VLAN IDentify Tag, VLAN ID Tag). , Ethernet type (Ether Type).
  • the header fields included in the outer IP header are IP Header Misc Data, Protocol, Header Checksum, Outer Source IP, and Outer Destination IP.
  • the header fields included in the UPD header are UDP source port, VXLAN port, UDP length, and redundancy check (Checksum).
  • the header fields included in the VXLAN header are VXLAN, Virtual LAN IDentify (VNID), and two reserved fields.
  • the detailed process of processing the first packet by the first device 1 and the second packet obtained by the forwarding process may be referred to the implementation process of any of the following embodiments, and details are not described herein. .
  • the embodiment of the present application provides a method for forwarding a packet based on an integrated flow table, where the execution body of the method may be the first device in the embodiment shown in FIG. 1-1 or FIG. 1-2.
  • the execution body of the method may be the first device in the embodiment shown in FIG. 1-1 or FIG. 1-2.
  • Step 201 Acquire a first packet.
  • the first packet may be a packet from a virtual machine or may be a packet sent from another physical device other than the first device.
  • the virtual machine may run in the first device, or the virtual machine may run on other physical devices than the first device.
  • the first device when the first device is a network element such as a router or a switch in the network, the first device may receive the first packet sent by the terminal, the server, or another network element in the network. or,
  • the first device may receive the first packet sent by the device such as the terminal or another server, or the first device may include at least one virtual machine, and the first device may obtain the virtual device from the virtual device.
  • the first message may be a server, the first device may receive the first packet sent by the device such as the terminal or another server, or the first device may include at least one virtual machine, and the first device may obtain the virtual device from the virtual device.
  • the first message may be a server, the first device may receive the first packet sent by the device such as the terminal or another server, or the first device may include at least one virtual machine, and the first device may obtain the virtual device from the virtual device.
  • the first message may be a server, the first device may receive the first packet sent by the device such as the terminal or another server, or the first device may include at least one virtual machine, and the first device may obtain the virtual device from the virtual device.
  • the first message may be a server, the first device may include at least one virtual machine, and the first device may obtain the virtual device from the virtual device.
  • the first device When the first device is a terminal, the first device may receive the first packet sent by the device from another terminal or a server, or the first device includes at least one virtual machine, and the first device may acquire the virtual device from the virtual device. First message.
  • the integrated flow table includes multiple flow entry items, and each of the multiple flow entry includes a mapping relationship between the matching item and the operation set, and the matching items and operations included in each flow entry
  • the set includes a plurality of message header fields, the operation set including a forwarding operation and all other operations performed on the message corresponding to the operation set prior to the forwarding operation.
  • the operation corresponding to the operation set corresponding to the first packet may be: reading an operation set corresponding to the first packet or other processing circuit for causing the device based on the integrated flow table to forward the message to be ready to execute.
  • the operation in the operation set corresponding to the first packet that is, the operation included in the operation set corresponding to the first packet is for the field in the first packet (for example, it may be a packet header or a payload, or a packet header) And the operation of the field of the payload can achieve the effect that the information in the first packet is not required to be reused by other flow tables.
  • the operation set corresponding to the first packet further includes, after reading the operation set corresponding to the first packet and the forwarding operation, performing all the fields in the first packet Other operations refer to operations between forwarding operations after reading the operation set corresponding to the first packet.
  • the types of all other operations include one or more of the following: an operation of adding a field in a packet header, an operation of deleting a field in a packet header, an operation of modifying a content of a field in a packet header, and a setting report.
  • all of the other types of operations are only one or more of the above five operations, and other types of operations are not "all other operations" described in this application.
  • the type of the field in the packet header of the first packet is the type of information corresponding to the field or the location of the field in the header of the first packet.
  • the matching item in the flow entry may uniquely identify the one-way message flow.
  • the match entry in each flow entry in the integrated flow table may include the same type of the packet header field, that is, for any two flow entries in the integrated flow table, the matching entries in the two flow entries include The fields are the same.
  • each message flow is uniquely identified by using the same type of message header field. or,
  • the match entry in each flow entry in the integrated flow table may include different types of packet header fields, that is, for any two flow entries in the integrated flow table, the matching entries in the two flow entries include The types of fields can vary.
  • the matching of the headers in each flow entry in the integrated flow table may include different types of packet header fields.
  • the matching item in the flow entry may include a nine-tuple field in the packet header or a partial message header field in the nine-tuple field.
  • the matching item includes a nine-tuple field in the packet header, that is, the matching item includes nine packet header fields, and the nine packet header fields may be a sender address, a sender port number, and a receiving, respectively. End address, receiver port number, VXLAN, protocol, external virtual local area network (OUTER VLAN), internal virtual local area network (INNER VLAN), and virtual port (vPort). or,
  • the matching item may include a part of the packet header field in the nine header fields.
  • the match may include a sender address, a sender port number, a receiver address, and a receiver port number.
  • the matching item may include a sender address, a sender port number, a receiver address, a receiver port number, and a protocol.
  • the sending end address may be a sending end IP address
  • the receiving end address may be a receiving end IP address
  • the sending end address may occupy a length of four bytes
  • the sending port number may occupy a length of two bytes
  • the receiving end address may occupy a length of four bytes.
  • the receiving port can occupy two bytes in length.
  • VXLAN can occupy three bytes in length.
  • the protocol can occupy one byte.
  • the length of OUTER VLAN, INNER VLAN and vPort can be two bytes.
  • the set of operations in the flow entry includes a forwarding operation and at least one other operation performed prior to the forwarding operation.
  • the other operations may be any one of the following operations: adding a field in the packet header, deleting the field in the packet header, and modifying the content of the field in the packet header. Prioritize the operation of the message and set the connection tracking operation. For the other operations, only the above-mentioned types are listed in the present embodiment, and the others are not listed one by one.
  • the adding a field in the packet header may include at least one of an operation of adding a vlan in the packet header and an operation of adding a vxlan in the packet header.
  • the operation of deleting a field in the packet header may include at least one of an operation of deleting a vlan in a packet header and an operation of deleting a vxlan in a packet header.
  • the operation of modifying the content of the field in the packet header may include: modifying the operation of the sender MAC in the packet header, modifying the operation of the receiving MAC in the packet header, modifying the operation of the sender IP in the packet header, and modifying At least one of operation of the receiving end IP in the packet header, operation of modifying the sender port number in the packet header, and operation of modifying the receiving port number in the packet header.
  • setting the connection tracking operation may be an operation of recording status information of the message.
  • the status information of the message may include information such as the serial number of the message.
  • the operation of recording the status information of the packet may be: extracting the identifier information for identifying the packet and obtaining the state information of the packet from the packet header of the packet, where the identifier information may include the sending end of the packet. At least one of the address, the sender port number, the receiver address, and the receiver port number, and the identifier information and the state information are correspondingly stored in the correspondence between the identifier information and the state information.
  • an operation set including multiple operations may be directly stored in the flow entry.
  • the operation set in the flow entry may include a field corresponding to each of the multiple operations, and the corresponding field of the operation includes a name of the operation, a parameter size of the operation, and a parameter of the operation.
  • the name of the operation and the parameter size of the operation are first read from the corresponding field of the operation, and the parameter of the operation is read according to the parameter size of the operation, so as to implement Get the action.
  • the operation set in the flow entry includes a field corresponding to each operation of the k+1 operations; the corresponding operation field includes the operation name cmd 0 and the operation parameter size. Size 0 and the parameter config 0 of the operation; the field corresponding to the second operation includes the operation name cmd 1 , the operation parameter size size 1 and the operation parameter config 1 ... the operation corresponding to the k+1th operation includes the operation The name cmd k , the size of the operation parameter size k and the parameter config k of the operation. or,
  • the flow entry may not directly store an operation set including multiple operations, but store a pointer to the operation set.
  • Each operation of the plurality of operations corresponds to a field in the operation set, and the corresponding field of the operation includes a name of the operation, a parameter size of the operation, and a parameter of the operation.
  • the flow entry includes a pointer action pointer, and the operation set pointed to by the pointer action pointer includes a field corresponding to each operation of the k+1 operations; the field corresponding to the first operation includes an operation.
  • the field corresponding to one operation includes the name cmd k of the operation, the size size k of the operation, and the parameter config k of the operation.
  • the parameter of the operation includes at least the field content of the added vlan.
  • the parameters of the operation include at least the content of the added vxlan field.
  • the parameter of the operation includes at least a field identifier for identifying a vlan to be deleted.
  • the parameter of the operation includes at least the field identifier for identifying the vxlan to be deleted.
  • the parameters of the operation include at least the MAC address of the modified sender.
  • the parameter of the operation includes at least the MAC address of the modified receiving end.
  • the parameters of the operation include at least the IP address of the modified sender.
  • the parameter of the operation includes at least the modified IP address of the receiving end.
  • the parameter of the operation includes at least the port number of the modified sender.
  • the parameter of the operation includes at least the port number of the modified receiving end.
  • the parameters of the operation include at least the priority.
  • the parameters of the operation include at least indication information for indicating status information of the recorded message.
  • the flow entry may include other information in addition to the matching item and the operation set.
  • the flow entry may further include packet statistics, where the packet statistics may include the number of packets and/or the amount of packet data. The number of the packets is used to record the total number of packets forwarded by using the flow entry, and the amount of the data is used to record the total amount of data that is forwarded by using the flow entry.
  • Each flow entry in the integrated flow table may be generated by a technician or generated during the process of forwarding a message.
  • Step 202 Extract multiple first packet header fields from the packet header of the first packet.
  • the extracted multiple first packet header fields have the same category as the multiple packet header fields included in one flow entry in the integrated flow table.
  • the packet header of the first packet may be compared with a string of masks to obtain a plurality of first packet header fields in the first packet, where the string mask indicates the multiple The position of a message header field in the header of the first packet.
  • a first mask may be generated, where the first mask has the same byte length as the header of the first packet, and the first mask is in the integrated flow table.
  • the non-zero bit in the first mask corresponds to multiple message header fields included in the target flow entry. Then, the packet header of the first packet is compared with the first mask to obtain a plurality of first packet header fields in the first packet.
  • the first mask includes multiple mask fields, and each packet header field in the packet header of the first packet corresponds to a mask field.
  • the length of the packet header field is equal to the length of the corresponding mask field, and if the type of the packet header field is in the target flow entry The type of the packet header field, the mask field corresponding to the header field of the packet is composed of bit 1. If the type of the header field is not the type of the packet header field in the target flow entry, the report The mask field corresponding to the header field is composed of bit 0.
  • the corresponding target flow entry in the integrated flow table includes a nine-tuple field in the packet header, that is, the target flow entry includes a sender address, a sender port number, and a receiver address, Receive port number, VXLAN, protocol, OUTER VLAN, INNER VLAN, and vPort.
  • the packet header of the first packet includes the version, service type, sender address, total length, and sender port number.
  • the first mask may also include a mask field corresponding to each of the twelve header fields.
  • the types of the three packet header fields are not the type of the packet header field in the target flow entry, so the mask field corresponding to the version is composed of bit 0, and the service type The corresponding mask field consists of bit 0, and the mask field corresponding to the total length consists of bit 0.
  • the types of the nine packet header fields are all reported in the target flow entry.
  • the type of the header field, so the mask field corresponding to the sender address is composed of bit 1.
  • the mask field corresponding to the port number of the sender is composed of bit 1.
  • the mask field corresponding to the address of the receiver is composed of bit 1, and the port of the receiver is used.
  • the mask field corresponding to the number consists of bit 1.
  • the mask field corresponding to VXLAN consists of bit 1.
  • the mask field corresponding to the protocol consists of bit 1.
  • the mask field corresponding to OUTERVLAN consists of bit 1.
  • the mask field corresponding to INNERVLAN. It consists of bit 1
  • the mask field corresponding to vPort consists of bit 1.
  • the matching item in each flow entry in the integrated flow table includes the same type of the packet header field, only one string of the first mask needs to be generated.
  • a plurality of first packet header fields in the packet header of the first packet are the same as a plurality of packet header fields included in a matching entry in the integrated flow table, that is, the multiple extracted in the step includes the multiple
  • the packet header field set of the first packet header field is the same as a matching entry in the integrated flow table.
  • multiple strings of the first mask may be generated.
  • the first mask of each string corresponds to the target flow entry in the integrated flow table, and the type of the packet header field in the target flow entry corresponding to the first mask of each string is different.
  • the packet header of the first packet is ANDed with the first mask of the string, to obtain a packet header field set including multiple first header fields, and the packet header field set
  • the packet header field in the packet has the same type as the packet header field in the target flow entry corresponding to the first mask of the string. In this way, N sets of header fields can be extracted from the first packet, where N is an integer greater than 1 and each packet header field set has a different type of packet header field.
  • the at least one packet header field set may be preset in advance. And each match in the integrated flow table is a preset set of header fields.
  • the packet header of the first packet is ANDed with the first mask of the string to obtain multiple packet header fields in the first packet header;
  • the multiple packet header fields are preset to a packet header field set, the multiple packet header fields are formed into a packet header field set. If the multiple packet header fields are different from each of the preset at least one packet header field set, the multiple packet fields are discarded.
  • the user may be provided with a control interface, and the user may preset at least one packet header field set in advance through the control interface.
  • the first header header field needs to be obtained in the first packet header by performing a parallelization and operation on the packet header of the first packet.
  • the efficiency of parsing the first message field can be improved.
  • the header of the first packet is compared with the first mask of Figure 2-4. After the AND operation, the header of the first packet is retained.
  • the plurality of first message header fields include a sender address, a sender port number, a receiver address, a receiver port number, a VXLAN, a protocol, an OUTER VLAN, an INNER VLAN, and a vPort nine header fields, and the nine messages.
  • the header field is the first packet header field to be extracted and the nine header fields are formed into a packet header field set.
  • Step 202 is a parallel parsing operation.
  • the parallel parsing operation of step 202 can be roughly divided into: acquiring the first packet, identifying the packet header of the first packet, and intercepting the first packet.
  • Each packet header field in the packet header performs an AND operation on each packet header field and a string of masks to obtain a packet header field set.
  • Step 203 Search for the target flow entry that matches the multiple first packet header fields from the integrated flow table to determine an operation set corresponding to the first packet.
  • the operation corresponding to the first packet is performed on all other operations performed on the first packet between the operation set corresponding to the first packet and the forwarding operation.
  • the packet header including the plurality of first packet header fields is extracted in step 202.
  • a set of fields, and the set of header fields is the same as a match in the integrated flow table. Therefore, in this step, the target flow entry matching the multiple first packet header fields is found in the integrated flow table according to the multiple first packet header fields.
  • step 202 N packet header field sets are extracted, and because of the N reports A set of header fields in the header field set is the same as a match in the integrated stream table.
  • the target flow entry matching the set of the packet header fields in the plurality of packet header field sets may be searched from the integration flow table by the following steps (1) to (4):
  • the operation set included in the target flow entry is determined as the operation set corresponding to the first packet, and the return is ended.
  • the set of header fields in the set of N header fields is the same as the match in the integrated flow table. Therefore, according to the set of header fields, the processes of (1) to (4) above are adopted. The operation set corresponding to the first packet is found.
  • the operation set corresponding to the first packet is searched from the integrated flow entry to include parameters of multiple operations.
  • the multiple operations include a forwarding operation and all other operations performed on the first packet before the forwarding operation.
  • each flow entry in the integrated flow table may further include an expiration time, where the expiration time is used to indicate a moment when the flow entry is deleted from the integrated flow table, in this embodiment, The first expiration time is included in the target flow entry that matches the plurality of first packet header fields.
  • the target flow entry matching the multiple first packet header fields is searched from the integrated flow table to determine an operation set corresponding to the first packet, and the first of the target flow entries may be The expiration time is updated to the second expiration time, and the second expiration time is later than the first expiration time.
  • the second expiration time can be obtained by increasing the first expiration time.
  • the target flow entry further includes a time difference between the second expiration time and the first expiration time, and the first expiration time may be increased by the time difference to obtain a second expiration time.
  • the time difference included in each flow entry in the integrated flow table may be the same or different.
  • the second expiration time is obtained by the following manner.
  • a time difference may be preset, and each flow entry in the integrated flow table may not include The time difference of the expiration time, so that the first expiration time can be increased by the preset time difference to obtain the second expiration time.
  • multiple flow entry items in the integrated flow table where the multiple flow entry items are located in multiple rows of the integrated flow table, and each of the multiple rows in the integrated flow table corresponds to an expiration time
  • the target flow entry is located in the corresponding first expiration time line
  • the target flow entry may be The row corresponding to the expiration time moves to the row corresponding to the second expiration time.
  • each expiration time in the integrated flow table may correspond to one row, and each row may include at least one flow entry. That is to say, the second expiration time corresponds to one row, and each flow entry whose expiration time is the second expiration time may be located in a row corresponding to the second expiration time. or,
  • each expiration time in the integrated flow table may correspond to at least one row, and each row may include one flow entry. That is to say, the second expiration time corresponds to at least one row, and each row corresponding to the second expiration time includes a flow entry whose expiration time is the second expiration time.
  • the flow entry in each row in the integrated flow table may be an index used to identify the flow entry, and the index used to identify the flow entry may be a pointer to the flow entry or the like. So the above move operation can be:
  • the index of the target flow entry is moved from the row corresponding to the first expiration time to the row corresponding to the second expiration time.
  • each expiration time in the integrated flow table may correspond to one row, and if each row may include at least one flow entry, the linked list may be used to implement the row in the integrated flow table, and each behavior is a linked list. Use one of the linked lists to store the expiration time in the row, and use the other nodes in the linked list to store the index of the flow table entry in the row.
  • the first node in the linked list can be used to store the expiration time in the row, and other nodes in the linked list are used to store the index of the flow entry in the row.
  • the integrated flow table includes k rows, respectively, the first row, the second row, the kth row, and the first row includes the expiration time T 1 and the indexes of the four flow table entries.
  • the indexes of the four flow entry items are C 0 , C 1 , C 2 , and C 3 , respectively .
  • the first node of the linked list corresponding to the first row is used to store the expiration time T 1
  • the other nodes are used to store C 0 , C 1 , C 2 , and C 3 .
  • the description of the meaning of the first line can be referred to, and the description will not be repeated one by one.
  • the row corresponding to the current time is obtained from the integrated flow table, and the flow entry in the row is deleted from the corresponding relationship. This eliminates the need to check the expiration time in each flow entry in the integrated flow table in real time, thereby saving computing resources.
  • the corresponding flow entry can be found from the integrated flow table according to the index of the flow entry in the row, and the expiration time in the flow entry is extracted, and the expiration time and the current time are compared.
  • the flow entry is deleted from the integration flow table.
  • the number of linked lists is often limited. See Figure 2-9.
  • M is an integer greater than 1.
  • the integrated flow table includes at most M-1 rows, and the i-th linked list expires.
  • the expiration time in the M-1th linked list is T M-1 , and the Mth linked list is used to store the index of the flow entry whose expiration time is greater than T M-1 .
  • the operation of moving the target flow entry from the row corresponding to the first expiration time to the row corresponding to the second expiration time may be:
  • the index of the target flow entry is moved from the linked list storing the first expiration time to the linked list storing the second expiration time. If the second expiration time is later than the expiration time T M-1 , the index of the target flow entry is moved to the Mth link.
  • the first linked list to the M-1 linked list may be cleared, and then stored in each linked list from the first linked list to the M-1 linked list.
  • each new expiration time is later than the expiration time T M-1
  • the new expiration time in the i-th linked list is later than the new expiration time in the i-1th linked list.
  • the expiration time in the flow entry is extracted, and the index of the flow entry is moved from the Mth linked list to the linked list corresponding to the expiration time.
  • the foregoing operation of processing the expiration time in the integrated flow table may be summarized as: listening to the integrated flow table; and checking the target flow when the target flow entry is queried.
  • the first expiration time in the entry when the first expiration time is changed to the second expiration time, the target flow entry is moved, that is, the target flow entry is moved from the row corresponding to the first expiration time.
  • the line corresponding to the second expiration time continues to listen to the expiration time in the integrated flow table, that is, whether the expiration time equal to the current time exists in the integrated flow table; deleting the first mapping relationship, that is, listening out When the expiration time is equal to the current time, the flow entry in the row corresponding to the expiration time is deleted from the integration flow table.
  • Step 204 Perform all other operations in the operation set on the first packet to obtain a second packet corresponding to the first packet, and forward the second packet.
  • the first message may be executed in parallel or serially, and during serial execution, although the first performed operation changes the field of the first message. Or changing a certain attribute of the first packet, that is, the first packet has a change, and the post-execution operation is performed on the basis of the changed first packet.
  • these operations are collectively referred to as The first message is executed. That is why, in step 204, the second packet is forwarded, and in essence, the purpose of the method flow is to forward the information in the first packet, and the forwarding action in step 204 corresponds to the first packet.
  • the forwarding operation in the corresponding operation set.
  • the other operations may be performed on the first packet according to the parameters of each other operation, and the second packet is obtained after performing all other operations.
  • the other operation is to add a vlan to the packet header
  • Field content For example, if the other operation is to add a vlan to the packet header, add a vlan field to the packet header of the first packet to obtain a second field, where the field carries at least the vlan included in the parameters of the other operation. Field content.
  • the vxlan field is added to the packet header of the first packet to obtain a second field, where the field carries at least the vxlan field included in the parameter of the other operation. content.
  • the vlan field is deleted from the first packet according to the field identifier of the vlan included in the parameter of the other operation, to obtain the second packet.
  • the other operation is to delete the vxlan operation in the packet header
  • the field identifier of the vxlan included according to the parameters of the other operation is deleted from the first packet to obtain the second packet.
  • the other operation is to modify the operation of the sender MAC in the packet header, replace the field content in the sender MAC in the first packet with the MAC address of the sender included in the parameter of the other operation, to obtain the second Message.
  • the other operation is to modify the operation of the receiving MAC in the packet header
  • the content of the field in the receiving MAC in the first packet is replaced with the MAC address of the receiving end included in the parameter of the other operation, to obtain the second Message.
  • the other operation is to modify the operation of the sender IP in the packet header, replace the field content in the sender IP in the first packet with the IP address of the sender included in the parameter of the other operation, to obtain the second Message.
  • the other operation is to modify the operation of the receiving end IP in the packet header, replace the field content in the receiving end IP in the first packet with the IP address of the receiving end included in the parameter of the other operation, to obtain the second Message.
  • If the other operation is to modify the sender port number in the packet header, replace the field content in the sender port number in the first packet with the port number of the sender included in the parameter of the other operation, to obtain Second message.
  • the other operation is to modify the receiving port number in the packet header, replace the field content in the receiving port number in the first packet with the port number of the receiving end included in the parameter of the other operation, to obtain Second message.
  • the content of the field in the priority field in the first packet is replaced with the priority included in the parameter of the other operation to obtain the second packet.
  • the identification information and the status information of the first packet are obtained according to the indication information included in the parameter of the other operation, and the identifier information and the status information of the first packet are saved correspondingly. The correspondence between the identification information and the status information.
  • the target flow entry in the integrated flow table includes all the operations of processing the first packet, so that the first packet header field in the packet header of the first packet is searched.
  • the integrated flow table can find all the operations corresponding to the first packet, thereby improving the efficiency of processing and forwarding the first packet.
  • performing a AND operation with the mask and the header of the first packet to obtain the plurality of first packet header fields when parsing the headers of the first packet to obtain the plurality of first packet header fields, performing a AND operation with the mask and the header of the first packet to obtain the plurality of first packet header fields. Compared with the current header fields in the header of the first packet, the parsing efficiency can be improved, and the efficiency of processing and forwarding the first packet is further improved.
  • an embodiment of the present application provides a method for forwarding a message based on an integrated flow table.
  • the executor of the method may be the first device in the embodiment shown in Figure 1-1 or Figure 1-2, including:
  • Step 301 Acquire a third packet.
  • the third packet may be a packet from a virtual machine or may be a packet sent from another physical device other than the first device.
  • the virtual machine may run in the first device, or the virtual machine may run on other physical devices than the first device.
  • the first device can be a network element such as a router or a switch in the network
  • the first device can receive the third packet sent by the terminal, the server, or another network element in the network. or,
  • the first device can be a server
  • the first device can receive the third packet sent by the device such as the terminal or other server, or the first device can include at least one virtual machine, and the first device can obtain the virtual machine from the virtual device.
  • the third message or,
  • the first device can be a terminal
  • the first device can receive a third packet sent by a device such as another terminal or a server, or the first device includes at least one virtual machine, and the first device can obtain a virtual machine from the virtual device.
  • the third message can be a third packet sent by a device such as another terminal or a server, or the first device includes at least one virtual machine, and the first device can obtain a virtual machine from the virtual device. The third message.
  • the protocol of the third packet may be parsed. If the protocol is a preset protocol in the preset protocol set, perform the following step 302, if not, The operation of step 304 is performed, that is, the third message is directly forwarded through the OVS. In this way, the packet corresponding to the preset protocol can be searched for the corresponding operation of the packet from the integrated flow table.
  • the packet of the default protocol is usually a packet of a traffic with a large amount of traffic. Therefore, when receiving the packet of the default protocol, the packet is processed and forwarded by the operation of the following step 302.
  • Step 302 Extract multiple second packet header fields from the packet header of the third packet.
  • the extracted multiple second packet header fields have the same category as the multiple packet header fields included in one flow entry in the integrated flow table.
  • the matching item in each flow entry in the integrated flow table includes the same type of the packet header field
  • the first packet is extracted from the packet header of the third packet.
  • the header field collection of the header field is
  • extracting N from the packet header of the third packet includes multiple first The set of header fields of the packet header field, where N is an integer greater than 1.
  • Step 303 Search for the integrated flow table according to the multiple second packet header fields, to determine that the integrated flow table does not include the target flow entry that matches the multiple second packet header fields, and execute Step 304.
  • step 302 a packet header including the plurality of second packet header fields is extracted.
  • step 302 If the type of the packet header field included in the matching entry in each of the flow table entries in the integrated flow table may be different, then the N packet header field sets are extracted in step 302, and the step may be adopted in this step. Find the integration flow table by following the steps (1) through (5) below:
  • the operation set included in the target flow entry is determined as the operation set corresponding to the third packet, and the return is ended.
  • the third (3) to (5) process does not find the third in the integrated flow table.
  • the set of operations corresponding to the message is not included in the integrated flow table.
  • Step 304 Obtain at least one operation corresponding to the third packet and multiple second packet header fields in the packet header of the third packet from the OVS, and perform the at least one operation on the third packet.
  • the OVS may parse multiple second packet header fields in the packet header of the third packet according to the multiple second packet header fields. Determining at least one operation corresponding to the third message.
  • the multiple second packet header fields and the at least one operation may be acquired, and the at least one operation includes a forwarding operation, and the at least one operation is performed on the third packet.
  • the at least one operation may further include performing at least one other operation performed before the forwarding operation, performing the at least one other operation on the third packet, obtaining the fourth packet, and then forwarding the fourth packet.
  • the OVS includes an Exact Match Cache (EMC) table and a data flow table.
  • EMC Exact Match Cache
  • the OVS may also include a communication protocol, which may be an Openflow communication protocol.
  • the data flow table includes at least one hash table, where the data flow table stores operations corresponding to at least one packet, and for each packet, at least one operation corresponding to the packet is stored in the data flow table.
  • the hash table a mapping relationship between a plurality of packet header fields in the packet header including the packet and an operation corresponding to the packet may be stored in the hash table.
  • the EMC table is a hash table.
  • the EMC table stores the operations corresponding to some of the packets in the data flow table. For each message in the partial packet, the EMC table stores the report including the packet.
  • the third message may be input to the OVS.
  • the OVS receives the third packet, extracts multiple second packet header fields in the packet header of the third packet, and queries the EMC table according to the multiple second packet header fields.
  • the at least one operation corresponding to the third packet is queried in the EMC table, and the third packet is processed according to the at least one operation, and the fourth packet obtained after the processing is forwarded through a network interface card (NIC).
  • NIC network interface card
  • the part processing process of the third message by the OVS flow table is similar to the prior art solution, and the third message is as follows.
  • the process of the OVS flow table is used to further explain the effects of the technical solution of the present application. Since only one operation is included in each mapping relationship in the EMC, at least one operation corresponding to the third packet is distributed in different mapping relationships. Assuming that the third packet corresponds to five operations, the five operations are distributed in five mapping relationships, and each of the five mapping relationships includes one of the plurality of second packet header fields and the third packet. operating.
  • the query includes a second mapping relationship of the plurality of second packet header fields; and further, the EMC table is further queried according to the multiple second packet header fields, and the query includes the second second packet header field.
  • the query is continued until the complete EMC table is queried. It is determined that all operations corresponding to the third message are all queried.
  • the first packet carries information that needs to be forwarded, and the first packet is a packet to be processed by the method according to the integrated flow table forwarding packet of the present application.
  • the integrated flow table is queried according to the multiple first packet header fields of the first packet
  • the target flow entry is The operation set includes a forwarding operation and all other operations, wherein the so-called all other operations are: determining the operation set corresponding to the first packet and the forwarding operation, in the first packet
  • the field performs operations, all other operations performed on the first message, that is, there is no need to jump to other flow tables to find the operations required to forward the information of the first message.
  • the target flow entry when the target flow entry is queried, all the operations of forwarding the information carried in the first packet are obtained, and it is not necessary to continue to query the flow table entries remaining in the integrated flow table, that is, In the integrated flow table, the packets of the target flow entry are queried. Only the integrated flow table is used to support the forwarding of the packet, thereby improving the efficiency of obtaining the processing of the packet.
  • the server communicates with the server according to the communication protocol, to obtain at least one operation corresponding to the third packet from the server, and processes the at least one operation according to the at least one operation.
  • the third packet can be forwarded through the NIC to process the fourth packet.
  • the five operations are distributed in five hash tables. Included in the first hash table where the first operation is located, the mapping relationship between the multiple second packet header fields, the address of the first operation and the second hash table, and the second hash table is the second a hash table in which the operation is performed; the second hash table includes a mapping relationship between the plurality of second packet header fields, the second operation, and the address of the third hash table, and the third hash table is the third a hash table in which the operation is performed; a mapping relationship between the plurality of second packet header fields, a third operation, and an address of the fourth hash table is included in the third hash table, and the fourth hash table is the fourth The hash table in which the operation is performed; the mapping relationship between the plurality of second packet header fields, the fourth operation, and the address of the fifth hash table is included in the fourth hash table, and
  • the first hash table in the data flow table is first queried, and after the first hash table is queried, there is no query yet.
  • the second hash table in the data flow table is queried until the first hash table is queried, according to the plurality of second packet header fields, to the mapping relationship that includes the multiple second packet header fields.
  • the first hash table includes a first mapping relationship of the plurality of second packet header fields, where the first mapping relationship includes the multiple second packet header fields, the first operation, and the second hash. The address of the table.
  • the fifth mapping relationship includes addresses of the plurality of second packet header fields, the second operation, and the third hash table.
  • the time required to obtain the at least one operation in communication with the server is much longer than the operation of obtaining the operation from the data flow table. Time, so the time for obtaining the operation from the server is much longer than the time for obtaining the operation from the integrated flow table in the embodiment shown in Figure 2-1, so the operation is obtained from the integrated flow table, and the efficiency of processing the message is obtained. Great improvement.
  • Step 305 Generate a flow entry including the multiple second packet header fields and the at least one operation in the integrated flow table.
  • an expiration time may be set for the generated flow entry and stored in the flow entry, where the generated flow entry may be added to the row corresponding to the set expiration time.
  • the operation of adding the generated flow entry to the row corresponding to the set expiration time may be:
  • Determining whether there is a line including the set expiration time in the integrated flow table if yes, adding the generated flow entry to the row; if not, generating an expiration including setting in the integrated flow table The time and the row of the generated flow table entry.
  • the processes of the two embodiments may be summarized as follows: acquiring a packet, and obtaining the packet. a packet header field, where the integrated flow table is searched according to the plurality of packet header fields; if the target flow entry matching the plurality of packet header fields is found, the operation is processed according to the operation set included in the target flow entry a packet, if no target flow entry matching the plurality of packet header fields is found, obtaining at least one operation and a plurality of packet header fields from the OVS, processing the packet according to the at least one operation, and A flow entry including the obtained plurality of packet header fields and the at least one operation is generated in the integrated flow table.
  • the operation set corresponding to the third packet when the operation set corresponding to the third packet is not found in the integrated flow table, at least one operation corresponding to the third packet is obtained from the OVS, and the third flow is generated in the integrated flow table. a plurality of second packet header fields in the packet and the flow entry of the at least one operation, so that when the third packet is obtained next time, the operation corresponding to the third packet can be directly obtained from the integrated flow table. Set to improve the efficiency of processing and forwarding the third message next time.
  • an embodiment of the present application provides an apparatus 400 for forwarding a message based on an integrated flow table, where the apparatus 400 can be used to implement the embodiment shown in FIG. 2-1 or FIG. 3-1, and can also be implemented.
  • the integrated flow table includes multiple flow entry items, and each of the multiple flow entry includes a mapping relationship between the matching item and the operation set, where the matching item includes multiple message header fields, and the operation includes multiple message header fields.
  • the set includes forwarding operations, and the apparatus 400 includes:
  • the processing module 401 is configured to obtain a first packet, and extract a plurality of first packet header fields from the packet header of the first packet, where the multiple first packet header fields and the multiple flow entries A plurality of packet header fields included in a flow entry have the same type; and the target flow entry matching the multiple first header fields is searched from the integrated flow table to determine the first packet.
  • the operation set corresponding to the first packet further includes all other operations performed on the first packet between the operation set corresponding to the determining the first packet and the forwarding operation. Performing all other operations in the operation set on the first packet to obtain a second packet corresponding to the first packet;
  • the transceiver module 402 is configured to forward the second packet.
  • the transceiver module 402 may include a communication interface of a physical machine or a communication interface of a network card, or may be a code for calling a communication interface of a physical machine or a communication interface of a network card.
  • the communication interface includes at least one device or unit for implementing inter-node communication, such as an antenna, a port, or the like.
  • the apparatus 400 of this embodiment may be implemented by a physical machine or by a network card in a physical machine.
  • the code of the device 400 can be stored in a memory of the physical machine, and the code of the device 400 in the memory is called by the processor of the physical machine, thereby calling the communication interface of the physical machine to implement forwarding of the message.
  • the code of the device 400 can be stored in a storage medium of the network card, and the code of the device 400 in the storage medium is executed by the processing circuit of the network card, thereby calling the communication interface of the network card to implement the function of forwarding the message. .
  • all the other operations are a combination of any one or more of the following operations: adding a field in the packet header, deleting the field in the packet header, and modifying the field in the packet header.
  • adding a field in the packet header deleting the field in the packet header, and modifying the field in the packet header.
  • the operation of the content setting the priority operation of the message and setting the operation of the connection tracking.
  • the processing module 401 is configured to perform the AND operation on the header of the first packet and a string of masks. And obtaining the multiple first packet header fields in the first packet, where the mask indicates the location of the multiple first packet header fields in the packet header of the first packet.
  • the processing module 401 is further configured to: generate a first mask, where the first mask has the same byte length as the header of the first packet, and the non-zero bit in the first mask Corresponding to multiple message header fields included in the target flow entry.
  • the multiple flow entry items are located in multiple rows of the integrated flow table, and each of the multiple rows of the integrated flow table corresponds to an expiration time, and the expiration time is used to indicate from the integrated flow table.
  • the target flow entry is located in the row corresponding to the first expiration time.
  • processing module 401 is further configured to:
  • the processing module 401 is configured to update the first expiration time to the second expiration time.
  • the target flow entry further includes a time difference between the second expiration time and the first expiration time, wherein the time difference corresponds to the target flow entry, or the integrated flow table At least one other target flow entry also changes the respective expiration time using a time difference having the same value as the time difference.
  • processing module 401 is further configured to:
  • the header fields have the same kind
  • At least one operation corresponding to the third packet is obtained from the OVS, where the at least one operation includes a forwarding operation
  • processing module 401 is further configured to:
  • the type of the field in the packet header is the type of information corresponding to the field or the location of the field in the header of the first packet.
  • the device 400 may be integrated in the OVS or may not be integrated in the OVS.
  • the processing module 401 in the device 400 can monitor the OVS and monitor the OVS to parse a second target field set in the header of the third packet and generate a third When the message corresponds to at least one operation, the second target field set and the at least one operation are obtained.
  • Figure 4-2 shows that the device 400 is not integrated with the OVS, the device 400 can communicate with the OVS;
  • Figure 4-3 shows that the device 400 is integrated with the OVS, and the OVS can be used as A module of the device 400.
  • the processing module 401 can include a control interface, an aging unit, an integrated flow table, a monitoring unit, a parsing unit, and a processing unit. Also, it should be understood that this implementation is only illustrative and not a limitation of the implementation of the method and apparatus of the present application. The specific implementation and composition of the processing module 401 are not limited in this application.
  • the parsing unit is configured to parse multiple packet header fields of the packet header of the packet.
  • the packet may be the first packet or the third packet.
  • the parsing unit is configured to perform an AND operation on the packet header of the packet to obtain a plurality of packet header fields in the packet header; if the multiple packet header fields are pre- When a set of packet header fields is set, the plurality of packet header fields are cached in the header field set.
  • the parsing unit may perform an AND operation on the packet header of the packet with different multi-string masks to obtain a plurality of packet header field sets.
  • the preset header field set may be set by the user through the control interface in advance.
  • the processing unit is configured to query the integrated flow table according to the plurality of packet header fields in the packet field set parsed by the parsing unit, and if the target flow entry matching the plurality of packet header fields is queried, according to the target
  • the operation set included in the flow entry class processes the message and forwards the processed message through the transceiver module 402.
  • the processing unit may further change the first expiration time in the target flow entry to the second expiration time, and the second expiration time is late. At the first expiration time.
  • the target flow entry may include a time difference, where the time difference may be set by the user through the control interface.
  • the time difference set in each flow entry in the integrated flow table may be the same or different.
  • Such a processing unit may read the time difference from the target flow entry, increase the first expiration time by the time difference to obtain a second expiration time, and then change the first expiration time in the target flow entry to the second Expire date.
  • the processing unit is further configured to: when the target flow entry corresponding to the packet is not queried, input the packet to the OVS, and process the packet by using the OVS.
  • the monitoring unit is configured to monitor the OVS when the processing unit does not query the target flow entry corresponding to the packet, and obtain multiple header fields and the packet in the packet header of the packet from the OVS. Corresponding at least one operation, storing, in the integrated flow table, a flow entry including the plurality of packet header fields and the at least one operation.
  • the aging unit may check the integrated flow table, and when the expiration time of a flow entry in the integrated flow table is equal to the current time, the flow entry is deleted.
  • the OVS can be implemented by a network card of the object machine or the object machine.
  • the device 400 and the OVS may be stored in the same memory or in different memories.
  • the code of the device 400 and the code of the OVS can be stored in the same memory
  • the code of the device 400 and the code of the OVS can be stored in the memory of the physical machine, and are called by the processor of the physical machine.
  • the code of the device 400 in the memory and the code running the device 400 implements the function of forwarding the message; or the processor of the physical machine calls the code of the device 400 and the code of the OVS in the memory, and runs the device 400.
  • the code and OVS code implement the function of forwarding messages.
  • the code of the device 400 and the code of the OVS may be stored in a storage medium of the network card, and the code of the device 400 in the storage medium is called by the processing circuit of the network card and the code of the device 400 is executed to implement the forwarding report.
  • the code of the device 400 and the code of the OVS can be stored in different memories
  • the code of the device 400 can be stored in the memory of the physical machine
  • the code of the OVS can be stored in the storage medium of the network card
  • the processor of the physical machine calls the memory.
  • the code of the device 400 in operation, and the code running the device 400 acquires all operations for processing the message, and processes and forwards the message based on the entire operation. If the code through the device 400 does not obtain the full operation of the message, the processing circuit controlling the network card invokes the code of the OVS in the storage medium to effect forwarding of the message. or,
  • the code of the device 400 can be stored in a storage medium of the network card, the code of the OVS can be stored in the memory of the physical machine, the processing circuit of the network card calls the code of the device 400 in the storage medium, and the code of the device 400 is acquired.
  • the message performs all operations of processing, and processes and forwards the message according to the entire operation. If the code of the device 400 does not obtain the full operation of the message, the processor of the physical machine calls the code of the OVS in the memory to forward the message.
  • the target flow entry corresponding to the first packet in the integrated flow table includes all operations for processing the first packet
  • the processing module is configured according to the packet header in the first packet.
  • a plurality of packet header fields can find all the operations corresponding to the first packet by searching the integrated flow table, thereby improving the efficiency of processing and forwarding the first packet by the processing module.
  • FIG. 5 is a schematic diagram of an apparatus 500 for forwarding a message based on an integrated flow table according to an embodiment of the present application.
  • the apparatus 500 includes a processing circuit 501, a storage medium 502, and a communication interface 503, which are coupled to a storage medium 502 and a communication interface 503, respectively.
  • the device 500 is a hardware structured device that can be used to implement the functional modules in the device described in FIG. 4-1.
  • the processing module 401 in the apparatus 400 shown in FIG. 4-1 can be implemented by calling the code in the storage medium 502 by the processing circuit 501, and transmitting and receiving in the apparatus 400 shown in FIG. 4-1.
  • Module 402 may be implemented by the communication interface 503 or by the processing circuit 501 invoking code in the storage medium 502 for invoking the communication interface 503.
  • the apparatus 500 can include a physical machine of a processor and a memory, that is, the processing circuit 501 can be composed of one or more processors, and the storage medium 502 can be the memory. or,
  • the device 500 can be a network card of a physical machine, and the processing circuit 501 and the storage medium 502 are respectively physical circuits and storage media in the network card.
  • the apparatus 500 can also be used to implement the functions of the first device in any of the embodiments as described in FIGS. 1-1 to 1-2, or to implement any of the embodiments shown in FIGS. 2-1 and 3-1.
  • the processing circuit 501 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more for controlling the present application.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • the communication interface 503 is configured to communicate with other devices or communication networks, such as an Ethernet, a radio access network (RAN), a wireless local area network (WLAN), and the like.
  • RAN radio access network
  • WLAN wireless local area network
  • the storage medium 502 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or a device that can store information and instructions.
  • ROM read-only memory
  • RAM random access memory
  • EEPROM electrically erasable programmable read-only memory
  • magnetic disk storage media or other magnetic storage devices, or capable of carrying or storing instructions or data.
  • the desired program code in the form of a structure and any other medium that can be accessed by a computer, but is not limited thereto.
  • the storage medium 502 is used to store the application code for executing the solution of the present application, and is controlled by the processing circuit 501 for execution.
  • the processing circuit 501 is for executing application code stored in the storage medium 502 to implement the functions in the method of the present patent.
  • a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
  • the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

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

Abstract

本申请公开了一种基于集成流表转发报文的方法及装置,属于通信领域。所述集成流表包括多个流表项,所述多个流表项中的每个流表项包括匹配项与操作集之间的映射关系,所述匹配项包含多个报文头字段,所述操作集包括转发操作,所述方法包括:获取第一报文;从所述第一报文的报文头中提取多个第一报文头字段;从所述集成流表中查找与所述多个第一报文头字段相匹配的目标流表项,以确定所述第一报文对应的操作集,所述操作集中还包括在所述确定所述第一报文对应的操作集以及所述转发操作之间,对所述第一报文执行的全部其他操作;对所述第一报文执行所述操作集中的所述全部其他操作,以得到所述第一报文对应的第二报文,以及转发所述第二报文。本申请能够提高处理报文的效率。

Description

一种基于集成流表转发报文的方法及装置
本申请要求于2018年3月31日提交的申请号为201810278226.6、发明名称为“一种基于集成流表转发报文的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,特别涉及一种基于集成流表转发报文的方法及装置。
背景技术
开放虚拟交换机(Open Virtual Switch,OVS)用于转发报文,可以将某个虚拟机的报文转发到网络或实体机器,或将来自网络或实体机器的报文转发到某个虚拟机。
OVS接收到报文后需要获取对报文进行处理的多个处理操作,该多个处理操作中包括转发该报文的转发操作和在该转发操作之前执行的至少一个其他操作,然后根据该至少一个其他操作对该报文进行处理,再转发处理后的该报文。
由于OVS每次只能获取到一个处理操作,所以OVS在接收到报文后需要查找多个表,通过这些表中不同的映射关系多次获取相应的处理操作,才能获取到多个处理操作,导致需要较长的时间才能获取完所有操作,比较费时,对报文进行处理的效率低下。
发明内容
为了提高处理报文的效率,本申请实施例提供了一种基于集成流表转发报文的方法及装置。所述技术方案如下:
第一方面,本申请例提供了一种基于集成流表转发报文的方法,所述集成流表包括多个流表项,所述多个流表项中的每个流表项包括匹配项与操作集之间的映射关系,所述匹配项包含多个报文头字段,所述操作集包括转发操作。这样在获取第一报文时,从所述第一报文的报文头中提取多个第一报文头字段,其中,所述多个第一报文头字段与所述多个流表项中的一个流表项包含的多个报文头字段具有相同的种类;从所述集成流表中查找与所述多个第一报文头字段相匹配的目标流表项,以确定所述第一报文对应的操作集,所述第一报文对应的操作集中还包括在所述确定所述第一报文对应的操作集以及所述转发操作之间,对所述第一报文执行的全部其他操作;对所述第一报文执行所述操作集中的所述全部其他操作,以得到所述第一报文对应的第二报文,以及转发所述第二报文。由于所述集成流表中的目标流表项包括第一报文对应的操作集,该操作集中包括对第一报文处理的全部操作,这样根据多个第一报文头字段,查找一次所述集成流表就可以查找出第一报文对应的全部操作,从而提高对第一报文进行处理和转发的效率。
其中,确定所述第一报文对应的操作集对应的操作可以是读取该第一报文对应的操作集或者其他用于使该基于集成流表转发报文的装置的处理电路准备好执行该第一报文对应的操作集中的操作,也就是说,第一报文对应的操作集中包括的操作,是针对第一报文中字段(例 如可以是报文头或者载荷,或者报文头和载荷的字段)的操作,可以达到使得转发该第一报文中的信息不需要再借助其他的流表的效果。一种实现方式下,第一报文对应的操作集中还包括在读取该第一报文对应的操作集以及所述转发操作之间,对所述第一报文中的字段所执行的全部其他操作,指的是读取该第一报文对应的操作集之后,转发操作之间的操作。
在第一方面的一种可能的实现方式中,所述报文头中的字段的种类为所述字段对应的信息的类型或为所述字段在所述第一报文的报文头的位置。
在第一方面的一种可能的实现方式中,将所述第一报文的报文头与一串掩码进行与运算,以得到所述第一报文中的所述多个第一报文头字段,所述掩码指示所述多个第一报文头字段在所述第一报文的报文头中的位置。如此使用一串掩码与第一报文的报文头进行与运算,便可提取第一报文的报文头中的所有需要提取的第一报文头字段,相比目前一个一个解析第一报文的报文头中的各报文头字段,可以提高解析的效率,进一步提高对第一报文进行处理和转发的效率。
在第一方面的一种可能的实现方式中,生成第一掩码,由于所述第一掩码与所述第一报文的报文头具有相同的字节长度,所述第一掩码中非0的比特位对应于所述目标流表项中包括的多个报文头字段。这样可以使用第一掩码解析第一报文的报文头,可以提高解析第一报文的效率。
在第一方面的一种可能的实现方式中,所述多个流表项位于所述集成流表的多个行,所述集成流表的多个行中的每行对应一个到期时间,所述到期时间用于指示从所述集成流表中删除所述到期时间对应行中的流表项的时刻,所述目标流表项位于对应第一到期时间的行。这样在从所述集成流表中查找与所述多个第一报文头字段相匹配的目标流表项,以确定所述第一报文对应的操作集后,将所述目标流表项,从所述第一到期时间对应的行移动到第二到期时间对应的行,所述第二到期时间晚于所述第一到期时间。这样可以按到期时间对流表项进行分类,如此在根据当前时间搜寻到期的流表项时,可以提高搜寻效率。
在第一方面的一种可能的实现方式中,将所述第一到期时间更新为第二到期时间。由于第二到期时间晚于第一到期时间,这样在该集成流表中查找出包括第一报文对应的操作集的目标流表项后,可以延长该目标流表项在该集成流表中的存储时间。
在第一方面的一种可能的实现方式中,所述第一报文对应的目标流表项中,还包括所述第二到期时间与所述第一到期时间之间的时间差。
在第一方面的一种可能的实现方式中,获取第三报文;从所述第三报文的报文头中提取多个第二报文头字段,其中,所述多个第二报文头字段与所述多个流表项中的一个流表项包含的多个报文头字段具有相同的种类;在所述集成流表中不包括与所述多个第二报文头字段相匹配的目标流表项的情况下,从开放虚拟交换机OVS中获取所述第三报文对应的至少一个操作,所述至少一个操作包括转发操作;对所述第三报文执行所述至少一个操作。这样当所 述集成流表中没有第三报文对应的操作集时,可以从OVS获取对所述第三报文的至少一个操作,从而保证能够成功对第三报文进行处理和转发。
在第一方面的一种可能的实现方式中,从所述OVS中获取所述第三报文的报文头中的多个第二报文头字段和至少一个操作,在所述集成流表中存储包括所述获取的该多个第二报文头字段和该至少一个操作的流表项。这样在下一次接收到第三报文时,可以一次从所述集成流表中查找出第三报文对应的操作集,提高下一次处理和转发与第三报文具有相同的该多个第二报文头字段的报文的效率。
在第一方面的一种可能的实现方式中,所述全部其他操作包括以下操作中的一个或多个:在报文头中添加字段的操作,在报文头中删除字段的操作,修改报文头中的字段的内容的操作,设定报文的优先级操作和设定连线跟踪的操作。
第二方面,本申请提供了一种基于集成流表转发报文的装置,所述集成流表包括多个流表项,所述多个流表项中的每个流表项包括匹配项与操作集之间的映射关系,所述匹配项包含多个报文头字段,所述操作集包括转发操作,所述装置包括处理模块和收发模块。所述处理模块用于获取第一报文;从所述第一报文的报文头中提取多个第一报文头字段,其中,所述多个第一报文头字段与所述多个流表项中的一个流表项包含的多个报文头字段具有相同的种类;从所述集成流表中查找与所述多个第一报文头字段相匹配的目标流表项,以确定所述第一报文对应的操作集,所述第一报文对应的操作集中还包括在所述确定所述第一报文对应的操作集以及所述转发操作之间,对所述第一报文执行的全部其他操作;对所述第一报文执行所述操作集中的所述全部其他操作,以得到所述第一报文对应的第二报文;所述收发模块,用于转发所述第二报文。由于所述集成流表中的目标流表项包括第一报文对应的操作集,该操作集中包括对第一报文处理的全部操作,这样根据多个第一报文头字段,查找一次所述集成流表就可以查找出第一报文对应的全部操作,从而提高对第一报文进行处理和转发的效率。
在第二方面的一种可能的实现方式中,所述装置中的处理模块和收发模块,还可以用于执行第一方面的任意一种可能的实现方式中的方法。关于第二方面中涉及到的与第一方面相应的词语和句子的解释,以及各种实现方法的有益效果的描述,请参考第一方面。
第三方面,本申请提供了一种基于集成流表转发报文的装置,所述集成流表包括多个流表项,所述多个流表项中的每个流表项包括匹配项与操作集之间的映射关系,所述匹配项包含多个报文头字段,所述操作集包括转发操作,所述装置包括处理模块和收发模块。所述处理模块用于获取第一报文;从所述第一报文的报文头中提取多个第一报文头字段,其中,所述多个第一报文头字段与所述多个流表项中的一个流表项包含的多个报文头字段具有相同的种类;根据所述多个第一报文头字段查找所述集成流表,当查找出与所述多个第一报文头字段相匹配的目标流表项,根据所述目标流表项确定所述第一报文对应的操作集,所述第一报文对应的操作集中还包括在所述确定所述第一报文对应的操作集以及所述转发操作之间,对所述第一报文执行的全部其他操作,对所述第一报文执行所述操作集中的所述全部其他操作;当没有查找出与所述多个第一报文头字段相匹配的目标流表项,则从开放虚拟交换机OVS中 获取所述第一报文对应的至少一个操作,所述至少一个操作包括转发操作;对所述第一报文执行所述至少一个操作。所述收发模块,用于转发处理后的第一报文。由于所述集成流表中的目标流表项包括第一报文对应的操作集,该操作集中包括对第一报文处理的全部操作,这样当从集成流表中包括目标流表项时,根据多个第一报文头字段,查找一次所述集成流表就可以查找出第一报文对应的全部操作,从而提高对第一报文进行处理和转发的效率。当所述集成流表中没有目标流表项时,可以从OVS获取对所述第一报文的至少一个操作,从而保证能够成功对第一报文进行处理和转发。
在第三方面的一种可能的实现方式中,所述装置中的处理模块和收发模块,还可以用于执行第一方面的任意一种可能的实现方式中的方法。关于第三方面中涉及到的与第一方面相应的词语和句子的解释,以及各种实现方法的有益效果的描述,请参考第一方面。
第四方面,本申请提供了一种基于集成流表转发报文的装置,所述装置包括:处理电路和存储介质;所述存储介质存储有一个或多个程序,所述一个或多个程序被配置由所述处理电路执行,所述一个或多个程序包含用于进行如第一方面或第一方面任意可能实施方式中的方法的指令。关于第三方面中涉及到的与第一方面相应的词语和句子的解释,以及各种实现方法的有益效果的描述,请参考第一方面。
第五方面,本申请提供了一种基于集成流表转发报文的装置,所述装置包括通信接口、处理电路和存储介质。其中,所述处理电路分别与所述通信接口和存储介质连接。所述存储介质用于存储程序、指令或代码,所述处理电路用于执行所述存储介质中的程序、指令或代码,完成第一方面或第一方面的任意可能的实现方式中的方法。
第六方面,本申请实施例提供了一种计算机程序产品,所述计算机程序产品包括在计算机可读存储介质中存储的计算机程序,并且所述计算程序通过处理器进行加载来实现上述第一方面或第一方面的任意可能的实现方式的方法。
第七方面,本申请提实施例供了一种非易失性计算机可读存储介质,用于存储计算机程序,所述计算机程序通过处理器进行加载来执行第一方面或第一方面的任意可能的实现方式的方法的指令。
第八方面,本申请提实施例供了一种芯片,所述芯片包括可编程逻辑电路和/或程序指令,当所述芯片运行时用于实现上述第一方面或第一方面的任意可能的实现方式的方法。
关于第二、三、四、五、六、七和八方面中涉及到的与第一方面相应的词语和句子的解释,以及各种实现方法的有益效果的描述,请参考第一方面,此处不再赘述。
附图说明
图1-1是本申请实施例提供的一种系统架构示意图;
图1-2是本申请实施例提供的一种系统架构示意图;
图1-3是一种使用OVS的虚拟网络系统的示意图;
图1-4是本申请实施例提供的一种报文的结构示意图;
图2-1是本申请实施例提供的一种基于集成流表转发报文的方法流程图;
图2-2是本申请实施例提供的一种流表项的结构示意图;
图2-3是本申请实施例提供的另一种流表项的结构示意图;
图2-4是本申请实施例提供的一种报文头和掩码的结构示意图;
图2-5是本申请实施例提供的第一报文与多个掩码与运算过程的示意图;
图2-6是本申请实施例提供的一种报文头与掩码与运算过程的示意图;
图2-7是本申请实施例提供的一种平行化解析报文的流程图;
图2-8是本申请实施例提供的一种集成流表中行的结构示意图;
图2-9是本申请实施例提供的使用链表存储集成流表中行的结构示意图;
图2-10是本申请实施例提供的对集成流表进行监控的流程图;
图3-1是本申请实施例提供的另一种基于集成流表转发报文的方法流程图;
图3-2是本申请实施例提供的一种OVS的结构示意图;
图3-3是本申请实施例提供的一种OVS处理报文的示意图;
图3-4是本申请实施例提供的一种转发报文的简要框图;
图4-1是本申请实施例提供的一种转发报文的装置结构示意图;
图4-2是本申请实施例提供的转发报文的装置与OVS之间的结构框图;
图4-3是本申请实施例提供的转发报文的装置与OVS集成后的结构框图;
图5是本申请实施例提供的一种基于集成流表转发报文的装置结构示意图。
具体实施方式
下面将结合附图对本申请实施方式作进一步地详细描述。
参见图1-1,本申请实施例提供了一种系统架构,包括:
第一设备1和第二设备2,第一设备1和第二设备2之间可以建立有网络连接。
第一设备1可以为终端或服务器等,第一设备1中可以包括至少一个虚拟机;第二设备2可以为终端或服务器等。
第一设备1可以向第二设备2发送报文,该报文可以来自第一设备1中的某个虚拟机。可选的,在实现时,第一设备1可以获取其包括的某个虚拟机的第一报文,获取用于处理该第一报文的操作,获取的操作中包括转发操作和在该转发操作之前执行的至少一个其他操作,对第一报文执行该至少一个其他操作得到第一报文对应的第二报文,可以向第二设备2转发第二报文。
第二设备2也可以向第一设备1的某个虚拟机发送报文。可选的,第一设备1接收来自第二设备2的第一报文,获取用于处理该第一报文的操作,获取的操作中包括转发操作和在该转发操作之前执行的至少一个其他操作,对第一报文执行该至少一个其他操作得到第一报文对应的第二报文,可以向该某个虚拟机输入第二报文。
可选的,第一设备1可以为路由器或交换机等交换设备。参见图1-2,该系统还可以包括第三设备3,第一设备1和第三设备3之间也可以建立有网络连接。第一设备1可以转发第二设备2和第三设备3之间的报文。
例如,第一设备1可以接收来自第二设备2的第一报文,获取用于处理该第一报文的操作,获取的操作中包括转发操作和在该转发操作之前对第一报文执行的全部其他操作,对第一报文执行该全部其他操作得到第二报文,可以向第三设备3转发第二报文。
可选的,第二设备2可以为终端,第三设备3可以服务器;或者,第二设备2可以为服务器,第三设备3可以为终端;或者,第二设备2和第三设备3可以均为终端或服务器。
可选的,第一设备1可以根据第二报文的报文头中的接收端信息转发第二报文,该接收端信息可以包括接收端地址,还可以包括接收端端口号等信息。
如果该接收端信息对应的接收端为虚拟机,则第一设备1向该虚拟机输入第二报文;如果该接收端信息对应的接收端为第二设备2,则第一设备1向第二设备2转发第二报文;如果该接收端信息对应的接收端为第三设备3,则第一设备向第三设备3转发第二报文。
上述所述的报文(为第一报文和/或第二报文),该报文包括报文头和报文内容(也称为载荷),而报文头中包括多个报文头字段。即报文头字段是组成报文头的字段。接下来举了一种报文的例子,以对报文头和报文头字段进行说明。例如报文头中通常包括源地址、源端口号、目的地址和目的端口号等字段,这些字段就是报文头字段。
第一设备、第二设备和第三设备中的任一个都可以包括用于实现本申请实施例方法的装置,该装置可以执行本实施方法中的各步骤的操作,以实现转发报文,由于OVS也是用于转发报文的,可以认为该装置具有OVS的功能。
对上述设备中的任一个,设备中还可以包括OVS,即该装置也可以与OVS集成在一起,该装置与OVS通信,可以与OVS配合,以实现转发报文。
或者,OVS是该装置的一个部分,例如OVS可以是组成该装置的一个模块。
再或者,第一设备中也可以不包括OVS,OVS位于除第一设备以外的其他设备中,该装置与该其他设备通信,可以与该其他设备上的OVS配合,实现转发报文。
在本实施例中,第一报文的报文头中存在多个第一报文头字段,该多个第一报文头字段与集成流表中的一个流表项包含的多个报文头字段具有相同的种类。
图1-3是一种使用OVS的虚拟网络系统的示意图,例如该架构图中的节点1,节点2和节点3可以对应前文中的一种实现方式下的第一设备、第二设备和第三设备。
节点1、节点2和节点3分别为三台安装有OVS软件并配置有网卡(network interface card,NIC)的物理主机或服务器,三个节点通过物理交换机107传输信息,每个节点均拥有完整的软件和硬件,为了简洁,图1-3仅示例性地画出了节点1包括的软件和硬件。
如图1-1所示,节点1的硬件包括中央处理器101(central processing unit,CPU)、存储器102和网卡103,节点1的软件包括OVS 104、虚拟机(virtual machine,VM)105和VM106,节点1上的VM 105和VM 106通过OVS 104和网卡103与其它节点通信。其中,本申请描述的基于集成流表转发报文的装置,作为软件就可以位于OVS104中;或者独立于OVS104,例如可用框图表示在图上的虚拟机(VM105、VM106)和OVS104之间,报文先使用该装置进行转发,如果装置中的集成流表无法转发该报文,再通过OVS转发;可以使用CPU101的硬件资源执行本申请的方法,也可以使用网卡103的硬件资源来执行本申请的方法。上述虚拟网络系统仅是举例说明,适用于本申请的虚拟网络系统不限于此,例如,节点1还可以安装容器或者其它虚拟操作系统软件,节点的数量还可以是其它数量,每个节点所包括的硬件也都不限于图1-3所示的硬件。
例如,参见图1-4所示的虚拟扩展局域网(Virtual Extensible LAN,VXLAN)报文的结构,包括报文头、报文内容和帧校验序列(Frame Check Sequence,FCS)。报文头中包括外层媒体介入控制层(Media Access Control,MAC)头、外层网络之间互连的协议(Internet Protocol,IP)头、用户数据报协议(User Datagram Protocol,UDP)头和VXLAN头。
仍参见图1-4,外层MAC头包括的报文头字段分别为目的MAC地址、源MAC地址、虚似局域网(Virtual LAN,VLAN)类型、VLAN标识标签(VLAN IDentify Tag,VLAN ID Tag)、以太网类型(Ether Type)。外层IP头包括的报文头字段分别为IP头其余资料(IP Header Misc Data)、协议、头冗余校验(HeaderChecksum)、外层源IP和外层目的IP。UPD头包括的报文头字段分别为UDP源端口、VXLAN端口、UDP长度和冗余检验(Checksum)。VXLAN头包括的报文头字段分别为VXLAN、虚拟局域网标识(Virtual LAN IDentify,VNID)和两个保留字段。
在本实施例中,第一设备1对第一报文进行处理,以及转发处理后得到的第二报文的详细过程,可以参见如下任一实施例的实现过程,在此先不进行详细说明。
参见图2-1,本申请实施例提供了一种基于集成流表转发报文的方法,该方法的执行主体可以为图1-1或图1-2所示实施例中的第一设备,包括:
步骤201:获取第一报文。
第一报文可以是来自虚拟机的报文或者可以是来自除第一设备外的其他物理设备发送的报文。其中,该虚拟机可以运行在第一设备中,或者该虚拟机可以运行在除第一设备外的其他物理设备上。
例如,当第一设备为网络中的路由器或交换机等网元,第一设备可以接收来自终端、服务器或网络中的其他网元发送的第一报文。或者,
当第一设备为服务器时,第一设备可以接收来自终端或其他服务器等设备发送的第一报文,或者,第一设备中可以包括至少一个虚拟机,第一设备可以获取来自某个虚拟机的第一报文。或者,
当第一设备为终端时,第一设备可以接收来自其他终端或服务器等设备发送的第一报文,或者,第一设备中包括至少一个虚拟机,第一设备可以获取来自某个虚拟机的第一报文。
该集成流表中包括多个流表项,该多个流表项中的每个流表项包括匹配项与操作集之间的映射关系,对于每个流表项中包括的匹配项和操作集,该匹配项包含多个报文头字段,该操作集包括转发操作,以及在该转发操作之前对与该操作集对应的报文所执行的全部其他操作。
其中,确定所述第一报文对应的操作集对应的操作可以是读取该第一报文对应的操作集或者其他用于使该基于集成流表转发报文的装置的处理电路准备好执行该第一报文对应的操作集中的操作,也就是说,第一报文对应的操作集中包括的操作,是针对第一报文中字段(例如可以是报文头或者载荷,或者报文头和载荷的字段)的操作,可以达到使得转发该第一报文中的信息不需要再借助其他的流表的效果。一种实现方式下,第一报文对应的操作集中还包括在读取该第一报文对应的操作集以及所述转发操作之间,对所述第一报文中的字段所执行的全部其他操作,指的是读取该第一报文对应的操作集之后,转发操作之间的操作。
该全部其他操作所包括的种类包括以下一个或多个:在报文头中添加字段的操作,在报文头中删除字段的操作,修改报文头中的字段的内容的操作,设定报文的优先级操作和设定 连线跟踪的操作。一种实现方式下,所述全部其他操作种类只有上述5种操作中的一类或几类,其他种类的操作都不是本申请描述的“全部其他操作”。可选的,第一报文的报文头中的字段的种类为该字段对应的信息的类型或为该字段在第一报文的报文头的位置。
在本步骤中,假设第一报文的报文头中存在多个第一报文头字段与该集成流表中的一个匹配项包含的多个报文头字段相同,所以该集成流表中包括第一报文对应的操作集。
可选的,对于该集成流表中的每个流表项中的匹配项,该流表项中的匹配项可以唯一地标识一路报文流。
集成流表中的每个流表项中的匹配项包括的报文头字段的种类可以相同,即对于集成流表中的任意两个流表项,该两个流表项中的匹配项包括的字段种类相同。这样在本实施例中,每路报文流都使用相同种类的报文头字段来唯一标识。或者,
集成流表中的每个流表项中的匹配项包括的报文头字段的种类可以不同,即对于集成流表中的任意两个流表项,该两个流表项中的匹配项包括的字段种类可以不同。
由于某些报文流需要报文的报文头中的九元组字段来唯一标识,某些报文流仅使用报文的报文头中的五元组字段就可以唯一标识,或者某些报文流仅使用报文的报文头中的四元组字段就可以唯一标识。因此集成流表中的每个流表项中的匹配项包括的报文头字段的种类可以不同。
可选的,流表项中的匹配项可以包括报文头中的九元组字段或该九元组字段中的部分报文头字段等。
可选的,该匹配项包括报文头中的九元组字段,即该匹配项包括九个报文头字段,该九个报文头字段可以分别为发送端地址、发送端端口号、接收端地址、接收端端口号、VXLAN、协议、外部虚拟局域网(OUTER VLAN)、内部虚拟局域网(INNER VLAN)和虚拟端口(virtual Port,vPort)。或者,
可选的,该匹配项可以包括该九个报文头字段中的部分报文头字段。例如,该匹配项可以包括发送端地址、发送端端口号、接收端地址和接收端端口号。再例如,该匹配项可以包括发送端地址、发送端端口号、接收端地址、接收端端口号和协议。
可选的,上述发送端地址可以为发送端IP,接收端地址可以为接收端IP。
可选的,对于上述九个报文头字段,发送端地址可以占用四个字节的长度,发送端端口号可以占用两个字节的长度,接收端地址可以占用四个字节的长度,接收端端口可以占用两个字节的长度,VXLAN可以占用三个字节的长度,协议可以占用一个字节的长度,OUTER VLAN、INNER VLAN和vPort占用的长度可以均为两个字节。
对于集成流表中的每个流表项,该流表项中的操作集包括转发操作,以及在该转发操作之前执行的至少一种其他操作。
可选的,该其他操作可以为以下操作中的任一种:在报文头中添加字段的操作,在报文头中删除字段的操作,修改报文头中的字段的内容的操作,设定报文的优先级操作和设定连线跟踪操作。对于该其他操作,在本实施例中只列举了上述几种,对其他的就不再一一列举。
可选的,在报文头中添加字段的操作可以包括在报文头中添加vlan的操作和在报文头中添加vxlan的操作中至少一个。在报文头中删除字段的操作可以包括在报文头中删除vlan的操作和在报文头中删除vxlan的操作中的至少一个。
修改报文头中的字段的内容的操作可以包括修改报文头中的发送端MAC的操作、修改报文头中的接收端MAC的操作、修改报文头中的发送端IP的操作、修改报文头中的接收端 IP的操作、修改报文头中的发送端端口号的操作和修改报文头中的接收端端口号的操作中的至少一个。
可选的,设定连线跟踪操作可以是记录报文的状态信息的操作。报文的状态信息可以包括该报文的序号等信息。
对于记录该报文的状态信息的操作,可以为:从该报文的报文头中提取用于标识报文的标识信息以及获取报文的状态信息,该标识信息可以包括报文的发送端地址、发送端端口号、接收端地址和接收端端口号中至少一个,将该标识信息和该状态信息对应保存在标识信息与状态信息的对应关系中。
可选的,参见图2-2,对于该集成流表中的每个流表项,该流表项中可以直接存储有包括多个操作的操作集。
该流表项中的操作集可以包括该多个操作中的每个操作对应的字段,操作对应的字段中包括该操作的名称、该操作的参数大小和该操作的参数。这样在后续从第一映射关系中读取操作时,先从该操作对应的字段中读取该操作的名称和该操作的参数大小,根据该操作的参数大小读取该操作的参数,以实现获取该操作。
例如,参见图2-2,该流表项中的操作集包括k+1个操作中的每个操作对应的字段;第一个操作对应的字段中包括操作的名称cmd 0、操作的参数大小size 0和操作的参数config 0;第二个操作对应的字段中包括操作的名称cmd 1、操作的参数大小size 1和操作的参数config 1……第k+1个操作对应的字段中包括操作的名称cmd k、操作的参数大小size k和操作的参数config k。或者,
可选的,参见图2-3,该流表项可以不直接存储包括多个操作的操作集,而是存储有指向包括该操作集的指针。在该操作集中该多个操作中的每个操作对应字段,操作对应的字段中包括该操作的名称、该操作的参数大小和该操作的参数。例如,参见图2-3,该流表项包括指针action pointer,该指针action pointer指向的操作集中包括k+1个操作中的每个操作对应的字段;第一个操作对应的字段中包括操作的名称cmd 0、操作的参数大小size 0和操作的参数config 0;第二个操作对应的字段中包括操作的名称cmd 1、操作的参数大小size 1和操作的参数config 1……第k+1个操作对应的字段中包括操作的名称cmd k、操作的参数大小size k和操作的参数config k
可选的,对于在报文头中添加vlan的操作,该操作的参数至少包括添加的vlan的字段内容。
对于在报文头中添加vxlan的操作,该操作的参数至少包括添加的vxlan的字段内容。
对于在报文头中删除vlan的操作,该操作的参数至少包括用于标识需要删除的vlan的字段标识。
对于在报文头中删除vxlan的操作,该操作的参数至少包括用于标识需要删除的vxlan的字段标识。
对于修改报文头中的发送端MAC的操作,该操作的参数至少包括修改后的发送端的MAC地址。
对于修改报文头中的接收端MAC的操作,该操作的参数至少包括修改后的接收端的MAC地址。
对于修改报文头中的发送端IP的操作,该操作的参数至少包括修改后的发送端的IP地址。
对于修改报文头中的接收端IP的操作,该操作的参数至少包括修改后的接收端的IP地址。
对于修改报文头中的发送端端口号的操作,该操作的参数至少包括修改后的发送端的端口号。
对于修改报文头中的接收端端口号的操作,该操作的参数至少包括修改后的接收端的端口号。
对于设定报文的优先级操作,该操作的参数至少包括优先级。
对于设定连线跟踪操作,该操作的参数至少包括用于指示记录报文的状态信息的指示信息。
可选的,参见图2-2,对于该集成流表中的每条流表项,该流表项除了包括匹配项和操作集外,还可以包括其他信息。例如,该流表项还可以包括报文统计信息,该报文统计信息可以包括报文数目和/或报文数据量。该报文数目用于记录使用该流表项转发的报文的总数目,该报文数据量用于记录使用该流表项转发的报文的总数据量。
其中,该集成流表中的每条流表项可以由技术人员设置的或者在转发报文的过程中生成的。在转发报文的过程生成该流表项的详细过程可以参见图3-1所述的实施例,在此先不做详细说明。
步骤202:从第一报文的报文头中提取多个第一报文头字段。
其中,提取的多个第一报文头字段与集成流表中的一个流表项包括的多个报文头字段具有相同的种类。
在本步骤中,可以将第一报文的报文头与一串掩码进行与运算,以得到第一报文中的多个第一报文头字段,该串掩码指示该多个第一报文头字段在第一报文的报文头中的位置。
可选的,在执行本步骤之前,可以生成一串第一掩码,其中,第一掩码与第一报文的报文头具有相同的字节长度,第一掩码在集成流表中对应至少一个目标流表项,第一掩码中非0的比特位对应于目标流表项中包括的多个报文头字段。然后,可以将第一报文的报文头与第一掩码进行与运算,以得到第一报文中的多个第一报文头字段。
可选的,第一掩码包括多个掩码字段,第一报文的报文头中的每个报文头字段对应一个掩码字段。对于第一报文的报文头中的每个报文头字段,该报文头字段的长度等于其对应的掩码字段的长度,如果该报文头字段的种类是目标流表项中的一个报文头字段的种类,则该报文头字段对应的掩码字段由比特1组成,如果该报文头字段的种类不是目标流表项中的一个报文头字段的种类,则该报文头字段对应的掩码字段由比特0组成。
例如,假设第一掩码在该集成流表中对应的目标流表项包括报文头中的九元组字段,即目标流表项中包括发送端地址、发送端端口号、接收端地址、接收端端口号、VXLAN、协议、OUTER VLAN、INNER VLAN和vPort。
参见图2-4所示的第一报文的报文头中的每个报文头字段,第一报文的报文头包括版本、服务类型、发送端地址、总长度、发送端端口号、接收端地址、接收端端口号、VXLAN、协议、OUTER VLAN、INNER VLAN和vPort十二个报文头字段。同样,对于生成的第一掩码,第一掩码中也可以包括该十二个报文头字段中的每个报文头字段对应的掩码字段。
其中,对于版本、服务类型和总长度,这三个报文头字段的种类均不是该目标流表项中的报文头字段的种类,所以版本对应的掩码字段由比特0组成,服务类型对应的掩码字段由比特0组成,以及总长度对应的掩码字段由比特0组成。
对于发送端地址、发送端端口号、接收端地址、接收端端口号、VXLAN、协议、OUTER VLAN、INNER VLAN和vPort,这九个报文头字段的种类均为该目标流表项中的报文头字段的种类,所以发送端地址对应的掩码字段由比特1组成,发送端端口号对应的掩码字段由比特1组成,接收端地址对应的掩码字段由比特1组成,接收端端口号对应的掩码字段由比特1组成,VXLAN对应的掩码字段由比特1组成,协议对应的掩码字段由比特1组成,OUTERVLAN对应的掩码字段由比特1组成,INNERVLAN对应的掩码字段由比特1组成,以及vPort对应的掩码字段由比特1组成。
可选的,当集成流表中的每个流表项中的匹配项包括的报文头字段的种类相同时,只需要生成一串第一掩码。将第一报文的报文头与该串第一掩码与运算得到一个包括多个第一报文头字段的报文头字段集合。
假设第一报文的报文头中存在多个第一报文头字段与该集成流表中的一个匹配项包含的多个报文头字段相同,即在本步骤中提取的包括该多个第一报文头字段的报文头字段集合与集成流表中的一个匹配项相同。
可选的,当集成流表中的每个流表项中的匹配项包括的报文头字段的种类可以不同时,可以生成多串第一掩码。每串第一掩码在集成流表中对应目标流表项,每串第一掩码对应的目标流表项中的报文头字段的种类不同。
对于每串第一掩码,将第一报文的报文头与该串第一掩码进行与运算,得到包括多个第一报头字段的一个报文头字段集合,该报文头字段集合中的报文头字段与该串第一掩码对应的目标流表项中的报文头字段具有相同种类。这样可以从第一报文中提取N个报文头字段集合,N为大于1的整数且每个报文头字段集合具有的报文头字段的种类不同。
在本实施例中,假设该N个报文头字段集合中存在一个报文头字段集合与集成流表中的一个匹配项相同。
例如,参见图2-5,假设可以生成六串第一掩码,分别为第一掩码1、2、3、4、5和6,将第一报文的报文头分别与第一掩码1、2、3、4、5和6进行与运算,得到报文头字段集合1、2、3、4、5和6。
其中,可以事先预设至少一个报文头字段集合。且该集成流表中的每个匹配项均为预设的报文头字段集合。
可选的,对于每串第一掩码,将第一报文的报文头与该串第一掩码进行一次与运算,以得到第一报文头中的多个报文头字段;如果该多个报文头字段为预设的一个报文头字段集合时,则将该多个报文头字段组成报文头字段集合。如果该多个报文头字段与预设的至少一个报文头字段集合中的每个报文头字段集合均不同时,则丢弃该多个报文字段。
可选的,可以向用户提供一个控制界面,用户可以通过该控制界面事先预设至少一个报文头字段集合。
在本实施例中,只需要将第一报文的报文头与一串掩码进行一次平行化与运算,就可以得到第一报文头中所需要获取的多个第一报文头字段,从而可以提高了解析第一报文字段的效率。
例如,参见图2-6,将第一报文的报文头与图2-4中的一串第一掩码进行与运算,与运算之后,第一报文的报文头中被保留下来的多个第一报文头字段包括发送端地址、发送端端口号、接收端地址、接收端端口号、VXLAN、协议、OUTER VLAN、INNER VLAN和vPort九个报文头字段,该九个报文头字段均为需要提取的第一报文头字段并将该九个报文头字段 组成报文头字段集合。
其中,步骤202为平行化解析操作,参见图2-7,步骤202的平行化解析操作可以大体分为:获取到第一报文,识别第一报文的报文头,截取第一报文的报文头中的各报文头字段,将各报文头字段与一串掩码进行与运算得到报文头字段集合。
步骤203:从该集成流表中查找与该多个第一报文头字段相匹配的目标流表项,以确定第一报文对应的操作集。
第一报文对应的操作集中在所述确定所述第一报文对应的操作集以及所述转发操作之间,对所述第一报文执行的全部其他操作。
其中,当集成流表中的每个流表项中的匹配项包括的报文头字段的种类可以相同时,由于在步骤202提取到一个包括该多个第一报文头字段的报文头字段集合,且该报文头字段集合与集成流表中的一个匹配项相同。所以在本步骤中,根据该多个第一报文头字段,从该集成流表中查找到与该多个第一报文头字段相匹配的目标流表项。
其中,当集成流表中的每个流表项中的匹配项包括的报文头字段的种类可以不同时,则在步骤202中提取到N个报文头字段集合,又由于该N个报文头字段集合中存在一个报文头字段集合与集成流表中的一个匹配项相同。在本步骤中可以通过如下(1)至(4)的步骤从该集成流表中查找与该多个报文头字段集合中的某个报文头字段集合相匹配的目标流表项:
(1):从该N个报文头字段集合中选择一个报文头字段集合。
(2):根据选择的报文头字段集合,查找该集成流表,如果查找出与选择的报文头字段集合相匹配的目标流表项,则执行(3),如果没有查找出与选择的报文头字段集合相匹配的目标流表项,则执行(4)。
(3):将目标流表项包括的操作集确定为第一报文对应的操作集,结束返回。
(4):从该N个报文头字段集合中选择一个未选择过的报文头字段集合,返回执行(2)。
由于该N个报文头字段集合中存在的一个报文头字段集合与集成流表中的一个匹配项相同,所以根据某个报文头字段集合,通过上述(1)至(4)的过程会查找出第一报文对应的操作集。
可选的,从该集成流表项中查找出第一报文对应的操作集中包括多个操作的参数。
其中,需要说明的是:该多个操作中包括转发操作,以及在该转发操作之前对第一报文执行的全部其他操作。
可选的,该集成流表中的每个流表项中还可以包括到期时间,该到期时间用于指示从集成流表中删除该流表项的时刻,在本实施例中与该多个第一报文头字段相匹配的目标流表项中包括第一到期时间。
可选的,从集成流表中查找出与该多个第一报文头字段相匹配的目标流表项,以确定第一报文对应的操作集合,可以将目标流表项中的第一到期时间更新为第二到期时间,第二到期时间晚于第一到期时间。
可以通过增加第一到期时间,以得到第二到期时间。
可选的,增加第一到期时间,得到第二到期时间的实现方式有多种。例如,在本实施例中列举如下一种实现方式,具体为:
目标流表项中还包括第二到期时间与第一到期时间之间的时间差,可以将第一到期时间增加该时间差,得到第二到期时间。
可选的,该集成流表中的每个流表项中包括的时间差可以相同,也可以不同。
再例如,在本实施例中还列举了通过如下方式得到第二到期时间,在该种方式中,可以预设一个时间差,该集成流表中的每个流表项可以不包括用于增加到期时间的时间差,这样可以将第一到期时间增加预设的该时间差得到第二到期时间。
可选的,在该集成流表中的多个流表项,该多个流表项位于该集成流表的多个行,集成流表中的多个行中的每行对应一个到期时间,目标流表项位于对应的第一到期时间的行;
可选的,从集成流表中查找出与该多个第一报文头字段相匹配的目标流表项,以确定第一报文对应的操作集后,可以将目标流表项,从第一到期时间对应的行移动到第二到期时间对应的行。
可选的,集成流表中的每个到期时间可以对应一行,每行中可以包括至少一个流表项。也就是说第二到期时间对应一行,这样到期时间为第二到期时间的每个流表项可以位于第二到期时间对应的一行中。或者,
可选的,集成流表中的每个到期时间可以对应的至少一行,每行中可以包括一个流表项。也就是说第二到期时间对应至少一行,第二到期时间对应的每行包括一个到期时间为第二到期时间的流表项。
可选的,该集成流表中的每行中的流表项可以是用于标识该流表项的索引,用于标识该流表项的索引可以为指向该流表项的指针等。所以上述移动操作可以为:
将目标流表项的索引,从第一到期时间对应的行移动到第二到期时间对应的行中。
可选的,在集成流表中的每个到期时间可以对应一行,每行中可以包括至少一个流表项的情况下,可以使用链表来实现集成流表中行,每行为一个链表。使用该链表中的一个结点存储该行中的到期时间,使用该链表中的其他结点存储该行中的流表项的索引。
可选的,可以使用链表中的第一个结点存储该行中的到期时间,使用该链表中的其他节点存储该行中的流表项的索引。
例如,参见图2-8,假设该集成流表中包括k行,分别第1行、第2行……第k行,第1行包括到期时间T 1和四个流表项的索引,该四个流表项的索引,分别为C 0、C 1、C 2和C 3。第1行对应的链表的第一个结点用于存储到期时间T 1,其他结点用于存储C 0、C 1、C 2和C 3。对于第2行、第3行……第k行的含义,可以参照对第1行的含义的说明,就不再分别一一说明。
可选的,可以从该集成流表中,获取当前时间对应的行,并从该对应关系中删除该行中的流表项。这样不需要实时检查集成流表中的每个流表项中的到期时间,从而节省了运算资源。
在删除时,可以根据该行中的流表项的索引,从集成流表中查找出对应的流表项,提取该流表项中的到期时间,在比较出该到期时间与当前时间相同时,从集成流表中删除该流表项。
其中,链表的数目往往是有限的,参见图2-9,假设存在M个链表,M为大于1的整数,该集成流表中最多包括M-1行,且第i个链表中的到期时间T i晚于第i-1个链表中的到期时间T i-1,i=2、3……M-1。第M-1个链表中的到期时间为T M-1,第M个链表用于存储到期时间大于T M-1的流表项的索引。
所以,将目标流表项,从第一到期时间对应的行移动到第二到期时间对应的行的操作,可以为:
如果第二到期时间不晚于到期时间T M-1,将目标流表项的索引,从存储第一到期时间的 链表中,移动到存储第二到期时间的链表中。如果第二到期时间晚于到期时间T M-1,将目标流表项的索引,移动到第M个链路中。
可选的,如果当前时间到达到期时间T M-1时,可以清空第1个链表至第M-1个链表,再在第1个链表至第M-1个链表中每个链表中存储新到期时间,每个新到期时间均晚于到期时间T M-1,且第i个链表中的新到期时间晚于第i-1个链表中的新到期时间。
然后,对于第M个链表中的每个流表项,提取该流表项中的到期时间,将该流表项的索引从第M个链表中移动到存储该到期时间对应的链表中。
其中,参见图2-10,上述对该集成流表中的到期时间进行处理的操作,可以概括为:监听该集成流表;当监听到目标流表项被查询到时,检查该目标流表项中的第一到期时间,在检查到第一到期时间变更为第二到期时间时,移动该目标流表项,即将该目标流表项从第一到期时间对应的行移动到第二到期时间对应的行;继续监听该集成流表中的到期时间,即监听该集成流表中是否存在与当前时间相等的到期时间;删除第一映射关系,即在监听出与当前时间相等的到期时间时,将该到期时间对应的行中的流表项从该集成流表中删除。
步骤204:对第一报文执行该操作集中的全部其他操作以得到与该第一报文对应的第二报文,以及转发第二报文。
需要说明的是,该全部其他操作包括多个操作的情况下,可以并行对第一报文执行,也可以串行,在串行执行时,虽然先执行的操作改变了第一报文的字段或者改变了第一报文的某个属性,也就是说第一报文有变化,后执行的操作在此基础上,对变化后的第一报文执行,本申请中,统称这些操作是对第一报文执行的。这也是为什么,步骤204中,描述的是转发第二报文,而实质上,该方法流程的目的是转发第一报文中的信息,步骤204中的转发动作,对应的就是第一报文对应的操作集中的转发操作。
可选的,可以根据每个其他操作的参数对第一报文执行该其他操作,执行全部其他操后得到第二报文。
例如,如果该其他操作为在报文头中添加vlan的操作,则在第一报文的报文头中添加vlan的字段,得到第二字段,该字段至少携带该其他操作的参数包括的vlan的字段内容。
如果该其他操作为在报文头中添加vxlan的操作,则在第一报文的报文头中添加vxlan的字段,得到第二字段,该字段至少携带该其他操作的参数包括的vxlan的字段内容。
如果该其他操作为在报文头中删除vlan的操作,则根据该其他操作的参数包括的vlan的字段标识,从第一报文中删除vlan的字段,以得到第二报文。
如果该其他操作为在报文头中删除vxlan的操作,则根据该其他操作的参数包括的vxlan的字段标识。从第一报文中删除vxlan的字段,以得到第二报文。
如果该其他操作为修改报文头中的发送端MAC的操作,则将第一报文中的发送端MAC中的字段内容替换为该其他操作的参数包括的发送端的MAC地址,以得到第二报文。
如果该其他操作为修改报文头中的接收端MAC的操作,则将第一报文中的接收端MAC中的字段内容替换为该其他操作的参数包括的接收端的MAC地址,以得到第二报文。
如果该其他操作为修改报文头中的发送端IP的操作,则将第一报文中的发送端IP中的字段内容替换为该其他操作的参数包括的发送端的IP地址,以得到第二报文。
如果该其他操作为修改报文头中的接收端IP的操作,则将第一报文中的接收端IP中的字段内容替换为该其他操作的参数包括的接收端的IP地址,以得到第二报文。
如果该其他操作为修改报文头中的发送端端口号的操作,则将第一报文中的发送端端口 号中的字段内容替换为该其他操作的参数包括的发送端的端口号,以得到第二报文。
如果该其他操作为修改报文头中的接收端端口号的操作,则将第一报文中的接收端端口号中的字段内容替换为该其他操作的参数包括的接收端的端口号,以得到第二报文。
如果该其他操作为设定报文的优先级操作,则将第一报文中的优先级字段中的字段内容替换为该其他操作的参数包括的优先级,以得到第二报文。
如果该其他操作为设定连线跟踪操作,则根据该其他操作的参数包括的指示信息,获取第一报文的标识信息和状态信息,将第一报文的标识信息和状态信息对应保存的标识信息与状态信息的对应关系中。
在本申请实施例中,由于集成流表中的目标流表项中包括处理第一报文的全部操作,这样根据第一报文的报文头中的多个第一报文头字段,查找一次该集成流表就可以查找出第一报文对应的全部操作,从而提高对第一报文进行处理和转发的效率。另外,在解析第一报文的报文头得到该多个第一报文头字段时,使用掩码与第一报文的报文头进行与运算得到该多个第一报文头字段,相比目前一个一个解析第一报文的报文头中的各报文头字段,可以提高解析的效率,进一步提高对第一报文进行处理和转发的效率。
参见图3-1,本申请实施例提供了一种基于集成流表转发报文的方法,该方法中与前文所述方法对应的名词、步骤、实现方式以及技术效果,请参考前文的描述,为了行文简洁,下文不再一一描述。该方法的执行主体可以为图1-1或图1-2所示实施例中的第一设备,包括:
步骤301:获取第三报文。
第三报文可以是来自虚拟机的报文或者可以是来自除第一设备外的其他物理设备发送的报文。其中,该虚拟机可以运行在第一设备中,或者该虚拟机可以运行在除第一设备外的其他物理设备上。
例如,当第一设备可以为网络中的路由器或交换机等网元时,第一设备可以接收来自终端、服务器或网络中的其他网元发送的第三报文。或者,
当第一设备可以为服务器时,第一设备可以接收来自终端或其他服务器等设备发送的第三报文,或第一设备中可以包括至少一个虚拟机,第一设备可以获取来自某个虚拟机的第三报文。或者,
当第一设备可以为终端时,第一设备可以接收来自其他终端或服务器等设备发送的第三报文,.或第一设备中包括至少一个虚拟机,第一设备可以获取来自某个虚拟机的第三报文。
关于该集成流表中的内容可以参见图2-1所示的实施例中的步骤201中关于该集成流表的描述,在此不再详细说明。
可选的,在获取到第三报文后,还可以解析出第三报文的协议,如果该协议是预设协议集合中的预设协议,则执行如下步骤302的操作,如果不是,则执行如下步骤304的操作,即直接通过OVS转发第三报文。这样可以只对属于预设协议的报文从该集成流表中查找该报文对应的操作。
预设协议的报文通常属于流量较大的报文流,因此在接收属于预设协议的报文时,可以通过如下步骤302的操作加快对该报文进行处理和转发。
步骤302:从第三报文的报文头中提取多个第二报文头字段。
其中,提取的多个第二报文头字段与集成流表中的一个流表项包括的多个报文头字段具有相同的种类。
解析第二报文的报文头中的多个第二报文头字段的详细内容可以参见图2-1所示的实施例中的步骤202中关于解析多个第一报文头字段的描述,在此不再详细说明。
可选的,当集成流表中的每个流表项中的匹配项包括的报文头字段的种类相同时,从第三报文的报文头中提取出一个包括多个第一报文头字段的报文头字段集合。
可选的,当集成流表中的每个流表项中的匹配项包括的报文头字段的种类可以不同时,从第三报文的报文头中提取出N个包括多个第一报文头字段的报文头字段集合,N为大于1的整数。
步骤303:根据该多个第二报文头字段,查找该集成流表,以确定该集成流表中不包括与该多个第二报文头字段相匹配的目标流表项的情况,执行步骤304。
其中,当集成流表中的每个流表项中的匹配项包括的报文头字段的种类可以相同时,则在步骤302提取到一个包括该多个第二报文头字段的报文头字段集合,所以在本步骤中,根据该多个第二报文头字段,查找该集成流表。
其中,当集成流表中的每个流表项中的匹配项包括的报文头字段的种类可以不同时,则在步骤302中提取到N个报文头字段集合,在本步骤中可以通过如下(1)至(5)的步骤查找该集成流表:
(1):从该N个报文头集合中选择一个报文头字段集合。
(2):根据选择的报文头字段集合,查找该集成流表,如果查找出与选择的报文头字段集合相匹配的目标流表项,则执行(3),如果没有查找出与选择的报文头字段集合相匹配的目标流表项,则执行(4)。
(3):将目标流表项包括的操作集确定为第三报文对应的操作集,结束返回。
(4):判断该N个报文头字段集合中是否还存在未被选择的报文头字段集合,如果不存在,则结束返回,如果存在,则执行(5)。
(5):从该N个报文头字段集合中选择一个未选择过的报文头字段集合,返回执行(2)。
由于该集成流表中不包括该N个报文头字段集合,所以根据每个报文头字段集合,通过上述(1)至(5)的过程在该集成流表中均没有查找出第三报文对应的操作集。
步骤304:从OVS中获取第三报文对应的至少一个操作和第三报文的报文头中的多个第二报文头字段,对第三报文执行该至少一个操作。
在确定该集成流表中不包括第三报文对应的操作时,OVS可以解析第三报文的报文头中的多个第二报文头字段并根据该多个第二报文头字段确定第三报文对应的至少一个操作。
在本步骤中,可以获取该多个第二报文头字段和该至少一个操作,该至少一个操作包括转发操作,对第三报文执行该至少一个操作。
可选的,该至少一个操作还可以包括在该转发操作之前执行的至少一个其他操作,可以对第三报文执行该至少一个其他操作,得到第四报文,然后转发第四报文。
参见图3-2,OVS包括完整匹配快存(Exact Match Cache,EMC)表和数据流表。OVS中还可以包括通信协议,该通信协议可以为Openflow通讯协议。
可选的,数据流表包括至少一个哈希表,数据流表中存储至少一个报文对应的操作,对于每个报文,该报文对应的至少一个操作存储在数据流表中的不同哈希表中,在该哈希表中可以存储有包括该报文的报文头中的多个报文头字段和该报文对应的一个操作的映射关系。
EMC表为一张哈希表,EMC表中存储有数据流表中的部分报文对应的操作,对于该部分报文中的每个报文,在EMC表中存储有包括该报文的报文头中的多个报文头字段和该报 文对应的一个操作的映射关系。由于每条映射关系中只包括一个操作,所以在EMC表中存储有该报文对应的至少一条映射关系,该报文对应的至少一个操作存储在该至少一条映射关系。
在本步骤中,在确定该集成流表中不包括第三报文对应的操作集时,可以向OVS输入第三报文。参见图3-3,OVS接收该第三报文,提取第三报文的报文头中的多个第二报文头字段,根据该多个第二报文头字段查询EMC表,如果从EMC表中查询到第三报文对应的至少一个操作,根据该至少一个操作处理第三报文,以及可以通过网络适配器(Network Interface Card,NIC)转发处理后得到的第四报文。
可以理解的是,由于第三报文不在本申请描述的集成流表中,通过OVS流表对第三报文的这一部分处理过程和现有技术的方案类似,下面,就以第三报文由OVS流表处理的过程,来进一步解释本申请技术方案的效果。由于在EMC中每条映射关系中只包括一个操作,所以第三报文对应的至少一个操作分布在不同映射关系。假设第三报文对应五个操作,则该五个操作分布在五条映射关系中,该五条映射关系中的每条映射关系包括该多个第二报文头字段和第三报文对应的一个操作。这样在根据该多个第二报文头字段查询EMC表时,当查询到包括该多个第二报文头字段的第一条映射关系后,继续根据该多个第二报文头字段查询EMC表,查询包括该多个第二报文头字段的第二条映射关系;再继续根据该多个第二报文头字段查询EMC表,查询包括该多个第二报文头字段的第三条映射关系;按上述方式,当查询包括该多个第二报文头字段的第五条映射关系后,如果EMC表还有未查询的映射关系,则继续查询,直至查询完整个EMC表,才确定将第三报文对应的所有操作全部被查询出来。
然而,参见图2-1所示的实施例,可知,第一报文携带有需要被转发的信息,第一报文是本申请的基于集成流表转发报文的方法所要处理的报文。在根据第一报文的多个第一报文头字段,查询集成流表时,当查询到与该多个第一报文头字段相匹配的目标流表项时,由于该目标流表项的操作集中包括转发操作和全部其他操作,其中,所谓的全部其他操作就是,所述确定所述第一报文对应的操作集以及所述转发操作之间,对所述第一报文中的字段执行操作,对所述第一报文执行的全部其他操作,也就是说,不需要跳转到其他流表中查找转发第一报文的信息所需的操作。所以当查询到目标流表项就获取到对第一报文携带的信息进行转发的全部操作,不需要继续查询集成流表中剩下未被查询的流表项,也就是说,对于能够从集成流表中查询到目标流表项的报文,只需要使用集成流表这一张表,就可以支持对这个报文的转发,从而提高了获取对报文处理的操作的效率。
如果从EMC表中没有查询到该多个第二报文头字段的至少一个操作,则根据该多个第二报文头字段查询数据流表中的哈希表,如果从数据流表中查询到第三报文对应的至少一个操作,根据该至少一个操作处理第三报文,可以通过NIC转发处理后得到的第四报文。如果从数据流表中没有查询到第三报文对应的至少一个操作,则根据该通信协议与服务器通信,以从服务器中获取第三报文对应的至少一个操作,根据该至少一个操作处理第三报文,可以通过NIC转发处理后得到的第四报文。
由于第三报文对应的至少一个操作存储在数据流表中的不同哈希表中,假设第三报文对应五个操作,则该五个操作分布在五个哈希表中。在第一个操作所在的第一哈希表中包括该多个第二报文头字段、该第一个操作和第二哈希表的地址的映射关系,第二哈希表是第二个操作所在的哈希表;在第二哈希表中包括该多个第二报文头字段、第二个操作和第三哈希表的地址的映射关系,第三哈希表是第三个操作所在的哈希表;在第三哈希表中包括该多个第 二报文头字段、第三个操作和第四哈希表的地址的映射关系,第四哈希表是第四个操作所在的哈希表;在第四哈希表中包括该多个第二报文头字段、第四个操作和第五哈希表的地址的映射关系,第五哈希表是第五个操作所在的哈希表;在第五哈希表中包括该多个第二报文头字段和第五个操作的映射关系。
这样在根据该多个第二报文头字段查询数据流表中的哈希表,首先查询数据流表中的第一个哈希表,在查询完第一个哈希表后,还没有查询到包括该多个第二报文头字段的映射关系,则查询数据流表中的第二个哈希表,直至查询到第一哈希表时,根据该多个第二报文头字段从第一哈希表中查询包括该多个第二报文头字段的第一条映射关系,该第一条映射关系包括该多个第二报文头字段、第一个操作和第二哈希表的地址。根据第二哈希表的地址跳转到第二哈希表中,根据该多个第二报文头字段,从第二哈希表中查询包括该多个第二报文头字段的第二条映射关系,该第二条映射关系包括该多个第二报文头字段、第二个操作和第三哈希表的地址。按上述方式,直到从第五哈希表中查询到包括该多个第二报文头字段的第五条映射关系,该第五条映射关系包括该多个第二报文头字段和第五个操作,由于第五条映射关系中没有包括哈希表的地址,从而停止查询。
然而,参见图2-1所示的实施例,在根据第一报文的多个第一报文头字段,查询集成流表时,当查询到与该多个第一报文头字段相匹配的目标流表项时,由于该目标流表项的操作集中包括转发操作和对第一报文处理的全部其他操作,所以当查询到目标流表项就获取到对第一报文进行处理的全部操作,不会像查询数据流表那样需要在不同的哈希表之间跳转以及查询不同的哈希表,从而提高了获取对报文处理的操作的效率。
如果从数据流表中没有查询到第三报文对应的至少一个操作,则根据该通信协议与服务器通信,与服务器通信获取该至少一个操作所需要的时间远大于从数据流表中获取操作的时间,所以从服务器中获取操作的时间更远大于图2-1所示实施例中从集成流表中获取操作的时间,所以从集成流表中获取操作,并对报文进行处理的效率得到很大的提高。
步骤305:在该集成流表中生成包括该多个第二报文头字段和该至少一个操作的流表项。
可选的,可以为生成的流表项设置到期时间并存储在该流表项中,在该集成流表中可以将生成的流表项添加到设置的到期时间对应的行中。
可选的,将生成的流表项添加到设置的到期时间对应的行中的操作,可以为:
判断该集成流表中是否存在包括设置的到期时间的行,如果存在,将该生成的流表项添加到该行中;如果不存在,则在该集成流表中生成包括设置的到期时间和生成的流表项的行。
参见图3-4,对于图2-1所述的实施例和图3-1所示的实施例,该两个实施例的流程可以概括为以下操作:获取报文,获取该报文的多个报文头字段,根据该多个报文头字段查找集成流表;如果查找到与该多个报文头字段相匹配的目标流表项,根据该目标流表项包括的操作集处理该报文;如果没有查找到与该多个报文头字段相匹配的目标流表项,从OVS中获取至少一个操作和多个报文头字段,根据该至少一个操作处理该报文,以及,在集成流表中生成包括获取的该多个报文头字段和该至少一个操作的流表项。
在本申请实施例中,当查找出集成流表中没有第三报文对应的操作集时,从OVS中获取第三报文对应的至少一个操作,并在该集成流表中生成包括第三报文中的多个第二报文头字段和该至少一个操作的流表项,这样当下一次获取到第三报文时,就可以直接从该集成流表中获取第三报文对应的操作集,以提高下一次对第三报文进行处理和转发的效率。
参见图4-1,本申请实施例提供了一种基于集成流表转发报文的装置400,所述装置400可用于实现图2-1或图3-1所示的实施例,还可以实现图1-1或图1-2所示实施例中的第一设备的功能。
其中,集成流表包括多个流表项,该多个流表项中的每个流表项包括匹配项与操作集之间的映射关系,该匹配项包含多个报文头字段,该操作集包括转发操作,该装置400包括:
处理模块401,用于获取第一报文;从第一报文的报文头中提取多个第一报文头字段,其中,该多个第一报文头字段与该多个流表项中的一个流表项包含的多个报文头字段具有相同的种类;从该集成流表中查找与该多个第一报文头字段相匹配的目标流表项,以确定第一报文对应的操作集,第一报文对应的操作集中还包括包括在所述确定所述第一报文对应的操作集以及所述转发操作之间,对所述第一报文执行的全部其他操作;对所述第一报文执行该操作集中的全部其他操作,以得到第一报文对应的第二报文;
收发模块402,用于转发该第二报文。
收发模块402可以包括物理机的通信接口或者网卡的通信接口,也可以是用于调用物理机的通信接口或者网卡的通信接口的代码。通信接口包括天线,端口等用于实现节点间通信的至少一种器件或者单元。
可选的,本实施例的装置400可以通过物理机来实现或通过物理机中的网卡来实现。
当通过物理机来实现时,该装置400的代码可以存储于物理机的内存中,通过物理机的处理器调用内存中的该装置400的代码,从而调用物理机的通信接口实现转发报文的功能。
当通过网卡来实现时,该装置400的代码可以存储于网卡的存储介质中,通过网卡的处理电路运行存储介质中的该装置400的代码,以从而调用网卡的通信接口实现转发报文的功能。
可选的,所述全部其他操作为以下操作中的任一个或多个的组合:在报文头中添加字段的操作,在报文头中删除字段的操作,修改报文头中的字段的内容的操作,设定报文的优先级操作和设定连线跟踪的操作。
可选的,在从第一报文的报文头中提取多个第一报文头字段的方面,处理模块401,用于将第一报文的报文头与一串掩码进行与运算,以得到第一报文中的该多个第一报文头字段,该掩码指示该多个第一报文头字段在第一报文的报文头中的位置。
可选的,处理模块401,还用于:生成第一掩码,其中,第一掩码与第一报文的报文头具有相同的字节长度,第一掩码中非0的比特位对应于该目标流表项中包括的多个报文头字段。
可选的,该多个流表项位于该集成流表的多个行,集成流表的多个行中的每行对应一个到期时间,该到期时间用于指示从该集成流表中删除该到期时间对应行中的流表项的时刻,目标流表项位于对应第一到期时间的行。
可选的,处理模块401,还用于:
从集成流表中查找与该多个第一报文头字段相匹配的目标流表项,以确定第一报文对应的操作集后,将该目标流表项,从第一到期时间对应的行移动到第二到期时间对应的行,第二到期时间晚于第一到期时间。
可选的,处理模块401,用于将第一到期时间更新为第二到期时间。
可选的,目标流表项中,还包括第二到期时间与第一到期时间之间的时间差,其中,该时间差与目标流表项一一对应的,或者,该集成流表中的至少一条其他目标流表项也使用与 该时间差具有相同数值的时间差更改各自对应的到期时间。
可选的,处理模块401,还用于:
获取第三报文;
从第三报文的报文头中提取多个第二报文头字段,其中,该多个第二报文头字段与该多个流表项中的一个流表项包含的多个报文头字段具有相同的种类;
在集成流表中不包括与该多个第二报文头字段相匹配的目标流表项的情况下,从OVS中获取第三报文对应的至少一个操作,该至少一个操作包括转发操作;
对第三报文执行该至少一个操作。
可选的,处理模块401,还用于:
从OVS中获取第三报文的报文头中的多个第二报文头字段,在该集成流表中存储包括获取的该多个第二报文头字段和至少一个操作的流表项。
可选的,报文头中的字段的种类为该字段对应的信息的类型或为该字段在第一报文的报文头的位置。
可选的,需要说明的是:该装置400可以集成在OVS中,也可以不集成在该OVS中。在不集成在该OVS中时,该装置400中的处理模块401可以对该OVS进行监控,并在监控到OVS解析第三报文的报文头中的一个第二目标字段集合并产生第三报文对应的至少一个操作时,获取该一个第二目标字段集合和该至少一个操作。
参见图4-2或4-3,图4-2表示该装置400没有与OVS集成在一起,该装置400可以与OVS通信;图4-3表示该装置400与OVS集成在一起,OVS可以作为该装置400的一个模块。
为了便于理解,下面举例描述处理模块401的一种实现方式。处理模块401可以包括控制界面、老化单元、集成流表、监控单元、解析单元和处理单元。以及,应当理解,该实现方式仅为说明,而不是对本申请的方法和装置的实现的限制。处理模块401的具体实现和组成,本申请不做限制。
解析单元用于解析报文的报文头的多个报文头字段。该报文可以为上述第一报文或第三报文。
可选的,解析单元用于将该报文的报文头与一串掩码进行与运算,以得到该报文头中的多个报文头字段;如果该多个报文头字段为预设的一个报文头字段集合时,则将该多个报文头字段缓存报文头字段集合。
其中,解析单元可以将该报文的报文头与不同的多串掩码进行与运算,以得到多个报文头字段集合。
预设的报文头字段集合可以是用户事先通过控制界面设置的。
处理单元用于根据解析单元解析的报文字段集合中的多个报文头字段查询该集成流表,如果查询到与该多个报文头字段相匹配的目标流表项,则根据该目标流表项中包括的操作集处理该报文并通过收发模块402转发处理后的该报文。
可选的,在从该集成流表中查询到目标流表项时,处理单元还可以将该目标流表项中的第一到期时间变更为第二到期时间,第二到期时间晚于第一到期时间。
可选的,该目标流表项中可以包括一个时间差,该时间差可以由用户通过该控制界面设置在该目标流表项中。其中,该集成流表中的每条流表项中设置的时间差可以相同,也可以不同。这样处理单元可以从该目标流表项中读取该时间差,将第一到期时间增加该时间差得 到第二到期时间,然后将该目标流表项中的第一到期时间变更为第二到期时间。
处理单元还用于在没有查询到该报文对应的目标流表项时,将该报文输入到OVS,通过OVS处理该报文。
监控单元用于在处理单元没有查询到该报文对应的目标流表项时,对OVS进行监控,并从OVS中获取该报文的报文头中的多个报文头字段和该报文对应的至少一个操作,在该集成流表中存储包括该多个报文头字段和该至少一个操作的流表项。
可选的,老化单元可以检查该集成流表,当检查到该集成流表中的某个流表项的到期时间等于当前时间时,删除该流表项。
可选的,在该装置400与OVS不集成在一起时,OVS可以通过物体机或物体机的网卡来实现。可选的,该装置400和OVS可以存储在同一存储器,也可以存储在不同存储器中。
当该装置400的代码和OVS的代码可以存储在同一存储器时,当通过物理机来实现时,该装置400的代码和OVS的代码可以存储于物理机的内存中,通过物理机的处理器调用内存中的该装置400的代码并运行该装置400的代码实现转发报文的功能;或者,通过物理机的处理器调用内存中的该装置400的代码和OVS的代码,并运行该装置400的代码和OVS的代码实现转发报文的功能。当通过网卡来实现时,该装置400的代码和OVS的代码可以存储于网卡的存储介质中,通过网卡的处理电路调用存储介质中的该装置400的代码并运行该装置400的代码实现转发报文的功能;或者,通过网卡的处理电路调用存储介质中的该装置400的代码和OVS的代码,并运行该装置400的代码和OVS的代码实现转发报文的功能。
当该装置400的代码和OVS的代码可以存储在不同存储器时,该装置400的代码可以存储在物理机的内存中,OVS的代码可以存储在网卡的存储介质中,物理机的处理器调用内存中的该装置400的代码,并运行该装置400的代码获取对该报文进行处理的全部操作,以及根据该全部操作来处理并转发该报文。如果通过该装置400的代码没有获取到对该报文的全部操作,则控制网卡的处理电路调用存储介质中的OVS的代码实现转发该报文。或者,
该装置400的代码可以存储在网卡的存储介质中,OVS的代码可以存储在物理机的内存中,网卡的处理电路调用存储介质中的该装置400的代码,并运行该装置400的代码获取对该报文进行处理的全部操作,以及根据该全部操作来处理并转发该报文。如果通过该装置400的代码没有获取到对该报文的全部操作,则由物理机的处理器调用内存中的OVS的代码实现转发该报文。
在本申请实施例中,由于集成流表中的第一报文对应的目标流表项中包括对第一报文进行处理的全部操作,这样处理模块根据第一报文的报文头中的多个报文头字段,查找一次该集成流表就可以查找出第一报文对应的全部操作,从而提高处理模块对第一报文进行处理和转发的效率。
参见图5,图5所示为本申请实施例提供的一种基于集成流表转发报文的装置500示意图。该装置500包括处理电路501、存储介质502和通信接口503,处理电路501分别与存储介质502和通信接口503连接。
该装置500是一种硬件结构的装置,可以用于实现图4-1所述的装置中的功能模块。例如,本领域技术人员可以想到图4-1所示的装置400中的处理模块401可以通过该处理电路501调用存储介质502中的代码来实现,图4-1所示的装置400中的收发模块402可以通过该通信接口503,或者通过处理电路501调用存储介质502中用于调用通信接口503的代码来 实现。
可选的,该装置500可以包括处理器和内存的物理机,即该处理电路501可以由一个或多个处理器组成,该存储介质502可以为该内存。或者,
可选的,该装置500可以为物理机的网卡,该处理电路501和存储介质502分别为网卡中的物理电路和存储介质。
该装置500还可用于实现如图1-1至1-2所述的任一实施例中第一设备的功能,或者实现图2-1和图3-1所示的任一实施例。
可选的,上述处理电路501可以是通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
上述通信接口503,用于与其他设备或通信网络通信,如以太网,无线接入网(radio access network,RAN),无线局域网(wireless local area networks,WLAN)等。
上述存储介质502可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。
其中,存储介质502用于存储执行本申请方案的应用程序代码,并由处理电路501来控制执行。处理电路501用于执行存储介质502中存储的应用程序代码,从而实现本专利方法中的功能。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (14)

  1. 一种基于集成流表转发报文的方法,其特征在于,所述集成流表包括多个流表项,所述多个流表项中的每个流表项包括匹配项与操作集之间的映射关系,所述匹配项包含多个报文头字段,所述操作集包括转发操作,所述方法包括:
    获取第一报文;
    从所述第一报文的报文头中提取多个第一报文头字段,其中,所述多个第一报文头字段与所述多个流表项中的一个流表项包含的多个报文头字段具有相同的种类;
    从所述集成流表中查找与所述多个第一报文头字段相匹配的目标流表项,以确定所述第一报文对应的操作集,所述第一报文对应的操作集中还包括在所述确定所述第一报文对应的操作集以及所述转发操作之间,对所述第一报文执行的全部其他操作;
    对所述第一报文执行所述操作集中的所述全部其他操作,以得到所述第一报文对应的第二报文,以及转发所述第二报文。
  2. 根据权利要求1所述的方法,其特征在于,所述从所述第一报文的报文头中提取多个第一报文头字段包括:
    将所述第一报文的报文头与一串掩码进行与运算,以得到所述第一报文中的所述多个第一报文头字段,所述掩码指示所述多个第一报文头字段在所述第一报文的报文头中的位置。
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    生成第一掩码,其中,所述第一掩码与所述第一报文的报文头具有相同的字节长度,所述第一掩码中非0的比特位对应于所述目标流表项中包括的多个报文头字段。
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述多个流表项位于所述集成流表的多个行,所述集成流表的多个行中的每行对应一个到期时间,所述到期时间用于指示从所述集成流表中删除所述到期时间对应行中的流表项的时刻,所述目标流表项位于对应第一到期时间的行,所述方法还包括:
    从所述集成流表中查找与所述多个第一报文头字段相匹配的目标流表项,以确定所述第一报文对应的操作集后,将所述目标流表项,从所述第一到期时间对应的行移动到第二到期时间对应的行,所述第二到期时间晚于所述第一到期时间。
  5. 根据权利要求1至4任一项所述的方法,其特征在于,所述方法还包括:
    获取第三报文;
    从所述第三报文的报文头中提取多个第二报文头字段,其中,所述多个第二报文头字段与所述多个流表项中的一个流表项包含的多个报文头字段具有相同的种类;
    在所述集成流表中不包括与所述多个第二报文头字段相匹配的目标流表项的情况下,从开放虚拟交换机OVS中获取所述第三报文对应的至少一个操作,所述至少一个操作包括转发操作;
    对所述第三报文执行所述至少一个操作。
  6. 根据权利要求1至5任一项所述的方法,其特征在于,所述全部其他操作包括以下操作中的一个或多个:在报文头中添加字段的操作,在报文头中删除字段的操作,修改报文头中的字段的内容的操作,设定报文的优先级操作和设定连线跟踪的操作。
  7. 一种基于集成流表转发报文的装置,其特征在于,所述集成流表包括多个流表项,所述多个流表项中的每个流表项包括匹配项与操作集之间的映射关系,所述匹配项包含多个报文头字段,所述操作集包括转发操作,所述装置包括:
    处理模块,用于获取第一报文;从所述第一报文的报文头中提取多个第一报文头字段,其中,所述多个第一报文头字段与所述多个流表项中的一个流表项包含的多个报文头字段具有相同的种类;从所述集成流表中查找与所述多个第一报文头字段相匹配的目标流表项,以确定所述第一报文对应的操作集,所述第一报文对应的操作集中还包括在所述确定所述第一报文对应的操作集以及所述转发操作之间,对所述第一报文执行的全部其他操作;对所述第一报文执行所述操作集中的所述全部其他操作,以得到所述第一报文对应的第二报文;
    收发模块,用于转发所述第二报文。
  8. 根据权利要求7所述的装置,其特征在于,在从所述第一报文的报文头中提取多个第一报文头字段的方面,所述处理模块,用于:
    将所述第一报文的报文头与一串掩码进行与运算,以得到所述第一报文中的所述多个第一报文头字段,所述掩码指示所述多个第一报文头字段在所述第一报文的报文头中的位置。
  9. 根据权利要求8所述的装置,其特征在于,所述处理模块,还用于:
    生成第一掩码,其中,所述第一掩码与所述第一报文的报文头具有相同的字节长度,所述第一掩码中非0的比特位对应于所述目标流表项中包括的多个报文头字段。
  10. 根据权利要求7至9任一项所述的装置,其特征在于,所述多个流表项位于所述集成流表的多个行,所述集成流表的多个行中的每行对应一个到期时间,所述到期时间用于指示从所述集成流表中删除所述到期时间对应行中的流表项的时刻,所述目标流表项位于对应第一到期时间的行,所述处理模块,还用于:
    从所述集成流表中查找与所述多个第一报文头字段相匹配的目标流表项,以确定所述第一报文对应的操作集后,将所述目标流表项,从所述第一到期时间对应的行移动到第二到期时间对应的行,所述第二到期时间晚于所述第一到期时间。
  11. 根据权利要求7至10任一项所述的装置,其特征在于,所述处理模块,还用于:
    获取第三报文;
    从所述第三报文的报文头中提取多个第二报文头字段,其中,所述多个第二报文头字段与所述多个流表项中的一个流表项包含的多个报文头字段具有相同的种类;
    在所述集成流表中不包括与所述多个第二报文头字段相匹配的目标流表项的情况下,从开放虚拟交换机OVS中获取所述第三报文对应的至少一个操作,所述至少一个操作包括转发操作;
    对所述第三报文执行所述至少一个操作。
  12. 根据权利要求7至11任一项所述的装置,其特征在于,所述全部其他操作包括以下操作中的一个或多个:在报文头中添加字段的操作,在报文头中删除字段的操作,修改报文头中的字段的内容的操作,设定报文的优先级操作和设定连线跟踪的操作。
  13. 一种基于集成流表转发报文的装置,其特征在于,所述装置包括:
    处理电路和存储介质;
    所述存储介质存储有一个或多个程序,所述一个或多个程序被配置由所述处理电路执行,所述一个或多个程序包含用于进行如权利要求1至6任一项权利要求所述的方法的指令。
  14. 一种非易失性计算机可读存储介质,其特征在于,用于存储计算机程序,所述计算机程序通过处理器进行加载来执行如权利要求1至6任一项权利要求所述的方法的指令。
PCT/CN2019/080602 2018-03-31 2019-03-29 一种基于集成流表转发报文的方法及装置 WO2019185051A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/725,247 US11496393B2 (en) 2018-03-31 2019-12-23 Method and apparatus for forwarding packet based on integrated flow table

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810278226.6 2018-03-31
CN201810278226.6A CN110324245B (zh) 2018-03-31 2018-03-31 一种基于集成流表转发报文的方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/725,247 Continuation US11496393B2 (en) 2018-03-31 2019-12-23 Method and apparatus for forwarding packet based on integrated flow table

Publications (1)

Publication Number Publication Date
WO2019185051A1 true WO2019185051A1 (zh) 2019-10-03

Family

ID=68060963

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/080602 WO2019185051A1 (zh) 2018-03-31 2019-03-29 一种基于集成流表转发报文的方法及装置

Country Status (3)

Country Link
US (1) US11496393B2 (zh)
CN (2) CN110324245B (zh)
WO (1) WO2019185051A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111131050A (zh) * 2019-12-31 2020-05-08 盛科网络(苏州)有限公司 流表的匹配方法及装置
CN113132238A (zh) * 2019-12-31 2021-07-16 华为技术有限公司 一种通信方法及设备
CN111740910A (zh) * 2020-06-19 2020-10-02 联想(北京)有限公司 一种报文处理方法、装置、网络传输设备及报文处理系统
CN111740909A (zh) * 2020-06-19 2020-10-02 联想(北京)有限公司 一种报文处理方法、装置、网络传输设备及报文处理系统
CN111953609B (zh) * 2020-08-07 2022-10-11 平安科技(深圳)有限公司 基于ovs的数据包处理方法及相关设备
CN112953927B (zh) * 2021-02-07 2022-03-11 中国科学院计算技术研究所 基于虚拟交换机中流表结构隔离的流表查询方法及系统
CN116489237A (zh) * 2022-01-13 2023-07-25 大唐移动通信设备有限公司 数据包处理方法、装置及网络设备
CN114553762B (zh) * 2022-01-30 2023-12-26 阿里巴巴(中国)有限公司 一种对流表中的流表项处理的方法及装置
CN114726788B (zh) * 2022-05-06 2024-02-02 深圳星云智联科技有限公司 应用于dpu的报文传输方法及相关装置
CN116506355B (zh) * 2023-06-27 2023-09-05 珠海星云智联科技有限公司 卸载流表存储的处理方法及相关装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104394083A (zh) * 2014-09-22 2015-03-04 华为技术有限公司 转发表项处理的方法、报文转发的方法及其装置和系统
CN104394080A (zh) * 2014-11-28 2015-03-04 杭州华三通信技术有限公司 实现安全组功能的方法及装置
CN104518969A (zh) * 2014-12-12 2015-04-15 北京智谷睿拓技术服务有限公司 数据报文处理方法、装置及交换机
KR20150135041A (ko) * 2014-05-23 2015-12-02 숭실대학교산학협력단 오픈플로우 라우팅 장치 및 방법

Family Cites Families (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2857538B1 (fr) * 2003-07-08 2006-10-06 At & T Corp Systeme et methode de compression d'en-tete de paquets bases sur la creation dynamique d'un gabarit
US8930690B2 (en) 2012-03-21 2015-01-06 Microsoft Corporation Offloading packet processing for networking device virtualization
CN104219160B (zh) * 2013-05-31 2018-08-14 华为技术有限公司 生成输入参数的方法及设备
PT3002931T (pt) * 2013-06-26 2019-10-31 Huawei Tech Co Ltd Método e sistema de atribuição de endereços ip
CN103354522B (zh) * 2013-06-28 2016-08-10 华为技术有限公司 一种多级流表查找方法和装置
CN104348716B (zh) * 2013-07-23 2018-03-23 新华三技术有限公司 一种报文处理方法及设备
CN104426768B (zh) * 2013-09-05 2018-06-15 华为技术有限公司 一种数据报文转发方法及装置
US9602398B2 (en) * 2013-09-15 2017-03-21 Nicira, Inc. Dynamically generating flows with wildcard fields
US9270592B1 (en) * 2014-01-24 2016-02-23 Google Inc. Hash collision avoidance in network routing
US9686200B2 (en) * 2014-03-31 2017-06-20 Nicira, Inc. Flow cache hierarchy
CN106105098B (zh) * 2014-09-25 2019-05-31 华为技术有限公司 交换机及业务请求报文的处理方法
US11178051B2 (en) * 2014-09-30 2021-11-16 Vmware, Inc. Packet key parser for flow-based forwarding elements
CN104601468B (zh) 2015-01-13 2018-10-09 新华三技术有限公司 报文转发方法和设备
US9473404B2 (en) * 2015-01-23 2016-10-18 Telefonaktiebolaget Lm Ericsson (Publ) Symmetric flow processing in a software-defined networking (SDN) system
US9825862B2 (en) * 2015-08-26 2017-11-21 Barefoot Networks, Inc. Packet header field extraction
CN105224692B (zh) * 2015-11-03 2018-08-31 武汉烽火网络有限责任公司 支持多核处理器的sdn多级流表并行查找的系统及方法
CN106936777B (zh) 2015-12-29 2020-02-14 中移(苏州)软件技术有限公司 基于OpenFlow的云计算分布式网络实现方法、系统
CN107204867B (zh) 2016-03-18 2020-03-24 中兴通讯股份有限公司 一种信息传输方法、装置和系统
CN105959217A (zh) * 2016-06-06 2016-09-21 北京邮电大学 一种sdn移动自组网的数据处理方法及装置
EP3340064B1 (en) 2016-08-03 2020-12-02 Huawei Technologies Co., Ltd. Network interface card, computer device and data packet processing method
EP3510730B1 (en) * 2016-09-12 2020-06-24 Telefonaktiebolaget LM Ericsson (PUBL) Efficient troubleshooting in sdn network
US20180083876A1 (en) * 2016-09-20 2018-03-22 Radisys Corporation Optimization of multi-table lookups for software-defined networking systems
CN106506402B (zh) 2016-10-21 2019-08-23 中国科学院声学研究所 一种协议无关转发流缓存方法
CN106961363A (zh) * 2017-03-29 2017-07-18 云络动力(北京)科技有限公司 一种捕获虚拟交换机用户态数据平面数据报文的方法和系统
US11115328B2 (en) * 2017-05-04 2021-09-07 Telefonaktiebolaget Lm Ericsson (Publ) Efficient troubleshooting in openflow switches

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150135041A (ko) * 2014-05-23 2015-12-02 숭실대학교산학협력단 오픈플로우 라우팅 장치 및 방법
CN104394083A (zh) * 2014-09-22 2015-03-04 华为技术有限公司 转发表项处理的方法、报文转发的方法及其装置和系统
CN104394080A (zh) * 2014-11-28 2015-03-04 杭州华三通信技术有限公司 实现安全组功能的方法及装置
CN104518969A (zh) * 2014-12-12 2015-04-15 北京智谷睿拓技术服务有限公司 数据报文处理方法、装置及交换机

Also Published As

Publication number Publication date
US11496393B2 (en) 2022-11-08
US20200136969A1 (en) 2020-04-30
CN110324245B (zh) 2021-03-23
CN113542125B (zh) 2022-11-25
CN113542125A (zh) 2021-10-22
CN110324245A (zh) 2019-10-11

Similar Documents

Publication Publication Date Title
WO2019185051A1 (zh) 一种基于集成流表转发报文的方法及装置
US11792117B2 (en) Packet processing method and apparatus
CN107113240B (zh) 可扩展虚拟局域网报文发送方法、计算机设备和可读介质
US7180887B1 (en) Routing and forwarding table management for network processor architectures
US7007101B1 (en) Routing and forwarding table management for network processor architectures
JP7208008B2 (ja) ネットワークデバイスで使用するためのプログラマブルパケット分類フレームワークを提供するためのシステムおよび方法
WO2019057199A1 (zh) 一种报文转发的方法及网络设备
US8767757B1 (en) Packet forwarding system and method using patricia trie configured hardware
US9973400B2 (en) Network flow information collection method and apparatus
US11652735B2 (en) Multicast data packet processing method, and apparatus
CN111937360B (zh) 最长前缀匹配
US9847940B2 (en) Control method, packet processing device, and storage medium
WO2018192587A1 (zh) 一种查表方法及装置、计算机存储介质
US10263901B2 (en) Service packet processing method, apparatus, and system
US20210334270A1 (en) Information query method and apparatus, device, and storage medium
US9385951B2 (en) Apparatus and method for controlling packet transfer based on registered destination information
CN115242892B (zh) 一种流标识获取方法、装置、设备及介质
CN116319553A (zh) 一种表项查找方法以及网络设备
CN114422437B (zh) 一种异构报文的转发方法及装置
US10541914B2 (en) Data packet forwarding method and network device
WO2016176853A1 (zh) 一种路由查询方法和网络设备
US20170279915A1 (en) Switch access module, cell encapsulation method, switching network system and computer storage medium
US9444731B2 (en) Methods and systems for data packet routing
WO2023088226A1 (zh) 转发报文的方法以及相关设备

Legal Events

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

Ref document number: 19774770

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19774770

Country of ref document: EP

Kind code of ref document: A1