A flow table updating method, device, network system and electronic device

By obtaining and updating the flow table identifier of network devices in SDN, the network interruption problem during flow table update is solved, and the stability of SDN is improved.

CN118802743BActive Publication Date: 2025-01-14HANGZHOU HIKVISION SYST TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411282462.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2025-01-14
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

In SDN, due to the lack of flow table identification when the flow table is updated, the network device cannot process the received packets, resulting in network interruption and stability problems.

Method used

When re-establishing the communication connection, the first flow table identification of the network device is obtained, and a second flow table matching it is generated, and the second flow table and the flow table deletion request are sent to ensure that the network device deletes the old flow after receiving the new flow table tables to avoid network interruption.

Benefits of technology

Improves the stability of traffic table updates in SDN, preventing network devices from being unable to process packets due to the old traffic table not being deleted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118802743B_ABST
    Figure CN118802743B_ABST
Patent Text Reader

Abstract

The embodiment of the present application is applicable to the field of network communication technology, and provides a flow table update method, device, network system and electronic device, the method comprising: when re-establishing a communication connection with a network device, obtaining a first flow table identifier of a first flow table stored locally by the network device and generated before establishing a communication connection with the control end; and generating a second flow table matching the network device; the second flow table is provided with a second flow table identifier different from the first flow table identifier; sending the second flow table and a flow table deletion request to the network device; the flow table deletion request is generated by the control end based on the first flow table identifier; the flow table deletion request is used to instruct the network device to delete the first flow table. The embodiment of the present application can improve the stability of SDN during the flow table update process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application belong to the field of network communication technology, and in particular, relate to a flow table updating method, device, network system and electronic equipment. Background Art

[0002] Software Defined Network (SDN) is a network architecture that separates the control plane from the data forwarding plane to achieve dynamic and programmable control of network traffic. The data plane is mainly composed of network devices such as switches, which are responsible for the fast forwarding of data packets. The control plane contains the SDN controller, which is responsible for the management and policy formulation of the entire network.

[0003] OpenFlow is a communication protocol standard that allows SDN controllers to communicate with network devices such as switches and routers. A flow table is a data structure defined in the OpenFlow protocol. It is essentially a set of rules. Each rule in the flow table defines the matching conditions and corresponding operations of the data packet.

[0004] In the related art, since the flow table identifier (default cookie) is not set in the flow table, the SDN controller can only send a new flow table to the online device by deleting the old flow table stored in the network device to complete the update of the flow table. Before the network device deletes the old flow table and receives the new flow table, the network device cannot process the received messages, resulting in network interruption. Summary of the invention

[0005] In view of this, embodiments of the present application provide a flow table updating method, an apparatus, a network system, an electronic device, and a storage medium to improve the stability of SDN during the flow table updating process.

[0006] A first aspect of an embodiment of the present application provides a flow table updating method, which is applied to a control end, and the method includes:

[0007] When re-establishing a communication connection with the network device, obtaining a first flow table identifier of a first flow table generated before establishing a communication connection with the control end and stored locally in the network device; and generating a second flow table matching the network device; the second flow table is provided with a second flow table identifier different from the first flow table identifier;

[0008] The second flow table and a flow table deletion request are sent to the network device; the flow table deletion request is generated by the control end based on the first flow table identifier; the flow table deletion request is used to instruct the network device to delete the first flow table.

[0009] A second aspect of an embodiment of the present application provides a flow table updating method, which is applied to a network device, and the method includes:

[0010] When re-establishing a communication connection with the control end, sending a first flow table identifier in a first flow table generated before establishing a communication connection with the control end and stored locally to the control end;

[0011] receiving a second flow table and a flow table deletion request sent by the control end; the flow table deletion request is generated by the control end based on the first flow table identifier;

[0012] In response to the flow table deletion request, the first flow table is deleted.

[0013] A third aspect of an embodiment of the present application provides a flow table updating device, located at a control end, the device comprising:

[0014] A first flow table identifier acquisition module is used to acquire a first flow table identifier of a first flow table generated before establishing a communication connection with the control terminal and stored locally in the network device when re-establishing a communication connection with the network device; and generate a second flow table matching the network device; the second flow table is provided with a second flow table identifier different from the first flow table identifier;

[0015] A flow table and request sending module is used to send the second flow table and a flow table deletion request to the network device; the flow table deletion request is generated by the control end based on the first flow table identifier; the flow table deletion request is used to instruct the network device to delete the first flow table stored locally.

[0016] A fourth aspect of an embodiment of the present application provides a flow table updating device, located in a network device, the device comprising:

[0017] A first flow table identifier sending module, configured to send the first flow table identifier in the first flow table generated before establishing the communication connection with the control end and stored locally to the control end when re-establishing the communication connection with the control end;

[0018] A flow table and request receiving module, used for receiving a second flow table and a flow table deletion request sent by the control end; the flow table deletion request is generated by the control end based on the first flow table identifier;

[0019] The first flow table deleting module is used to delete the first flow table in response to the flow table deletion request.

[0020] A fifth aspect of the embodiments of the present application provides a network system, including a control terminal and a network device;

[0021] The network equipment includes:

[0022] A first flow table identifier sending module, configured to send the first flow table identifier in the first flow table generated before establishing the communication connection with the control end and stored locally to the control end when re-establishing the communication connection with the control end;

[0023] The control terminal comprises:

[0024] A first flow table identifier acquisition module is used to acquire a first flow table identifier of a first flow table generated before establishing a communication connection with the control terminal and stored locally in the network device when re-establishing a communication connection with the network device; and generate a second flow table matching the network device; the second flow table is provided with a second flow table identifier different from the first flow table identifier;

