Background
Interpretation of terms:
the software defined network is a novel network architecture, which separates the data plane and the control plane of the traditional network, thereby realizing the programmable control of the bottom layer forwarding hardware through the software platform of the integrated controller.
The OpenFlow protocol is a communication protocol between a data plane and a control plane in a software-defined network, and a controller of the control plane instructs a switch of the data plane how to forward a network packet through rules and actions defined by the OpenFlow protocol.
The flow table is a table structure similar to a conventional network routing table defined in the OpenFlow protocol, and is composed of several flow table entries. The flow table entry is composed of a rule and an action set, and if the network packet conforms to the rule defined by the flow table entry, the packet is executed with a corresponding action, such as: forwarding or modifying the source and destination IP addresses from a certain port, etc.
The group table is a special flow table defined by the OpenFlow protocol, and is composed of a plurality of group entries. Each group entry includes: a group entry identifier, a group entry type, a group entry counter, and an action bucket set. The group entry type determines the semantics of the group entry, such as: a group entry of the all type indicates that all actions in the group entry action bucket set are to be performed, while a group entry of the select type indicates that only one action in the group entry action bucket set is to be performed. The action bucket set comprises a plurality of action buckets, and each action bucket represents a processing which can be carried out on a network data packet, such as: forwarding or modifying certain fields of the packet from a certain port, etc.
Flow cluster (Flowlet) refers to a set of packets having a correlation in the same TCP flow, where the correlation is: if the time interval between any two adjacent packets arriving at the same switch is less than the predefined timeout value, the packets satisfying this condition are considered as a set, called a stream cluster.
The flow cluster switching (Flowlet switching) is a routing switching technology with flow clusters as granularity, packets belonging to the same flow cluster can be forwarded from the same port, and different flow clusters can randomly select a forwarding port. The timeout value is usually defined as the maximum value of the delay difference between multiple paths in the multi-path forwarding technique, so that the TCP reordering phenomenon is not caused.
The stream cluster switching is an important routing switching technology and is applied to the field of load balancing. Because the timeout values for distinguishing different stream clusters are set to be larger than the delay difference of any two load balancing parallel paths, the load balancing based on the stream clusters cannot cause the packet out-of-sequence, the performance of the TCP can be improved, and the throughput of the network can be improved. Meanwhile, the load balancing is realized simply by using the route switching mechanism, and extra congestion control information is not needed, such as: the congestion situation of a certain current link. The load balancing based on the stream cluster switching has self-adaptive load balancing capability, namely, the network traffic can be approximately proportionally distributed to each link according to the bandwidth of the link.
The implementation of a routing switching mechanism based on cluster switching at the hardware level generally requires a dedicated switching chip for support, such as: cisco (cisco) implemented this switch mechanism in a self-developed hardware switch. The software layer implementation is generally based on an open-source software switch OpenvSwitch or a programmable software switch P4, but such implementation generally causes the absence of other switching functions of the switch, and becomes a software switch that only supports a cluster switching routing mechanism. At present, no implementation scheme which can perfectly interface with the software defined network exists.
The OpenFlow protocol defined group table in the software defined network provides us with additional forwarding capabilities, such as: we can implement support for multicast routing using group tables of all type. This forwarding capability provided by the group table does not disrupt other forwarding mechanisms supported by the OpenFlow protocol, such as: and (4) a forwarding mode based on rule matching of the flow table entry. The routing forwarding mechanism expanded through the group table cannot influence the original forwarding mechanism of the OpenFlow protocol, and belongs to a supplement to the routing forwarding mechanism in the OpenFlow protocol. The invention realizes the stream cluster exchange by the group table selection algorithm, which is a perfect solution for realizing the stream cluster exchange routing mechanism in the software defined network.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide an OpenFlow group table selection algorithm which can support a routing switching mechanism based on cluster switching under the condition of not changing the original software-defined network data plane forwarding mechanism. Therefore, the invention adopts the technical scheme that the method for selecting the OpenFlow group table of the cluster exchange routing mechanism comprises the following steps:
1) a controller of a software defined network control plane senses the topology of an underlying network and calculates a plurality of reachable paths from source network equipment to target network equipment;
2) the controller takes each reachable port of the switch on the reachable path as an action bucket of a group table entry and issues the action bucket to each switch in the form of the group table entry;
3) initializing last arrival time hash table: the hash table records the time of the current last packet of each flow arriving at the switch;
4) initializing last departure time hash table: the hash table records the output port of the current last packet of each flow;
5) initialization timeout value timeout: the timeout value is used for distinguishing different stream clusters and is larger than the maximum delay difference of a plurality of load balancing parallel paths;
6) when a port of the switch receives a data packet, calculating the hash value hash _ key of the packet according to a quintuple comprising an ingress port, a source IP address, a destination IP address, a source port and a destination port, and recording the arrival time of the packet at the switch, namely the arrival time of the packet at the switch.
7) If the last arrival time hash table does not have a record with the keyword being the hash _ key, adding the record arrival corresponding to the keyword hash _ key into the last arrival time hash table; randomly selecting a port indicated by an action bucket from the action bucket set of the group table item corresponding to the packet as an output port output _ port, adding a record output _ port corresponding to the keyword hash _ key to a last leaving time hash table, and executing the following step 11, otherwise, executing the following step 8;
8) obtaining a last time record last _ time of the arrival at the switch of the last packet of the flow to which the packet belongs, corresponding to the key hash _ key, from the last arrival time hash table, updating the record corresponding to the key hash _ key in the last departure time hash table as the arrival time, and if the arrival time arrive _ time-the last time record last _ time of the arrival at the switch of the packet is greater than or equal to timeout, executing the following step 9; otherwise, the following step 10 is executed;
9) randomly selecting a port indicated by a bucket of the action bucket from the action bucket set of the group table item corresponding to the packet as an output port output _ port, adding a record output _ port corresponding to the keyword hash _ key to the last output port last _ output _ port hash table, and executing the following step 11;
10) obtaining an egress port record of a previous packet of the flow to which the packet belongs corresponding to the key hash _ key from the last _ output _ port hash table as an output _ port, and executing the following step 11;
11) the packet is sent from the port with port number output _ port of the switch to the next hop, and step 6 is performed.
The specific steps in one example are:
1) in the underlying network topology, the TCP sending end is IP:10.0.0.1Port:3301, the TCP receiving end is IP:10.0.0.2Port:3302, and there are two reachable paths between the receiving and sending ends, which are:
and
2) the software defined network controller issues the group entries to each switch, which issues to switch S1 the group entries as follows:
group_id=1,type=select,selection_method=flowlet_switching,bucket=output:2,bucket=output:3
3) initialize last _ array _ time hash table: the hash table records the time of the current last packet of each flow arriving at the switch;
4) initializing last _ outout _ port hash table: the hash table records the output port of the current last packet of each flow;
5) initialization timeout value timeout: the timeout value is used for distinguishing different stream clusters and is larger than the maximum delay difference of a plurality of load balancing parallel paths;
6) the data packet sent from the sender to the receiver is processed as follows on the switch S1 according to the group table selection algorithm
6.1.1) the switch S1 receives the first data packet from the sender, and calculates the hash value of the packet as hash _ key according to the quintuple, where the quintuple is: the ingress port is 1, the source IP address is 10.0.0.1, the destination IP address is 10.0.0.2, the source port is 3301, and the destination port is 3302;
6.1.2) there is no record with the key of 100 in the last _ annular _ time hash table, add the record annular _ time of the key 100 to the last _ annular _ time hash table as 867674 us. The following step 6.1.3 is performed;
6.1.3) randomly selecting a port indicated by an action bucket from the action bucket set of the group table item matched with the packet as an output port output _ port equal to 2, adding a record output _ port equal to 2 corresponding to the keyword 100 into a last _ output _ port hash table, and sending the packet from port No. 2 of the switch;
6.2.1) the switch S1 receives the second data packet from the sending end, calculates the hash value of the packet according to the quintuple, and records the arrival time of the packet at the switch, the arrival time of the packet at the switch;
6.2.2) obtaining a record of time that the key 100 corresponds to the first packet arriving at the switch, namely, last _ time 867674us from the last _ arrival _ time hash table, and updating the record corresponding to the key 100 in the last _ arrival _ time hash table to be equal to arrival _ time 868125 us; since this is true for the ambient _ time-last _ time of 451<500, the following step 6.2.3 is performed;
6.2.3) obtains the egress port record output _ port of the first packet corresponding to the key 100 from the last _ output _ port hash table as 2. The packet is sent out from port number 2 of the switch. (ii) a
6.3.1) the switch S1 receives the third data packet from the sending end, calculates the hash value of the packet according to the quintuple, and records the arrival time arive _ time of the packet at the switch;
6.3.2) get the record of the time that the key 100 corresponds to the second packet arriving at the switch from the last _ arrival _ time hash table. Updating a record corresponding to the keyword 100 in the last _ ambient _ time hash table as ambient _ time; since the arrival _ time-last _ time of 512>500 holds, the following step 6.3.3 is performed;
6.3.3) randomly selecting a port indicated by one action bucket from the action bucket set of the group table entry matched with the packet as an output port output _ port equal to 3, and adding a record output _ port equal to 3 corresponding to the keyword 100 into a last _ output _ port hash table; the packet is sent out from port number 3 of the switch.
The invention has the characteristics and beneficial effects that:
no matter a special hardware switching chip is used or a routing mechanism based on the current software switch solution is realized based on the flow cluster switching, the forwarding mode of the switch becomes single, so that the switch cannot be applied to a software defined network and cannot well support the OpenFlow protocol.
In order to solve the above problems, the present invention provides support for a flow cluster switching routing mechanism by expanding an OpenFlow protocol group table selection algorithm on the premise of not changing a normal forwarding mechanism of an OpenFlow protocol, and is an incremental implementation method, so that a software defined network is made possible by using a routing switch based on flow cluster switching.
Description of the drawings:
fig. 1 is a schematic flow chart of an OpenFlow group table selection algorithm supporting a cluster switch routing switch mechanism.
Figure 2 is a software defined network topology.
Detailed Description
The invention aims to provide an OpenFlow group table selection algorithm, which can realize a routing switching mechanism supporting flow cluster switching in a software-defined network data plane.
The technical scheme adopted by the invention for solving the technical problems is as follows:
1) a controller of a software defined network control plane senses underlying network topology and calculates a plurality of reachable paths between source network equipment and destination network equipment.
2) The controller takes each reachable port of the switch on the reachable path as an action bucket of the group table entry, and issues the action bucket to each switch in the form of the group table entry.
3) Initialize last _ array _ time hash table: the hash table records the time at which the current last packet of each flow arrives at the switch.
4) Initializing last _ outout _ port hash table: the hash table records the egress port of the current last packet of each flow.
5) Initialization timeout value timeout: the timeout value is used to distinguish between different flowlets and is typically greater than the maximum delay difference for load balancing multiple parallel paths.
6) When a port of the switch receives a data packet, calculating the hash value of the packet as a hash _ key according to the quintuple (an ingress port, a source IP address, a destination IP address, a source port and a destination port), and recording the arrival time of the packet at the switch, namely the arrival time of the packet at the switch.
7) If the record with the key being the hash _ key does not exist in the last _ annular _ time hash table, adding the record annular _ time corresponding to the key hash _ key into the last _ annular _ time hash table. A port indicated by one action bucket is randomly selected from the action bucket set of the group table item corresponding to the packet as an output port output _ port, a record output _ port corresponding to the keyword hash _ key is added to a last _ output _ port hash table, and the following step 11 is executed. Otherwise, the following step 8 is performed.
8) And obtaining a last _ time record of the arrival time of the last packet of the flow to which the packet belongs, corresponding to the key hash _ key, at the switch from the last _ array _ time hash table. And updating the record corresponding to the key hash _ key in the last _ ambient _ time hash table to be ambient _ time. If the ambient _ time-last _ time ≧ timeout holds, execute the following step 9; otherwise, the following step 10 is performed.
9) A port indicated by one action bucket is randomly selected from the action bucket set of the group table item corresponding to the packet as an output port output _ port, a record output _ port corresponding to the keyword hash _ key is added to a last _ output _ port hash table, and the following step 11 is executed.
10) And obtaining an output port record of the last packet of the flow to which the packet belongs corresponding to the key hash _ key from the last _ output _ port hash table as an output _ port. The following step 11 is performed.
11) The packet is sent from the port with port number output _ port of the switch to the next hop, and step 6 is performed.
The technical solution of the present invention will be described in detail with reference to the following embodiments. The OpenFlow group table selection algorithm of the present invention has a flow diagram as shown in fig. 1, and has the following specific operation steps:
1) assuming that the underlying network topology is as shown in FIG. 2, there are two reachable paths between the TCP sender (IP:10.0.0.1Port:3301) and the TCP receiver (IP:10.0.0.2Port:3302), which are:
and
2) the software defined network controller issues the group entries to each switch, which issues to switch S1 the group entries as follows:
group_id=1,type=select,selection_method=flowlet_switching,bucket=output:2,bucket=output:3
3) initialize last _ array _ time hash table: the hash table records the time when the current last packet of each flow arrives at the switch
4) Initializing last _ outout _ port hash table: the hash table records the egress port of the current last packet of each flow.
5) Initialization timeout value timeout: the timeout value is used to distinguish different clusters of streams and is generally greater than the maximum delay difference of the load balancing multiple parallel paths. In this example, it is assumed that the timeout value is 500 us.
6) Packets sent by the sender to the recipient (the first three packets are taken as an example) are processed as follows at switch S1 according to the group table selection algorithm (the processing flow at other switches is similar).
6.1.1) the switch S1 receives the first packet from the sender, and calculates the hash value of the packet as hash _ key according to the quintuple (ingress port is 1, source IP address is 10.0.0.1, destination IP address is 10.0.0.2, source port is 3301, destination port is 3302), and assumes that hash _ key is 100. The arrival time of the packet at the switch, arive _ time, is recorded as 867674 us.
6.1.2) there is no record with the key of 100 in the last _ annular _ time hash table, add the record annular _ time of the key 100 to the last _ annular _ time hash table as 867674 us. The following step 6.1.3 is performed.
6.1.3) randomly selecting a port indicated by one action bucket (bucket: output:2) from the group table entry action bucket set (bucket: output:2, bucket: output:3) matched by the packet as an output port output _ port: 2, and adding a record output _ port corresponding to the key 100 to a last _ output _ port hash table. The packet is sent out from port number 2 of the switch.
6.2.1) switch S1 receives the second packet from the sender, and calculates the hash value of the packet as 100 according to the quintuple (ingress port is 1, source IP address is 10.0.0.1, destination IP address is 10.0.0.2, source port is 3301, destination port is 3302). The arrival time of the packet at the switch, arive _ time, is recorded as 868125 us.
6.2.2) obtain the time record of the arrival of the first packet at the switch, corresponding to key 100, last _ time 867674us from the last _ arrival _ time hash table. The record corresponding to the key 100 in the last _ innovative _ time hash table is updated to be innovative _ time 868125 us. Since this holds true for the ambient _ time-last _ time of 451<500, the following step 6.2.3 is performed.
6.2.3) obtains the egress port record output _ port of the first packet corresponding to the key 100 from the last _ output _ port hash table as 2. The packet is sent out from port number 2 of the switch.
6.3.1) switch S1 receives the third packet from the sender, and calculates the hash value of the packet as 100 according to the quintuple (ingress port is 1, source IP address is 10.0.0.1, destination IP address is 10.0.0.2, source port is 3301, destination port is 3302). The arrival time of the packet at the switch, arive _ time, is recorded as 868637 us.
6.3.2) obtain from the last _ arrival _ time hash table the time record of the arrival of the second packet at the switch, which corresponds to key 100, 868125 us. The record corresponding to the key 100 in the last _ innovative _ time hash table is updated to be innovative _ time 868637 us. Since the arrival _ time-last _ time ═ 512>500 holds, the following step 6.3.3 is performed.
6.3.3) randomly selects a port indicated by one action bucket (bucket: output:3) from the group table entry action bucket set (bucket: output:2, bucket: output:3) matched by the packet as an output port output _ port:3, and adds the record output _ port:3 corresponding to the key 100 to the last _ output _ port hash table. The packet is sent out from port number 3 of the switch.