The disclosure relates to a Software Defined Network (SDN) technology, and in particular to a method, device and system for ageing a flow table based on the OpenFlow protocol, and a computer readable medium.
The SDN architecture separates, through the OpenFlow protocol adopted, a control plane and a forwarding plane of a network device to obtain a network controller representing the control plane and a switch representing the forwarding plane respectively. A method for forwarding a data packet in an SDN network based on the OpenFlow protocol is to forward the data packet using a flow table, in which the controller controls multiple switches through the standardized OpenFlow protocol, and issues the flow table to each switch; the switch receives and saves the flow table; and the switch forwards the data packet according to the flow table it saves, after receiving the data packet by the switch from the network.
However, each flow table occupies a certain memory space of the switch. If the switch accumulates the flow tables for a long time, a phenomenon of running out of the memory will occur. Thus, there is a life cycle (also called ageing time) for each flow table.
At present, the life cycle for each flow table takes time as a measure, so each flow table is aged based on the life cycle of time. But, the service providers generally charge users for provided data services according to the service traffic, thus in a case of charging according to the service traffic, ageing the flow table based on the life cycle of time will cause a large number of periodically inquiring messages between the controller and the switch; besides, the controller communicates with the switch through a Transmission Control Protocol (TCP) connection, so a large bandwidth consumption is caused, and periodically inquiring message will cause low charging precision and low real-time accuracy under the condition of taking data traffic as the charging standard.
Embodiments of the disclosure provide a method, device and system for ageing a flow table based on the OpenFlow protocol and a computer readable medium, which can reduce the bandwidth consumption caused by periodically inquiring messages between the controller and the switch in a case of taking data traffic as the charging standard, and improve the charging precision and the real-time accuracy.
The technical solutions of the embodiments of the disclosure are implemented as follows.
In the first aspect, the embodiment of the disclosure provides a method for ageing a flow table, the method may include:
In an embodiment, after receiving, by the switch, the configuration message for the flow table issued by the controller, and before setting, by the switch, the parameter value of the life cycle for the data volume of the flow table according to the configuration message for the flow table, the method further includes:
In an embodiment, after ageing the flow table by the switch, the method further includes:
In an embodiment, the notification of the flow table being aged further includes: a parameter value of a life cycle for a data volume remaining for the flow table, a hard timeout remaining for the flow table, and an idle timeout remaining for the flow table.
In the second aspect, the embodiment of the disclosure provides a method for ageing a flow table including:
In an embodiment, when the configuration message for the flow table includes information indicating a notification of the flow table being aged, the method further includes:
In an embodiment, the notification of the flow table being aged further includes: a parameter value of a life cycle for a data volume remaining for the flow table, a hard timeout remaining for the flow table, and an idle timeout remaining for the flow table.
In the third aspect, the embodiment of the disclosure provides a switch including: a receiving unit, a flow table setting unit and a flow table ageing unit,
In an embodiment, the switch further includes: a verifying unit configured to perform detection and verification of consistency of the configuration message for the flow table and to trigger the flow table setting unit, when determining that the configuration message for the flow table is correct.
In an embodiment, the switch further includes: a sending unit configured to send a notification of the flow table being aged to the controller when the configuration message for the flow table includes information indicating the notification of the flow table being aged, the notification of the flow table being aged including an ageing reason for representing that the data volume, for which matching is performed according to the flow table, reaches the parameter value of the life cycle for the data volume of the flow table.
In an embodiment, the notification of the flow table being aged further includes: a parameter value of a life cycle for a data volume remaining for the flow table, a hard timeout remaining for the flow table, and an idle timeout remaining for the flow table.
In the fourth aspect, the embodiment of the disclosure provides a controller including an encapsulating unit and a sending unit,
In an embodiment, the controller further includes a receiving unit configured to receive a notification of the flow table being aged which is sent by the switch, the notification of the flow table being aged including an ageing reason for representing that a data volume, for which matching is performed according to the flow table, reaches the parameter value of the life cycle for the data volume of the flow table.
In an embodiment, the notification of the flow table being aged further includes: a parameter value of a life cycle for a data volume remaining for the flow table, a hard timeout remaining for the flow table, and an idle timeout remaining for the flow table.
In the fifth aspect, the embodiment of the disclosure provides a system for ageing a flow table based on an OpenFlow protocol, including: a switch and a controller,
The disclosure also provides a computer readable medium in which an executable instruction is stored, the executable instruction being configured to perform any one of the above methods for ageing a flow table.
According to a method, device and system for ageing a flow table, and the computer readable medium provided by of the embodiments of the disclosure, which add a parameter Packet count of a life cycle for a data volume taking a data volume, for which matching is performed according to the flow table, as a measure, the switch can regard the data volume matched as another type of life cycle for the flow table; after completing the matching of fixed data volume through the flow table, the switch ages the flow table, thus it is applicable to an application scenario where the service providers charge users according to the service data traffic.
The technical solutions in the embodiments of the disclosure are clearly and completely described below in connection with the accompanying drawings.
As shown in
The embodiments of the disclosure add, in the existing structure of a flow table, a parameter, Packet count, of a life cycle for a data volume taking the data volume, for which matching is performed according to the flow table, as a measure, so that the switch can regard the data volume matched as another type of a life cycle for the flow table; after completion of the matching at fixed data volume by the switch by means of the flow table, the switch ages the flow table, so it is applicable to a scenario where the service providers charge users according to the service data traffic.
With reference to
At S201: a switch receives a configuration message for the flow table issued by a controller.
Exemplarily, in an SDN structure based on the OpenFlow protocol, the switch forwards a data packet according to the flow table issued by the controller. Thus, flow information issued by the controller in the present embodiment is called a flow table, and the configuration message for the flow table, as a carrier for the controller to issue the flow table, can include parameter values corresponding to the constituent parameters of the flow table issued by the controller; for example, the controller can issue a parameter value, Packet count, of a life cycle for a data volume of the flow table, and the parameter value, Packet count, of the life cycle for the data volume of the flow table is the maximum data volume, for which matching is performed by the switch according to the flow table.
It can be understood that the configuration message for the flow table further includes parameter values corresponding to the constituent parameters in the structure of the flow table shown in
At S202: the switch sets the parameter value of the life cycle for the data volume of the flow table according to the configuration message for the flow table.
Exemplarily, after receiving the configuration message for the flow table, the switch can also perform detection and verification of consistency of the configuration message for the flow table; when determining by the switch that the configuration message for the flow table is correct, the switch sets the parameter value of the life cycle for the data volume of the flow table according to the configuration message for the flow table.
Note that the configuration message for the flow table includes parameter values corresponding to the constituent parameters in the structure of the flow table shown in
It can be understood that after the switch sets the flow table, matching of data and packets can be performed according to the flow table, and the data volume, for which matching is performed by the switch according to the flow table, can be recorded in the matching process.
At S203: when the data volume, for which matching is performed by the switch according to the flow table, reaches the parameter value of the life cycle for the data volume of the flow table, the switch ages the flow table.
Exemplarily, the parameter, Packet count, of the life cycle for the data volume is similar to the parameters, hard timeout and idle timeout, of Timeouts, belonging to a life cycle for the flow table, thus the switch needs to age the flow table so as to reduce the memory space occupied by the flow table, when the parameter, Packet count, of the life cycle for the data volume of the flow table is reached.
Note that the switch ages the flow table with the parameter, Packet count, of the life cycle for the data volume, thereby the life cycle for the flow table is only related to the data volume, for which matching is performed by the switch according to the flow table, and is not related to the time for which the flow table is saved in the switch. Thus, the parameter, Packet count, of the life cycle for the data volume is more suitable for the data services that the service providers charge according to the traffic than the parameters, hard timeout and idle timeout, of Timeouts.
Note that the configuration message for the flow table can also include information indicating a notification of the flow table being aged, which is used for indicating the switch to notify the controller of the ageing reason after ageing the flow table.
Correspondingly, when the configuration message for the flow table includes the information indicating a notification of the flow table being aged, and after the switch ages the flow table because the data volume, for which matching is performed by the switch according to the flow table, reaches the parameter value of the life cycle for the data volume of the flow table, the switch can further send the notification of the flow table being aged to the controller, the notification of the flow table being aged includes an ageing reason for representing that the data volume, for which matching is performed by the flow table, reaches the parameter value of the life cycle for the data volume of the flow table.
In addition, the reason for ageing the flow table is that the parameter of the life cycle for the data volume expires, but is not that the parameters, hard timeout and idle timeout, of Timeouts expire, so the switch can also encapsulate the hard timeout remaining for the flow table and the idle timeout remaining for the flow table into the notification of the flow table being aged, so that the controller can synthesize the life cycles in dimensions of time and a data volume to provide a reference for the latter flow table setting.
In addition, when the reason for ageing the flow table is that the parameters, hard timeout and idle timeout, of Timeouts expire, the switch can also encapsulate the parameter value of the life cycle for the data volume remaining for the flow table into the notification of the flow table being aged.
Thus, the notification of the flow table being aged can also include: the parameter value of the life cycle for the data volume remaining for the flow table, the hard timeout remaining for the flow table and the idle timeout remaining for the flow table. It can be understood that when the reason for ageing the flow table is that the parameter of the life cycle for the data volume expires, the parameter value of the life cycle for the data volume remaining for the flow table, which is included in the notification of the flow table being aged, is 0.
The embodiments of the disclosure provide a method for ageing a flow table based on the OpenFlow protocol. The method adds a parameter, Packet count, of a life cycle for a data volume taking the data volume, for which matching is performed according to the flow table, as a measure, so that the switch can regard the data volume matched as another type of life cycle for the flow table; after completion the matching of fixed data volume by the switch according to the flow table, the switch ages the flow table, so the method is applicable to the application scenario where the service providers charge users according to the service data traffic.
At S401: the controller encapsulates a parameter value of a life cycle for a data volume of the flow table into a configuration message for the flow table.
Specifically, a parameter value, Packet count, of a life cycle for a data volume of the flow table can be the maximum data volume, for which matching is performed by the switch according to the flow table.
At S402: the controller issues the configuration message for the flow table to the switch.
Exemplarily, the configuration message for the flow table is arranged for the switch to set the flow table.
Note that in the SDN structure based on the OpenFlow protocol, the switch forwards the data packet according to the flow table issued by the controller. In the present embodiment, the flow information issued by the controller is called a flow table, and the configuration message for the flow table, as the carrier for the controller to issue the flow table, can include parameter values corresponding to the constituent parameters of the flow table issued by the controller. It can be understood that the configuration message for the flow table includes the parameter values corresponding to the constituent parameters in the structure of the flow table shown in
Note that the configuration message for the flow table can also include information indicating a notification of the flow table being aged, which is used for indicating the switch to notify the controller of the ageing reason after ageing the flow table.
Correspondingly, when the configuration message for the flow table includes the information indicating the notification of the flow table being aged, the controller can also receive the notification of the flow table being aged which is sent by the switch, and the notification of the flow table being aged includes an ageing reason for representing that the data volume, for which matching is performed according to the flow table, reaches the parameter value of the life cycle for the data volume of the flow table.
The reason for ageing the flow table is that the parameter of the life cycle for the data volume expires, but not that the parameters, hard timeout and idle timeout, of the Timeouts expire, so the switch can also encapsulate the hard timeout remaining for the flow table and the idle timeout remaining for the flow table into the notification of the flow table being aged. In addition, when the reason for ageing the flow table is that the parameter hard timeout or the parameter idle timeout of the Timeouts expires, the switch can also encapsulate a parameter value of a life cycle for a data volume remaining for the flow table into the notification of the flow table being aged; thus, the notification of the flow table being aged further includes: the parameter value of the life cycle for the data volume remaining for the flow table, the hard timeout remaining for the flow table and the idle timeout remaining for the flow table. It can be understood that when the reason for ageing the flow table is that the parameter value of the life cycle for the data volume expires, the parameter value of the life cycle for the data volume remaining for the flow table included in the notification of the flow table being aged is 0.
The present embodiment provides another method for ageing a flow table based on the OpenFlow protocol, which adds a parameter, Packet count, of a life cycle for a data volume taking the data volume, for which matching is performed according to the flow table, as a measure, so the switch can regard the data volume matched as another type of life cycle for the flow table; after completing the matching of fixed data volume through the flow table, the switch ages the flow table, so the method is applicable to the application scenario where the service providers charge users according to the service data traffic.
Based on the technical solutions described in the above embodiments,
At S501: the controller encapsulates a parameter value of a life cycle for a data volume of the flow table into a configuration message for the flow table,
Exemplarily, the configuration message for the flow table, as the carrier for the controller to issue the flow table, is a basis for the switch to set the flow table; the existing structure of the flow table is shown in
At S502: the controller issues the configuration message for the flow table to the switch.
Exemplarily, because the configuration message for the flow table is arranged for the switch to set the flow table. Note that the configuration message for the flow table can also include information indicating a notification of the flow table being aged, which is used for indicating the switch to notify the controller of an ageing reason after ageing the flow table.
At S503: the switch sets the parameter value of the life cycle for the data volume of the flow table according to the configuration message for the flow table.
Exemplarily, because the configuration message for the flow table includes parameter values corresponding to the constituent parameters in the structure of the flow table shown in
It can be understood that after the switch sets the flow table, matching of the data and packets can be performed according to the flow table, and the data volume, for which matching is performed by the switch according to the flow table, can be recorded in the matching process.
At Step 504: when the data volume, for which matching is performed by the switch according to the flow table, reaches the parameter value of the life cycle for the data volume of the flow table, the switch ages the flow table.
Exemplarily, the a parameter value, Packet count, of a life cycle for a data volume is similar to the parameters, hard timeout and idle timeout, of the Timeouts, belonging to a life cycle for the flow table, thus when the parameter value, Packet count, of the life cycle for the data volume of the flow table is reached, the switch needs to age the flow table, so as to reduce the memory space occupied by the flow table.
At S505: the switch sends a notification of the flow table being aged to the controller after ageing the flow table.
In the present embodiment, specifically, those skilled in the art can understand that when the flag OFPFF_SEND_FLOW_REM in the flow table is set, it means the switch needs to send the notification of the flow table being aged to the controller after ageing the flow table, so as to notify a reason for ageing the flow table.
In the present embodiment, the specific ageing notification message is OFPT_FLOW_REMOVED; the specific ofp_flow_removed structure for recording the notification content is shown below:
In addition, the reason for ageing the flow table is that the parameter of the life cycle for the data volume expires, but not that the parameters, hard timeout and idle timeout, of the Timeouts expire, so the switch can also encapsulate the hard timeout remaining for the flow table and the idle timeout remaining for the flow table into a notification of the flow table being aged. In addition, when the reason for ageing the flow table is that the parameter hard timeout or the parameter idle timeout of the Timeouts expires, the switch can also encapsulate a parameter value of a life cycle for a data volume remaining for the flow table into the notification of the flow table being aged; thus, the notification of the flow table being aged can also include: the parameter value of the life cycle for the data volume remaining for the flow table, the hard timeout remaining for the flow table and the idle timeout remaining for the flow table. In the specific ofp_flow_removed structure of the ageing notification message OFPT_FLOW_REMOVED, these three parameters uint64_t packet_count_overflow, uint16_t idle_timeout and uint16_t hard_timeout are set as the parameter value of the life cycle for the data volume remaining for the flow table, the idle timeout remaining for the flow table and the hard timeout remaining for the flow table respectively.
It can be understood that when the reason for ageing the flow table is that the parameter of the life cycle for the data volume expires, the parameter uint64_t packet_count_overflow in the ageing notification message OFPT_FLOW_REMOVED of the flow table is set as 0.
In the detailed flow of the method for ageing a flow table based on the OpenFlow protocol which is provided by the present embodiment, the switch ages the flow table through a parameter Packet count of a life cycle for a data volume, so that the life cycle for the flow table is only related to the data volume, for which matching is performed by the switch according to the flow table, and is not related to the time for which the flow table is saved in the switch. Thus, the parameter Packet count of the life cycle for the data volume is more suitable for the data services that the service providers charge according to the traffic, compared with the parameters, hard timeout and idle timeout, of the Timeouts.
Based on the same technical conception as those in the above embodiments,
Exemplarily, with reference to
Exemplarily, with reference to
In an embodiment, the notification of the flow table being aged further includes the parameter value of the life cycle for the data volume remaining for the flow table, the hard timeout remaining for the flow table and the idle timeout remaining for the flow table.
In practical applications, the receiving unit 601 can be realized by an interface board (also called board card) in the switch; the interface board is used for connecting a user terminal or the interface board of other network device; the interface board has various different types of network communication interfaces, such as a 100M bandwidth interface, a 1000M bandwidth interface, a 10G bandwidth interface, an ATM interface, an optical interface (for connecting an optical cable), and an electric interface (for connecting an electrical cable). The flow table setting unit 602, the flow table ageing unit 603 and the verifying unit 604 can be realized by a Central Processing Unit (CPU) or a Field Programmable Gate Array (FPGA) in the switch.
The present embodiment provides a switch 60, which adds a parameter Packet count of a life cycle for a data volume taking the data volume, for which matching is performed according to the flow table, as a measure, so the switch 60 can regard the data volume matched as another type of life cycle for the flow table; after completing the matching of fixed data volume through the flow table, the switch 60 ages the flow table, so the switch is applicable to the application scenario where the service providers charge users according to the service data traffic.
With reference to
The encapsulating unit 801 is configured to encapsulate the parameter value of the life cycle for the data volume of the flow table into the configuration message for the flow table.
The sending unit 802 is configured to issue the configuration message for the flow table encapsulated by the encapsulating unit to the switch, and the configuration message for the flow table is arranged for the switch to set the flow table.
Exemplarily, with reference to
In an embodiment, the notification of the flow table being aged further includes the parameter value of the life cycle for the data volume remaining for the flow table, the hard timeout remaining for the flow table and the idle timeout remaining for the flow table.
The encapsulating unit 801 can be realized by a microprocessor or an FPGA in the controller; the sending unit 802 and the receiving unit 803 can be realized by the interface board (also called board card) in the controller; the interface board is used for connecting a user terminal or the interface board of other network device; the interface board has various different types of network communication interfaces, such as a 100M bandwidth interface, a 1000M bandwidth interface, a 10G bandwidth interface, an ATM interface, an optical interface (for connecting an optical cable), and an electric interface (for connecting an electrical cable).
The present embodiment provides a controller 80, which adds a parameter Packet count of a life cycle for a data volume taking the data volume, for which matching is performed according to the flow table, as a measure, so the switch 60 can regard the data volume matched as another type of life cycle for the flow table; after completing the matching of fixed data volume through the flow table, the switch 60 ages the flow table, so the controller is applicable to the application scenario where the service providers charge users according to the service data traffic.
Based on the same technical conception as those in the above embodiments, FIG. 10 shows a system 100 for ageing a flow table based on the OpenFlow protocol which is provided by the embodiments of the disclosure. The system 100 includes the switch 60 and the controller 80.
The switch 60 is configured to:
The controller 80 is configured to:
As an implementation, the controller 80 is further configured to receive a notification of the flow table being aged which is sent by the switch 60, the notification of the flow table being aged including an ageing reason for representing that the data volume, for which matching is performed according to the flow table, reaches the parameter value of the life cycle for the data volume of the flow table.
As an implementation, the switch 60 is further configured to perform detection and verification of consistency of the configuration message for the flow table, and set the parameter value of the life cycle for the data volume of the flow table according to the received configuration message for the flow table, when determining that the configuration message for the flow table is correct.
As an implementation, the switch 60 is further configured to send a notification of the flow table being aged to the controller, when the configuration message for the flow table includes the information indicating the notification of the flow table being aged, the notification of the flow table being aged including an ageing reason for representing that a data volume, for which matching is performed according to the flow table, reaches the parameter value of the life cycle for the data volume of the flow table.
As an implementation, the notification of the flow table being aged further includes the parameter value of the life cycle for the data volume remaining for the flow table, the hard timeout remaining for the flow table and the idle timeout remaining for the flow table.
The present embodiment provides a system 100 for ageing a flow table based on the OpenFlow protocol, which adds a parameter Packet count of a life cycle for a data volume taking the data volume, for which matching is performed according to the flow table, as a measure, so the switch 60 can regard the data volume matched as another type of life cycle for the flow table; after completing the matching of fixed data volume through the flow table, the switch 60 ages the flow table, so the system is applicable to the application scenario where the service providers charge users according to the service data traffic.
Those skilled in the art should understand that the embodiments of the disclosure can provide a method, a system or a computer program product. Thus, forms of hardware embodiments, software embodiments or embodiments combining software and hardware can be adopted in the disclosure. Moreover, a form of the computer program product implemented on one or more computer available storage media (including, but not limited to, a magnetic disk memory, an optical memory and the like) containing computer available program codes can be adopted in the disclosure.
The disclosure is described with reference to flowcharts and/or block diagrams of the method, the device (system) and the computer program product according to the embodiments of the disclosure. It should be understood that each flow and/or block in the flowcharts and/or the block diagrams and a combination of the flows and/or the blocks in the flowcharts and/or the block diagrams can be realized by computer program instructions. These computer program instructions can be provided for a general computer, a dedicated computer, an embedded processor or other programmable data processing device to generate a machine, so that a device for realizing functions designated in one or more flows of the flowcharts and/or one or more blocks of the block diagrams is generated via instructions executed by the computers or the processors of the other programmable data processing devices.
These computer program instructions can also be stored in a computer readable memory capable of guiding the computers or the other programmable data processing devices to work in a specific mode, so that a manufactured product including an instruction apparatus is generated via the instructions stored in the computer readable memory, and the instruction apparatus realizes the functions designated in one or more flows of the flowcharts and/or one or more blocks of the block diagrams.
These computer program instructions can also be loaded to the computers or the other programmable data processing devices, so that processing realized by the computers is generated by executing a series of operation steps on the computers or the other programmable devices, and therefore the instructions executed on the computers or the other programmable devices provide a step for realizing the functions designated in one or more flows of the flowcharts and/or one or more blocks of the block diagrams.
What are described above are only the particular embodiments of the disclosure and are not intended to limit the scope of protection of the disclosure.
Number | Date | Country | Kind |
---|---|---|---|
201410457670.6 | Sep 2014 | CN | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2014/094638 | 12/23/2014 | WO | 00 |