[0025] A flow table and request sending module, used for sending the second flow table and a flow table deletion request to the network device; the flow table deletion request is generated by the control end based on the first flow table identifier;

[0026] The network device also includes:

[0027] A flow table and request receiving module, used for receiving the second flow table and the flow table deletion request sent by the control end;

[0028] The first flow table deleting module is used to delete the first flow table in response to the flow table deletion request.

[0029] The sixth aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the flow table update method as described in the first aspect or the second aspect above is implemented.

[0030] A seventh aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the flow table updating method as described in the first aspect or the second aspect above is implemented.

[0031] An eighth aspect of the embodiments of the present application provides a computer program product. When the computer program product runs on a computer, the computer executes the flow table updating method described in the first aspect or the second aspect.

[0032] Compared with the related art, the embodiments of the present application have the following beneficial effects:

[0033] In an embodiment of the present application, when a communication connection is re-established with a network device, a first flow table identifier of a first flow table generated before a communication connection is established with the control end and stored locally in the network device is obtained; and a second flow table matching the network device is generated; the second flow table is provided with a second flow table identifier different from the first flow table identifier; the second flow table and a flow table deletion request are sent to the network device; the flow table deletion request is generated by the control end based on the first flow table identifier; the flow table deletion request is used to instruct the network device to delete the first flow table, so that when the control end in the SDN re-establishes a communication connection with the network device, the newly generated second flow table can be sent to the network device first, and after the network device completes receiving the second flow table, the first flow table stored before the above-mentioned communication connection is re-established is deleted, thereby avoiding the situation in the related art where the locally stored flow table is cleared first and then the new flow table is received, resulting in the network device being unable to process the received message, thereby improving the stability of the SDN during the flow table update process. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0035] Figure 1 is a schematic diagram of a flow table updating method provided in an embodiment of the present application;

[0036] Figure 2 This is a schematic diagram of an interaction process between an SDN controller and a switch provided in an embodiment of the present application;

[0037] Figure 3 is a schematic diagram of another flow table updating method provided in an embodiment of the present application;

[0038] Figure 4 is a schematic diagram of a flow table updating device provided in an embodiment of the present application;

[0039] Figure 5 is a schematic diagram of another flow table updating device provided in an embodiment of the present application;

[0040] Figure 6 is a schematic diagram of a network system provided in an embodiment of the present application;

[0041] Figure 7 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0043] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0044] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0045] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0046] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0047] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0048] The embodiments of the present application relate to network devices in SDN (including but not limited to routers and switches), and control terminals for managing network devices (for example, SDN controllers (control programs), or servers with SDN controllers deployed). The network devices are used to forward or process received messages according to the flow tables stored therein. The control terminal can update the flow tables stored in the network devices, including adding flow tables or deleting flow tables. The control terminal can communicate with one or more network devices in the same SND.

[0049] The technical solution of the present application is described below through specific embodiments.

[0050] Reference Figure 1 , shows a schematic diagram of a flow table updating method provided in an embodiment of the present application, which may specifically include the following steps:

[0051] Step 101, when re-establishing a communication connection with a network device, obtaining a first flow table identifier of a first flow table locally stored in the network device and generated before establishing a communication connection with the control terminal; and generating a second flow table matching the network device;

[0052] The second flow table is provided with a second flow table identifier which is different from the first flow table identifier.

[0053] In the case of power failure of network devices, shutdown or restart of SDN controllers, power failure of servers, etc., the communication connection between network devices and control terminals will be disconnected, resulting in at least partial network interruption. During the network interruption, the hardware or software in SDN may change. Therefore, after the communication connection is reestablished, the flow table in the network device needs to be updated to prevent the network device from receiving a message that cannot be forwarded or processed according to its currently stored flow table, resulting in the inability to process the message or requiring more time to process the message.

[0054] The control end and the network device may store a flow table, which is composed of multiple flow table entries, one of which is used to record a flow table identifier (such as the first flow table identifier and the second flow table identifier mentioned above). The control end and the network device may distinguish the flow table based on the flow table identifier.

[0055] After the control end and any one side of the network device are restarted, it is necessary to reconnect the communication connection with the other end. When the communication connection is reestablished, the control end needs to obtain the flow table identifier of the flow table currently stored locally by the network device, that is, the first flow table identifier. Since the network device locally stores the first flow table when the communication connection is reestablished, the first flow table is the flow table stored before the network is interrupted, and the first flow table needs to be refreshed.

[0056] In one example, the control end can obtain the first flow table sent by the network device, and read the flow table identifier in the first flow table to obtain the first flow table identifier. In another example, the control end directly obtains the flow table identifier of the flow table currently stored by the network device to obtain the first flow table identifier, without obtaining the entire first flow table, thereby reducing unnecessary data transmission.

[0057] In a specific implementation, the control end may send a first flow table acquisition request to the network device, and the network device sends the first flow table to the control end in response to the first flow table acquisition request.

[0058] Different network devices may need to implement different functions. For example, different network devices may need to process different messages, and the same network device may not process different messages in the same way. Therefore, when refreshing the flow table stored in the network device, it is necessary to generate a flow table that matches the function of the different network devices, and determine that the regenerated flow table is the second flow table.

[0059] The second flow table identifier of the second flow table regenerated after the network interruption is different from the first flow table identifier. Since the first flow table identifier is the flow table identifier of the first flow table stored by the network device before the network device sends the regenerated flow table at the control end, the control end can determine that the first flow table corresponding to the first flow table identifier is the flow table generated before the communication connection with the network device is re-established, and the second flow table corresponding to the second flow table identifier is the flow table generated after the communication connection with the network device is re-established.

