WO2014019205A1 - 处理数据报文的方法、装置及系统 - Google Patents
处理数据报文的方法、装置及系统 Download PDFInfo
- Publication number
- WO2014019205A1 WO2014019205A1 PCT/CN2012/079602 CN2012079602W WO2014019205A1 WO 2014019205 A1 WO2014019205 A1 WO 2014019205A1 CN 2012079602 W CN2012079602 W CN 2012079602W WO 2014019205 A1 WO2014019205 A1 WO 2014019205A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- bit field
- matching
- information
- domain information
- flow entry
- Prior art date
Links
- 238000012545 processing Methods 0.000 title claims abstract description 97
- 238000000034 method Methods 0.000 title claims abstract description 84
- 230000008569 process Effects 0.000 claims description 38
- 230000004048 modification Effects 0.000 claims description 36
- 238000012986 modification Methods 0.000 claims description 36
- 230000004044 response Effects 0.000 claims description 33
- 238000004364 calculation method Methods 0.000 claims description 20
- 238000012795 verification Methods 0.000 claims description 12
- 238000005538 encapsulation Methods 0.000 description 23
- 238000010586 diagram Methods 0.000 description 14
- 238000005516 engineering process Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 10
- 230000009471 action Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012217 deletion Methods 0.000 description 3
- 230000037430 deletion Effects 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000011664 signaling Effects 0.000 description 2
- 101150117538 Set2 gene Proteins 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004140 cleaning Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005111 flow chemistry technique Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2483—Traffic characterised by specific attributes, e.g. priority or QoS involving identification of individual flows
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/38—Flow based routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/52—Multiprotocol routers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/70—Routing based on monitoring results
Definitions
- the present invention relates to the field of information technology and, in particular, to a method, apparatus and system for processing data messages. Background technique
- the OpenFlow technology aims to solve the bottleneck of the current network facing new services based on the existing TCP/IP technology conditions and the innovative network interconnection concept.
- the core idea is to convert the packet forwarding process, which was originally controlled by the switch/router, into an independent process performed by the OpenFlow Switch (OpenFlow Switch) and the Openflow Controller (Controller). Therefore, devices in the OpenFlow network can be distributed and centralized, and the network becomes user-definable.
- the embodiment of the invention provides a method, a device and a system for processing a data message, which can implement flexible customization processing of data messages.
- the first aspect provides a method for processing a data packet, including: matching a data packet with a matching domain information of a flow entry; the flow entry includes the matching domain information and operation domain information;
- the operation domain information includes an operation type and a first bit field indication information, where the first bit field indication information includes a first offset and a first field length, and the first bit field indication information is used to specify the data.
- a first bit field of the packet, or the matching domain information includes second bit field indication information and a matching value, where the second bit field indication information includes a second offset and a second field length, the second The bit field indication information is used to specify a second bit field of the data message; if the data message matches the matching domain information, the number is determined according to the operation domain information. According to the message.
- the operation domain information includes the operation type and the first bit domain indication information
- the datagram is used according to the operation domain information
- the operation includes: determining a first bit field of the data packet according to the first bit field indication information; and operating the first bit field according to the operation type.
- the matching domain information includes the second bit domain indication information and the matching value
- the matching the data packet with the matching domain information of the flow entry includes: determining, according to the second bit field indication information, a second bit field of the data packet; according to the matching value, The second bit field is matched.
- the second aspect provides an apparatus for processing a data packet, including: a matching unit, configured to match a data packet with a matching domain information of a flow entry; the flow entry includes the matching domain information and operation
- the domain information includes the operation type and the first bit field indication information, where the first bit field indication information includes a first offset and a first field length, where the first bit field indicates information
- the first bit field of the data packet is specified, or the matching domain information includes second bit field indication information and a matching value, where the second bit field indication information includes a second offset and a second field length.
- the second bit field indication information is used to specify a second bit field of the data packet, and the operation unit is configured to: according to the operation domain information, if the data packet and the matching domain information are successfully matched , operating on the data packet.
- the operating unit when the operation domain information includes the operation type and the first bit field indication information, the operating unit is specifically configured to: if the data packet And the first bit field of the data packet is determined according to the first bit field indication information, and the first bit field is operated according to the operation type.
- the matching domain information includes the second bit field indication information and the matching
- the matching unit is configured to: determine, according to the second bit field indication information, a second bit field of the data packet; and perform matching on the second bit field according to the matching value.
- the third aspect provides a method for processing a data packet, including: generating a flow entry adding indication message, where the flow entry adding indication information includes matching domain information and operation domain information; where the operating domain information includes Operation type and first bit field indication information, the first bit field indication letter
- the information includes a first offset and a first field length, where the first bit field indication information is used to specify a first bit field of the data packet, or the matching domain information includes second bit field indication information and a matching value.
- the second bit field indication information includes a second offset and a second field length, where the second bit field indication information is used to specify a second bit field of the data packet; sending the flow entry to add And indicating the message to the switching device, so that the switching device generates a flow entry according to the flow entry adding indication message, and processes the data packet according to the flow entry.
- the method further includes: sending a feature request message to the switching device, where the feature request message is used to query whether the matching domain information or the operation domain information is supported; Receiving a characteristic response message sent by the switching device, where the characteristic response message is used to indicate that the matching domain information or the operation domain information is supported.
- the fourth aspect provides an apparatus for processing a data packet, including: a generating unit, configured to generate a flow entry adding indication message, where the flow entry adding indication information includes matching domain information and operation domain information;
- the operation domain information includes an operation type and a first bit field indication information, where the first bit field indication information includes a first offset and a first field length, where the first bit field indication information is used to specify a data message.
- the matching domain information includes second bit field indication information and a matching value, where the second bit field indication information includes a second offset and a second field length, where the second bit field indication
- the information is used to specify a second bit field of the data packet
- the sending unit is configured to send the flow entry update indication message to the switching device, so that the switching device adds the indication message according to the flow entry to generate a flow. An entry, and processing the data packet according to the flow entry.
- the sending unit is further configured to send a feature request message to the switching device, where the feature request message is used to query whether the matching domain information is supported or the
- the device includes a receiving unit, configured to receive a feature response message sent by the switching device, where the feature response message is used to indicate that the matching domain information or the operating domain information is supported.
- the fifth aspect provides a system for processing a data message, comprising: a device for processing a data message provided by the second aspect; and a device for processing the data message provided by the fourth aspect.
- the specific bit field of the data packet can be flexibly determined according to the offset and the length of the field, and the specific bit field is matched or operated, so that the flexible processing of the data packet can be flexibly customized, thereby enabling
- the processing of data packets is no longer limited to a specific protocol format, avoiding the need for standardized extensions for new protocols, making the processing of data packets more generic. Sex. DRAWINGS
- FIG. 1 is a schematic diagram of an example of a network architecture to which an embodiment of the present invention may be applied;
- FIG. 2 is a schematic flowchart of a method of processing a data message according to an embodiment of the present invention;
- FIG. 3 is a process data according to an embodiment of the present invention. Schematic flow chart of the method of the message;
- FIG. 5 is a schematic flow chart showing an example of a process of matching data packets according to an embodiment of the present invention.
- Figure 7 is a schematic illustration of an illustrative example of an example
- FIG. 11 is a schematic diagram of an example of an arrangement of a flow table according to an embodiment of the present invention.
- FIG. 12 is a schematic block diagram of an apparatus for processing a data message according to an embodiment of the present invention.
- FIG. 13 is a flowchart according to another embodiment of the present invention. Schematic block diagram of a device for processing a data message.
- FIG. 14 is a schematic block diagram of a system for processing a data message according to another embodiment of the present invention.
- FIG. 15 is a hardware implementation of an apparatus for processing a data message according to another embodiment of the present invention. Schematic diagram of the structure;
- 16 is a hardware implementation of an apparatus for processing a data message according to another embodiment of the present invention. Schematic diagram of the structure. detailed description
- FIG. 1 is a schematic diagram of an example of a network architecture to which an embodiment of the present invention may be applied. It should be noted that the example of FIG. 1 is only intended to assist those skilled in the art to better understand the embodiments of the present invention, and not to limit the scope of the embodiments of the present invention. In Figure 1, the architecture of the OpenFlow network is taken as an example.
- an Openflow switch includes one or more Flow tables that implement packet packet matching and forwarding, and a Secure channel that connects to an external Openflow controller.
- the Openflow switch's secure channel interacts with the Openflow controller through Openflow protocol messages to implement flow table operations inside the switch.
- Each flow table includes one or more flow entries.
- Openflow controller passed
- Openflow protocol messages can add, update, or delete flow entries in a flow table.
- Each flow entry includes matching domain information and corresponding operational domain information, wherein the operational domain information may also be referred to as Actions domain information or Instructions (Instructions) domain information.
- the switch After receiving the data packet from the input port, the switch starts matching from the first flow table, and then jumps to the next flow table to continue matching. This flow-through-flow table is called a flow line.
- the Pipeline d switch compares the received packets with the matching domain information of each flow entry in the flow table. If the flow table contains and receives the received packets. If the matching flow entry is executed, the corresponding operation in the operation domain information in the flow entry is performed.
- the operation domain in the flow entry includes two types of information, and the first type is to jump the matched packet to the next flow table to further implement Processing, at the same time can also pass the corresponding metadata; The second type is to implement the modification and forwarding of data packets to the output port.
- the OpenFlow switching device may be a switch-enabled device that supports the OpenFlow technology, and may be an OpenFlow switch, which is not limited by the embodiment of the present invention.
- the OpenFlow switching device can be called a switching device.
- the OpenFlow control device may be a control-enabled device that supports the OpenFlow technology, and may be an OpenFlow controller, which is not limited by the embodiment of the present invention.
- the OpenFlow control device is referred to as a control device.
- OpenFlow network is taken as an example for description, the embodiment of the present invention may also be applied to other control planes and forwarding planes similar to the OpenFlow network. In the network architecture. This embodiment of the present invention does not limit this.
- FIG. 2 is a schematic flowchart of a method for processing a data message according to an embodiment of the present invention.
- the method of Figure 2 is performed by a switching device, such as a switch that supports OpenFlow technology.
- the flow entry includes the matching domain information and the operational domain information.
- the operation domain information includes an operation type and first bit field indication information, where the first bit field indication information includes a first offset and a first field length, where the first bit field indication information is used. Specifies the first bit field of the data message.
- the operation domain information includes the first bit field indication information
- the length of the specific bit field can be determined according to the length of the first field, so that the specific bit field can be obtained, and corresponding operations can be performed on the specific bit field according to the operation type. Therefore, it is possible to freely acquire a specific bit field in the data message to perform corresponding operations, and is no longer limited to a specific protocol format, thereby avoiding the standardized extension required for the new protocol.
- the first bit field indication information further includes a first mask, and after obtaining the specific bit field according to the first offset and the first field length, obtaining one of the bit fields according to the first mask.
- a plurality of bits that is, at least one bit in the bit field, and then corresponding operations may be performed on the obtained one or more bits according to the type of operation. Therefore, on the basis of the specific bit field of the freely obtained data message, one or more specific bits in the specific bit field can be freely obtained for corresponding operations, thereby increasing the degree of freedom in custom processing of the data message and Versatility.
- the matching domain information includes second bit field indication information and a matching value, where the second bit field indication information includes a second offset and a second field length, where the second bit field indication information is used. Specify a second bit field of the data text.
- the matching between the second bit field and the matching value is successful, that is, the data packet matches the flow entry successfully.
- the matching value corresponds to the second bit field indication information.
- the matching domain information includes the second bit field indication information, determining, according to the second offset, that a specific bit field of the data packet is at a starting position of the data packet, according to the second field.
- the length, the length of the specific bit field can be determined, so that the specific bit field can be obtained, and then the bit field is matched according to the matching value. Therefore, it is possible to freely acquire a specific bit field in the data packet for matching, and is no longer limited to a specific protocol format, thereby avoiding the need for a new protocol. Standardized extensions carried out.
- the second bit field indication information further includes a second mask.
- one of the bit fields may also be obtained according to the second mask.
- a plurality of bits, that is, at least one bit in the bit field, and then the obtained one or more bits can be matched according to the matching value. Therefore, one or more specific bits in the specific bit field can be freely acquired for matching on the basis of a specific bit field of the freely obtained data message, thereby increasing the degree of freedom and versatility of custom processing of the data message. .
- the data packet may refer to a packet data packet.
- the data packet is operated according to the operation domain information.
- the operating the data packet according to the operation domain information may include:
- the first bit field indication information determines a first bit field of the data message, and operates on the first bit field according to the operation type.
- the operating the data packet may include: determining, according to the first bit field indication information, the data packet a bit field, according to the first mask, obtaining at least one bit of the first bit field, and operating at least one bit of the first bit field according to the operation type.
- the operation domain information includes the operation type and the first bit field indication information
- the operation domain information further includes an operand
- the operation of the one bit field may include: operating the first bit field and the operand according to the operation type.
- the operating the at least one bit of the first bit field according to the operation type may include: according to the operation type, at least one bit of the first bit field and the Operands operate.
- the switching device may have a forwarding plane function and does not have a control plane function.
- the control surface function can be done by an external control device.
- the control device can parse the context information of the protocol format and the protocol format of the data packet, and map the processing of the data packet to the matching domain information and/or the operation domain information in the flow entry, so that the forwarding surface is processed and The specific protocol format is irrelevant.
- the operation domain information in the flow entry includes the first bit field indication information, and the first bit domain indication information includes the first offset and the first field length, so the switching device
- the first bit field in the data packet can be arbitrarily determined according to the first bit field indication information, and the first bit field is operated without parsing a specific protocol format of the data message.
- the switching device can arbitrarily determine the second bit field in the data packet according to the second bit field indication information, and match the second bit field without parsing the specific protocol format of the data message.
- the switching device does not need to be extended in the existing specification for the specific protocol format of the data packet, thereby enabling flexible and custom stream operations of the user. And can avoid the need for standardized extensions for emerging protocols. Therefore, in the embodiment of the present invention, the processing method of the data file is more general, and the application scenario is more extensive. In comparison, since the types of protocol formats supported by the existing OpenFlow specifications are limited, if the data packets of the newly added protocol format are to be processed, the existing specifications can only be applied to the newly added protocol formats. Continued expansion, resulting in a bloated extension.
- the flexible positioning of the specific bit field of the data packet can be realized by using the offset and the length of the field, so that the flexible processing of the data packet can be flexibly customized, so that the processing of the data packet is not limited.
- the specific protocol format avoids the need for standardized extensions for new protocols, making the processing of data packets more versatile.
- the switching device matches the matching domain information of the data packet and the flow entry, and may also use the switching device to the datagram according to the prior art.
- the process of matching the matching domain information of the text and the flow entry is performed. This embodiment of the present invention does not limit this.
- the switching device operates the data packet according to the operation domain information, and may also perform operations on the data packet according to the switching device in the prior art.
- the domain information is executed during the process of operating the data message. This embodiment of the present invention does not limit this.
- the offset may be an address of a packet frame received from an input port of the switching device, and the unit may be an 8-bit byte.
- the above field length can represent the number of bytes of consecutive fields after the offset.
- the offset and field length can collectively specify a contiguous byte segment of a length in the data message.
- the above mask (Mask) may represent a bit mask within a field specified by the offset and the length of the field. The length of the mask can be the same as the length of the field.
- the foregoing operation type may include a pop-up operation type, a push-in operation type, a set operation type, a length calculation operation type, a checksum calculation operation type, and a checksum.
- the type of validation operation the type of incremental operation, the type of decrement operation, or the type of copy operation.
- the switching device may receive the flow entry adding indication message sent by the control device, where the flow entry adding indication message may include the matching domain information and the operating domain information.
- the switching device can generate a flow entry according to the received matching domain information and the operation domain information. It should be known to those skilled in the art that the flow entry can also be pre-configured on the switching device.
- the switching device may receive the flow entry modification indication message sent by the control device, where the flow entry modification indication message may include the matching domain information and the new operational domain information.
- the switching device can modify the flow entry according to the matching domain information and the new operational domain information.
- the switching device may receive the feature request message sent by the control device, where the feature request message may be used to query whether the switching device supports the universal stream processing capability, that is, whether the matching domain is supported. Information or operational domain information as described above.
- the switching device can send a characteristic response message to the control device, and the characteristic response message can be used to indicate that the universal stream processing capability is supported, that is, the matching domain information or the operation domain information described above is supported.
- the "general stream processing" may be that the processing of the data packet by the switching device is not limited to the specific protocol format of the data packet, that is, the specific protocol of the switching device does not need to parse the data packet.
- the related context information and the format of the data message can complete the processing of the data message.
- the foregoing flow entry may coexist in the same flow table with the flow entry in the prior art.
- the above flow entry can be stored in a separate flow table.
- the foregoing flow entry may be an extension of an existing flow entry, for example, the operation domain information and/or the matching domain information may be added to the flow entry of the existing common flow table.
- the above flow entry can also be stored separately in the newly added flow table in the switching device.
- the newly added flow table may be referred to as a Generic Flow Table.
- the general flow table can be interspersed in the existing Flow Pipeline. Other common flow tables in the flow pipeline can jump to the general flow table, and the general flow table can also jump to other common flow tables in the flow pipeline.
- FIG. 3 is a schematic flowchart of a method for processing a data message according to an embodiment of the present invention.
- the method of Figure 3 is performed by a control device, for example, a controller that supports OpenFlow technology.
- the flow entry entry indication information includes matching domain information and operation domain information.
- the operation domain information includes an operation type and a first bit field indication information, where the first bit field indication information includes a first offset and a first field length, where the first bit field indication information is used to specify data.
- the first bit field of the message may also include operands.
- the first bit field indication information may further include a first mask.
- the operation type includes a pop operation type, a push operation type, a set operation type, a length calculation operation type, a checksum calculation operation type, a checksum verification operation type, an increment operation type, a decrement operation type, or a copy. Type of operation.
- the matching domain information includes second bit field indication information and a matching value, where the second bit field indication information includes a second offset and a second field length, where the second bit field indication information is used.
- the second bit field indication information may further include a second mask.
- the switching device may add an indication message according to the flow entry, that is, according to the matching domain information and the operation domain information carried in the indication entry of the flow entry, to generate a flow entry, and according to the flow entry, The generated flow entry processes the data packet.
- the control device may generate a flow entry modification indication message, where the flow entry modification indication message also includes the foregoing matching domain information and the operation domain information. Accordingly, in step 320, the control device may send the generated flow entry modification indication message to the switching device. After receiving the flow entry modification instruction message, the switching device may modify the matching domain information in the indication message according to the flow entry, find the corresponding flow entry, and then modify the operation domain information of the corresponding flow entry to The operation domain information carried in the flow entry modification indication message, so that the switching device can process the data packet according to the updated flow entry.
- the control device may send the feature request message to the switching device, the feature request message Used to query whether the switching device supports the bit field indication information or the matching domain information.
- the control device receives the feature response message returned by the switching device, where the feature response message may indicate that the matching domain information or the operation domain information is supported, and may also indicate that the support is not supported. Match domain information or the operational domain information.
- the switching device By querying whether the switching device supports the matching domain information or the operation domain information, it may be avoided to send the matching domain information or the operating domain information to a switching device that does not support the matching domain information or the operating domain information, so that The switching device is incorrectly added or updated A flow entry is processed, so that the flow entry cannot be processed correctly.
- the flexible positioning of the specific bit field of the data packet can be realized, and the flexible processing of the data packet can be customized.
- the processing of data packets is no longer limited to a specific protocol format, and the standardized extension required for new protocols is avoided, so that the processing of data packets is more versatile.
- the switching device is a switch and the control device is a controller. Communication between the switch and the controller is possible. For example, a Transport Layer Security (TLS) can be established between the switch and the controller to conduct a session via TLS.
- TLS Transport Layer Security
- the Network Application Network Application
- the controller may be integrated into one physical entity, or may be separate, which is not limited by the embodiment of the present invention.
- the controller sends a feature request message to the switch, where the feature request message is used to query whether the switch supports the universal stream processing capability.
- the switch sends a feature response message to the controller, where the feature response message is used to indicate that the switch supports the universal stream processing capability.
- Whether the universal stream processing capability is supported in the embodiment of the present invention refers to whether the capability of locating a specific bit field by offset and field length is supported.
- the specific performance of the capability may be in various forms, such as whether the first bit field indication information or the second bit field indication information in the embodiment shown in FIG. 2 can be supported, or whether the first bit field indication is supported, for example.
- the operation domain information of the information or the matching domain information including the second bit field indication information is not limited in this embodiment of the present invention.
- the switch may carry a general stream processing capability flag in the feature response message, and notify the controller through the flag bit whether the universal stream processing capability is supported.
- the network application layer sends a flow entry update or modification indication message to the controller, where the flow entry add or modify indication message is used to indicate an operation that needs to be performed on the flow entry in the switch.
- the network application layer can map the operation of the switch to a flow table according to the business logic.
- the operation of the flow entry may include adding a flow entry or modifying a flow entry.
- the network application layer may send a flow entry entry indication message to the controller, or may invoke an Application Programming Interface (API), and the flow entry may indicate that the message may carry the matching domain information and Operation domain information.
- API Application Programming Interface
- the network application layer may send a flow entry modification indication message to the controller, where the flow entry modification indication message may carry the matching domain information and the new operation domain information.
- the network application layer may also delete the flow entry by using the flow entry deletion indication message.
- the controller sends a flow entry update or modification indication message to the switch.
- the flow entry entry indication message may carry the matching domain information and the operation domain information delivered by the network application layer.
- the flow entry modification indication message may carry the matching domain information and the new operational domain information delivered by the network application layer.
- controller may also send a flow entry deletion instruction message to the switch according to the flow entry deletion instruction message sent by the network application layer.
- the switch adds or modifies the indication message according to the flow entry sent by the controller, and operates on the flow entry.
- the switch may add a matching domain information and an operation domain information carried in the indication message according to the flow entry to generate a flow entry.
- the switch can also modify the matching domain information and the new operating domain information carried in the indication message according to the flow entry to operate the flow entry. For example, the operation domain information in the flow entry corresponding to the matching domain information carried in the flow entry modification indication message may be updated to the new operational domain information.
- the switch sends a flow entry to the controller to add or modify a response message.
- the switch adds or modifies the response message to the controller through the flow entry to notify the controller that the operation of the flow entry has been completed.
- the controller sends a flow entry to the network application layer to add or modify a response message.
- the controller adds or modifies the response message through the flow entry to notify the network application layer that the switch has completed the operation of the flow entry.
- 401-407 exemplarily describes how the controller adds and updates the flow entries on the switch.
- the controller sends a flow entry update or modification indication message may also be triggered by other conditions, which is not limited by the embodiment of the present invention.
- the following describes how the switch processes data packets based on flow entries.
- the switch receives data packets from other external network elements.
- the switch matches the data packet with the flow entry.
- the foregoing flow entry may include matching domain information
- the matching domain information may include second bit domain indication information and a matching value
- the second bit domain indication information may include a second offset and a second field length
- the second bit domain indication information Can be used to specify the second bit field of the data >3 ⁇ 4 text.
- the switch may determine the second bit field in the data packet according to the second bit field indication information. For example, the switch can determine the second bit field based on the second offset and the second field length. Furthermore, the second bit field indication information may further include a second mask. The switch can also determine a particular bit in the second bit field based on the second offset, the second field length, and the second mask. For convenience of presentation, specific bits in the second bit field are also collectively referred to as a second bit field.
- the switch After determining the second bit field, the switch can match the second bit field based on the matching value.
- the matching between the second bit field and the matching value is successful, that is, the data packet matches the flow entry successfully.
- the matching value corresponds to the second bit field indication information.
- FIG. 5 is a diagram showing an example of a process of matching data packets according to an embodiment of the present invention.
- This embodiment uses the matching domain information format in the existing OpenFlow protocol to define the universal matching domain information proposed by the present invention.
- the content of the existing OpenFlow matching domain information can be described by an OXM (OpenFlow Extensible Match) TLV (Type-Length-Value) structure.
- OXM OpenFlow Extensible Match
- TLV Type-Length-Value
- Each OXM TLV can be 5-259 bytes long and the header can take up 4 bytes.
- An example of the header format of the OXM TLV structure is shown in Table 1.
- the OXM-HASMASK 1 ( Value ) section includes the bit mask to set
- OXM_CLASS and OXM_FIELD in OXM_TYPE indicate the matching name of the matching domain information in the flow entry, such as the Ethernet destination address (ETH_DST).
- OXM_VALUE is the OXM content, and the matching value corresponding to OXM_TYPE is recorded.
- OXM_HASMASK in OXM_TYPE indicates whether the determined second bit field needs to further match some of the bits within the OXM_VALUE through the mask.
- the matching domain information may also be in the format of the OXM structure.
- the OXM structure used in the matching domain information of the embodiment of the present invention is referred to as a general OXM structure.
- a new defined member class such as OFPXMC_HW_0, can be introduced in OXM_CLASS to indicate that the extension is defined by an ONF (Open Networking Foundation) member.
- OXM_FIELD such as OXM_OF_GENERIC_FIELD , indicating that the OXM is a generic match type.
- OXM_VALUE is no longer a simple value, but includes a second offset, a second field length, a second mask, and a matching value.
- the second offset, the second field length, the second mask, and the matching value are represented by Offset, Size, Mask, and Data, respectively.
- the four parameters may be arranged in a prescribed order, or each parameter may be defined as a separate sub-TLV structure, where Type is a parameter type, such as a second offset, a second field length, and a second mask. Or match the value. Length indicates the length of the parameter byte, and Value indicates the specific value of the parameter. In addition, if multiple bit fields need to be matched, multiple general OXMs can be added to the flow table entry.
- Table 2 An example of the format of matching domain information
- OXM_CLASS OFPXMC—HW—0
- OXM_FIELD OXM_OF_GENERIC_FIELD
- Mask[Size] unit8 The second mask. Mask occupation byte length is determined by Size
- Match value That is, the value of the second bit field, the byte segment
- the length is determined by size.
- IP address Internet Protocol
- DA destination address
- the left side is used for matching using the OpenFlow standard OXM.
- OXM_CLASS indicates that the following OXM is defined by the OpenFlow standard protocol
- OXM_FIELD specifies that the category of the currently matched bit field is the IPv4 destination address
- OXM_HASMASK is 1 indicating that the mask is required
- VALUE is the specific masked IPv4. Address value.
- the right side of Table 3 is a manner of matching the IP destination address described by the general OXM defined in the embodiment of the present invention.
- the OXM_CLASS indicates that the OXM is an ONF organization member extension definition
- the OXM_FIELD identifier is a universal matching domain category
- the OXM_HASMASK is 0 indicating that no mask is needed
- the Value is the second offset, the second field length, the second mask, and the matching value.
- the matching domain information in the embodiment of the present invention is more general. Table 3 Comparison of Matching Domain Information in the OpenFlow Protocol with Matching Domain Information in the Embodiment of the Present Invention
- OXM—CLASS OFPXMC—HW—0 OFPXMC_OPENFLOW_BASIC
- OXM—FIELD OFPXMT_OFB_IPV4_DST OXM—OF—COMMOM—FIELD
- OXM_VALUE 4 (second field length)
- the switch If the data packet matches the flow entry, the switch operates the data packet according to the flow entry.
- the flow entry may include operation domain information, and the operation domain information may include an operation type and first bit domain indication information, where the first bit domain indication information may include a first offset and a first field length, where the first bit domain indication information may be The first bit field used to specify the data message.
- the switch may determine the first bit field in the data packet according to the first bit field indication information. For example, the switch can determine the first bit field based on the first offset and the first field length.
- the first bit field indication information may further include a first mask. In this way, the switch can also determine a specific bit of the first bit field according to the first offset, the first field length, and the first mask. For convenience of presentation, the specific bits of the first bit field are also collectively referred to as the first bit field.
- the switch After determining the first bit field, the switch can operate on the first bit field in the data packet according to the type of operation.
- the operation domain may further include an operand corresponding to the operation type.
- the switch can operate on the first bit field and operand of the data message according to the type of operation.
- the operation type may include a pop operation type, a push operation type, a set operation type, a length calculation operation type, a checksum calculation operation type, a checksum verification operation type, an increment operation type, a decrement operation type, or a copy operation.
- Types of It should be noted that the types of operations in the embodiments of the present invention are not limited to the types of operations listed above, and may also include other types of operations, which are not limited in the embodiments of the present invention.
- the first offset may include Top-offset and/or Bottom-offset.
- the Top-Off set may be from the start position of the packet frame received from the input port of the switch, and the Bottom-Offset may be from the end of the packet frame.
- Top-Offset and Bottom-Offset can specify one together Continuous byte segment.
- the first field length is represented by Size, and the first field length may include Sizel and Size2.
- the operand is represented by Data or Step, and the first mask is represented by Mask. Table 4 indicates the operation type and the corresponding first bit field indication information in the operation domain information.
- the specified bit field pops up.
- Pop-up operation type Pop ( Top- offset, Size ) can be used to decapsulate the tunnel header (Tunnel
- This type of operation is used to encapsulate the tunnel header.
- Size, Mask, Data This type of operation can be used to modify the value of a specified bit field.
- Section length, and bit field 1 byte length calculation operation ( Top-offset 1 ,
- bit field 2 (by type Bottom-offsetl ,
- Top-offset2 and Size2 are specified). Top-offset2, Size2 )
- This type of operation is mainly used to calculate the load length.
- bit field 1 (bit field 1 consists of Top-offsetl and Bottom-offsetl
- Or sizel specifies the checksum, and the checksum calculation operation (Top-offset 1 ,
- This type of operation is primarily used to calculate the checksum of the load.
- Verify-Checksum calculation bit field 1 (bit field 1 by The checksum of the type (Top-offset 1, Top-offsetl and Bottom-offsetl Sizel/Bottom-offsetl, or Sizel specified), and Top-offset2, Size2) will checksum with bit field 2 (bit field 2) Top-offset2 is compared with the original checksum stored in Size2). If they are not equal, the subsequent operations are terminated and an error message is reported to the controller. Increase the Step size for the value of the specified field of Top-offset and Size. can be use on
- Increment (Top-offset, increment sequence ⁇ 1 J (sequence increment operation type)
- Bit field 1 (bit field 1
- Top-offset2, Size2 The content is copied to bit field 2 (bit field 2 is specified by Top-offset2 and Size2).
- the above operational domain information can also adopt the TLV structure.
- An example of the definition of the above type of operation type (TYPE ) can be referred to Table 5.
- Table 5 An example of the type value of the operation type in the operation domain information
- OFPAT_GENERIC_CALCULATE_LENGTH 34 Calculating the bit field length operation Calculating the bit field checksum operation
- Size uintl6 Field length Table 7 Example of the structure of the push operation type and the corresponding first bit field indication information
- Data[Size] unit8 The value of the bit field is pushed in.
- the length of the bit field is determined by the size.
- Table 8 shows an example of the structure of the operation type and the corresponding first bit field indication information.
- Mask[Size] unit8 mask Mask occupied byte length is determined by Size
- the value of the bit field to be pressed, the length of the bit field is determined by Size
- Size2 uintl6 bit field 2 length Table 12 Example of structure of incremental operation type and corresponding first bit field indication information
- the first offset may include Top-offset and/or Bottom-offset, and may also include Top-offsetl, Top-offset2, and Bottom-offsetl.
- the first field length is represented by Size, and the first field length may include Sizel and Size2.
- Data or Step represents the operand and Mask represents the first mask.
- each type of parameter (such as Top-offset, Bottom-offset, Size, Mask, Data, Step) involved in the Value type in the structure of the structure of the corresponding first bit field indication information may also be A separate TLV structure is used, where Type is a parameter type, such as Offset, Size, Mask, Data or Step, Length is the parameter byte length, and Value is the parameter specific value.
- the switch can perform operations on data packets without parsing the protocol format of the data packets.
- the above-mentioned operational domain information can also be called a general operating domain.
- step 410 the operation of the data packet by the switch can also be performed according to the operation mode in the prior art, which is not limited by the embodiment of the present invention.
- steps 401 to 402 and steps 403 to 407 are not performed every time data packet processing is performed, for example, may be performed once at power-on, or steps 403 to 407 may be required to be convected. Executed when the item is configured. Thus, in the subsequent data message processing, steps 401 to 402 or steps 403 to 407 need not be performed. In this way, after receiving the data packet, the switch can directly perform steps 409 and 410.
- the first bit field of the data packet is determined according to the first bit field indication information including the first offset and the first field length in the operation domain information, and according to the operation type in the operation domain information
- the operation of the first bit field is such that the operation of the data message is no longer limited to a specific protocol format, so that the standardized extension required for the new protocol can be avoided, and thus the user can completely implement the stream operation completely customized.
- the second bit field of the data packet is determined according to the second bit field indication information including the second offset and the second field length in the matching domain information, and the second bit is matched according to the matching value.
- Domain matching so that the matching of data packets is no longer limited to a specific protocol Therefore, it is possible to avoid the standardized extension required for the new protocol, and thus it is possible to implement a completely customized stream operation by the user.
- the types of protocol formats in the existing OpenFlow specification are limited, resulting in limited application scenarios.
- the existing OpenFlow specification does not support rich tunnel encapsulation and decapsulation processing.
- VLAN Virtual Local Area Network
- MPLS Multi-Protocol Label Switching
- the GTP (General Packet Radio Service) (GPRS) protocol is used as an example to describe the process of establishing a GTP tunnel based on the method of the embodiment of the present invention. It should be noted that the examples of FIG. 6 to FIG. 10 are only intended to assist those skilled in the art to better understand the embodiments of the present invention, and do not limit the scope of the embodiments of the present invention. Intentional flow chart.
- the control device here is a controller
- the switching device is a switch.
- the controller receives the GTP-C (GTP-Control) request message.
- GTP-C GTP-Control
- the controller receives a Create Session Request message.
- the message may come from other external network elements or from other logical entities of the network element.
- the embodiment of the present invention does not limit this.
- the controller establishes GTP session information.
- the controller can establish GTP-U user plane context information, such as may include users
- the controller returns a GTP-C setup response message.
- the controller maps the GTP session context information to the matching domain information and the operation domain information of the flow entry in the switch.
- the matching domain information includes second bit field indication information and a matching value, where the second bit field indication information includes a second offset and a second field length, where the second bit field indication information is used to specify the location
- the second bit field of the data message may further include a second mask.
- the operation domain information includes an operation type and a first bit field indication information, where the first bit field indication information includes a first offset and a first field length, where the first bit field indicates information
- the first bit field of the data message is specified.
- the second bit field indication information may further include a first mask.
- matching domain information and the operation domain information refer to the description in FIG. 2 or FIG. 4, and details are not described herein.
- the controller sends a flow entry update indication message to the switch, where the flow entry adds the indication message carrying the matching domain information and the operation domain information.
- the switch adds the matching domain information and the operation domain information carried in the indication message according to the flow entry to generate a flow entry.
- the switch sends a flow entry entry response message to the controller.
- the switch receives uplink GTP-U data packets from other external network elements.
- the switch can receive uplink GTP-U data packets from other external network elements.
- the switch matches the data packet in step 608 according to the matching domain information of the flow entry. After the matching succeeds, the GTP-U decapsulation operation is performed on the data packet according to the operation domain information.
- the switch forwards the IP data packet obtained by decapsulation in step 609.
- the switch receives downlink IP data packets from other network elements.
- the switch performs a GTP-U encapsulation operation on the data packet according to the matching domain information and the operation domain information in the flow entry.
- the switch operates the GTP-U data packet encapsulated in step 612.
- the controller in the GTP-C signaling phase, establishes GTP session context information according to the GTP-C request message, and maps the subsequent GTP-U decapsulation or encapsulation operation to the matching domain information and operation of the flow table entry. Domain information.
- the switch generates a flow entry according to the matching domain information and the operation domain information, and can directly process and forward the corresponding GTP-U data packet by using the first bit field indication information or the second bit field indication information to determine the corresponding bit field. Without having to parse the protocol format of the data message.
- the flow entry is generated according to the matching domain information and the operation domain information sent by the controller, so that the switch can directly perform tunnel encapsulation or decapsulation processing on the GTP-U data packet without using the data packet.
- the protocol format is parsed, which enables users to customize the stream operations. intention.
- the switching device in this embodiment is a switch
- the control device is a controller.
- the switch receives the first uplink GTP-U data packet from the other network element.
- the switch sends the first uplink GTP-U data packet in step 701 to the controller by using a PKT-IN (Packet-in, Data Packet Input) message.
- PKT-IN Packet-in, Data Packet Input
- the switch can forward the first uplink GTP-U data packet to the controller through the PKT-IN message, because the corresponding flow entry for the data packet is not established in the switch.
- the controller parses the first uplink GTP-U data packet, and determines that the GTP decapsulation operation needs to be performed on the data packet, and then the decapsulation process is mapped to the matching domain information and the operation domain information of the flow entry.
- the controller sends a flow entry update indication message to the switch, where the flow entry adds the match domain information and the operation domain information of the message carrying step 703.
- the matching domain information includes a second bit field indication information including a second offset and a second field length, and the second bit field indication information is used to specify The second bit field of the data text.
- the second bit field indication information may further include a second mask.
- the operation domain information includes an operation type and a first bit field indication information, where the first bit field indication information includes a first offset and a first field length, where the first bit field indication information is used to specify The first bit field of the data message.
- the second bit field indication information may further include a first mask.
- matching domain information and the operation domain information refer to the description in FIG. 2 or FIG. 4, and details are not described herein.
- the switch generates a flow entry according to the matching domain information and the operation domain information in step 704.
- the switch sends a flow entry entry response message to the controller.
- the controller returns a first uplink GTP-U data packet to the switch by using a PKT-OUT (Packet-out, Data Packet Output) message.
- PKT-OUT Packet-out, Data Packet Output
- the switch matches the first uplink GTP-U data packet according to the matching domain information of the flow entry. After the matching succeeds, the first uplink GTP-U data packet is decapsulated according to the operation domain information.
- the switch forwards the first uplink IP data packet obtained by decapsulation.
- the switch receives subsequent uplink GTP-U data packets from other users. 711.
- the switch matches the subsequent uplink GTP-U data packet according to the matching domain information of the flow entry. After the matching is successful, the switch performs the decapsulation operation on the subsequent uplink GTP-U data packet according to the operation domain information.
- the switch forwards the subsequent IP data packet obtained by decapsulation.
- the switch receives the first downlink IP data packet from other external network elements.
- the switch sends the first downlink IP data packet in step 713 to the controller by using a PKT-IN (Packet-in) message.
- PKT-IN Packet-in
- the switch can forward the first downlink IP data packet to the controller through the PKT-IN message, because the corresponding flow entry for the data packet is not established in the switch.
- the controller parses the first IP data packet, and determines that the data packet needs to be performed.
- the GTP-U encapsulation process maps the encapsulation process to the matching domain information and the operation domain information of the flow entry.
- the controller sends a flow entry update indication message to the switch, where the flow entry adds the indication message carrying the matching domain information and the operation domain information.
- the switch generates a flow entry according to the matching domain information and the operation domain information of the flow entry. 718.
- the switch sends a flow entry update response message to the controller.
- the controller returns the first downlink IP data packet to the switch through the PKT-OUT message.
- the switch matches the first downlink IP data packet according to the matching domain information of the flow entry. After the matching succeeds, the first downlink IP data packet is encapsulated according to the operation domain information.
- the switch forwards the first GTP-U data packet obtained by the encapsulation.
- the switch receives subsequent downlink IP data packets from other external network elements.
- the switch matches the subsequent downlink IP data packet according to the matching domain information of the flow entry. After the matching is successful, the switch encapsulates the subsequent downlink IP data packet according to the operation domain information.
- the switch forwards the subsequent downlink GTP-U data packet obtained by the encapsulation.
- the establishment of a flow entry is not performed during the GTP-C signaling phase.
- the first data packet is forwarded to the controller, and the controller parses the data packet, and maps the GTP-U decapsulation or encapsulation processing to the matching domain information of the flow entry.
- Operation domain information The switch generates a flow entry according to the matching domain information and the operation domain information, and directly determines a specific bit field of the subsequent GTP-U data packet according to the first bit domain indication information or the second bit domain indication information. And processing and forwarding, without the need to parse the protocol format of the data message.
- the flow entry is generated according to the matching domain information and the operation domain information sent by the controller, so that the switch can directly perform tunnel encapsulation or decapsulation processing on the GTP-U data packet without using the data packet.
- the protocol format is parsed, which enables users to flexibly and customize the processing of data packets. intention.
- the switching device in this embodiment is a switch
- the control device is a controller.
- the GTP protocol is used as an example to describe how to perform GTP tunnel encapsulation processing based on flow entries after the switch receives an IP data packet.
- the matching field information includes second bit field indication information and a matching value, the second bit field indication information includes a second offset and a second field length, and the second bit field indication information is used to specify the data.
- the second bit field of the message includes second bit field indication information and a matching value, the second bit field indication information includes a second offset and a second field length, and the second bit field indication information is used to specify the data.
- the second bit field of the message includes second bit field indication information and a matching value
- the second bit field indication information includes a second offset and a second field length
- the second bit field indication information is used to specify the data.
- the switch may match the second bit field corresponding to the IP source address (Source Address) determined by the second bit field indication information in the matching domain information, that is, the switch according to the second bit in the OXM indicating the IP SA
- the field indication information determines the bit field in which the IP SA in the IP data file is located, and compares whether the value of the bit field is equal to the matching value in the OXM.
- the switch can perform the operation type in the operation domain information in the flow entry after the matching is successful.
- the control device After the control device establishes the operation or parses the first GTP-U data packet, it can determine that the data packet needs to be GTP encapsulated.
- the switch has added an indication message according to the flow entry sent by the previous controller to establish a flow entry.
- the operation domain information in the flow entry may include multiple sets of operation types corresponding to the encapsulation process and first bit field indication information corresponding to the operation type, where the GTP encapsulation header may include an external IP header, UDP (User Data gram Protocol, User Data Protocol) The header and the GTP header, the external IP header is the source endpoint address and the destination endpoint address of the tunnel, and the allocated TEID may also be included in the GTP encapsulation header.
- the encapsulation process may include first bit field indication information corresponding to the following sets of operation types and operation types:
- the flow entry is generated according to the matching domain information and the operation domain information sent by the controller, so that the switch can directly determine and process the specific bit field for the GTP-U data packet without using the data packet.
- the protocol format is parsed, which enables users to flexibly and customize the processing of data packets. intention.
- the switching device is a switch
- the control device is a controller.
- the GTP protocol is used as an example to describe how to perform GTP tunnel decapsulation according to the flow entry after the switch receives the GTP-U data packet.
- the matching field of the flow entry includes two sets of second bit field indication information and a matching value.
- the switch may determine the second bit field indication information in the first group in the matching domain, and
- the bit fields corresponding to the IP DA are matched, and the bit fields corresponding to the UDP port number 2152 determined by the second bit field indication information in the second group in the matching domain are matched. That is, the switch may determine the bit field in which the IP DA in the GTP-U data packet is located according to the second bit field indication information in the first group in the 0XM indicating the IP DA, and compare whether the value of the bit field is related to the 0XM. The matching values in the first group are equal.
- the switch can determine the bit field in which the UDP port in the GTP-U data packet is located according to the second bit field indication information of the second group in the 0XM indicating the UDP port, and compare whether the value of the bit field is in the 0XM. The matching values of the second group are equal. If both bit fields match successfully, the switching device can perform GTP decapsulation according to the operation domain information in the flow entry.
- the switch has added an indication message according to the flow entry sent by the previous controller to establish a flow entry.
- the operation domain information in the flow entry may include multiple sets of operation types corresponding to the decapsulation process and first bit field indication information corresponding to the operation type.
- the GTP encapsulation header may include an external IP header, a UDP header, and a GTP header.
- the decapsulation process may include the following sets of operation types and first bit field indication information corresponding to the operation type:
- the flow entry is generated according to the matching domain information and the operation domain information sent by the controller, so that the switch can directly perform the GTP-U data packet according to the first bit domain indication information and the second bit domain indication information.
- the tunnel decapsulation process does not need to parse the protocol format of the data packet, so that the user can perform flexible and custom stream operations.
- the switching device is a switch
- the control device is a controller.
- the GTP protocol is used as an example to describe how to perform GTP tunnel decapsulation and re-packaging according to the flow entry after the switch receives the GTP-U data packet after the switch has established the flow entry.
- the process does not need to pop the original tunnel packet header and then press the new tunnel packet header. You only need to modify the external IP address and tunnel ID.
- the matching field of the flow entry in this embodiment includes two sets of second bit field indication information and a matching value.
- the switch may match the bit field corresponding to the IP DA determined by the second bit field indication information of the first group in the matching domain, and determine the second bit field indication information of the second group in the matching domain, and The bit field corresponding to the UDP port number 2152 is matched. That is, the switch can determine the GTP-U data packet according to the second bit field indication information of the first group in the 0XM indicating the IP DA. The bit field in which the IP DA is located, and compares whether the value of the bit field is equal to the matching value of the first group in the OXM.
- the switching device can determine the bit field in which the UDP port in the GTP-U data packet is located according to the second bit field indication of the second group in the OXM indicating the UDP port, and compare whether the value of the bit field is in the OXM. The matching values of the second group are equal. If both bit fields match successfully, the switching device can modify the tunnel header field information according to the operation domain information in the flow entry.
- the controller can perform GTP decapsulation and re-encapsulation of data packets after the previous GTP-C session establishment operation or the first GTP-U data packet analysis.
- the switch has added an indication message according to the flow entry sent by the previous controller to establish a flow entry.
- the operation domain information in the flow entry may include multiple sets of operation types corresponding to the decapsulation and re-encapsulation processing and first bit field indication information corresponding to the operation type.
- the GTP encapsulation header may include an external IP header, a UDP header, and a GTP header.
- the decapsulation and re-encapsulation process may include first bit field indication information corresponding to the following sets of operation types and operation types:
- the flow entry is generated according to the matching domain information and the operation domain information sent by the controller, so that the switch can directly perform the GTP-U data packet according to the first bit domain indication information and the second bit domain indication information.
- the tunnel decapsulation and re-encapsulation process does not need to parse the protocol format of the data packet, so that the user can perform flexible and custom stream operations.
- the flow entry may be an extension of an existing flow entry, for example, the operation domain information and/or matching domain information may be added to a flow entry of an existing common flow table.
- the above flow entry can also be stored separately in the newly added flow table in the switch. The following will be described in detail with specific examples. The arrangement of the flow table in the embodiment of the present invention.
- FIG. 11 is a schematic diagram showing an example of an arrangement of a flow table according to an embodiment of the present invention.
- the flow entry of the embodiment of the present invention may be separately stored in the newly added flow table.
- the flow table can be called a general flow table.
- Other common flow tables can remain unchanged.
- the general flow table can be interspersed in the existing flow pipeline.
- Other common flow tables in the flow pipeline can jump to the general flow table, and the general flow table can also jump to other common flow tables in the return pipeline.
- the flow table entry of the general flow table has the same structure as the flow entry in the common flow table, but the OXM in the embodiment of the present invention may be included in the matching domain information, and the operation domain information may include the operation in the embodiment of the present invention.
- the type and the corresponding first bit field indication information are the same structure as the flow entry in the common flow table, but the OXM in the embodiment of the present invention may be included in the matching domain information, and the operation domain information may include the operation in the embodiment of the present invention.
- the type and the corresponding first bit field indication information may be included in the matching domain information, and the operation domain information may include the operation in the embodiment of the present invention.
- Figure 12 is a schematic block diagram of an apparatus for processing a data message in accordance with one embodiment of the present invention.
- An example of an apparatus 1200 of Figure 12 is a switching device, such as an OpenFlow switch.
- the device 1200 includes a matching unit 1210 and an operating unit 1220.
- the matching unit 1210 is configured to match the data packet with the matching domain information of the flow entry; the flow entry includes the matching domain information and the operation domain information; wherein the operation domain information includes an operation type and a first bit
- the first bit field indication information includes a first offset and a first field length, where the first bit field indication information is used to specify a first bit field of the data packet, or
- the matching domain information includes second bit field indication information including a second offset and a second field length, and the second bit field indication information is used to specify the data packet Second bit field;
- the operation unit 1220 is configured to: if the data packet is successfully matched with the matching domain information, operate the data packet according to the operation domain information.
- the operation unit 1220 is specifically configured to: if the data packet and the matching domain information match successfully, according to The first bit field indication information determines a first bit field of the data message, and operates on the first bit field according to the operation type.
- the operation unit 1220 is specifically configured to: And if the data text and the matching domain information match successfully, according to the first The bit field indication information determines a first bit field of the data packet, and obtains at least one bit of the first bit field according to the first mask, and according to the operation type, the first bit field At least one bit of the operation operates.
- the operation unit 1220 is specifically configured to: if the datagram And the first bit field of the data packet is determined according to the first bit field indication information, and the first bit field and the operand are determined according to the operation type. Take action.
- the matching unit 1210 is specifically configured to determine, according to the second bit field indication information, the data packet. a second bit field; matching the second bit field according to the matching value.
- the matching unit 1210 is specifically configured to use the Determining the second bit field indication information, determining a second bit field of the data message, obtaining at least one bit of the second bit field according to the second mask, according to the matching value, The at least one bit of the second bit field is matched.
- the operation type includes a pop operation type, a push operation type, a set operation type, a length calculation operation type, a checksum calculation operation type, a checksum verification operation type, an increment operation type, a decrement operation type, or a copy.
- Type of operation includes a pop operation type, a push operation type, a set operation type, a length calculation operation type, a checksum calculation operation type, a checksum verification operation type, an increment operation type, a decrement operation type, or a copy.
- the first bit field of the data packet is determined according to the first bit field indication information including the first offset and the first field length in the operation domain information, and according to the operation type in the operation domain information
- the first bit field operates such that operation of the data message is no longer limited to a particular protocol format.
- the switching device can arbitrarily determine the second bit field in the data message according to the second bit field indication information, and match the second bit field without parsing the specific protocol format of the data message. Therefore, the device shown in Fig. 12 can avoid the standardized expansion required for the new protocol, and thus can realize flexible and custom flow operations of the user.
- the apparatus 1200 may further include a receiving unit 1230 and a generating unit 1240.
- the receiving unit 1230 is configured to receive a flow entry update indication message sent by the control device, where the flow entry addition indication message includes the matching domain information and the operation domain information; And configured to generate the flow entry according to the matching domain information and the operation domain information.
- the receiving unit 1230 is further configured to receive a flow entry modification indication message sent by the control device, where the flow entry modification indication message includes the matching domain information and new operation domain information.
- the device 1200 further includes The modifying unit 1240 is configured to modify the flow entry according to the matching domain information and the new operational domain information.
- the receiving unit 1230 is further configured to receive a feature request message sent by the control device, where the feature request message is used to query whether the operation domain information or the matching domain information is supported.
- the device 1200 further includes a sending unit. 1250. The method is configured to send a feature response message to the control device, where the feature response message is used to indicate that the operation domain information or the matching domain information is supported.
- device 1200 can be a switching device.
- the switching device can be a switch.
- the flexible positioning of the specific bit field of the data packet can be realized by using the offset and the length of the field, so that the flexible processing of the data packet can be flexibly customized, so that the processing of the data packet is not limited.
- the specific protocol format avoids the need for standardized extensions for new protocols, making the processing of data packets more versatile.
- FIG. 13 is a schematic block diagram of an apparatus for processing a data message according to another embodiment of the present invention. As shown in FIG. 13, the apparatus 1300 includes a generating unit 1310 and a transmitting unit 1320.
- the generating unit 1310 is configured to generate a flow entry adding indication message, where the flow entry adding indication information includes matching domain information and operation domain information, where the operating domain information includes an operation type and a first bit domain indication information, where The first bit field indication information includes a first offset field and a first field length, where the first bit field indication information is used to specify a first bit field of the data message, or the matching domain information includes a second bit The field indication information and the matching value, the second bit field indication information includes a second offset and a second field length, and the second bit field indication information is used to specify a second bit field of the data packet;
- the sending unit 1320 is configured to send the flow entry update indication message to the switching device, so that the switching device generates a flow entry according to the flow entry adding indication message, and pairs the data according to the flow entry. The message is processed.
- the generating unit 1310 is further configured to generate a flow entry modification indication message, where the flow entry The modification indication message includes the matching domain information and new operation domain information; correspondingly, the sending unit
- the 1320 is further configured to send the flow entry modification indication message to the switching device, so that the switching device, according to the matching domain information and the new operational domain information, corresponds to the matching domain information.
- the flow entry is modified.
- the sending unit 1320 is further configured to send a feature request message to the switching device, where the feature request message is used to query whether the matching domain information or the operating domain information is supported.
- the device 1300 further includes The receiving unit 1330 is configured to receive a feature response message sent by the switching device, where the feature response message is used to indicate that the matching domain information or the operating domain information is supported.
- the device 1300 can be a control device, and exemplary, can be a controller.
- the apparatus in the embodiment of the present invention can transmit the bit field indication information carrying the offset and the length of the field to the switching device, so as to implement flexible positioning of the specific bit field of the data packet, and implement flexible customization processing of the data packet. Therefore, the processing of the data message is no longer limited to a specific protocol format, and the standardized extension required for the new protocol is avoided, so that the processing of the data message is more versatile.
- Another embodiment of the present invention further provides a system for processing data messages. As shown in FIG. 14, the system includes a switching device 1410 and a control device 1420.
- the switching device 1410 can be the device shown in FIG. 12, and the control device can be a figure.
- the specific bit field of the data packet can be flexibly determined according to the offset and the length of the field, and the specific bit field is matched or operated, so that the flexible processing of the data packet can be customized.
- the processing of data packets is no longer limited to a specific protocol format, and the standardized extension required for new protocols is avoided, so that the processing of data packets is more versatile.
- Another embodiment of the present invention further provides a flow entry, including matching domain information and operation domain information.
- the operation domain information includes an operation type and first bit field indication information, where the first bit field indication information includes a first offset and a first field length, and the first bit domain indication The information is used to specify a first bit field of the data packet, or the matching domain information includes second bit field indication information and a matching value, where the second bit field indication information includes a second offset and a second Field length, the second bit field indication information is used to specify a second bit field of the data message.
- the first bit field indication information further includes a first mask.
- the second bit field indication information further includes a second mask.
- the operation domain information further includes an operand.
- the operation type includes a pop operation type, a push operation type, a set operation type, a length calculation operation type, a checksum calculation operation type, a checksum verification operation type, an increment operation type, a decrement operation type, or a copy.
- Type of operation includes a pop operation type, a push operation type, a set operation type, a length calculation operation type, a checksum calculation operation type, a checksum verification operation type, an increment operation type, a decrement operation type, or a copy.
- the flow entry provided by the embodiment of the present invention can flexibly determine a specific bit field of the data packet, and perform matching or operation on the specific bit field, thereby implementing flexible customization processing on the data text, thereby enabling the datagram to be
- the processing of the text is no longer limited to a specific protocol format, avoiding the need for standardized extensions for new protocols, and making the processing of data packets more versatile.
- Another embodiment of the present invention also provides a computer program product for processing a data message.
- the computer program product includes program code executable by a computer for executing a method of processing a data message as shown in FIG.
- an embodiment of the present invention provides a hardware implementation of an apparatus for processing a data message.
- the device may be a switching device, and exemplary, may be a switch that supports OpenFlow technology.
- the apparatus includes a processor, a memory, a first network interface, a second network interface, and a third network interface.
- the first network interface, the second network interface, and the third network interface are interconnected by a bus between the processor and the memory.
- the first network interface can be connected to the control device for interaction.
- the control device can be a controller that supports OpenFlow technology.
- the second network interface acts as an input port for the device and can be used to receive data messages.
- the third network interface acts as an output port of the device and can be used to transmit data messages processed by the processor.
- each network interface can contain multiple input and output ports.
- the first, second and third network interfaces may be mutually independent network interfaces or may be combined into one network interface; the memory may be a semiconductor storage unit that is directly accessible by the processor.
- the memory is used to store the computer-executable program code, and the program code is used to execute the method for processing the data message as shown in FIG. 2, and to store the flow entry provided by the embodiment of the present invention.
- a processor configured to execute the computer-executable program code according to the memory, as shown in FIG. 2 The method of processing a data message is shown, and the received data message is processed.
- the flow entry entry indication message sent by the control device may be received by using the first network interface, where the flow entry entry indication message may include the matching domain information and the operation domain of the flow entry provided by the embodiment of the present invention.
- the information, the processor may generate the flow entry provided by the embodiment of the present invention according to the matching domain information and the operation domain information carried in the flow entry, and store the flow entry in the memory.
- the flow entry modification indication message sent by the control device is received by the first network interface, and is similar to the flow entry update indication message.
- the flow entry modification indication message may include the flow table provided by the embodiment of the present invention.
- the matching domain information and the operation domain information of the item, the processor may find the corresponding flow entry in the memory according to the matching domain information, and update the operation domain information in the flow entry to be carried in the flow entry modification indication message. Operation domain information.
- the feature request message sent by the control device may be received by using the first network interface, and the feature request message may be used to query whether the switching device supports the universal flow processing capability, that is, whether the flow entry provided by the embodiment of the present invention is supported. Match domain information or operational domain information.
- the feature response message may be sent to the control device by using the first network interface, and the feature response message may be used to indicate that the common stream processing capability is supported, that is, the matching domain information or the operation domain information of the flow entry provided by the embodiment of the present invention is supported.
- the hardware implementation of the device for processing data packets provides flexible positioning of a specific bit field of the data packet by using an offset and a field length, thereby implementing flexible customization processing of the data packet, thereby enabling
- the processing of data packets is no longer limited to a specific protocol format, avoiding the need for standardized extensions for new protocols, making the processing of data packets more versatile.
- an embodiment of the present invention provides a hardware implementation of an apparatus for processing a data message.
- the device may be a control device, exemplarily, a controller that supports OpenFlow technology.
- the device includes a memory, a processor, and a controller.
- the memory, processor, and controller are intercommunicated via the bus.
- the network interface can be connected to the switching device to interact with the switching device.
- the memory can be a semiconductor device that can be accessed directly by the processor.
- the memory is used to store computer executable program code for executing the method of processing the data message as shown in FIG. 3.
- a processor configured to execute the method for processing the data message as shown in FIG. 3 according to the computer-executable program code stored in the memory.
- the flow entry adds an indication message, a flow entry modification indication message, or a feature request message by the processor through the network interface. Send to the switching device.
- the switching device can generate the flow entry provided by the embodiment of the present invention, thereby implementing the specific bit field of the data packet.
- Flexible positioning which enables flexible and custom processing of data packets, avoids the need for standardized extensions for new protocols, and makes data packet processing more versatile.
- the disclosed systems, devices, and methods may be implemented in other ways.
- the device embodiments described above are merely illustrative.
- the division of the unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
- the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
- the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art or a part of the technical solution.
- the points may be embodied in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform various embodiments of the present invention All or part of the steps of the method.
- the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. .
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例提供处理数据报文的方法、装置及系统。该方法包括:将数据报文与流表项的匹配域信息进行匹配;所述流表项包括所述匹配域信息和操作域信息;其中,所述操作域信息包括操作类型和第一比特域指示信息,所述第一比特域指示信息包括第一偏移量和第一字段长度,所述第一比特域指示信息用于指定所述数据报文的第一比特域,或者,所述匹配域信息包括第二比特域指示信息和匹配值,所述第二比特域指示信息包括第二偏移量和第二字段长度,所述第二比特域指示信息用于指定所述数据报文的第二比特域;如果所述数据报文与所述匹配域信息匹配成功,则根据所述操作域信息,对所述数据报文进行操作。该方法能够实现对数据报文灵活的自定义处理。
Description
处理数据报文的方法、 装置及系统 技术领域
本发明涉及信息技术领域, 并且具体地, 涉及处理数据报文的方法、 装 置及系统。 背景技术
开放流( OpenFlow )技术旨在基于现有 TCP/IP技术条件, 以创新的网 络互联理念解决当前网络面对新业务产生的瓶颈。其核心思想就是将原本完 全由交换机 /路由器控制的数据包转发过程, 转化为由 OpenFlow 交换机 ( OpenFlow Switch )和 Openflow控制器( Controller )分别完成的独立过程。 因此 OpenFlow网络中的设备能够分布部署、 集中管控, 使得网络变为用户 可定义的形态。
虽然在 OpenFlow网络中, 用户可以决定如何路由数据包或者如何进行 访问控制等,但是由于对分组数据报文的操作仍然是局限于现有具体协议格 式, 因此用户只能针对规定的协议格式进行自定义操作。 而目前 OpenFlow 规范中所能支持的协议格式是有限的, 导致应用场景也 4艮有限。 如果为了实 现新增的协议需求,则需要针对具体的新增协议对 OpenFlow规范继续扩展, 这样会造成扩展项变得复杂。 发明内容
本发明实施例提供处理数据报文的方法、 装置及系统, 能够实现对数据 报文灵活的自定义处理。
第一方面, 提供了一种处理数据报文的方法, 包括: 将数据报文与流表 项的匹配域信息进行匹配; 所述流表项包括所述匹配域信息和操作域信息; 其中, 所述操作域信息包括操作类型和第一比特域指示信息, 所述第一比特 域指示信息包括第一偏移量和第一字段长度,所述第一比特域指示信息用于 指定所述数据报文的第一比特域, 或者, 所述匹配域信息包括第二比特域指 示信息和匹配值, 所述第二比特域指示信息包括第二偏移量和第二字段长 度, 所述第二比特域指示信息用于指定所述数据报文的第二比特域; 如果所 述数据报文与所述匹配域信息匹配成功, 则根据所述操作域信息, 对所述数
据报文进行操作。
在第一方面的第一种可能实现的方式中, 当所述操作域信息包括所述操 作类型和所述第一比特域指示信息时, 所述根据所述操作域信息, 对所述数 据报文进行操作, 包括: 根据所述第一比特域指示信息确定所述数据报文的 第一比特域; 根据所述操作类型, 对所述第一比特域进行操作。
结合第一方面, 或第一方面的第一种可能实现的方式, 在第二种可能实 现的方式中, 当所述匹配域信息包括所述第二比特域指示信息和所述匹配值 时, 所述将数据报文与流表项的匹配域信息进行匹配, 包括: 根据所述第二 比特域指示信息, 确定所述数据报文的第二比特域; 根据所述匹配值, 对所 述第二比特域进行匹配。
第二方面, 提供了一种处理数据报文的装置, 包括: 匹配单元, 用于将 数据报文与流表项的匹配域信息进行匹配; 所述流表项包括所述匹配域信息 和操作域信息;其中,所述操作域信息包括操作类型和第一比特域指示信息, 所述第一比特域指示信息包括第一偏移量和第一字段长度, 所述第一比特域 指示信息用于指定所述数据报文的第一比特域, 或者, 所述匹配域信息包括 第二比特域指示信息和匹配值, 所述第二比特域指示信息包括第二偏移量和 第二字段长度,所述第二比特域指示信息用于指定所述数据报文的第二比特 域; 操作单元, 用于如果所述数据报文与所述匹配域信息匹配成功, 则根据 所述操作域信息, 对所述数据报文进行操作。
在第二方面的第一种可能实现的方式中, 当所述操作域信息包括所述操 作类型和所述第一比特域指示信息时, 所述操作单元具体用于, 如果所述数 据报文与所述匹配域信息匹配成功, 则根据所述第一比特域指示信息确定所 述数据报文的第一比特域,根据所述操作类型,对所述第一比特域进行操作。
结合第二方面或者第二方面的第一种可能实现的方式,在第二方面的第 二种可能实现的方式中, 当所述匹配域信息包括所述第二比特域指示信息和 所述匹配值时, 所述匹配单元具体用于, 根据所述第二比特域指示信息, 确 定所述数据报文的第二比特域; 根据所述匹配值, 对所述第二比特域进行匹 配。
第三方面, 提供了一种处理数据报文的方法, 包括: 生成流表项添加指 示消息, 所述流表项添加指示信息包括匹配域信息和操作域信息; 其中, 所 述操作域信息包括操作类型和第一比特域指示信息, 所述第一比特域指示信
息包括第一偏移量和第一字段长度,所述第一比特域指示信息用于指定数据 报文的第一比特域, 或者, 所述匹配域信息包括第二比特域指示信息和匹配 值, 所述第二比特域指示信息包括第二偏移量和第二字段长度, 所述第二比 特域指示信息用于指定所述数据报文的第二比特域; 发送所述流表项添加指 示消息至交换设备, 以使所述交换设备根据所述流表项添加指示消息生成流 表项, 并根据所述流表项对所述数据报文进行处理。
在第三方面的第一种可能实现的方式中, 该方法还包括发送特性请求消 息至所述交换设备, 所述特性请求消息用于询问是否支持所述匹配域信息或 者所述操作域信息; 接收所述交换设备发送的特性响应消息, 所述特性响应 消息用于指示支持所述匹配域信息或者所述操作域信息。
第四方面, 提供了一种处理数据报文的装置, 包括: 生成单元, 用于生 成流表项添加指示消息,所述流表项添加指示信息包括匹配域信息和操作域 信息; 其中, 所述操作域信息包括操作类型和第一比特域指示信息, 所述第 一比特域指示信息包括第一偏移量和第一字段长度, 所述第一比特域指示信 息用于指定数据报文的第一比特域, 或者, 所述匹配域信息包括第二比特域 指示信息和匹配值, 所述第二比特域指示信息包括第二偏移量和第二字段长 度, 所述第二比特域指示信息用于指定所述数据报文的第二比特域; 发送单 元, 用于发送所述流表项添加指示消息至交换设备, 以使所述交换设备根据 所述流表项添加指示消息生成流表项, 并根据所述流表项对所述数据报文进 行处理。
在第四方面的第一种可能的实现方式中, 所述发送单元, 还用于发送特 性请求消息至所述交换设备, 所述特性请求消息用于询问是否支持所述匹配 域信息或者所述操作域信息; 所述装置还包括接收单元, 用于接收所述交换 设备发送的特性响应消息, 所述特性响应消息用于指示支持所述匹配域信息 或者所述操作域信息。
第五方面, 提供一种处理数据报文的系统, 包括第二方面提供的处理数 据报文的装置和第四方面提供的处理数据报文的装置。
在上述方案中,通过根据偏移量和字段长度能够灵活确定数据报文的特 定比特域, 并对该特定比特域进行匹配或者操作, 因此能够实现对数据报文 灵活的自定义处理, 从而使对数据报文的处理不再局限于特定的协议格式, 避免对于新增协议需要进行的标准化扩展, 使对数据报文的处理更具通用
性。 附图说明
为了更清楚地说明本发明实施例的技术方案, 下面将对本发明实施例中 所需要使用的附图作筒单地介绍, 显而易见地, 下面所描述的附图仅仅是本 发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的 前提下, 还可以根据这些附图获得其他的附图。
图 1是可应用本发明实施例的网络架构的一个例子的示意图; 图 2是根据本发明实施例的处理数据报文的方法的示意性流程图; 图 3是根据本发明实施例的处理数据报文的方法的示意性流程图;
图 5是根据本发明实施例的对数据报文进行匹配的过程的一个例子的示 f一个例子的示 意性流程图
图 7是 ^ 一例子的示 一例子的示 意图;
一例子的示 意图; 示意图;
图 11是根据本发明实施例的流表的布置方式的一个例子的示意图 图 12是根据本发明一个实施例的处理数据报文的装置的示意框图 图 13是根据本发明另一实施例的处理数据报文的装置的示意框图 图 14是根据本发明另一实施例的处理数据报文的系统的示意框图 图 15是根据本发明另一实施例的处理数据报文的装置的一种硬件实现 的结构示意图;
图 16是根据本发明另一实施例的处理数据报文的装置的一种硬件实现
的结构示意图。 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例是本发明的一部分实施例, 而不 是全部实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创 造性劳动的前提下所获得的所有其他实施例, 都应属于本发明保护的范围。
图 1是可应用本发明实施例的网络架构的一个例子的示意图。 应注意, 图 1的例子只是为了帮助本领域技术人员更好地理解本发明实施例, 而非限 制本发明实施例的范围。在图 1中, 以 OpenFlow网络的架构为例进行说明。
如图 1所示, 一个 Openflow交换机包括一个或多个实现分组报文匹配 和转发功能的流表 ( Flow table ) 以及一个连接外部 Openflow控制器的安全 通道 ( Secure channel )。 Openflow交换机的安全通道与 Openflow控制器之 间通过 Openflow协议消息进行交互, 实现对交换机内部的流表操作。
每个流表中包括一个或多个流表项( Flow entry )。 Openflow控制器通过
Openflow协议消息可以添加、更新或删除流表中的流表项。每个流表项包括 匹配域信息和对应的操作域信息, 其中操作域信息也可称为动作 (Actions ) 域信息或者指令(Instructions )域信息。 交换机从输入端口接收到数据报文 后从第一个流表开始进行匹配, 然后跳转到下一个流表继续匹配。 这种顺次 级联的流表称为流管线 (Pipeline d 交换机将接收到的报文与流表中各流表 项的匹配域信息进行比对, 如果流表中存在与接收到的报文匹配的流表项, 则执行流表项中操作域信息中对应的操作。 流表项中的操作域包括两类信 息, 第一类是将匹配的报文跳转到下一个流表实现进一步处理, 同时还可传 递相应的元数据; 第二类是实现对数据报文的修改和转发到输出端口。
OpenFlow交换设备可以是支持 OpenFlow技术的具有交换功能的设备, 可以是 OpenFlow 交换机, 本发明实施例对此不作限制。 以下实施例中 OpenFlow 交换设备可筒称交换设备。 OpenFlow 控制设备可以是支持 OpenFlow技术的具有控制功能的设备,可以是 OpenFlow控制器, 本发明实 施例对此不作限制。 以下实施例中 OpenFlow控制设备筒称控制设备。
应注意, 本发明实施例中, 虽然以 OpenFlow网络为例进行说明, 但本 发明实施例还可以应用于其它类似于 OpenFlow网络的控制面与转发面分离
的网络架构中。 本发明实施例对此不作限定。
图 2是根据本发明实施例的处理数据报文的方法的示意性流程图。 图 2 的方法由交换设备执行, 例如, 支持 OpenFlow技术的交换机。
210, 将数据报文与流表项的匹配域信息进行匹配。
所述流表项包括所述匹配域信息和操作域信息。
可选地, 所述操作域信息包括操作类型和第一比特域指示信息, 所述第 一比特域指示信息包括第一偏移量和第一字段长度, 所述第一比特域指示信 息用于指定所述数据报文的第一比特域。
当所述操作域信息包括第一比特域指示信息的时候,可以根据第一比特 域指示信息的第一偏移量确定数据报文的某个特定比特域在该数据报文中 的起始位置, 根据第一字段长度可以确定该特定比特域的长度, 从而可以获 取该特定比特域,进而可以根据操作类型,对该特定比特域进行相应的操作。 因此能够自由获取数据报文中的特定比特域进行相应的操作, 而不再局限于 特定的协议格式, 避免对于新增协议需要进行的标准化扩展。
可选地, 第一比特域指示信息还包括第一掩码, 在根据第一偏移量和第 一字段长度获得该特定比特域后, 还可以根据第一掩码, 获得该比特域中一 个或多个比特位, 即该比特域中至少一个比特位, 进而可以根据操作类型, 对获得的一个或多个比特位进行相应的操作。 因此, 可以在自由获取数据报 文的特定比特域的基础上, 自由获取该特定比特域中一个或多个特定的比特 位进行相应的操作, 增加了对数据报文自定义处理的自由度和通用性。
可选地, 所述匹配域信息包括第二比特域指示信息和匹配值, 所述第二 比特域指示信息包括第二偏移量和第二字段长度,所述第二比特域指示信息 用于指定所述数据 文的第二比特域。
如果第二比特域的取值与匹配值相等, 则第二比特域与匹配值匹配成 功, 也就是数据报文与流表项匹配成功。 匹配值与第二比特域指示信息是相 对应的。
当所述匹配域信息包括所述第二比特域指示信息的时候, 可以根据第二 偏移量确定数据报文的某个特定比特域在所述数据报文的起始位置,根据第 二字段长度, 可以确定该特定比特域的长度, 从而可以获取该特定比特域, 进而根据匹配值, 对该比特域进行匹配。 因此能够自由获取数据报文中的特 定比特域进行匹配, 而不再局限于特定的协议格式, 避免对于新增协议需要
进行的标准化扩展。
可选地, 第二比特域指示信息还包括第二掩码, 在根据第二偏移量和第 二字段长度获得该特定比特域后, 还可以根据第二掩码, 获得该比特域中一 个或多个比特位, 即该比特域中至少一个比特位, 进而可以根据匹配值, 对 获得的一个或多个比特位进行匹配。 因此, 可以在自由获取数据报文的特定 比特域的基础上, 自由获取该特定比特域中一个或多个特定的比特位进行匹 配, 增加了对数据报文自定义处理的自由度和通用性。
应注意, 本发明实施例中, 数据报文可以是指分组数据报文。
220, 如果所述数据报文与所述匹配域信息匹配成功, 则根据所述操作 域信息, 对所述数据报文进行操作。
可选地, 当所述操作域信息包括所述操作类型和所述第一比特域指示信 息时, 所述根据所述操作域信息, 对所述数据报文进行操作, 可以包括: 根 据所述第一比特域指示信息确定所述数据报文的第一比特域,根据所述操作 类型, 对所述第一比特域进行操作。
可选地, 当所述第一比特域指示信息还包括第一掩码时, 对所述数据报 文进行操作, 可以包括: 根据所述第一比特域指示信息确定所述数据报文的 第一比特域, 根据所述第一掩码, 获得所述第一比特域的至少一个比特位, 根据所述操作类型, 对所述第一比特域的至少一个比特位进行操作。
可选地, 当所述操作域信息包括所述操作类型和所述第一比特域指示信 息时, 若所述操作域信息还包括操作数时, 所述根据所述操作类型, 对所述 第一比特域进行操作, 可以包括: 根据所述操作类型, 对所述第一比特域和 所述操作数进行操作。 类似的, 所述根据所述操作类型, 对所述第一比特域 的至少一个比特位进行操作, 可以包括: 根据所述操作类型, 对所述第一比 特域的至少一个比特位和所述操作数进行操作。
本发明实施例中, 交换设备可以具有转发面功能, 不具有控制面功能。 控制面功能可以由外部的控制设备完成。 这样, 控制设备可以解析协议格式 的上下文信息以及数据报文的协议格式, 并将对数据报文的处理映射为流表 项中的匹配域信息和 /或操作域信息, 使得转发面的处理与具体协议格式无 关。
本发明实施例中, 由于流表项中的操作域信息包括第一比特域指示信 息, 而第一比特域指示信息包括第一偏移量和第一字段长度, 因此交换设备
根据第一比特域指示信息可以任意地确定数据报文中的第一比特域, 并对第 一比特域进行操作, 而无需解析数据报文的具体协议格式。 同理, 交换设备 根据第二比特域指示信息可以任意地确定数据报文中的第二比特域, 并对第 二比特域进行匹配, 而无需解析数据报文的具体协议格式。 此外, 即使该数 据报文的协议格式在现有规范中并不存在, 交换设备也无需针对数据报文的 具体协议格式在现有规范中进行扩展, 因此能够实现用户灵活的自定义的流 操作, 并能够避免对于不断出现的新增协议需要进行的标准化扩展。 因此本 发明实施例中对数据 文的处理方法更为通用, 应用场景也更为广泛。 相比 较而言, 由于现有 OpenFlow规范中支持的协议格式的种类是有限的, 如果 需要对新增的协议格式的数据报文进行处理, 则只能针对该新增的协议格式 对现有规范继续扩展, 造成了扩展项的臃肿。
本发明实施例中,通过采用偏移量和字段长度能够实现对数据报文特定 比特域的灵活定位, 实现对数据报文灵活的自定义处理, 从而使对数据报文 的处理不再局限于特定的协议格式,避免对于新增协议需要进行的标准化扩 展, 使对数据报文的处理更具通用性。
另外, 当匹配域信息为现有 OpenFlow技术定义的内容时, 在步骤 210 中, 交换设备对数据报文与流表项的匹配域信息进行匹配, 还可以按照现有 技术中交换设备对数据报文与流表项的匹配域信息进行匹配的过程执行。本 发明实施例对此不作限定。
另外, 当操作域信息为现有 OpenFlow技术定义的内容时, 在步骤 220 中, 交换设备根据操作域信息, 对数据报文进行操作, 还可以按照现有技术 中交换设备对数据报文根据操作域信息对数据报文进行操作的过程执行。本 发明实施例对此不作限定。
应注意, 本发明实施例中, 上述的偏移量(Offset ) 可以是从交换设备 的输入端口接收到的分组帧起始位置算起, 单位可以是 8位字节(byte )。 上 述的字段长度可以表示偏移量之后连续字段的字节数。偏移量和字段长度可 以共同指定数据报文中一个长度确定的连续的字节段。 上述的掩码(Mask ) 可以表示由偏移量和字段长度共同指定的字段内的比特掩码。掩码的长度可 以与字段长度相同。
可选地, 作为另一实施例, 上述操作类型可以包括弹出操作类型、 压入 操作类型、 设置操作类型、 长度计算操作类型、 校验和计算操作类型、 校验
和验证操作类型、 递增操作类型、 递减操作类型或复制操作类型。
可选地, 作为另一实施例, 在步骤 210之前, 交换设备可以接收控制设 备发送的流表项添加指示消息, 流表项添加指示消息可以包括匹配域信息和 操作域信息。 交换设备可以根据接收到的匹配域信息和操作域信息, 生成流 表项。 本领域普通技术人员应知, 流表项也可以预先配置在交换设备上。
可选地, 作为另一实施例, 在步骤 210之前, 交换设备可以接收控制设 备发送的流表项修改指示消息, 流表项修改指示消息可以包括匹配域信息和 新的操作域信息。 交换设备可以根据匹配域信息和新的操作域信息, 对流表 项进行修改。
可选地, 作为另一实施例, 在步骤 210之前, 交换设备可以接收控制设 备发送的特性请求消息,特性请求消息可以用于询问交换设备是否支持通用 流处理能力, 即是否支持上述的匹配域信息或者上述的操作域信息。 交换设 备可以向控制设备发送特性响应消息,特性响应消息可以用于指示支持通用 流处理能力, 即支持上述的匹配域信息或者上述的操作域信息。
应注意, 本发明实施例中, "通用流处理" 可以是指交换设备对数据报 文的处理不局限于数据报文的具体协议格式, 也就是说, 交换设备无需解析 数据报文的具体协议相关的上下文信息和数据报文的格式, 就可以完成对数 据报文的处理。
可选地, 作为另一实施例, 上述流表项与现有技术中的流表项可以共存 于同一个流表中。 或者上述流表项可以单独存放于一个流表中。
作为一种可选的实现方式, 上述流表项可以是对现有流表项的扩展, 例 如可以在现有的普通流表的流表项中增加上述操作域信息和 /或匹配域信息。 上述流表项也可以在交换设备中新增加的流表中单独存放。 本发明实施例 中, 为了区别于其它现有的普通流表, 该新增加的流表可以称为通用流表 ( Generic Flow Table )。 通用流表可以穿插在现有的流管线( Flow Pipeline ) 中, 流管线中的其它普通流表可以跳转到通用流表, 通用流表也可以跳转回 流管线中的其它普通流表。
图 3是根据本发明实施例的处理数据报文的方法的示意性流程图。 图 3 的方法由控制设备执行, 例如, 支持 OpenFlow技术的控制器。
310, 生成流表项添加指示消息
其中, 流表项添加指示信息包括匹配域信息和操作域信息。
可选地, 操作域信息包括操作类型和第一比特域指示信息, 所述第一比 特域指示信息包括第一偏移量和第一字段长度, 所述第一比特域指示信息用 于指定数据报文的第一比特域。 示例性的, 操作域信息还可以包括操作数。 示例性的, 第一比特域指示信息还可以包括第一掩码。 示例性的, 所述操作 类型包括弹出操作类型、压入操作类型、设置操作类型、长度计算操作类型、 校验和计算操作类型、 校验和验证操作类型、 递增操作类型、 递减操作类型 或复制操作类型。
可选地, 所述匹配域信息包括第二比特域指示信息和匹配值, 所述第二 比特域指示信息包括第二偏移量和第二字段长度,所述第二比特域指示信息 用于指定所述数据报文的第二比特域。 示例性的, 第二比特域指示信息还可 以包括第二掩码。
320, 发送该流表项添加指示消息至交换设备。
当交换设备收到该流表项添加指示信息后, 可以根据该流表项添加指示 消息, 即根据该流表项添加指示消息携带的匹配域信息和操作域信息来生成 流表项, 并根据生成后的流表项对数据报文进行处理。
可选地, 若需要更新交换设备中的流表项, 在步骤 310中, 控制设备可 以生成流表项修改指示消息, 该流表项修改指示消息也包括上述匹配域信息 和操作域信息。 相应地, 在步骤 320中, 控制设备可以发送生成的流表项修 改指示消息至交换设备。 交换设备在收到该流表项修改指示消息后, 可以根 据该流表项修改指示消息中的匹配域信息, 找到对应的流表项, 然后将该对 应的流表项的操作域信息修改为携带在该流表项修改指示消息中的操作域 信息, 这样交换设备可以根据更新后的流表项对数据报文进行处理。
可选地, 当操作域信息包括操作类型和第一比特域指示信息, 或者匹配 域信息包括第二比特域指示信息和匹配值时,控制设备可以发送特性请求消 息至交换设备,该特性请求消息用以询问交换设备是否支持所述比特域指示 信息或者所述匹配域信息。 对应地, 在发送特性请求消息至交换设备后, 控 制设备接收交换设备返回的特性响应消息, 该特性响应消息可以指示支持所 述匹配域信息或者所述操作域信息,也可以指示不支持所述匹配域信息或者 所述操作域信息。通过询问交换设备是否支持所述匹配域信息或者所述操作 域信息,可以避免发送所述匹配域信息或者所述操作域信息至不支持所述匹 配域信息或者操作域信息的交换设备, 以使所述交换设备错误添加或者更新
流表项, 从而导致不能正确使用流表项处理数据报文。
本发明实施例中,通过将携带偏移量和字段长度的比特域指示信息发送 至交换设备, 能够实现对数据报文特定比特域的灵活定位, 实现对数据报文 灵活的自定义处理, 从而使对数据报文的处理不再局限于特定的协议格式, 避免对于新增协议需要进行的标准化扩展, 使对数据报文的处理更具通用 性。
下面将结合具体例子详细描述本发明实施例。 应注意, 这些例子只是为 了帮助本领域技术人员更好地理解本发明实施例, 而非限制本发明实施例的 范围。 本领域技术人员根据所给出的这些例子, 显然可以进行各种等价的修 改或变化, 这样的修改或变化也落入本发明实施例的范围内。 图。 在图 4中, 交换设备为交换机, 控制设备为控制器。 交换机和控制器之 间可以进行通信, 例如, 交换机和控制器之间可以建立传输层安全通道 ( Transport Layer Security, TLS ), 通过 TLS进行会话。 此外, 在图 4中, 网络应用层(Network Application, Network App )与控制器可以集成在一个 物理实体中, 也可以是分开的, 本发明实施例对此不作限定。
401 , 控制器向交换机发送特性请求消息, 特性请求消息用于询问交换 机是否支持通用流处理能力。
402, 交换机向控制器发送特性响应消息, 特性响应消息用于指示交换 机支持通用流处理能力。
本发明实施例所述的是否支持通用流处理能力,是指是否支持通过偏移 量和字段长度来定位特定比特域的能力。 该能力具体的表现可以有多种形 式, 例如是否能够支持如图 2所示实施例中的第一比特域指示信息或者第二 比特域指示信息的处理, 或者例如是否支持包含第一比特域指示信息的操作 域信息或者包含第二比特域指示信息的匹配域信息, 本发明实施例对此不作 限定。
例如, 交换机可以在特性响应消息中携带通用流处理能力标志位, 通过 标志位向控制器通知是否支持通用流处理能力。
403 , 网络应用层向控制器发送流表项添加或修改指示消息, 该流表项 添加或修改指示消息用于指示需要对交换机中的流表项执行的操作。
例如, 网络应用层可以根据业务逻辑, 将对交换机的操作映射为对流表
项的操作。 对流表项的操作可以包括添加流表项或修改流表项等。 例如, 网 络应用层可以向控制器发送流表项添加指示消息, 也可以调用修改流表 API ( Application Programming Interface,应用程序编程接口 ) , 流表项添力口指示消 息中可以携带匹配域信息和操作域信息。 网络应用层可以向控制器发送流表 项修改指示消息, 流表项修改指示消息中可以携带匹配域信息和新的操作域 信息。 此外, 网络应用层也可以通过流表项删除指示消息指示删除流表项。
404, 控制器向交换机发送流表项添加或修改指示消息。
流表项添加指示消息中可以携带网络应用层下发的匹配域信息和操作 域信息。 流表项修改指示消息中可以携带网络应用层下发的匹配域信息和新 的操作域信息。
此外, 控制器也可以根据网络应用层下发的流表项删除指示消息, 向交 换机发送流表项删除指示消息。
405 , 交换机根据控制器发送的流表项添加或修改指示消息, 对流表项 进行操作。
例如, 交换机可以根据流表项添加指示消息中携带的匹配域信息和操作 域信息, 生成流表项。
交换机也可以根据流表项修改指示消息中携带的匹配域信息和新的操 作域信息, 对流表项进行操作。 例如, 可以将与流表项修改指示消息中携带 的匹配域信息对应的流表项中的操作域信息更新为新的操作域信息。
406, 交换机向控制器发送流表项添加或修改响应消息。
交换机通过流表项添加或修改响应消息向控制器通知已完成对流表项 的操作。
407 , 控制器向网络应用层发送流表项添加或修改响应消息。
控制器通过流表项添加或修改响应消息向网络应用层通知交换机已完 成对流表项的操作。
401-407示例性的介绍了控制器对于交换机上流表项的添加、 更新的操 作的方法。 其中, 控制器发送流表项添加或修改指示消息也可以由其他条件 触发, 本发明实施例对此不作限定。 下面将介绍交换机如何根据流表项对数 据报文进行处理。
408, 交换机从其它外部网元接收数据报文。
409, 交换机将数据报文与流表项进行匹配。
上述流表项可以包括匹配域信息, 匹配域信息可以包括第二比特域指示 信息和匹配值, 第二比特域指示信息可以包括第二偏移量和第二字段长度, 第二比特域指示信息可以用于指定数据 >¾文的第二比特域。
交换机可以根据第二比特域指示信息, 确定数据报文中的第二比特域。 例如, 交换机可以根据第二偏移量和第二字段长度,确定第二比特域。此外, 第二比特域指示信息还可包括第二掩码。 那么交换机还可以根据第二偏移 量、 第二字段长度和第二掩码, 确定第二比特域中特定的比特位。 为了表述 方便, 下面将第二比特域中的特定的比特位, 也统称为第二比特域。
在确定第二比特域之后, 交换机可以根据匹配值对第二比特域进行匹 配。
具体地, 如果第二比特域的取值与匹配值相等, 则第二比特域与匹配值 匹配成功, 也就是数据报文与流表项匹配成功。 匹配域中, 匹配值与第二比 特域指示信息是相对应的。
在上述的匹配过程中, 交换机无需解析数据报文的协议格式, 就能够执 行对数据 文与流表项的匹配。 因此上述的匹配域信息也可以称为通用匹配 域( Generic Match Field )信息。 图 5是根据本发明实施例的对数据报文进行 匹配的过程的一个例子的示意图。
下面将结合具体的例子详细描述匹配域信息。 应注意, 这些例子只是为 了帮助本领域技术人员更好地理解本发明实施例, 而非限制本发明实施例的 范围。
本实施例借用现有 OpenFlow协议中的匹配域信息格式定义本发明提出 的通用匹配域信息。 现有 OpenFlow 匹配域信息的内容可采用 OXM ( OpenFlow Extensible Match ) TLV ( Type-Length- Value , 类型-长度-内容) 结构体进行描述。每个 OXM TLV可以是 5-259字节长, 头部可以占 4字节。 OXM TLV结构体的头部格式的一个例子见表 1。
表 1 OXM TLV结构体举例
名称 长度(比特) 描述
匹配类别(Match class ): 成 员 类 另 ll ( member
OXM—CLASS 16
ΟΧΜ—ΤΥΡΕ class ) 或者保留类别
( reserved class )
OXM—FIELD 7 对应匹配类别的匹配项
名称
如 果 OXM 的 内 容
OXM—HASMASK 1 ( Value )部分包括比特 掩码则进行设置
OXM内容(Value )部分
OXM—LENGTH 8
的长度
8
OXM—VALUE OXM内容, 即匹配值
*OXM_LENGTH
OXM_TYPE 中的 OXM_CLASS和 OXM_FIELD,表示流表项中的匹配 域信息对应的匹配项名称, 如以太网目的地址( ETH_DST )。 OXM_VALUE 为 OXM 内容, 记录 OXM_TYPE 对应的匹配值。 OXM_TYPE 中的 OXM_HASMASK 表明确定的第二比特域是否需要进一步通过掩码匹配 OXM_VALUE 内的部分比特位。 如果 OXM_HASMASK=0 , 则表明 OXM_VALUE所有比特位作为匹配值使用; 如果 OXM_HASMASK=l , 则 表明 OXM_VALUE 中对应掩码部分的比特位作为匹配值使用, 并且 OXM_VALUE后面紧跟与其值等字节长度的掩码的值。
本发明实施例中, 匹配域信息也可以采用 OXM结构体的格式, 为了区 别于现有 OpenFlow规范中的 OXM, 将本发明实施例的匹配域信息采用的 OXM结构体称为通用 OXM结构体。 其中在 OXM_CLASS中可以引入新定 义的成员类, 比如 OFPXMC_HW_0 , 表明该扩展由某个 ONF ( Open Networking Foundation, 开放网络基金)成员定义。 在 OXM_FIELD 中引入 新的匹配的域的类型, 比如 OXM_OF_GENERIC_FIELD , 表明该 OXM为 通用匹配类型。 OXM_VALUE 不再是一个单纯的数值, 而是包括第二偏移 量、 第二字段长度、 第二掩码和匹配值。 在下面的表 2中, 以 Offset, Size, Mask和 Data分别表示第二偏移量、 第二字段长度、 第二掩码和匹配值。 这 4 个参数可以是按规定的顺序排列, 也可将每个参数定义为一个独立的子 TLV结构, 其中 Type为参数类型, 比如为第二偏移量、 第二字段长度、 第 二掩码或匹配值。 Length表示参数字节长度, Value表示参数具体数值。 另 夕卜, 如果需要匹配多个比特域, 则可以在流表项中添加多个通用 OXM。
表 2 匹配域信息的格式的一个例子
名称 类型 描述
Type uintl6 OXM_CLASS= OFPXMC—HW—0
OXM_FIELD=OXM_OF_GENERIC_FIELD
Len uintl6 通用 OXM总体长度
Value (该部分后面可能需要进行字节填充, 确保整体长度为 8字节
的整数倍)
Offset uintl6 第二偏移量
Size uintl6 第二字段长度
Mask[Size] unit8 第二掩码。 Mask占用字节长度由 Size决定
匹配值。 也就是第二比特域的取值, 字节段
Data[Size] unit8
的长度由 size决定 下面以匹配数据才艮文中 IP ( Internet Protocol , 网络协议) 目的地址 ( Destination Address , DA ) 为例, 说明如何使用本发明实施例定义的通用 ΟΧΜ来描述一个匹配的比特域。
如表 3的左侧所示, 左侧为采用 OpenFlow标准 OXM描述的用于匹配
IP目的地址的匹配域信息, OXM_CLASS表明以下 OXM为 OpenFlow标准 协议定义, OXM_FIELD指定当前匹配的比特域的类别为 IPv4 目的地址, OXM_HASMASK为 1表明需要掩码, VALUE为具体的经过掩码后的 IPv4 地址数值。
表 3的右侧为采用本发明实施例中定义的通用 OXM描述的匹配 IP目的 地址的方式。 其中, OXM_CLASS表明 OXM为 ONF组织成员扩展定义, OXM_FIELD标识为通用匹配域类别, OXM_HASMASK为 0表明不需要掩 码, Value为采用第二偏移量、第二字段长度、第二掩码和匹配值描述的 IPv4 目的地址在数据报文中的位置和数值大小。 从表 3可以看出, 本发明实施例 中的匹配域信息更为通用。 表 3 OpenFlow协议中的匹配域信息与本发明实施例的匹配域信息的比较
OpenFlow协议中匹配域信息的 本发明实施例的匹配域信息的通用 OXM
OXM格式 格式
OXM_CLASS=
OXM—CLASS = OFPXMC—HW—0 OFPXMC_OPENFLOW_BASIC
OXM—FIELD OXM—FIELD = =OFPXMT_OFB_IPV4_DST OXM—OF—COMMOM—FIELD
OXM—HASMASK = 1 OXM—HASMASK: 0
OXM_Value = 30(第二偏移量)
OXM—VALUE = 4(第二字段长度)
10.12.0.0/255.255.0.0 255.255.0.0(第二掩码)
10.12.0.0(匹配值) 此外, 交换机将数据报文与流表项进行匹配的过程, 还可以按照现有技 术中交换机对数据报文与流表项进行匹配的过程执行。本发明实施例对此不 作限定。
410, 如果数据报文与流表项匹配成功, 则交换机根据流表项对数据报 文进行操作。
流表项可以包括操作域信息,操作域信息可以包括操作类型和第一比特 域指示信息, 第一比特域指示信息可以包括第一偏移量和第一字段长度, 第 一比特域指示信息可以用于指定数据报文的第一比特域。
具体地, 如果数据报文与流表项匹配成功, 则交换机可以根据第一比特 域指示信息, 确定数据报文中的第一比特域。 例如, 交换机可以根据第一偏 移量和第一字段长度, 确定第一比特域。 此外, 第一比特域指示信息还可以 包括第一掩码。 这样, 交换机还可以根据第一偏移量、 第一字段长度和第一 掩码, 确定第一比特域的特定比特位。 为了表述方便, 下面将第一比特域的 特定比特位也统称为第一比特域。
在确定第一比特域后, 交换机可以根据操作类型, 对数据报文中的第一 比特域进行操作。
具体地, 操作域中还可以包括操作类型对应的操作数。 这样, 交换机可 以根据操作类型, 对数据报文的第一比特域和操作数进行操作。
可选地, 操作类型可以包括弹出操作类型、 压入操作类型、 设置操作类 型、 长度计算操作类型、 校验和计算操作类型、 校验和验证操作类型、 递增 操作类型、 递减操作类型或复制操作类型。 应注意, 本发明实施例中的操作 类型并不限于上述列举的操作类型, 还可以包括其它操作类型, 本发明实施 例对此不作限定。
上述列举的操作类型的具体表示方式和描述可以参见表 4。 在表 4中, 第一偏移量可以包括 Top-offset和 /或 Bottom-offset。 其中, Top- Off set可以 是从交换机的输入端口接收到的分组帧的起始位置算起, Bottom-Offset可以 是从分组帧的末尾位置算起。 Top-Offset和 Bottom-Offset可以共同指定一个
连续的字节段。 此外, 在表 4中, 以 Size表示第一字段长度, 第一字段长度 可以包括 Sizel和 Size2。 以 Data或 Step表示操作数, 以 Mask表示第一掩 码。 表 4操作域信息中操作类型与相应的第一比特域指示信息的表示方式 和描述
序
操作类型 表示方式 描述
号
弹出指定比特域。 该操作类型
1 弹出操作类型 Pop ( Top- offset, Size ) 可用于解封装隧道头 (Tunnel
Header )„
在 Top-offset 处压入长度为
Push ( Top-offset, Size, Size字节,取值为 Data的比特
2 压入操作类型
Data ) 域。 该操作类型用于封装隧道 头。
将 Top-offset、 Size, Mask指
Set-value ( Top- offset, 定的比特域的值设置为 Data
3 设置操作类型
Size, Mask, Data ) 值。 该操作类型可用于修改指 定比特域的值。
计算比特域 1 (由 Top-offsetl 与 Bottom-offsetl 指定) 的字
Calculate-Length
节长度, 并将比特域 1的字节 长度计算操作 ( Top-offset 1 ,
4 长度存放在比特域 2 ( 由 类型 Bottom-offsetl ,
Top-offset2与 Size2指定)中。 Top-offset2, Size2 )
该操作类型主要用于计算载荷 长度。
计算比特域 1 (比特域 1由 Top-offsetl与 Bottom-offsetl
Calculate- Checksum
或 sizel指定 ) 的校验和, 并 校验和计算操 ( Top-offset 1 ,
5 将校验和存放在比特域 2 (比 作类型 Sizel/Bottom-offsetl ,
特域 2由 Top-offset2与 Size2 Top-offset2, Size2 )
指定) 中。 该操作类型主要用 于计算载荷的校验和。
6 校验和验证操 Verify-Checksum 计算比特域 1 (比特域 1由
作类型 ( Top-offset 1 , Top-offsetl与 Bottom-offsetl Sizel/Bottom-offsetl , 或 Sizel指定) 的校验和, 并 Top-offset2, Size2 ) 将校验和与比特域 2(比特域 2 由 Top-offset2与 Size2指定) 存放的原始校验和比较。 如果 不相等, 则终止后续操作, 向 控制器上报错误信息。 对 Top-offset和 Size指定字段 的取值增加 Step大小。可用于
Increment ( Top- offset, 递增序歹1 J号 ( sequence 递增操作类型
Size, Mask, Step ) number )。 当增加到设定的最 大值时,向 controller上报事件 通知。
对 Top-offset和 Size指定的比
Decrement ( Top- offset, 特域的取值递减 Sep大小。 当 递减操作类型
Size, Mask, Step ) 达到设定的最小值时, 向控制 器上报事件通知。
将比特域 1 (比特域 1由
Copy ( Top-offsetl , Sizel , Top-offsetl和 Sizel指定) 的 复制操作类型
Top-offset2, Size2 ) 内容复制到比特域 2(比特域 2 由 Top-offset2和 Size2指定)。
上述的操作域信息也可以采用 TLV 结构。 上述的操作类型的类型 ( TYPE ) 的定义的一个例子可参照表 5。
表 5 操作域信息中操作类型的类型值的一个例子
取
类型 (TYPE )名称 描述
值
OFPAT—GENERIC—POP 31 弹出比特域操作
OFPAT—GENERIC—PUSH 32 压入比特域操作
OFPAT—GENERIC—SET—VALUE 33 设置比特域操作
OFPAT_GENERIC_CALCULATE_LENGTH 34 计算比特域长度操作 计算比特域校验和操
OFPAT_GENERIC_CALCULATE_CHECKSUM 35
作
OFPAT_GENERIC_VERIFY_CHECKSUM 36 验证比特域校验值操
作
OFPAT_GENERIC_INCREMENT 37 比特域数值递增操作
OFPAT_GENERIC_DECREMENT 38 比特域数值递减操作 复制比特域间数值操
OFPAT—GENERIC—COPY 39
作 下面参照表 6至表 14描述上面的各个操作类型以及各操作类型对应的 第一比特域指示信息的结构体的例子。 表 6 弹出操作类型与相应的第一比特域指示信息的结构体的例子 名称 类型 描述
Type uintl6 OFPAT—GENERIC—POP
Len uintl6 该结构体的总体长度
Value (该部分后面可能需要进行字节填充, 确保整体长度为 8字节的 整数倍 )
Top-offset uintl6 头端偏移量
Size uintl6 字段长度 表 7压入操作类型与相应的第一比特域指示信息的结构体的例子
名称 类型 描述
Type uintl6 OFPAT—GENERIC—PUSH
Len uintl6 该结构体的总体长度
Value (该部分后面可能需要进行字节填充, 确保整体长度为 8字节的 整数倍 )
Top-offset uintl6 头端偏移量
Size uintl6 字段长度
Data[Size] unit8 压入比特域的取值,比特域的长度由 size决定 表 8设置操作类型与相应的第一比特域指示信息的结构体的例子
名称 类型 描述
Type uintl6 OFPAT—GENERIC—SET—VALUE
Len uintl6 该结构体的总体长度
Value (该部分后面可能需要进行字节填充, 确保整体长度为 8字节的 整数倍 )
Top-offset uintl6 头端偏移量
Size uintl6 字节段长度
Mask[Size] unit8 掩码, Mask占用字节长度由 Size决定
压入的比特域的取值, 比特域的长度由 Size
Data[Size] unit8
决定 表 9 长度计算操作类型与相应的第一比特域指示信息的结构体的例子
名称 类型 描述
Type uintl6 OFPAT—GENERIC—CALCULATE—CHECKSUM
Len uintl6 该结构体的总体长度
Value (该部分后面可能需要进行字节填充,确保整体长度为 8字节的整数倍 )
Top-offsetl uintl6 头端偏移量 1
Bottom-offsetl/Sizel uintl6 尾端偏移量 1或者字段长度 1
Top-offset2 uintl6 头端偏移量 2
Size2 uintl6 比特域 2的长度 表 11 校验和验证操作类型与相应的第一比特域指示信息的结构体的例 子
名称 类型 描述
Type uintl6 OFPAT_GENERIC_VERIFY_CHECKSUM
Len uintl6 该结构体的总体长度
Value (该部分后面可能需要进行字节填充,确保整体长度为 8字节的整数倍)
Top-offsetl uintl6 头端偏移量 1
Bottom-offsetl/Sizel uintl6 尾端偏移量 1或者字段长度 1
Top-offset2 uintl6 头端偏移量 2
Size2 uintl6 比特域 2长度
表 12 递增操作类型与相应的第一比特域指示信息的结构体的例子
应理解, 上述表 6 至表 14 中, 第一偏移量可以包括 Top-offset和 /或 Bottom-offset, 也可以包括 Top-offsetl、 Top-offset2和 Bottom-offsetl。 此夕卜,
以 Size表示第一字段长度, 第一字段长度可以包括 Sizel和 Size2。 Data或 Step表示操作数, Mask表示第一掩码。
表 6至表 14中, 操作类型及相应的第一比特域指示信息的结构体中的 Value部分涉及的每种参数(如 Top-offset、 Bottom-offset、 Size, Mask, Data, Step )也可以采用单独的 TLV结构体描述,其中 Type为参数类型,比如 Offset, Size, Mask, Data或 Step, Length为参数字节长度, Value为参数具体数值。
应注意, 上面的表 4至表 14的例子只是为了帮助本领域技术人员更好 地理解本发明实施例, 而非限制本发明实施例的范围。 本领域技术人员根据 所给出的这些例子, 显然可以进行各种等价的修改或变化, 这样的修改或变 化也落入本发明实施例的范围内。
在上述的操作过程中, 交换机无需解析数据报文的协议格式, 就能够执 行对数据报文的操作。 因此上述的操作域信息也可以称为通用操作域
( Generic Action Field )信息。
此外, 在步骤 410中, 交换机对数据报文的操作也可以按照现有技术中 的操作方式进行操作, 本发明实施例对此不作限定。
还应注意, 在图 4中, 步骤 401至 402以及步骤 403至 407不是在每次 进行数据报文处理前都需要执行, 例如, 可以在开机时执行一次, 或者步骤 403至 407在需要对流表项配置时执行。这样在后续的数据报文处理过程中, 就不需要执行步骤 401至 402或者步骤 403至 407。 这样, 交换机在接收到 数据报文后, 可以直接执行步骤 409和 410。
应理解, 上述各过程的序号的大小并不意味着执行顺序的先后, 各过程 的执行顺序应以其功能和内在逻辑确定, 而不应对本发明实施例的实施过程 构成任何限定。
本发明实施例中,通过根据操作域信息中包括第一偏移量和第一字段长 度的第一比特域指示信息确定数据报文的第一比特域, 并根据操作域信息中 的操作类型对第一比特域进行操作,使得对数据报文的操作不再局限于特定 的协议格式, 从而能够避免对于新增协议需要进行的标准化扩展, 因此能够 实现用户完全自定义的流操作。
此外, 本发明实施例中, 通过根据匹配域信息中包括第二偏移量和第二 字段长度的第二比特域指示信息确定数据报文的第二比特域, 并根据匹配值 对第二比特域进行匹配, 使得对数据报文的匹配不再局限于特定的协议格
式, 从而能够避免对于新增协议需要进行的标准化扩展, 因此能够实现用户 完全自定义的流操作。
现有 OpenFlow规范中的协议格式的种类有限, 导致应用场景也有限。 例如, 现有 OpenFlow规范并不支持丰富的隧道封装和解封装的处理。 目前 只能处理 VLAN ( Virtual Local Area Network , 虚拟局域网 )、 MPLS ( Multi-Protocol Label Switching, 多协议标签交换) 的弹出 (pop )和压入 ( push )操作, 而对于 PPPoE, L3隧道封装和解封装缺乏必要的处理机制。
下面将以 GTP ( GPRS ( General Packet Radio Service, 通用分组无线服 务) Tunneling Protocol, GPRS隧道协议)协议为例, 详细说明基于本发明 实施例的方法建立 GTP隧道的过程。 应注意, 图 6至图 10的例子只是为了 帮助本领域技术人员更好地理解本发明实施例, 而非限制本发明实施例的范 围。 意性流程图。 示例性的, 这里的控制设备为控制器, 交换设备为交换机。
601 , 控制器接收 GTP-C ( GTP-Control )请求消息。
例如, 控制器接收建立会话请求(Create Session Request ) 消息。 该消 息可以来自其他外部网元, 也可能来自本网元其他逻辑实体。 本发明实施例 对此不作限定。
602, 控制器建立 GTP会话信息。
例如, 控制器可以建立 GTP-U用户面上下文信息, 比如可以包括用户
ID ), 承载 TEID ( Tunnel Endpoint Identifier, 隧道端点标识 ), QoS ( Quality of Service, 服务质量)参数或计费参数等。
603 , 控制器返回 GTP-C建立响应消息。
604, 控制器将 GTP会话上下文信息映射为交换机中流表项的匹配域信 息和操作域信息。
可选地, 匹配域信息包括第二比特域指示信息和匹配值, 所述第二比特 域指示信息包括第二偏移量和第二字段长度, 所述第二比特域指示信息用于 指定所述数据报文的第二比特域。 其中, 第二比特域指示信息还可以包括第 二掩码。
可选地, 操作域信息包括操作类型和第一比特域指示信息, 所述第一比 特域指示信息包括第一偏移量和第一字段长度, 所述第一比特域指示信息用
于指定所述数据报文的第一比特域。 其中, 第二比特域指示信息还可以包括 第一掩码。
匹配域信息和操作域信息的举例可以参考图 2或者图 4中的描述, 此处 不作赘述。
605 , 控制器向交换机发送流表项添加指示消息, 该流表项添加指示消 息携带匹配域信息和操作域信息。
606, 交换机根据流表项添加指示消息携带的匹配域信息和操作域信息, 生成流表项。
607 , 交换机向控制器发送流表项添加响应消息。
608, 交换机从其它外部网元接收上行 GTP-U数据报文。
交换机可以从其它外部网元接收上行 GTP-U数据报文。
609, 交换机根据流表项的匹配域信息对步骤 608 中的数据报文进行匹 配, 在匹配成功后, 根据操作域信息对数据报文执行 GTP-U解封装操作。
610, 交换机将步骤 609中解封装得到的 IP数据报文进行转发。
611 , 交换机从其它网元接收下行 IP数据报文。
612, 交换机根据流表项中的匹配域信息和操作域信息, 对数据报文执 行 GTP-U封装操作。
613, 交换机将步骤 612中封装得到的 GTP-U数据报文进行操作。
本实施例中, 根据匹配域信息对数据报文的匹配, 以及根据操作域信息 对数据报文进行处理的示例,请参见图 2或者图 4中的描述,此处不作赘述。
在图 6中, 在 GTP-C信令阶段, 控制器根据 GTP-C请求消息建立 GTP 会话上下文信息, 并将后续 GTP-U的解封装或封装操作映射为流表项的匹 配域信息和操作域信息。 交换机根据匹配域信息和操作域信息生成流表项, 就可以对后续的 GTP-U数据报文通过第一比特域指示信息或者第二比特域 指示信息确定对应的比特域, 直接进行处理和转发, 而不必对数据报文的协 议格式进行解析。
本发明实施例中,通过根据控制器发送的匹配域信息和操作域信息生成 流表项, 使得交换机可以对 GTP-U数据报文直接进行隧道封装或解封装处 理, 而无需对数据报文的协议格式进行解析, 能够实现用户灵活的自定义的 流操作。
意图。 示例性的, 本实施例中的交换设备为交换机, 控制设备为控制器。
701 , 交换机从其它网元接收首个上行 GTP-U数据报文。
此处假设交换机之前没有接收过上行 GTP-U数据报文。
702, 交换机通过 PKT-IN ( Packet-in, 数据报文输入) 消息向控制器发 送步骤 701中的首个上行 GTP-U数据报文。
由于初始时交换机中没有建立处理该数据报文相应的流表项, 交换机可 以通过 PKT-IN消息将首个上行 GTP-U数据报文转发给控制器。
703, 控制器对首个上行 GTP-U数据报文进行解析, 确定需要对该数据 报文进行 GTP解封装操作, 则将解封装处理映射为流表项的匹配域信息和 操作域信息。
704, 控制器向交换机发送流表项添加指示消息, 该流表项添加指示消 息携带步骤 703的匹配域信息和操作域信息。
可选地, 匹配域信息包括包括第二比特域指示信息和匹配值, 所述第二 比特域指示信息包括第二偏移量和第二字段长度, 所述第二比特域指示信息 用于指定所述数据 文的第二比特域。 其中, 第二比特域指示信息还可以包 括第二掩码。
可选地, 操作域信息包括操作类型和第一比特域指示信息, 所述第一比 特域指示信息包括第一偏移量和第一字段长度, 所述第一比特域指示信息用 于指定所述数据报文的第一比特域。 其中, 第二比特域指示信息还可以包括 第一掩码。
匹配域信息和操作域信息的举例可以参考图 2或者图 4中的描述, 此处 不作赘述。
705, 交换机根据步骤 704的匹配域信息和操作域信息, 生成流表项。
706, 交换机向控制器发送流表项添加响应消息。
707, 控制器通过 PKT-OUT ( Packet-out, 数据报文输出)消息向交换机 返回首个上行 GTP-U数据报文。
708, 交换机根据流表项的匹配域信息对首个上行 GTP-U数据报文进行 匹配, 在匹配成功后, 根据操作域信息对首个上行 GTP-U数据报文进行解 封装操作。
709, 交换机将解封装得到的首个上行 IP数据报文进行转发。
710, 交换机从其它网友接收后续的上行 GTP-U数据报文。
711 , 交换机根据流表项的匹配域信息对后续的上行 GTP-U数据报文进 行匹配, 在匹配成功后, 根据操作域信息对后续的上行 GTP-U数据报文进 行解封装操作。
712, 交换机将解封装得到的后续的 IP数据报文进行转发。
713, 交换机从其它外部网元接收首个下行 IP数据报文。
714, 交换机通过 PKT-IN ( Packet-in ) 消息向控制器发送步骤 713中的 首个下行 IP数据报文。
由于初始时交换机中没有建立对该数据报文处理的相应的流表项, 交换 机可以通过 PKT-IN消息将首个下行 IP数据报文转发给控制器。
715, 控制器对首个 IP数据报文进行解析, 确定需要对该数据报文进行
GTP-U封装处理, 将封装处理映射为流表项的匹配域信息和操作域信息。
716, 控制器向交换机发送流表项添加指示消息, 该流表项添加指示消 息携带匹配域信息和操作域信息。
717, 交换机根据流表项的匹配域信息和操作域信息, 生成流表项。 718, 交换机向控制器发送流表项添加响应消息。
719, 控制器通过 PKT-OUT消息向交换机返回首个下行 IP数据报文。
720,交换机根据流表项的匹配域信息对首个下行 IP数据报文进行匹配, 在匹配成功后, 根据操作域信息对首个下行 IP数据报文进行封装操作。
721 , 交换机对封装得到的首个 GTP-U数据报文进行转发。
722, 交换机从其它外部网元接收后续的下行 IP数据报文。
723, 交换机根据流表项的匹配域信息对后续的下行 IP数据报文进行匹 配, 在匹配成功后, 根据操作域信息对后续的下行 IP数据报文进行封装操 作。
724, 交换机对封装得到的后续的下行 GTP-U数据报文进行转发。
本实施例中, 根据匹配域信息对数据报文的匹配, 以及根据操作域信息 对数据报文进行处理的示例,请参见图 2或者图 4中的描述,此处不作赘述。
在图 7中, 在 GTP-C信令阶段不进行流表项的建立。 在有 GTP-U数据 报文到达时, 首个数据报文先转发到控制器, 由控制器解析数据报文, 并将 GTP-U解封装或封装处理映射为流表项的匹配域信息和操作域信息。交换机 根据匹配域信息和操作域信息生成流表项, 就可以根据第一比特域指示信息 或者第二比特域指示信息直接确定后续的 GTP-U数据报文的特定比特域,
并进行处理和转发, 无需进行数据报文的协议格式的解析。
本发明实施例中,通过根据控制器发送的匹配域信息和操作域信息生成 流表项, 使得交换机可以对 GTP-U数据报文直接进行隧道封装或解封装处 理, 而无需对数据报文的协议格式进行解析, 能够实现用户灵活的自定义的 对数据报文的处理。 意图。 示例性的, 本实施例中的交换设备为交换机, 控制设备为控制器。
在图 8中, 以 GTP协议为例, 描述在交换机建立了流表项后, 当交换 机收到 IP数据报文后如何根据流表项进行 GTP隧道封装处理。
其中, 匹配域信息包括第二比特域指示信息和匹配值, 所述第二比特域 指示信息包括第二偏移量和第二字段长度, 所述第二比特域指示信息用于指 定所述数据报文的第二比特域。
交换机可以对由匹配域信息中的第二比特域指示信息确定的、 与 IP源 地址( Source Address , S A )对应的第二比特域进行匹配, 即交换机根据指 示 IP SA的 OXM中的第二比特域指示信息, 确定 IP数据 文中的 IP SA所 在的比特域, 并比较该比特域的值是否与 OXM中的匹配值相等。
如果该比特域的值与 OXM中的匹配值相等, 则匹配成功后, 交换机可 以执行流表项中的操作域信息中的操作类型。 控制设备经过之前的 GTP会 话建立操作或对首个 GTP-U数据报文的解析, 可以确定需要对该数据报文 进行 GTP封装。
交换机已经根据之前的控制器发送的流表项添加指示消息, 建立了流表 项。 流表项中的操作域信息可以包括封装处理对应的多组操作类型及操作类 型对应的第一比特域指示信息, 其中 GTP封装头可以包括外部 IP头、 UDP ( User Data gram Protocol , 用户数据 协议 ) 头和 GTP头, 外部 IP头为隧 道的源端点地址和目的端点地址, GTP封装头中还可以包括分配的 TEID。 封装处理可以包括以下几组操作类型和操作类型对应的第一比特域指示信 息:
( 1 )根据递减操作类型以及对应的第一比特域指示信息, 即 Decrement ( Top-offset, Size, Mask, Step ), 对 IP数据报文中 TTL ( Time To Live , 生存时间)对应的比特域进行减 1操作。
( 2 ) 根据校验计算操作类型以及对应的第一比特域指示信息, 即
Calculate- Checksum ( Top-offsetl , Bottom-offsetl , Top-offset2 , Size2 ) , 更 新内层 IP数据报文头的校验和。
( 3 ) 根据压入操作类型以及对应的第一比特域指示信息, 即 push ( Top-offset, Size, Data ), 使用 IP-UDP-GTP头对 IP数据报文进行封装。
( 4 )根据 3次长度计算操作类型以及对应的第一比特域指示信息, 即 3 次 Calculate-Length ( Top-offsetl , Bottom-offsetl , Top-off set2 , Size2 ), 分另 ll 更新 GTP、 UDP和外部 IP头中对应的 Length (长度 ) 字段的长度。
( 5 )根据 2次校验计算操作类型以及对应的第一比特域指示信息, 即 2 次 Calculate-Checksum( Top-offsetl , Sizel/Bottom-offsetl , Top-offset2 , Size2 ), 分别更新 UDP和外部 IP头中对应的 checksum (校验和 )字段的数值。
本发明实施例中,通过根据控制器发送的匹配域信息和操作域信息生成 流表项, 使得交换机可以对 GTP-U数据报文直接确定特定的比特域并进行 处理, 而无需对数据报文的协议格式进行解析, 能够实现用户灵活的自定义 的对数据报文的处理。 意图。 本实施例中, 交换设备为交换机, 控制设备为控制器。
图 9中, 以 GTP协议为例, 描述在交换机建立了流表项后, 当交换机 收到 GTP-U数据报文后如何按照流表项进行 GTP隧道解封装处理。
该流表项的匹配域中包含两组第二比特域指示信息及匹配值。
交换机可以对由匹配域中的第一组中的第二比特域指示信息确定的、与
IP DA对应的比特域进行匹配, 并对由匹配域中的第二组中的第二比特域指 示信息确定的、 与 UDP端口号 2152对应的比特域进行匹配。 即交换机可以 根据指示 IP DA的 0XM中的第一组中的第二比特域指示信息,确定 GTP-U 数据报文中的 IP DA所在的比特域, 并比较该比特域的值是否与该 0XM中 第一组中的匹配值相等。 同时, 交换机可以根据指示 UDP端口的 0XM中 第二组的第二比特域指示信息,确定 GTP-U数据报文中的 UDP端口所在的 比特域, 并比较该比特域的值是否与该 0XM中第二组的匹配值相等。 如果 两个比特域都匹配成功, 则交换设备可以根据流表项中的操作域信息进行 GTP解封装。
控制器经过之前的 GTP-C会话建立操作或对首个 GTP-U数据报文的解 析处理, 可以确定需要对数据报文执行 GTP解封装。
交换机已经根据之前的控制器发送的流表项添加指示消息, 建立了流表 项。 流表项中的操作域信息可以包括解封装处理对应的多组操作类型及操作 类型对应的第一比特域指示信息。其中 GTP封装头可以包括外部 IP头、 UDP 头和 GTP头。 解封装处理可以包括以下几组操作类型以及操作类型对应的 第一比特域指示信息:
( 1 )根据 2次校验验证操作类型以及对应的第一比特域指示信息, 即 2 次 Verify-Checksum ( Top-offsetl , Sizel/Bottom-offsetl , Top-offset2 , Size2 ) 分别验证外部 IP头和 UDP头的校验和。
( 2 ) 根据弹出操作类型以及对应的第一比特域指示信息, 即 Pop ( Top-offset, Size ), 弹出 IP-UDP-GTP头, 从而对 IP数据报文进行解封装。
( 3 )根据递减操作类型以及对应的第一比特域指示信息, 即 Decrement ( Top-offset, Size, Mask, Step ), 对 IP数据报文中 TTL对应的比特域进行 减 1操作。
( 4 ) 根据校验计算操作类型以及对应的第一比特域指示信息, 即 Calculate- Checksum ( Top-offsetl , Sizel/Bottom-offsetl , Top-offset2, Size2 ), 更新内层 IP头的校验和。
本发明实施例中,通过根据控制器发送的匹配域信息和操作域信息生成 流表项,使得交换机可以根据第一比特域指示信息和第二比特域指示信息对 GTP-U数据报文直接进行隧道解封装处理,而无需对数据报文的协议格式进 行解析, 能够实现用户灵活的自定义的流操作。 示意图。 本实施例中, 交换设备为交换机, 控制设备为控制器。
在图 10中, 以 GTP协议为例, 描述在交换机建立了流表项后, 当交换 机接收到 GTP-U数据报文后, 如何根据流表项进行 GTP隧道解封装和再封 装处理。该处理过程不需要先弹出原有隧道报文头,再压入新的隧道报文头, 只需修改外部 IP地址和隧道 ID等信息。
本实施例中的流表项的匹配域包括两组第二比特域指示信息和匹配值。 交换机可以对由匹配域中第一组的第二比特域指示信息确定的、 与 IP DA对应的比特域进行匹配, 并对由匹配域中第二组的第二比特域指示信息 确定的、 与 UDP端口号 2152对应的比特域进行匹配。 即交换机可以根据指 示 IP DA的 0XM中第一组的第二比特域指示信息, 确定 GTP-U数据报文
中的 IP DA所在的比特域, 并比较该比特域的值是否与该 OXM中第一组的 匹配值相等。 同时, 交换设备可以根据指示 UDP端口的 OXM中第二组的 第二比特域指示, 确定 GTP-U数据报文中的 UDP端口所在的比特域, 并比 较该比特域的值是否与该 OXM中第二组的匹配值相等。 如果两个比特域都 匹配成功, 则交换设备可以根据流表项中的操作域信息对隧道头域信息进行 修改。
控制器经过之前的 GTP-C会话建立操作或对首个 GTP-U数据报文的解 析处理, 可以确定需要对数据报文进行 GTP解封装和重新再封装。
交换机已经根据之前的控制器发送的流表项添加指示消息,建立了流表 项。 流表项中的操作域信息可以包括解封装和重新再封装处理对应的多组操 作类型及操作类型对应的第一比特域指示信息。 其中 GTP封装头可以包括 外部 IP头、 UDP头和 GTP头。 解封装和重新再封装处理可以包括以下几组 操作类型和操作类型对应的第一比特域指示信息:
( 1 )根据 2次校验验证操作类型以及对应的第一比特域指示信息,即 2 次 Verify-Checksum ( Top-offsetl , Sizel/Bottom-offsetl , Top-offset2 , Size2 ), 分别验证外部 IP头和 UDP头的校验和。
( 2 )根据设置操作类型以及对应的第一比特域指示信息, 即 Set-value ( Top-offset, Size, Mask, Data ), 将 GTP头中的原有 TEID1修改为新的
TEID2。
( 3 )根据设置操作类型以及对应的第一比特域指示信息, 即 Set-value
( Top-offset, Size, Mask, Data ), 更新外部 IP头中源地址和目的地址。
( 4 )根据 2次校验计算操作类型和对应的第一比特域指示信息, 即 2 此 Calculate-Checksum( Top-offsetl , Sizel/Bottom-offsetl , Top-offset2 , Size2 ), 分别更新内层 UDP头的校验和和内层 IP头的校验和。
本发明实施例中,通过根据控制器发送的匹配域信息和操作域信息生成 流表项,使得交换机可以根据第一比特域指示信息和第二比特域指示信息对 GTP-U数据报文直接进行隧道解封装再封装处理,而无需对数据报文的协议 格式进行解析, 能够实现用户灵活的自定义的流操作。
本发明实施例中, 上述流表项可以是对现有流表项的扩展, 例如可以在 现有的普通流表的流表项中增加上述操作域信息和 /匹配域信息。上述流表项 也可以在交换机中新增加的流表中单独存放。 下面将结合具体例子详细描述
本发明实施例中流表的布置方式。
图 11是根据本发明实施例的流表的布置方式的一个例子的示意图。 如图 11所示, 本发明实施例的流表项可以在新增加的流表中单独存放, 为了区别于其它现有的普通流表(如图 1 中所示的流表), 该新增加的流表 可以称为通用流表。 其它普通流表可以保持不变。 通用流表可以穿插在现有 的流管线中, 流管线中的其它普通流表可以跳转到通用流表, 通用流表也可 以跳转回流管线中的其它普通流表。
通用流表的流表项与普通流表中的流表项采用相同的结构,但在匹配域 信息中可以包括本发明实施例中的 OXM, 操作域信息中可以包括本发明实 施例中的操作类型以及对应的第一比特域指示信息。
因此, 本发明实施例中, 通过增加通用流表存放包括匹配域信息和操作 域信息的流表项, 无需扩展原有的普通流表中的流表项, 处理更为便捷。
图 12是根据本发明一个实施例的处理数据报文的装置的示意框图。 图 12的装置 1200的一个例子是交换设备, 例如 OpenFlow交换机。 装置 1200 包括匹配单元 1210和操作单元 1220。
匹配单元 1210用于将数据报文与流表项的匹配域信息进行匹配; 所述 流表项包括所述匹配域信息和操作域信息; 其中, 所述操作域信息包括操作 类型和第一比特域指示信息, 所述第一比特域指示信息包括第一偏移量和第 一字段长度, 所述第一比特域指示信息用于指定所述数据报文的第一比特 域, 或者, 所述匹配域信息包括第二比特域指示信息和匹配值, 所述第二比 特域指示信息包括第二偏移量和第二字段长度, 所述第二比特域指示信息用 于指定所述数据报文的第二比特域;
操作单元 1220,用于如果所述数据报文与所述匹配域信息匹配成功, 则 根据所述操作域信息, 对所述数据报文进行操作。
可选地, 当所述操作域信息包括所述操作类型和所述第一比特域指示信 息时, 操作单元 1220具体用于, 如果所述数据报文与所述匹配域信息匹配 成功, 则根据所述第一比特域指示信息确定所述数据报文的第一比特域, 根 据所述操作类型, 对所述第一比特域进行操作。
可选地, 当所述操作域信息包括所述操作类型和所述第一比特域指示信 息时, 所述第一比特域指示信息还包括第一掩码, 对应地, 操作单元 1220 具体用于, 如果所述数据 文与所述匹配域信息匹配成功, 则根据所述第一
比特域指示信息确定所述数据报文的第一比特域, 根据所述第一掩码, 获得 所述第一比特域的至少一个比特位, 根据所述操作类型, 对所述第一比特域 的至少一个比特位进行操作。
可选地, 当所述操作域信息包括所述操作类型和所述第一比特域指示信 息时, 若所述操作域信息还包括操作数时, 操作单元 1220具体用于, 如果 所述数据报文与所述匹配域信息匹配成功, 则根据所述第一比特域指示信息 确定所述数据报文的第一比特域, 根据所述操作类型, 对所述第一比特域和 所述操作数进行操作。
可选地, 当所述匹配域信息包括所述第二比特域指示信息和所述匹配值 时, 匹配单元 1210具体用于, 根据所述第二比特域指示信息, 确定所述数 据报文的第二比特域; 根据所述匹配值, 对所述第二比特域进行匹配。
可选地, 当所述匹配域信息包括所述第二比特域指示信息和所述匹配值 时, 若所述第二比特域指示信息还包括第二掩码, 匹配单元 1210具体用于 根据所述第二比特域指示信息, 确定所述数据报文的第二比特域, 根据所述 第二掩码, 获得所述第二比特域的至少一个比特位, 所述根据所述匹配值, 对所述第二比特域的所述至少一个比特位进行匹配。
示例性的, 所述操作类型包括弹出操作类型、 压入操作类型、 设置操作 类型、 长度计算操作类型、 校验和计算操作类型、 校验和验证操作类型、 递 增操作类型、 递减操作类型或复制操作类型。
装置 1200的其它功能和操作可参照上面图 2至图 11的方法实施例中涉 及交换设备的过程, 为了避免重复, 此处不再赘述。
本发明实施例中,通过根据操作域信息中包括第一偏移量和第一字段长 度的第一比特域指示信息确定数据报文的第一比特域, 并根据操作域信息中 的操作类型对第一比特域进行操作,使得对数据报文的操作不再局限于特定 的协议格式。 同理, 交换设备根据第二比特域指示信息可以任意地确定数据 报文中的第二比特域, 并对第二比特域进行匹配, 而无需解析数据报文的具 体协议格式。 所以通过图 12所示的装置能够避免对于新增协议需要进行的 标准化扩展, 因此能够实现用户灵活的自定义的流操作。
作为本发明另一个实施例, 装置 1200还可以包括接收单元 1230和生成 单元 1240。 接收单元 1230用于接收控制设备发送的流表项添加指示消息, 所述流表项添加指示消息包括所述匹配域信息和所述操作域信息; 生成单元
用于根据所述匹配域信息和所述操作域信息, 生成所述流表项。
可选地, 接收单元 1230还用于接收控制设备发送的流表项修改指示消 息, 所述流表项修改指示消息包括所述匹配域信息和新的操作域信息; 对应 地, 装置 1200还包括修改单元 1240, 用于根据所述匹配域信息和所述新的 操作域信息, 对所述流表项进行修改。
可选地, 接收单元 1230还用于接收控制设备发送的特性请求消息, 所 述特性请求消息用于询问是否支持所述操作域信息或者所述匹配域信息; 对 应地, 装置 1200还包括发送单元 1250, 用于向所述控制设备发送特性响应 消息, 所述特性响应消息用于指示支持所述操作域信息或者所述匹配域信 息。
可选地, 装置 1200可以为交换设备。 示例性的, 交换设备可以为交换 机。
装置 1200的其它功能和操作可参照上面图 2至图 11的方法实施例中涉 及交换设备的过程, 为了避免重复, 此处不再赘述。
本发明实施例中,通过采用偏移量和字段长度能够实现对数据报文特定 比特域的灵活定位, 实现对数据报文灵活的自定义处理, 从而使对数据报文 的处理不再局限于特定的协议格式,避免对于新增协议需要进行的标准化扩 展, 使对数据报文的处理更具通用性。
图 13是本发明另一实施例提供的一种处理数据报文的装置的示意框图。 如图 13所示, 该装置 1300包括生成单元 1310和发送单元 1320。
生成单元 1310,用于生成流表项添加指示消息,所述流表项添加指示信 息包括匹配域信息和操作域信息; 其中, 所述操作域信息包括操作类型和第 一比特域指示信息, 所述第一比特域指示信息包括第一偏移量和第一字段长 度, 所述第一比特域指示信息用于指定数据报文的第一比特域, 或者, 所述 匹配域信息包括第二比特域指示信息和匹配值, 所述第二比特域指示信息包 括第二偏移量和第二字段长度, 所述第二比特域指示信息用于指定所述数据 报文的第二比特域;
发送单元 1320,用于发送所述流表项添加指示消息至交换设备, 以使所 述交换设备根据所述流表项添加指示消息生成流表项, 并根据所述流表项对 所述数据报文进行处理。
可选地, 生成单元 1310还用于生成流表项修改指示消息, 所述流表项
修改指示消息包括所述匹配域信息和新的操作域信息; 对应地, 发送单元
1320还用于,发送所述流表项修改指示消息至所述交换设备, 以使所述交换 设备根据所述匹配域信息和所述新的操作域信息,对与所述匹配域信息对应 的流表项进行修改。
可选地, 发送单元 1320还用于, 发送特性请求消息至所述交换设备, 所述特性请求消息用于询问是否支持所述匹配域信息或者所述操作域信息; 对应地, 装置 1300还包括接收单元 1330, 用于接收所述交换设备发送的特 性响应消息, 所述特性响应消息用于指示支持所述匹配域信息或者所述操作 域信息。
可选地, 装置 1300可以为控制设备, 示例性的, 可以为控制器。
本实施例的装置 1300工作方式可以参考图 3~图 11中控制设备的工作方 式, 此处不作赘述。
本发明实施例中的装置可以通过将携带偏移量和字段长度的比特域指 示信息发送至交换设备, 能够实现对数据报文特定比特域的灵活定位, 实现 对数据报文灵活的自定义处理,从而使对数据报文的处理不再局限于特定的 协议格式, 避免对于新增协议需要进行的标准化扩展, 使对数据报文的处理 更具通用性。
本发明另一实施例还提供一种处理数据报文的系统, 如图 14所示, 该 系统包括交换设备 1410和控制设备 1420。
示例性的, 交换设备 1410可以为图 12所示的装置, 控制设备可以为图
13所示的装置。
本系统的工作方式可以参考图 2~图 11所示实施例中的工作方式, 此处 不作赘述。
本发明实施例中,通过根据偏移量和字段长度能够灵活确定数据报文的 特定比特域, 并对该特定比特域进行匹配或者操作, 因此能够实现对数据报 文灵活的自定义处理, 从而使对数据报文的处理不再局限于特定的协议格 式, 避免对于新增协议需要进行的标准化扩展, 使对数据报文的处理更具通 用性。
本发明另一实施例还提供一种流表项, 包括匹配域信息和操作域信息。 其中, 其中, 所述操作域信息包括操作类型和第一比特域指示信息, 所述第 一比特域指示信息包括第一偏移量和第一字段长度, 所述第一比特域指示信
息用于指定所述数据报文的第一比特域, 或者, 所述匹配域信息包括第二比 特域指示信息和匹配值, 所述第二比特域指示信息包括第二偏移量和第二字 段长度, 所述第二比特域指示信息用于指定所述数据报文的第二比特域。
可选地, 所述第一比特域指示信息还包括第一掩码。
可选地, 所述第二比特域指示信息还包括第二掩码。
可选地, 所述操作域信息还包括操作数。
可选地, 所述操作类型包括弹出操作类型、 压入操作类型、 设置操作类 型、 长度计算操作类型、 校验和计算操作类型、 校验和验证操作类型、 递增 操作类型、 递减操作类型或复制操作类型。
通过本发明实施例提供的流表项, 可以灵活确定数据报文的特定比特 域, 并对该特定比特域进行匹配或者操作, 因此能够实现对数据 文灵活的 自定义处理, 从而使对数据报文的处理不再局限于特定的协议格式, 避免对 于新增协议需要进行的标准化扩展, 使对数据报文的处理更具通用性。
本发明另一实施例还提供一种处理数据报文的计算机程序产品。该计算 机程序产品包括能够被计算机执行的程序代码, 该程序代码用来执行如图 2 所示的处理数据报文的方法。
如图 15所示, 本发明实施例提供一种处理数据报文的装置的其中一种 硬件实现。 该装置可以是交换设备, 示例性的, 可以是支持 OpenFlow技术 的交换机。
该装置包括处理器、 存储器、 第一网络接口, 第二网络接口和第三网络 接口。 其中第一网络接口, 第二网络接口, 第三网络接口, 处理器和存储器 之间通过总线互联。 第一网络接口可以与控制设备连接, 进行交互, 示例性 的, 该控制设备可以是支持 OpenFlow技术的控制器。 第二网络接口作为该 装置的输入端口, 可以用于接收数据报文。 第三网络接口作为该装置的输出 端口, 可以用于发送经过处理器处理的数据报文。 示例性的, 每个网络接口 可以包含多个输入和输出端口。 第一、 第二和第三网络接口可以是相互独立 的网络接口,也可相互合并为一个网络接口;存储器可以为半导体存储单元, 可以直接被处理器访问。
其中, 存储器用于存储计算机可执行的程序代码, 该程序代码用来执行 如图 2所示的处理数据报文的方法, 以及用于存储本发明实施例提供的流表 项。 处理器, 用于根据存储器存储的计算机可执行的程序代码, 执行如图 2
所示的处理数据报文的方法, 对接收到的数据报文进行处理。
示例性的, 通过第一网络接口, 可以接收控制设备发送的流表项添加指 示消息,该流表项添加指示消息中可以包括生成本发明实施例提供的流表项 的匹配域信息和操作域信息, 处理器可以根据流表项添加指示消息中携带的 所述匹配域信息和所述操作域信息生成本发明实施例提供的流表项, 并存储 在存储器中。
示例性的, 通过第一网络接口, 还可以接收控制设备发送的流表项修改 指示消息, 与流表项添加指示消息类似, 流表项修改指示消息中可以包括本 发明实施例提供的流表项的匹配域信息和操作域信息, 处理器可以根据所述 匹配域信息找到存储器中对应的流表项, 并将该流表项中的操作域信息更新 为流表项修改指示消息中携带的操作域信息。
示例性的, 通过第一网络接口, 还可以接收控制设备发送的特性请求消 息, 特性请求消息可以用于询问交换设备是否支持通用流处理能力, 即是否 支持本发明实施例提供的流表项的匹配域信息或者操作域信息。 对应的, 通 过第一网络接口可以向控制设备发送特性响应消息,特性响应消息可以用于 指示支持通用流处理能力, 即支持本发明实施例提供的流表项的匹配域信息 或者操作域信息。
通过本实施例提供的处理数据报文的装置的硬件实现, 采用偏移量和字 段长度实现对数据报文特定比特域的灵活定位, 进而可以实现对数据报文灵 活的自定义处理, 从而使对数据报文的处理不再局限于特定的协议格式, 避 免对于新增协议需要进行的标准化扩展, 使对数据报文的处理更具通用性。
如图 16所示, 本发明实施例提供一种处理数据报文的装置的其中一种 硬件实现。 该装置可以是控制设备, 示例性的, 可以是支持 OpenFlow技术 的控制器。
该装置包括存储器、 处理器和控制器。 存储器、 处理器和控制器通过总 线进行互通。 网络接口可以连接交换设备, 与交换设备进行交互。 存储器可 以是半导体器件, 可以直接被处理器访问。
其中, 存储器用于存储计算机可执行的程序代码, 该程序代码用来执行 如图 3所示的处理数据报文的方法。 处理器, 用于根据存储器存储的计算机 可执行的程序代码, 执行如图 3所示的处理数据报文的方法。 其中流表项添 加指示消息、 流表项修改指示消息或者特性请求消息由处理器通过网络接口
向交换设备进行发送。
通过将包含本发明实施例提供的流表项的匹配域信息和操作域信息发 送至交换设备, 可以使交换设备生成本发明实施例提供的流表项, 从而实现 对数据报文特定比特域的灵活定位,进而可以实现对数据报文灵活的自定义 处理, 避免对于新增协议需要进行的标准化扩展, 使对数据报文的处理更具 通用性。
本领域普通技术人员可以意识到, 结合本文中所公开的实施例描述的各 示例的单元及算法步骤, 能够以电子硬件、 或者计算机软件和电子硬件的结 合来实现。 这些功能究竟以硬件还是软件方式来执行, 取决于技术方案的特 定应用和设计约束条件。 专业技术人员可以对每个特定的应用来使用不同方 法来实现所描述的功能, 但是这种实现不应认为超出本发明的范围。
所属领域的技术人员可以清楚地了解到, 为描述的方便和筒洁, 上述描 述的系统、 装置和单元的具体工作过程, 可以参考前述方法实施例中的对应 过程, 在此不再赘述。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置和 方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示 意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可 以有另外的划分方式, 例如多个单元或组件可以结合或者可以集成到另一个 系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间 的耦合或直接耦合或通信连接可以是通过一些接口, 装置或单元的间接耦合 或通信连接, 可以是电性, 机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作 为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或 者全部单元来实现本实施例方案的目的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元 中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一 个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使 用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发明 的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部
分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质 中, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。 而前 述的存储介质包括: U盘、移动硬盘、只读存储器( ROM , Read-Only Memory )、 随机存取存储器(RAM, Random Access Memory ), 磁碟或者光盘等各种可 以存储程序代码的介质。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护 范围应以所述权利要求的保护范围为准。
Claims
1、 一种处理数据报文的方法, 其特征在于, 包括:
将数据报文与流表项的匹配域信息进行匹配; 所述流表项包括所述匹配 域信息和操作域信息; 其中, 所述操作域信息包括操作类型和第一比特域指 示信息, 所述第一比特域指示信息包括第一偏移量和第一字段长度, 所述第 一比特域指示信息用于指定所述数据报文的第一比特域, 或者, 所述匹配域 信息包括第二比特域指示信息和匹配值, 所述第二比特域指示信息包括第二 偏移量和第二字段长度,所述第二比特域指示信息用于指定所述数据报文的 第二比特域;
如果所述数据报文与所述匹配域信息匹配成功, 则根据所述操作域信 息, 对所述数据报文进行操作。
2、 根据权利要求 1所述的方法, 其特征在于, 当所述操作域信息包括 所述操作类型和所述第一比特域指示信息时, 所述根据所述操作域信息, 对 所述数据报文进行操作, 包括:
根据所述第一比特域指示信息确定所述数据报文的第一比特域; 根据所述操作类型, 对所述第一比特域进行操作。
3、 根据权利要求 1所述的方法, 其特征在于, 当所述操作域信息包括 所述操作类型和所述第一比特域指示信息时, 所述第一比特域指示信息还包 括第一掩码, 所述根据所述操作域信息, 对所述数据报文进行操作, 包括: 根据所述第一比特域指示信息确定所述数据报文的第一比特域; 根据所述第一掩码, 获得所述第一比特域的至少一个比特位; 根据所述操作类型, 对所述第一比特域的至少一个比特位进行操作。
4、 根据权利要求 2所述的方法, 其特征在于, 当所述操作域信息还包 括操作数时, 所述根据所述操作类型, 对所述第一比特域进行操作, 包括: 根据所述操作类型, 对所述第一比特域和所述操作数进行操作。
5、 根据权利要求 1-4 中任一项所述的方法, 其特征在于, 当所述匹配 域信息包括所述第二比特域指示信息和所述匹配值时, 所述将数据报文与流 表项的匹配域信息进行匹配, 包括:
根据所述第二比特域指示信息, 确定所述数据报文的第二比特域; 根据所述匹配值, 对所述第二比特域进行匹配。
6、 根据权利要求 1-4 中任一项所述的方法, 其特征在于, 当所述匹配 域信息包括所述第二比特域指示信息和所述匹配值时, 所述第二比特域指示
信息还包括第二掩码, 所述将数据报文与流表项的匹配域信息进行匹配, 包 括:
根据所述第二比特域指示信息, 确定所述数据报文的第二比特域; 根据所述第二掩码, 获得所述第二比特域的至少一个比特位; 根据所述匹配值, 对所述第二比特域的所述至少一个比特位进行匹配。
7、 根据权利要求 1-6 中任一项所述的方法, 其特征在于, 所述操作类 型包括弹出操作类型、 压入操作类型、 设置操作类型、 长度计算操作类型、 校验和计算操作类型、 校验和验证操作类型、 递增操作类型、 递减操作类型 或复制操作类型。
8、 根据权利要求 1-7 中任一项所述的方法, 其特征在于, 所述方法还 包括:
接收控制设备发送的流表项添加指示消息, 所述流表项添加指示消息包 括所述匹配域信息和所述操作域信息;
根据所述匹配域信息和所述操作域信息, 生成所述流表项。
9、 根据权利要求 1-8 中任一项所述的方法, 其特征在于, 所述方法还 包括:
接收控制设备发送的流表项修改指示消息, 所述流表项修改指示消息包 括所述匹配域信息和新的操作域信息;
根据所述匹配域信息和所述新的操作域信息, 对所述流表项进行修改。
10、 根据权利要求 1-9中任一项所述的方法, 其特征在于, 所述方法还 包括:
接收控制设备发送的特性请求消息, 所述特性请求消息用于询问是否支 持所述操作域信息或者所述匹配域信息;
向所述控制设备发送特性响应消息, 所述特性响应消息用于指示支持所 述操作域信息或者所述匹配域信息。
11、 一种处理数据报文的装置, 其特征在于, 包括:
匹配单元, 用于将数据报文与流表项的匹配域信息进行匹配; 所述流表 项包括所述匹配域信息和操作域信息; 其中, 所述操作域信息包括操作类型 和第一比特域指示信息, 所述第一比特域指示信息包括第一偏移量和第一字 段长度, 所述第一比特域指示信息用于指定所述数据报文的第一比特域, 或 者, 所述匹配域信息包括第二比特域指示信息和匹配值, 所述第二比特域指 示信息包括第二偏移量和第二字段长度, 所述第二比特域指示信息用于指定
所述数据报文的第二比特域;
操作单元, 用于如果所述数据报文与所述匹配域信息匹配成功, 则根据 所述操作域信息, 对所述数据报文进行操作。
12、 根据权利要求 11所述的装置, 其特征在于, 当所述操作域信息包 括所述操作类型和所述第一比特域指示信息时, 所述操作单元具体用于, 如 果所述数据 文与所述匹配域信息匹配成功, 则根据所述第一比特域指示信 息确定所述数据报文的第一比特域, 根据所述操作类型, 对所述第一比特域 进行操作。
13、 根据权利要求 11所述的装置, 其特征在于, 当所述操作域信息包 括所述操作类型和所述第一比特域指示信息时, 所述第一比特域指示信息还 包括第一掩码, 所述操作单元具体用于, 如果所述数据报文与所述匹配域信 息匹配成功, 则根据所述第一比特域指示信息确定所述数据报文的第一比特 域, 根据所述第一掩码, 获得所述第一比特域的至少一个比特位, 根据所述 操作类型, 对所述第一比特域的至少一个比特位进行操作。
14、 根据权利要求 12所述的装置, 其特征在于, 当所述操作域信息还 包括操作数时, 所述操作单元具体用于, 如果所述数据报文与所述匹配域信 息匹配成功, 则根据所述第一比特域指示信息确定所述数据报文的第一比特 域, 根据所述操作类型, 对所述第一比特域和所述操作数进行操作。
15、 根据权利要求 11-14中任一项所述的装置, 其特征在于, 当所述匹 配域信息包括所述第二比特域指示信息和所述匹配值时, 所述匹配单元具体 用于, 根据所述第二比特域指示信息, 确定所述数据报文的第二比特域; 根 据所述匹配值, 对所述第二比特域进行匹配。
16、 根据权利要求 11-14中任一项所述的装置, 其特征在于, 当所述匹 配域信息包括所述第二比特域指示信息和所述匹配值时, 所述第二比特域指 示信息还包括第二掩码, 所述匹配单元具体用于, 根据所述第二比特域指示 信息, 确定所述数据报文的第二比特域, 根据所述第二掩码, 获得所述第二 比特域的至少一个比特位, 所述根据所述匹配值, 对所述第二比特域的所述 至少一个比特位进行匹配。
17、 根据权利要求 11-16中任一项所述的装置, 其特征在于, 所述操作 类型包括弹出操作类型、压入操作类型、设置操作类型、长度计算操作类型、 校验和计算操作类型、 校验和验证操作类型、 递增操作类型、 递减操作类型 或复制操作类型。
18、 根据权利要求 11-17中任一项所述的装置, 其特征在于, 所述装置 还包括:
接收单元, 用于接收控制设备发送的流表项添加指示消息, 所述流表项 添加指示消息包括所述匹配域信息和所述操作域信息;
生成单元, 用于根据所述匹配域信息和所述操作域信息, 生成所述流表 项。
19、 根据权利要求 11-18中任一项所述的装置, 其特征在于,
所述接收单元还用于, 接收控制设备发送的流表项修改指示消息, 所述 流表项修改指示消息包括所述匹配域信息和新的操作域信息;
所述装置还包括修改单元, 用于根据所述匹配域信息和所述新的操作域 信息, 对所述流表项进行修改。
20、 根据权利要求 11-19中任一项所述的装置, 其特征在于,
所述接收单元还用于, 接收控制设备发送的特性请求消息, 所述特性请 求消息用于询问是否支持所述操作域信息或者所述匹配域信息;
所述装置还包括发送单元, 用于向所述控制设备发送特性响应消息, 所 述特性响应消息用于指示支持所述操作域信息或者所述匹配域信息。
21、 根据权利要求 11-20中任一项所述的装置, 其特征在于, 所述装置 为交换设备。
22、 一种处理数据报文的方法, 其特征在于, 包括:
生成流表项添加指示消息, 所述流表项添加指示信息包括匹配域信息和 操作域信息; 其中, 所述操作域信息包括操作类型和第一比特域指示信息, 所述第一比特域指示信息包括第一偏移量和第一字段长度, 所述第一比特域 指示信息用于指定数据报文的第一比特域, 或者, 所述匹配域信息包括第二 比特域指示信息和匹配值, 所述第二比特域指示信息包括第二偏移量和第二 字段长度, 所述第二比特域指示信息用于指定所述数据报文的第二比特域; 发送所述流表项添加指示消息至交换设备, 以使所述交换设备根据所述 流表项添加指示消息生成流表项, 并根据所述流表项对所述数据报文进行处 理。
23、 如权利要求 22所述的方法, 其特征在于, 所述发送所述流表项添 加指示消息至交换设备之前, 还包括:
发送特性请求消息至所述交换设备, 所述特性请求消息用于询问是否支 持所述匹配域信息或者所述操作域信息;
接收所述交换设备发送的特性响应消息, 所述特性响应消息用于指示支 持所述匹配域信息或者所述操作域信息。
24、 一种处理数据报文的装置, 其特征在于, 包括:
生成单元, 用于生成流表项添加指示消息, 所述流表项添加指示信息包 括匹配域信息和操作域信息; 其中, 所述操作域信息包括操作类型和第一比 特域指示信息, 所述第一比特域指示信息包括第一偏移量和第一字段长度, 所述第一比特域指示信息用于指定数据报文的第一比特域, 或者, 所述匹配 域信息包括第二比特域指示信息和匹配值, 所述第二比特域指示信息包括第 二偏移量和第二字段长度, 所述第二比特域指示信息用于指定所述数据报文 的第二比特域;
发送单元, 用于发送所述流表项添加指示消息至交换设备, 以使所述交 换设备根据所述流表项添加指示消息生成流表项, 并根据所述流表项对所述 数据报文进行处理。
25、 根据权利要求 24所述的装置, 其特征在于,
所述生成单元还用于, 生成流表项修改指示消息, 所述流表项修改指示 消息包括所述匹配域信息和新的操作域信息;
所述发送单元, 还用于发送所述流表项修改指示消息至所述交换设备, 以使所述交换设备根据所述匹配域信息和所述新的操作域信息,对与所述匹 配域信息对应的流表项进行修改。
26、 根据权利要求 24或 25所述的装置, 其特征在于,
所述发送单元, 还用于发送特性请求消息至所述交换设备, 所述特性请 求消息用于询问是否支持所述匹配域信息或者所述操作域信息;
所述装置还包括接收单元, 用于接收所述交换设备发送的特性响应消 息, 所述特性响应消息用于指示支持所述匹配域信息或者所述操作域信息。
27、 根据权利要求 24-26中任一项所述的装置, 其特征在于, 所述装置 为控制设备。
28、 一种处理数据报文的系统, 其特征在于, 包括:
根据权利要求 11-21中任一项所述的装置和根据权利要求 24-27中任一 项所述的装置。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2012/079602 WO2014019205A1 (zh) | 2012-08-02 | 2012-08-02 | 处理数据报文的方法、装置及系统 |
CN201280001131.0A CN103718520B (zh) | 2012-08-02 | 2012-08-02 | 处理数据报文的方法、装置及系统 |
EP12882133.7A EP2869509B1 (en) | 2012-08-02 | 2012-08-02 | Method, apparatus, and system for processing data packet |
US14/611,470 US9894003B2 (en) | 2012-08-02 | 2015-02-02 | Method, apparatus and system for processing data packet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2012/079602 WO2014019205A1 (zh) | 2012-08-02 | 2012-08-02 | 处理数据报文的方法、装置及系统 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US14/611,470 Continuation US9894003B2 (en) | 2012-08-02 | 2015-02-02 | Method, apparatus and system for processing data packet |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014019205A1 true WO2014019205A1 (zh) | 2014-02-06 |
Family
ID=50027128
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2012/079602 WO2014019205A1 (zh) | 2012-08-02 | 2012-08-02 | 处理数据报文的方法、装置及系统 |
Country Status (4)
Country | Link |
---|---|
US (1) | US9894003B2 (zh) |
EP (1) | EP2869509B1 (zh) |
CN (1) | CN103718520B (zh) |
WO (1) | WO2014019205A1 (zh) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105245455A (zh) * | 2014-07-11 | 2016-01-13 | 中国移动通信集团公司 | 软件定义网络中的流表下发方法、报文转发方法及设备 |
CN105340227A (zh) * | 2014-06-03 | 2016-02-17 | 华为技术有限公司 | 开放流流表间信息传递的方法、控制器、交换机及系统 |
CN105453497A (zh) * | 2014-08-06 | 2016-03-30 | 华为技术有限公司 | 一种软件定义网络sdn中处理数据包的方法、装置及系统 |
CN105723674A (zh) * | 2013-05-07 | 2016-06-29 | 华为技术有限公司 | 用于在网络控制协议中动态地绑定头字段标识符的方法 |
US20170041227A1 (en) * | 2014-04-21 | 2017-02-09 | Huawei Technologies Co., Ltd. | Packet transmission method and device, and communications system |
EP3166265A4 (en) * | 2014-08-06 | 2017-08-16 | Huawei Technologies Co., Ltd. | Method, apparatus and system for processing data packet in software defined network (sdn) |
CN111583147A (zh) * | 2020-05-06 | 2020-08-25 | 北京字节跳动网络技术有限公司 | 图像处理方法、装置、设备及计算机可读存储介质 |
CN116455997A (zh) * | 2023-06-12 | 2023-07-18 | 深圳华锐分布式技术股份有限公司 | Step行情多路转发方法、装置、设备及介质 |
Families Citing this family (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9246847B2 (en) * | 2012-12-17 | 2016-01-26 | Telefonaktiebolaget L M Ericsson (Publ) | Extending the reach and effectiveness of header compression in access networks using SDN |
US20160094357A1 (en) * | 2013-04-24 | 2016-03-31 | Nec Corporation | Control apparatus, computer system, communication control method, and program |
CN103428094B (zh) * | 2013-08-12 | 2016-08-17 | 杭州华三通信技术有限公司 | 开放流OpenFlow系统中的报文转发方法及装置 |
CN105471726B (zh) | 2014-09-05 | 2019-08-27 | 华为技术有限公司 | 转发参数传递的方法及设备 |
US20180048593A1 (en) * | 2015-02-17 | 2018-02-15 | Hewlett Packard Enterprise Development Lp | Flow entry generating and packet processing based on flow entry |
US20170359259A1 (en) * | 2016-06-09 | 2017-12-14 | Hewlett Packard Enterprise Development Lp | Packet field matching in openflow |
US11159427B2 (en) * | 2017-03-31 | 2021-10-26 | Intel Corporation | Single lookup entry for symmetric flows |
CN107426180B (zh) * | 2017-06-15 | 2020-05-05 | 西安微电子技术研究所 | 一种以太网数据帧覆盖性的检测装置 |
EP3995955B1 (en) * | 2017-06-30 | 2024-10-16 | Huawei Technologies Co., Ltd. | Data processing method, network interface card, and server |
CN109495387A (zh) * | 2017-09-13 | 2019-03-19 | 中兴通讯股份有限公司 | 流表匹配方法、装置、系统及计算机可读存储介质 |
US11444877B2 (en) * | 2019-03-18 | 2022-09-13 | At&T Intellectual Property I, L.P. | Packet flow identification with reduced decode operations |
US11470009B2 (en) * | 2019-10-18 | 2022-10-11 | Arista Networks, Inc. | Implementing multi-table OpenFlow using a parallel hardware table lookup architecture |
US11601491B2 (en) * | 2020-03-30 | 2023-03-07 | Tencent America LLC | Network-based media processing (NBMP) workflow management direct access in 5G framework for live uplink streaming (FLUS) |
CN114079674B (zh) * | 2020-08-10 | 2023-02-21 | 大唐移动通信设备有限公司 | 一种数据处理方法、用户面功能及装置 |
CN115314447B (zh) * | 2021-05-08 | 2024-03-26 | 中国科学院声学研究所 | 一种SDN环境中packet-in消息的处理方法及系统 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101594355A (zh) * | 2009-06-17 | 2009-12-02 | 华为技术有限公司 | 一种实现软件跨版本交互的方法及装置 |
CN102333039A (zh) * | 2011-10-25 | 2012-01-25 | 华为技术有限公司 | 一种转发报文的方法、生成表项的方法及装置 |
CN102349268A (zh) * | 2009-03-09 | 2012-02-08 | 日本电气株式会社 | OpenFlow通信系统和OpenFlow通信方法 |
CN102594689A (zh) * | 2012-02-22 | 2012-07-18 | 中兴通讯股份有限公司 | 一种分布式网络控制方法及装置 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8762501B2 (en) * | 2011-08-29 | 2014-06-24 | Telefonaktiebolaget L M Ericsson (Publ) | Implementing a 3G packet core in a cloud computer with openflow data and control planes |
US10390259B2 (en) * | 2012-02-28 | 2019-08-20 | Nokia Solutions And Networks Oy | Data forwarding in a mobile communications network system with centralized gateway apparatus controlling distributed gateway elements |
EP2832076B1 (en) * | 2012-03-30 | 2018-05-02 | Nokia Solutions and Networks Oy | Centralized ip address management for distributed gateways |
-
2012
- 2012-08-02 EP EP12882133.7A patent/EP2869509B1/en active Active
- 2012-08-02 WO PCT/CN2012/079602 patent/WO2014019205A1/zh active Application Filing
- 2012-08-02 CN CN201280001131.0A patent/CN103718520B/zh active Active
-
2015
- 2015-02-02 US US14/611,470 patent/US9894003B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102349268A (zh) * | 2009-03-09 | 2012-02-08 | 日本电气株式会社 | OpenFlow通信系统和OpenFlow通信方法 |
CN101594355A (zh) * | 2009-06-17 | 2009-12-02 | 华为技术有限公司 | 一种实现软件跨版本交互的方法及装置 |
CN102333039A (zh) * | 2011-10-25 | 2012-01-25 | 华为技术有限公司 | 一种转发报文的方法、生成表项的方法及装置 |
CN102594689A (zh) * | 2012-02-22 | 2012-07-18 | 中兴通讯股份有限公司 | 一种分布式网络控制方法及装置 |
Non-Patent Citations (1)
Title |
---|
See also references of EP2869509A4 * |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105723674A (zh) * | 2013-05-07 | 2016-06-29 | 华为技术有限公司 | 用于在网络控制协议中动态地绑定头字段标识符的方法 |
CN105723674B (zh) * | 2013-05-07 | 2019-07-12 | 华为技术有限公司 | 用于在网络控制协议中动态地绑定头字段标识符的方法 |
US10686701B2 (en) * | 2014-04-21 | 2020-06-16 | Huawei Technologies Co., Ltd. | Packet transmission method and device, and communications system |
US20170041227A1 (en) * | 2014-04-21 | 2017-02-09 | Huawei Technologies Co., Ltd. | Packet transmission method and device, and communications system |
CN105340227A (zh) * | 2014-06-03 | 2016-02-17 | 华为技术有限公司 | 开放流流表间信息传递的方法、控制器、交换机及系统 |
CN105340227B (zh) * | 2014-06-03 | 2018-11-13 | 华为技术有限公司 | 开放流流表间信息传递的方法、控制器、交换机及系统 |
CN105245455A (zh) * | 2014-07-11 | 2016-01-13 | 中国移动通信集团公司 | 软件定义网络中的流表下发方法、报文转发方法及设备 |
CN105245455B (zh) * | 2014-07-11 | 2019-01-01 | 中国移动通信集团公司 | 软件定义网络中的流表下发方法、报文转发方法及设备 |
US10200289B2 (en) | 2014-08-06 | 2019-02-05 | Huawei Technologies Co., Ltd. | Data packet processing method, apparatus, and system in software defined network SDN |
EP3166265A4 (en) * | 2014-08-06 | 2017-08-16 | Huawei Technologies Co., Ltd. | Method, apparatus and system for processing data packet in software defined network (sdn) |
CN105453497A (zh) * | 2014-08-06 | 2016-03-30 | 华为技术有限公司 | 一种软件定义网络sdn中处理数据包的方法、装置及系统 |
US10764195B2 (en) | 2014-08-06 | 2020-09-01 | Huawei Technologies Co., Ltd. | Data packet processing method, apparatus, and system in software defined network SDN |
CN111583147A (zh) * | 2020-05-06 | 2020-08-25 | 北京字节跳动网络技术有限公司 | 图像处理方法、装置、设备及计算机可读存储介质 |
CN111583147B (zh) * | 2020-05-06 | 2023-06-06 | 北京字节跳动网络技术有限公司 | 图像处理方法、装置、设备及计算机可读存储介质 |
CN116455997A (zh) * | 2023-06-12 | 2023-07-18 | 深圳华锐分布式技术股份有限公司 | Step行情多路转发方法、装置、设备及介质 |
CN116455997B (zh) * | 2023-06-12 | 2023-08-22 | 深圳华锐分布式技术股份有限公司 | Step行情多路转发方法、装置、设备及介质 |
Also Published As
Publication number | Publication date |
---|---|
EP2869509A1 (en) | 2015-05-06 |
US20150146718A1 (en) | 2015-05-28 |
CN103718520B (zh) | 2017-07-21 |
US9894003B2 (en) | 2018-02-13 |
EP2869509B1 (en) | 2019-01-02 |
CN103718520A (zh) | 2014-04-09 |
EP2869509A4 (en) | 2015-06-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2014019205A1 (zh) | 处理数据报文的方法、装置及系统 | |
WO2018040529A1 (zh) | 一种报文处理方法、设备及系统 | |
US7519079B2 (en) | Generic routing encapsulation over point-to-point protocol | |
CN105591982B (zh) | 一种报文传输的方法和装置 | |
WO2015143802A1 (zh) | 业务功能链处理方法及装置 | |
CN104125191B (zh) | 基于以太网的点对点协议的处理方法、设备和系统 | |
WO2013059991A1 (zh) | 数据报文处理方法和系统、报文转发设备 | |
US20200186389A1 (en) | Virtual Extensible Local Area Network (VXLAN) Packet Encapsulation | |
WO2015085576A1 (zh) | 地址解析协议消息的处理方法和转发器、控制器 | |
WO2021174943A1 (zh) | 数据转发方法、装置、设备和存储介质 | |
WO2017193732A1 (zh) | 一种伪线数据报文的封装、解封装方法和相关装置 | |
EP3425860B1 (en) | Tunnel type selection methods and apparatuses | |
CN108282391B (zh) | 一种vxlan报文分片方法和装置 | |
CN108075991B (zh) | 报文转发方法及装置 | |
WO2017206058A1 (zh) | 一种宽带集群通信中的通信配置方法和装置 | |
EP4117242A1 (en) | Message detection method, device and system | |
WO2015100585A1 (zh) | 光纤到分配点设备及其通信方法 | |
JP2023529639A (ja) | パケット処理方法、デバイス、およびシステム | |
WO2015006901A1 (zh) | 一种数据流处理方法、设备和系统 | |
CN115514828A (zh) | 数据传输方法及电子设备 | |
WO2014067065A1 (zh) | 实现隧道处理的方法、装置和系统 | |
WO2024041064A1 (zh) | Quic报文的传输方法及相关设备 | |
CN110943896B (zh) | PPPoE数据报文传输方法、装置、设备及存储介质 | |
KR100912299B1 (ko) | IPv4 /IPv6 통합망에서의 데이터 포워딩 방법 | |
CN110505137B (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: 12882133 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2012882133 Country of ref document: EP |
|
NENP | Non-entry into the national phase |
Ref country code: DE |