WO2016177191A1 - Packet processing method and device - Google Patents

Packet processing method and device Download PDF

Info

Publication number
WO2016177191A1
WO2016177191A1 PCT/CN2016/077583 CN2016077583W WO2016177191A1 WO 2016177191 A1 WO2016177191 A1 WO 2016177191A1 CN 2016077583 W CN2016077583 W CN 2016077583W WO 2016177191 A1 WO2016177191 A1 WO 2016177191A1
Authority
WO
WIPO (PCT)
Prior art keywords
packet
indication information
service feature
port
output
Prior art date
Application number
PCT/CN2016/077583
Other languages
French (fr)
Chinese (zh)
Inventor
王丽雪
李煊
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016177191A1 publication Critical patent/WO2016177191A1/en

Links

Images

Definitions

  • the present invention relates to the field of network communication technologies, and in particular, to a packet processing method and apparatus.
  • Software-defined network SDN is a new type of network innovation architecture. Its core concept is the separation of control plane and forwarding plane.
  • the basic SDN network includes: a network controller (Controller) on the control plane and an OpenFlow switch on the forwarding plane, which implement control functions and data forwarding functions, respectively.
  • the OpenFlow switch includes one or more Flow Tables and a Group Table to perform packet lookup and forwarding, and a channel for communicating with the network controller.
  • the group table of the OpenFlow switch is composed of a series of group entries, including a group identifier, a group type, a counter, and an action bucket.
  • the packet offloading method of the OpenFlow switch in the SDN network mainly selects the corresponding outbound port output packet in the unit of the packet.
  • this method of shunting does not take into account the impact of business characteristics in different application areas. For example, in the field of broadband access, it is necessary to ensure that packets are always output from the same port according to a link-building relationship. The current shunting method cannot meet this requirement.
  • the object of the embodiments of the present invention is to provide a method and a device for processing a packet, which solves the problem that the packet offloading method of the OpenFlow switch in the SDN network cannot meet the service characteristics of different application domains.
  • an embodiment of the present invention provides a method for processing a packet, including:
  • the step of determining the indication information corresponding to the service feature information according to the service feature information includes:
  • the indication information that is uniquely corresponding to the service feature information from the mapping relationship table between the service feature information and the indication information.
  • the method further includes: if the indication information that uniquely corresponds to the service feature information is not found from the mapping relationship table, the method further includes:
  • the output port is an inactive port, select other indication information according to the first preset rule, and determine an output port of the output packet indicated by the other indication information, until the output port is an active port, and use the active The port outputs the message.
  • the method further includes: after the outputting the packet by using the active port, the method further includes:
  • the mapping relationship table includes a plurality of entries, each of the entries identifying a service feature information and an identifier of the indication information uniquely corresponding to the service feature information;
  • An update period is set for each of the entries, and the packet containing the service feature information of the entry is not received from the mapping relationship table.
  • the entry is: if the packet containing the service feature information of the entry is received in the update period, the update period of the entry is reset by using the time of receiving the packet as a starting point.
  • the method further includes:
  • the preset field is pointed to other indication information.
  • the indication information is saved in a action bucket of the OpenFlow switch.
  • the indication information indicating that the packet is output from the newly added out port is correspondingly increased.
  • An embodiment of the present invention further provides a packet processing apparatus, including:
  • the information acquiring module is configured to receive the packet, and obtain service characteristic information related to the service from the packet;
  • a determining module configured to determine, according to the service feature information, indication information corresponding to the service feature information
  • the first output module is configured to output the message from an output port according to the indication of the indication information.
  • the determining module includes:
  • the determining submodule is configured to, according to the service feature information, look up the indication information that is uniquely corresponding to the service feature information from the mapping relationship table between the service feature information and the action bucket.
  • the processing device further includes:
  • Obtaining a module configured to obtain a preset field if the indication information uniquely corresponding to the service feature information is not found in the mapping relationship table;
  • a port obtaining module configured to determine indication information pointed by the preset field, and obtain an output port of the message outputted by the indication information
  • a second output module configured to output the message by using the active port if the output port is an active port
  • a third output module configured to: if the output port is an inactive port, select other indication information according to the first preset rule, and determine an output port of the output packet indicated by the other indication information until the output port is An active port that outputs the message by using the active port.
  • the processing device further includes:
  • the saving module is configured to save the correspondence between the indication information corresponding to the active port and the service feature information in the packet output from the active port to the mapping relationship table.
  • the mapping relationship table includes a plurality of entries, each of the entries identifying a service feature information and an identifier of the indication information uniquely corresponding to the service feature information;
  • the device also includes:
  • An update module configured to set an update period for each of the entries starting from a settling time of each entry, and if the packet containing the service feature information of the entry is not received in the update period, The entry is deleted in the mapping relationship table. If the packet containing the service feature information of the entry is received in the update period, the update period of the entry is reset based on the time when the packet is received.
  • the processing device further includes:
  • Pointing to the module set to point the preset field to other indication information according to the second preset rule.
  • the indication information is saved in a action bucket of the OpenFlow switch.
  • the processing device further includes:
  • a new module is set to increase the indication of the output of the packet from the newly added outbound port when the output port of the OpenFlow switch is added.
  • the OpenFlow switch can determine different indication information according to different service feature information in the packet according to the corresponding relationship between the service feature information and the indication information.
  • the indication of the information is outputted by the message; the message having the same service feature information can be outputted from the same output port indicated by the same indication information; thereby, the output port of the message is determined according to the service characteristics of different application areas of the message.
  • the implementation of packet shunting provides a favorable basis for software-defined networks in different fields and expands the application scope of software-defined networks.
  • FIG. 1 is a schematic diagram showing the basic steps of a method for processing a packet according to an embodiment of the present invention
  • FIG. 2 is a flowchart showing specific steps subsequent to the process of processing a packet according to an embodiment of the present invention
  • Figure 3 shows a network architecture diagram of a software-defined network SDN
  • FIG. 4 is a flowchart showing a specific application process of a packet processing method provided by the present invention in an OpenFlow switch;
  • FIG. 5 is a structural diagram showing the structure of a message processing apparatus according to an embodiment of the present invention.
  • the present invention is directed to the problem that the packet offloading method of the OpenFlow switch in the SDN network in the prior art cannot meet the problem of poor traffic distribution caused by the service characteristics of different application domains, and provides a packet processing method and device, which are pre-stored service features.
  • the correspondence between the information and the indication information enables the OpenFlow switch to determine different indication information according to different service characteristic information in the packet and output the packet according to the indication of the indication information; further enable the packets having the same service characteristic information to be the same
  • the output of the same output port indicated by the indication information is implemented. Therefore, the output port of the packet is determined according to the service characteristics of different application areas of the packet, and the packet is offloaded, thereby providing a favorable foundation for the application of the software-defined network in different fields. Expand the scope of application of software-defined networks.
  • an embodiment of the present invention provides a method for processing a packet, including:
  • Step 11 Receive a packet, and obtain service characteristic information related to the service from the packet.
  • Step 12 Determine, according to the service feature information, indication information corresponding to the service feature information
  • Step 13 Output the message from an output port according to the indication of the indication information.
  • the packet carries a field capable of expressing the service feature, and different services may select different fields in the packet as the service feature information to establish different mapping relationship tables.
  • the source MAC address in the packet is selected as the service feature information, and the mapping relationship table is established. If the source MAC address is the same, the same service of the same user is determined, and the same output port can be output; for example, for In the B-type service, the source MAC address and the protocol value in the selected packet are used as the service feature information to establish a mapping relationship table.
  • the source MAC address and the protocol value are the same, the same service is determined as the same user, and the packets are output from the same output port. .
  • the indication information is used to indicate that the message is output from an output port, and the message is output from different output ports by using different indication information.
  • a method for processing a packet provided by an embodiment of the present invention is specifically described in an OpenFlow switch environment based on a software-defined network SDN. That is, the indication information is saved in a action bucket of the OpenFlow switch.
  • the action bucket corresponding to the service feature information is determined according to the service feature information, where the action bucket includes the indication information, and the indication information is through which output port The message is output.
  • the mapping relationship table stores the correspondence between the service feature information and the action bucket.
  • a plurality of mapping relationship tables may be set, and different service feature information is saved in different mapping relationship tables.
  • a mapping relationship table stores a correspondence between a source MAC address and a action bucket
  • another mapping relationship table stores a correspondence between a protocol value and a action bucket; however, an embodiment in which different service feature information is saved to a mapping relationship table is also
  • the purpose of the search corresponding to the present invention can be achieved. Therefore, the specific storage manner can be specifically determined according to the size of the stored data and the setting of the storage space, and is not limited to a fixed manner.
  • the method for processing the packet offloading provided by the embodiment of the present invention can implement the output of the packet according to the service features of different application domains, and meets the adaptation of the packet offloading and different service features, and provides favorable applications for the SDN network in different fields. Foundation to expand its range of applications.
  • the service feature information may be, but is not limited to, a MAC address, a protocol value, a session ID, and the like, and a combination thereof, and is not specifically limited herein.
  • the method for processing a packet according to the embodiment of the present invention can select an output port to output a packet according to the service feature information, thereby implementing packet offloading, and can implement the packet with the same service feature information from a certain determination.
  • Output port output For example, the source MAC address of a service selection packet is used as the service feature information. After receiving the packet, the source MAC address is obtained from the packet, and the mapping table is searched according to the source MAC address. The output of the determined output port can still output the message from the output port after receiving the message of the source MAC address next time.
  • step 12 in the above embodiment of the present invention includes:
  • Step 121 Search, according to the service feature information, the indication information that is uniquely corresponding to the service feature information from the mapping relationship table between the service feature information and the indication information.
  • the mapping relationship table may be preset according to the service characteristics, or may be added one by one according to the communication process. For example, if the initialization of the mapping relationship table is empty, after the first packet is output, the packet is The correspondence between the service feature information and the indication information is saved to the mapping relationship table, and so on. Each time a message is output, a corresponding relationship is added to the mapping relationship table, and the mapping relationship table is continuously improved; or, for example, the mapping relationship The initialization of the table is not empty. The mapping between the common service feature information and the commonly used indication information is saved in the initialization of the mapping relationship table. Of course, the method of gradually adding the corresponding relationship may be continuously used in the following manner. Improve the mapping relationship table.
  • the method is applied to the SDN network, and the step 121 is specifically: searching, according to the service feature information, a action bucket that uniquely corresponds to the service feature information from the mapping relationship table between the service feature information and the action bucket.
  • the action bucket contains its instructions. The way to save the corresponding relationship by using the mapping relationship table can make the saved content easy to manage, and the searching is simple and fast.
  • the mapping relationship table needs to ensure that each service feature information has a uniquely determined action bucket corresponding thereto, and can be implemented by using an algorithm such as a hash table.
  • the method further includes:
  • Step 21 Obtain a preset field.
  • Step 22 Determine indication information pointed by the preset field, and obtain an output of the packet indicated by the indication information. Output port;
  • Step 23 If the output port is an active port, output the packet by using the active port.
  • Step 24 If the output port is an inactive port, select other indication information according to the first preset rule, and determine an output port of the output packet indicated by the other indication information until the output port is an active port, and use The active port outputs the message.
  • the embodiment of the present invention sets a preset field (Flag field), the Flag field. Representing the default indication information when the indication information is not found in the mapping relationship table. Further, the indication information is stored in the action bucket, that is, the Flag field represents a default action bucket when the action bucket is not found in the mapping relationship table. Initialize the Flag field to the minimum action bucket number to participate in the split. Preferably, when the search fails, it is determined whether the Flag field specifies whether the egress port corresponding to the action in the action bucket is active. If the egress port is active, the packet is output from the corresponding egress port. If the egress port is inactive, the Flag field points to the next one. The action bucket will be active until the outbound port corresponding to the action in the selected action bucket, and the message will be output from the active port.
  • the flag field specifies whether the egress port corresponding to the action in the action bucket is active. If the egress port is active, the packet is output from the corresponding egress port. If the
  • the first preset rule is that the polling selection is performed according to the number of the indication information, that is, if the indication information includes: indication information 1, indication information 2, indication information 3, and indication information 4; then the Flag field initially points to the indication information 1, When the output port corresponding to the indication information 1 is an inactive port, the Flag field points to the indication information 2. When the output port corresponding to the indication information 2 is an inactive port, the Flag field points to the indication information 3, and when the output port corresponding to the indication information 3 When it is an inactive port, the Flag field points to the indication information 4, and when the output port corresponding to the indication information 4 is an inactive port, the Flag field is redirected to the indication information 1, and so on, thereby implementing the round robin selection.
  • the number of the indication information may also be the number of the action bucket, and the principle is the same as the above, and the description is not repeated.
  • the polling method is chosen to avoid repeatedly selecting the same output port and not achieving the effect of shunting.
  • the method further includes:
  • Step 25 Save the correspondence between the indication information corresponding to the active port and the service feature information in the packet outputted from the active port to the mapping relationship table.
  • mapping between the mapping information corresponding to the active port and the service feature information in the packet is saved in the mapping relationship table in order to continuously improve the mapping relationship table, that is, when the packet containing the service feature information arrives next time, it can directly
  • the corresponding indication information is found in the mapping relationship table, and the offload output processing is performed.
  • the mapping relationship table includes a plurality of entries, each of the entries identifying a service feature information and an identifier of the indication information uniquely corresponding to the service feature information;
  • the method also includes:
  • Step 26 Set an update period for each of the entries starting from a settling time of each entry, and if the packet containing the service feature information of the entry is not received in the update period, the mapping relationship is obtained. The entry is deleted in the table. If the packet containing the service feature information of the entry is received in the update period, the update period of the entry is reset based on the time when the packet is received.
  • the mapping relationship table is composed of a plurality of entries, each of which is composed of a service feature information and an identifier of the indication information corresponding to the service feature information, where the identifier of the indication information is generally indication information.
  • the number further can be the number of the action bucket. That is, one service feature information corresponds to a uniquely determined action bucket number.
  • the step of setting the update period for each entry may be implemented by software control or hardware control; hardware control, for example, setting an aging timer for each entry, and the aging timer is the update cycle time. Further, the aging timer is set for each entry, and the packet containing the service feature information of the entry is not received in the update period.
  • the entry is deleted in the mapping relationship table, and if the packet containing the service feature information is received, the entry related to the service feature information is re-established in the mapping relationship table; if the table is included in the update period
  • the update period of the entry is reset based on the time when the packet is received.
  • the update period of the reset entry may be the same as or different from the original update cycle. Different situations are generally implemented by software control, and software and hardware can be implemented for the same situation.
  • the setting of the update period can ensure the real-time performance of the corresponding relationship in the mapping relationship table, and also avoids the storage burden caused by storing too much data, thereby avoiding affecting the network running speed.
  • the method further includes:
  • Step 27 Point the preset field to other indication information according to the second preset rule.
  • the preset field is directed to the default indication information, in a communication process, there are more cases of packet transmission, so the default indication information cannot only point to the same indication information, for example, the first packet comes over.
  • the mapping relationship table fails to be searched, the preset field points to the first indication information, and the first message is output according to the above process of the present invention; when the second message arrives, the mapping relationship table also fails to be searched, and if the preset field is still Pointing to the first indication information (ie, corresponding to the same output port), the second packet is also outputted from the same port as the first packet, and fewer packets have no effect on the transmission process, but with the number of packets If the number of ports is congested and the other port is idle, the effect of the offloading is not achieved.
  • the second preset rule is used. Point the preset field to another indication.
  • the second preset rule is to perform polling selection according to the number of the indication information.
  • the second preset rule is consistent with the first preset rule, that is, the current preset field points to the number 1, and after the message is output, the preset field is changed to point number 2, and so on.
  • the maximum number is then re-pointed to the lowest number to achieve a loop.
  • the number may be the number of the indication information or the number of the action bucket, and the principle thereof is consistent with the first preset rule, and the description is not repeated here.
  • the indication information indicating that the packet is output from the newly added egress port is correspondingly increased. Further, if the number of output ports is originally four, and one output port is added as the output port 5, an indication information is added correspondingly, and the indication information indicates that the message is output from the output port 5.
  • a motion bucket is added to place the newly added indication information; and the number of the action bucket is added to the value range of the preset field, that is, the preset field points to the action bucket 4 and does not jump to the action bucket 1 but Pointing to the action bucket 5, and then pointing to the action bucket 1, so that when the service feature information of the packet fails to be searched in the mapping relationship table, it is possible to output from the output port 5, thereby incorporating the newly added output port into the offload task. Reduce the burden on other output ports.
  • Figure 3 shows the network architecture of the SDN network.
  • Port 1 is the inbound port of the packet, and ports 2, 3, and 4 are the egress ports to be used for the offloading.
  • the type of the group table, the action in the action bucket, and the correspondence between the result of the selection algorithm and the action bucket are required.
  • the pre-processing is performed to form a group table for offloading the packet, and then the packet is processed (split).
  • the method for processing the packet specifically includes:
  • Step 31 Set the group type of the group entry in the group table to Select
  • Step 32 Define an action in the action bucket to output a message from the egress port
  • Step 33 Define a action bucket according to the number of ports to be divided into the flow, and the corresponding relationship between the action bucket and the result of the group table selection algorithm, and the action in the action bucket is to output the packet through different outbound ports;
  • Step 34 Construct a mapping relationship table between the service feature value and the action bucket according to different service characteristics, and initialize the table as an empty table;
  • the service feature value uses the source MAC address of the packet, and the hash table is used to represent the mapping relationship between the service feature value and the action bucket.
  • Step 35 Set a Flag field (preset field) to represent a default action bucket when the action bucket is not found in the mapping relationship table, and initialize the Flag field to a minimum action bucket number to participate in the splitting;
  • the initial Flag field is 1.
  • Step 36 Obtain a packet from the ingress port of the switch.
  • Step 37 After receiving the packet, extract the service feature value from the packet; then, use the service feature value as an input to search the mapping relationship table;
  • Step 38 If the search succeeds, output the packet from the egress port according to the action in the found action bucket; and update the aging timer of the entry in the mapping relationship table;
  • Step 39 If the search fails, determine whether the corresponding field of the action in the action bucket in the Flag field is active;
  • Step 40 if the outgoing port is active, the packet is output from the corresponding egress port, and step 41 is performed;
  • Step 41 the correspondence between the service feature value and the action bucket is inserted into the mapping relationship table, and an aging timer is set, and step 42 is performed;
  • Step 42 Point the Flag field to the next action bucket, and determine whether the action bucket number is greater than the maximum action bucket number
  • Step 43 If greater than the maximum action bucket number, set the Flag field to point to the minimum action bucket number
  • Step 44 if the outgoing port is not active, the Flag field points to the next action bucket, and step 45 is performed;
  • Step 45 it is determined whether the action bucket number is greater than the maximum bucket number, if less, then return to step 39; if greater, then step 46;
  • step 46 the Flag field is pointed to the minimum action bucket number and returns to step 39.
  • the aging time of the aging timer can be set according to the actual usage scenario. In this example, the aging time is 180s.
  • the mapping table is empty, so the search fails. Because the Flag field is 1, the action corresponding to the action in bucket #1 is determined. Port 2 is active, and the packet is output from the outbound port 2; the mapping between the source MAC address of the packet 01 00 5E 37 00 48 and the action bucket number 1 is inserted into the mapping relationship table, and the aging timer 180s is set; finally, the Flag field is set. Point to the next action bucket, then the Flag is 2, and it is found that the value of the Flag field is not greater than the maximum action bucket number 3 to be involved in the splitting; if the source MAC address is again received within 180s, the source MAC address is 01 00 5E 37 00 48.
  • the device searches for the aging timer of the source MAC address entry in the mapping table and performs the action in the corresponding action bucket to remove the packet from the egress port. 2 output. If the packet whose source MAC address is 01 00 5E 37 00 48 is not received within 180s, the aging timer of the entry with the source MAC address of 01 00 5E 37 00 48 in the mapping table expires. This table is in the mapping table. The entry will be deleted. After receiving the packet with the source MAC address of 01 00 5E 37 00 48, the entry with the source MAC address of 01 00 5E 37 00 48 will be reconstructed in the mapping table.
  • the search for the mapping table fails, and it is determined that the outgoing port 3 corresponding to the action in the action bucket number 2 specified by the Flag field is active, and the packet is sent out.
  • Port 3 output; insert the correspondence between the source MAC address of the packet 01 00 5E 37 00 49 and the action bucket number 2 into the mapping relationship table, and set the aging timer 180s; finally, point the Flag field to the next action bucket, at this time, Flag If it is 3, it is judged that the value of the Flag field is not greater than the maximum action bucket number 3 to be involved in the shunt.
  • the mapping of the mapping table fails, and the outbound port 4 corresponding to the action in the action bucket number 3 specified by the Flag field is active, and the packet is sent out.
  • Port 4 output; insert the correspondence between the source MAC address of the packet 01 00 5E 37 00 4A and the action bucket number 3 into the mapping relationship table, and set the aging timer 180s; finally, point the Flag field to the next action bucket, at this time, Flag If it is 4, it is judged that the value of the Flag field is greater than the maximum action bucket number 3 to be involved in the split, and the Flag field is set to the minimum action bucket number 1.
  • the following 20 packets of different source MAC addresses are sequentially input into the OpenFlow switch, and the correspondence between the source MAC address and the action bucket and the outbound port of the packet are as shown in Table 2.
  • the packet offloading method of an OpenFlow switch solves the limitation of the existing offloading method in an application scenario.
  • the invention is simple and easy to implement, and fully utilizes the characteristics of the group table in the OpenFlow switch, and can easily cope with the increase of the number of outgoing ports, not only can successfully implement packet shunting, but also can adopt different service feature values according to different service characteristics.
  • the input of the group table selection algorithm selects the port output message to provide a favorable basis for the application of SDN in different fields.
  • Embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the embodiment of the present invention further provides a packet processing apparatus, which includes:
  • the information obtaining module 51 is configured to receive the packet, and obtain service characteristic information related to the service from the packet;
  • the determining module 52 is configured to determine, according to the service feature information, indication information corresponding to the service feature information;
  • the first output module 53 is configured to output the message from an output port according to the indication of the indication information.
  • the determining module 52 in the foregoing embodiment of the present invention includes:
  • the determining submodule is configured to, according to the service feature information, look up the indication information that is uniquely corresponding to the service feature information from the mapping relationship table between the service feature information and the action bucket.
  • processing apparatus in the above embodiment of the present invention further includes:
  • An obtaining module configured to obtain a preset field if a motion bucket uniquely corresponding to the service feature information is not found in the mapping relationship table
  • a port obtaining module configured to determine indication information pointed by the preset field, and obtain an output port of the message outputted by the indication information
  • a second output module configured to output the message by using the active port if the output port is an active port
  • a third output module configured to: if the output port is an inactive port, select other indication information according to the first preset rule, and determine an output port of the output packet indicated by the other indication information until the output port is An active port that outputs the message by using the active port.
  • processing apparatus in the above embodiment of the present invention further includes:
  • the saving module is configured to save the correspondence between the indication information corresponding to the active port and the service feature information in the packet to the mapping relationship table.
  • mapping relationship table in the foregoing embodiment of the present invention includes a plurality of entries, each of the entries identifying a service feature information and an identifier of the indication information uniquely corresponding to the service feature information;
  • the device also includes:
  • An update module configured to set an update period for each of the entries starting from a setup time of each entry, if The packet that contains the service feature information of the entry is not received in the update period, and the entry is deleted from the mapping relationship table. If the packet containing the service feature information of the entry is received in the update period, The update period of the entry is reset based on the time when the packet is received.
  • processing apparatus in the above embodiment of the present invention further includes:
  • Pointing to the module set to point the preset field to other indication information according to the second preset rule.
  • the indication information in the foregoing embodiment of the present invention is saved in a action bucket of an OpenFlow switch.
  • processing device further includes:
  • a new module is set to increase the indication of the output of the packet from the newly added outbound port when the output port of the OpenFlow switch is added.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the foregoing embodiments of the present invention can be applied to the field of network communication technologies, so that the output port of the packet is determined according to the service characteristics of different application domains of the packet, and the packet is offloaded, and the software defines the network in different fields.
  • the application provides a favorable basis for expanding the range of applications for software-defined networks.