[0060] Step 102: Send the second flow table and a flow table deletion request to the network device.

[0061] The flow table deletion request is generated by the control end based on the first flow table identifier; the flow table deletion request is used to instruct the network device to delete the first flow table stored locally.

[0062] As can be seen from the above, the second flow table generated by the control end after obtaining the first flow table identifier is the flow table regenerated after the control end and the network device reestablish the communication connection, that is, the new flow table that the network device needs to use, so the control end sends the second flow table and the flow table deletion request to the network device. The embodiment of the present application does not limit the order of sending the second flow table and the flow table deletion request.

[0063] As an example, the control end first sends the second flow table and then sends the flow table deletion request. After the control end sends the second flow table to the network device, if the control end confirms that the network device has received (completed receiving) the second flow table, a flow table deletion request is generated based on the first flow table identifier, and the flow table deletion request including the first flow table identifier is sent to the network device. The network device can recognize the flow table deletion request and delete the flow table currently stored therein corresponding to the first flow table identifier in the flow table deletion request, thereby deleting the first flow table locally therein.

[0064] Since the network device deletes the first flow table originally stored locally before the communication connection is re-established only after receiving the second flow table newly generated by the control end, during the process of updating the flow table stored in the network device by the control end, it avoids the situation in the related technology where the locally stored flow table is cleared before receiving the new flow table, resulting in the network device being unable to process the received message.

[0065] As another example, the control end may send the second flow table and the flow table deletion request at the same time. As another example, the control end may send the flow table deletion request first and then send the second flow table. It is only necessary for the network device to respond to the flow table deletion request to delete the first flow table stored locally after receiving the second flow table.

[0066] In an embodiment of the present application, when a communication connection is re-established with a network device, a first flow table identifier of a first flow table generated before a communication connection is established with a control end and stored locally on the network device is obtained; and a second flow table matching the network device is generated; the second flow table is provided with a second flow table identifier different from the first flow table identifier; the second flow table and a flow table deletion request are sent to the network device; the flow table deletion request is generated by the control end based on the first flow table identifier; the flow table deletion request is used to instruct the network device to delete the first flow table stored locally, so that when the control end in the SDN re-establishes a communication connection with the network device, the newly generated second flow table can be sent to the network device first, and after the network device completes receiving the second flow table, the first flow table stored before the above-mentioned communication connection is re-established is deleted, thereby avoiding the situation in the related art where the locally stored flow table is cleared first and then the new flow table is received, resulting in the network device being unable to process the received message, thereby improving the stability of the SDN during the flow table update process.

[0067] In some embodiments of the present application, generating a second flow table matching the network device may include: determining a network service corresponding to the network device; determining a feature flow table entry matching the network service; generating a second flow table identifier corresponding to the network service; and generating a second flow table based on the feature flow table entry and the second flow table identifier.

[0068] Different network devices can provide different network services, such as one or more of a virtual switch, a virtual router, and a load balancer. The controller can determine the network services corresponding to the one or more network devices for reestablishing the communication connection, and generate a second flow table for the network services corresponding to each network device, so that when the network device receives the message, it can implement the network service provided by it according to the second flow table.

[0069] The network services provided by the network device can be predetermined. The embodiments of the present application do not limit the network services provided by the network device and the method of determining the network services provided by the network device. The type of network services and the determination method do not affect the implementation of the embodiments of the present application.

[0070] Different network services correspond to different feature flow table items. For any network service, the feature flow table items at least include the necessary flow table items to implement the network service (including but not limited to: matching domain, action, priority), and flow table items for storing flow table identifiers. The flow table item for storing the flow table identifier can be a "Cookie" item. The second flow table identifier is used to distinguish different network services, record the second flow table identifier in the "Cookie" item, add the second flow table identifier to the second flow table, and generate the second flow table based on the feature flow table item and the second flow table identifier, so that the network service corresponding to the second flow table can be distinguished by the second flow table identifier.

[0071] It can be understood that the above only uses the second flow table as an example to illustrate the generation process of the flow table. The generation process of the first flow table is similar to that of the second flow table. The main difference lies in the different generation time of the two. For the generation process of the first flow table, refer to the process of generating the second flow table, which will not be repeated here.

[0072] In some embodiments of the present application, before sending the flow table deletion request to the network device, the method further includes:

[0073] receiving a flow table adding completion message from the network device, wherein the flow table adding completion message indicates that the network device has received the second flow table;

[0074] In response to the flow table adding completion message, a flow table deleting request is generated based on the first flow table identifier.

[0075] In the above example where the control end first sends the second flow table and then sends the flow table deletion request, after the control end sends the second flow table to the network device, the network device can determine whether it has completed receiving the second flow table sent by the control end. After confirming that it has completed receiving the second flow table sent by the control end, the network device can generate a flow table addition completion message and send the flow table addition completion message to the control end. When the control end receives the flow table addition completion message, it determines that the network device has received (completed receiving) the second flow table, and then generates a flow table deletion request based on the first flow table identifier.

[0076] Since the network device can delete the response flow table in response to the flow table deletion request, by confirming that the network device has completed receiving the second flow table before sending the flow table deletion request to the network device, the situation where the network device cannot process the received messages is reduced, thereby improving the stability of SDN.

