• Tidak ada hasil yang ditemukan

Proof of the Algorithm

We need to prove that the algorithms in section 4.3 together provide PPC updates.

p is an affected packet with a label label, that can take the values Up, N EWp or OLDp, indicating if the packet is unaffected, new or old respectively.

Let us assume that the individual algorithms at the data and control planes are correct. Let us assume that switches are synchronized, to make descriptions easier and that no conflicting RUs occur. However, the controller-switch links may have variable delays and the switches may have varying execution speeds.

Case 1:sf has not received Commit and so it is unaware of an update. At timeTf, packet p arrives with time stamp T Sp. T Sp≤Tf by definition (T Sp was the time at the ingress switch when the packet left it andsf may be an ingress). It will match with some existing (old) rule, and the packet will be forwarded. label will remain Up. So phas been handled by old rules. Now, is it possible that some switch downstream of sf uses new

rules onp? This is not possible.

Suppose a new rule has been installed in a downstream switch, say sp, and either Commit has been received (T=Tmax for all affected rules), or both Commit and Commit OK have been received (T=Tlast for all affected rules). Now when p matches a new rule, the check in line4 of Algorithm4 will find that T Sp<T of the new rule. If only Commit has been received, T=Tmax, and T Sp<Tmax by definition, for anyT Sp. At time Tf, since sf has not received Commit, it has not received Commit OK. Tlast is the largest of the values of time received in Ready To Commit sent by all the affected switches, including sf. Hence Tlast>Tf. Since Tf≥T Sp, it follows that T Sp<Tlast. So label of packet p will be made OLDp (line 11 of Algorithm 4) and a match with an old or unaffected rule will take place. Once a packet is labelled OLDp, it is always handled by old rules (line 16 of Algorithm4) as long as old rules exist, and so all subsequent switches will also handle p with old rules.

Case 2: sf has received Commit but not Commit OK. sf will have new rules, but in all of themT=Tmax. So, as discussed above,sf will find that T Sp<T in any new rule, and old rules will apply.label of p will be made OLDp (line 11of Algorithm 4). Once so labelled, all subsequent switches will use old rules on p.

Case 3: sf has received both Commit and Commit OK.sf will match pwith a new rule, and if T Sp≥T, it will apply the new rule and set the label to N EWp (line 21 of Algorithm4). Once a packet is labelledN EWp, all subsequent switches will use new rules irrespective of the value of T and T Sp (line 21). All subsequent switches will have new rules already installed since Commit OK has been received by sf, and this can happen only if all affected switches have received Commit and have sent Ready to Commit (steps 2 and 3 of Figure4.1) to the Controller.

If sf finds thatT Sp<T, it will use old rules, and change the label toOLDp. Similar to earlier cases, all subsequent switches will now use old rules.

The above cases will hold as long as both old rules and new rules co-exist in the affected switches. Old rules are discarded and checking for rule type ceases once a timer with time Tm expires at a switch. Once sf receives Commit OK, it sends Ack Commit OK with the current time to the controller (step 4 of Figure 4.1). Once the controller receives Ack Commit OK from all switches, it sends a Discard Old message withTdel set to the time of the last Ack Commit OK sent (step 5 of Figure 4.1). The timer value Tm

is then set by each switch as Tdel+M −Ti, to account for the elapsed time from Tdel to Ti. After time Tdel, no packet with time stamp greater than Tdel will be switched with old rules. So the last packet to be using old rules will have T Sp≤Tdel. By definition the maximum lifetime of a packet in the network is M. So after timeTdel+M, no old packet will be there in the network and so the old rules can be deleted. This ensures that old rules are not discarded prematurely. Packets with label N EWp will still be there in the network, but since switches will have converted the new rules to type U, the new rules will continue to apply.

It has to be ensured though, that the next conflicting update does not start too soon so that a packet with label N EWp (but of the previous update) is not erroneously handled. To take care of this, the next update is not started until after another time period of M has elapsed. No packet will have its label set to N EWp if its time stamp T Sp>Tdel+M , since new rules will no longer exist at any switch. Waiting for time M will ensure that all such new packets leave the network before the next update begins.

Part II

Per-Flow Consistent Updates

Chapter 5

EPCU-SRT: Enhanced Per-Flow Consistent Updates

5.1 Introduction

We have examined in detail in chapter2the need to preserve per-flow consistency (PFC).

In this chapter, an algorithm, EPCU-SRT, to preserve PFC to address the concerns during Server Load Balancing (section2.8.4chapter2) and to prevent packet re-ordering (section 2.8.5in chapter2) is presented. This algorithm assumes that when the path of a flow in a network is changed, the sequence of stateful switches and the NF instances (middleboxes) through which the flow is being routed, and the instances themselves, are not changed (waypoint invariance is maintained).