Abstract

Provided are a packet processing method and device. The processing method comprises: receiving a packet, and acquiring service feature information related to a service from the packet; according to the service feature information, determining indication information corresponding to the service feature information; and according to an instruction of the indication information, outputting the packet from an output port. By means of the embodiments of the present invention, an OpenFlow switch can determine different indication information according to different service feature information in a packet through a pre-stored correlation between service feature information and indication information and output the packet according to an instruction of the indication information, thereby realizing determining packet output ports according to service characteristics of different application fields of packets, realizing the shunting of packets, providing a favorable basis for the application of a software defined network for different fields, and expanding the application range of the software defined network.

Description

一种报文的处理方法及装置Message processing method and device 技术领域Technical field
本发明涉及网络通信技术领域,特别涉及一种报文的处理方法及装置。The present invention relates to the field of network communication technologies, and in particular, to a packet processing method and apparatus.
背景技术Background technique
软件定义网络SDN是一种新型网络创新架构,其核心理念是控制面与转发面的分离。基本的SDN网络包括:控制面的网络控制器(Controller)和转发面的OpenFlow交换机,分别实现控制功能和数据转发功能。OpenFlow交换机包括一个或多个流表(Flow Table)和一个组表(Group Table)来执行报文的查找和转发,以及一个信道用来与网络控制器进行通信。具体的,OpenFlow交换机的组表由一系列组表项组成,组表项包括组标识(Group Identifier)、组类型(Group Type)、计数器(Counters)和行动桶(Action Buckets)。当组类型为All时,执行所有行动桶中行动;当组类型为Select时,执行其中一个行动桶中行动;当组类型为Indirect时,执行指定行动桶中行动;当组类型为Fast Failover时,执行第一个活动的行动桶中行动。Software-defined network SDN is a new type of network innovation architecture. Its core concept is the separation of control plane and forwarding plane. The basic SDN network includes: a network controller (Controller) on the control plane and an OpenFlow switch on the forwarding plane, which implement control functions and data forwarding functions, respectively. The OpenFlow switch includes one or more Flow Tables and a Group Table to perform packet lookup and forwarding, and a channel for communicating with the network controller. Specifically, the group table of the OpenFlow switch is composed of a series of group entries, including a group identifier, a group type, a counter, and an action bucket. When the group type is All, perform actions in all action buckets; when the group type is Select, perform actions in one of the action buckets; when the group type is Indirect, perform actions in the specified action bucket; when the group type is Fast Failover , the action in the action bucket of the first activity.
目前,SDN网络中OpenFlow交换机的报文分流方法主要是以报文为单位选择相应出端口输出报文。但是,这种分流方法没有考虑不同应用领域的业务特点的影响。例如,在宽带接入等领域,需要确保报文根据一种建链关系始终从同一出端口输出,目前的分流方法就无法满足这种需要。At present, the packet offloading method of the OpenFlow switch in the SDN network mainly selects the corresponding outbound port output packet in the unit of the packet. However, this method of shunting does not take into account the impact of business characteristics in different application areas. For example, in the field of broadband access, it is necessary to ensure that packets are always output from the same port according to a link-building relationship. The current shunting method cannot meet this requirement.
发明内容Summary of the invention
本发明实施例的目的在于提供一种报文的处理方法及装置,解决SDN网络中OpenFlow交换机的报文分流方法无法满足不同应用领域的业务特点导致的分流不佳的问题。The object of the embodiments of the present invention is to provide a method and a device for processing a packet, which solves the problem that the packet offloading method of the OpenFlow switch in the SDN network cannot meet the service characteristics of different application domains.
为了达到上述目的,本发明实施例提供一种报文的处理方法,包括:In order to achieve the above object, an embodiment of the present invention provides a method for processing a packet, including:
接收报文,并从报文中获取与业务相关的业务特征信息;Receiving a message, and obtaining service characteristic information related to the service from the message;
根据所述业务特征信息,确定与所述业务特征信息对应的指示信息;Determining, according to the service feature information, indication information corresponding to the service feature information;
根据所述指示信息的指示从一输出端口输出所述报文。And outputting the message from an output port according to the indication of the indication information.
其中,根据所述业务特征信息,确定与所述业务特征信息对应的指示信息的步骤包括:The step of determining the indication information corresponding to the service feature information according to the service feature information includes:
根据所述业务特征信息,从所述业务特征信息与指示信息的映射关系表中查找与所述业务特征信息唯一对应的指示信息。And indicating, according to the service feature information, the indication information that is uniquely corresponding to the service feature information from the mapping relationship table between the service feature information and the indication information.
其中,若从所述映射关系表中查找不到与所述业务特征信息唯一对应的指示信息,所述方法还包括: The method further includes: if the indication information that uniquely corresponds to the service feature information is not found from the mapping relationship table, the method further includes:
获取一预设字段;Get a preset field;
确定所述预设字段指向的指示信息,并获取所述指示信息指示的输出所述报文的输出端口;Determining the indication information pointed by the preset field, and acquiring an output port of the message indicated by the indication information;
若所述输出端口为活跃端口,利用所述活跃端口输出所述报文;If the output port is an active port, outputting the packet by using the active port;
若所述输出端口为不活跃端口,根据第一预设规则选择其他指示信息,并确定所述其他指示信息指示的输出报文的输出端口,直到所述输出端口为活跃端口,利用所述活跃端口输出所述报文。If the output port is an inactive port, select other indication information according to the first preset rule, and determine an output port of the output packet indicated by the other indication information, until the output port is an active port, and use the active The port outputs the message.
其中,利用所述活跃端口输出所述报文后,所述方法还包括:The method further includes: after the outputting the packet by using the active port, the method further includes:
将所述活跃端口对应的指示信息与从该活跃端口输出的所述报文中的业务特征信息的对应关系保存至所述映射关系表中。And saving the correspondence between the indication information corresponding to the active port and the service feature information in the packet output from the active port to the mapping relationship table.
其中,所述映射关系表包括多个表项,每个所述表项标识一个业务特征信息以及与所述业务特征信息唯一对应的指示信息的标识;The mapping relationship table includes a plurality of entries, each of the entries identifying a service feature information and an identifier of the indication information uniquely corresponding to the service feature information;
以每个表项的建立时间为起点为每个所述表项设置更新周期,若所述更新周期内未收到包含该表项的业务特征信息的报文,从所述映射关系表中删除该表项;若所述更新周期内收到包含该表项的业务特征信息的报文,以收到该报文的时间为起点重新设置该表项的更新周期。An update period is set for each of the entries, and the packet containing the service feature information of the entry is not received from the mapping relationship table. The entry is: if the packet containing the service feature information of the entry is received in the update period, the update period of the entry is reset by using the time of receiving the packet as a starting point.
其中,将对应关系保存至所述映射关系表中后,所述方法还包括:After the correspondence is saved in the mapping relationship table, the method further includes:
按照第二预设规则,将所述预设字段指向其他指示信息。According to the second preset rule, the preset field is pointed to other indication information.
其中,所述指示信息保存于OpenFlow交换机的行动桶中。The indication information is saved in a action bucket of the OpenFlow switch.
其中,当OpenFlow交换机的输出端口增加时,相应增加指示从新增的出端口输出报文的指示信息。When the output port of the OpenFlow switch is increased, the indication information indicating that the packet is output from the newly added out port is correspondingly increased.
本发明实施例还提供一种报文的处理装置,包括:An embodiment of the present invention further provides a packet processing apparatus, including:
信息获取模块,设置为接收报文,并从报文中获取与业务相关的业务特征信息;The information acquiring module is configured to receive the packet, and obtain service characteristic information related to the service from the packet;
确定模块,设置为根据所述业务特征信息,确定与所述业务特征信息对应的指示信息;a determining module, configured to determine, according to the service feature information, indication information corresponding to the service feature information;
第一输出模块,设置为根据所述指示信息的指示从一输出端口输出所述报文。The first output module is configured to output the message from an output port according to the indication of the indication information.
其中,所述确定模块包括:The determining module includes:
确定子模块,设置为根据所述业务特征信息,从所述业务特征信息与行动桶的映射关系表中查找与所述业务特征信息唯一对应的指示信息。The determining submodule is configured to, according to the service feature information, look up the indication information that is uniquely corresponding to the service feature information from the mapping relationship table between the service feature information and the action bucket.
其中,所述处理装置还包括: The processing device further includes:
获取模块,设置为若从所述映射关系表中查找不到与所述业务特征信息唯一对应的指示信息,获取一预设字段;Obtaining a module, configured to obtain a preset field if the indication information uniquely corresponding to the service feature information is not found in the mapping relationship table;
端口获取模块,设置为确定预设字段指向的指示信息,并获取所述指示信息指示的输出所述报文的输出端口;a port obtaining module, configured to determine indication information pointed by the preset field, and obtain an output port of the message outputted by the indication information;
第二输出模块,设置为若所述输出端口为活跃端口,利用所述活跃端口输出所述报文;a second output module, configured to output the message by using the active port if the output port is an active port;
第三输出模块,设置为若所述输出端口为不活跃端口,根据第一预设规则选择其他指示信息,并确定所述其他指示信息指示的输出报文的输出端口,直到所述输出端口为活跃端口,利用所述活跃端口输出所述报文。a third output module, configured to: if the output port is an inactive port, select other indication information according to the first preset rule, and determine an output port of the output packet indicated by the other indication information until the output port is An active port that outputs the message by using the active port.
其中,所述处理装置还包括:The processing device further includes:
保存模块,设置为将所述活跃端口对应的指示信息与从该活跃端口输出的所述报文中的业务特征信息的对应关系保存至所述映射关系表中。The saving module is configured to save the correspondence between the indication information corresponding to the active port and the service feature information in the packet output from the active port to the mapping relationship table.
其中,所述映射关系表包括多个表项,每个所述表项标识一个业务特征信息以及与所述业务特征信息唯一对应的指示信息的标识;The mapping relationship table includes a plurality of entries, each of the entries identifying a service feature information and an identifier of the indication information uniquely corresponding to the service feature information;
所述装置还包括:The device also includes:
更新模块,设置为以每个表项的建立时间为起点为每个所述表项设置更新周期,若所述更新周期内未收到包含该表项的业务特征信息的报文,从所述映射关系表中删除该表项;若所述更新周期内收到包含该表项的业务特征信息的报文,以收到该报文的时间为起点重新设置该表项的更新周期。An update module, configured to set an update period for each of the entries starting from a settling time of each entry, and if the packet containing the service feature information of the entry is not received in the update period, The entry is deleted in the mapping relationship table. If the packet containing the service feature information of the entry is received in the update period, the update period of the entry is reset based on the time when the packet is received.
其中,所述处理装置还包括:The processing device further includes:
指向模块,设置为按照第二预设规则,将所述预设字段指向其他指示信息。Pointing to the module, set to point the preset field to other indication information according to the second preset rule.
其中,所述指示信息保存于OpenFlow交换机的行动桶中。The indication information is saved in a action bucket of the OpenFlow switch.
其中,所述处理装置还包括:The processing device further includes:
新增模块,设置为当OpenFlow交换机的输出端口增加时,相应增加指示从新增的出端口输出报文的指示信息。A new module is set to increase the indication of the output of the packet from the newly added outbound port when the output port of the OpenFlow switch is added.
本发明实施例的上述技术方案至少具有如下有益效果:The above technical solutions of the embodiments of the present invention have at least the following beneficial effects:
本发明实施例的报文的处理方法及装置中,通过预先存储的业务特征信息与指示信息的对应关系,使得OpenFlow交换机能够根据报文中不同的业务特征信息,确定不同的指示信息并根据指示信息的指示输出报文;进一步使得具有同一业务特征信息的报文能够从同一指示信息指示的同一输出端口输出;从而实现了根据报文的不同的应用领域的业务特点来确定报文的输出端口,实现报文的分流,为软件定义网络在不同领域的应用提供有利基础,扩大软件定义网络的应用范围。 In the method and device for processing a message according to the embodiment of the present invention, the OpenFlow switch can determine different indication information according to different service feature information in the packet according to the corresponding relationship between the service feature information and the indication information. The indication of the information is outputted by the message; the message having the same service feature information can be outputted from the same output port indicated by the same indication information; thereby, the output port of the message is determined according to the service characteristics of different application areas of the message. The implementation of packet shunting provides a favorable basis for software-defined networks in different fields and expands the application scope of software-defined networks.
附图说明DRAWINGS
图1表示本发明实施例提供的报文的处理方法的基本步骤示意图;FIG. 1 is a schematic diagram showing the basic steps of a method for processing a packet according to an embodiment of the present invention;
图2表示本发明实施例提供的报文的处理方法中查到不到指示信息时后续的具体步骤流程图;FIG. 2 is a flowchart showing specific steps subsequent to the process of processing a packet according to an embodiment of the present invention;
图3表示软件定义网路SDN的网络架构图;Figure 3 shows a network architecture diagram of a software-defined network SDN;
图4表示本发明提供的报文的处理方法在OpenFlow交换机中的具体应用流程图;4 is a flowchart showing a specific application process of a packet processing method provided by the present invention in an OpenFlow switch;
图5表示本发明实施例提供的报文的处理装置的组成结构图。FIG. 5 is a structural diagram showing the structure of a message processing apparatus according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。The technical problems, the technical solutions, and the advantages of the present invention will be more clearly described in the following description.
本发明针对现有技术中SDN网络中OpenFlow交换机的报文分流方法无法满足不同应用领域的业务特点导致的分流不佳的问题,提供一种报文的处理方法及装置,通过预先存储的业务特征信息与指示信息的对应关系,使得OpenFlow交换机能够根据报文中不同的业务特征信息,确定不同的指示信息并根据指示信息的指示输出报文;进一步使得具有同一业务特征信息的报文能够从同一指示信息指示的同一输出端口输出;从而实现了根据报文的不同的应用领域的业务特点来确定报文的输出端口,实现报文的分流,为软件定义网络在不同领域的应用提供有利基础,扩大软件定义网络的应用范围。The present invention is directed to the problem that the packet offloading method of the OpenFlow switch in the SDN network in the prior art cannot meet the problem of poor traffic distribution caused by the service characteristics of different application domains, and provides a packet processing method and device, which are pre-stored service features. The correspondence between the information and the indication information enables the OpenFlow switch to determine different indication information according to different service characteristic information in the packet and output the packet according to the indication of the indication information; further enable the packets having the same service characteristic information to be the same The output of the same output port indicated by the indication information is implemented. Therefore, the output port of the packet is determined according to the service characteristics of different application areas of the packet, and the packet is offloaded, thereby providing a favorable foundation for the application of the software-defined network in different fields. Expand the scope of application of software-defined networks.
如图1所示,本发明实施例提供一种报文的处理方法,包括:As shown in FIG. 1 , an embodiment of the present invention provides a method for processing a packet, including:
步骤11,接收报文,并从报文中获取与业务相关的业务特征信息;Step 11: Receive a packet, and obtain service characteristic information related to the service from the packet.
步骤12,根据所述业务特征信息,确定与所述业务特征信息对应的指示信息;Step 12: Determine, according to the service feature information, indication information corresponding to the service feature information;
步骤13,根据所述指示信息的指示从一输出端口输出所述报文。Step 13: Output the message from an output port according to the indication of the indication information.
本发明的上述实施例中,报文中携带能够表述业务特点的字段,不同的业务可以选择报文中的不同字段作为业务特征信息,建立不同的映射关系表。例如,针对A类业务,选择报文中的源MAC地址作为业务特征信息,建立映射关系表,只要源MAC地址相同则确定为同一用户的相同业务,可以从同一输出端口输出;再例如,针对B类业务,选择报文中的源MAC地址和协议值共同作为业务特征信息,建立映射关系表,当源MAC地址和协议值均相同确定为同一用户的相同业务,从同一输出端口输出报文。即收到报文后,根据业务类型来选择不同的业务特征信息,查找不同的映射关系表,从而实现多业务。其中,上述指示信息为用于指示从一输出端口输出报文,通过不同的指示信息实现从不同的输出端口输出报文。本发明的具体实施例中,基于软件定义网络SDN的OpenFlow交换机环境下对本发明实施例提供的报文的处理方法进行具体描述。即所述指示信息保存于OpenFlow交换机的行动桶中。从而本 发明上述实施例的步骤12,具体为,根据所述业务特征信息,确定与所述业务特征信息对应的行动桶,其中,该行动桶中包含所述指示信息,该指示信息为通过哪个输出端口输出所述报文。即OpenFlow交换机中,上述映射关系表保存的是业务特征信息与行动桶的对应关系;进一步的,为了查找方便可设置多个映射关系表,将不同的业务特征信息保存不同的映射关系表中,例如一个映射关系表中保存源MAC地址与行动桶的对应关系,另一个映射关系表中保存协议值与行动桶的对应关系;但是将不同的业务特征信息保存至一个映射关系表的实施例也能够实现本发明的查找对应的目的,故其具体的保存方式可根据存储数据的大小以及存储空间的设置来具体确定,不限于一固定方式。本发明实施例提供的报文分流的处理方法可以根据不同应用领域的业务特点来实现报文的输出,满足了报文分流与不同业务特点的适配,为SDN网络在不同领域的应用提供有利基础,扩大其应用范围。进一步的,业务特征信息可以但不限于MAC地址、协议值、Session ID等字段及其组合字段,在此不作具体限定。In the foregoing embodiment of the present invention, the packet carries a field capable of expressing the service feature, and different services may select different fields in the packet as the service feature information to establish different mapping relationship tables. For example, for the type A service, the source MAC address in the packet is selected as the service feature information, and the mapping relationship table is established. If the source MAC address is the same, the same service of the same user is determined, and the same output port can be output; for example, for In the B-type service, the source MAC address and the protocol value in the selected packet are used as the service feature information to establish a mapping relationship table. When the source MAC address and the protocol value are the same, the same service is determined as the same user, and the packets are output from the same output port. . That is, after the packet is received, different service feature information is selected according to the service type, and different mapping relationship tables are searched to implement multiple services. The indication information is used to indicate that the message is output from an output port, and the message is output from different output ports by using different indication information. In the specific embodiment of the present invention, a method for processing a packet provided by an embodiment of the present invention is specifically described in an OpenFlow switch environment based on a software-defined network SDN. That is, the indication information is saved in a action bucket of the OpenFlow switch. Thus In the step 12 of the foregoing embodiment, the action bucket corresponding to the service feature information is determined according to the service feature information, where the action bucket includes the indication information, and the indication information is through which output port The message is output. That is, in the OpenFlow switch, the mapping relationship table stores the correspondence between the service feature information and the action bucket. Further, in order to facilitate the search, a plurality of mapping relationship tables may be set, and different service feature information is saved in different mapping relationship tables. For example, a mapping relationship table stores a correspondence between a source MAC address and a action bucket, and another mapping relationship table stores a correspondence between a protocol value and a action bucket; however, an embodiment in which different service feature information is saved to a mapping relationship table is also The purpose of the search corresponding to the present invention can be achieved. Therefore, the specific storage manner can be specifically determined according to the size of the stored data and the setting of the storage space, and is not limited to a fixed manner. The method for processing the packet offloading provided by the embodiment of the present invention can implement the output of the packet according to the service features of different application domains, and meets the adaptation of the packet offloading and different service features, and provides favorable applications for the SDN network in different fields. Foundation to expand its range of applications. Further, the service feature information may be, but is not limited to, a MAC address, a protocol value, a session ID, and the like, and a combination thereof, and is not specifically limited herein.
较佳的,本发明实施例提供的报文的处理方法能够根据业务特征信息选择输出端口输出报文,从而实现报文的分流;且能够实现将业务特征信息相同的报文始终从一个确定的输出端口输出。比如,一个业务选择报文的源MAC地址作为业务特征信息,那么收到报文后,从报文中获取源MAC地址,根据源MAC地址查找映射关系表,根据查表结果将报文从唯一确定的输出端口输出,下次再收到此源MAC地址的报文仍然能够从这个输出端口输出该报文。Preferably, the method for processing a packet according to the embodiment of the present invention can select an output port to output a packet according to the service feature information, thereby implementing packet offloading, and can implement the packet with the same service feature information from a certain determination. Output port output. For example, the source MAC address of a service selection packet is used as the service feature information. After receiving the packet, the source MAC address is obtained from the packet, and the mapping table is searched according to the source MAC address. The output of the determined output port can still output the message from the output port after receiving the message of the source MAC address next time.
进一步地,本发明的上述实施例中步骤12包括:Further, step 12 in the above embodiment of the present invention includes:
步骤121,根据所述业务特征信息,从所述业务特征信息与指示信息的映射关系表中查找与所述业务特征信息唯一对应的指示信息。Step 121: Search, according to the service feature information, the indication information that is uniquely corresponding to the service feature information from the mapping relationship table between the service feature information and the indication information.
其中,映射关系表可以为根据业务特性预先设定,也可以根据在通信过程一一添加,例如,该映射关系表的初始化为空,则在第一个报文输出后,将该报文的业务特征信息与其指示信息的对应关系保存至映射关系表,依次类推,每输出一个报文,则在映射关系表中增加一组对应关系,不断完善该映射关系表;或者再例如,该映射关系表的初始化不为空,该映射关系表的初始化中保存一些常用的业务特征信息与常用的指示信息的对应关系,当然,该种方式的后续也可采用上述的逐渐添加对应关系的方法来不断完善映射关系表。同上,该方法应用至SDN网络中,则该步骤121具体为:根据所述业务特征信息,从所述业务特征信息与行动桶的映射关系表中查找与所述业务特征信息唯一对应的行动桶,该行动桶中包含其指示信息。采用映射关系表保存对应关系的方式能够使得其保存内容易于管理,查找简单快捷。The mapping relationship table may be preset according to the service characteristics, or may be added one by one according to the communication process. For example, if the initialization of the mapping relationship table is empty, after the first packet is output, the packet is The correspondence between the service feature information and the indication information is saved to the mapping relationship table, and so on. Each time a message is output, a corresponding relationship is added to the mapping relationship table, and the mapping relationship table is continuously improved; or, for example, the mapping relationship The initialization of the table is not empty. The mapping between the common service feature information and the commonly used indication information is saved in the initialization of the mapping relationship table. Of course, the method of gradually adding the corresponding relationship may be continuously used in the following manner. Improve the mapping relationship table. In the same manner, the method is applied to the SDN network, and the step 121 is specifically: searching, according to the service feature information, a action bucket that uniquely corresponds to the service feature information from the mapping relationship table between the service feature information and the action bucket. The action bucket contains its instructions. The way to save the corresponding relationship by using the mapping relationship table can make the saved content easy to manage, and the searching is simple and fast.
较佳的,该映射关系表需要保证每个业务特征信息有唯一确定的行动桶与之对应,可以采用哈希表(hash表)等算法来实现。Preferably, the mapping relationship table needs to ensure that each service feature information has a uniquely determined action bucket corresponding thereto, and can be implemented by using an algorithm such as a hash table.
进一步的,本发明提供的上述实施例中,若从所述映射关系表中查找不到与所述业务特征信息对应的指示信息,如图2所示,所述方法还包括:Further, in the foregoing embodiment provided by the present invention, if the indication information corresponding to the service feature information is not found in the mapping relationship table, as shown in FIG. 2, the method further includes:
步骤21,获取一预设字段;Step 21: Obtain a preset field.
步骤22,确定所述预设字段指向的指示信息,并获取所述指示信息指示的输出所述报文 的输出端口;Step 22: Determine indication information pointed by the preset field, and obtain an output of the packet indicated by the indication information. Output port;
步骤23,若所述输出端口为活跃端口,利用所述活跃端口输出所述报文;Step 23: If the output port is an active port, output the packet by using the active port.
步骤24,若所述输出端口为不活跃端口,根据第一预设规则选择其他指示信息,并确定所述其他指示信息指示的输出报文的输出端口,直到所述输出端口为活跃端口,利用所述活跃端口输出所述报文。Step 24: If the output port is an inactive port, select other indication information according to the first preset rule, and determine an output port of the output packet indicated by the other indication information until the output port is an active port, and use The active port outputs the message.
本发明的上述实施例中,由于映射关系表中可能存在查找不到业务特征信息对应的指示信息的情况,则该情况下,本发明实施例设置一预设字段(Flag字段),该Flag字段代表在映射关系表中查不到指示信息时的默认指示信息,进一步地,该指示信息保存于行动桶中,即该Flag字段代表在映射关系表中查不到行动桶时的默认行动桶,初始化Flag字段为欲参与分流的最小行动桶号。较佳的,即当查找失败时,判断Flag字段指定行动桶中行动对应的出端口是否活跃,如出端口活跃,将报文从对应出端口输出,如出端口不活跃,Flag字段指向下一个行动桶,直到选择的行动桶中行动对应的出端口活跃,从活跃的端口将报文输出。In the foregoing embodiment of the present invention, in the case that the indication information corresponding to the service feature information cannot be found in the mapping relationship table, the embodiment of the present invention sets a preset field (Flag field), the Flag field. Representing the default indication information when the indication information is not found in the mapping relationship table. Further, the indication information is stored in the action bucket, that is, the Flag field represents a default action bucket when the action bucket is not found in the mapping relationship table. Initialize the Flag field to the minimum action bucket number to participate in the split. Preferably, when the search fails, it is determined whether the Flag field specifies whether the egress port corresponding to the action in the action bucket is active. If the egress port is active, the packet is output from the corresponding egress port. If the egress port is inactive, the Flag field points to the next one. The action bucket will be active until the outbound port corresponding to the action in the selected action bucket, and the message will be output from the active port.
其中,该第一预设规则为按照指示信息的编号进行轮询选择,即若指示信息包括:指示信息1、指示信息2、指示信息3以及指示信息4;则Flag字段初始指向指示信息1,当指示信息1对应的输出端口为非活跃端口时,Flag字段指向指示信息2,当指示信息2对应的输出端口为非活跃端口时,Flag字段指向指示信息3,当指示信息3对应的输出端口为非活跃端口时,Flag字段指向指示信息4,而当指示信息4对应的输出端口为非活跃端口时,Flag字段则重新指向指示信息1,以此类推,从而实现循环选择。较佳的,指示信息的编号也可以为行动桶的编号,原理与上述一致,不再重复描述。该轮询选择的方式是为了避免重复选择同一输出端口,达不到分流的效果。The first preset rule is that the polling selection is performed according to the number of the indication information, that is, if the indication information includes: indication information 1, indication information 2, indication information 3, and indication information 4; then the Flag field initially points to the indication information 1, When the output port corresponding to the indication information 1 is an inactive port, the Flag field points to the indication information 2. When the output port corresponding to the indication information 2 is an inactive port, the Flag field points to the indication information 3, and when the output port corresponding to the indication information 3 When it is an inactive port, the Flag field points to the indication information 4, and when the output port corresponding to the indication information 4 is an inactive port, the Flag field is redirected to the indication information 1, and so on, thereby implementing the round robin selection. Preferably, the number of the indication information may also be the number of the action bucket, and the principle is the same as the above, and the description is not repeated. The polling method is chosen to avoid repeatedly selecting the same output port and not achieving the effect of shunting.
进一步地,本发明的上述实施例中,利用所述活跃端口输出所述报文后,所述方法还包括:Further, in the foregoing embodiment of the present invention, after the message is output by using the active port, the method further includes:
步骤25,将所述活跃端口对应的指示信息与从该活跃端口输出的所述报文中的业务特征信息的对应关系保存至所述映射关系表中。Step 25: Save the correspondence between the indication information corresponding to the active port and the service feature information in the packet outputted from the active port to the mapping relationship table.
将活跃端口对应的指示信息与报文中的业务特征信息的对应关系保存至映射关系表中是为了不断完善映射关系表,即当下次有包含该业务特征信息的报文到来时,能够直接从映射关系表中查找到对应的指示信息,进行分流输出处理。The mapping between the mapping information corresponding to the active port and the service feature information in the packet is saved in the mapping relationship table in order to continuously improve the mapping relationship table, that is, when the packet containing the service feature information arrives next time, it can directly The corresponding indication information is found in the mapping relationship table, and the offload output processing is performed.
进一步的,本发明的上述实施例中,所述映射关系表包括多个表项,每个所述表项标识一个业务特征信息以及与所述业务特征信息唯一对应的指示信息的标识;上述处理方法还包括:Further, in the above embodiment of the present invention, the mapping relationship table includes a plurality of entries, each of the entries identifying a service feature information and an identifier of the indication information uniquely corresponding to the service feature information; The method also includes:
步骤26,以每个表项的建立时间为起点为每个所述表项设置更新周期,若所述更新周期内未收到包含该表项的业务特征信息的报文,从所述映射关系表中删除该表项;若所述更新周期内收到包含该表项的业务特征信息的报文,以收到该报文的时间为起点重新设置该表项的更新周期。 Step 26: Set an update period for each of the entries starting from a settling time of each entry, and if the packet containing the service feature information of the entry is not received in the update period, the mapping relationship is obtained. The entry is deleted in the table. If the packet containing the service feature information of the entry is received in the update period, the update period of the entry is reset based on the time when the packet is received.
本发明实施例中,映射关系表由多个表项组成,每个表项由一个业务特征信息以及与上述业务特征信息对应的指示信息的标识组成,其中,该指示信息的标识一般为指示信息的编号;进一步地可以为行动桶的编号。即一个业务特征信息对应一个唯一确定的行动桶编号。上述为每个表项设置更新周期的步骤可通过软件控制或硬件控制来实现;硬件控制,例如,为每个表项设置一老化定时器,老化定时器的时间即为更新周期的时间。进一步地,由于每个表项的建立时间不同,则针对每个表项设置不同的老化定时器,若所述更新周期内未收到包含该表项的业务特征信息的报文,从所述映射关系表中删除该表项,之后若收到包含该业务特征信息的报文,会在映射关系表中重新建立关于该业务特征信息的表项;若所述更新周期内收到包含该表项的业务特征信息的报文,以收到该报文的时间为起点重新设置该表项的更新周期,重新设置的该表项的更新周期与原先设置的更新周期可以相同也可以不同,对于不同的情况,一般通过软件控制实现,对于相同的情况采用软件、硬件均可实现。该更新周期的设置能够保证映射关系表中对应关系的实时性,也避免了存储过多数据带来的存储负担,从而避免其影响网络运行速度。In the embodiment of the present invention, the mapping relationship table is composed of a plurality of entries, each of which is composed of a service feature information and an identifier of the indication information corresponding to the service feature information, where the identifier of the indication information is generally indication information. The number; further can be the number of the action bucket. That is, one service feature information corresponds to a uniquely determined action bucket number. The step of setting the update period for each entry may be implemented by software control or hardware control; hardware control, for example, setting an aging timer for each entry, and the aging timer is the update cycle time. Further, the aging timer is set for each entry, and the packet containing the service feature information of the entry is not received in the update period. The entry is deleted in the mapping relationship table, and if the packet containing the service feature information is received, the entry related to the service feature information is re-established in the mapping relationship table; if the table is included in the update period For the packet of the service characteristic information of the item, the update period of the entry is reset based on the time when the packet is received. The update period of the reset entry may be the same as or different from the original update cycle. Different situations are generally implemented by software control, and software and hardware can be implemented for the same situation. The setting of the update period can ensure the real-time performance of the corresponding relationship in the mapping relationship table, and also avoids the storage burden caused by storing too much data, thereby avoiding affecting the network running speed.
进一步的,本发明的上述实施例中,将对应关系保存至所述映射关系表中后,所述方法还包括:Further, in the foregoing embodiment of the present invention, after the correspondence is saved in the mapping relationship table, the method further includes:
步骤27,按照第二预设规则,将所述预设字段指向其他指示信息。Step 27: Point the preset field to other indication information according to the second preset rule.
本发明实施例中,由于预设字段指向的是默认指示信息,一个通信过程中,会有较多报文传输的情况,故该默认指示信息不能仅指向同一指示信息,例如第一报文过来,映射关系表查找失败时,预设字段指向第一指示信息,按照本发明的上述过程输出第一报文后;第二报文过来,映射关系表也查找失败,此时若预设字段还指向第一指示信息(即对应同一输出端口),第二报文还会从与第一报文同样的端口输出,较少的报文对传输过程不会有影响,但随着报文数量的增多,会导致一个端口拥塞,另外的端口空闲的问题,达不到分流的效果;故在每一个采用预设字段指向的指示信息对应的输出端口输出报文后,利用第二预设规则,将预设字段指向另一个指示信息。所述第二预设规则为按照指示信息的编号进行轮询选择。较佳的,第二预设规则实际上与第一预设规则一致,即当前预设字段指向编号1,则输出报文后,将预设字段改为指向编号2,以此类推,在达到最大编号时再重新指向最小编号,从而实现循环。其中,该编号可以为指示信息的编号或者行动桶的编号,其原理与第一预设规则一致,在此不重复描述。In the embodiment of the present invention, since the preset field is directed to the default indication information, in a communication process, there are more cases of packet transmission, so the default indication information cannot only point to the same indication information, for example, the first packet comes over. When the mapping relationship table fails to be searched, the preset field points to the first indication information, and the first message is output according to the above process of the present invention; when the second message arrives, the mapping relationship table also fails to be searched, and if the preset field is still Pointing to the first indication information (ie, corresponding to the same output port), the second packet is also outputted from the same port as the first packet, and fewer packets have no effect on the transmission process, but with the number of packets If the number of ports is congested and the other port is idle, the effect of the offloading is not achieved. Therefore, after each output port corresponding to the indication information pointed to by the preset field outputs a message, the second preset rule is used. Point the preset field to another indication. The second preset rule is to perform polling selection according to the number of the indication information. Preferably, the second preset rule is consistent with the first preset rule, that is, the current preset field points to the number 1, and after the message is output, the preset field is changed to point number 2, and so on. The maximum number is then re-pointed to the lowest number to achieve a loop. The number may be the number of the indication information or the number of the action bucket, and the principle thereof is consistent with the first preset rule, and the description is not repeated here.
进一步的,本发明的上述实施例中当OpenFlow交换机的输出端口增加时,相应增加指示从新增的出端口输出报文的指示信息。进一步地,若输出端口的数量原先为4个,现增加一个输出端口为输出端口5,则相应的增加一个指示信息,该指示信息指示从输出端口5输出报文。即增加一个行动桶用来放置新增的上述指示信息;并且将行动桶的编号添加到预设字段的取值范围内,即预设字段指向行动桶4后不跳转到行动桶1而是指向行动桶5,继而再指向行动桶1,这样当有报文的业务特征信息在映射关系表中查找失败时,就有可能从输出端口5输出,从而将新增的输出端口纳入到分流任务中,减轻其他输出端口的负担。Further, in the foregoing embodiment of the present invention, when the output port of the OpenFlow switch is increased, the indication information indicating that the packet is output from the newly added egress port is correspondingly increased. Further, if the number of output ports is originally four, and one output port is added as the output port 5, an indication information is added correspondingly, and the indication information indicates that the message is output from the output port 5. That is, a motion bucket is added to place the newly added indication information; and the number of the action bucket is added to the value range of the preset field, that is, the preset field points to the action bucket 4 and does not jump to the action bucket 1 but Pointing to the action bucket 5, and then pointing to the action bucket 1, so that when the service feature information of the packet fails to be searched in the mapping relationship table, it is possible to output from the output port 5, thereby incorporating the newly added output port into the offload task. Reduce the burden on other output ports.
下面对本发明提供的报文的处理方法应用于SDN网络的OpenFlow交换机中的具体流程 进行详细描述:The following describes the specific process in the processing of the packet provided by the present invention in the OpenFlow switch of the SDN network. Detailed description:
如图3所示为SDN网络的网络架构图。其中,端口1为报文入端口,端口2、3、4为欲参与分流的出端口;本实施例中,需要对组表的类型、行动桶中行动以及选择算法结果与行动桶的对应关系进行预先处理,由此形成对报文进行分流的组表,再进行报文的处理(分流);进一步地,如图4所示,本发明实施例提供的报文的处理方法具体包括:Figure 3 shows the network architecture of the SDN network. Port 1 is the inbound port of the packet, and ports 2, 3, and 4 are the egress ports to be used for the offloading. In this embodiment, the type of the group table, the action in the action bucket, and the correspondence between the result of the selection algorithm and the action bucket are required. The pre-processing is performed to form a group table for offloading the packet, and then the packet is processed (split). Further, as shown in FIG. 4, the method for processing the packet according to the embodiment of the present invention specifically includes:
步骤31,设定组表中组表项的组类型为Select;Step 31: Set the group type of the group entry in the group table to Select;
步骤32,定义行动桶中行动为从出端口输出报文;Step 32: Define an action in the action bucket to output a message from the egress port;
步骤33,根据欲参与分流的端口数定义行动桶及其与组表选择算法结果的对应关系,行动桶中的行动为通过不同出端口输出报文;Step 33: Define a action bucket according to the number of ports to be divided into the flow, and the corresponding relationship between the action bucket and the result of the group table selection algorithm, and the action in the action bucket is to output the packet through different outbound ports;
在本实施例中,选择算法结果与行动桶的对应关系以及行动桶中行动内容如表1所示。In this embodiment, the correspondence between the selection algorithm result and the action bucket and the action content in the action bucket are as shown in Table 1.
Figure PCTCN2016077583-appb-000001
Figure PCTCN2016077583-appb-000001
表1行动桶与行动桶的行动的对应关系Table 1 Correspondence between action bucket and action bucket action
步骤34,根据不同业务特点构建业务特征值与行动桶的映射关系表,初始化此表为空表;Step 34: Construct a mapping relationship table between the service feature value and the action bucket according to different service characteristics, and initialize the table as an empty table;
本实施例中,业务特征值采用报文源MAC地址,采用hash表来表示业务特征值与行动桶的映射关系。In this embodiment, the service feature value uses the source MAC address of the packet, and the hash table is used to represent the mapping relationship between the service feature value and the action bucket.
步骤35,设置一个Flag字段(预设字段)代表在映射关系表中查不到行动桶时的默认行动桶,初始化Flag字段为欲参与分流的最小行动桶号;Step 35: Set a Flag field (preset field) to represent a default action bucket when the action bucket is not found in the mapping relationship table, and initialize the Flag field to a minimum action bucket number to participate in the splitting;
本实施例中,初始化Flag字段为1。In this embodiment, the initial Flag field is 1.
步骤36,从交换机入端口获取报文;Step 36: Obtain a packet from the ingress port of the switch.
步骤37,收到报文后,从报文中提取业务特征值;然后,将业务特征值作为输入,查找映射关系表;Step 37: After receiving the packet, extract the service feature value from the packet; then, use the service feature value as an input to search the mapping relationship table;
步骤38,如查找成功,按照查找到的行动桶中的行动,将报文从出端口输出;并更新映射关系表中此表项的老化定时器;Step 38: If the search succeeds, output the packet from the egress port according to the action in the found action bucket; and update the aging timer of the entry in the mapping relationship table;
步骤39,如查找失败,判断Flag字段指定行动桶中行动的对应出端口是否活跃;Step 39: If the search fails, determine whether the corresponding field of the action in the action bucket in the Flag field is active;
步骤40,如出端口活跃,将报文从对应出端口输出,并执行步骤41; Step 40, if the outgoing port is active, the packet is output from the corresponding egress port, and step 41 is performed;
步骤41,将业务特征值与行动桶的对应关系插入映射关系表,并设置老化定时器,并执行步骤42; Step 41, the correspondence between the service feature value and the action bucket is inserted into the mapping relationship table, and an aging timer is set, and step 42 is performed;
步骤42,将Flag字段指向下一个行动桶,并判断该行动桶号是否大于最大行动桶号;Step 42: Point the Flag field to the next action bucket, and determine whether the action bucket number is greater than the maximum action bucket number;
步骤43,若大于最大行动桶号,将该Flag字段设置为指向最小行动桶号;Step 43: If greater than the maximum action bucket number, set the Flag field to point to the minimum action bucket number;
步骤44,如出端口不活跃,Flag字段指向下一个行动桶,并执行步骤45;Step 44, if the outgoing port is not active, the Flag field points to the next action bucket, and step 45 is performed;
步骤45,判断该行动桶号是否大于最大行动桶号,若小于,则返回步骤39;若大于,则执行步骤46; Step 45, it is determined whether the action bucket number is greater than the maximum bucket number, if less, then return to step 39; if greater, then step 46;
步骤46,将Flag字段指向最小行动桶号,并返回步骤39。In step 46, the Flag field is pointed to the minimum action bucket number and returns to step 39.
需要特别说明的是,上述老化定时器的老化时间可根据实际使用场景设定,本实例中,设老化时间为180s。It should be noted that the aging time of the aging timer can be set according to the actual usage scenario. In this example, the aging time is 180s.
本实施例中,假定各出端口均处于活跃状态。In this embodiment, it is assumed that each of the outgoing ports is in an active state.
当收到的报文源MAC地址为01 00 5E 37 00 48时,由于此时映射关系表为空表,故查找失败,由于此时Flag字段为1,判断行动桶号1中行动对应的出端口2活跃,将报文从出端口2输出;将报文源MAC地址01 00 5E 37 00 48与行动桶号1的对应关系插入映射关系表,并设置老化定时器180s;最后,将Flag字段指向下一个行动桶,则此时Flag为2,判断发现此时Flag字段值不大于欲参与分流的最大行动桶号3;如在180s内再次收到源MAC地址为01 00 5E 37 00 48的报文,由于映射关系表中有此源MAC地址项,故会查找成功,从而更新映射关系表中此源MAC地址项的老化定时器,并执行对应行动桶中行动,将报文从出端口2输出。如在180s内未收到源MAC地址为01 00 5E 37 00 48的报文,映射关系表中源MAC地址为01 00 5E 37 00 48的表项的老化定时器超时,映射关系表中此表项会被删除,之后再次收到源MAC地址为01 00 5E 37 00 48的报文,会在映射关系表中重建源MAC地址为01 00 5E 37 00 48的表项。When the source MAC address of the received packet is 01 00 5E 37 00 48, the mapping table is empty, so the search fails. Because the Flag field is 1, the action corresponding to the action in bucket #1 is determined. Port 2 is active, and the packet is output from the outbound port 2; the mapping between the source MAC address of the packet 01 00 5E 37 00 48 and the action bucket number 1 is inserted into the mapping relationship table, and the aging timer 180s is set; finally, the Flag field is set. Point to the next action bucket, then the Flag is 2, and it is found that the value of the Flag field is not greater than the maximum action bucket number 3 to be involved in the splitting; if the source MAC address is again received within 180s, the source MAC address is 01 00 5E 37 00 48. If the source MAC address entry is found in the mapping table, the device searches for the aging timer of the source MAC address entry in the mapping table and performs the action in the corresponding action bucket to remove the packet from the egress port. 2 output. If the packet whose source MAC address is 01 00 5E 37 00 48 is not received within 180s, the aging timer of the entry with the source MAC address of 01 00 5E 37 00 48 in the mapping table expires. This table is in the mapping table. The entry will be deleted. After receiving the packet with the source MAC address of 01 00 5E 37 00 48, the entry with the source MAC address of 01 00 5E 37 00 48 will be reconstructed in the mapping table.
类似的,当收到的报文源MAC地址为01 00 5E 37 00 49时,查找映射关系表失败,判断Flag字段指定的行动桶号2中行动对应的出端口3活跃,将报文从出端口3输出;将报文源MAC地址01 00 5E 37 00 49与行动桶号2的对应关系插入映射关系表,并设置老化定时器180s;最后,将Flag字段指向下一个行动桶,此时Flag为3,判断发现此时Flag字段值不大于欲参与分流的最大行动桶号3。Similarly, when the source MAC address of the received packet is 01 00 5E 37 00 49, the search for the mapping table fails, and it is determined that the outgoing port 3 corresponding to the action in the action bucket number 2 specified by the Flag field is active, and the packet is sent out. Port 3 output; insert the correspondence between the source MAC address of the packet 01 00 5E 37 00 49 and the action bucket number 2 into the mapping relationship table, and set the aging timer 180s; finally, point the Flag field to the next action bucket, at this time, Flag If it is 3, it is judged that the value of the Flag field is not greater than the maximum action bucket number 3 to be involved in the shunt.
进一步地,当收到的报文源MAC地址为01 00 5E 37 00 4A时,查找映射关系表失败,判断Flag字段指定的行动桶号3中行动对应的出端口4活跃,将报文从出端口4输出;将报文源MAC地址01 00 5E 37 00 4A与行动桶号3的对应关系插入映射关系表,并设置老化定时器180s;最后,将Flag字段指向下一个行动桶,此时Flag为4,判断发现此时Flag字段值大于欲参与分流的最大行动桶号3,将Flag字段置为最小行动桶号1。Further, when the source MAC address of the received packet is 01 00 5E 37 00 4A, the mapping of the mapping table fails, and the outbound port 4 corresponding to the action in the action bucket number 3 specified by the Flag field is active, and the packet is sent out. Port 4 output; insert the correspondence between the source MAC address of the packet 01 00 5E 37 00 4A and the action bucket number 3 into the mapping relationship table, and set the aging timer 180s; finally, point the Flag field to the next action bucket, at this time, Flag If it is 4, it is judged that the value of the Flag field is greater than the maximum action bucket number 3 to be involved in the split, and the Flag field is set to the minimum action bucket number 1.
在本实施例中,选取如下20个不同源MAC地址的报文依次输入OpenFlow交换机,源MAC地址与行动桶的对应关系以及报文的出端口,如表2所示。In this embodiment, the following 20 packets of different source MAC addresses are sequentially input into the OpenFlow switch, and the correspondence between the source MAC address and the action bucket and the outbound port of the packet are as shown in Table 2.
源MAC地址Source MAC address 行动桶Action bucket 出端口Out port
01 00 5E 37 00 4801 00 5E 37 00 48 行动桶1Action bucket 1 22
01 00 5E 37 00 4901 00 5E 37 00 49 行动桶2Action bucket 2 33
01 00 5E 37 00 4A01 00 5E 37 00 4A 行动桶3Action bucket 3 44
01 00 5E 37 00 4B01 00 5E 37 00 4B 行动桶1Action bucket 1 22
01 00 5E 37 00 4C01 00 5E 37 00 4C 行动桶2Action bucket 2 33
01 00 5E 37 00 4D01 00 5E 37 00 4D 行动桶3Action bucket 3 44
01 00 5E 37 00 4E01 00 5E 37 00 4E 行动桶1Action bucket 1 22
01 00 5E 37 00 4F01 00 5E 37 00 4F 行动桶2Action bucket 2 33
01 00 5E 37 00 5001 00 5E 37 00 50 行动桶3Action bucket 3 44
01 00 5E 37 00 5101 00 5E 37 00 51 行动桶1Action bucket 1 22
01 00 5E 37 00 5201 00 5E 37 00 52 行动桶2Action bucket 2 33
01 00 5E 37 00 5301 00 5E 37 00 53 行动桶3Action bucket 3 44
01 00 5E 37 00 5401 00 5E 37 00 54 行动桶1Action bucket 1 22
01 00 5E 37 00 5501 00 5E 37 00 55 行动桶2Action bucket 2 33
01 00 5E 37 00 5601 00 5E 37 00 56 行动桶3Action bucket 3 44
01 00 5E 37 00 5701 00 5E 37 00 57 行动桶1Action bucket 1 22
01 00 5E 37 00 5801 00 5E 37 00 58 行动桶2Action bucket 2 33
01 00 5E 37 00 5901 00 5E 37 00 59 行动桶3Action bucket 3 44
01 00 5E 37 00 5A01 00 5E 37 00 5A 行动桶1Action bucket 1 22
01 00 5E 37 00 5B01 00 5E 37 00 5B 行动桶2Action bucket 2 33
表2源MAC地址、行动桶以及出端口的对应关系Table 2 Correspondence between source MAC address, action bucket, and egress port
综上,本发明所述的一种OpenFlow交换机的报文分流方法解决了现有分流方法在应用场景上的局限。本发明简单容易实现,充分利用了OpenFlow交换机中组表的特点,能够轻松应对出端口数增加的情况,不仅能够成功实现报文的分流,而且能够根据不同的业务特点采用不同的业务特征值作为组表选择算法的输入,选择出端口输出报文,为SDN在不同领域的应用提供有利基础。In summary, the packet offloading method of an OpenFlow switch according to the present invention solves the limitation of the existing offloading method in an application scenario. The invention is simple and easy to implement, and fully utilizes the characteristics of the group table in the OpenFlow switch, and can easily cope with the increase of the number of outgoing ports, not only can successfully implement packet shunting, but also can adopt different service feature values according to different service characteristics. The input of the group table selection algorithm selects the port output message to provide a favorable basis for the application of SDN in different fields.
需要说明的是,对于上述方法实施例而言,为了简单描述,故将其都表达为一系列的动 作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。It should be noted that, for the above method embodiments, for the sake of simple description, they are all expressed as a series of motions. Combinations, but those skilled in the art should understand that the present application is not limited by the order of the acts described, as some steps may be performed in other sequences or concurrently in accordance with the present application.
本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包含但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Embodiments of the present application can be provided as a method, system, or computer program product. Thus, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware. Moreover, the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
为了更好的实现上述目的,如图5所示,本发明实施例还提供一种报文的处理装置,其中,包括:In order to achieve the above objective, as shown in FIG. 5, the embodiment of the present invention further provides a packet processing apparatus, which includes:
信息获取模块51,设置为接收报文,并从报文中获取与业务相关的业务特征信息;The information obtaining module 51 is configured to receive the packet, and obtain service characteristic information related to the service from the packet;
确定模块52,设置为根据所述业务特征信息,确定与所述业务特征信息对应的指示信息;The determining module 52 is configured to determine, according to the service feature information, indication information corresponding to the service feature information;
第一输出模块53,设置为根据所述指示信息的指示从一输出端口输出所述报文。The first output module 53 is configured to output the message from an output port according to the indication of the indication information.
进一步地,本发明的上述实施例中所述确定模块52包括:Further, the determining module 52 in the foregoing embodiment of the present invention includes:
确定子模块,设置为根据所述业务特征信息,从所述业务特征信息与行动桶的映射关系表中查找与所述业务特征信息唯一对应的指示信息。The determining submodule is configured to, according to the service feature information, look up the indication information that is uniquely corresponding to the service feature information from the mapping relationship table between the service feature information and the action bucket.
进一步地,本发明的上述实施例中所述处理装置还包括:Further, the processing apparatus in the above embodiment of the present invention further includes:
获取模块,设置为若从所述映射关系表中查找不到与所述业务特征信息唯一对应的行动桶,获取一预设字段;An obtaining module, configured to obtain a preset field if a motion bucket uniquely corresponding to the service feature information is not found in the mapping relationship table;
端口获取模块,设置为确定预设字段指向的指示信息,并获取所述指示信息指示的输出所述报文的输出端口;a port obtaining module, configured to determine indication information pointed by the preset field, and obtain an output port of the message outputted by the indication information;
第二输出模块,设置为若所述输出端口为活跃端口,利用所述活跃端口输出所述报文;a second output module, configured to output the message by using the active port if the output port is an active port;
第三输出模块,设置为若所述输出端口为不活跃端口,根据第一预设规则选择其他指示信息,并确定所述其他指示信息指示的输出报文的输出端口,直到所述输出端口为活跃端口,利用所述活跃端口输出所述报文。a third output module, configured to: if the output port is an inactive port, select other indication information according to the first preset rule, and determine an output port of the output packet indicated by the other indication information until the output port is An active port that outputs the message by using the active port.
进一步地,本发明的上述实施例中所述处理装置还包括:Further, the processing apparatus in the above embodiment of the present invention further includes:
保存模块,设置为将所述活跃端口对应的指示信息与所述报文中的业务特征信息的对应关系保存至所述映射关系表中。The saving module is configured to save the correspondence between the indication information corresponding to the active port and the service feature information in the packet to the mapping relationship table.
进一步地,本发明的上述实施例中所述映射关系表包括多个表项,每个所述表项标识一个业务特征信息以及与所述业务特征信息唯一对应的指示信息的标识;Further, the mapping relationship table in the foregoing embodiment of the present invention includes a plurality of entries, each of the entries identifying a service feature information and an identifier of the indication information uniquely corresponding to the service feature information;
所述装置还包括:The device also includes:
更新模块,设置为以每个表项的建立时间为起点为每个所述表项设置更新周期,若所述 更新周期内未收到包含该表项的业务特征信息的报文,从所述映射关系表中删除该表项;若所述更新周期内收到包含该表项的业务特征信息的报文,以收到该报文的时间为起点重新设置该表项的更新周期。An update module, configured to set an update period for each of the entries starting from a setup time of each entry, if The packet that contains the service feature information of the entry is not received in the update period, and the entry is deleted from the mapping relationship table. If the packet containing the service feature information of the entry is received in the update period, The update period of the entry is reset based on the time when the packet is received.
进一步地,本发明的上述实施例中所述处理装置还包括:Further, the processing apparatus in the above embodiment of the present invention further includes:
指向模块,设置为按照第二预设规则,将所述预设字段指向其他指示信息。Pointing to the module, set to point the preset field to other indication information according to the second preset rule.
进一步地,本发明的上述实施例中所述指示信息保存于OpenFlow交换机的行动桶中。Further, the indication information in the foregoing embodiment of the present invention is saved in a action bucket of an OpenFlow switch.
进一步地,所述处理装置还包括:Further, the processing device further includes:
新增模块,设置为当OpenFlow交换机的输出端口增加时,相应增加指示从新增的出端口输出报文的指示信息。A new module is set to increase the indication of the output of the packet from the newly added outbound port when the output port of the OpenFlow switch is added.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。It will be apparent to those skilled in the art that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.
工业实用性Industrial applicability
上述的本发明实施例,可以应用于网络通信技术领域,从而实现了根据报文的不同的应用领域的业务特点来确定报文的输出端口,实现报文的分流,为软件定义网络在不同领域的应用提供有利基础,扩大软件定义网络的应用范围。 The foregoing embodiments of the present invention can be applied to the field of network communication technologies, so that the output port of the packet is determined according to the service characteristics of different application domains of the packet, and the packet is offloaded, and the software defines the network in different fields. The application provides a favorable basis for expanding the range of applications for software-defined networks.