[0077] In other embodiments of the present application, since the control end first obtains the first flow table identifier and then sends the second flow table, the control end can generate a flow table deletion request based on the first flow table identifier before determining that the network device has received the second flow table, and after determining that the network device has received the second flow table, send the flow table deletion request to the network device, so that the network device deletes the first flow table it stores after completing receiving the second flow table.

[0078] In a specific implementation, the control end may send a second flow table adding request to the network device, and the network device receives and stores the second flow table sent by the control end in response to the second flow table adding request.

[0079] In some embodiments of the present application, generating the second flow table identifier corresponding to the network service includes: determining an allocatable identifier range corresponding to the network service; and determining the second flow table identifier in the allocatable identifier range according to a preset method.

[0080] The allocatable identifier range may be pre-set for each network service, and the allocatable identifier ranges of each network service do not overlap. When the second flow table needs to be generated, the second flow table identifier is determined in the allocatable identifier range corresponding to the network service in a preset manner. The preset manner may include but is not limited to random generation, rolling generation, etc.

[0081] Since the allocatable identifier ranges corresponding to different network services do not overlap, the network service corresponding to the second flow table can be determined through the second flow table identifier. Furthermore, the second flow table identifier can be used to implement network service granularity processing on the second flow table, including but not limited to sending or regenerating the second flow table for a specified network service.

[0082] In some embodiments of the present application, before generating the second flow table based on the feature flow table entry and the second flow table identifier, generating the second flow table matching the network device further includes: determining whether there is a first flow table identifier that is identical to the second flow table identifier; if so, for the network service that has the same first flow table identifier and the second flow table identifier, re-executing the generation of the second flow table identifier corresponding to the network service.

[0083] Since the first flow table is generated before the control end re-establishes the communication connection with the network device, and the second flow table is generated after the control end re-establishes the communication connection with the network device, in some special cases (for example, the same network service exists before and after the communication is re-established, and the first flow table identifier and the second flow table identifier corresponding to the same network service generated by the random generation method before and after the communication is re-established are the same), the server can identify the currently generated second flow table identifier before generating the second flow table based on the characteristic flow table item and the second flow table identifier. If there is a second flow table identifier that is the same as the first flow table identifier, the second flow table identifier is regenerated until the second flow table identifier is different from the first flow table identifier, so as to prevent the second flow table corresponding to the second flow table identifier that is the same as the first flow table identifier from being mistakenly deleted after the second flow table is subsequently sent to the network device and a flow table deletion request is sent to the network device. For example, the control end receives a first flow table identifier C1, C1 is within the allocable identifier range R1 of the network service NS1, and currently needs to generate a second flow table identifier C2 corresponding to the network service NS1 by random generation, that is, C2 is also within the allocable identifier range R1. At this time, there is a certain probability that C2=C1. If C1 and C2 are the same and the generated second flow table is sent directly to the network device, after the network device receives the second flow table and the flow table deletion request, since the flow table deletion request is used to instruct the network device to delete the flow table corresponding to the flow table identifier C1, the second flow table corresponding to C2 that is the same as C1 is mistakenly deleted, causing the network device to be unable to forward or process the message corresponding to the network service NS1. Therefore, when the control end recognizes that C2=C1, it regenerates C2 for the network service NS1 until C2 is different from C1.

[0084] In some other embodiments of the present application, in order to avoid the situation where the second flow table identifier is the same as the first flow table identifier, the flow table identifier can be generated in combination with the time dimension, and the generation of the second flow table identifier corresponding to the network service may include: determining the assignable identifier range corresponding to the network service, and there is no overlap in the assignable identifier ranges of each of the network services; determining the first element in the assignable identifier range according to a preset method; determining the current timestamp as the second element; and combining the first element and the second element to generate the second flow table identifier. In these embodiments, the generation process of the first flow table identifier and the second flow table identifier is the same and will not be repeated. The first element is determined in combination with the assignable identifier corresponding to the network service, and the flow table identifier is generated with the second element determined by the current timestamp, thereby introducing the second element corresponding to the time dimension in the flow table identifier, so that even if it corresponds to the same network service, the flow table identifiers generated at different times will not be the same.

[0085] In some embodiments of the present application, sending the second flow table to the network device includes: if there are multiple second flow tables, determining the update priority of the multiple second flow tables according to the priority of the network service corresponding to the second flow table identifier; and sending the multiple second flow tables to the network device in an order corresponding to the update priority.

[0086] In SDN, different network services may have different priorities according to actual needs. Since different network services correspond to different second flow table identifiers, the network service corresponding to the second flow table can be determined by the second flow table identifier, and then the update priority of the second flow table can be determined in combination with the priority of the network service. If there are multiple second flow tables that need to be sent, multiple second flow tables can be sent to the network device in order from high to low priority.

[0087] In some embodiments of the present application, the update priority of the multiple second flow tables is determined based on the priority of the network service corresponding to the second flow table identifier, including: determining the update priority of the second flow tables corresponding to different network services according to the priority corresponding to the network service; if there is a second flow table corresponding to the same network service, then determining the update priority of the multiple second flow tables corresponding to the same network service according to preset sorting information.

[0088] Different network services have different priorities, and the update priority of the second flow table can be determined according to the priority of the network service. For example, the second flow tables generated by the control end include the second flow table FT1 corresponding to the network service NS1, and the second flow table FT2 corresponding to the network service NS2. If the priority of the network service NS1 is higher than that of the network service NS2, it is determined that the priority of the second flow table FT1 is higher than that of the second flow table FT2.

