WO2017020173A1 - Method for realizing flow table synchronization and forwarding device - Google Patents

Method for realizing flow table synchronization and forwarding device Download PDF

Info

Publication number
WO2017020173A1
WO2017020173A1 PCT/CN2015/085740 CN2015085740W WO2017020173A1 WO 2017020173 A1 WO2017020173 A1 WO 2017020173A1 CN 2015085740 W CN2015085740 W CN 2015085740W WO 2017020173 A1 WO2017020173 A1 WO 2017020173A1
Authority
WO
WIPO (PCT)
Prior art keywords
synchronization rule
flow table
target flow
source
source flow
Prior art date
Application number
PCT/CN2015/085740
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 华为技术有限公司
Priority to CN201580031073.XA priority Critical patent/CN107534612B/en
Priority to PCT/CN2015/085740 priority patent/WO2017020173A1/en
Publication of WO2017020173A1 publication Critical patent/WO2017020173A1/en

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Provided are a method for realizing flow table synchronization and a forwarding device, which are used for solving the problems in the prior art that computing resources of a controller are consumed and a synchronization time delay is increased during synchronization between flow tables. The method comprises: after a source flow table in a forwarding device is modified, being able to directly determine a source flow entry to be synchronized, and based on a synchronization rule associated with the source flow table, converting the flow entry to be synchronized and synchronizing a target flow entry generated after conversion into a target flow table. In this way, since a controller does not need to perform synchronization between flow tables, and a forwarding device independently completes the whole synchronization process instead, the waste of computing resources of the controller is avoided, and signalling interaction between a switch and the controller is also avoided, thereby reducing a time delay in flow table synchronization.

Description