Claims (16)

  1. 一种报文的处理方法,包括:A method for processing a message, comprising:
    接收报文,并从报文中获取与业务相关的业务特征信息;Receiving a message, and obtaining service characteristic information related to the service from the message;
    根据所述业务特征信息,确定与所述业务特征信息对应的指示信息;Determining, according to the service feature information, indication information corresponding to the service feature information;
    根据所述指示信息的指示从一输出端口输出所述报文。And outputting the message from an output port according to the indication of the indication information.
  2. 根据权利要求1所述的报文的处理方法,其中,根据所述业务特征信息,确定与所述业务特征信息对应的指示信息的步骤包括:The method for processing a message according to claim 1, wherein the step of determining the indication information corresponding to the service feature information according to the service feature information comprises:
    根据所述业务特征信息,从所述业务特征信息与指示信息的映射关系表中查找与所述业务特征信息唯一对应的指示信息。And indicating, according to the service feature information, the indication information that is uniquely corresponding to the service feature information from the mapping relationship table between the service feature information and the indication information.
  3. 根据权利要求2所述的报文的处理方法,其中,若从所述映射关系表中查找不到与所述业务特征信息唯一对应的指示信息,所述方法还包括:The method for processing a packet according to claim 2, wherein if the indication information uniquely corresponding to the service feature information is not found in the mapping relationship table, the method further includes:
    获取一预设字段;Get a preset field;
    确定所述预设字段指向的指示信息,并获取所述指示信息指示的输出所述报文的输出端口;Determining the indication information pointed by the preset field, and acquiring an output port of the message indicated by the indication information;
    若所述输出端口为活跃端口,利用所述活跃端口输出所述报文;If the output port is an active port, outputting the packet by using the active port;
    若所述输出端口为不活跃端口,根据第一预设规则选择其他指示信息,并确定所述其他指示信息指示的输出报文的输出端口,直到所述输出端口为活跃端口,利用所述活跃端口输出所述报文。If the output port is an inactive port, select other indication information according to the first preset rule, and determine an output port of the output packet indicated by the other indication information, until the output port is an active port, and use the active The port outputs the message.
  4. 根据权利要求3所述的报文的处理方法,其中,利用所述活跃端口输出所述报文后,所述方法还包括:The method of processing a packet according to claim 3, wherein, after the message is output by using the active port, the method further includes:
    将所述活跃端口对应的指示信息与从该活跃端口输出的所述报文中的业务特征信息的对应关系保存至所述映射关系表中。And saving the correspondence between the indication information corresponding to the active port and the service feature information in the packet output from the active port to the mapping relationship table.
  5. 根据权利要求4所述的报文的处理方法,其中,所述映射关系表包括多个表项,每个所述表项标识一个业务特征信息以及与所述业务特征信息唯一对应的指示信息的标识;The method of processing a packet according to claim 4, wherein the mapping relationship table includes a plurality of entries, each of the entries identifying a service feature information and indication information uniquely corresponding to the service feature information. Identification
    以每个表项的建立时间为起点为每个所述表项设置更新周期,若所述更新周期内未收到包含该表项的业务特征信息的报文,从所述映射关系表中删除该表项;若所述更新周期内收到包含该表项的业务特征信息的报文,以收到该报文的时间为起点重新设置该表项的更新周期。An update period is set for each of the entries, and the packet containing the service feature information of the entry is not received from the mapping relationship table. The entry is: if the packet containing the service feature information of the entry is received in the update period, the update period of the entry is reset by using the time of receiving the packet as a starting point.
  6. 根据权利要求4所述的报文的处理方法,其中,将对应关系保存至所述映射关系表中后,所述方法还包括:The method of processing a packet according to claim 4, wherein after the correspondence is saved in the mapping relationship table, the method further includes:
    按照第二预设规则,将所述预设字段指向其他指示信息。 According to the second preset rule, the preset field is pointed to other indication information.
  7. 根据权利要求1至6任一项所述的报文的处理方法,其中,所述指示信息保存于OpenFlow交换机的行动桶中。The method for processing a message according to any one of claims 1 to 6, wherein the indication information is stored in a action bucket of an OpenFlow switch.
  8. 根据权利要求7所述的报文的处理方法,其中,当OpenFlow交换机的输出端口增加时,相应增加指示从新增的出端口输出报文的指示信息。The method of processing a packet according to claim 7, wherein when the output port of the OpenFlow switch is increased, the indication information indicating that the packet is output from the newly added egress port is correspondingly increased.
  9. 一种报文的处理装置,包括:A message processing device, comprising:
    信息获取模块,设置为接收报文,并从报文中获取与业务相关的业务特征信息;The information acquiring module is configured to receive the packet, and obtain service characteristic information related to the service from the packet;
    确定模块,设置为根据所述业务特征信息,确定与所述业务特征信息对应的指示信息;a determining module, configured to determine, according to the service feature information, indication information corresponding to the service feature information;
    第一输出模块,设置为根据所述指示信息的指示从一输出端口输出所述报文。The first output module is configured to output the message from an output port according to the indication of the indication information.
  10. 根据权利要求9所述的报文的处理装置,其中,所述确定模块包括:The processing device of the message according to claim 9, wherein the determining module comprises:
    确定子模块,设置为根据所述业务特征信息,从所述业务特征信息与行动桶的映射关系表中查找与所述业务特征信息唯一对应的指示信息。The determining submodule is configured to, according to the service feature information, look up the indication information that is uniquely corresponding to the service feature information from the mapping relationship table between the service feature information and the action bucket.
  11. 根据权利要求10所述的报文的处理装置,其中,所述处理装置还包括:The processing device of the message according to claim 10, wherein the processing device further comprises:
    获取模块,设置为若从所述映射关系表中查找不到与所述业务特征信息唯一对应的指示信息,获取一预设字段;Obtaining a module, configured to obtain a preset field if the indication information uniquely corresponding to the service feature information is not found in the mapping relationship table;
    端口获取模块,设置为确定预设字段指向的指示信息,并获取所述指示信息指示的输出所述报文的输出端口;a port obtaining module, configured to determine indication information pointed by the preset field, and obtain an output port of the message outputted by the indication information;
    第二输出模块,设置为若所述输出端口为活跃端口,利用所述活跃端口输出所述报文;a second output module, configured to output the message by using the active port if the output port is an active port;
    第三输出模块,设置为若所述输出端口为不活跃端口,根据第一预设规则选择其他指示信息,并确定所述其他指示信息指示的输出报文的输出端口,直到所述输出端口为活跃端口,利用所述活跃端口输出所述报文。a third output module, configured to: if the output port is an inactive port, select other indication information according to the first preset rule, and determine an output port of the output packet indicated by the other indication information until the output port is An active port that outputs the message by using the active port.
  12. 根据权利要求11所述的报文的处理装置,其中,所述处理装置还包括:The processing device of the message according to claim 11, wherein the processing device further comprises:
    保存模块,设置为将所述活跃端口对应的指示信息与从该活跃端口输出的所述报文中的业务特征信息的对应关系保存至所述映射关系表中。The saving module is configured to save the correspondence between the indication information corresponding to the active port and the service feature information in the packet output from the active port to the mapping relationship table.
  13. 根据权利要求12所述的报文的处理装置,其中,所述映射关系表包括多个表项,每个所述表项标识一个业务特征信息以及与所述业务特征信息唯一对应的指示信息的标识;The apparatus for processing a message according to claim 12, wherein the mapping relationship table includes a plurality of entries, each of the entries identifying a service feature information and indication information uniquely corresponding to the service feature information. Identification
    所述装置还包括:The device also includes:
    更新模块,设置为以每个表项的建立时间为起点为每个所述表项设置更新周期,若所述更新周期内未收到包含该表项的业务特征信息的报文,从所述映射关系表中删除该 表项;若所述更新周期内收到包含该表项的业务特征信息的报文,以收到该报文的时间为起点重新设置该表项的更新周期。An update module, configured to set an update period for each of the entries starting from a settling time of each entry, and if the packet containing the service feature information of the entry is not received in the update period, Delete the mapping table If the packet is received in the update period, the update period of the entry is reset based on the time when the packet is received.
  14. 根据权利要求12所述的报文的处理装置,其中,所述处理装置还包括:The processing device of the message according to claim 12, wherein the processing device further comprises:
    指向模块,设置为按照第二预设规则,将所述预设字段指向其他指示信息。Pointing to the module, set to point the preset field to other indication information according to the second preset rule.
  15. 根据权利要求9-14任一项所述的报文的处理装置,其中,所述指示信息保存于OpenFlow交换机的行动桶中。The processing device for a message according to any one of claims 9 to 14, wherein the indication information is stored in a action bucket of an OpenFlow switch.
  16. 根据权利要求15所述的报文的处理装置,其中,所述处理装置还包括:The processing device of the message according to claim 15, wherein the processing device further comprises:
    新增模块,设置为当OpenFlow交换机的出端口增加时,相应增加指示从新增的输出端口输出报文的指示信息。 The new module is set to increase the indication information indicating the output of the packet from the newly added output port when the egress port of the OpenFlow switch is added.