[0089] In actual applications, among the several second flow tables generated by the control end, there may be a situation where multiple second flow tables correspond to the same network service. For example, the several second flow tables generated by the control end include the second flow table FT1 corresponding to the network service NS1, and the second flow table FT2, the second flow table FT3, and the second flow table FT4 corresponding to the network service NS2. If the priority of the network service NS1 is higher than that of the network service NS2, it is determined that the priority of the second flow table FT1 is higher than that of the second flow table FT2, the second flow table FT3, and the second flow table FT4. For the multiple second flow tables (second flow table FT2, second flow table FT3, and second flow table FT4) corresponding to the same network service, their update priority can be determined according to the preset sorting information. For example, according to the preset sorting information, the update priority of the second flow table FT2, the second flow table FT3, and the second flow table FT4 is determined to be the second flow table FT3, the second flow table FT4, and the second flow table FT2, respectively. Then, the update priority of the several second flow tables generated by the control end is the second flow table FT1, the second flow table FT3, the second flow table FT4, and the second flow table FT2, respectively.

[0090] As an example, the preset sorting information may include, but is not limited to, one of the feature flow table item sorting and the generation time sequence of the second flow table.

[0091] The characteristic flow table entries are determined by the control end before generating the second flow table. The control end can store the characteristic flow table entries in a certain recording method (for example: constructing a table method, or establishing an index method). The update priority of multiple second flow tables corresponding to the same network service can be determined by the order of the characteristic flow table entries stored in this recording method.

[0092] The control end may also record the generation time of each second flow table during the process of generating the second flow table, and determine the update priority of multiple second flow tables corresponding to the same network service according to the order of the generation time.

[0093] As an example, the flow table identifier (the first flow table identifier and the second flow table identifier) ​​may be an integer character of a certain number of digits. For example, the flow table identifier may be a 64-bit integer.

[0094] In some embodiments of the present application, the control terminal is pre-set with configuration information; the configuration information includes the allocatable identification range corresponding to each of the network services.

[0095] The control end is pre-set with configuration information (for example, a configuration document), and the corresponding allocatable identifier ranges of different network services are stored in the configuration information. When generating a second flow table identifier, the control end can read the configuration information, determine the allocatable identifier corresponding to the network service for which the second flow table identifier needs to be generated, and determine the second flow table identifier in the allocatable identifier range in a preset manner.

[0096] The following uses the control end as an SDN controller and the network device as a switch as an example to further illustrate the embodiment of the present application. Figure 2 , shows a schematic diagram of an interaction process between an SDN controller and a switch provided in an embodiment of the present application; comprising the following steps:

[0097] Step 201: The SDN controller connects to the switch and sends a request to obtain an old OpenFlow flow table (first flow table) of a network service to the switch.

[0098] Step 202: The switch returns the old OpenFlow flow table of the network service, and the SDN controller parses the Cookie (first flow table identifier) ​​of the old OpenFlow flow table of the network service.

[0099] Step 203: Randomly regenerate a new Cookie value (second flow table identifier) ​​of the network service OpenFlow flow table of the switch from the Cookie range (allocatable identifier range) allocated to different service networks, and send a request to add the OpenFlow flow table to the switch.

[0100] Step 204: The switch successfully adds a new OpenFlow flow table and notifies the SDN controller that the OpenFlow flow table has been added. The cookie value (including the first flow table identifier and the second flow table identifier) ​​can distinguish the new OpenFlow flow table of the switch from the old OpenFlow flow table.

[0101] Step 205: Based on the old cookie of the network service obtained in step 202, the old cookie is used to accurately match the OpenFlow flow table.

[0102] Step 206: The switch successfully deletes the old OpenFlow flow table and notifies the SDN controller that the OpenFlow flow table has been deleted.

[0103] Reference Figure 3 , shows a schematic diagram of another flow table updating method provided in an embodiment of the present application, which may specifically include the following steps:

[0104] Step 301, when establishing a communication connection with a control end, sending a first flow table identifier of a first flow table stored locally and generated before establishing a communication connection with the control end to the control end;

[0105] Step 302, receiving a second flow table and a flow table deletion request sent by the control end;

[0106] The flow table deletion request is generated by the control end based on the first flow table identifier;

[0107] Step 303: In response to the flow table deletion request, delete the first flow table.

[0108] In some embodiments of the present application, before step 303, the embodiments of the present application may also include: generating a flow table adding completion message after receiving the second flow table; sending the flow table adding completion message to the control end, and the flow table adding completion message indicates that the network device has received the second flow table.

[0109] The interaction process between the control terminal and the network device has been clearly explained in the aforementioned embodiment, so the description of the embodiment of the present application is relatively simple. The specific process refers to the aforementioned embodiment and will not be repeated.

[0110] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0111] Reference Figure 4 , shows a schematic diagram of a flow table updating device provided in an embodiment of the present application, the device is located at the control end, and the device may specifically include a first flow table identifier acquisition module 401, a flow table and request sending module 402, wherein:

[0112] The first flow table identifier acquisition module 401 is used to acquire the first flow table identifier of the first flow table generated before the communication connection with the control terminal is established and stored locally in the network device when re-establishing the communication connection with the network device; and generate a second flow table matching the network device; the second flow table is provided with a second flow table identifier different from the first flow table identifier;

[0113] The flow table and request sending module 402 is used to send the second flow table and a flow table deletion request to the network device; the flow table deletion request is generated by the control end based on the first flow table identifier; the flow table deletion request is used to instruct the network device to delete the first flow table stored locally.

[0114] In some embodiments of the present application, the first flow table identifier acquisition module 401 may include:

[0115] A network service determination submodule, used to determine the network service corresponding to the network device;

