6.3 Algorithm for concurrent consistent per-flow updates
6.3.4 Algorithm at the control plane
The control plane (CP) of the switch exchanges messages with the controller and config- ures the data plane (DP) of the switch, as shown in Figure 6.1. The stateful lists that are used by the CP and the DP to realize Proflow, the indices used for those lists, the values each item may take and their purpose, are shown in Table 6.2. In the description of algorithms, these lists are not always shown with their indices. The table also shows which entity writes values into each item and which entity reads the values. The value of T associated with each rule is used by the rule to compare packet time stamp values. It is initialized to Tmax, for every rule. The value of rule type associated with each rule is initialized toU, indicating that the rule is unaffected. This section specifies the algorithm for the control plane, at the controller and at each si∈S in Figure 6.1. The message ex- changes below are the same as in the algorithms in previous chapters ; the parameters in
Table 6.2: Stateful lists used by the affected and ingress switches Variable
[index]
Used by
Written by
Read by
Values Initial value
Purpose
T [n] si Controller DP 0 to Tmax Tmax To compare with the packet time stamp to decide label of a packet
rule type [n]
si Controller DP N EW, OLD
or U
U Indicates the type of rule
state [d hash]
si DP DP N EW F L,
OLD F L
OLD F L Indicates the type of flow
prev t [d hash]
si DP DP 0 to Tmax 0 Stores the time stamp of a packet as it exits
a switch live f l
[V]
si DP CP 0 to Tmax 0 Indicates if there are any old flows alive, us- ing a packet time stamp.
ev [V] si CP DP ST ART,
ST OP
ST OP Indicates if DP must update live f l
Tp [V] si Controller CP 0 to Tmax Tmax If the inter-packet delay is less than this value, an old flow is considered alive
TRC [V] si Controller CP 0 to Tmax Ti Time at which Ready To Commit was sent.
Used to distinguish new and old flows
V [n] si Controller CP 0 to K 0 Version number of an RU
126
istate [hash]
ingress DP DP N EW F L,
U F L
U F L Indicates type of flow
itstamp [hash]
ingress DP DP 0 to Tmax 0 The time stamp of SYN
DP: Switch Data Plane, CP: Switch Control Plane,n: rule number, v: RU identifier, Tmax: 1 less than the maximum value the item can hold,Ti: Current time at switchi,hash: Hash of the 5-tuple (with the same value for forward and reverse flows),d hash: Hash of the 5-tuple (with a different value for forward and reverse flows),si: an affected switch,K: Maximum number of simultaneous RUs
127
them and the actions upon receiving them have been modified for a PFC update.
1. The Controller, upon receiving an RU from the application, with S, and Roi and Rni for every si∈S, sends a “Commit” to every si∈S with v, Roi and Rni. v is a unique RU identifier, used only between the controller and the switches.
2. The CP of every switch si∈S receives “Commit”, a) installs the Rni rules with a higher priority thanRoi rules, b) changes the installedRoi rules to check if a packet is labelledOLDporUp by changing their match fields (Rnirules check if an incoming packet is labelledN EWp orUp), c) sets rule type of the Roi rules as OLD and Rni rules as N EW, d) sets V of each affected rule to v, denoted by V[n]=v. V[n] is henceforth referred to asV. e) sets T of each affected rule toTmax, f) sends “Ready to Commit” with Ti and g) sets TRC[V]=Ti. The above actions, per changed rule, must be atomic.
3. The controller, upon receiving “Ready to Commit” from all si∈S, updates Tlast to reflect the largestTireceived and sends “Commit OK” to allsi∈S, withTlast andtp. As long as the inter-packet delay of an old flow is less thantp, the flow is considered alive.
4. Upon receiving “Commit OK”, the switch CP a) sets Tp[V]=tp b) sets T=Tlast in Roi and Rni c) sets ev to ST ART, to inform the DP that it has to begin updating live f l[V] (explained subsequently) to indicate that there are live old flows and d) starts a timer of value 2∗ Tp. All the above actions after receiving Commit OK are atomic, per rule. Upon expiry of the timer, if live f l[V] has increased from the previous time it was checked, there are live old flows, in which case the timer is restarted. Otherwise, it considers all the old flows complete, sets ev to ST OP and sends “Ack Commit OK” to the controller, with Ti.
5. Upon receiving “Ack Commit OK” from all si∈S, the controller sets the largest of Ti received in “Ack Commit OK” to Tdel. It sends “Discard Old” to all si∈S with Tdel.
6. Upon receiving “Discard Old”, the switch CP starts a timerTdel+M−Ti, whereM is the maximum lifetime of a packet within the network. When the timer expires, as
all the packets that were switched using Roi are no longer in the network, the switch deletes Roi. It marks all the rules inRni as unaffected by setting their rule type to U and modifies their match fields such that they cease to check for the packet label N EWp. T need not be initialised to Tmax as packets matching unaffected rules do not check for T. Next, it sends “Discard Old Ack” to the controller. the update at the switch is complete.
7. After the controller receives “Discard Old Ack” from allsi∈S, the RU is complete at the controller. After M units after timer expiry at the lastsi∈S, the last of packets that have label set to N EWp are no longer in the network. Now the next update not disjoint with the current one may begin.