PCT/CN2016/077583 2015-08-27 2016-03-28 Packet processing method and device WO2016177191A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510536388.1A CN106487683A (en) 2015-08-27 2015-08-27 A kind of processing method and processing device of message
CN201510536388.1 2015-08-27

Publications (1)

Publication Number Publication Date
WO2016177191A1 true WO2016177191A1 (en) 2016-11-10

Family

ID=57217511

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/077583 WO2016177191A1 (en) 2015-08-27 2016-03-28 Packet processing method and device

Country Status (2)

Country Link
CN (1) CN106487683A (en)
WO (1) WO2016177191A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020134153A1 (en) * 2018-12-26 2020-07-02 中兴通讯股份有限公司 Distribution method, system and processing device
CN113535359A (en) * 2021-07-23 2021-10-22 中国科学技术大学苏州高等研究院 Service request scheduling method and device in multi-tenant cloud
WO2022105731A1 (en) * 2020-11-20 2022-05-27 武汉绿色网络信息服务有限责任公司 Data packet transmission port refresh method and device
CN114866456A (en) * 2022-04-22 2022-08-05 新华三工业互联网有限公司 Message sending method and device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107682342B (en) * 2017-10-17 2020-03-10 盛科网络(苏州)有限公司 Method and system for DDoS (distributed denial of service) flow traction based on openflow
CN112929298A (en) * 2021-01-29 2021-06-08 紫光云技术有限公司 Method for accessing shared volume by centralized gateway

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101820392A (en) * 2010-03-26 2010-09-01 中兴通讯股份有限公司 Method for realizing multi-service forwarding and network processor
CN103368775A (en) * 2013-07-09 2013-10-23 杭州华三通信技术有限公司 Traffic backup method and core switching equipment
CN103581021A (en) * 2013-10-23 2014-02-12 华为技术有限公司 Method and equipment for detecting services in software defined network
US20140359697A1 (en) * 2013-06-04 2014-12-04 Hangzhou H3C Technologies Co., Ltd. Active Security Defense for Software Defined Network

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070159968A1 (en) * 2006-01-12 2007-07-12 Cutaia Nicholas J Selective text telephony character discarding
CN101047631A (en) * 2006-04-29 2007-10-03 华为技术有限公司 Customer position information transmitting method, MAC address automatic allocating method, network creating method and system
CN100499590C (en) * 2006-05-23 2009-06-10 杭州华三通信技术有限公司 Message access controlling method and a network apparatus
CN101127707B (en) * 2007-09-21 2010-10-27 杭州华三通信技术有限公司 Data forwarding method and access point device
CN103597789A (en) * 2011-08-08 2014-02-19 惠普发展公司,有限责任合伙企业 Fabric chip having a port resolution module

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101820392A (en) * 2010-03-26 2010-09-01 中兴通讯股份有限公司 Method for realizing multi-service forwarding and network processor
US20140359697A1 (en) * 2013-06-04 2014-12-04 Hangzhou H3C Technologies Co., Ltd. Active Security Defense for Software Defined Network
CN103368775A (en) * 2013-07-09 2013-10-23 杭州华三通信技术有限公司 Traffic backup method and core switching equipment
CN103581021A (en) * 2013-10-23 2014-02-12 华为技术有限公司 Method and equipment for detecting services in software defined network

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020134153A1 (en) * 2018-12-26 2020-07-02 中兴通讯股份有限公司 Distribution method, system and processing device
WO2022105731A1 (en) * 2020-11-20 2022-05-27 武汉绿色网络信息服务有限责任公司 Data packet transmission port refresh method and device
CN113535359A (en) * 2021-07-23 2021-10-22 中国科学技术大学苏州高等研究院 Service request scheduling method and device in multi-tenant cloud
CN113535359B (en) * 2021-07-23 2023-11-10 中国科学技术大学苏州高等研究院 Method and device for scheduling service requests in multi-tenant cloud
CN114866456A (en) * 2022-04-22 2022-08-05 新华三工业互联网有限公司 Message sending method and device