[0116] A feature flow table entry determination submodule, used to determine a feature flow table entry matching the network service;

[0117] A second flow table identifier generating submodule, used to generate a second flow table identifier corresponding to the network service;

[0118] The second flow table generating submodule is used to generate a second flow table based on the characteristic flow table entry and the second flow table identifier.

[0119] In some embodiments of the present application, the device may further include:

[0120] a flow table adding completion message receiving module, configured to receive a flow table adding completion message from the network device, wherein the flow table adding completion message indicates that the network device has received the second flow table;

[0121] The flow table adding completion message response module is used to generate a flow table deletion request based on the first flow table identifier in response to the flow table adding completion message.

[0122] In some embodiments of the present application, the second flow table identifier generating unit may include:

[0123] The allocatable identifier range determining subunit is used to determine the allocatable identifier range corresponding to the network service, and the allocatable identifier ranges of the network services do not overlap;

[0124] The second flow table identifier determination subunit is used to determine the second flow table identifier in the allocatable identifier range according to a preset method.

[0125] In some other embodiments of the present application, the second flow table identifier generating unit may include:

[0126] The allocatable identifier range determining subunit is used to determine the allocatable identifier range corresponding to the network service, and the allocatable identifier ranges of the network services do not overlap;

[0127] A first element determination subunit, configured to determine a first element in the allocable identifier range according to a preset method;

[0128] A second element determination subunit, used to determine the current timestamp as the second element;

[0129] The element combining subunit is used to combine the first element and the second element to generate a second flow table identifier.

[0130] In some embodiments of the present application, the first flow table identifier acquisition module 401 further includes:

[0131] The flow table identifier judgment submodule is used to judge whether there is a first flow table identifier that is the same as the second flow table identifier; if there is a first flow table identifier that is the same as the second flow table identifier, then for the network service with the same first flow table identifier and second flow table identifier, the second flow table identifier generation submodule is called.

[0132] In some embodiments of the present application, the flow table and request sending module may include:

[0133] An update priority determination submodule, for determining the update priority of the plurality of second flow tables according to the priority of the network service corresponding to the second flow table identifier if there are a plurality of second flow tables;

[0134] The second flow table sending submodule is used to send the second flow table to the network device in an order corresponding to the update priority.

[0135] In some embodiments of the present application, the update priority determination submodule includes:

[0136] A first priority determination unit, used to determine the update priority of the second flow table corresponding to different network services according to the priority corresponding to the network service;

[0137] The second priority determination unit is used to determine the update priority of multiple second flow tables corresponding to the same network service according to preset sorting information if there are second flow tables corresponding to the same network service.

[0138] In some embodiments of the present application, the control terminal is pre-set with configuration information; the configuration information includes the allocatable identification range corresponding to each of the network services.

[0139] Reference Figure 5 , shows a schematic diagram of another flow table updating device provided in an embodiment of the present application, the device is located in a network device, and the device may specifically include a first flow table identification sending module 501, a flow table and request receiving module 502, and a first flow table deleting module 503, wherein:

[0140] A first flow table identifier sending module 501, configured to send the first flow table identifier in the locally stored first flow table to the control end when re-establishing a communication connection with the control end;

[0141] A flow table and request receiving module 502, configured to receive a second flow table and a flow table deletion request sent by the control terminal;

[0142] The first flow table deleting module 503 is configured to delete the first flow table in response to the flow table deletion request.

[0143] In some embodiments of the present application, the device may further include:

[0144] A flow table adding completion message generating module, configured to generate a flow table adding completion message after receiving the second flow table;

[0145] The flow table adding completion message sending module is used to send the flow table adding completion message to the control end, and the flow table adding completion message indicates that the network device has received the second flow table.

[0146] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.

[0147] Reference Figure 6 , shows a schematic diagram of a network system provided in an embodiment of the present application, the system includes a control terminal 601 and a network device 602, wherein:

[0148] The network device 602 includes:

[0149] The first flow table identifier sending module 501 is used to send the first flow table identifier in the first flow table generated before the communication connection with the control end is established and stored locally to the control end 601 when the communication connection with the control end is re-established;

[0150] The control terminal 601 includes:

[0151] The first flow table identifier acquisition module 401 is used to acquire the first flow table identifier of the first flow table stored locally by the network device 602 and generated before the communication connection with the control terminal 601 is established when re-establishing the communication connection with the network device 602; and generate a second flow table matching the network device 602; the second flow table is provided with a second flow table identifier different from the first flow table identifier;

[0152] The flow table and request sending module 402 is used to send the second flow table and the flow table deletion request to the network device 602; the flow table deletion request is generated by the control end based on the first flow table identifier;

[0153] The network device 602 further includes:

[0154] A flow table and request receiving module 502, configured to receive a second flow table and a flow table deletion request sent by the control terminal;

[0155] The first flow table deleting module 503 is configured to delete the first flow table in response to the flow table deletion request.

[0156] In the above network system, one or more network devices 602 may be provided.

[0157] For the system embodiment, since the control end 601 includes a flow table update device located at the control end, the description is relatively simple, and the relevant parts can be referred to the description of the device embodiment part; since the network device 602 includes a flow table update device located at the network device, the description is relatively simple, and the relevant parts can be referred to the description of the device embodiment part.