一种流表同步的实现方法及转发设备Method for realizing flow table synchronization and forwarding device 技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种流表同步的实现方法及转发设备。The present invention relates to the field of communications technologies, and in particular, to a method for implementing flow table synchronization and a forwarding device.
背景技术Background technique
软件定义网络(Software Defined Networking,SDN)是一种新型网络架构,具有控制与转发解耦、集中控制和开放可编程接口的特点,是业界普遍看好的技术发展方向。Software Defined Networking (SDN) is a new type of network architecture with control and forwarding decoupling, centralized control and open programmable interfaces. It is a optimistic technology development direction in the industry.
开放式流(OpenFlow)协议是当前SDN架构下控制面与转发面的设备之间的标准,在控制面与转发面解耦之后,控制器可以通过Openflow协议对处于转发设备(如交换机)的行为进行控制。The OpenFlow protocol is the standard between the control plane and the forwarding plane device in the current SDN architecture. After the control plane is decoupled from the forwarding plane, the controller can perform the behavior of the forwarding device (such as a switch) through the Openflow protocol. Take control.
控制器通过控制交换机上的流表(Flow Table),实现对交换机中待转发报文的转发行为进行控制,具体包括:交换机保存有基于控制器生成的流表,其中一个流表中可以包含多个流表项,每个流表项中主要包含报文的匹配项、操作等信息;交换机接收到一个报文后,按照设定顺序依次将流表中每个流表项包含的匹配项与该报文进行匹配,在一个流表项包含的匹配项与该报文匹配成功后,立即执行该流表项中的操作。The controller controls the forwarding behavior of the packets to be forwarded on the switch by controlling the flow table on the switch. The switch includes a flow table generated by the controller, where one flow table can contain multiple flow tables. Each flow entry contains information about the matching and operation of the packet. After receiving a packet, the switch sequentially matches the matching entries in each flow entry in the flow table. The packet is matched. After the matching entry of a flow entry matches the packet, the operation in the flow entry is performed immediately.
交换机保存的多个流表之间,有些流表需要实现同步,如学习流表(Learning Table)和转发流表(Forwarding Table),在交换机中学习到一个新的流表项保存至学习流表后,控制器需要将该新的流表项进行转换生成同步流表项,令其满足转发流表的格式,转换后将同步流表项发送至交换机,交换机将该同步流表项保存到转发流表中,这个过程需要控制器和交换机进行多次信令交互,且控制器在对流表项进行转换时,需要耗费计算资源,增加了同步时延。Between the multiple flow tables saved by the switch, some flow tables need to be synchronized, such as a learning table (Learning Table) and a forwarding table (Forwarding Table). A new flow table entry is learned in the switch and saved to the learning flow table. Then, the controller needs to convert the new flow entry to generate a synchronous flow entry, so that it satisfies the format of the forwarding flow table. After the conversion, the synchronous flow entry is sent to the switch, and the switch saves the synchronous flow entry to the forwarding. In the flow table, this process requires multiple signaling interactions between the controller and the switch. When the controller converts the flow entry, it consumes computing resources and increases the synchronization delay.
因此,如何实现不同流表间的自动同步,以大量减少控制器和转发设备 之间的信令交互,同时缩小同步时延,降低控制器的计算压力,是基于OpenFlow协议的SDN网络架构中亟待解决的问题。Therefore, how to achieve automatic synchronization between different flow tables to greatly reduce controllers and forwarding devices The signaling interaction between the two, while reducing the synchronization delay and reducing the computational pressure of the controller, is an urgent problem to be solved in the SDN network architecture based on the OpenFlow protocol.
发明内容Summary of the invention
本发明实施例提供了一种流表同步的实现方法及转发设备,用以解决现有技术中存在的流表间同步时耗费控制器计算资源,增加同步时延的问题。The embodiment of the invention provides a method for implementing flow table synchronization and a forwarding device, which is used to solve the problem that the controller computing resources are consumed and the synchronization delay is increased when the flow table is synchronized in the prior art.
第一方面,一种流表同步的实现方法,包括:In a first aspect, a method for implementing flow table synchronization includes:
转发设备在对一源流表修改后,确定与所述源流表关联的同步规则,同步规则中包括源流表标识、目标流表标识,以及源流表项的转换规则,其中,所述源流表项为所述源流表标识对应的源流表中的流表项,所述同步规则包括的源流表标识与所述源流表的源流表标识相同;After the source device is modified, the forwarding device determines a synchronization rule that is associated with the source flow table. The synchronization rule includes a source flow table identifier, a target flow table identifier, and a source flow entry conversion rule, where the source flow entry is The source flow table identifies a flow entry in the source flow table, and the source flow table identifier included in the synchronization rule is the same as the source flow table identifier in the source flow table;
所述转发设备根据所述源流表,确定待同步的源流表项,并根据所述源流表项的转换规则,对所述待同步的源流表项进行转换,将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中。Determining, by the source device, the source flow entry to be synchronized according to the source flow table, and converting the source flow entry to be synchronized according to the conversion rule of the source flow entry, and converting the generated target flow entry Synchronizing to the target flow table corresponding to the target flow table identifier.
结合第一方面,在第一方面的第一种可能的实现方式中,当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,所述转发设备根据所述源流表,确定需要同步的源流表项,包括:With reference to the first aspect, in a first possible implementation manner of the first aspect, when the source flow table is modified to install the source flow entry to be added to the source flow table, the forwarding device is configured according to the The source flow table determines the source flow entries that need to be synchronized, including:
所述转发设备将安装到所述源流表中所述待增加的源流表项作为待同步的源流表项;或者The forwarding device installs the source flow entry to be added in the source flow table as a source flow entry to be synchronized; or
当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,所述转发设备根据所述源流表,确定需要同步的源流表项,包括:When the source flow table is modified to modify the source flow entry to be modified in the source flow table, the forwarding device determines, according to the source flow table, the source flow entry to be synchronized, including:
所述转发设备将所述源流表中的所述待修改的源流表项、修改后的源流表项作为待同步的源流表项;或者The forwarding device uses the source flow entry to be modified and the modified source flow entry in the source flow table as the source flow entry to be synchronized; or
当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,所述转发设备根据所述源流表,确定需要同步的源流表项,包括:When the source flow table is modified to invalidate the source flow entry to be invalidated in the source flow table, the forwarding device determines, according to the source flow table, the source flow entry to be synchronized, including:
所述转发设备将所述源流表中所述待无效的源流表项作为待同步的源流表项。 The forwarding device uses the source flow entry to be invalidated in the source flow table as a source flow entry to be synchronized.
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,所述转发设备将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中,包括:In conjunction with the first possible implementation of the first aspect, in a second possible implementation manner of the first aspect, when the source flow table is modified to install the source flow entry to be added into the source flow table, And the forwarding device synchronizes the target flow entry that is generated after the conversion to the target flow table corresponding to the target flow table identifier, including:
所述转发设备将生成的目标流表项安装到所述目标流表标识对应的目标流表中。The forwarding device installs the generated target flow entry into the target flow table corresponding to the target flow table identifier.
结合第一方面的第一种可能的实现方式,在第一方面的第三种可能的实现方式中,当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,所述转发设备将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中,包括:In conjunction with the first possible implementation of the first aspect, in a third possible implementation manner of the first aspect, when the source flow table is modified to modify the source flow entry to be modified in the source flow table, And the forwarding device synchronizes the target flow entry that is generated after the conversion to the target flow table corresponding to the target flow table identifier, including:
在所述目标流表标识对应的目标流表中,查找到所述待修改的源流表项转换后生成的目标流表项后,对查找到的目标流表项进行无效处理;After the target flow entry generated by the source flow entry to be modified is found in the target flow table corresponding to the target flow table identifier, the target flow entry that is found is invalidized after being found;
将修改后的源流表项转换后生成的目标流表项安装到所述目标流表标识对应的目标流表中。The target flow entry generated after the modified source flow entry is converted is installed in the target flow table corresponding to the target flow table identifier.
结合第一方面的第一种可能的实现方式,在第一方面的第四种可能的实现方式中,当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,所述转发设备将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中,包括:With reference to the first possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, when the source flow table is modified to invalidate the source flow entry to be invalid in the source flow table During processing, the forwarding device synchronizes the target flow entry generated after the conversion to the target flow table corresponding to the target flow table identifier, including:
在所述目标流表标识对应的目标流表中,查找到生成的目标流表项后,对查找到的目标流表项进行无效处理。After the generated target flow entry is found in the target flow table corresponding to the target flow table identifier, the found target flow entry is invalidated.
结合第一方面的第二种或第三种可能的实现方式,在第一方面的第五种可能的实现方式中,所述转发设备将生成的目标流表项安装到所述目标流表标识对应的目标流表中,包括:In conjunction with the second or third possible implementation of the first aspect, in a fifth possible implementation manner of the first aspect, the forwarding device installs the generated target flow entry to the target flow table identifier The corresponding target flow table includes:
将生成的包含有同步规则标识的所述目标流表项,安装到所述目标流表标识对应的目标流表中,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。And the generated target flow entry is included in the target flow table corresponding to the target flow table identifier, where the synchronization rule identifier is used to indicate that the target flow entry is based on the The synchronization rule identifies the corresponding synchronization rule generated.
结合第一方面或第一方面的以上任一种可能的实现方式,在第一方面的 第六种可能的实现方式中,所述转发设备在将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中之后,还包括:In combination with the first aspect or any of the above possible implementations of the first aspect, in the first aspect In a sixth possible implementation manner, after the forwarding, by the forwarding device, the target flow entry that is generated after the conversion is synchronized to the target flow table corresponding to the target flow table identifier, the forwarding device further includes:
向所述控制器发送目标流表变化通知消息。A target flow table change notification message is sent to the controller.
结合第一方面或第一方面的以上任一种可能的实现方式,在第一方面的第七种可能的实现方式中,还包括:With reference to the first aspect, or any one of the foregoing possible implementation manners of the first aspect, in a seventh possible implementation manner of the first aspect, the method further includes:
所述转发设备接收所述控制器发送同步规则增加消息,所述同步规则增加消息中包含待增加的同步规则;The forwarding device receives the synchronization rule addition message sent by the controller, where the synchronization rule addition message includes a synchronization rule to be added;
所述转发设备将所述待增加的同步规则中包括的源流表标识对应的源流表与接收的所述待增加的同步规则建立关联。And the forwarding device associates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added with the received synchronization rule to be added.
结合第一方面的第七种可能的实现方式,在第一方面的第八种可能的实现方式中,所述转发设备在接收到控制器发送的同步规则增加消息之后,在将所述待增加的同步规则中包括的源流表标识对应的源流表、接收的所述同步规则建立关联之前,还包括:In conjunction with the seventh possible implementation of the first aspect, in an eighth possible implementation manner of the first aspect, the forwarding device, after receiving the synchronization rule addition message sent by the controller, is to be added Before the source flow table identifier corresponding to the source flow table identifier included in the synchronization rule is associated with the received synchronization rule, the method further includes:
对所述待增加的同步规则进行校验,并确定校验通过。The synchronization rule to be added is checked, and the verification is determined to pass.
结合第一方面的第八种可能的实现方式,在第一方面的第九种可能的实现方式中,所述转发设备在将所述待增加的同步规则中包括的源流表标识对应的源流表、接收的所述同步规则建立关联之后,还包括:In conjunction with the eighth possible implementation of the first aspect, in a ninth possible implementation manner of the first aspect, the forwarding device is configured to identify a source flow table corresponding to the source flow table identifier included in the synchronization rule to be added After the received synchronization rule is associated, the method further includes:
向所述控制器发送同步规则增加响应消息。A synchronization rule addition response message is sent to the controller.
结合第一方面的第七至第九种可能的实现方式中的任一种可能的实现方式,在第一方面的第十种可能的实现方式中,所述转发设备在接收所述控制器发送同步规则增加消息之后,还包括:With reference to any one of the seventh to the ninth possible implementation manners of the first aspect, in a tenth possible implementation manner of the first aspect, the forwarding device is configured to send the controller After the synchronization rule adds a message, it also includes:
根据所述待增加的同步规则包括的源流表项的转换规则,对所述待增加的同步规则中包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标流表项同步至所述待增加的同步规则包括的目标流表标识对应的目标流表中。Converting, according to the conversion rule of the source flow entry included in the synchronization rule to be added, the source flow entry in the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added, and converting the generated target flow The entry is synchronized to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be added.
结合第一方面或第一方面的第一至第十种可能的实现方式中的任一种可能的实现方式,在第一方面的第十一种可能的实现方式中,还包括: With reference to the first aspect, or any one of the first to the tenth possible implementation manners of the first aspect, in an eleventh possible implementation manner of the first aspect, the method further includes:
所述转发设备接收所述控制器发送的同步规则修改消息,所述同步规则修改消息中包括同步规则修改规则;The forwarding device receives a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a synchronization rule modification rule;
所述转发设备根据所述同步规则修改消息,确定待修改的同步规则;Determining, by the forwarding device, the synchronization rule according to the synchronization rule to determine a synchronization rule to be modified;
所述转发设备根据所述同步规则修改规则、以及所述待修改的同步规则,生成新同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同;The forwarding device generates a new synchronization rule according to the synchronization rule modification rule and the synchronization rule to be modified, where the new synchronization rule and the source flow table identifier and the target flow included in the synchronization rule to be modified The table identifiers are the same, and the conversion rules of the source flow entries are different.
所述转发设备将所述待修改的同步规则中包括的源流表标识对应的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。The forwarding device de-associates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be modified with the synchronization rule to be modified; and the source flow table corresponding to the source flow table identifier included in the new synchronization rule Associated with the new synchronization rule.
结合第一方面的第十一种可能的实现方式,在第一方面的第十二种可能的实现方式中,所述转发设备在确定待修改的同步规则之后,在生成新同步规则之前,还包括:With reference to the eleventh possible implementation manner of the first aspect, in the twelfth possible implementation manner of the first aspect, after the determining, by the forwarding device, the synchronization rule to be modified, before generating the new synchronization rule, include:
基于所述待修改的同步规则,对所述同步规则修改消息进行校验,并确定校验通过。And verifying, according to the synchronization rule to be modified, the synchronization rule modification message, and determining that the verification is passed.
结合第一方面或第一方面的第一至第十种可能的实现方式中的任一种可能的实现方式,在第一方面的第十三种可能的实现方式中,还包括:With reference to the first aspect or any one of the first to the tenth possible implementation manners of the first aspect, in a thirteenth possible implementation manner of the first aspect, the method further includes:
所述转发设备接收所述控制器发送的同步规则修改消息,所述同步规则修改消息中包括新同步规则;The forwarding device receives a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a new synchronization rule;
所述转发设备根据所述同步规则修改消息,确定待修改的同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同;The forwarding device determines the synchronization rule to be modified according to the synchronization rule modification message, where the new synchronization rule is the same as the source flow table identifier and the target flow table identifier included in the synchronization rule to be modified, and includes The conversion rules of source flow entries are different.
所述转发设备将所述待修改的同步规则中包括的源流表标识对应的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。The forwarding device de-associates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be modified with the synchronization rule to be modified; and the source flow table corresponding to the source flow table identifier included in the new synchronization rule Associated with the new synchronization rule.
结合第一方面的第十三种可能的实现方式,在第一方面的第十四种可能的实现方式中,所述转发设备在接收所述控制器发送的同步规则修改消息之后,在确定待修改的同步规则之前,还包括: With reference to the thirteenth possible implementation manner of the first aspect, in a fourteenth possible implementation manner of the first aspect, the forwarding device, after receiving the synchronization rule modification message sent by the controller, determines Before the modified synchronization rules, it also includes:
对所述新同步规则进行校验,并确定校验通过。The new synchronization rule is verified and the verification is determined to pass.
结合第一方面的第十一或第十三种可能的实现方式,在第一方面的第十五种可能的实现方式中,所述转发设备在确定待修改的同步规则之后,还包括:With reference to the eleventh or thirteenth possible implementation manner of the first aspect, in the fifteenth possible implementation manner of the first aspect, after the determining, by the forwarding device, the synchronization rule to be modified, the method further includes:
在所述待修改的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待修改的同步规则生成的目标流表项;Determining, according to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, a target flow entry generated based on the synchronization rule to be modified;
对确定的目标流表项进行无效处理。Invalid processing of the determined target flow entry.
结合第一方面的第十五种可能的实现方式,在第一方面的第十六种可能的实现方式中,所述转发设备在所述待修改的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待修改的同步规则生成的目标流表项,包括:With reference to the fifteenth possible implementation manner of the first aspect, in a sixteenth possible implementation manner of the first aspect, the forwarding device, in the target flow table identifier that is included in the synchronization rule to be modified, In the flow table, the target flow entry generated based on the synchronization rule to be modified is determined, including:
当所述待修改的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待修改的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, in the target flow table, the matching synchronization rule identifier included in the target flow table is a target flow entry identified by the synchronization rule of the synchronization rule to be modified, wherein the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
将查找到的目标流表项作为基于所述待修改的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be modified.
结合第一方面的第十五或第十六种可能的实现方式,在第一方面的第十七种可能的实现方式中,所述转发设备在对确定的目标流表项进行无效处理之后,还包括:With the fifteenth or sixteenth possible implementation manner of the first aspect, in the seventeenth possible implementation manner of the first aspect, after the forwarding device performs invalid processing on the determined target flow entry, Also includes:
根据所述新同步规则包括的源流表项的转换规则,对所述新同步规则包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中。And converting, according to the conversion rule of the source flow entry included in the new synchronization rule, the source flow entry in the source flow table corresponding to the source flow table identifier included in the new synchronization rule, and synchronizing the target flow entry generated after the conversion to the The target synchronization flow table included in the new synchronization rule is identified in the corresponding target flow table.
结合第一方面的第十七种可能的实现方式,在第一方面的第十八种可能的实现方式中,所述转发设备将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中,包括: In conjunction with the seventeenth possible implementation manner of the first aspect, in the eighteenth possible implementation manner of the first aspect, the forwarding device that synchronizes the target flow entry generated after the conversion to the new synchronization rule includes The target flow table identifies the corresponding target flow table, including:
将生成的目标流表项安装到所述新同步规则包括的目标流表标识对应的目标流表中。The generated target flow entry is installed in the target flow table corresponding to the target flow table identifier included in the new synchronization rule.
结合第一方面的第十一至第十八种可能的实现方式中任一种可能的实现方式,在第一方面的第十九种可能的实现方式中,所述转发设备在确定待修改的同步规则之后,还包括:With reference to any one of the eleventh to the eighteenth possible implementation manners of the first aspect, in the nineteenth possible implementation manner of the first aspect, the forwarding device determines the to-be-modified After synchronizing the rules, it also includes:
向所述控制器发送同步规则修改响应消息。A synchronization rule modification response message is sent to the controller.
结合第一方面或第一方面的以上任一种可能的实现方式,在第一方面的第二十种可能的实现方式中,还包括:With reference to the first aspect, or any one of the foregoing possible implementation manners of the first aspect, in the twentieth possible implementation manner of the first aspect, the method further includes:
所述转发设备接收所述控制器发送的同步规则删除消息;Receiving, by the forwarding device, a synchronization rule deletion message sent by the controller;
所述转发设备根据所述同步规则删除消息,确定待删除的同步规则;Determining, by the forwarding device, the synchronization rule according to the synchronization rule to determine a synchronization rule to be deleted;
所述转发设备将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联。The forwarding device de-associates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted with the synchronization rule to be deleted.
结合第一方面的第二十种可能的实现方式,在第一方面的第二十一种可能的实现方式中,所述转发设备在确定待删除的同步规则之后,还包括:In conjunction with the twentieth possible implementation of the first aspect, in the twenty-first possible implementation manner of the first aspect, after the determining, by the forwarding device, the synchronization rule to be deleted, the method further includes:
在所述待删除的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待删除的同步规则生成的目标流表项,并对确定的目标流表项进行无效处理。And determining, in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, a target flow entry generated based on the synchronization rule to be deleted, and performing invalid processing on the determined target flow entry.
结合第一方面的第二十一种可能的实现方式,在第一方面的第二十二种可能的实现方式中,所述转发设备在所述待删除的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待删除的同步规则生成的目标流表项,包括:With reference to the twenty-first possible implementation manner of the first aspect, in a twenty-second possible implementation manner of the first aspect, the forwarding device corresponds to the target flow table identifier included in the synchronization rule to be deleted In the target flow table, the target flow entry generated based on the synchronization rule to be deleted is determined, including:
当所述待删除的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待删除的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, in the target flow table, the included synchronization rule identifier is found as a target flow entry that is identified by a synchronization rule of the synchronization rule to be deleted, where the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
将查找到的目标流表项作为基于所述待删除的同步规则生成的目标流表 项。The found target flow entry is used as the target flow table generated based on the synchronization rule to be deleted. item.
结合第一方面的第二十至第二十二种可能的实现方式中的任一种可能的实现方式,在第一方面的第二十三种可能的实现方式中,所述转发设备在将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联之后,还包括:With reference to any one of the possible implementations of the twentieth to twenty-second possible implementations of the first aspect, in the twenty-third possible implementation manner of the first aspect, the forwarding device is After the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted is de-associated with the synchronization rule to be deleted, the method further includes:
向所述控制器发送同步规则删除响应消息。A synchronization rule deletion response message is sent to the controller.
结合第一方面的第一种可能的实现方式,在第一方面的第二十四种可能的实现方式中,所述转发设备对待无效的源流表项进行无效处理,包括:In conjunction with the first possible implementation of the first aspect, in the twenty-fourth possible implementation manner of the first aspect, the forwarding device performs invalid processing on the invalid source flow entry, including:
对所述待无效的源流表项设置设定的老化时间。The set aging time is set for the source flow entry to be invalidated.
结合第一方面的第三、第四、第十五、第二十一种可能的实现方式中的任一种可能的实现方式,在第一方面的第二十五种可能的实现方式中,所述转发设备对目标流表项进行无效处理,包括:With reference to any one of the possible implementation manners of the third, fourth, fifteenth, and twenty-first possible implementation manners of the first aspect, in the twenty-fifth possible implementation manner of the first aspect, The forwarding device performs invalid processing on the target flow entry, including:
对所述目标流表项设置设定的老化时间。Setting the aging time of the target flow entry.
结合第一方面的第二十五种可能的实现方式,在第一方面的第二十六种可能的实现方式中,所述转发设备对目标流表项进行无效处理,还包括:With reference to the twenty-fifth possible implementation manner of the first aspect, in the twenty-sixth possible implementation manner of the first aspect, the forwarding device performs invalid processing on the target flow entry, and further includes:
当所述目标流表项中保存有同步规则标识时,将所述目标流表项中包含的同步规则标识删除,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。When the synchronization rule identifier is saved in the target flow entry, the synchronization rule identifier included in the target flow entry is deleted, where the synchronization rule identifier is used to indicate that the target flow entry is based on the The synchronization rule identifies the corresponding synchronization rule generated.
第二方面,一种转发设备,包括:In a second aspect, a forwarding device includes:
第一确定单元,用于在对一源流表修改后,确定与所述源流表关联的同步规则,同步规则中包括源流表标识、目标流表标识,以及源流表项的转换规则,其中,所述源流表项为所述源流表标识对应的源流表中的流表项,所述同步规则包括的源流表标识与所述源流表的源流表标识相同;a first determining unit, configured to determine, after modifying a source flow table, a synchronization rule associated with the source flow table, where the synchronization rule includes a source flow table identifier, a target flow table identifier, and a conversion rule of the source flow entry, where The source flow table entry is a flow entry in the source flow table corresponding to the source flow table identifier, and the source flow table identifier included in the synchronization rule is the same as the source flow table identifier of the source flow table;
第一处理单元,用于根据所述源流表,确定待同步的源流表项,并根据所述源流表项的转换规则,对所述待同步的源流表项进行转换,将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中。a first processing unit, configured to determine, according to the source flow table, a source flow entry to be synchronized, and convert the source flow entry to be synchronized according to a conversion rule of the source flow entry, and convert the generated target The flow entry is synchronized to the target flow table corresponding to the target flow table identifier.
结合第二方面,在第二方面的第一种可能的实现方式中,所述第一处理 单元,用于:With reference to the second aspect, in a first possible implementation manner of the second aspect, the first processing Unit for:
当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,将安装到所述源流表中所述待增加的源流表项作为待同步的源流表项;或者When the source flow table is modified to install the source flow entry to be added to the source flow table, the source flow entry to be added to the source flow table is used as the source flow entry to be synchronized; or
当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,将所述源流表中的所述待修改的源流表项、修改后的源流表项作为待同步的源流表项;或者When the source flow table is modified to modify the source flow entry to be modified in the source flow table, the source flow entry to be modified and the modified source flow entry in the source flow table are to be synchronized. Source flow entry; or
当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,将所述源流表中所述待无效的源流表项作为待同步的源流表项。When the source flow table is modified to invalidate the source flow entry to be invalidated in the source flow table, the source flow entry to be invalidated in the source flow table is used as the source flow entry to be synchronized.
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,所述第一处理单元,用于:In conjunction with the first possible implementation of the second aspect, in a second possible implementation manner of the second aspect, when the source flow table is modified to install the source flow entry to be added to the source flow table, The first processing unit is configured to:
将生成的目标流表项安装到所述目标流表标识对应的目标流表中。The generated target flow entry is installed in the target flow table corresponding to the target flow table identifier.
结合第二方面的第一种可能的实现方式,在第二方面的第三种可能的实现方式中,当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,所述第一处理单元,用于:With the first possible implementation of the second aspect, in a third possible implementation manner of the second aspect, when the source flow table is modified to modify the source flow entry to be modified in the source flow table, The first processing unit is configured to:
在所述目标流表标识对应的目标流表中,查找到所述待修改的源流表项转换后生成的目标流表项后,对查找到的目标流表项进行无效处理;After the target flow entry generated by the source flow entry to be modified is found in the target flow table corresponding to the target flow table identifier, the target flow entry that is found is invalidized after being found;
将修改后的源流表项转换后生成的目标流表项安装到所述目标流表标识对应的目标流表中。The target flow entry generated after the modified source flow entry is converted is installed in the target flow table corresponding to the target flow table identifier.
结合第二方面的第一种可能的实现方式,在第二方面的第四种可能的实现方式中,当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,所述第一处理单元,用于:With reference to the first possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, when the source flow table is modified to invalidate the source flow entry to be invalid in the source flow table When processed, the first processing unit is configured to:
在所述目标流表标识对应的目标流表中,查找到生成的目标流表项后,对查找到的目标流表项进行无效处理。After the generated target flow entry is found in the target flow table corresponding to the target flow table identifier, the found target flow entry is invalidated.
结合第二方面的第二种或第三种可能的实现方式,在第二方面的第五种可能的实现方式中,所述第一处理单元,在将生成的目标流表项安装到所述目标流表标识对应的目标流表中时,用于: With reference to the second or third possible implementation of the second aspect, in a fifth possible implementation manner of the second aspect, the first processing unit is configured to install the generated target flow entry to the When the target flow table identifies the corresponding target flow table, it is used to:
将生成的包含有同步规则标识的所述目标流表项,安装到所述目标流表标识对应的目标流表中,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。And the generated target flow entry is included in the target flow table corresponding to the target flow table identifier, where the synchronization rule identifier is used to indicate that the target flow entry is based on the The synchronization rule identifies the corresponding synchronization rule generated.
结合第二方面或第二方面的以上任一种可能的实现方式,在第二方面的第六种可能的实现方式中,还包括:With reference to the second aspect or any one of the foregoing possible implementation manners of the second aspect, in a sixth possible implementation manner of the second aspect, the method further includes:
第一发送单元,用于在将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中之后,向所述控制器发送目标流表变化通知消息。The first sending unit is configured to send a target flow table change notification message to the controller after synchronizing the target flow entry generated after the conversion to the target flow table corresponding to the target flow table identifier.
结合第二方面或第二方面的以上任一种可能的实现方式,在第二方面的第七种可能的实现方式中,还包括:With reference to the second aspect or any one of the foregoing possible implementation manners of the second aspect, in a seventh possible implementation manner of the second aspect, the method further includes:
第一接收单元,用于接收所述控制器发送同步规则增加消息,所述同步规则增加消息中包含待增加的同步规则;a first receiving unit, configured to receive, by the controller, a synchronization rule addition message, where the synchronization rule addition message includes a synchronization rule to be added;
第一关联单元,用于将所述待增加的同步规则中包括的源流表标识对应的源流表与接收的所述待增加的同步规则建立关联。The first association unit is configured to associate the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added with the received synchronization rule to be added.
结合第二方面的第七种可能的实现方式,在第二方面的第八种可能的实现方式中,还包括:In conjunction with the seventh possible implementation of the second aspect, in an eighth possible implementation manner of the second aspect, the method further includes:
第一校验单元,用于在接收到控制器发送的同步规则增加消息之后,在将所述待增加的同步规则中包括的源流表标识对应的源流表、接收的所述同步规则建立关联之前,对所述待增加的同步规则进行校验,并确定校验通过。a first checking unit, configured to: after receiving the synchronization rule addition message sent by the controller, before associating the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added, and the received synchronization rule And verifying the synchronization rule to be added, and determining that the verification is passed.
结合第二方面的第八种可能的实现方式,在第二方面的第九种可能的实现方式中,第二发送单元,用于:In conjunction with the eighth possible implementation of the second aspect, in a ninth possible implementation manner of the second aspect, the second sending unit is configured to:
在将所述待增加的同步规则中包括的源流表标识对应的源流表、接收的所述同步规则建立关联之后,向所述控制器发送同步规则增加响应消息。After the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added is associated with the received synchronization rule, a synchronization rule increase response message is sent to the controller.
结合第二方面的第七至第九种可能的实现方式中的任一种可能的实现方式,在第二方面的第十种可能的实现方式中,还包括:With reference to any one of the possible implementations of the seventh to the ninth possible implementations of the second aspect, in a tenth possible implementation manner of the second aspect, the method further includes:
第二处理单元,用于在接收所述控制器发送同步规则增加消息之后,根据所述待增加的同步规则包括的源流表项的转换规则,对所述待增加的同步规则中包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生 成的目标流表项同步至所述待增加的同步规则包括的目标流表标识对应的目标流表中。a second processing unit, configured to: after receiving the synchronization rule addition message, the source flow table included in the synchronization rule to be added according to the conversion rule of the source flow entry included in the synchronization rule to be added Identify the source flow entry in the corresponding source flow table for conversion. The target flow entry is synchronized to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be added.
结合第二方面或第二方面的第一至第十种可能的实现方式中的任一种可能的实现方式,在第二方面的第十一种可能的实现方式中,还包括:With reference to the second aspect, or any one of the first to the tenth possible implementation manners of the second aspect, in an eleventh possible implementation manner of the second aspect, the method further includes:
第二接收单元,用于接收所述控制器发送的同步规则修改消息,所述同步规则修改消息中包括同步规则修改规则;a second receiving unit, configured to receive a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a synchronization rule modification rule;
第二确定单元,用于根据所述同步规则修改消息,确定待修改的同步规则;a second determining unit, configured to modify a message according to the synchronization rule, and determine a synchronization rule to be modified;
生成单元,用于根据所述同步规则修改规则、以及所述待修改的同步规则,生成新同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同;a generating unit, configured to generate a new synchronization rule according to the synchronization rule modification rule and the synchronization rule to be modified, where the new synchronization rule and the source flow table identifier and target included in the synchronization rule to be modified The flow table identifiers are the same, and the conversion rules of the source flow entries are different.
第二关联单元,用于将所述待修改的同步规则中包括的源流表标识对应的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。a second association unit, configured to disassociate the source flow table corresponding to the source flow table identifier included in the synchronization rule to be modified, and the synchronization rule to be modified; and corresponding to the source flow table identifier included in the new synchronization rule The source flow table is associated with the new synchronization rule.
结合第二方面的第十一种可能的实现方式,在第二方面的第十二种可能的实现方式中,还包括:With reference to the eleventh possible implementation manner of the second aspect, in a twelfth possible implementation manner of the second aspect, the method further includes:
第二校验单元,用于在确定待修改的同步规则之后,在生成新同步规则之前,基于所述待修改的同步规则,对所述同步规则修改消息进行校验,并确定校验通过。The second check unit is configured to check the synchronization rule modification message based on the synchronization rule to be modified, and determine the verification pass, after determining the synchronization rule to be modified, before generating the new synchronization rule.
结合第二方面或第二方面的第一至第十种可能的实现方式中的任一种可能的实现方式,在第二方面的第十三种可能的实现方式中,还包括:With reference to the second aspect or any one of the first to the tenth possible implementation manners of the second aspect, in the thirteenth possible implementation manner of the second aspect, the method further includes:
第二接收单元,用于接收所述控制器发送的同步规则修改消息,所述同步规则修改消息中包括新同步规则;a second receiving unit, configured to receive a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a new synchronization rule;
第二确定单元,用于根据所述同步规则修改消息,确定待修改的同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同;a second determining unit, configured to determine, according to the synchronization rule modification message, a synchronization rule to be modified, where the new synchronization rule is the same as the source flow table identifier and the target flow table identifier included in the synchronization rule to be modified, The conversion rules of the source flow entries are different.
第二关联单元,用于将所述待修改的同步规则中包括的源流表标识对应 的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。a second association unit, configured to correspond to the source flow table identifier included in the synchronization rule to be modified The source flow table is de-associated with the synchronization rule to be modified; and the source flow table corresponding to the source flow table identifier included in the new synchronization rule is associated with the new synchronization rule.
结合第二方面的第十三种可能的实现方式,在第二方面的第十四种可能的实现方式中,还包括:With reference to the thirteenth possible implementation manner of the second aspect, in the fourteenth possible implementation manner of the second aspect, the method further includes:
第二校验单元,用于在接收所述控制器发送的同步规则修改消息之后,在确定待修改的同步规则之前,对所述新同步规则进行校验,并确定校验通过。The second check unit is configured to check the new synchronization rule and determine the verification pass before determining the synchronization rule to be modified after receiving the synchronization rule modification message sent by the controller.
结合第二方面的第十一或第十三种可能的实现方式,在第二方面的第十五种可能的实现方式中,还包括:With reference to the eleventh or thirteenth possible implementation manner of the second aspect, in the fifteenth possible implementation manner of the second aspect, the method further includes:
第三处理单元,用于在确定待修改的同步规则之后,在所述待修改的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待修改的同步规则生成的目标流表项;a third processing unit, configured to: after determining the synchronization rule to be modified, determine, in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, the target flow generated based on the synchronization rule to be modified Entry
对确定的目标流表项进行无效处理。Invalid processing of the determined target flow entry.
结合第二方面的第十五种可能的实现方式,在第二方面的第十六种可能的实现方式中,所述第三处理单元,用于:In conjunction with the fifteenth possible implementation of the second aspect, in a sixteenth possible implementation manner of the second aspect, the third processing unit is configured to:
当所述待修改的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待修改的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, in the target flow table, the matching synchronization rule identifier included in the target flow table is a target flow entry identified by the synchronization rule of the synchronization rule to be modified, wherein the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
将查找到的目标流表项作为基于所述待修改的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be modified.
结合第二方面的第十五或第十六种可能的实现方式,在第二方面的第十七种可能的实现方式中,所述第三处理单元,还用于:In conjunction with the fifteenth or sixteenth possible implementation manner of the second aspect, in the seventeenth possible implementation manner of the second aspect, the third processing unit is further configured to:
在对确定的目标流表项进行无效处理之后,根据所述新同步规则包括的源流表项的转换规则,对所述新同步规则包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标流表项同步至所述新同步规则包 括的目标流表标识对应的目标流表中。After the invalidation of the determined target flow entry, the source flow entry in the source flow table corresponding to the source flow table identifier included in the new synchronization rule is converted according to the conversion rule of the source flow entry included in the new synchronization rule. , synchronizing the generated target flow entry to the new synchronization rule package The target flow table identifier is identified in the corresponding target flow table.
结合第二方面的第十七种可能的实现方式,在第二方面的第十八种可能的实现方式中,所述第三处理单元,在将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中时,用于:In conjunction with the seventeenth possible implementation of the second aspect, in the eighteenth possible implementation of the second aspect, the third processing unit synchronizes the target flow entry generated after the conversion to the When the new synchronization rule includes the target flow table identifier in the corresponding target flow table, it is used to:
将生成的目标流表项安装到所述新同步规则包括的目标流表标识对应的目标流表中。The generated target flow entry is installed in the target flow table corresponding to the target flow table identifier included in the new synchronization rule.
结合第二方面的第十一至第十八种可能的实现方式中任一种可能的实现方式,在第二方面的第十九种可能的实现方式中,还包括:With reference to any one of the eleventh to the eighteenth possible implementation manners of the second aspect, in a nineteenth possible implementation manner of the second aspect, the method further includes:
第三发送单元,用于在确定待修改的同步规则之后,向所述控制器发送同步规则修改响应消息。And a third sending unit, configured to send a synchronization rule modification response message to the controller after determining the synchronization rule to be modified.
结合第二方面或第二方面的以上任一种可能的实现方式,在第二方面的第二十种可能的实现方式中,还包括:With reference to the second aspect or any one of the foregoing possible implementation manners of the second aspect, in the twentieth possible implementation manner of the second aspect, the method further includes:
第三接收单元,用于接收所述控制器发送的同步规则删除消息;a third receiving unit, configured to receive a synchronization rule deletion message sent by the controller;
第三确定单元,用于根据所述同步规则删除消息,确定待删除的同步规则;a third determining unit, configured to delete a message according to the synchronization rule, and determine a synchronization rule to be deleted;
第三关联单元,用于将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联。The third association unit is configured to disassociate the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted from the synchronization rule to be deleted.
结合第二方面的第二十种可能的实现方式,在第二方面的第二十一种可能的实现方式中,还包括:With reference to the twentieth possible implementation of the second aspect, in the twenty-first possible implementation manner of the second aspect, the method further includes:
第四处理单元,用于所述转发设备在确定待删除的同步规则之后,在所述待删除的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待删除的同步规则生成的目标流表项,并对确定的目标流表项进行无效处理。a fourth processing unit, configured to: after the determining, by the forwarding device, the synchronization rule to be deleted, determining, according to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, the synchronization rule to be deleted The generated target flow entry and invalidate the determined target flow entry.
结合第二方面的第二十一种可能的实现方式,在第二方面的第二十二种可能的实现方式中,所述第四处理单元,用于:In conjunction with the twenty-first possible implementation of the second aspect, in a twenty-second possible implementation manner of the second aspect, the fourth processing unit is configured to:
当所述待删除的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待删除的同步规则的同步规则标识的目标流表项,其中,所述同 步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, in the target flow table, the included synchronization rule identifier is found as The target flow entry identified by the synchronization rule of the synchronization rule to be deleted, where the same The step rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
将查找到的目标流表项作为基于所述待删除的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be deleted.
结合第二方面的第二十至第二十二种可能的实现方式中的任一种可能的实现方式,在第二方面的第二十三种可能的实现方式中,还包括:With reference to the possible implementation of any one of the twentieth to the twenty-second possible implementation manners of the second aspect, in the twenty-third possible implementation manner of the second aspect, the method further includes:
第四发送单元,用于在将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联之后,向所述控制器发送同步规则删除响应消息。And a fourth sending unit, configured to send a synchronization rule deletion response message to the controller after disassociating the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted from the synchronization rule to be deleted.
结合第二方面的第一种可能的实现方式,在第二方面的第二十四种可能的实现方式中,对待无效的源流表项进行无效处理,包括:In conjunction with the first possible implementation of the second aspect, in the twenty-fourth possible implementation manner of the second aspect, the source flow entry to be invalidated is invalidated, including:
对所述待无效的源流表项设置设定的老化时间。The set aging time is set for the source flow entry to be invalidated.
结合第二方面的第三、第四、第十五、第二十一种可能的实现方式中的任一种可能的实现方式,在第二方面的第二十五种可能的实现方式中,对目标流表项进行无效处理,包括:With reference to any one of the possible implementation manners of the third, fourth, fifteenth, and twentieth possible implementations of the second aspect, in the twenty-fifth possible implementation manner of the second aspect, Invalidate the target flow entry, including:
对所述目标流表项设置设定的老化时间。Setting the aging time of the target flow entry.
结合第二方面的第二十五种可能的实现方式,在第二方面的第二十六种可能的实现方式中,对目标流表项进行无效处理,还包括:With reference to the twenty-fifth possible implementation manner of the second aspect, in the twenty-sixth possible implementation manner of the second aspect, the target flow entry is invalidated, and the method further includes:
当所述目标流表项中保存有同步规则标识时,将所述目标流表项中包含的同步规则标识删除,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。When the synchronization rule identifier is saved in the target flow entry, the synchronization rule identifier included in the target flow entry is deleted, where the synchronization rule identifier is used to indicate that the target flow entry is based on the The synchronization rule identifies the corresponding synchronization rule generated.
本发明实施例中,在转发设备中的源流表修改后,可以直接确定待同步的源流表项,并基于与该源流表关联的同步规则,对该待同步的流表项进行转换,并将转换后生成的目标流表项同步至目标流表中。由于不需要通过控制器进行流表间的同步,而是转发设备独立完成整个同步过程,因此避免了浪费控制器的计算资源,也避免了交换机与控制器之间的信令交互,减小了流表同步的时延。 In the embodiment of the present invention, after the source flow table in the forwarding device is modified, the source flow entry to be synchronized may be directly determined, and the flow entry to be synchronized is converted based on the synchronization rule associated with the source flow table, and The target stream entry generated after the conversion is synchronized to the target flow table. Since the synchronization between the flow tables is not required by the controller, the forwarding device independently completes the entire synchronization process, thereby avoiding wasting the computing resources of the controller and avoiding the signaling interaction between the switch and the controller, thereby reducing the signaling interaction between the switch and the controller. The delay of the flow table synchronization.
附图说明DRAWINGS
图1为本发明实施例提供的一种流表同步的实现方法的流程图;FIG. 1 is a flowchart of a method for implementing flow table synchronization according to an embodiment of the present invention;
图2为本发明实施例提供的一种增加同步规则的方法的流程图;2 is a flowchart of a method for adding a synchronization rule according to an embodiment of the present invention;
图3为本发明实施例提供的一种修改同步规则的方法的流程图;FIG. 3 is a flowchart of a method for modifying a synchronization rule according to an embodiment of the present invention;
图4为本发明实施例提供的另一种修改同步规则的方法的流程图;FIG. 4 is a flowchart of another method for modifying a synchronization rule according to an embodiment of the present invention;
图5为本发明实施例提供的一种删除同步规则的方法的流程图;FIG. 5 is a flowchart of a method for deleting a synchronization rule according to an embodiment of the present invention;
图6为本发明实施例提供的一种转发设备的结构示意图;FIG. 6 is a schematic structural diagram of a forwarding device according to an embodiment of the present disclosure;
图7为本发明实施例提供的一种转发设备的结构图。FIG. 7 is a structural diagram of a forwarding device according to an embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The present invention will be further described in detail with reference to the accompanying drawings, in which FIG. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例提供一种流表同步的实现方法及转发设备,用以解决现有技术中存在的流表间同步时耗费控制器计算资源,增加同步时延的问题。其中,方法和装置是基于同一发明构思的,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。The embodiment of the invention provides a method for implementing flow table synchronization and a forwarding device, which is used to solve the problem that the controller computing resources are consumed and the synchronization delay is increased when the flow table is synchronized in the prior art. The method and the device are based on the same inventive concept. Since the principles of the method and the device for solving the problem are similar, the implementation of the device and the method can be referred to each other, and the repeated description is not repeated.
在现有技术中,流表间实现同步的过程中,转发设备要将待同步的流表项通知控制器,再由控制器将待同步的流表项进行转换生成同步流表项,并将生成的同步流表项发送至转发设备,显然传统的流表间同步时,耗费了控制器的计算资源,增加了同步时延;而采用本发明技术方案,转发设备在对一源流表修改后,确定与所述源流表关联的同步规则,其中,同步规则中包括源流表标识、目标流表标识,以及源流表项的转换规则,源流表项为所述源流表标识对应的源流表中的流表项;转发设备根据所述源流表,确定待同 步的源流表项,并根据所述源流表项的转换规则,对所述待同步的源流表项进行转换,并将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中,这样,在转发设备中的源流表修改后,可以直接确定待同步的源流表项,并基于与该源流表关联的同步规则,对该待同步的流表项进行转换,并将转换后生成的目标流表项同步至目标流表中,由于不需要通过控制器进行流表间的同步,而是转发设备独立完成整个同步过程,因此避免了浪费控制器的计算资源,也避免了交换机与控制器之间的信令交互,减小了流表同步的时延。In the prior art, in the process of implementing synchronization between the flow tables, the forwarding device notifies the controller of the flow entry to be synchronized, and then the controller converts the flow entry to be synchronized to generate a synchronous flow entry, and The generated synchronous flow entry is sent to the forwarding device. Obviously, when the traditional flow table is synchronized, the computing resource of the controller is consumed, and the synchronization delay is increased. However, after the technical solution of the present invention is used, the forwarding device is modified after the source flow table is modified. Determining a synchronization rule associated with the source flow table, where the synchronization rule includes a source flow table identifier, a target flow table identifier, and a conversion rule of the source flow entry, where the source flow entry is in the source flow table corresponding to the source flow table identifier. a flow entry; the forwarding device determines to wait for the same according to the source flow table. a source flow entry of the step, and converting the source flow entry to be synchronized according to the conversion rule of the source flow entry, and synchronizing the target flow entry generated after the conversion to the target corresponding to the target flow table identifier In the flow table, after the source flow table in the forwarding device is modified, the source flow entry to be synchronized can be directly determined, and the flow entry to be synchronized is converted based on the synchronization rule associated with the source flow table, and The target flow entry generated after the conversion is synchronized to the target flow table. Since the synchronization between the flow tables is not required by the controller, the forwarding device independently completes the entire synchronization process, thereby avoiding wasting the computing resources of the controller and avoiding The signaling interaction between the switch and the controller reduces the delay of the flow table synchronization.
本发明实施例提供了一种流表同步的实现方法,适用于SDN架构中的转发设备,如交换机等,下面结合附图对本发明优选的实施方式进行详细说明。The embodiment of the present invention provides a method for implementing flow table synchronization, which is applicable to a forwarding device in an SDN architecture, such as a switch. The preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings.
参阅图1所示,该方法的具体流程包括:Referring to Figure 1, the specific process of the method includes:
步骤101:转发设备在对一源流表修改后,确定与所述源流表关联的同步规则,同步规则中包括源流表标识、目标流表标识,以及源流表项的转换规则,其中,所述源流表项为所述源流表标识对应的源流表中的流表项,所述同步规则包括的源流表标识与所述源流表的源流表标识相同。Step 101: The forwarding device determines, after modifying a source flow table, a synchronization rule associated with the source flow table, where the synchronization rule includes a source flow table identifier, a target flow table identifier, and a conversion rule of the source flow entry, where the source flow The entry is a flow entry in the source flow table corresponding to the source flow table identifier, and the source flow table identifier included in the synchronization rule is the same as the source flow table identifier of the source flow table.
转发设备对所述源流表修改,包括以下几种方式:The forwarding device modifies the source flow table, including the following methods:
第一种方式:将待增加的源流表项安装至所述源流表中;The first method is: installing the source flow entry to be added into the source flow table;
第二种方式:对所述源流表中待修改的源流表项进行修改;The second method is: modifying the source flow entry to be modified in the source flow table;
第三种方式:将所述源流表中的待无效的源流表项进行无效处理。The third mode: invalidating the source flow entry to be invalid in the source flow table.
在第一种方式中,转发设备增加新的源流表项到源流表的时机,包括:在转发设备可以自学习到一个流表项,将该流表项作为待增加的源流表项;或者在转发设备接收到控制器发送的指示增加流表项的修改流表Flow Modification消息,将该Flow Modification消息中包含的流表项作为待增加的源流表项等,本发明对此不做限定。In the first mode, the forwarding device adds a new source flow entry to the source flow table, including: the forwarding device can self-learn a flow entry, and the flow entry is used as the source flow entry to be added; or The forwarding device receives the modified flow table Flow Modification message sent by the controller to increase the flow entry, and the flow entry included in the Flow Modification message is used as the source flow entry to be added.
在第二种方式中,转发设备对源流表中的源流表项进行修改的时机,包括:在转发设备接收到控制器发送的指示修改流表项的Flow Modification消息,根据Flow Modification消息中的源流表项的标识,确定待修改的源流表 项,在根据Flow Modification消息包含的流表项修改规则,对确定的待修改的源流表项进行修改,其中,源流表项的标识可以为源流表项的序号编码等,或者为匹配域+优先级,本发明对此不做限定。In the second mode, the timing of the modification of the source flow entry in the source flow table by the forwarding device includes: receiving, by the forwarding device, a Flow Modification message sent by the controller to modify the flow entry, according to the source flow in the Flow Modification message. The identifier of the entry to determine the source flow table to be modified. The item is modified according to the flow entry modification rule included in the flow Modification message, and the source flow entry to be modified is modified, wherein the identifier of the source flow entry may be the serial number of the source flow entry, or the matching domain + priority The present invention does not limit this.
在第三种方式中,转发设备对待无效的源流表项进行无效处理,即使该待无效的源流表项在指定时刻后失去工作能力,无法进行匹配,其中,进行无效处理包括多种方式,例如,将待无效的源流表项进行删除,或者对待无效的源流表项设置老化时间,或者将待无效的源流表项中的某一项可以指示该源流表项工作能力的信息进行修改等,本发明对此不做限定。转发设备对待无效的源流表项进行无效处理的时机,包括:在源流表存储空间不足时,删除其中某些源流表项;或者接收到控制器发送的指示无效流表项的Flow Modification消息,根据Flow Modification消息中的源流表项的标识,确定待无效的源流表项。In the third mode, the forwarding device performs invalid processing on the invalid source flow entry, even if the source flow entry to be invalid loses the working capability after the specified time, and cannot be matched, wherein the invalidation process includes multiple manners, for example, The source flow entry to be invalidated is deleted, or the aging time is set for the invalid source flow entry, or one of the source flow entries to be invalid can be used to modify the information of the source flow entry. The invention does not limit this. When the forwarding device invalidates the invalid source flow entry, the method includes: deleting some of the source flow entries when the source flow table storage space is insufficient; or receiving a Flow Modification message sent by the controller indicating the invalid flow entry, according to The identifier of the source flow entry in the flow Modification message determines the source flow entry to be invalid.
在转发设备中源流表与包含该源流表标识的同步规则建立关联,其中,具体的,源流表与同步规则建立关联,包括将该同步规则保存至该源流表中或者,将该同步规则进行一些安装处理等操作,使该规则与该源流表之间存在关联,即将同步规则在源流表侧进行维护,这样,在源流表修改后,可以直接确定与源流表关联的同步规则,进而进行同步操作,且由于同步规则中还包含有目标流表标识,因此,可以快速找到目标流表进行同步,缩小了流表同步的时延,提高了流表同步的效率。In the forwarding device, the source flow table is associated with the synchronization rule that includes the source flow table identifier. Specifically, the source flow table is associated with the synchronization rule, including saving the synchronization rule to the source flow table, or performing the synchronization rule. After the installation process is performed, the rule is associated with the source flow table. That is, the synchronization rule is maintained on the source flow table side. After the source flow table is modified, the synchronization rule associated with the source flow table can be directly determined, and then the synchronization operation is performed. Because the synchronization rule also includes the target flow table identifier, the target flow table can be quickly found for synchronization, the delay of the flow table synchronization is reduced, and the efficiency of the flow table synchronization is improved.
一般流表项中包括多项信息,如包含匹配域、优先级、操作、老化时间、标志位等,可选的,在将源流表转换为目标流表时,对于源流表中的某些简单信息,如标识位等可以直接进行复制,而不需要修改,但是对于源流表中的某些复杂信息,如匹配域、操作等,需要从该源流表中提取并按照指定的算法或规则进行转换,生成新的匹配域、操作。同步规则中的流表项转换规则中规定了源流表项中需要进行转换的信息,以及对应的转换算法或规则。A general flow entry includes multiple information, such as the matching domain, priority, operation, aging time, and flag. Optionally, when converting the source flow table to the target flow table, some simple ones in the source flow table are used. Information, such as identifiers, can be copied directly without modification. However, some complex information in the source flow table, such as matching fields and operations, needs to be extracted from the source flow table and converted according to the specified algorithm or rule. , generate a new matching domain, operation. The flow entry conversion rule in the synchronization rule specifies the information that needs to be converted in the source flow entry, and the corresponding conversion algorithm or rule.
步骤102:所述转发设备根据所述源流表,确定待同步的源流表项,并根据所述源流表项的转换规则,对所述待同步的源流表项进行转换,将转换后 生成的目标流表项同步至所述目标流表标识对应的目标流表中。Step 102: The forwarding device determines, according to the source flow table, the source flow entry to be synchronized, and converts the source flow entry to be synchronized according to the conversion rule of the source flow entry, and then converts the source flow entry to be synchronized. The generated target flow entry is synchronized to the target flow table corresponding to the target flow table identifier.
由于在步骤401中对所述源流表的修改方式不同,因此,在所述转发设备根据所述源流表,确定的待同步的源流表项也不同。具体的,包括:The source flow entry to be synchronized determined by the forwarding device according to the source flow table is also different according to the modification manner of the source flow table in the step 401. Specifically, including:
当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,所述转发设备根据所述源流表,确定需要同步的源流表项,包括:When the source flow table is modified to install the source flow entry to be added to the source flow table, the forwarding device determines, according to the source flow table, the source flow entry to be synchronized, including:
所述转发设备将安装到所述源流表中所述待增加的源流表项作为待同步的源流表项;The forwarding device installs the source flow entry to be added in the source flow table as a source flow entry to be synchronized;
当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,所述转发设备根据所述源流表,确定需要同步的源流表项,包括:When the source flow table is modified to modify the source flow entry to be modified in the source flow table, the forwarding device determines, according to the source flow table, the source flow entry to be synchronized, including:
所述转发设备将所述源流表中的所述待修改的源流表项、修改后的源流表项作为待同步的源流表项;The forwarding device uses the source flow entry to be modified and the modified source flow entry in the source flow table as the source flow entry to be synchronized;
当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,所述转发设备根据所述源流表,确定需要同步的源流表项,包括:When the source flow table is modified to invalidate the source flow entry to be invalidated in the source flow table, the forwarding device determines, according to the source flow table, the source flow entry to be synchronized, including:
所述转发设备将所述源流表中所述待无效的源流表项作为待同步的源流表项。The forwarding device uses the source flow entry to be invalidated in the source flow table as a source flow entry to be synchronized.
由于在步骤401中对所述源流表的修改方式不同,在所述转发设备根据所述源流表,确定的待同步的源流表项也不同,进而导致在根据所述源流表项的转换规则,对所述待同步的源流表项进行转换后,如何将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中也不相同,具体包括以下几种方式:The source flow entry to be synchronized is different according to the source flow table, and the source flow entry to be synchronized is different according to the source flow table, and the conversion rule according to the source flow entry is further caused by the change of the source flow table in the step 401. After the source stream entry to be synchronized is converted, how to synchronize the target flow entry generated after the conversion to the target flow table corresponding to the target flow table identifier is different, and specifically includes the following methods:
第一种方式:当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,所述转发设备将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中,包括:所述转发设备将生成的目标流表项安装到所述目标流表标识对应的目标流表中。The first mode is: when the source flow table is modified to install the source flow entry to be added to the source flow table, the forwarding device synchronizes the target flow entry generated after the conversion to the target flow table identifier. The corresponding target flow table includes: the forwarding device installs the generated target flow entry into the target flow table corresponding to the target flow table identifier.
第二种方式:当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,所述转发设备将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中,包括: The second mode is: when the source flow table is modified to modify the source flow entry to be modified in the source flow table, the forwarding device synchronizes the target flow entry generated after the conversion to the target flow table identifier. The corresponding target flow table includes:
在所述目标流表标识对应的目标流表中,查找到所述待修改的源流表项转换后生成的目标流表项后,对查找到的目标流表项进行无效处理;After the target flow entry generated by the source flow entry to be modified is found in the target flow table corresponding to the target flow table identifier, the target flow entry that is found is invalidized after being found;
将修改后的源流表项转换后生成的目标流表项安装到所述目标流表标识对应的目标流表中。The target flow entry generated after the modified source flow entry is converted is installed in the target flow table corresponding to the target flow table identifier.
第三种方式:当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,所述转发设备将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中,包括:The third mode is: when the source flow table is modified to invalidate the source flow entry to be invalid in the source flow table, the forwarding device synchronizes the target flow entry generated after the conversion to the target flow The table identifier corresponds to the target flow table, including:
在所述目标流表标识对应的目标流表中,查找到生成的目标流表项后,对查找到的目标流表项进行无效处理。After the generated target flow entry is found in the target flow table corresponding to the target flow table identifier, the found target flow entry is invalidated.
其中,对查找到的目标流表项进行无效处理,即使该目标流表项在指定时刻后失去工作能力,无法进行匹配,该指定时刻可以为查找到该目标流表项时,或者在查找到该目标流表项设定时间段后,本发明对此不做限定。对目标流表项进行无效处理包括多种方式,例如,将目标流表项进行删除;或者对目标流表项设置设定的老化时间,其中该老化时间可以为转发设备预设的,或者用户设置的,或者复制该目标流表项对应的源流表项的老化时间等;或者将目标流表项中的某一项可以指示该目标流表项工作能力的信息进行修改等,本发明对此不做限定。The target flow entry is invalidated even if the target flow entry fails to work after the specified time, and the specified time can be found when the target flow entry is found, or After the target flow entry is set for a period of time, the present invention does not limit this. The invalidation of the target flow entry includes multiple methods, for example, deleting the target flow entry; or setting the aging time of the target flow entry, where the aging time may be preset for the forwarding device, or the user The aging time of the source flow entry corresponding to the target flow entry is set, or the information of the target flow entry can be modified to indicate the working capability of the target flow entry, and the present invention Not limited.
在上述第一种方式以及第二种方式中,所述转发设备将生成的目标流表项安装到所述目标流表标识对应的目标流表中,包括:In the first mode and the second mode, the forwarding device installs the generated target flow entry into the target flow table corresponding to the target flow table identifier, including:
直接将生成的目标流表安装到所述目标流表标识对应的目标流表中;或者Directly installing the generated target flow table into the target flow table corresponding to the target flow table identifier; or
将生成的包含有同步规则标识的所述目标流表项,安装到所述目标流表标识对应的目标流表中,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。And the generated target flow entry is included in the target flow table corresponding to the target flow table identifier, where the synchronization rule identifier is used to indicate that the target flow entry is based on the The synchronization rule identifies the corresponding synchronization rule generated.
在基于同步规则生成的目标流表项中添加同步规则标识,用于指示该目标流表项是基于该同步规则标识生成的,这样,转发设备在后期对该同步规则进行修改或删除等操作时,可以快速的找到基于该同步规则生成的目标流 表项,进而将找到的目标流表项进行无效,提高了在同步规则修改或删除时流表的同步效率。A synchronization rule identifier is added to the target flow entry that is generated by the synchronization rule, and is used to indicate that the target flow entry is generated based on the synchronization rule identifier, so that the forwarding device performs operations such as modifying or deleting the synchronization rule later. , you can quickly find the target stream generated based on the synchronization rule The entry, in addition, invalidates the found target flow entry, which improves the synchronization efficiency of the flow table when the synchronization rule is modified or deleted.
在步骤102所述转发设备在将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中之后,还包括:After the forwarding device synchronizes the target flow entry generated after the conversion to the target flow table corresponding to the target flow table identifier, the forwarding device further includes:
向所述控制器发送目标流表变化通知消息。A target flow table change notification message is sent to the controller.
转发设备通过该目标流表变化通知消息通知控制器,目标流表已经发生变化。The forwarding device notifies the controller through the target flow table change notification message that the target flow table has changed.
采用本发明实施例提供的流表同步的实现方法,在转发设备中的源流表修改后,可以直接确定待同步的源流表项,并基于与该源流表关联的同步规则,对该待同步的流表项进行转换,并将转换后生成的目标流表项同步至目标流表中,由于不需要通过控制器进行流表间的同步,而是转发设备独立完成整个同步过程,因此避免了浪费控制器的计算资源,也避免了交换机与控制器之间的信令交互,减小了流表同步的时延,实现了转发设备和控制器的彻底解耦,同时,在转发设备中源流表与包含该源流表标识的同步规则建立关联,即将同步规则在源流表侧进行维护,在源流表修改后,可以直接确定与源流表关联的同步规则,进而进行同步操作,且由于同步规则中还包含有目标流表标识,因此,可以快速找到目标流表进行同步,进一步缩小了流表同步的时延,提高了流表同步的效率。The method for implementing the flow table synchronization provided by the embodiment of the present invention can directly determine the source flow entry to be synchronized after the source flow table in the forwarding device is modified, and based on the synchronization rule associated with the source flow table, the synchronization to be synchronized. The flow entry is converted, and the target flow entry generated after the conversion is synchronized to the target flow table. Since the synchronization between the flow tables is not required by the controller, the forwarding device independently completes the entire synchronization process, thereby avoiding waste. The computing resources of the controller also avoid the signaling interaction between the switch and the controller, reduce the delay of the flow table synchronization, realize the complete decoupling of the forwarding device and the controller, and at the same time, the source flow table in the forwarding device The synchronization rule is associated with the synchronization rule of the source flow table. The synchronization rule is maintained on the source flow table. After the source flow table is modified, the synchronization rule associated with the source flow table can be directly determined, and then the synchronization operation is performed. Contains the target flow table identifier, so you can quickly find the target flow table for synchronization, further reducing the delay of flow table synchronization Improve the efficiency of the flow meter synchronized.
在本发明实施例中,控制器可以对同步规则进行控制,如增加、修改,以及删除等,转发设备可以根据控制器对同步规则的控制,进一步根据同步规则的增加、修改和删除,对源流表和目标流表进行同步。In the embodiment of the present invention, the controller may control the synchronization rule, such as adding, modifying, and deleting. The forwarding device may further increase, modify, and delete the synchronization rule according to the control of the synchronization rule by the controller. The table and the target flow table are synchronized.
参阅图2所示,在转发设备中增加同步规则的流程包括:Referring to FIG. 2, the process of adding synchronization rules to the forwarding device includes:
步骤201:转发设备接收控制器发送同步规则增加消息,所述同步规则增加消息中包含待增加的同步规则。Step 201: The forwarding device receiving controller sends a synchronization rule addition message, where the synchronization rule addition message includes a synchronization rule to be added.
控制器根据业务逻辑的需要,生成同步规则,其中,同步规则中包含源流表标识,目标流表标识,以及源流表中的源流表项的转换规则,该源流表项的转换规则中规定了源流表项中需要进行转换的信息,以及对应的转换算 法或规则,用以将源流表项转换为对应的目标流表项。The controller generates a synchronization rule according to the requirements of the service logic, where the synchronization rule includes a source flow table identifier, a target flow table identifier, and a conversion rule of the source flow entry in the source flow table, where the source flow entry defines a source flow. The information that needs to be converted in the table entry, and the corresponding conversion calculation A method or rule to convert a source flow entry to a corresponding target flow entry.
控制器生成同步规则后,将同步规则作为待增加的同步规则通过同步规则增加消息发送至转发设备。After the synchronization rule is generated, the controller sends the synchronization rule as a synchronization rule to be added to the forwarding device through the synchronization rule addition message.
可选的,所述转发设备在接收到控制器发送的同步规则增加消息之后,在执行步骤202之前,还包括:Optionally, the forwarding device, after receiving the synchronization rule addition message sent by the controller, before performing step 202, further includes:
对所述待增加的同步规则进行校验,并确定校验通过。The synchronization rule to be added is checked, and the verification is determined to pass.
转发设备对所述待增加的同步规则进行校验,即确定该待增加的同步规则的合理性,例如,判断本地是否存在该待增加的同步规则中包含的源流表标识对应的源流表,以及该待增加的同步规则中包含的目标流表标识对应的目标流表,以及确定该待增加的同步规则中包含的源流表项的转换规则的合理性等。The forwarding device verifies the synchronization rule to be added, that is, determines the plausibility of the synchronization rule to be added, for example, determining whether the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added exists locally, and The target flow table identifier corresponding to the target flow table identifier included in the synchronization rule to be added, and the rationality of the conversion rule of the source flow entry included in the synchronization rule to be added.
步骤202:所述转发设备将所述待增加的同步规则中包括的源流表标识对应的源流表与接收的所述待增加的同步规则建立关联。Step 202: The forwarding device associates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added with the received synchronization rule to be added.
在执行步骤202时,将待增加的同步规则与所述待增加的同步规则中包括的源流表标识对应的源流表建立关联,具体的,包括将该同步规则保存至该源流表中,或者将该同步规则进行一些安装处理等操作,使该规则与该源流表之间存在关联,即将同步规则在源流表侧进行维护,这样,在源流表修改后,可以直接确定与源流表关联的同步规则,进而进行同步操作,且由于同步规则中还包含有目标流表标识,因此,可以快速找到目标流表进行同步,缩小了流表同步的时延,提高了流表同步的效率。When the step 202 is performed, the synchronization rule to be added is associated with the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added, and specifically, the synchronization rule is saved in the source flow table, or The synchronization rule performs some operations such as the installation process, so that the rule is associated with the source flow table, that is, the synchronization rule is maintained on the source flow table side, so that after the source flow table is modified, the synchronization rule associated with the source flow table can be directly determined. Then, the synchronization operation is performed, and since the synchronization rule further includes the target flow table identifier, the target flow table can be quickly found for synchronization, the delay of the flow table synchronization is reduced, and the efficiency of the flow table synchronization is improved.
可选的,在步骤202之后,所述转发设备向所述控制器发送同步规则增加响应消息,用以通知控制器本地已经增加该待增加的同步规则。Optionally, after the step 202, the forwarding device sends a synchronization rule addition response message to the controller, to notify the controller that the synchronization rule to be added has been locally added.
可选的,在步骤201所述转发设备在接收所述控制器发送同步规则增加消息之后,还包括:Optionally, after receiving the synchronization rule addition message by the controller, the forwarding device further includes:
根据所述待增加的同步规则包括的源流表项的转换规则,对所述待增加的同步规则中包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标流表项同步至所述待增加的同步规则包括的目标流表标识对 应的目标流表中。将转换后生成的目标流表项同步至所述待增加的同步规则包括的目标流表标识对应的目标流表中,具体的,即将转换后生成的目标流表项安装至所述待增加的同步规则包括的目标流表标识对应的目标流表中。Converting, according to the conversion rule of the source flow entry included in the synchronization rule to be added, the source flow entry in the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added, and converting the generated target flow The entry is synchronized to the target flow table identifier pair included in the synchronization rule to be added Should be in the target flow table. Synchronizing the target flow entry that is generated after the conversion to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be added, and specifically, the target flow entry generated after the conversion is installed to the to-be-added The target flow table identifier included in the synchronization rule is identified in the corresponding target flow table.
当然,上述步骤可以不执行,即转发设备接收到待增加的同步规则后,不会基于该待增加的同步规则中的源流表项的转换规则,对源流表和目标流表建立关联,当然,可以执行该步骤,且执行该步骤的时机并不确定,可以在步骤201之后执行,或者在步骤202之后执行,本发明对此不做限定。Of course, the foregoing steps may not be performed. After the forwarding device receives the synchronization rule to be added, the forwarding device does not establish an association between the source flow table and the target flow table based on the conversion rule of the source flow entry in the synchronization rule to be added. This step can be performed, and the timing of performing the step is not determined, and may be performed after step 201 or after step 202, which is not limited by the present invention.
通过以上两种方式的描述,转发设备可以根据控制器的同步规则增加消息,对同步规则进行增加,并基于增加的同步规则实现源流表与目标流表之间的同步。Through the description of the above two methods, the forwarding device may add a message according to the synchronization rule of the controller, increase the synchronization rule, and implement synchronization between the source flow table and the target flow table based on the added synchronization rule.
在转发设备中修改同步规则包括两种方式:第一种:在将本地的同步规则进行修改,参阅图3所示;第二种:通过新的同步规则,直接将本地的同步规则进行替换,参阅图4所示。There are two ways to modify the synchronization rule in the forwarding device: the first one: modify the local synchronization rule, see Figure 3; the second: replace the local synchronization rule directly with the new synchronization rule. See Figure 4.
第一种方式修改同步规则流程包括:The first way to modify the synchronization rule process includes:
步骤301:转发设备接收控制器发送的同步规则修改消息,所述同步规则修改消息中包括同步规则修改规则。Step 301: The forwarding device receives a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a synchronization rule modification rule.
同步规则修改规则中包含了对同步规则中包含的内容(源流表项的转换规则)中的修改规则,例如将源流表项的转换规则中某一项信息的一种转换算法修改为另一种转换算法等,根据该同步规则修改规则可以将原同步规则进行修改,生成新的同步规则。The modification rule of the synchronization rule includes a modification rule in the content of the synchronization rule (the conversion rule of the source flow entry), for example, a conversion algorithm of one item of the conversion rule of the source flow entry is modified to another The conversion algorithm and the like may modify the original synchronization rule according to the synchronization rule to generate a new synchronization rule.
步骤302:所述转发设备根据所述同步规则修改消息,确定待修改的同步规则。Step 302: The forwarding device determines a synchronization rule to be modified according to the synchronization rule modification message.
可选的,在步骤302,确定待修改的同步规则之后,还包括:Optionally, after determining the synchronization rule to be modified, in step 302, the method further includes:
向所述控制器发送同步规则修改响应消息。A synchronization rule modification response message is sent to the controller.
执行步骤302时,可以通过多种方式,例如可以通过同步规则修改消息中还包含的同步规则标识或者其它同步规则的指示信息,确定待修改的同步规则,或者同步规则修改消息中还包含同步规则,然后根据该同步规则在本 地中的同步规则中进行匹配,匹配到时,将匹配到的同步规则作为待修改的同步规则。When the step 302 is performed, the synchronization rule to be modified may be determined by using the synchronization rule identifier or the indication information of other synchronization rules included in the synchronization rule modification message, or the synchronization rule modification message may also include the synchronization rule. And then according to the synchronization rule in this The matching is performed in the synchronization rule in the ground. When the matching is reached, the matching synchronization rule is taken as the synchronization rule to be modified.
可选的,在步骤302之后,在步骤303之前,还包括,基于所述待修改的同步规则,对所述同步规则修改消息进行校验,并确定校验通过。Optionally, after step 302, before step 303, the method further includes: checking, according to the synchronization rule to be modified, the synchronization rule modification message, and determining that the verification is passed.
由于在同步规则修改规则中包含了对同步规则中包含的内容(如源流表项的转换规则)中的修改规则,因此,可以通过待修改的同步规则中包含的源流表项的转换规则,对同步规则修改消息中包含的同步规则修改规则等信息进行校验。Because the modification rule in the synchronization rule includes the modification rule in the content of the synchronization rule, such as the conversion rule of the source flow entry, the conversion rule of the source flow entry included in the synchronization rule to be modified may be The information such as the synchronization rule modification rule included in the synchronization rule modification message is verified.
可选的,在步骤302之后,还包括:Optionally, after step 302, the method further includes:
在所述待修改的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待修改的同步规则生成的目标流表项;Determining, according to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, a target flow entry generated based on the synchronization rule to be modified;
对确定的目标流表项进行无效处理。Invalid processing of the determined target flow entry.
由于待修改的同步规则需要进行修改生成新的同步规则,因此,基于该待修改的同步规则生成的目标流表项也失去了工作价值,如果不进行处理,可能会导致工作异常。因此,需要对基于该待修改的同步规则生成的目标流表项进行无效处理。Since the synchronization rule to be modified needs to be modified to generate a new synchronization rule, the target flow entry generated based on the synchronization rule to be modified also loses the working value. If not processed, the operation may be abnormal. Therefore, it is necessary to invalidate the target flow entry generated based on the synchronization rule to be modified.
其中,对目标流表项进行无效处理,即令该目标流表项在指定时刻后失去工作能力,无法进行匹配,该指定时刻可以为查找到该目标流表项时,或者在查找到该目标流表项设定时间段后,本发明对此不做限定。对目标流表项进行无效处理包括多种方式,例如,将目标流表项进行删除;或者对目标流表项设置设定的老化时间,其中该老化时间可以为转发设备预设的,或者用户设置的,或者复制该目标流表项对应的源流表项的老化时间等;或者将目标流表项中的某一项可以指示该目标流表项工作能力的信息进行修改等,本发明对此不做限定。其中,对目标流表项进行无效处理时,当所述目标流表项中保存有同步规则标识时,还包括:将所述目标流表项中包含的同步规则标识删除,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。 The target flow entry is invalidated, so that the target flow entry cannot be matched after the specified time, and the specified time can be found when the target flow entry is found, or the target flow is found. After the time period is set, the present invention does not limit this. The invalidation of the target flow entry includes multiple methods, for example, deleting the target flow entry; or setting the aging time of the target flow entry, where the aging time may be preset for the forwarding device, or the user The aging time of the source flow entry corresponding to the target flow entry is set, or the information of the target flow entry can be modified to indicate the working capability of the target flow entry, and the present invention Not limited. When the target flow entry is invalidated, when the synchronization rule identifier is saved in the target flow entry, the method further includes: deleting the synchronization rule identifier included in the target flow entry, where the synchronization The rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier.
其中,所述转发设备在所述待修改的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待修改的同步规则生成的目标流表项,可以包括:The forwarding device, in the target flow table corresponding to the target flow table identifier that is included in the synchronization rule to be modified, determines the target flow entry that is generated based on the synchronization rule to be modified, and may include:
当所述待修改的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待修改的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, in the target flow table, the matching synchronization rule identifier included in the target flow table is a target flow entry identified by the synchronization rule of the synchronization rule to be modified, wherein the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
将查找到的目标流表项作为基于所述待修改的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be modified.
若之前基于该待修改的同步规则生成目标流表项在安装时,该目标流表项添加了同步规则标识,用以指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的,则通过待修改的同步规则的同步规则标识就可以快速找到基于所述待修改的同步规则生成的目标流表项;若之前基于该待修改的同步规则生成目标流表项在安装时,该目标流表项未添加同步规则标识,则可以根据该待修改的同步规则中的源流表项的转换规则,将源流表中的每一项源流表项进行转换,生成目标流表项,并在目标流表中查找是否包含生成的目标流表项,如果包含,则在目标流表中包含的该目标流表项即为基于所述待修改的同步规则生成的目标流表项。If the target flow entry is generated based on the synchronization rule to be modified, the synchronization rule identifier is added to the target flow entry to indicate that the target flow entry is generated based on the synchronization rule corresponding to the synchronization rule identifier. The target flow entry generated based on the synchronization rule to be modified may be quickly found through the synchronization rule identifier of the synchronization rule to be modified; if the target flow entry is previously generated based on the synchronization rule to be modified, If the source flow entry is not added to the target flow entry, the source flow entry in the source flow table is converted according to the conversion rule of the source flow entry in the synchronization rule to be generated, and the target flow entry is generated. The target flow table entry is found in the target flow table, and if it is included, the target flow entry included in the target flow table is the target flow entry generated based on the synchronization rule to be modified.
步骤303:所述转发设备根据所述同步规则修改规则、以及所述待修改的同步规则,生成新同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同。Step 303: The forwarding device generates a new synchronization rule according to the synchronization rule modification rule and the synchronization rule to be modified, where the new synchronization rule and the source flow table identifier included in the synchronization rule to be modified The same as the target flow table identifier, and the conversion rules of the included source flow entries are different.
可选的,在生成新同步规则之后且在所述转发设备在对确定的目标流表项进行无效处理之后,还包括:Optionally, after the new synchronization rule is generated and after the forwarding device performs invalid processing on the determined target flow entry, the method further includes:
根据所述新同步规则包括的源流表项的转换规则,对所述新同步规则包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标 流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中。Converting, according to the conversion rule of the source flow entry included in the new synchronization rule, the source flow entry in the source flow table corresponding to the source flow table identifier included in the new synchronization rule, and converting the generated target The flow entry is synchronized to the target flow table corresponding to the target flow table identifier included in the new synchronization rule.
可选的,所述转发设备将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中,包括:Optionally, the forwarding device synchronizes the target flow entry that is generated after the conversion to the target flow table corresponding to the target flow table identifier included in the new synchronization rule, including:
将生成的目标流表项安装到所述新同步规则包括的目标流表标识对应的目标流表中。The generated target flow entry is installed in the target flow table corresponding to the target flow table identifier included in the new synchronization rule.
将生成的目标流表项安装到目标流表时,可选的,还可以将该新同步规则的同步规则标识添加到生成的目标流表项中,以便在后期该新同步规则再修改或删除时,可以快速找到基于该新同步规则生成的目标流表项。When the generated target flow entry is installed in the target flow table, optionally, the synchronization rule identifier of the new synchronization rule may be added to the generated target flow entry, so that the new synchronization rule may be modified or deleted later. When you can quickly find the target flow entry generated based on the new synchronization rule.
步骤304:所述转发设备将所述待修改的同步规则中包括的源流表标识对应的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。Step 304: The forwarding device de-associates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be modified with the synchronization rule to be modified, and correspondingly identifies the source flow table identifier included in the new synchronization rule. The source flow table is associated with the new synchronization rule.
将待修改的同步规则与源流表解除关联,包括删除该待修改的同步规则,或者将该待修改的同步规则进行处理,使在该源流表与目标流表进行同步时,不能通过该待修改的同步规则。De-releasing the synchronization rule to be modified from the source flow table, including deleting the synchronization rule to be modified, or processing the synchronization rule to be modified, so that the source flow table and the target flow table cannot be modified when the source flow table is synchronized with the target flow table. Synchronization rules.
第二种方式修改同步规则流程包括:The second way to modify the synchronization rule process includes:
步骤401:转发设备接收控制器发送的同步规则修改消息,所述同步规则修改消息中包括新同步规则。Step 401: The forwarding device receives a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a new synchronization rule.
在步骤401之后,在步骤402之前,还包括:对所述新同步规则进行校验,并确定校验通过。After step 401, before step 402, the method further includes: checking the new synchronization rule, and determining that the verification is passed.
转发设备对所述新同步规则进行校验,即确定该新同步规则的合理性,例如,判断本地是否存在该新同步规则中包含的源流表标识对应的源流表,以及该新同步规则中包含的目标流表标识对应的目标流表,以及确定该新同步规则中包含的源流表项的转换规则的合理性等。The forwarding device checks the new synchronization rule, that is, determines the rationality of the new synchronization rule, for example, determines whether the source flow table corresponding to the source flow table identifier included in the new synchronization rule exists locally, and the new synchronization rule includes The target flow table identifies the corresponding target flow table, and determines the rationality of the conversion rule of the source flow entry included in the new synchronization rule.
步骤402:所述转发设备根据所述同步规则修改消息,确定待修改的同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同。Step 402: The forwarding device determines the synchronization rule to be modified according to the synchronization rule modification message, where the new synchronization rule is the same as the source flow table identifier and the target flow table identifier included in the synchronization rule to be modified. The conversion rules of the source stream entries are different.
可选的,在步骤402,确定待修改的同步规则之后,还包括: Optionally, after determining the synchronization rule to be modified, in step 402, the method further includes:
向所述控制器发送同步规则修改响应消息。A synchronization rule modification response message is sent to the controller.
执行步骤402时,可以通过多种方式,例如,可以通过同步规则修改消息中还包含的同步规则标识或者其它同步规则的指示信息,确定待修改的同步规则,或者将与新同步规则中源流表标识对应的源流表关联的同步规则作为待修改的同步规则。When the step 402 is performed, the synchronization rule to be modified may be determined by using the synchronization rule identifier or the indication information of other synchronization rules included in the synchronization rule modification message, or the source flow table in the new synchronization rule may be used. The synchronization rule associated with the corresponding source flow table is identified as the synchronization rule to be modified.
可选的,在步骤402之后,还包括:Optionally, after step 402, the method further includes:
在所述待修改的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待修改的同步规则生成的目标流表项;Determining, according to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, a target flow entry generated based on the synchronization rule to be modified;
对确定的目标流表项进行无效处理。Invalid processing of the determined target flow entry.
由于待修改的同步规则需要进行修改生成新的同步规则,因此,基于该待修改的同步规则生成的目标流表项也失去了工作价值,如果不进行处理,可能会导致工作异常。因此,需要对基于该待修改的同步规则生成的目标流表项进行无效处理。Since the synchronization rule to be modified needs to be modified to generate a new synchronization rule, the target flow entry generated based on the synchronization rule to be modified also loses the working value. If not processed, the operation may be abnormal. Therefore, it is necessary to invalidate the target flow entry generated based on the synchronization rule to be modified.
其中,对目标流表项进行无效处理,即令该目标流表项在指定时刻后失去工作能力,无法进行匹配,该指定时刻可以为查找到该目标流表项时,或者在查找到该目标流表项设定时间段后,本发明对此不做限定。对目标流表项进行无效处理包括多种方式,例如,将目标流表项进行删除;或者对目标流表项设置设定的老化时间,其中该老化时间可以为转发设备预设的,或者用户设置的,或者复制该目标流表项对应的源流表项的老化时间等;或者将目标流表项中的某一项可以指示该目标流表项工作能力的信息进行修改等,本发明对此不做限定。其中,对目标流表项进行无效处理时,当所述目标流表项中保存有同步规则标识时,还包括:将所述目标流表项中包含的同步规则标识删除,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。The target flow entry is invalidated, so that the target flow entry cannot be matched after the specified time, and the specified time can be found when the target flow entry is found, or the target flow is found. After the time period is set, the present invention does not limit this. The invalidation of the target flow entry includes multiple methods, for example, deleting the target flow entry; or setting the aging time of the target flow entry, where the aging time may be preset for the forwarding device, or the user The aging time of the source flow entry corresponding to the target flow entry is set, or the information of the target flow entry can be modified to indicate the working capability of the target flow entry, and the present invention Not limited. When the target flow entry is invalidated, when the synchronization rule identifier is saved in the target flow entry, the method further includes: deleting the synchronization rule identifier included in the target flow entry, where the synchronization The rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier.
其中,所述转发设备在所述待修改的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待修改的同步规则生成的目标流表项,可以包括: The forwarding device, in the target flow table corresponding to the target flow table identifier that is included in the synchronization rule to be modified, determines the target flow entry that is generated based on the synchronization rule to be modified, and may include:
当所述待修改的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待修改的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, in the target flow table, the matching synchronization rule identifier included in the target flow table is a target flow entry identified by the synchronization rule of the synchronization rule to be modified, wherein the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
将查找到的目标流表项作为基于所述待修改的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be modified.
若之前基于该待修改的同步规则生成目标流表项在安装时,该目标流表项添加了同步规则标识,用以指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的,则通过待修改的同步规则的同步规则标识就可以快速找到基于所述待修改的同步规则生成的目标流表项;若之前基于该待修改的同步规则生成目标流表项在安装时,该目标流表项未添加同步规则标识,则可以根据该待修改的同步规则中的源流表项的转换规则,将源流表中的每一项源流表项进行转换,生成目标流表项,并在目标流表中查找是否包含生成的目标流表项,如果包含,则在目标流表中包含的该目标流表项即为基于所述待修改的同步规则生成的目标流表项。If the target flow entry is generated based on the synchronization rule to be modified, the synchronization rule identifier is added to the target flow entry to indicate that the target flow entry is generated based on the synchronization rule corresponding to the synchronization rule identifier. The target flow entry generated based on the synchronization rule to be modified may be quickly found through the synchronization rule identifier of the synchronization rule to be modified; if the target flow entry is previously generated based on the synchronization rule to be modified, If the source flow entry is not added to the target flow entry, the source flow entry in the source flow table is converted according to the conversion rule of the source flow entry in the synchronization rule to be generated, and the target flow entry is generated. The target flow table entry is found in the target flow table, and if it is included, the target flow entry included in the target flow table is the target flow entry generated based on the synchronization rule to be modified.
可选的,在生成新同步规则之后且在所述转发设备在对确定的目标流表项进行无效处理之后,还包括:Optionally, after the new synchronization rule is generated and after the forwarding device performs invalid processing on the determined target flow entry, the method further includes:
根据所述新同步规则包括的源流表项的转换规则,对所述新同步规则包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中。And converting, according to the conversion rule of the source flow entry included in the new synchronization rule, the source flow entry in the source flow table corresponding to the source flow table identifier included in the new synchronization rule, and synchronizing the target flow entry generated after the conversion to the The target synchronization flow table included in the new synchronization rule is identified in the corresponding target flow table.
可选的,所述转发设备将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中,包括:Optionally, the forwarding device synchronizes the target flow entry that is generated after the conversion to the target flow table corresponding to the target flow table identifier included in the new synchronization rule, including:
将生成的目标流表项安装到所述新同步规则包括的目标流表标识对应的目标流表中。The generated target flow entry is installed in the target flow table corresponding to the target flow table identifier included in the new synchronization rule.
将生成的目标流表项安装到目标流表时,可选的,还可以将该新同步规则的同步规则标识添加到生成的目标流表项中,以便在后期该新同步规则再 修改或删除时,可以快速找到基于该新同步规则生成的目标流表项。When the generated target flow entry is installed in the target flow table, optionally, the synchronization rule identifier of the new synchronization rule may be added to the generated target flow entry, so that the new synchronization rule is later When modifying or deleting, you can quickly find the target flow entry generated based on the new synchronization rule.
步骤403:所述转发设备将所述待修改的同步规则中包括的源流表标识对应的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。Step 403: The forwarding device de-associates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be modified with the synchronization rule to be modified, and correspondingly identifies the source flow table identifier included in the new synchronization rule. The source flow table is associated with the new synchronization rule.
通过以上两种方式的描述,转发设备可以根据控制器的同步规则修改消息,对同步规则进行修改,并基于修改后的同步规则实现源流表与目标流表之间的同步。Through the description of the above two methods, the forwarding device may modify the message according to the synchronization rule of the controller, modify the synchronization rule, and implement synchronization between the source flow table and the target flow table based on the modified synchronization rule.
参阅图5所示,在转发设备中删除同步规则的流程包括:Referring to FIG. 5, the process of deleting a synchronization rule in a forwarding device includes:
步骤501:转发设备接收所述控制器发送的同步规则删除消息。Step 501: The forwarding device receives a synchronization rule deletion message sent by the controller.
步骤502:所述转发设备根据所述同步规则删除消息,确定待删除的同步规则。Step 502: The forwarding device deletes the synchronization rule according to the synchronization rule to determine a synchronization rule to be deleted.
在执行步骤502时,可以通过多种方式,例如,可以根据同步规则删除消息中包含的同步规则标识或者其它同步规则的指示信息,确定待删除的同步规则,或者,同步规则删除消息中还包含同步规则,然后根据该同步规则在本地中的同步规则中进行匹配,匹配到时,将匹配到的同步规则作为待删除的同步规则。When the step 502 is performed, the synchronization rule to be deleted may be determined in a plurality of manners, for example, the synchronization rule identifier included in the message or the indication information of the other synchronization rules may be deleted according to the synchronization rule, or the synchronization rule deletion message is further included. The synchronization rule is matched according to the synchronization rule in the local synchronization rule. When the match is reached, the matched synchronization rule is used as the synchronization rule to be deleted.
所述转发设备在确定待删除的同步规则之后,还包括:After determining the synchronization rule to be deleted, the forwarding device further includes:
在所述待删除的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待删除的同步规则生成的目标流表项,并对确定的目标流表项进行无效处理。And determining, in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, a target flow entry generated based on the synchronization rule to be deleted, and performing invalid processing on the determined target flow entry.
其中,对目标流表项进行无效处理,即令该目标流表项在指定时刻后失去工作能力,无法进行匹配,该指定时刻可以为查找到该目标流表项时,或者在查找到该目标流表项设定时间段后,本发明对此不做限定。对目标流表项进行无效处理包括多种方式,例如,将目标流表项进行删除;或者对目标流表项设置设定的老化时间,其中该老化时间可以为转发设备预设的,或者用户设置的,或者复制该目标流表项对应的源流表项的老化时间等;或者将目标流表项中的某一项可以指示该目标流表项工作能力的信息进行修改等, 本发明对此不做限定。其中,对目标流表项进行无效处理时,当所述目标流表项中保存有同步规则标识时,还包括:将所述目标流表项中包含的同步规则标识删除,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。The target flow entry is invalidated, so that the target flow entry cannot be matched after the specified time, and the specified time can be found when the target flow entry is found, or the target flow is found. After the time period is set, the present invention does not limit this. The invalidation of the target flow entry includes multiple methods, for example, deleting the target flow entry; or setting the aging time of the target flow entry, where the aging time may be preset for the forwarding device, or the user The aging time of the source flow entry corresponding to the target flow entry is set, or the information of the target flow entry can be modified to indicate the working capability of the target flow entry. The invention is not limited thereto. When the target flow entry is invalidated, when the synchronization rule identifier is saved in the target flow entry, the method further includes: deleting the synchronization rule identifier included in the target flow entry, where the synchronization The rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier.
所述转发设备在所述待删除的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待删除的同步规则生成的目标流表项,可以包括:The forwarding device, in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, determining the target flow entry generated based on the synchronization rule to be deleted, may include:
当所述待删除的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待删除的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, in the target flow table, the included synchronization rule identifier is found as a target flow entry that is identified by a synchronization rule of the synchronization rule to be deleted, where the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
将查找到的目标流表项作为基于所述待删除的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be deleted.
若之前基于该待删除的同步规则生成目标流表项在安装时,该目标流表项添加了同步规则标识,用以指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的,则通过待删除的同步规则的同步规则标识就可以快速找到基于所述待删除的同步规则生成的目标流表项;若之前基于该待删除的同步规则生成目标流表项在安装时,该目标流表项未添加同步规则标识,则可以根据该待删除的同步规则中的源流表项的转换规则,将源流表中的每一项源流表项进行转换,生成目标流表项,并在目标流表中查找是否包含生成的目标流表项,如果包含,则在目标流表中包含的该目标流表项即为基于所述待删除的同步规则生成的目标流表项。If the target flow entry is generated based on the synchronization rule to be deleted, the synchronization rule identifier is added to the target flow entry to indicate that the target flow entry is generated based on the synchronization rule corresponding to the synchronization rule identifier. The target flow entry generated based on the synchronization rule to be deleted may be quickly found by the synchronization rule identifier of the synchronization rule to be deleted; if the target flow entry is previously generated based on the synchronization rule to be deleted, If the source flow entry is not added to the target flow entry, the source flow entry in the source flow table is converted according to the conversion rule of the source flow entry in the synchronization rule to be generated, and the target flow entry is generated. The target flow table entry is found in the target flow table, and if it is included, the target flow entry included in the target flow table is the target flow entry generated based on the synchronization rule to be deleted.
步骤503:所述转发设备将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联。Step 503: The forwarding device disassociates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted from the synchronization rule to be deleted.
可选的,所述转发设备在将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联之后,还包括:Optionally, the forwarding device, after disassociating the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted, with the synchronization rule to be deleted, further includes:
向所述控制器发送同步规则删除响应消息。 A synchronization rule deletion response message is sent to the controller.
通过以上步骤的描述,转发设备可以根据控制器的同步规则删除消息,对同步规则进行删除,并基于修改后的同步规则实现源流表与目标流表之间的同步。Through the description of the above steps, the forwarding device may delete the message according to the synchronization rule of the controller, delete the synchronization rule, and implement synchronization between the source flow table and the target flow table based on the modified synchronization rule.
基于以上实施例,参阅图6所示,本发明实施例还提供了一种转发设备,该转发设备600包括:第一确定单元601,第一处理单元602,其中,Based on the foregoing embodiment, referring to FIG. 6, the embodiment of the present invention further provides a forwarding device, where the forwarding device 600 includes: a first determining unit 601, a first processing unit 602, where
第一确定单元601,用于在对一源流表修改后,确定与所述源流表关联的同步规则,同步规则中包括源流表标识、目标流表标识,以及源流表项的转换规则,其中,所述源流表项为所述源流表标识对应的源流表中的流表项,所述同步规则包括的源流表标识与所述源流表的源流表标识相同;The first determining unit 601 is configured to determine, after modifying a source flow table, a synchronization rule that is associated with the source flow table, where the synchronization rule includes a source flow table identifier, a target flow table identifier, and a conversion rule of the source flow entry, where The source flow entry is a flow entry in the source flow table corresponding to the source flow table identifier, and the source flow table identifier included in the synchronization rule is the same as the source flow table identifier of the source flow table;
第一处理单元602,用于根据所述源流表,确定待同步的源流表项,并根据所述源流表项的转换规则,对所述待同步的源流表项进行转换,将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中。The first processing unit 602 is configured to determine, according to the source flow table, a source flow entry to be synchronized, and convert the source flow entry to be synchronized according to a conversion rule of the source flow entry, and generate the converted The target flow entry is synchronized to the target flow table corresponding to the target flow table identifier.
可选的,所述第一处理单元602,用于:Optionally, the first processing unit 602 is configured to:
当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,将安装到所述源流表中所述待增加的源流表项作为待同步的源流表项;或者When the source flow table is modified to install the source flow entry to be added to the source flow table, the source flow entry to be added to the source flow table is used as the source flow entry to be synchronized; or
当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,将所述源流表中的所述待修改的源流表项、修改后的源流表项作为待同步的源流表项;或者When the source flow table is modified to modify the source flow entry to be modified in the source flow table, the source flow entry to be modified and the modified source flow entry in the source flow table are to be synchronized. Source flow entry; or
当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,将所述源流表中所述待无效的源流表项作为待同步的源流表项。When the source flow table is modified to invalidate the source flow entry to be invalidated in the source flow table, the source flow entry to be invalidated in the source flow table is used as the source flow entry to be synchronized.
可选的,当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,所述第一处理单元602,用于:Optionally, when the source flow table is modified to install the source flow entry to be added to the source flow table, the first processing unit 602 is configured to:
将生成的目标流表项安装到所述目标流表标识对应的目标流表中。The generated target flow entry is installed in the target flow table corresponding to the target flow table identifier.
可选的,当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,所述第一处理单元602,用于:Optionally, when the source flow table is modified to modify the source flow entry to be modified in the source flow table, the first processing unit 602 is configured to:
在所述目标流表标识对应的目标流表中,查找到所述待修改的源流表项转换后生成的目标流表项后,对查找到的目标流表项进行无效处理; After the target flow entry generated by the source flow entry to be modified is found in the target flow table corresponding to the target flow table identifier, the target flow entry that is found is invalidized after being found;
将修改后的源流表项转换后生成的目标流表项安装到所述目标流表标识对应的目标流表中。The target flow entry generated after the modified source flow entry is converted is installed in the target flow table corresponding to the target flow table identifier.
可选的,当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,所述第一处理单元602,用于:Optionally, when the source flow table is modified to invalidate the source flow entry to be invalidated in the source flow table, the first processing unit 602 is configured to:
在所述目标流表标识对应的目标流表中,查找到生成的目标流表项后,对查找到的目标流表项进行无效处理。After the generated target flow entry is found in the target flow table corresponding to the target flow table identifier, the found target flow entry is invalidated.
可选的,所述第一处理单元602,在将生成的目标流表项安装到所述目标流表标识对应的目标流表中时,用于:Optionally, the first processing unit 602 is configured to: when the generated target flow entry is installed in the target flow table corresponding to the target flow table identifier:
将生成的包含有同步规则标识的所述目标流表项,安装到所述目标流表标识对应的目标流表中,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。And the generated target flow entry is included in the target flow table corresponding to the target flow table identifier, where the synchronization rule identifier is used to indicate that the target flow entry is based on the The synchronization rule identifies the corresponding synchronization rule generated.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第一发送单元,用于在将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中之后,向所述控制器发送目标流表变化通知消息。The first sending unit is configured to send a target flow table change notification message to the controller after synchronizing the target flow entry generated after the conversion to the target flow table corresponding to the target flow table identifier.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第一接收单元,用于接收所述控制器发送同步规则增加消息,所述同步规则增加消息中包含待增加的同步规则;a first receiving unit, configured to receive, by the controller, a synchronization rule addition message, where the synchronization rule addition message includes a synchronization rule to be added;
第一关联单元,用于将所述待增加的同步规则中包括的源流表标识对应的源流表与接收的所述待增加的同步规则建立关联。The first association unit is configured to associate the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added with the received synchronization rule to be added.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第一校验单元,用于在接收到控制器发送的同步规则增加消息之后,在将所述待增加的同步规则中包括的源流表标识对应的源流表、接收的所述同步规则建立关联之前,对所述待增加的同步规则进行校验,并确定校验通过。a first checking unit, configured to: after receiving the synchronization rule addition message sent by the controller, before associating the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added, and the received synchronization rule And verifying the synchronization rule to be added, and determining that the verification is passed.
可选的,第二发送单元,用于:Optionally, the second sending unit is configured to:
在将所述待增加的同步规则中包括的源流表标识对应的源流表、接收的所述同步规则建立关联之后,向所述控制器发送同步规则增加响应消息。After the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added is associated with the received synchronization rule, a synchronization rule increase response message is sent to the controller.
可选的,所述转发设备600,还包括: Optionally, the forwarding device 600 further includes:
第二处理单元,用于在接收所述控制器发送同步规则增加消息之后,根据所述待增加的同步规则包括的源流表项的转换规则,对所述待增加的同步规则中包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标流表项同步至所述待增加的同步规则包括的目标流表标识对应的目标流表中。a second processing unit, configured to: after receiving the synchronization rule addition message, the source flow table included in the synchronization rule to be added according to the conversion rule of the source flow entry included in the synchronization rule to be added The source flow entry in the corresponding source flow table is converted, and the target flow entry generated after the conversion is synchronized to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be added.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第二接收单元,用于接收所述控制器发送的同步规则修改消息,所述同步规则修改消息中包括同步规则修改规则;a second receiving unit, configured to receive a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a synchronization rule modification rule;
第二确定单元,用于根据所述同步规则修改消息,确定待修改的同步规则;a second determining unit, configured to modify a message according to the synchronization rule, and determine a synchronization rule to be modified;
生成单元,用于根据所述同步规则修改规则、以及所述待修改的同步规则,生成新同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同;a generating unit, configured to generate a new synchronization rule according to the synchronization rule modification rule and the synchronization rule to be modified, where the new synchronization rule and the source flow table identifier and target included in the synchronization rule to be modified The flow table identifiers are the same, and the conversion rules of the source flow entries are different.
第二关联单元,用于将所述待修改的同步规则中包括的源流表标识对应的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。a second association unit, configured to disassociate the source flow table corresponding to the source flow table identifier included in the synchronization rule to be modified, and the synchronization rule to be modified; and corresponding to the source flow table identifier included in the new synchronization rule The source flow table is associated with the new synchronization rule.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第二校验单元,用于在确定待修改的同步规则之后,在生成新同步规则之前,基于所述待修改的同步规则,对所述同步规则修改消息进行校验,并确定校验通过。The second check unit is configured to check the synchronization rule modification message based on the synchronization rule to be modified, and determine the verification pass, after determining the synchronization rule to be modified, before generating the new synchronization rule.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第二接收单元,用于接收所述控制器发送的同步规则修改消息,所述同步规则修改消息中包括新同步规则;a second receiving unit, configured to receive a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a new synchronization rule;
第二确定单元,用于根据所述同步规则修改消息,确定待修改的同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同;a second determining unit, configured to determine, according to the synchronization rule modification message, a synchronization rule to be modified, where the new synchronization rule is the same as the source flow table identifier and the target flow table identifier included in the synchronization rule to be modified, The conversion rules of the source flow entries are different.
第二关联单元,用于将所述待修改的同步规则中包括的源流表标识对应 的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。a second association unit, configured to correspond to the source flow table identifier included in the synchronization rule to be modified The source flow table is de-associated with the synchronization rule to be modified; and the source flow table corresponding to the source flow table identifier included in the new synchronization rule is associated with the new synchronization rule.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第二校验单元,用于在接收所述控制器发送的同步规则修改消息之后,在确定待修改的同步规则之前,对所述新同步规则进行校验,并确定校验通过。The second check unit is configured to check the new synchronization rule and determine the verification pass before determining the synchronization rule to be modified after receiving the synchronization rule modification message sent by the controller.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第三处理单元,用于在确定待修改的同步规则之后,在所述待修改的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待修改的同步规则生成的目标流表项;a third processing unit, configured to: after determining the synchronization rule to be modified, determine, in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, the target flow generated based on the synchronization rule to be modified Entry
对确定的目标流表项进行无效处理。Invalid processing of the determined target flow entry.
可选的,所述第三处理单元,用于:Optionally, the third processing unit is configured to:
当所述待修改的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待修改的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, in the target flow table, the matching synchronization rule identifier included in the target flow table is a target flow entry identified by the synchronization rule of the synchronization rule to be modified, wherein the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
将查找到的目标流表项作为基于所述待修改的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be modified.
可选的,所述第三处理单元,还用于:Optionally, the third processing unit is further configured to:
在对确定的目标流表项进行无效处理之后,根据所述新同步规则包括的源流表项的转换规则,对所述新同步规则包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中。After the invalidation of the determined target flow entry, the source flow entry in the source flow table corresponding to the source flow table identifier included in the new synchronization rule is converted according to the conversion rule of the source flow entry included in the new synchronization rule. And synchronizing the target flow entry generated after the conversion to the target flow table corresponding to the target flow table identifier included in the new synchronization rule.
可选的,所述第三处理单元,在将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中时,用于:Optionally, the third processing unit is configured to: when the target flow entry generated after the conversion is synchronized to the target flow table corresponding to the target flow table identifier included in the new synchronization rule,
将生成的目标流表项安装到所述新同步规则包括的目标流表标识对应的 目标流表中。And installing the generated target flow entry to the target flow table identifier included in the new synchronization rule. In the target flow table.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第三发送单元,用于在确定待修改的同步规则之后,向所述控制器发送同步规则修改响应消息。And a third sending unit, configured to send a synchronization rule modification response message to the controller after determining the synchronization rule to be modified.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第三接收单元,用于接收所述控制器发送的同步规则删除消息;a third receiving unit, configured to receive a synchronization rule deletion message sent by the controller;
第三确定单元,用于根据所述同步规则删除消息,确定待删除的同步规则;a third determining unit, configured to delete a message according to the synchronization rule, and determine a synchronization rule to be deleted;
第三关联单元,用于将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联。The third association unit is configured to disassociate the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted from the synchronization rule to be deleted.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第四处理单元,用于所述转发设备在确定待删除的同步规则之后,在所述待删除的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待删除的同步规则生成的目标流表项,并对确定的目标流表项进行无效处理。a fourth processing unit, configured to: after the determining, by the forwarding device, the synchronization rule to be deleted, determining, according to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, the synchronization rule to be deleted The generated target flow entry and invalidate the determined target flow entry.
可选的,所述第四处理单元,用于:Optionally, the fourth processing unit is configured to:
当所述待删除的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待删除的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, in the target flow table, the included synchronization rule identifier is found as a target flow entry that is identified by a synchronization rule of the synchronization rule to be deleted, where the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
将查找到的目标流表项作为基于所述待删除的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be deleted.
可选的,所述转发设备600,还包括:Optionally, the forwarding device 600 further includes:
第四发送单元,用于在将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联之后,向所述控制器发送同步规则删除响应消息。And a fourth sending unit, configured to send a synchronization rule deletion response message to the controller after disassociating the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted from the synchronization rule to be deleted.
可选的,对待无效的源流表项进行无效处理,包括: Optionally, the invalid source stream entry is invalidated, including:
对所述待无效的源流表项设置设定的老化时间。The set aging time is set for the source flow entry to be invalidated.
可选的,对目标流表项进行无效处理,包括:Optionally, invalidating the target flow entry, including:
对所述目标流表项设置设定的老化时间。Setting the aging time of the target flow entry.
可选的,对目标流表项进行无效处理,还包括:Optionally, the target flow entry is invalidated, and the method further includes:
当所述目标流表项中保存有同步规则标识时,将所述目标流表项中包含的同步规则标识删除,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。When the synchronization rule identifier is saved in the target flow entry, the synchronization rule identifier included in the target flow entry is deleted, where the synchronization rule identifier is used to indicate that the target flow entry is based on the The synchronization rule identifies the corresponding synchronization rule generated.
基于上述实施例,参阅图7所示,本发明实施例还提供了一种转发设备,该转发设备700包括:收发器701、处理器702、总线703以及存储器704,其中:Based on the foregoing embodiment, referring to FIG. 7, an embodiment of the present invention further provides a forwarding device, where the forwarding device 700 includes a transceiver 701, a processor 702, a bus 703, and a memory 704, where:
收发器701、处理器702以及存储器704通过总线703相互连接;总线703可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The transceiver 701, the processor 702, and the memory 704 are connected to each other through a bus 703. The bus 703 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. Wait. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 7, but it does not mean that there is only one bus or one type of bus.
收发器701用于与控制器进行通信,如接收控制器发送的同步规则增加消息,或者同步规则修改消息,或者同步规则删除消息等。The transceiver 701 is configured to communicate with the controller, such as a synchronization rule addition message sent by the receiving controller, or a synchronization rule modification message, or a synchronization rule deletion message.
处理器702用于实现本发明实施例图1所示的流表同步的实现方法,包括:The processor 702 is used to implement the method for implementing the flow table synchronization shown in FIG. 1 of the embodiment of the present invention, including:
在对一源流表修改后,确定与所述源流表关联的同步规则,同步规则中包括源流表标识、目标流表标识,以及源流表项的转换规则,其中,所述源流表项为所述源流表标识对应的源流表中的流表项,所述同步规则包括的源流表标识与所述源流表的源流表标识相同;After the source flow table is modified, the synchronization rule is associated with the source flow table, where the synchronization rule includes a source flow table identifier, a target flow table identifier, and a source flow entry conversion rule, where the source flow entry is the The source flow table identifies the flow entry in the source flow table, and the source flow table identifier included in the synchronization rule is the same as the source flow table identifier in the source flow table;
根据所述源流表,确定待同步的源流表项,并根据所述源流表项的转换规则,对所述待同步的源流表项进行转换,将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中。And determining, according to the source flow table, the source flow entry to be synchronized, and converting the source flow entry to be synchronized according to the conversion rule of the source flow entry, and synchronizing the target flow entry generated after the conversion to the The target flow table identifies the corresponding target flow table.
该转发设备700还包括存储器704,用于存放程序等。具体地,程序可以 包括程序代码,该程序代码包括计算机操作指令。存储器704可能包含随机存取存储器(random access memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。处理器702执行存储器704所存放的应用程序,实现如上流表同步的实现方法。The forwarding device 700 also includes a memory 704 for storing programs and the like. Specifically, the program can A program code is included, the program code including computer operating instructions. The memory 704 may include a random access memory (RAM), and may also include a non-volatile memory such as at least one disk storage. The processor 702 executes the application stored in the memory 704 to implement the implementation method of the flow table synchronization as described above.
综上所述,通过本发明实施例中提供的一种流表同步的实现方法及转发设备,该方法通过在转发设备中的源流表修改后,可以直接确定待同步的源流表项,并基于与该源流表关联的同步规则,对该待同步的流表项进行转换,并将转换后生成的目标流表项同步至目标流表中,由于不需要通过控制器进行流表间的同步,而是转发设备独立完成整个同步过程,因此避免了浪费控制器的计算资源,也避免了交换机与控制器之间的信令交互,减小了流表同步的时延,实现了转发设备和控制器的彻底解耦,同时,在转发设备中源流表与包含该源流表标识的同步规则建立关联,即将同步规则在源流表侧进行维护,在源流表修改后,可以直接确定与源流表关联的同步规则,进而进行同步操作,且由于同步规则中还包含有目标流表标识,因此,可以快速找到目标流表进行同步,进一步缩小了流表同步的时延,提高了流表同步的效率。In summary, the method for implementing flow table synchronization and the forwarding device are provided by the embodiment of the present invention. After the source flow table in the forwarding device is modified, the method can directly determine the source flow entry to be synchronized, and based on The synchronization rule associated with the source flow table converts the flow entry to be synchronized, and synchronizes the target flow entry generated after the conversion to the target flow table, because synchronization between the flow tables is not required by the controller. Rather, the forwarding device independently completes the entire synchronization process, thereby avoiding wasting the computing resources of the controller, avoiding the signaling interaction between the switch and the controller, reducing the delay of the flow table synchronization, and implementing the forwarding device and control. The device is completely decoupled. At the same time, the source flow table is associated with the synchronization rule containing the source flow table identifier. The synchronization rule is maintained on the source flow table side. After the source flow table is modified, the source flow table can be directly determined. Synchronize the rules, and then perform the synchronization operation, and because the synchronization rules also contain the target flow table identifier, the target flow table can be quickly found. Line synchronization, flow table further refine the synchronization delay, improve the efficiency of the flow table synchronization.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention 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 present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. To implement the functions specified in one or more blocks of a flow or a flow and/or block diagram of a flowchart Device.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiment of the invention has been described, it will be apparent to those skilled in the < Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。 It is apparent that those skilled in the art can make various modifications and variations to the embodiments of the invention without departing from the spirit and scope of the embodiments of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the embodiments of the invention.

Claims (54)

  1. 一种流表同步的实现方法,其特征在于,包括:A method for implementing flow table synchronization, which is characterized by comprising:
    转发设备在对一源流表修改后,确定与所述源流表关联的同步规则,同步规则中包括源流表标识、目标流表标识,以及源流表项的转换规则,其中,所述源流表项为所述源流表标识对应的源流表中的流表项,所述同步规则包括的源流表标识与所述源流表的源流表标识相同;After the source device is modified, the forwarding device determines a synchronization rule that is associated with the source flow table. The synchronization rule includes a source flow table identifier, a target flow table identifier, and a source flow entry conversion rule, where the source flow entry is The source flow table identifies a flow entry in the source flow table, and the source flow table identifier included in the synchronization rule is the same as the source flow table identifier in the source flow table;
    所述转发设备根据所述源流表,确定待同步的源流表项,并根据所述源流表项的转换规则,对所述待同步的源流表项进行转换,将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中。Determining, by the source device, the source flow entry to be synchronized according to the source flow table, and converting the source flow entry to be synchronized according to the conversion rule of the source flow entry, and converting the generated target flow entry Synchronizing to the target flow table corresponding to the target flow table identifier.
  2. 如权利要求1所述的方法,其特征在于,当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,所述转发设备根据所述源流表,确定需要同步的源流表项,包括:The method according to claim 1, wherein when the source flow table is modified to install the source flow entry to be added to the source flow table, the forwarding device determines that synchronization is required according to the source flow table. Source flow entry, including:
    所述转发设备将安装到所述源流表中所述待增加的源流表项作为待同步的源流表项;或者The forwarding device installs the source flow entry to be added in the source flow table as a source flow entry to be synchronized; or
    当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,所述转发设备根据所述源流表,确定需要同步的源流表项,包括:When the source flow table is modified to modify the source flow entry to be modified in the source flow table, the forwarding device determines, according to the source flow table, the source flow entry to be synchronized, including:
    所述转发设备将所述源流表中的所述待修改的源流表项、修改后的源流表项作为待同步的源流表项;或者The forwarding device uses the source flow entry to be modified and the modified source flow entry in the source flow table as the source flow entry to be synchronized; or
    当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,所述转发设备根据所述源流表,确定需要同步的源流表项,包括:When the source flow table is modified to invalidate the source flow entry to be invalidated in the source flow table, the forwarding device determines, according to the source flow table, the source flow entry to be synchronized, including:
    所述转发设备将所述源流表中所述待无效的源流表项作为待同步的源流表项。The forwarding device uses the source flow entry to be invalidated in the source flow table as a source flow entry to be synchronized.
  3. 如权利要求2所述的方法,其特征在于,当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,所述转发设备将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中,包括:The method of claim 2, wherein when the source flow table is modified to install the source flow entry to be added to the source flow table, the forwarding device converts the generated target flow entry Synchronizing to the target flow table corresponding to the target flow table identifier, including:
    所述转发设备将生成的目标流表项安装到所述目标流表标识对应的目标 流表中。The forwarding device installs the generated target flow entry to the target corresponding to the target flow table identifier In the flow table.
  4. 如权利要求2所述的方法,其特征在于,当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,所述转发设备将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中,包括:The method according to claim 2, wherein when the source flow table is modified to modify the source flow entry to be modified in the source flow table, the forwarding device converts the generated target flow entry Synchronizing to the target flow table corresponding to the target flow table identifier, including:
    在所述目标流表标识对应的目标流表中,查找到所述待修改的源流表项转换后生成的目标流表项后,对查找到的目标流表项进行无效处理;After the target flow entry generated by the source flow entry to be modified is found in the target flow table corresponding to the target flow table identifier, the target flow entry that is found is invalidized after being found;
    将修改后的源流表项转换后生成的目标流表项安装到所述目标流表标识对应的目标流表中。The target flow entry generated after the modified source flow entry is converted is installed in the target flow table corresponding to the target flow table identifier.
  5. 如权利要求2所述的方法,其特征在于,当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,所述转发设备将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中,包括:The method according to claim 2, wherein when the source flow table is modified to invalidate the source flow entry to be invalidated in the source flow table, the forwarding device generates the target flow after the conversion The entry is synchronized to the target flow table corresponding to the target flow table identifier, including:
    在所述目标流表标识对应的目标流表中,查找到生成的目标流表项后,对查找到的目标流表项进行无效处理。After the generated target flow entry is found in the target flow table corresponding to the target flow table identifier, the found target flow entry is invalidated.
  6. 如权利要求3或4所述的方法,其特征在于,所述转发设备将生成的目标流表项安装到所述目标流表标识对应的目标流表中,包括:The method of claim 3 or 4, wherein the forwarding device installs the generated target flow entry into the target flow table corresponding to the target flow table identifier, including:
    将生成的包含有同步规则标识的所述目标流表项,安装到所述目标流表标识对应的目标流表中,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。And the generated target flow entry is included in the target flow table corresponding to the target flow table identifier, where the synchronization rule identifier is used to indicate that the target flow entry is based on the The synchronization rule identifies the corresponding synchronization rule generated.
  7. 如权利要求1-6任一项所述的方法,其特征在于,所述转发设备在将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中之后,还包括:The method according to any one of claims 1-6, wherein the forwarding device further includes, after synchronizing the target flow entry generated after the conversion to the target flow table corresponding to the target flow table identifier, :
    向所述控制器发送目标流表变化通知消息。A target flow table change notification message is sent to the controller.
  8. 如权利要求1-7任一项所述的方法,其特征在于,还包括:The method of any of claims 1-7, further comprising:
    所述转发设备接收所述控制器发送同步规则增加消息,所述同步规则增加消息中包含待增加的同步规则;The forwarding device receives the synchronization rule addition message sent by the controller, where the synchronization rule addition message includes a synchronization rule to be added;
    所述转发设备将所述待增加的同步规则中包括的源流表标识对应的源流表与接收的所述待增加的同步规则建立关联。 And the forwarding device associates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added with the received synchronization rule to be added.
  9. 如权利要求8所述的方法,其特征在于,所述转发设备在接收到控制器发送的同步规则增加消息之后,在将所述待增加的同步规则中包括的源流表标识对应的源流表、接收的所述同步规则建立关联之前,还包括:The method according to claim 8, wherein the forwarding device, after receiving the synchronization rule addition message sent by the controller, identifies the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added, Before the received synchronization rule is associated, the method further includes:
    对所述待增加的同步规则进行校验,并确定校验通过。The synchronization rule to be added is checked, and the verification is determined to pass.
  10. 如权利要求9所述的方法,其特征在于,所述转发设备在将所述待增加的同步规则中包括的源流表标识对应的源流表、接收的所述同步规则建立关联之后,还包括:The method according to claim 9, wherein the forwarding device, after associating the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added, and the received synchronization rule, further includes:
    向所述控制器发送同步规则增加响应消息。A synchronization rule addition response message is sent to the controller.
  11. 如权利要求8-10任一项所述的方法,其特征在于,所述转发设备在接收所述控制器发送同步规则增加消息之后,还包括:The method according to any one of claims 8 to 10, further comprising: after receiving the synchronization rule addition message by the controller, the forwarding device further comprises:
    根据所述待增加的同步规则包括的源流表项的转换规则,对所述待增加的同步规则中包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标流表项同步至所述待增加的同步规则包括的目标流表标识对应的目标流表中。Converting, according to the conversion rule of the source flow entry included in the synchronization rule to be added, the source flow entry in the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added, and converting the generated target flow The entry is synchronized to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be added.
  12. 如权利要求1-11任一项所述的方法,其特征在于,还包括:The method of any of claims 1-11, further comprising:
    所述转发设备接收所述控制器发送的同步规则修改消息,所述同步规则修改消息中包括同步规则修改规则;The forwarding device receives a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a synchronization rule modification rule;
    所述转发设备根据所述同步规则修改消息,确定待修改的同步规则;Determining, by the forwarding device, the synchronization rule according to the synchronization rule to determine a synchronization rule to be modified;
    所述转发设备根据所述同步规则修改规则、以及所述待修改的同步规则,生成新同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同;The forwarding device generates a new synchronization rule according to the synchronization rule modification rule and the synchronization rule to be modified, where the new synchronization rule and the source flow table identifier and the target flow included in the synchronization rule to be modified The table identifiers are the same, and the conversion rules of the source flow entries are different.
    所述转发设备将所述待修改的同步规则中包括的源流表标识对应的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。The forwarding device de-associates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be modified with the synchronization rule to be modified; and the source flow table corresponding to the source flow table identifier included in the new synchronization rule Associated with the new synchronization rule.
  13. 如权利要求12所述的方法,其特征在于,所述转发设备在确定待修改的同步规则之后,在生成新同步规则之前,还包括:The method according to claim 12, wherein the forwarding device, after determining the synchronization rule to be modified, before generating the new synchronization rule, further includes:
    基于所述待修改的同步规则,对所述同步规则修改消息进行校验,并确 定校验通过。And verifying, according to the synchronization rule to be modified, the synchronization rule modification message, and determining The calibration is passed.
  14. 如权利要求1-11任一项所述的方法,其特征在于,还包括:The method of any of claims 1-11, further comprising:
    所述转发设备接收所述控制器发送的同步规则修改消息,所述同步规则修改消息中包括新同步规则;The forwarding device receives a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a new synchronization rule;
    所述转发设备根据所述同步规则修改消息,确定待修改的同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同;The forwarding device determines the synchronization rule to be modified according to the synchronization rule modification message, where the new synchronization rule is the same as the source flow table identifier and the target flow table identifier included in the synchronization rule to be modified, and includes The conversion rules of source flow entries are different.
    所述转发设备将所述待修改的同步规则中包括的源流表标识对应的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。The forwarding device de-associates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be modified with the synchronization rule to be modified; and the source flow table corresponding to the source flow table identifier included in the new synchronization rule Associated with the new synchronization rule.
  15. 如权利要求14所述的方法,其特征在于,所述转发设备在接收所述控制器发送的同步规则修改消息之后,在确定待修改的同步规则之前,还包括:The method according to claim 14, wherein the forwarding device, after receiving the synchronization rule modification message sent by the controller, before determining the synchronization rule to be modified, further includes:
    对所述新同步规则进行校验,并确定校验通过。The new synchronization rule is verified and the verification is determined to pass.
  16. 如权利要求12或14所述的方法,其特征在于,所述转发设备在确定待修改的同步规则之后,还包括:The method according to claim 12 or 14, wherein the forwarding device further comprises: after determining the synchronization rule to be modified:
    在所述待修改的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待修改的同步规则生成的目标流表项;Determining, according to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, a target flow entry generated based on the synchronization rule to be modified;
    对确定的目标流表项进行无效处理。Invalid processing of the determined target flow entry.
  17. 如权利要求16所述的方法,其特征在于,所述转发设备在所述待修改的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待修改的同步规则生成的目标流表项,包括:The method according to claim 16, wherein the forwarding device determines a target generated based on the synchronization rule to be modified in a target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified. Flow entry, including:
    当所述待修改的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待修改的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的; When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, in the target flow table, the matching synchronization rule identifier included in the target flow table is a target flow entry identified by the synchronization rule of the synchronization rule to be modified, wherein the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
    将查找到的目标流表项作为基于所述待修改的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be modified.
  18. 如权利要求16或17所述的方法,其特征在于,所述转发设备在对确定的目标流表项进行无效处理之后,还包括:The method according to claim 16 or 17, wherein the forwarding device, after invalidating the determined target flow entry, further comprises:
    根据所述新同步规则包括的源流表项的转换规则,对所述新同步规则包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中。And converting, according to the conversion rule of the source flow entry included in the new synchronization rule, the source flow entry in the source flow table corresponding to the source flow table identifier included in the new synchronization rule, and synchronizing the target flow entry generated after the conversion to the The target synchronization flow table included in the new synchronization rule is identified in the corresponding target flow table.
  19. 如权利要求18所述的方法,其特征在于,所述转发设备将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中,包括:The method of claim 18, wherein the forwarding device synchronizes the target stream entry generated by the conversion to the target flow table corresponding to the target flow table identifier included in the new synchronization rule, including:
    将生成的目标流表项安装到所述新同步规则包括的目标流表标识对应的目标流表中。The generated target flow entry is installed in the target flow table corresponding to the target flow table identifier included in the new synchronization rule.
  20. 如权利要求12-19任一项所述的方法,其特征在于,所述转发设备在确定待修改的同步规则之后,还包括:The method according to any one of claims 12 to 19, wherein after the determining, by the forwarding device, the synchronization rule to be modified, the method further includes:
    向所述控制器发送同步规则修改响应消息。A synchronization rule modification response message is sent to the controller.
  21. 如权利要求1-20任一项所述的方法,其特征在于,还包括:The method of any of claims 1 to 20, further comprising:
    所述转发设备接收所述控制器发送的同步规则删除消息;Receiving, by the forwarding device, a synchronization rule deletion message sent by the controller;
    所述转发设备根据所述同步规则删除消息,确定待删除的同步规则;Determining, by the forwarding device, the synchronization rule according to the synchronization rule to determine a synchronization rule to be deleted;
    所述转发设备将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联。The forwarding device de-associates the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted with the synchronization rule to be deleted.
  22. 如权利要求21所述的方法,其特征在于,所述转发设备在确定待删除的同步规则之后,还包括:The method of claim 21, wherein the forwarding device, after determining the synchronization rule to be deleted, further comprises:
    在所述待删除的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待删除的同步规则生成的目标流表项,并对确定的目标流表项进行无效处理。And determining, in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, a target flow entry generated based on the synchronization rule to be deleted, and performing invalid processing on the determined target flow entry.
  23. 如权利要求22所述的方法,其特征在于,所述转发设备在所述待删除的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待删除 的同步规则生成的目标流表项,包括:The method according to claim 22, wherein the forwarding device determines, based on the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, that the device is to be deleted. The target flow entry generated by the synchronization rule includes:
    当所述待删除的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待删除的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, in the target flow table, the included synchronization rule identifier is found as a target flow entry that is identified by a synchronization rule of the synchronization rule to be deleted, where the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
    将查找到的目标流表项作为基于所述待删除的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be deleted.
  24. 如权利要求21-23任一项所述的方法,其特征在于,所述转发设备在将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联之后,还包括:The method according to any one of claims 21 to 23, wherein the forwarding device releases the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted and the synchronization rule to be deleted After the association, it also includes:
    向所述控制器发送同步规则删除响应消息。A synchronization rule deletion response message is sent to the controller.
  25. 如权利要求2所述的方法,其特征在于,所述转发设备对待无效的源流表项进行无效处理,包括:The method of claim 2, wherein the forwarding device performs invalid processing on the invalid source flow entry, including:
    对所述待无效的源流表项设置设定的老化时间。The set aging time is set for the source flow entry to be invalidated.
  26. 如权利要求4,5,16,22中任一项所述的方法,其特征在于,所述转发设备对目标流表项进行无效处理,包括:The method according to any one of claims 4, 5, 16, 22, wherein the forwarding device invalidates the target flow entry, including:
    对所述目标流表项设置设定的老化时间。Setting the aging time of the target flow entry.
  27. 如权利要求26所述的方法,其特征在于,所述转发设备对目标流表项进行无效处理,还包括:The method of claim 26, wherein the forwarding device invalidates the target flow entry, further comprising:
    当所述目标流表项中保存有同步规则标识时,将所述目标流表项中包含的同步规则标识删除,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。When the synchronization rule identifier is saved in the target flow entry, the synchronization rule identifier included in the target flow entry is deleted, where the synchronization rule identifier is used to indicate that the target flow entry is based on the The synchronization rule identifies the corresponding synchronization rule generated.
  28. 一种转发设备,其特征在于,包括:A forwarding device, comprising:
    第一确定单元,用于在对一源流表修改后,确定与所述源流表关联的同步规则,同步规则中包括源流表标识、目标流表标识,以及源流表项的转换规则,其中,所述源流表项为所述源流表标识对应的源流表中的流表项,所 述同步规则包括的源流表标识与所述源流表的源流表标识相同;a first determining unit, configured to determine, after modifying a source flow table, a synchronization rule associated with the source flow table, where the synchronization rule includes a source flow table identifier, a target flow table identifier, and a conversion rule of the source flow entry, where The source flow entry is a flow entry in the source flow table corresponding to the source flow table identifier. The source flow table identifier included in the synchronization rule is the same as the source flow table identifier of the source flow table;
    第一处理单元,用于根据所述源流表,确定待同步的源流表项,并根据所述源流表项的转换规则,对所述待同步的源流表项进行转换,将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中。a first processing unit, configured to determine, according to the source flow table, a source flow entry to be synchronized, and convert the source flow entry to be synchronized according to a conversion rule of the source flow entry, and convert the generated target The flow entry is synchronized to the target flow table corresponding to the target flow table identifier.
  29. 如权利要求28所述的转发设备,其特征在于,所述第一处理单元,用于:The forwarding device according to claim 28, wherein the first processing unit is configured to:
    当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,将安装到所述源流表中所述待增加的源流表项作为待同步的源流表项;或者When the source flow table is modified to install the source flow entry to be added to the source flow table, the source flow entry to be added to the source flow table is used as the source flow entry to be synchronized; or
    当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,将所述源流表中的所述待修改的源流表项、修改后的源流表项作为待同步的源流表项;或者When the source flow table is modified to modify the source flow entry to be modified in the source flow table, the source flow entry to be modified and the modified source flow entry in the source flow table are to be synchronized. Source flow entry; or
    当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,将所述源流表中所述待无效的源流表项作为待同步的源流表项。When the source flow table is modified to invalidate the source flow entry to be invalidated in the source flow table, the source flow entry to be invalidated in the source flow table is used as the source flow entry to be synchronized.
  30. 如权利要求29所述的转发设备,其特征在于,当对所述源流表修改为将待增加的源流表项安装至所述源流表中时,所述第一处理单元,用于:The forwarding device according to claim 29, wherein when the source flow table is modified to install the source flow entry to be added to the source flow table, the first processing unit is configured to:
    将生成的目标流表项安装到所述目标流表标识对应的目标流表中。The generated target flow entry is installed in the target flow table corresponding to the target flow table identifier.
  31. 如权利要求29所述的转发设备,其特征在于,当对所述源流表修改为对所述源流表中待修改的源流表项进行修改时,所述第一处理单元,用于:The forwarding device according to claim 29, wherein when the source flow table is modified to modify a source flow entry to be modified in the source flow table, the first processing unit is configured to:
    在所述目标流表标识对应的目标流表中,查找到所述待修改的源流表项转换后生成的目标流表项后,对查找到的目标流表项进行无效处理;After the target flow entry generated by the source flow entry to be modified is found in the target flow table corresponding to the target flow table identifier, the target flow entry that is found is invalidized after being found;
    将修改后的源流表项转换后生成的目标流表项安装到所述目标流表标识对应的目标流表中。The target flow entry generated after the modified source flow entry is converted is installed in the target flow table corresponding to the target flow table identifier.
  32. 如权利要求29所述的转发设备,其特征在于,当对所述源流表修改为将所述源流表中的待无效的源流表项进行无效处理时,所述第一处理单元,用于:The forwarding device according to claim 29, wherein when the source flow table is modified to invalidate the source flow entry to be invalidated in the source flow table, the first processing unit is configured to:
    在所述目标流表标识对应的目标流表中,查找到生成的目标流表项后,对查找到的目标流表项进行无效处理。 After the generated target flow entry is found in the target flow table corresponding to the target flow table identifier, the found target flow entry is invalidated.
  33. 如权利要求30或31所述的转发设备,其特征在于,所述第一处理单元,在将生成的目标流表项安装到所述目标流表标识对应的目标流表中时,用于:The forwarding device according to claim 30 or 31, wherein the first processing unit is configured to: when the generated target flow entry is installed in the target flow table corresponding to the target flow table identifier:
    将生成的包含有同步规则标识的所述目标流表项,安装到所述目标流表标识对应的目标流表中,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。And the generated target flow entry is included in the target flow table corresponding to the target flow table identifier, where the synchronization rule identifier is used to indicate that the target flow entry is based on the The synchronization rule identifies the corresponding synchronization rule generated.
  34. 如权利要求28-33任一项所述的转发设备,其特征在于,还包括:The forwarding device according to any one of claims 28 to 33, further comprising:
    第一发送单元,用于在将转换后生成的目标流表项同步至所述目标流表标识对应的目标流表中之后,向所述控制器发送目标流表变化通知消息。The first sending unit is configured to send a target flow table change notification message to the controller after synchronizing the target flow entry generated after the conversion to the target flow table corresponding to the target flow table identifier.
  35. 如权利要求28-34任一项所述的转发设备,其特征在于,还包括:The forwarding device according to any one of claims 28 to 34, further comprising:
    第一接收单元,用于接收所述控制器发送同步规则增加消息,所述同步规则增加消息中包含待增加的同步规则;a first receiving unit, configured to receive, by the controller, a synchronization rule addition message, where the synchronization rule addition message includes a synchronization rule to be added;
    第一关联单元,用于将所述待增加的同步规则中包括的源流表标识对应的源流表与接收的所述待增加的同步规则建立关联。The first association unit is configured to associate the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added with the received synchronization rule to be added.
  36. 如权利要求35所述的转发设备,其特征在于,还包括:The forwarding device of claim 35, further comprising:
    第一校验单元,用于在接收到控制器发送的同步规则增加消息之后,在将所述待增加的同步规则中包括的源流表标识对应的源流表、接收的所述同步规则建立关联之前,对所述待增加的同步规则进行校验,并确定校验通过。a first checking unit, configured to: after receiving the synchronization rule addition message sent by the controller, before associating the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added, and the received synchronization rule And verifying the synchronization rule to be added, and determining that the verification is passed.
  37. 如权利要求36所述的转发设备,其特征在于,第二发送单元,用于:The forwarding device according to claim 36, wherein the second sending unit is configured to:
    在将所述待增加的同步规则中包括的源流表标识对应的源流表、接收的所述同步规则建立关联之后,向所述控制器发送同步规则增加响应消息。After the source flow table corresponding to the source flow table identifier included in the synchronization rule to be added is associated with the received synchronization rule, a synchronization rule increase response message is sent to the controller.
  38. 如权利要求35-37任一项所述的转发设备,其特征在于,还包括:The forwarding device according to any one of claims 35 to 37, further comprising:
    第二处理单元,用于在接收所述控制器发送同步规则增加消息之后,根据所述待增加的同步规则包括的源流表项的转换规则,对所述待增加的同步规则中包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标流表项同步至所述待增加的同步规则包括的目标流表标识对应的目标流表中。 a second processing unit, configured to: after receiving the synchronization rule addition message, the source flow table included in the synchronization rule to be added according to the conversion rule of the source flow entry included in the synchronization rule to be added The source flow entry in the corresponding source flow table is converted, and the target flow entry generated after the conversion is synchronized to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be added.
  39. 如权利要求28-38任一项所述的转发设备,其特征在于,还包括:The forwarding device according to any one of claims 28 to 38, further comprising:
    第二接收单元,用于接收所述控制器发送的同步规则修改消息,所述同步规则修改消息中包括同步规则修改规则;a second receiving unit, configured to receive a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a synchronization rule modification rule;
    第二确定单元,用于根据所述同步规则修改消息,确定待修改的同步规则;a second determining unit, configured to modify a message according to the synchronization rule, and determine a synchronization rule to be modified;
    生成单元,用于根据所述同步规则修改规则、以及所述待修改的同步规则,生成新同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同;a generating unit, configured to generate a new synchronization rule according to the synchronization rule modification rule and the synchronization rule to be modified, where the new synchronization rule and the source flow table identifier and target included in the synchronization rule to be modified The flow table identifiers are the same, and the conversion rules of the source flow entries are different.
    第二关联单元,用于将所述待修改的同步规则中包括的源流表标识对应的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。a second association unit, configured to disassociate the source flow table corresponding to the source flow table identifier included in the synchronization rule to be modified, and the synchronization rule to be modified; and corresponding to the source flow table identifier included in the new synchronization rule The source flow table is associated with the new synchronization rule.
  40. 如权利要求39所述的转发设备,其特征在于,还包括:The forwarding device of claim 39, further comprising:
    第二校验单元,用于在确定待修改的同步规则之后,在生成新同步规则之前,基于所述待修改的同步规则,对所述同步规则修改消息进行校验,并确定校验通过。The second check unit is configured to check the synchronization rule modification message based on the synchronization rule to be modified, and determine the verification pass, after determining the synchronization rule to be modified, before generating the new synchronization rule.
  41. 如权利要求28-38任一项所述的转发设备,其特征在于,还包括:The forwarding device according to any one of claims 28 to 38, further comprising:
    第二接收单元,用于接收所述控制器发送的同步规则修改消息,所述同步规则修改消息中包括新同步规则;a second receiving unit, configured to receive a synchronization rule modification message sent by the controller, where the synchronization rule modification message includes a new synchronization rule;
    第二确定单元,用于根据所述同步规则修改消息,确定待修改的同步规则,其中,所述新同步规则与所述待修改的同步规则中包括的源流表标识和目标流表标识相同,且包括的源流表项的转换规则不同;a second determining unit, configured to determine, according to the synchronization rule modification message, a synchronization rule to be modified, where the new synchronization rule is the same as the source flow table identifier and the target flow table identifier included in the synchronization rule to be modified, The conversion rules of the source flow entries are different.
    第二关联单元,用于将所述待修改的同步规则中包括的源流表标识对应的源流表与所述待修改的同步规则解除关联;并将所述新同步规则中包括的源流表标识对应的源流表与所述新同步规则建立关联。a second association unit, configured to disassociate the source flow table corresponding to the source flow table identifier included in the synchronization rule to be modified, and the synchronization rule to be modified; and corresponding to the source flow table identifier included in the new synchronization rule The source flow table is associated with the new synchronization rule.
  42. 如权利要求41所述的转发设备,其特征在于,还包括:The forwarding device of claim 41, further comprising:
    第二校验单元,用于在接收所述控制器发送的同步规则修改消息之后,在确定待修改的同步规则之前,对所述新同步规则进行校验,并确定校验通 过。a second checking unit, configured to: after receiving the synchronization rule modification message sent by the controller, verify the new synchronization rule, and determine the verification pass before determining the synchronization rule to be modified Over.
  43. 如权利要求39或41所述的转发设备,其特征在于,还包括:The forwarding device according to claim 39 or 41, further comprising:
    第三处理单元,用于在确定待修改的同步规则之后,在所述待修改的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待修改的同步规则生成的目标流表项;a third processing unit, configured to: after determining the synchronization rule to be modified, determine, in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, the target flow generated based on the synchronization rule to be modified Entry
    对确定的目标流表项进行无效处理。Invalid processing of the determined target flow entry.
  44. 如权利要求43所述的转发设备,其特征在于,所述第三处理单元,用于:The forwarding device according to claim 43, wherein the third processing unit is configured to:
    当所述待修改的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待修改的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be modified, in the target flow table, the matching synchronization rule identifier included in the target flow table is a target flow entry identified by the synchronization rule of the synchronization rule to be modified, wherein the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
    将查找到的目标流表项作为基于所述待修改的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be modified.
  45. 如权利要求43或44所述的转发设备,其特征在于,所述第三处理单元,还用于:The forwarding device according to claim 43 or 44, wherein the third processing unit is further configured to:
    在对确定的目标流表项进行无效处理之后,根据所述新同步规则包括的源流表项的转换规则,对所述新同步规则包括的源流表标识对应的源流表中的源流表项进行转换,将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中。After the invalidation of the determined target flow entry, the source flow entry in the source flow table corresponding to the source flow table identifier included in the new synchronization rule is converted according to the conversion rule of the source flow entry included in the new synchronization rule. And synchronizing the target flow entry generated after the conversion to the target flow table corresponding to the target flow table identifier included in the new synchronization rule.
  46. 如权利要求45所述的转发设备,其特征在于,所述第三处理单元,在将转换后生成的目标流表项同步至所述新同步规则包括的目标流表标识对应的目标流表中时,用于:The forwarding device according to claim 45, wherein the third processing unit synchronizes the target flow entry generated after the conversion to the target flow table corresponding to the target flow table identifier included in the new synchronization rule When used to:
    将生成的目标流表项安装到所述新同步规则包括的目标流表标识对应的目标流表中。The generated target flow entry is installed in the target flow table corresponding to the target flow table identifier included in the new synchronization rule.
  47. 如权利要求39-46任一项所述的转发设备,其特征在于,还包括: The forwarding device according to any one of claims 39 to 46, further comprising:
    第三发送单元,用于在确定待修改的同步规则之后,向所述控制器发送同步规则修改响应消息。And a third sending unit, configured to send a synchronization rule modification response message to the controller after determining the synchronization rule to be modified.
  48. 如权利要求28-47任一项所述的转发设备,其特征在于,还包括:The forwarding device according to any one of claims 28 to 47, further comprising:
    第三接收单元,用于接收所述控制器发送的同步规则删除消息;a third receiving unit, configured to receive a synchronization rule deletion message sent by the controller;
    第三确定单元,用于根据所述同步规则删除消息,确定待删除的同步规则;a third determining unit, configured to delete a message according to the synchronization rule, and determine a synchronization rule to be deleted;
    第三关联单元,用于将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联。The third association unit is configured to disassociate the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted from the synchronization rule to be deleted.
  49. 如权利要求48所述的转发设备,其特征在于,还包括:The forwarding device of claim 48, further comprising:
    第四处理单元,用于所述转发设备在确定待删除的同步规则之后,在所述待删除的同步规则包含的目标流表标识对应的目标流表中,确定基于所述待删除的同步规则生成的目标流表项,并对确定的目标流表项进行无效处理。a fourth processing unit, configured to: after the determining, by the forwarding device, the synchronization rule to be deleted, determining, according to the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, the synchronization rule to be deleted The generated target flow entry and invalidate the determined target flow entry.
  50. 如权利要求49所述的转发设备,其特征在于,所述第四处理单元,用于:The forwarding device according to claim 49, wherein the fourth processing unit is configured to:
    当所述待删除的同步规则包含的目标流表标识对应的目标流表中,目标流表项中保存有同步规则标识时,在所述目标流表中,查找包含的同步规则标识为所述待删除的同步规则的同步规则标识的目标流表项,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的;When the synchronization rule identifier is stored in the target flow table entry in the target flow table corresponding to the target flow table identifier included in the synchronization rule to be deleted, in the target flow table, the included synchronization rule identifier is found as a target flow entry that is identified by a synchronization rule of the synchronization rule to be deleted, where the synchronization rule identifier is used to indicate that the target flow entry is generated based on a synchronization rule corresponding to the synchronization rule identifier;
    将查找到的目标流表项作为基于所述待删除的同步规则生成的目标流表项。The found target flow entry is used as the target flow entry generated based on the synchronization rule to be deleted.
  51. 如权利要求48-50任一项所述的转发设备,其特征在于,还包括:The forwarding device according to any one of claims 48 to 50, further comprising:
    第四发送单元,用于在将所述待删除的同步规则中包括的源流表标识对应的源流表与所述待删除的同步规则解除关联之后,向所述控制器发送同步规则删除响应消息。And a fourth sending unit, configured to send a synchronization rule deletion response message to the controller after disassociating the source flow table corresponding to the source flow table identifier included in the synchronization rule to be deleted from the synchronization rule to be deleted.
  52. 如权利要求29所述的转发设备,其特征在于,对待无效的源流表项进行无效处理,包括: The forwarding device of claim 29, wherein the invalidation of the source flow entry to be invalidated comprises:
    对所述待无效的源流表项设置设定的老化时间。The set aging time is set for the source flow entry to be invalidated.
  53. 如权利要求31,32,43,49中任一项所述的转发设备,其特征在于,对目标流表项进行无效处理,包括:The forwarding device according to any one of claims 31, 32, 43 and 49, wherein the invalidating the target flow entry includes:
    对所述目标流表项设置设定的老化时间。Setting the aging time of the target flow entry.
  54. 如权利要求53所述的转发设备,其特征在于,对目标流表项进行无效处理,还包括:The forwarding device of claim 53, wherein the invalidating the target flow entry further comprises:
    当所述目标流表项中保存有同步规则标识时,将所述目标流表项中包含的同步规则标识删除,其中,所述同步规则标识用于指示所述目标流表项是基于所述同步规则标识对应的同步规则生成的。 When the synchronization rule identifier is saved in the target flow entry, the synchronization rule identifier included in the target flow entry is deleted, where the synchronization rule identifier is used to indicate that the target flow entry is based on the The synchronization rule identifies the corresponding synchronization rule generated.
PCT/CN2015/085740 2015-07-31 2015-07-31 Method for realizing flow table synchronization and forwarding device WO2017020173A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201580031073.XA CN107534612B (en) 2015-07-31 2015-07-31 Flow table synchronization realization method and forwarding equipment
PCT/CN2015/085740 WO2017020173A1 (en) 2015-07-31 2015-07-31 Method for realizing flow table synchronization and forwarding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/085740 WO2017020173A1 (en) 2015-07-31 2015-07-31 Method for realizing flow table synchronization and forwarding device

Publications (1)

Publication Number Publication Date
WO2017020173A1 true WO2017020173A1 (en) 2017-02-09

Family

ID=57942175

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/085740 WO2017020173A1 (en) 2015-07-31 2015-07-31 Method for realizing flow table synchronization and forwarding device

Country Status (2)

Country Link
CN (1) CN107534612B (en)
WO (1) WO2017020173A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110943928B (en) * 2018-09-25 2022-01-07 中兴通讯股份有限公司 Method for synchronizing forwarding information states, controller, network forwarding device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103326943A (en) * 2012-03-23 2013-09-25 日电(中国)有限公司 Data stream rerouting method and controller
CN104426815A (en) * 2013-08-27 2015-03-18 中兴通讯股份有限公司 Flow table issuing method and system in software-defined network, open flow controller and open flow switch
WO2015106216A1 (en) * 2014-01-10 2015-07-16 Fox Broadcasting Company Method and apparatus for precisely source-timed network flow switching
WO2015109497A1 (en) * 2014-01-23 2015-07-30 华为技术有限公司 Flow table modifying method, flow table modifying device, and openflow network system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150180769A1 (en) * 2013-12-20 2015-06-25 Alcatel-Lucent Usa Inc. Scale-up of sdn control plane using virtual switch based overlay
CN104065764B (en) * 2014-07-05 2017-07-25 中国科学技术大学 A kind of mobile management system replaced in software defined network based on address

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103326943A (en) * 2012-03-23 2013-09-25 日电(中国)有限公司 Data stream rerouting method and controller
CN104426815A (en) * 2013-08-27 2015-03-18 中兴通讯股份有限公司 Flow table issuing method and system in software-defined network, open flow controller and open flow switch
WO2015106216A1 (en) * 2014-01-10 2015-07-16 Fox Broadcasting Company Method and apparatus for precisely source-timed network flow switching
WO2015109497A1 (en) * 2014-01-23 2015-07-30 华为技术有限公司 Flow table modifying method, flow table modifying device, and openflow network system

Also Published As

Publication number Publication date
CN107534612A (en) 2018-01-02
CN107534612B (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN106878166B (en) Route notification method and device
US10915374B2 (en) Method of facilitating live migration of virtual machines
WO2019100921A1 (en) Information pushing method and device
EP2728470B1 (en) Method and apparatus for configuring network policy of virtual networks
WO2018099151A1 (en) Instruction generation process multiplexing method and device
WO2015074182A1 (en) Table items addressing method, switch, and controller based on flow table
TW201729566A (en) Network management system based on hybrid cloud platform
CN104869125B (en) SDN-based dynamic MAC address spoofing prevention method
JP2013520748A5 (en)
CN107547566B (en) Method and device for processing service message
JP2017535196A (en) Method, apparatus and system for migrating virtual network function instances
CN106603409B (en) Data processing system, method and equipment
CN106354566A (en) Command processing method and server
WO2017020173A1 (en) Method for realizing flow table synchronization and forwarding device
WO2018049583A1 (en) User plane sharing method, device and supervising management device based on network slicing
WO2014107836A1 (en) Network alarm method and device
WO2024040997A1 (en) Method and apparatus for controlling home appliance, gateway air conditioner, and storage medium
WO2015103869A1 (en) Method for tracing and filtering openflow message in software defined network
CN107147719A (en) A kind of hardware update method, master node, slave node and server cluster
CN110768811B (en) Method, device and system for updating YANG model file library
CN105227353A (en) A kind of MYSQL cluster implementation method and system
WO2016082614A1 (en) Method and device for processing multicast route table entry, and computer storage medium
CN111327437B (en) Flow table processing method, flow table processing device, and SDN network system
US10977064B2 (en) Live virtual machine migration
US20230280998A1 (en) Scheduling a pausable automated process in a computer network

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

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

Country of ref document: EP

Kind code of ref document: A1