Also Published As

Publication number Publication date
CN106487683A (en) 2017-03-08

Similar Documents

Publication Publication Date Title
WO2016177191A1 (en) Packet processing method and device
US10742722B2 (en) Server load balancing
US9602428B2 (en) Method and apparatus for locality sensitive hash-based load balancing
CN107547391B (en) Message transmission method and device
US11140069B2 (en) Optimizing information related to a route and/or a next hop for multicast traffic
WO2017025021A1 (en) Method and device for processing flow table
US10693785B2 (en) Method and system for forwarding data, virtual load balancer, and readable storage medium
US20140198662A1 (en) Centralized network control system
US11689646B2 (en) Network packet processing method and apparatus and network server
US9948482B2 (en) Apparatus and method for enabling flexible key in a network switch
US9135833B2 (en) Process for selecting compressed key bits for collision resolution in hash lookup table
CN111193756B (en) VXLAN tunnel load balancing method and related equipment
WO2017012471A1 (en) Load balance processing method and apparatus
CN108111422B (en) DPDK-based data high-speed multi-path forwarding method and device
US10523619B2 (en) Stateless message routing
US20210014163A1 (en) Per path and per link traffic accounting
WO2014082259A1 (en) Method and device for implementing load balancing
CN106254282B (en) The implementation method and device of link aggregation
WO2016173196A1 (en) Method and apparatus for learning address mapping relationship
CN109861908B (en) Route forwarding method and equipment
CN109005120B (en) Message processing method and network equipment
EP2887589A1 (en) Stateless message routing
WO2016000365A1 (en) Method and apparatus for path computation
US20230164149A1 (en) Causing or preventing an update to a network address translation table
US10476945B2 (en) Consistent flow assignment in load balancing

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16789185

Country of ref document: EP

Kind code of ref document: A1