[0158] Reference Figure 7 , shows a schematic diagram of an electronic device provided by an embodiment of the present application. Figure 7 As shown, the electronic device 700 in the embodiment of the present application includes: a processor 710, a memory 720, and a computer program 721 stored in the memory 720 and executable on the processor 710. When the processor 710 executes the computer program 721, the steps in each embodiment of the above-mentioned flow table update method are implemented, for example Figure 1 Alternatively, when the processor 710 executes the computer program 721, the functions of each module / unit in the above-mentioned device embodiments are realized, for example, Figure 4 The functions of the modules 401 to 402 shown, or Figure 5 Functions of modules 501 to 503 are shown.

[0159] Exemplarily, the computer program 721 may be divided into one or more modules / units, which are stored in the memory 720 and executed by the processor 710 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which may be used to describe the execution process of the computer program 721 in the electronic device 700. For example, the computer program 721 may be divided into a first flow table identifier acquisition module, a flow table and request sending module, and the specific functions of each module are as follows:

[0160] A first flow table identifier acquisition module is used to acquire a first flow table identifier of a first flow table generated before establishing a communication connection with the control terminal and stored locally in the network device when re-establishing a communication connection with the network device; and generate a second flow table matching the network device; the second flow table is provided with a second flow table identifier different from the first flow table identifier;

[0161] A flow table and request sending module is used to send the second flow table and a flow table deletion request to the network device; the flow table deletion request is generated by the control end based on the first flow table identifier; the flow table deletion request is used to instruct the network device to delete the first flow table stored locally.

[0162] Alternatively, the computer program 721 may be divided into a first flow table identifier sending module, a flow table deletion request receiving module, and a first flow table deletion module, and the specific functions of each module are as follows:

[0163] A first flow table identifier sending module, configured to send the first flow table identifier in the first flow table generated before establishing the communication connection with the control end and stored locally to the control end when re-establishing the communication connection with the control end;

[0164] A flow table and request receiving module, used for receiving a second flow table and a flow table deletion request sent by the control end; the flow table deletion request is generated by the control end based on the first flow table identifier;

[0165] The first flow table deleting module is used to delete the first flow table in response to the flow table deletion request.

[0166] The electronic device 700 may be the control terminal 601 or the network device 602 in the above-mentioned embodiments. The electronic device 700 may include, but is not limited to, a processor 710 and a memory 720. Those skilled in the art will understand that Figure 7 It is only an example of the electronic device 700 and does not constitute a limitation of the electronic device 700. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 700 may also include input and output devices, network access devices, buses, etc.

[0167] The processor 710 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0168] The memory 720 may be an internal storage unit of the electronic device 700, such as a hard disk or memory of the electronic device 700. The memory 720 may also be an external storage device of the electronic device 700, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 700. Further, the memory 720 may also include both an internal storage unit of the electronic device 700 and an external storage device. The memory 720 is used to store the computer program 721 and other programs and data required by the electronic device 700. The memory 720 may also be used to temporarily store data that has been output or is to be output.

[0169] The embodiment of the present application further discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the flow table updating method as described in the above-mentioned embodiments is implemented.

[0170] The embodiment of the present application further discloses a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the flow table updating method described in the above-mentioned embodiments.

[0171] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A flow table updating method, characterized in that: Applied to the control end, the method includes: When re-establishing a communication connection with the network device, obtaining a first flow table identifier of a first flow table generated before establishing a communication connection with the control end and stored locally in the network device; and generating a second flow table matching the network device for a network service provided by the network device; the second flow table is provided with a second flow table identifier different from the first flow table identifier; Sending the second flow table and a flow table deletion request to the network device; the flow table deletion request is generated by the control end based on the first flow table identifier; the flow table deletion request is used to instruct the network device to delete the first flow table; Wherein, different network devices provide different network services; the control terminal is provided with a distributable identification range corresponding to each network service; and the generating of the second flow table matching the network device includes: Determining a network service corresponding to the network device; Determine the allocatable identifier range corresponding to the network service, where the allocatable identifier ranges of the network services do not overlap; Determine a second flow table identifier in the allocatable identifier range in a preset manner; Determine a feature flow table entry that matches the network service; the feature flow table entry includes a necessary flow table entry for implementing the network service and a flow table entry for storing a flow table identifier; Generate a second flow table based on the characteristic flow table entry and the second flow table identifier; The determining the second flow table identifier in the allocatable identifier range in a preset manner includes: Determine a first element in the assignable identifier range in a preset manner; Determine the current timestamp as the second element; The first element and the second element are combined to generate a second flow table identifier.

2. The method according to claim 1, characterized in that The sending the second flow table to the network device includes: If there are multiple second flow tables, determining the update priority of the multiple second flow tables according to the priority of the network service corresponding to the second flow table identifier; The plurality of second flow tables are sent to the network device in an order corresponding to the update priority.

3. The method according to claim 2, characterized in that The step of determining the update priority of the plurality of second flow tables according to the priority of the network service corresponding to the second flow table identifier includes: Determining the update priority of the second flow table corresponding to different network services according to the priority corresponding to the network service; If there are second flow tables corresponding to the same network service, the update priorities of the plurality of second flow tables corresponding to the same network service are determined according to the preset sorting information.

4. A flow table updating method, characterized in that: Applied to a network device, the method comprises: When re-establishing a communication connection with the control end, sending a first flow table identifier in a first flow table generated before establishing a communication connection with the control end and stored locally to the control end; receiving a second flow table and a flow table deletion request sent by the control end; the flow table deletion request is generated by the control end based on the first flow table identifier; the second flow table is provided with a second flow table identifier different from the first flow table identifier; the second flow table is generated by the control end for the network service provided by the network device; In response to the flow table deletion request, deleting the first flow table; Wherein, different network devices provide different network services; the control end is provided with an assignable identifier range corresponding to each network service; and the second flow table is generated by the control end through the following method: Determining a network service corresponding to the network device; Determine the allocatable identifier range corresponding to the network service, where the allocatable identifier ranges of the network services do not overlap; Determine a second flow table identifier in the allocatable identifier range in a preset manner; Determine a feature flow table entry that matches the network service; the feature flow table entry includes a necessary flow table entry for implementing the network service and a flow table entry for storing a flow table identifier; Generate a second flow table based on the characteristic flow table entry and the second flow table identifier; The determining the second flow table identifier in the allocatable identifier range in a preset manner includes: Determine a first element in the assignable identifier range in a preset manner; Determine the current timestamp as the second element; The first element and the second element are combined to generate a second flow table identifier.

5. A flow table updating device, characterized in that: Located at the control end, the device includes: A first flow table identifier acquisition module is used to acquire a first flow table identifier of a first flow table stored locally by the network device and generated before establishing a communication connection with the control terminal when re-establishing a communication connection with the network device; and generate a second flow table matching the network device for a network service provided by the network device; the second flow table is provided with a second flow table identifier different from the first flow table identifier; A flow table and request sending module, used to send the second flow table and a flow table deletion request to the network device; the flow table deletion request is generated by the control end based on the first flow table identifier; the flow table deletion request is used to instruct the network device to delete the first flow table stored locally. Wherein, different network devices provide different network services; the control terminal is provided with a distributable identification range corresponding to each network service; and the second flow table is generated by the following submodules: A network service determination submodule, used to determine the network service corresponding to the network device; A feature flow table item determination submodule, used to determine a feature flow table item that matches the network service; the feature flow table item includes a necessary flow table item to implement the network service, and a flow table item for storing a flow table identifier; A second flow table identifier generating submodule, used to generate a second flow table identifier corresponding to the network service; A second flow table generating submodule, configured to generate a second flow table based on the characteristic flow table entry and the second flow table identifier; The second flow table identifier generation submodule includes: The allocatable identifier range determining subunit is used to determine the allocatable identifier range corresponding to the network service, and the allocatable identifier ranges of the network services do not overlap; The second flow table identifier determination subunit is used to determine the second flow table identifier in the allocatable identifier range according to a preset method.

6. A flow table updating device, characterized in that: Located in a network device, the apparatus comprises: A first flow table identifier sending module, configured to send the first flow table identifier in the first flow table generated before establishing the communication connection with the control end and stored locally to the control end when re-establishing the communication connection with the control end; a flow table and request receiving module, configured to receive a second flow table and a flow table deletion request sent by the control end; the flow table deletion request is generated by the control end based on the first flow table identifier; the second flow table is provided with a second flow table identifier different from the first flow table identifier; the second flow table is generated by the control end for the network service provided by the network device; A first flow table deleting module, configured to delete the first flow table in response to the flow table deletion request; Wherein, different network devices provide different network services; the control end is provided with a distributable identification range corresponding to each network service; and the second flow table is generated by the following submodules in the control end: A network service determination submodule, used to determine the network service corresponding to the network device; A feature flow table item determination submodule, used to determine a feature flow table item that matches the network service; the feature flow table item includes a necessary flow table item to implement the network service, and a flow table item for storing a flow table identifier; A second flow table identifier generating submodule, used to generate a second flow table identifier corresponding to the network service; A second flow table generating submodule, configured to generate a second flow table based on the characteristic flow table entry and the second flow table identifier; The second flow table identifier generation submodule includes: The allocatable identifier range determining subunit is used to determine the allocatable identifier range corresponding to the network service, and the allocatable identifier ranges of the network services do not overlap; The second flow table identifier determination subunit is used to determine the second flow table identifier in the allocatable identifier range according to a preset method.

7. A network system, characterized in that: Including control terminal and network equipment; The network equipment includes: A first flow table identifier sending module, configured to send the first flow table identifier in the first flow table generated before establishing the communication connection with the control end and stored locally to the control end when re-establishing the communication connection with the control end; The control terminal comprises: A first flow table identifier acquisition module is used to acquire a first flow table identifier of a first flow table stored locally by the network device and generated before establishing a communication connection with the control terminal when re-establishing a communication connection with the network device; and generate a second flow table matching the network device for a network service provided by the network device; the second flow table is provided with a second flow table identifier different from the first flow table identifier; A flow table and request sending module, used for sending the second flow table and a flow table deletion request to the network device; the flow table deletion request is generated by the control end based on the first flow table identifier; The network device also includes: A flow table and request receiving module, used for receiving the second flow table and the flow table deletion request sent by the control end; A first flow table deleting module, configured to delete the first flow table in response to the flow table deletion request; Wherein, different network devices provide different network services; the control terminal is provided with a distributable identification range corresponding to each network service; and the second flow table is generated by the following submodules: A network service determination submodule, used to determine the network service corresponding to the network device; A feature flow table item determination submodule, used to determine a feature flow table item that matches the network service; the feature flow table item includes a necessary flow table item to implement the network service, and a flow table item for storing a flow table identifier; A second flow table identifier generating submodule, used to generate a second flow table identifier corresponding to the network service; A second flow table generating submodule, configured to generate a second flow table based on the characteristic flow table entry and the second flow table identifier; The second flow table identifier generation submodule includes: The allocatable identifier range determining subunit is used to determine the allocatable identifier range corresponding to the network service, and the allocatable identifier ranges of the network services do not overlap; The second flow table identifier determination subunit is used to determine the second flow table identifier in the allocatable identifier range according to a preset method.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the flow table updating method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Flow table processing method and device

    CN104601470A